text:
(function (global, factory) {
  if (typeof define === "function" && define.amd) {
    define(['exports'], factory);
  } else if (typeof exports !== "undefined") {
    factory(exports);
  } else {
    var mod = {
      exports: {}
    };
    factory(mod.exports);
    global.String = mod.exports;
  }
})(this, function (exports) {
  'use strict';

  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  var camelize = exports.camelize = function camelize(str) {
    return str.split(' ').map(function (word) {
      return word.charAt(0).toUpperCase() + word.slice(1);
    }).join('');
  };
});


text:
package com.intellij.codeInsight.daemon.impl.analysis.encoding;

import com.intellij.lang.ASTNode;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiReference;
import com.intellij.psi.PsiReferenceProvider;
import com.intellij.psi.xml.XmlAttributeValue;
import com.intellij.psi.xml.XmlChildRole;
import com.intellij.util.ProcessingContext;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;

/**
 * @author cdr
 */
public class XmlEncodingReferenceProvider extends PsiReferenceProvider {
  private static final Logger LOG = Logger.getInstance(XmlEncodingReferenceProvider.class);
  @NonNls private static final String CHARSET_PREFIX = "charset=";

  @Override
  public PsiReference @NotNull [] getReferencesByElement(@NotNull PsiElement element, @NotNull final ProcessingContext context) {
    LOG.assertTrue(element instanceof XmlAttributeValue);
    XmlAttributeValue value = (XmlAttributeValue)element;

    return new PsiReference[]{new XmlEncodingReference(value, value.getValue(), xmlAttributeValueRange(value), 0)};
  }

  protected static TextRange xmlAttributeValueRange(final XmlAttributeValue xmlAttributeValue) {
    ASTNode valueNode = XmlChildRole.ATTRIBUTE_VALUE_VALUE_FINDER.findChild(xmlAttributeValue.getNode());
    PsiElement toHighlight = valueNode == null ? xmlAttributeValue : valueNode.getPsi();
    TextRange childRange = toHighlight.getTextRange();
    TextRange range = xmlAttributeValue.getTextRange();
    return childRange.shiftRight(-range.getStartOffset());
  }

  public static PsiReference[] extractFromContentAttribute(final XmlAttributeValue value) {
    String text = value.getValue();
    int start = text.indexOf(CHARSET_PREFIX);
    if (start != -1) {
      start += CHARSET_PREFIX.length();
      int end = text.indexOf(';', start);
      if (end == -1) end = text.length();
      String charsetName = text.substring(start, end);
      TextRange textRange = new TextRange(start, end).shiftRight(xmlAttributeValueRange(value).getStartOffset());
      return new PsiReference[]{new XmlEncodingReference(value, charsetName, textRange, 0)};
    }
    return PsiReference.EMPTY_ARRAY;
  }
}

redpajama_set_name: RedPajamaGithub


text:
package com.intellij.openapi.actionSystem;

import javax.annotation.Nonnull;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class CompositeShortcutSet implements ShortcutSet {
  private final ShortcutSet[] mySets;

  public CompositeShortcutSet(ShortcutSet... sets) {
    mySets = sets;
  }

  @Override
  @Nonnull
  public Shortcut[] getShortcuts() {
    List<Shortcut> result = new ArrayList<Shortcut>();
    for (ShortcutSet each : mySets) {
      Collections.addAll(result, each.getShortcuts());
    }
    return result.toArray(new Shortcut[result.size()]);
  }
}


text:
package day10;

public interface Turkey {
	void gobble();
	void fly();
}


text:
"""Mongodb implementations of learning searches."""

# pylint: disable=no-init
#     Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods,too-few-public-methods
#     Number of methods are defined in specification
# pylint: disable=protected-access
#     Access to protected methods allowed in package mongo package scope
# pylint: disable=too-many-ancestors
#     Inheritance defined in specification

from .. import utilities
from ...abstract_osid.learning import searches as abc_learning_searches
from dlkit.mongo.osid import searches as osid_searches

class ObjectiveSearch(abc_learning_searches.ObjectiveSearch, osid_searches.OsidSearch):
    """``ObjectiveSearch`` defines the interface for specifying objective search options."""

    @utilities.arguments_not_none
    def search_among_objectives(self, objective_ids):
        """Execute this search among the given list of objectives.

        arg:    objective_ids (osid.id.IdList): list of objectives
        raise:  NullArgument - ``objective_ids`` is ``null``
        *compliance: mandatory -- This method must be implemented.*

        """
        raise errors.Unimplemented()

    @utilities.arguments_not_none
    def order_objective_results(self, objective_search_order):
        """Specify an ordering to the search results.

        arg:    objective_search_order
                (osid.learning.ObjectiveSearchOrder): objective search
                order
        raise:  NullArgument - ``objective_search_order`` is ``null``
        raise:  Unsupported - ``objective_search_order`` is not of this
                service
        *compliance: mandatory -- This method must be implemented.*

        """
        raise errors.Unimplemented()

    @utilities.arguments_not_none
    def get_objective_search_record(self, objective_search_record_type):
        """Gets the objective search record corresponding to the given objective search record ``Type``.

        This method is used to retrieve an object implementing the
        requested record.

        arg:    objective_search_record_type (osid.type.Type): an
                objective search record type
        return: (osid.learning.records.ObjectiveSearchRecord) - the
                objective search record
        raise:  NullArgument - ``objective_search_record_type`` is
                ``null``
        raise:  OperationFailed - unable to complete request
        raise:  Unsupported -
                ``has_search_record_type(objective_search_record_type)``
                is ``false``
        *compliance: mandatory -- This method must be implemented.*

        """
        raise errors.Unimplemented()

class ObjectiveSearchResults(abc_learning_searches.ObjectiveSearchResults, osid_searches.OsidSearchResults):
    """This interface provides a means to capture results of a search."""

    def get_objectives(self):
        """Gets the objective list resulting from the search.

        return: (osid.learning.ObjectiveList) - the objective list
        raise:  IllegalState - list already retrieved
        *compliance: mandatory -- This method must be implemented.*

        """
        raise errors.Unimplemented()

    objectives = property(fget=get_objectives)

    def get_objective_query_inspector(self):
        """Gets the inspector for the query to examine the terms used in the search.

        return: (osid.learning.ObjectiveQueryInspector) - the query
                inspector
        *compliance: mandatory -- This method must be implemented.*

        """
        raise errors.Unimplemented()

    objective_query_inspector = property(fget=get_objective_query_inspector)

    @utilities.arguments_not_none
    def get_objective_search_results_record(self, objective_search_record_type):
        """Gets the objective search results record corresponding to the given objective search record ``Type``.

        This method is used to retrieve an object implementing the
        requested record.

        arg:    objective_search_record_type (osid.type.Type): an
                objective search record type
        return: (osid.learning.records.ObjectiveSearchResultsRecord) -
                the objective search results record
        raise:  NullArgument - ``objective_search_record_type`` is
                ``null``
        raise:  OperationFailed - unable to complete request
        raise:  Unsupported -
                ``has_search_record_type(objective_search_record_type)``
                is ``false``
        *compliance: mandatory -- This method must be implemented.*

        """
        raise errors.Unimplemented()

class ActivitySearch(abc_learning_searches.ActivitySearch, osid_searches.OsidSearch):
    """``ActivitySearch`` defines the interface for specifying activity search options."""

    @utilities.arguments_not_none
    def search_among_activities(self, activity_ids):
        """Execute this search among the given list of activities.

        arg:    activity_ids (osid.id.IdList): list of activities
        raise:  NullArgument - ``activity_ids`` is ``null``
        *compliance: mandatory -- This method must be implemented.*

        """
        raise errors.Unimplemented()

    @utilities.arguments_not_none
    def order_activity_results(self, activitiesearch_order):
        """Specify an ordering to the search results.

        arg:    activitiesearch_order
                (osid.learning.ActivitySearchOrder): activity search
                order
        raise:  NullArgument - ``activitiesearch_order`` is ``null``
        raise:  Unsupported - ``activitiesearch_order`` is not of this
                service
        *compliance: mandatory -- This method must be implemented.*

        """
        raise errors.Unimplemented()

    @utilities.arguments_not_none
    def get_activity_search_record(self, activitiesearch_record_type):
        """Gets the activity record corresponding to the given activity search record ``Type``.

        This method is used to retrieve an object implementing the
        requested record.

        arg:    activitiesearch_record_type (osid.type.Type): an
                activity search record type
        return: (osid.learning.records.ActivitySearchRecord) - the
                activity search record
        raise:  NullArgument - ``activitiesearch_record_type`` is
                ``null``
        raise:  OperationFailed - unable to complete request
        raise:  Unsupported -
                ``has_search_record_type(activitiesearch_record_type)``
                is ``false``
        *compliance: mandatory -- This method must be implemented.*

        """
        raise errors.Unimplemented()

class ActivitySearchResults(abc_learning_searches.ActivitySearchResults, osid_searches.OsidSearchResults):
    """This interface provides a means to capture results of a search."""

    def get_activities(self):
        """Gets the activity list resulting from the search.

        return: (osid.learning.ActivityList) - the activity list
        raise:  IllegalState - list already retrieved
        *compliance: mandatory -- This method must be implemented.*

        """
        raise errors.Unimplemented()

    activities = property(fget=get_activities)

    def get_activity_query_inspector(self):
        """Gets the inspector for the query to examine the terms used in the search.

        return: (osid.learning.ActivityQueryInspector) - the query
                inspector
        *compliance: mandatory -- This method must be implemented.*

        """
        raise errors.Unimplemented()

    activity_query_inspector = property(fget=get_activity_query_inspector)

    @utilities.arguments_not_none
    def get_activity_search_results_record(self, activitiesearch_record_type):
        """Gets the activity search results record corresponding to the given activity search record ``Type``.

        This method is used to retrieve an object implementing the
        requested record.

        arg:    activitiesearch_record_type (osid.type.Type): an
                activity search record type
        return: (osid.learning.records.ActivitySearchResultsRecord) -
                the activity search results record
        raise:  NullArgument - ``activitiesearch_record_type`` is
                ``null``
        raise:  OperationFailed - unable to complete request
        raise:  Unsupported -
                ``has_search_record_type(activitiesearch_record_type)``
                is ``false``
        *compliance: mandatory -- This method must be implemented.*

        """
        raise errors.Unimplemented()

class ProficiencySearch(abc_learning_searches.ProficiencySearch, osid_searches.OsidSearch):
    """The search interface for governing proficiency searches."""

    @utilities.arguments_not_none
    def search_among_proficiencies(self, proficiency_ids):
        """Execute this search among the given list of proficiencies.

        arg:    proficiency_ids (osid.id.IdList): list of proficiencies
        raise:  NullArgument - ``proficiency_ids`` is ``null``
        *compliance: mandatory -- This method must be implemented.*

        """
        raise errors.Unimplemented()

    @utilities.arguments_not_none
    def order_proficiency_results(self, proficiency_search_order):
        """Specify an ordering to the search results.

        arg:    proficiency_search_order
                (osid.learning.ProficiencySearchOrder): proficiency
                search order
        raise:  NullArgument - ``proficiency_search_order`` is ``null``
        raise:  Unsupported - ``proficiency_search_order`` is not of
                this service
        *compliance: mandatory -- This method must be implemented.*

        """
        raise errors.Unimplemented()

    @utilities.arguments_not_none
    def get_proficiency_search_record(self, proficiency_search_record_type):
        """Gets the proficiency search record corresponding to the given proficiency search record ``Type``.

        This method is used to retrieve an object implementing the
        requested record.

        arg:    proficiency_search_record_type (osid.type.Type): a
                proficiency search record type
        return: (osid.learning.records.ProficiencySearchRecord) - the
                proficiency search record
        raise:  NullArgument - ``proficiency_search_record_type`` is
                ``null``
        raise:  OperationFailed - unable to complete request
        raise:  Unsupported -
                ``has_record_type(proficiency_search_record_type)`` is
                ``false``
        *compliance: mandatory -- This method must be implemented.*

        """
        raise errors.Unimplemented()

class ProficiencySearchResults(abc_learning_searches.ProficiencySearchResults, osid_searches.OsidSearchResults):
    """This interface provides a means to capture results of a search."""

    def get_proficiencies(self):
        """Gets the proficiency list resulting from a search.

        return: (osid.learning.ProficiencyList) - the proficiency list
        raise:  IllegalState - list already retrieved
        *compliance: mandatory -- This method must be implemented.*

        """
        raise errors.Unimplemented()

    proficiencies = property(fget=get_proficiencies)

    def get_proficiency_query_inspector(self):
        """Gets the inspector for the query to examine the terms used in the search.

        return: (osid.learning.ProficiencyQueryInspector) - the
                proficiency query inspector
        *compliance: mandatory -- This method must be implemented.*

        """
        raise errors.Unimplemented()

    proficiency_query_inspector = property(fget=get_proficiency_query_inspector)

    @utilities.arguments_not_none
    def get_proficiency_search_results_record(self, proficiency_search_record_type):
        """Gets the proficiency search results record corresponding to the given proficiency search record ``Type``.

        This method is used to retrieve an object implementing the
        requested record.

        arg:    proficiency_search_record_type (osid.type.Type): a
                proficiency search record type
        return: (osid.learning.records.ProficiencySearchResultsRecord) -
                the proficiency search results record
        raise:  NullArgument - ``proficiency_search_record_type`` is
                ``null``
        raise:  OperationFailed - unable to complete request
        raise:  Unsupported -
                ``has_record_type(proficiency_search_record_type)`` is
                ``false``
        *compliance: mandatory -- This method must be implemented.*

        """
        raise errors.Unimplemented()

class ObjectiveBankSearch(abc_learning_searches.ObjectiveBankSearch, osid_searches.OsidSearch):
    """The interface for governing objective bank searches."""

    @utilities.arguments_not_none
    def search_among_objective_banks(self, objective_bank_ids):
        """Execute this search among the given list of objective banks.

        arg:    objective_bank_ids (osid.id.IdList): list of objective
                banks
        raise:  NullArgument - ``objective bank_ids`` is ``null``
        *compliance: mandatory -- This method must be implemented.*

        """
        raise errors.Unimplemented()

    @utilities.arguments_not_none
    def order_objective_bank_results(self, objective_bank_search_order):
        """Specify an ordering to the search results.

        arg:    objective_bank_search_order
                (osid.learning.ObjectiveBankSearchOrder): objective bank
                search order
        raise:  NullArgument - ``objective_bank_search_order`` is
                ``null``
        raise:  Unsupported - ``objective_bank_search_order`` is not of
                this service
        *compliance: mandatory -- This method must be implemented.*

        """
        raise errors.Unimplemented()

    @utilities.arguments_not_none
    def get_objective_bank_search_record(self, objective_bank_search_record_type):
        """Gets the objective bank search record corresponding to the given objective bank search record ``Type``.

        This method is used to retrieve an object implementing the
        requested record.

        arg:    objective_bank_search_record_type (osid.type.Type): an
                objective bank search record type
        return: (osid.learning.records.ObjectiveBankSearchRecord) - the
                objective bank search record
        raise:  NullArgument - ``objective_bank_search_record_type`` is
                ``null``
        raise:  OperationFailed - unable to complete request
        raise:  Unsupported - ``has_search_record_type(objective
                bank_search_record_type)`` is ``false``
        *compliance: mandatory -- This method must be implemented.*

        """
        raise errors.Unimplemented()

class ObjectiveBankSearchResults(abc_learning_searches.ObjectiveBankSearchResults, osid_searches.OsidSearchResults):
    """This interface provides a means to capture results of a search."""

    def get_objective_banks(self):
        """Gets the objective bank list resulting from the search.

        return: (osid.learning.ObjectiveBankList) - the objective bank
                list
        raise:  IllegalState - list already retrieved
        *compliance: mandatory -- This method must be implemented.*

        """
        raise errors.Unimplemented()

    objective_banks = property(fget=get_objective_banks)

    def get_objective_bank_query_inspector(self):
        """Gets the inspector for the query to examine the terms used in the search.

        return: (osid.learning.ObjectiveBankQueryInspector) - the query
                inspector
        *compliance: mandatory -- This method must be implemented.*

        """
        raise errors.Unimplemented()

    objective_bank_query_inspector = property(fget=get_objective_bank_query_inspector)

    @utilities.arguments_not_none
    def get_objective_bank_search_results_record(self, objective_bank_search_record_type):
        """Gets the objective bank search results record corresponding to the given objective bank search record
            ``Type``.

        This method is used to retrieve an object implementing the
        requested record.

        arg:    objective_bank_search_record_type (osid.type.Type): an
                objective bank search record type
        return: (osid.learning.records.ObjectiveBankSearchResultsRecord)
                - the objective bank search results record
        raise:  NullArgument - ``objective_bank_search_record_type`` is
                ``null``
        raise:  OperationFailed - unable to complete request
        raise:  Unsupported - ``has_search_record_type(objective
                bank_search_record_type)`` is ``false``
        *compliance: mandatory -- This method must be implemented.*

        """
        raise errors.Unimplemented()


text:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="org.redcross.openmapkit.tagswipe.ODKCollectFragment">

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:paddingLeft="20dp"
        android:paddingTop="20dp"
        android:paddingRight="20dp">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:text="@string/odkcollect_fragment_question"
            android:id="@+id/questionTextView" />

        <Space
            android:layout_width="20px"
            android:layout_height="@dimen/abc_text_size_large_material" />

        <LinearLayout
            android:orientation="horizontal"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent">

            <Button
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="wrap_content"
                android:text="@string/cancel"
                android:id="@+id/cancelButton" />

            <Button
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="wrap_content"
                android:text="@string/save"
                android:id="@+id/saveButton" />
        </LinearLayout>

    </LinearLayout>
</FrameLayout>


text:
<!DOCTYPE html>

    <meta name="viewport" content="width=device-width,height=device-height,user-scalable=no,maximum-scale=1.0,initial-scale=1.0" />
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <title>Cordova Mobile Spec</title>
    <link rel="stylesheet" href="../master.css" type="text/css" media="screen" title="no title" charset="utf-8">

Notifications and Dialogs

Action

Beep

Vibrate

Alert Dialog

Confirm Dialog

Built-in Alert Dialog

Built-in Confirm Dialog

Built-in Prompt Dialog

Back


text:
<?php
class CountriesController extends AppController {

	var $name = 'Countries';

	function beforeFilter(){
		parent::beforeFilter();

		if ($this->Session->read('Auth.User.group_id') != '1'){
			$this->Session->setFlash(__('Acceso Restringido.', true));
			$this->redirect(array('controller' => 'pages', 'action' => 'home'));
		}
	}

	function index() {
		$this->Country->recursive = 0;
		$this->set('countries', $this->paginate());
	}

	function view($id = null) {
		if (!$id) {
			$this->Session->setFlash(__('Invalid country', true));
			$this->redirect(array('action' => 'index'));
		}
		$this->set('country', $this->Country->read(null, $id));
	}

	function add() {
		if (!empty($this->data)) {
			$this->Country->create();
			if ($this->Country->save($this->data)) {
				$this->Session->setFlash(__('The country has been saved', true));
				$this->redirect(array('action' => 'index'));
			} else {
				$this->Session->setFlash(__('The country could not be saved. Please, try again.', true));
			}
		}
	}

	function edit($id = null) {
		if (!$id && empty($this->data)) {
			$this->Session->setFlash(__('Invalid country', true));
			$this->redirect(array('action' => 'index'));
		}
		if (!empty($this->data)) {
			if ($this->Country->save($this->data)) {
				$this->Session->setFlash(__('The country has been saved', true));
				$this->redirect(array('action' => 'index'));
			} else {
				$this->Session->setFlash(__('The country could not be saved. Please, try again.', true));
			}
		}
		if (empty($this->data)) {
			$this->data = $this->Country->read(null, $id);
		}
	}

	function delete($id = null) {
		if (!$id) {
			$this->Session->setFlash(__('Invalid id for country', true));
			$this->redirect(array('action'=>'index'));
		}
		if ($this->Country->delete($id)) {
			$this->Session->setFlash(__('Country deleted', true));
			$this->redirect(array('action'=>'index'));
		}
		$this->Session->setFlash(__('Country was not deleted', true));
		$this->redirect(array('action' => 'index'));
	}
}


text:
package com.vaadin.client.ui.dd;

import java.util.Iterator;

import com.google.gwt.user.client.Command;
import com.vaadin.client.ComponentConnector;
import com.vaadin.client.UIDL;
import com.vaadin.event.Transferable;
import com.vaadin.event.dd.DropTarget;
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;

public abstract class VAbstractDropHandler implements VDropHandler {

    private UIDL criterioUIDL;
    private VAcceptCriterion acceptCriteria = new VAcceptAll();

    /**
     * Implementor/user of {@link VAbstractDropHandler} must pass the UIDL
     * painted by {@link AcceptCriterion} to this method. Practically the
     * details about {@link AcceptCriterion} are saved.
     *
     * @param uidl
     */
    public void updateAcceptRules(UIDL uidl) {
        criterioUIDL = uidl;
        /*
         * supports updating the accept rule root directly or so that it is
         * contained in given uidl node
         */
        if (!uidl.getTag().equals("-ac")) {
            Iterator<Object> childIterator = uidl.getChildIterator();
            while (!uidl.getTag().equals("-ac") && childIterator.hasNext()) {
                uidl = (UIDL) childIterator.next();
            }
        }
        acceptCriteria = VAcceptCriteria.get(uidl.getStringAttribute("name"));
        if (acceptCriteria == null) {
            throw new IllegalArgumentException(
                    "No accept criteria found with given name "
                            + uidl.getStringAttribute("name"));
        }
    }

    /**
     * Default implementation does nothing.
     */
    @Override
    public void dragOver(VDragEvent drag) {

    }

    /**
     * Default implementation does nothing. Implementors should clean possible
     * emphasis or drag icons here.
     */
    @Override
    public void dragLeave(VDragEvent drag) {

    }

    /**
     * The default implementation in {@link VAbstractDropHandler} checks if the
     * Transferable is accepted.
     *

     * If transferable is accepted (either via server visit or client side
     * rules) the default implementation calls abstract
     * {@link #dragAccepted(VDragEvent)} method.
     *

     * If drop handler has distinct places where some parts may accept the
     * {@link Transferable} and others don't, one should use similar validation
     * logic in dragOver method and replace this method with empty
     * implementation.
     *
     */
    @Override
    public void dragEnter(final VDragEvent drag) {
        validate(new VAcceptCallback() {
            @Override
            public void accepted(VDragEvent event) {
                dragAccepted(drag);
            }
        }, drag);
    }

    /**
     * This method is called when a valid drop location was found with
     * {@link AcceptCriterion} either via client or server side check.
     *

     * Implementations can set some hints for users here to highlight that the
     * drag is on a valid drop location.
     *
     * @param drag
     */
    abstract protected void dragAccepted(VDragEvent drag);

    protected void validate(final VAcceptCallback cb, final VDragEvent event) {
        Command checkCriteria = new Command() {
            @Override
            public void execute() {
                acceptCriteria.accept(event, criterioUIDL, cb);
            }
        };

        VDragAndDropManager.get().executeWhenReady(checkCriteria);
    }

    boolean validated = false;

    /**
     * The default implemmentation visits server if {@link AcceptCriterion}
     * can't be verified on client or if {@link AcceptCriterion} are met on
     * client.
     */
    @Override
    public boolean drop(VDragEvent drag) {
        if (acceptCriteria.needsServerSideCheck(drag, criterioUIDL)) {
            return true;
        } else {
            validated = false;
            acceptCriteria.accept(drag, criterioUIDL, new VAcceptCallback() {
                @Override
                public void accepted(VDragEvent event) {
                    validated = true;
                }
            });
            return validated;
        }

    }

    /**
     * Returns the Paintable who owns this {@link VAbstractDropHandler}. Server
     * side counterpart of the Paintable is expected to implement
     * {@link DropTarget} interface.
     */
    @Override
    public abstract ComponentConnector getConnector();

}


text:
class Traces {
 public:
  Traces() : modules_(std::make_unique<Modules>()) { }

  // Saves an execution trace based on a virtual address, and two arguments: a
  // 4-bit and a 12-bit one. The meaning of the arguments is up to the caller.
  void TrySaveTrace(size_t pc, int trace_arg1, int trace_arg2);

  // Returns the number of modules in which execution traces have been
  // registered.
  int GetModulesCount() const;

  // Returns the name of a specific module.
  std::string GetModuleName(int idx) const;

  // Returns a list of (module index, offset) pairs that have been found so far.
  void GetTracesList(std::vector<std::pair<int, size_t>> *traces_list) const;

 private:
  // A set of unique wide traces logged in the process so far.
  std::unordered_set<uint64_t> traces_set_;

  // A list of unique output traces in the form of:
  //
  // (module index, offset in module with extra information encoded)
  //
  // The module index is generated by the Modules class.
  std::vector<std::pair<int, size_t>> traces_list_;

  // An instance of a class keeping track of executable modules in the process.
  std::unique_ptr<Modules> modules_;

  // Internal methods for constructing wide traces, output traces, and
  // performing 64->32 bit mixing.
  static uint32_t Hash_64_32_Shift(uint64_t key);
  static uint64_t ConstructWideTrace(
      size_t offset, int trace_arg1, int trace_arg2);
  static size_t ConstructOutputTrace(
      size_t offset, int trace_arg1, int trace_arg2);
};

#endif  // CMPCOV_TRACES_H_


text:
<?php

namespace Magento\Framework\Module\Test\Unit\Dir;

class ReverseResolverTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var \Magento\Framework\Module\Dir\ReverseResolver
     */
    protected $_model;

    /**
     * @var \Magento\Framework\Module\ModuleListInterface|\PHPUnit_Framework_MockObject_MockObject
     */
    protected $_moduleList;

    /**
     * @var \Magento\Framework\Module\Dir|\PHPUnit_Framework_MockObject_MockObject
     */
    protected $_moduleDirs;

    protected function setUp()
    {
        $this->_moduleList = $this->getMock('Magento\Framework\Module\ModuleListInterface');
        $this->_moduleDirs = $this->getMock('Magento\Framework\Module\Dir', [], [], '', false, false);
        $this->_model = new \Magento\Framework\Module\Dir\ReverseResolver($this->_moduleList, $this->_moduleDirs);
    }

    /**
     * @param string $path
     * @param string $expectedResult
     * @dataProvider getModuleNameDataProvider
     */
    public function testGetModuleName($path, $expectedResult)
    {
        $this->_moduleList->expects($this->once())->method('getNames')->will(
            $this->returnValue(['Fixture_ModuleOne', 'Fixture_ModuleTwo'])
        );
        $this->_moduleDirs->expects(
            $this->atLeastOnce()
        )->method(
            'getDir'
        )->will(
            $this->returnValueMap(
                [
                    ['Fixture_ModuleOne', '', 'app/code/Fixture/ModuleOne'],
                    ['Fixture_ModuleTwo', '', 'app/code/Fixture/ModuleTwo'],
                ]
            )
        );
        $this->assertSame($expectedResult, $this->_model->getModuleName($path));
    }

    public function getModuleNameDataProvider()
    {
        return [
            'module root dir' => ['app/code/Fixture/ModuleOne', 'Fixture_ModuleOne'],
            'module root dir trailing slash' => ['app/code/Fixture/ModuleOne/', 'Fixture_ModuleOne'],
            'module root dir backward slash' => ['app/code\\Fixture\\ModuleOne', 'Fixture_ModuleOne'],
            'dir in module' => ['app/code/Fixture/ModuleTwo/etc', 'Fixture_ModuleTwo'],
            'dir in module trailing slash' => ['app/code/Fixture/ModuleTwo/etc/', 'Fixture_ModuleTwo'],
            'dir in module backward slash' => ['app/code/Fixture/ModuleTwo\\etc', 'Fixture_ModuleTwo'],
            'file in module' => ['app/code/Fixture/ModuleOne/etc/config.xml', 'Fixture_ModuleOne'],
            'file in module backward slash' => [
                'app\\code\\Fixture\\ModuleOne\\etc\\config.xml',
                'Fixture_ModuleOne',
            ],
            'unknown module' => ['app/code/Unknown/Module', null]
        ];
    }
}


text:
int quit = FALSE;
int max_inputs = 10;
int inputs_count = 0;

SDL_Surface *screen;
SDL_Surface *header_message;
SDL_Surface *footer_message;
SDL_Surface *input_text;
SDL_Surface *timer_text;
SDL_Surface *info_text;
SDL_Surface *highscores[SCORELIST_MAX_LENGTH];

char input_str[256];
wchar_t input_str_w[256];
int input_str_len = 0;

int screen_width = 800;
int screen_height = 600;
int screen_bpp = 32;

char window_header_str[256] = "TextIn";
char window_footer_str[256] = "Martin Kelm, 2014";

char font_file[128] = "resources/beyourself.ttf";
TTF_Font *font = NULL;
SDL_Color font_color = { 255, 255, 255 };
int font_size = 24;
TTF_Font *input_font = NULL;
int input_font_size = 64;

SDL_Event event;

void input_init() {
  input_font = TTF_OpenFont(font_file, input_font_size);

  strncpy(input_str, "", strlen(input_str));
  wcsncpy(input_str_w, L"", wcslen(input_str_w));
  input_text = NULL;
  SDL_EnableUNICODE(SDL_ENABLE);
}

int init_messages() {
  footer_message = TTF_RenderText_Blended(font, window_footer_str, font_color);
  if (footer_message == NULL) {
    return FALSE;
  }
  header_message = TTF_RenderText_Blended(font, window_header_str, font_color);
  if (header_message == NULL) {
    return FALSE;
  }
  return TRUE;
}

int init() {
  if(SDL_Init(SDL_INIT_EVERYTHING) == -1) {
    return FALSE;
  }

  screen = SDL_SetVideoMode(
    screen_width, screen_height, screen_bpp, SDL_SWSURFACE | SDL_RESIZABLE
  );
  if (screen == NULL) {
    return FALSE;
  }

  if (TTF_Init() == -1) {
    return FALSE;
  }

  font = TTF_OpenFont(font_file, font_size);
  if (font == NULL) {
    return FALSE;
  }

  char wt_temp[256] = "";
  strcat(wt_temp, window_header_str);
  strcat(wt_temp, " - ");
  strcat(wt_temp, window_footer_str);
  SDL_WM_SetCaption(wt_temp, NULL);

  input_init();

  textlist_init();
  textlist_set_random_pos();

  scorelist_load();

  espeak_init();

  timer_start();

  return init_messages();
}

void input_clean_up() {
  TTF_CloseFont(input_font);
  SDL_FreeSurface(input_text);
  SDL_EnableUNICODE(SDL_DISABLE);
}

void clean_up() {
  espeak_clean_up();

  input_clean_up();

  SDL_FreeSurface(info_text);
  SDL_FreeSurface(timer_text);
  SDL_FreeSurface(header_message);
  SDL_FreeSurface(footer_message);

  int i;
  for (i = 0; i < SCORELIST_MAX_LENGTH; i++) {
    SDL_FreeSurface(highscores[i]);
  }

  TTF_CloseFont(font);
  TTF_Quit();

  SDL_Quit();
}

void apply_surface(int x, int y, SDL_Surface* source, SDL_Surface* destination) {
  SDL_Rect offset;
  offset.x = x;
  offset.y = y;

  SDL_BlitSurface(source, NULL, destination, &offset);
}

void input_show_centered(int move_y) {
  if (input_text != NULL) {
    apply_surface(
      (screen_width - input_text->w) / 2, (screen_height - input_text->h) / 2 + move_y,
      input_text, screen
    );
  }
  hlineColor(
    screen,
    screen_width * 0.1, screen_width * 0.9, screen_height / 2 + font_size + move_y,
    0xFFFFFFFF
  );
}

void handle_input() {
  if (event.type == SDL_KEYDOWN) {
    int input_change = FALSE;

    if (input_str_len < 256) {
      if (event.key.keysym.unicode == (Uint16)' ' ||
          (event.key.keysym.unicode >= (Uint16)'a' &&
           event.key.keysym.unicode <= (Uint16)'z') ||
          event.key.keysym.unicode == 223 || // ß
          event.key.keysym.unicode == 252 || // ü
          event.key.keysym.unicode == 228 || // ä
          event.key.keysym.unicode == 246) { // ö

        sprintf(input_str, "%s%c", input_str, event.key.keysym.unicode);
        wchar_t tmp[256];
        swprintf(tmp, 256, L"%lc", event.key.keysym.unicode);
        wcscat(input_str_w, tmp);

        input_str_len++;
        input_change = TRUE;
      }
    }
    if (event.key.keysym.sym == SDLK_BACKSPACE && input_str_len > 0) {
      input_str_len--;
      input_str[strlen(input_str)-1] = '\0';
      input_str_w[wcslen(input_str_w)-1] = '\0';
      input_change = TRUE;
    }
    if (input_change == TRUE) {
      SDL_FreeSurface(input_text);
      input_text = TTF_RenderText_Blended(input_font, input_str, font_color);
    }
  }
}

void show_timer_text() {
  SDL_FreeSurface(timer_text);
  char time[128];
  sprintf(time, "%d", timer_get_seconds());
  timer_text = TTF_RenderText_Blended(input_font, time, font_color);
  apply_surface(
    screen_width - timer_text->w, 0, timer_text, screen
  );
}

void output_scores() {
  int i, list_length = scorelist_get_length();
  char output[1024];
  struct st_scorelist score;
  for (i = 0; i < list_length; i++) {
    SDL_FreeSurface(highscores[i]);

    score = scorelist_get_score(i);
    sprintf(output, "%d. %ls, %d Punkte (%d Buchstaben in %d Sekunden)",
      i+1, score.name, score.points, score.chars, score.seconds);

    highscores[i] = TTF_RenderText_Blended(font, output, font_color);
    apply_surface(
      screen_width / 2 - highscores[i]->w / 2, screen_height * 0.2 + font_size * (i + 1),
      highscores[i], screen
    );
  }
  scorelist_save();
}

void show_info_text(int valid_input, int do_input_name, int do_input_continue, int move_y) {
  SDL_FreeSurface(info_text);
  char info[256];
  if (do_input_continue == TRUE) {
    sprintf(info, "weiter (ja/nein) ?");
  } else if (do_input_name == TRUE) {
    sprintf(info, "bitte Namen eingeben");
  } else {
    sprintf(info, "gesucht %d Buchstaben", textlist_get_current_text_len());
    if (valid_input > -1) {
      sprintf(info, "%s - letzte Eingabe %s",
        info, (valid_input == TRUE) ? "richtig" : "falsch");
    } else {
      sprintf(info, "%s - keine Eingabe bisher", info);
    }
  }
  info_text = TTF_RenderText_Blended(font, info, font_color);
  apply_surface(
    screen_width / 2 - info_text->w / 2, screen_height / 2 + 1.2 * font_size + move_y,
    info_text, screen
  );
}

int main(int argc, char* args[]) {
  setlocale(LC_ALL, "de_DE.UTF-8");

  if (init() == FALSE)
    return 1;

  Uint32 frameStart = 0;
  espeak_set_run(TRUE);
  int valid_input = -1;
  int do_input_name = FALSE;
  int do_input_continue = FALSE;
  int input_move_y = 0;

  while (quit == FALSE) {
    if (do_input_name == FALSE && do_input_continue == FALSE)
      timer_update();
    frameStart = SDL_GetTicks();

    while (SDL_PollEvent(&event)) {
      if (event.type == SDL_KEYDOWN && event.key.keysym.sym == SDLK_RETURN) {

        int skip_input = (strcmp(input_str, "") == 0) ? TRUE : FALSE;
        if (do_input_continue && strcmp(input_str, "") != 0) {
          if (strcmp(input_str, "nein") == 0) {
            quit = TRUE;
          } else {
            do_input_continue = FALSE;
            textlist_init();
            textlist_set_random_pos();
            timer_start();
            inputs_count = 0;
            input_init();
            espeak_set_run(TRUE);
          }
        } else if (do_input_name == TRUE && strcmp(input_str, "") != 0) {
          scorelist_add_score(input_str_w, textlist_get_chars_count(), timer_get_seconds());
          do_input_continue = TRUE;
          do_input_name = FALSE;
          input_init();

        } else if (textlist_current_compare(input_str_w) == 0 || skip_input == TRUE) {
          if (skip_input == FALSE)
            valid_input = TRUE;
          inputs_count++;
          espeak_lock();
          textlist_remove_current(skip_input);
          espeak_unlock();

          if (inputs_count == max_inputs) {
            do_input_name = TRUE;
            input_init();
          }
          if (do_input_name == FALSE && quit == FALSE) {
            espeak_lock();
            quit = (textlist_set_random_pos() == TRUE) ? FALSE : TRUE;
            espeak_unlock();
            input_init();
            espeak_set_run(TRUE);
          }
        } else {
          valid_input = FALSE;
          input_init();
          espeak_set_run(TRUE);
        }
      } else {
        handle_input();
      }
      if (event.type == SDL_VIDEORESIZE) {
        screen_width = event.resize.w;
        screen_height = event.resize.h;
        screen = SDL_SetVideoMode(
          screen_width, screen_height, screen_bpp, SDL_SWSURFACE | SDL_RESIZABLE
        );
      }
      if (event.type == SDL_QUIT) {
        quit = TRUE;
      }
    }

    SDL_FillRect(screen, &screen->clip_rect, SDL_MapRGB(screen->format, 0, 0, 0));

    show_timer_text();
    input_move_y = (do_input_continue == TRUE) ? screen_height * 0.1 : 0;

    if (do_input_continue == TRUE)
      output_scores();
    show_info_text(valid_input, do_input_name, do_input_continue, input_move_y);
    input_show_centered(input_move_y);

    apply_surface(
      screen_width - footer_message->w, screen_height - footer_message->h,
      footer_message, screen
    );
    apply_surface(0, 0, header_message, screen);
    if (SDL_Flip(screen) == -1)
      return 1;

    if ((SDL_GetTicks() - frameStart) < (1000 / FPS)) {
      SDL_Delay((1000 / FPS) - (SDL_GetTicks() - frameStart));
    }
  }

  clean_up();
  return 0;
}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="fill_horizontal"
    android:focusable="true"
>
<android.support.v7.widget.AppCompatAutoCompleteTextView
    android:id="@+id/search_box"
    android:layout_height="wrap_content"
    android:layout_width="match_parent"
    android:layout_alignParentTop="true"
    android:dropDownWidth="wrap_content"
    android:layout_centerHorizontal="true"
    android:inputType="textAutoComplete|textAutoCorrect"
    android:ems="10"
    />

</RelativeLayout>


text:
package org.broadinstitute.hellbender.tools.walkers.rnaseq;

import htsjdk.samtools.*;
import htsjdk.samtools.reference.IndexedFastaSequenceFile;
import org.broadinstitute.barclay.argparser.Advanced;
import org.broadinstitute.barclay.argparser.Argument;
import org.broadinstitute.barclay.argparser.CommandLineProgramProperties;
import org.broadinstitute.barclay.help.DocumentedFeature;
import org.broadinstitute.hellbender.utils.io.IOUtils;
import picard.cmdline.programgroups.ReadDataManipulationProgramGroup;
import org.broadinstitute.hellbender.engine.FeatureContext;
import org.broadinstitute.hellbender.engine.ReferenceContext;
import org.broadinstitute.hellbender.engine.TwoPassReadWalker;
import org.broadinstitute.hellbender.engine.filters.ReadFilter;
import org.broadinstitute.hellbender.engine.filters.ReadFilterLibrary;
import org.broadinstitute.hellbender.exceptions.UserException;
import org.broadinstitute.hellbender.transformers.MappingQualityReadTransformer;
import org.broadinstitute.hellbender.transformers.NDNCigarReadTransformer;
import org.broadinstitute.hellbender.transformers.ReadTransformer;
import org.broadinstitute.hellbender.utils.GenomeLocParser;
import org.broadinstitute.hellbender.utils.SATagBuilder;
import org.broadinstitute.hellbender.utils.clipping.ReadClipper;
import org.broadinstitute.hellbender.utils.fasta.CachingIndexedFastaSequenceFile;
import org.broadinstitute.hellbender.utils.read.*;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import static org.broadinstitute.hellbender.cmdline.StandardArgumentDefinitions.OUTPUT_LONG_NAME;
import static org.broadinstitute.hellbender.cmdline.StandardArgumentDefinitions.OUTPUT_SHORT_NAME;

/**
 *
 * Splits reads that contain Ns in their cigar string (e.g. spanning splicing events in RNAseq data).
 *
 * Identifies all N cigar elements and creates k+1 new reads (where k is the number of N cigar elements).
 * The first read includes the bases that are to the left of the first N element, while the part of the read that is to the right of the N
 * (including the Ns) is hard clipped and so on for the rest of the new reads. Used for post-processing RNA reads aligned against the full reference.
 *
 *
Input

 *

 *	    BAM file
 *

 *
 *
 *
Output

 *

 *      BAM file with reads split at N CIGAR elements and CIGAR strings updated.
 *

 *
 *
Usage example

 *

 *    gatk SplitNCigarReads \
 *      -R Homo_sapiens_assembly38.fasta \
 *      -I input.bam \
 *      -O output.bam
 *

 */
@DocumentedFeature
@CommandLineProgramProperties(
        summary = "Splits reads that contain Ns in their cigar string (e.g. spanning splicing events).",
        oneLineSummary = "Split Reads with N in Cigar",
        programGroup = ReadDataManipulationProgramGroup.class
)
public final class SplitNCigarReads extends TwoPassReadWalker {

    // A list of tags that break upon splitting on N. These will be removed from reads in the output.
    // NOTE: for future developers who want to use these tags. For each tag you remove from this list corresponding
    // support for properly recalculating the tags must be added to repairSupplementaryTags()
    static final String[] TAGS_TO_REMOVE = {"NM","MD","NH"};
    static final String MATE_CIGAR_TAG = "MC";

    @Argument(fullName = OUTPUT_LONG_NAME, shortName = OUTPUT_SHORT_NAME, doc="Write output to this BAM filename")
    String OUTPUT;

    /**
     * This flag tells GATK to refactor cigar string with NDN elements to one element. It intended primarily for use in
     * a RNAseq pipeline since the problem might come up when using RNAseq aligner such as Tophat2 with provided transcriptomes.
     * You should only use this if you know that your reads have that problem.
     */
    @Argument(fullName = "refactor-cigar-string", shortName = "fixNDN", doc = "refactor cigar string with NDN elements to one element", optional = true)
    boolean REFACTOR_NDN_CIGAR_READS = false;

    /**
     * This flag turns off the mapping quality 255 -> 60 read transformer. The transformer is on by default to ensure that
     * uniquely mapping reads assigned STAR's default 255 MQ aren't filtered out by HaplotypeCaller.
     */
    @Argument(fullName = "skip-mapping-quality-transform", shortName = "skip-mq-transform", doc = "skip the 255 -> 60 MQ read transform", optional = true)
    boolean SKIP_MQ_TRANSFORM = false;

    /**
     * For expert users only!  To minimize memory consumption you can lower this number, but then the tool may skip
     * overhang fixing in regions with too much coverage.  Just make sure to give Java enough memory!  4Gb should be
     * enough with the default value.
     */
    @Advanced
    @Argument(fullName="max-reads-in-memory", doc="max reads allowed to be kept in memory at a time by the BAM writer", optional=true)
    int MAX_RECORDS_IN_MEMORY = 150000;

    /**
     * If there are more than this many mismatches within the overhang regions, the whole overhang will get hard-clipped out.
     * It is still possible in some cases that the overhang could get clipped if the number of mismatches do not exceed this
     * value, e.g. if most of the overhang mismatches.
     */
    @Argument(fullName="max-mismatches-in-overhang", doc="max number of mismatches allowed in the overhang", optional=true)
    int MAX_MISMATCHES_IN_OVERHANG = 1;

    /**
     * If there are more than this many bases in the overhang, we won't try to hard-clip them out
     */
    @Argument(fullName="max-bases-in-overhang", doc="max number of bases allowed in the overhang", optional=true)
    int MAX_BASES_TO_CLIP = 40;

    @Argument(fullName="do-not-fix-overhangs", doc="do not have the walker soft-clip overhanging sections of the reads", optional=true)
    boolean doNotFixOverhangs = false;

    @Argument(fullName="process-secondary-alignments", doc="have the walker split secondary alignments (will still repair MC tag without it)", optional=true)
    boolean processSecondaryAlignments = false;

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

    private SAMFileGATKReadWriter outputWriter;
    private OverhangFixingManager overhangManager;
    private IndexedFastaSequenceFile referenceReader;
    SAMFileHeader header;

    @Override
    public List<ReadFilter> getDefaultReadFilters() {
        return Collections.singletonList(ReadFilterLibrary.ALLOW_ALL_READS);
    }

    @Override
    public ReadTransformer makePreReadFilterTransformer(){
        if (REFACTOR_NDN_CIGAR_READS) {
            return new NDNCigarReadTransformer();
        }
        else {
            return ReadTransformer.identity();
        }
    }

    //FIXME: once the engine accepts read transformer arguments, remove these magic numbers?
    private static final int FROM_QUALITY = 255;
    private static final int TO_QUALITY = 60;

    @Override
    public ReadTransformer makePostReadFilterTransformer(){
        if (SKIP_MQ_TRANSFORM) {
            return ReadTransformer.identity();
        }
        else {
            return new MappingQualityReadTransformer(FROM_QUALITY, TO_QUALITY);
        }
    }

    @Override
    public void onTraversalStart() {
        header = getHeaderForSAMWriter();
        try {
            referenceReader = new CachingIndexedFastaSequenceFile(referenceArguments.getReferencePath());
            GenomeLocParser genomeLocParser = new GenomeLocParser(getBestAvailableSequenceDictionary());
            outputWriter = createSAMWriter(IOUtils.getPath(OUTPUT), false);
            overhangManager = new OverhangFixingManager(header, outputWriter, genomeLocParser, referenceReader, MAX_RECORDS_IN_MEMORY, MAX_MISMATCHES_IN_OVERHANG, MAX_BASES_TO_CLIP, doNotFixOverhangs, processSecondaryAlignments);

        } catch (FileNotFoundException ex) {
            throw new UserException.CouldNotReadInputFile(referenceArguments.getReferencePath(), ex);
        }
    }

    @Override
    protected void firstPassApply(GATKRead read, ReferenceContext bytes, FeatureContext featureContext) {
        splitNCigarRead(read,overhangManager, true, header, processSecondaryAlignments);
    }

    @Override
    protected void secondPassApply(GATKRead read, ReferenceContext bytes, FeatureContext featureContext) {
        splitNCigarRead(read,overhangManager, true, header, processSecondaryAlignments);
    }

    // Activates writing in the manager, which destinguishes each pass
    @Override
    protected void afterFirstPass() {
        overhangManager.activateWriting();
    }

    @Override
    public void closeTool() {
        if (overhangManager != null) { overhangManager.flush(); }
        if (outputWriter != null ) { outputWriter.close(); }
        try {if (referenceReader != null) { referenceReader.close(); } }
        catch (IOException ex) {
            throw new UserException.MissingReference("Could not find reference file");
        }
    }

    /**
     * Goes through the cigar string of the read and create new reads for each consecutive non-N elements (while soft clipping the rest of the read) that are supplemental to each other.
     * For example: for a read with cigar '1H2M2D1M2N1M2I1N1M2S' 3 new reads will be created with cigar strings: 1H2M2D1M6S, 1H3S1M2I2S and 1H6S1M2S
     * If the read has an MC tag it will be adjusted according to the clipping of that mate based on its cigar
     *
     * @param read     the read to split (can be null)
     * @param emitReads   a parameter used to mock behavior for repairing mate cigar string information
     */
    public static GATKRead splitNCigarRead(final GATKRead read, OverhangFixingManager manager, boolean emitReads, SAMFileHeader header, boolean secondaryAlignments) {
        final int numCigarElements = read.numCigarElements();
        List<GATKRead> splitReads = new ArrayList<>(2);

        // Run the tool on dummy mate read to determine what the mate cigar will be upon completion, if manager has a prediction then dont repair
        if (emitReads && read.hasAttribute(MATE_CIGAR_TAG)) {
            final GATKRead mateSplitting = splitNCigarRead(ArtificialReadUtils.createArtificialRead(header, TextCigarCodec.decode(read.getAttributeAsString(MATE_CIGAR_TAG))), manager, false, header, secondaryAlignments);
            read.setAttribute(MATE_CIGAR_TAG, mateSplitting.getCigar().toString());
        }
        manager.setPredictedMateInformation(read);

        // If it is a secondary alignment, repair its mate-information (assuming its mate was primary) and pass
        if ( !secondaryAlignments &&  read.isSecondaryAlignment()){
            manager.addReadGroup(Collections.singletonList(read));
            return read;
        }

        boolean sectionHasMatch = false;
        int firstCigarIndex = 0;
        for ( int i = 0; i < numCigarElements; i++ ) {
            final CigarElement cigarElement = read.getCigarElement(i);
            CigarOperator op = cigarElement.getOperator();

            // One of the "Real" operators
            if (op == CigarOperator.M || op == CigarOperator.EQ || op == CigarOperator.X ||
                    op == CigarOperator.I || op == CigarOperator.D) {
                sectionHasMatch = true;
            }

            if (op == CigarOperator.N) {
                if (sectionHasMatch) {
                    if (!emitReads) {
                        // not passing the manager ensures that no splices get added to the manager for fake reads
                        splitReads.add(splitReadBasedOnCigar(read, firstCigarIndex, i, null));
                    } else {
                        splitReads.add(splitReadBasedOnCigar(read, firstCigarIndex, i, manager));
                    }
                }
                firstCigarIndex = i+1;
                sectionHasMatch = false;
            }
        }

        // if there are no N's in the read
        if (splitReads.size() < 1) {
            if (emitReads) {
                manager.addReadGroup(Collections.singletonList(read));
            }
            return read;
        }
        //add the last section of the read: from the last N to the the end of the read
        // (it will be done for all the usual cigar string that does not end with N)
        else if ((firstCigarIndex < numCigarElements) && sectionHasMatch) {
            splitReads.add(splitReadBasedOnCigar(read, firstCigarIndex, numCigarElements, null));
        }

        if (emitReads) {
            manager.addReadGroup(splitReads);
            return read;

        // If emitReads is false then we want the mate of the read
        } else {
            return splitReads.get(0);
        }
    }

    /**
     * Pull out an individual split position for a read
     *
     * @param read               the read being split
     * @param cigarStartIndex    the index of the first cigar element to keep
     * @param cigarEndIndex      the index of the last cigar element to keep
     * @param forSplitPositions  the manager for keeping track of split positions; can be null
     * @return a non-null read representing the section of the original read being split out
     */
    private static GATKRead splitReadBasedOnCigar(final GATKRead read, final int cigarStartIndex, final int cigarEndIndex, final OverhangFixingManager forSplitPositions) {
        int cigarFirstIndex = cigarStartIndex;
        int cigarSecondIndex = cigarEndIndex;

        //in case a section of the read ends or starts with D (for example the first section in 1M1D1N1M is 1M1D), we should trim this cigar element
        // it can be 'if', but it was kept as 'while' to make sure the code can work with Cigar strings that were not "cleaned"
        while(read.getCigarElement(cigarFirstIndex).getOperator().equals(CigarOperator.D)) {
            cigarFirstIndex++;
        }
        while(read.getCigarElement(cigarSecondIndex-1).getOperator().equals(CigarOperator.D)) {
            cigarSecondIndex--;
        }
        if(cigarFirstIndex > cigarSecondIndex) {
            throw new IllegalArgumentException("Cannot split this read (might be an empty section between Ns, for example 1N1D1N): " + read.getCigar().toString());
        }

        // we keep only the section of the read that is aligned to the reference between startRefIndex and stopRefIndex (inclusive).
        // the other sections of the read are clipped:
        final int startRefIndex = read.getUnclippedStart() + CigarUtils.countRefBasesBasedOnCigar(read, 0, cigarFirstIndex); //goes through the prefix of the cigar (up to cigarStartIndex) and move the reference index.
        final int stopRefIndex = startRefIndex + CigarUtils.countRefBasesBasedOnCigar(read,cigarFirstIndex,cigarSecondIndex)-1; //goes through a consecutive non-N section of the cigar (up to cigarEndIndex) and move the reference index.

        if ( forSplitPositions != null ) {
            final String contig = read.getContig();
            final int splitStart = startRefIndex + CigarUtils.countRefBasesBasedOnCigar(read,cigarFirstIndex,cigarEndIndex);  //we use cigarEndIndex instead of cigarSecondIndex so we won't take into account the D's at the end.
            final int splitEnd = splitStart + read.getCigarElement(cigarEndIndex).getLength() - 1;
            forSplitPositions.addSplicePosition(contig, splitStart, splitEnd);
        }

        return ReadClipper.softClipToRegionIncludingClippedBases(read,startRefIndex,stopRefIndex);
    }

    /**
     * A method that repairs the NH and NM tags for a group of reads
     *
     * @param readFamily         the a list of reads where the first item is the read to be marked as primary
     * @param header             the file header to associate with the given reads
     * @return a non-null read representing the section of the original read being split out
     */
    public static void repairSupplementaryTags(List<GATKRead> readFamily, SAMFileHeader header) {
        for (GATKRead read : readFamily) {
            for (String attribute : TAGS_TO_REMOVE) {
                read.clearAttribute(attribute);
            }
        }
        if (readFamily.size() > 1) {
            GATKRead primary = readFamily.remove(0);
            SATagBuilder.setReadsAsSupplemental(primary,readFamily);
        }
    }
}


text:
<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "CLN_MEDICINE_TEST".
 *
 * @property integer $MEDICINE_GEN_NO
 * @property integer $TRAN_INJ_GEN_NO
 * @property integer $CURE_GEN_NO
 * @property string $EXPENSES
 * @property integer $UNIT_POINT
 * @property integer $DISCOUNT
 * @property string $TOTAL
 * @property integer $VERSION
 * @property string $UPDATE_BY
 * @property string $UPDATE_DATE
 * @property string $CREATE_DATE
 * @property string $CREATE_BY
 */
class CLNMEDICINETEST2 extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'CLN_MEDICINE_TEST';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['MEDICINE_GEN_NO'], 'required'],
            [['MEDICINE_GEN_NO', 'TRAN_INJ_GEN_NO', 'CURE_GEN_NO', 'UNIT_POINT', 'DISCOUNT', 'VERSION'], 'integer'],
            [['EXPENSES', 'TOTAL'], 'number'],
            [['UPDATE_DATE', 'CREATE_DATE'], 'safe'],
            [['UPDATE_BY', 'CREATE_BY'], 'string', 'max' => 100],
            [['MEDICINE_GEN_NO'], 'unique']
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'MEDICINE_GEN_NO' => 'Medicine  Gen  No',
            'TRAN_INJ_GEN_NO' => 'Tran  Inj  Gen  No',
            'CURE_GEN_NO' => 'Cure  Gen  No',
            'EXPENSES' => 'Expenses',
            'UNIT_POINT' => 'Unit  Point',
            'DISCOUNT' => 'Discount',
            'TOTAL' => 'Total',
            'VERSION' => 'Version',
            'UPDATE_BY' => 'Update  By',
            'UPDATE_DATE' => 'Update  Date',
            'CREATE_DATE' => 'Create  Date',
            'CREATE_BY' => 'Create  By',
        ];
    }
}


text:
package spvwallet

import (
	"github.com/btcsuite/btcd/txscript"
	hd "github.com/btcsuite/btcutil/hdkeychain"
	"github.com/btcsuite/goleveldb/leveldb/errors"
)

const LOOKAHEADWINDOW = 100

type KeyPath struct {
	Purpose KeyPurpose
	Index   int
}

func (ts *TxStore) GetCurrentKey(purpose KeyPurpose) (*hd.ExtendedKey, error) {
	i, err := ts.Keys().GetUnused(purpose)
	if err != nil {
		return nil, err
	}
	if len(i) == 0 {
		return nil, errors.New("No unused keys in database")
	}
	return ts.generateChildKey(purpose, uint32(i[0]))
}

func (ts *TxStore) GetFreshKey(purpose KeyPurpose) *hd.ExtendedKey {
	index, _, err := ts.Keys().GetLastKeyIndex(purpose)
	var childKey *hd.ExtendedKey
	if err != nil {
		index = 0
	} else {
		index += 1
	}
	for {
		childKey, err = ts.generateChildKey(purpose, uint32(index))
		if err == nil {
			break
		}
		index += 1
	}
	addr, _ := childKey.Address(ts.Param)
	script, _ := txscript.PayToAddrScript(addr)
	p := KeyPath{KeyPurpose(purpose), index}
	ts.Keys().Put(script, p)
	return childKey
}

func (ts *TxStore) GetKeys() []*hd.ExtendedKey {
	var keys []*hd.ExtendedKey
	keyPaths, err := ts.Keys().GetAll()
	if err != nil {
		return keys
	}
	for _, path := range keyPaths {
		k, err := ts.generateChildKey(path.Purpose, uint32(path.Index))
		if err != nil {
			continue
		}
		keys = append(keys, k)
	}
	return keys
}

func (ts *TxStore) GetKeyForScript(scriptPubKey []byte) (*hd.ExtendedKey, error) {
	keyPath, err := ts.Keys().GetPathForScript(scriptPubKey)
	if err != nil {
		key, err := ts.Keys().GetKeyForScript(scriptPubKey)
		if err != nil {
			return nil, err
		}
		hdKey := hd.NewExtendedKey(
			ts.Param.HDPrivateKeyID[:],
			key.Serialize(),
			make([]byte, 32),
			[]byte{0x00, 0x00, 0x00, 0x00},
			0,
			0,
			true)
		return hdKey, nil
	}
	return ts.generateChildKey(keyPath.Purpose, uint32(keyPath.Index))
}

func (ts *TxStore) generateChildKey(purpose KeyPurpose, index uint32) (*hd.ExtendedKey, error) {
	if purpose == EXTERNAL {
		return ts.externalKey.Child(index)
	} else if purpose == INTERNAL {
		return ts.internalKey.Child(index)
	}
	return nil, errors.New("Unknown key purpose")
}

func (ts *TxStore) lookahead() {
	lookaheadWindows := ts.Keys().GetLookaheadWindows()
	for purpose, size := range lookaheadWindows {
		if size < LOOKAHEADWINDOW {
			for i := 0; i < (LOOKAHEADWINDOW - size); i++ {
				ts.GetFreshKey(purpose)
			}
		}
	}
}


text:
delete from annotatable_entity;
insert into annotatable_entity values (1);
insert into annotatable_entity values (2);
insert into annotatable_entity values (3);
insert into annotatable_entity values (4);
insert into annotatable_entity values (5);
insert into annotatable_entity values (6);
insert into annotatable_entity values (7);
insert into annotatable_entity values (8);
insert into annotatable_entity values (9);
insert into annotatable_entity values (10);
insert into annotatable_entity values (11);
insert into annotatable_entity values (12);
insert into annotatable_entity values (13);
insert into annotatable_entity values (14);
insert into annotatable_entity values (15);
insert into annotatable_entity values (16);
insert into annotatable_entity values (17);
insert into annotatable_entity values (18);
insert into annotatable_entity values (19);
insert into annotatable_entity values (20);
insert into annotatable_entity values (21);
insert into annotatable_entity values (22);
insert into annotatable_entity values (23);
insert into annotatable_entity values (24);
insert into annotatable_entity values (25);
insert into annotatable_entity values (26);
insert into annotatable_entity values (27);
insert into annotatable_entity values (28);
insert into annotatable_entity values (29);
insert into annotatable_entity values (30);
insert into annotatable_entity values (31);
insert into annotatable_entity values (32);
insert into annotatable_entity values (33);
insert into annotatable_entity values (34);
insert into annotatable_entity values (35);
insert into annotatable_entity values (36);
insert into annotatable_entity values (37);
insert into annotatable_entity values (38);
insert into annotatable_entity values (39);
insert into annotatable_entity values (40);
insert into annotatable_entity values (41);
insert into annotatable_entity values (42);
insert into annotatable_entity values (43);
insert into annotatable_entity values (44);
insert into annotatable_entity values (45);
insert into annotatable_entity values (46);
insert into annotatable_entity values (47);
insert into annotatable_entity values (48);
insert into annotatable_entity values (49);
insert into annotatable_entity values (50);
insert into annotatable_entity values (51);
insert into annotatable_entity values (52);
insert into annotatable_entity values (53);
insert into annotatable_entity values (54);
insert into annotatable_entity values (55);
insert into annotatable_entity values (56);
insert into annotatable_entity values (57);
insert into annotatable_entity values (58);
insert into annotatable_entity values (59);
insert into annotatable_entity values (60);
insert into annotatable_entity values (61);
insert into annotatable_entity values (62);
insert into annotatable_entity values (63);
insert into annotatable_entity values (64);
insert into annotatable_entity values (65);
insert into annotatable_entity values (66);
insert into annotatable_entity values (67);
insert into annotatable_entity values (68);
insert into annotatable_entity values (69);
insert into annotatable_entity values (70);
insert into annotatable_entity values (71);
insert into annotatable_entity values (72);