text:
/**
 * @fileoverview Functions for injecting Blockly into a web page.
 * @author fraser@google.com (Neil Fraser)
 */
'use strict';

/**
 * Initialize the SVG document with various handlers.
 * @param {!Element} container Containing element.
 * @param {Object} opt_options Optional dictionary of options.
 */
Blockly.inject = function(container, opt_options) {
  // Verify that the container is in document.
  if (!goog.dom.contains(document, container)) {
    throw 'Error: container is not in current document.';
  }
  if (opt_options) {
    Blockly.parseOptions_(opt_options);
  }
  Blockly.createDom_(container);
  Blockly.init_();
};

/**
 * Configure Blockly to behave according to a set of options.
 * @param {!Object} options Dictionary of options.
 * @private
 */
Blockly.parseOptions_ = function(options) {
  Blockly.RTL = !!options['rtl'];
  Blockly.editable = !options['readOnly'];
  Blockly.pathToBlockly = options['path'] || './';
};

/**
 * Create the SVG image.
 * @param {!Element} container Containing element.
 * @private
 */
Blockly.createDom_ = function(container) {
  // Load CSS.
  //<link href="blockly.css" rel="stylesheet" type="text/css" />
  var link = goog.dom.createDom('link', {
      'href': Blockly.pathToBlockly + 'media/blockly.css',
      'rel': 'stylesheet',
      'type': 'text/css',
      'onload': 'Blockly.cssLoaded()'});
  var head = document.head || document.getElementsByTagName('head')[0];
  if (!head) {
    throw 'No head in document.';
  }
  head.appendChild(link);

  // Build the SVG DOM.
  /*
  <svg
    xmlns="http://www.w3.org/2000/svg"
    xmlns:html="http://www.w3.org/1999/xhtml"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    version="1.1"
    class="blocklySvg">
    ...
  </svg>
  */
  var svg = Blockly.createSvgElement('svg', {
    'xmlns': 'http://www.w3.org/2000/svg',
    'xmlns:html': 'http://www.w3.org/1999/xhtml',
    'xmlns:xlink': 'http://www.w3.org/1999/xlink',
    'version': '1.1',
    'class': 'blocklySvg'
  }, null);
  /*
  <defs>
    ... filters go here ...
  </defs>
  */
  var defs = Blockly.createSvgElement('defs', {}, svg);
  var filter, feSpecularLighting, feMerge, pattern;
  /*
    <filter id="blocklyEmboss">
      <feGaussianBlur in="SourceAlpha" stdDeviation="1" result="blur"/>
      <feSpecularLighting in="blur" surfaceScale="1" specularConstant="0.5"
                          specularExponent="10" lighting-color="white"
                          result="specOut">
        <fePointLight x="-5000" y="-10000" z="20000"/>
      </feSpecularLighting>
      <feComposite in="specOut" in2="SourceAlpha" operator="in"
                   result="specOut"/>
      <feComposite in="SourceGraphic" in2="specOut" operator="arithmetic"
                   k1="0" k2="1" k3="1" k4="0"/>
    </filter>
  */
  filter = Blockly.createSvgElement('filter', {'id': 'blocklyEmboss'}, defs);
  Blockly.createSvgElement('feGaussianBlur',
      {'in': 'SourceAlpha', 'stdDeviation': 1, 'result': 'blur'}, filter);
  feSpecularLighting = Blockly.createSvgElement('feSpecularLighting',
      {'in': 'blur', 'surfaceScale': 1, 'specularConstant': 0.5,
      'specularExponent': 10, 'lighting-color': 'white', 'result': 'specOut'},
      filter);
  Blockly.createSvgElement('fePointLight',
      {'x': -5000, 'y': -10000, 'z': 20000}, feSpecularLighting);
  Blockly.createSvgElement('feComposite',
      {'in': 'specOut', 'in2': 'SourceAlpha', 'operator': 'in',
      'result': 'specOut'}, filter);
  Blockly.createSvgElement('feComposite',
      {'in': 'SourceGraphic', 'in2': 'specOut', 'operator': 'arithmetic',
      'k1': 0, 'k2': 1, 'k3': 1, 'k4': 0}, filter);
  /*
    <filter id="blocklyTrashcanShadowFilter">
      <feGaussianBlur in="SourceAlpha" stdDeviation="2" result="blur"/>
      <feOffset in="blur" dx="1" dy="1" result="offsetBlur"/>
      <feMerge>
        <feMergeNode in="offsetBlur"/>
        <feMergeNode in="SourceGraphic"/>
      </feMerge>
    </filter>
  */
  filter = Blockly.createSvgElement('filter',
      {'id': 'blocklyTrashcanShadowFilter'}, defs);
  Blockly.createSvgElement('feGaussianBlur',
      {'in': 'SourceAlpha', 'stdDeviation': 2, 'result': 'blur'}, filter);
  Blockly.createSvgElement('feOffset',
      {'in': 'blur', 'dx': 1, 'dy': 1, 'result': 'offsetBlur'}, filter);
  feMerge = Blockly.createSvgElement('feMerge', {}, filter);
  Blockly.createSvgElement('feMergeNode', {'in': 'offsetBlur'}, feMerge);
  Blockly.createSvgElement('feMergeNode', {'in': 'SourceGraphic'}, feMerge);
  /*
    <filter id="blocklyShadowFilter">
      <feGaussianBlur stdDeviation="2"/>
    </filter>
  */
  filter = Blockly.createSvgElement('filter',
      {'id': 'blocklyShadowFilter'}, defs);
  Blockly.createSvgElement('feGaussianBlur', {'stdDeviation': 2}, filter);
  /*
    <pattern id="blocklyDisabledPattern" patternUnits="userSpaceOnUse"
             width="10" height="10">
      <rect width="10" height="10" fill="#aaa" />
      <path d="M 0 0 L 10 10 M 10 0 L 0 10" stroke="#cc0" />
    </pattern>
  */
  pattern = Blockly.createSvgElement('pattern',
      {'id': 'blocklyDisabledPattern', 'patternUnits': 'userSpaceOnUse',
       'width': 10, 'height': 10}, defs);
  Blockly.createSvgElement('rect',
      {'width': 10, 'height': 10, 'fill': '#aaa'}, pattern);
  Blockly.createSvgElement('path',
      {'d': 'M 0 0 L 10 10 M 10 0 L 0 10', 'stroke': '#cc0'}, pattern);
  Blockly.mainWorkspace = new Blockly.Workspace(Blockly.editable);
  svg.appendChild(Blockly.mainWorkspace.createDom());
  if (Blockly.Toolbox && Blockly.editable) {
    svg.appendChild(Blockly.Toolbox.createDom());
  }
  Blockly.Tooltip && svg.appendChild(Blockly.Tooltip.createDom());
  if (Blockly.editable) {
    svg.appendChild(Blockly.FieldDropdown.createDom());
  }
  if (Blockly.ContextMenu) {
    svg.appendChild(Blockly.ContextMenu.createDom());
  }

  // The SVG is now fully assembled.  Add it to the container.
  container.appendChild(svg);
  Blockly.svg = svg;
  Blockly.svgResize();

  // Create an HTML container for popup overlays (e.g. editor widgets).
  Blockly.widgetDiv = goog.dom.createDom('div', {
      'class': 'blocklyWidgetDiv'});
  container.appendChild(Blockly.widgetDiv);
};

/**
 * Initialize Blockly with various handlers.
 * @private
 */
Blockly.init_ = function() {
  Blockly.bindEvent_(window, 'resize', document, Blockly.svgResize);
  // Bind events for scrolling the workspace.
  // Most of these events should be bound to the SVG's surface.
  // However, 'mouseup' has to be on the whole document so that a block dragged
  // out of bounds and released will know that it has been released.
  // Also, 'keydown' has to be on the whole document since the browser doesn't
  // understand a concept of focus on the SVG image.
  Blockly.bindEvent_(Blockly.svg, 'mousedown', null, Blockly.onMouseDown_);
  Blockly.bindEvent_(document, 'mouseup', null, Blockly.onMouseUp_);
  Blockly.bindEvent_(Blockly.svg, 'mousemove', null, Blockly.onMouseMove_);
  Blockly.bindEvent_(Blockly.svg, 'contextmenu', null, Blockly.onContextMenu_);
  Blockly.bindEvent_(document, 'keydown', null, Blockly.onKeyDown_);

  if (Blockly.editable) {
    Blockly.Toolbox && Blockly.Toolbox.init();
  }

  Blockly.mainWorkspace.addTrashcan(Blockly.getMainWorkspaceMetrics);
  Blockly.mainWorkspace.scrollbar = new Blockly.ScrollbarPair(
      Blockly.mainWorkspace.getBubbleCanvas(),
      Blockly.getMainWorkspaceMetrics, Blockly.setMainWorkspaceMetrics);

  // Load the sounds.
  Blockly.loadAudio_('click');
  Blockly.loadAudio_('delete');
};


text:
package gov.hhs.fha.nhinc.docquery._30.nhin;

import gov.hhs.fha.nhinc.aspect.InboundMessageEvent;
import gov.hhs.fha.nhinc.docquery.aspect.AdhocQueryRequestDescriptionBuilder;
import gov.hhs.fha.nhinc.docquery.aspect.AdhocQueryResponseDescriptionBuilder;
import gov.hhs.fha.nhinc.docquery.inbound.InboundDocQuery;
import ihe.iti.xds_b._2007.RespondingGatewayQueryPortType;

import javax.annotation.Resource;
import javax.xml.ws.BindingType;
import javax.xml.ws.WebServiceContext;
import javax.xml.ws.soap.Addressing;

import oasis.names.tc.ebxml_regrep.xsd.query._3.AdhocQueryRequest;
import oasis.names.tc.ebxml_regrep.xsd.query._3.AdhocQueryResponse;

/**
 *
 * @author Neil Webb, msw
 */
@BindingType(value = javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING)
@Addressing(enabled = true)
public class DocQuery implements RespondingGatewayQueryPortType {

    private InboundDocQuery inboundDocQuery;
    private WebServiceContext context;

    /**
     * The web service implementation for Document Query.
     *
     * @param body
     *            the body of the request
     * @return the query response for the document query
     */
    @InboundMessageEvent(beforeBuilder = AdhocQueryRequestDescriptionBuilder.class,
            afterReturningBuilder = AdhocQueryResponseDescriptionBuilder.class, serviceType = "Document Query",
            version = "3.0")
    public AdhocQueryResponse respondingGatewayCrossGatewayQuery(AdhocQueryRequest body) {
        return new DocQueryImpl(inboundDocQuery).respondingGatewayCrossGatewayQuery(body, context);
    }

    @Resource
    public void setContext(WebServiceContext context) {
        this.context = context;
    }

    public void setInboundDocQuery(InboundDocQuery inboundDocQuery) {
        this.inboundDocQuery = inboundDocQuery;
    }

    /**
     * Gets the inbound doc query dependency.
     *
     * @return the inbound doc query
     */
    public InboundDocQuery getInboundDocQuery() {
        return this.inboundDocQuery;
    }
}

redpajama_set_name: RedPajamaGithub


text:
package com.heaven7.java.data.io.music.in;

import com.heaven7.java.base.anno.NonNull;
import com.heaven7.java.base.util.Predicates;
import com.heaven7.java.data.io.bean.CutConfigBeanV10;
import com.heaven7.java.data.io.bean.CutInfo;
import com.heaven7.java.data.io.music.UniformNameHelper;
import com.heaven7.java.data.io.music.mock.MockExcelCol;
import com.heaven7.java.data.io.music.mock.MockExcelRow;
import com.heaven7.java.data.io.music.transfer.TransitionCutTransfer;
import com.heaven7.java.data.io.poi.ExcelRow;
import com.heaven7.java.visitor.ResultVisitor;
import com.heaven7.java.visitor.collection.VisitServices;

import java.util.*;

/**
 * @author heaven7
 */
public class TransferCutSource implements ExcelSource {

    private final CutConfigBeanV10 bean;
    private List<ExcelRow> mRows;

    public TransferCutSource(@NonNull CutConfigBeanV10 bean) {
        this.bean = bean;
    }

    @Override
    public List<ExcelRow> getRows() {
        if(mRows == null){
            List<CutConfigBeanV10.CutItem> cutItems = bean.getCutItems();
            if(Predicates.isEmpty(cutItems)){
                return Collections.emptyList();
            }
            List<ExcelRow> list = VisitServices.from(cutItems).map(new ResultVisitor<CutConfigBeanV10.CutItem, ExcelRow>() {
                @Override
                public ExcelRow visit(CutConfigBeanV10.CutItem cutItem, Object param) {
                    //trans cut
                    List<Float> transCuts = VisitServices.from(cutItem.getCutLines()).map(new ResultVisitor<CutConfigBeanV10.CutLine, Float>() {
                        @Override
                        public Float visit(CutConfigBeanV10.CutLine cutLine, Object param) {
                            if (cutLine.hasFlag(CutInfo.FLAG_TRANSITION_CUT)) {
                                return cutLine.getCut();
                            }
                            return null;
                        }
                    }).getAsList();
                    if (Predicates.isEmpty(transCuts)) {
                        return null;
                    }
                    String transCut = VisitServices.from(transCuts).joinToString(",");
                    List<MockExcelCol> cols = Arrays.asList(new MockExcelCol(UniformNameHelper.uniformSimpleMusicName(cutItem.getName())),
                            new MockExcelCol(cutItem.getDuration() + ""), new MockExcelCol("unused"),
                            new MockExcelCol(transCut));
                    return new MockExcelRow(cols);
                }
            }).getAsList();
            //nop populate
            mRows = new ArrayList<>();
            for (int i =0, count = list.size() ; i < count ; i ++){
                mRows.addAll(createNopRows());
                mRows.add(list.get(i));
            }
            for(int i = 0 , size = mRows.size() ; i < size ; i ++){
                MockExcelRow excelRow = (MockExcelRow) mRows.get(i);
                excelRow.setRowIndex(i);
            }
        }
        return mRows;
    }
    //nop populate
    private Collection<? extends ExcelRow> createNopRows() {
        //nop populate
        List<ExcelRow> nopRows = new ArrayList<>();
        for (int i = 0; i < TransitionCutTransfer.PERIOD - 1 ; i ++){
            nopRows.add(new MockExcelRow());
        }
        return nopRows;
    }

}


text:
#include "UefiLibInternal.h"

typedef struct {
  CHAR16  WChar;
  UINT32  Width;
} UNICODE_WIDTH_ENTRY;

#define NARROW_CHAR         0xFFF0
#define WIDE_CHAR           0xFFF1

GLOBAL_REMOVE_IF_UNREFERENCED CONST UNICODE_WIDTH_ENTRY mUnicodeWidthTable[] = {
  //
  // General script area
  //
  {(CHAR16)0x1FFF,  1},
  /*
   * Merge the blocks and replace them with the above entry as they fall to
   * the same category and they are all narrow glyph. This will reduce search
   * time and table size. The merge will omit the reserved code.
   *
   * Remove the above item if below is un-commented.
   *
  {(CHAR16)0x007F,  1},       // C0 controls and basic Latin. 0x0000-0x007F
  {(CHAR16)0x00FF,  1},       // C1 controls and Latin-1 support. 0x0080-0x00FF
  {(CHAR16)0x017F,  1},       // Latin extended-A. 0x0100-0x017F
  {(CHAR16)0x024F,  1},       // Latin extended-B. 0x0180-0x024F
  {(CHAR16)0x02AF,  1},       // IPA extensions. 0x0250-0x02AF
  {(CHAR16)0x02FF,  1},       // Spacing modifier letters. 0x02B0-0x02FF
  {(CHAR16)0x036F,  1},       // Combining diacritical marks. 0x0300-0x036F
  {(CHAR16)0x03FF,  1},       // Greek. 0x0370-0x03FF
  {(CHAR16)0x04FF,  1},       // Cyrillic. 0x0400-0x04FF
  {(CHAR16)0x052F,  0},       // Unassigned. As Armenian in ver3.0. 0x0500-0x052F
  {(CHAR16)0x058F,  1},       // Armenian. 0x0530-0x058F
  {(CHAR16)0x05FF,  1},       // Hebrew. 0x0590-0x05FF
  {(CHAR16)0x06FF,  1},       // Arabic. 0x0600-0x06FF
  {(CHAR16)0x08FF,  0},       // Unassigned. 0x0700-0x08FF
  {(CHAR16)0x097F,  1},       // Devanagari. 0x0900-0x097F
  {(CHAR16)0x09FF,  1},       // Bengali. 0x0980-0x09FF
  {(CHAR16)0x0A7F,  1},       // Gurmukhi. 0x0A00-0x0A7F
  {(CHAR16)0x0AFF,  1},       // Gujarati. 0x0A80-0x0AFF
  {(CHAR16)0x0B7F,  1},       // Oriya. 0x0B00-0x0B7F
  {(CHAR16)0x0BFF,  1},       // Tamil. (See page 7-92). 0x0B80-0x0BFF
  {(CHAR16)0x0C7F,  1},       // Telugu. 0x0C00-0x0C7F
  {(CHAR16)0x0CFF,  1},       // Kannada. (See page 7-100). 0x0C80-0x0CFF
  {(CHAR16)0x0D7F,  1},       // Malayalam (See page 7-104). 0x0D00-0x0D7F
  {(CHAR16)0x0DFF,  0},       // Unassigned. 0x0D80-0x0DFF
  {(CHAR16)0x0E7F,  1},       // Thai. 0x0E00-0x0E7F
  {(CHAR16)0x0EFF,  1},       // Lao. 0x0E80-0x0EFF
  {(CHAR16)0x0FBF,  1},       // Tibetan. 0x0F00-0x0FBF
  {(CHAR16)0x109F,  0},       // Unassigned. 0x0FC0-0x109F
  {(CHAR16)0x10FF,  1},       // Georgian. 0x10A0-0x10FF
  {(CHAR16)0x11FF,  1},       // Hangul Jamo. 0x1100-0x11FF
  {(CHAR16)0x1DFF,  0},       // Unassigned. 0x1200-0x1DFF
  {(CHAR16)0x1EFF,  1},       // Latin extended additional. 0x1E00-0x1EFF
  {(CHAR16)0x1FFF,  1},       // Greek extended. 0x1F00-0x1FFF
  *
  */

  //
  // Symbol area
  //
  {(CHAR16)0x2FFF,  1},
  /*
   * Merge the blocks and replace them with the above entry as they fall to
   * the same category and they are all narrow glyph. This will reduce search
   * time and table size. The merge will omit the reserved code.
   *
   * Remove the above item if below is un-commented.
   *
  {(CHAR16)0x206F,  1},       // General punctuation. (See page7-154). 0x200-0x206F
  {(CHAR16)0x209F,  1},       // Superscripts and subscripts. 0x2070-0x209F
  {(CHAR16)0x20CF,  1},       // Currency symbols. 0x20A0-0x20CF
  {(CHAR16)0x20FF,  1},       // Combining diacritical marks for symbols. 0x20D0-0x20FF
  {(CHAR16)0x214F,  1},       // Letterlike sympbols. 0x2100-0x214F
  {(CHAR16)0x218F,  1},       // Number forms. 0x2150-0x218F
  {(CHAR16)0x21FF,  1},       // Arrows. 0x2190-0x21FF
  {(CHAR16)0x22FF,  1},       // Mathematical operators. 0x2200-0x22FF
  {(CHAR16)0x23FF,  1},       // Miscellaneous technical. 0x2300-0x23FF
  {(CHAR16)0x243F,  1},       // Control pictures. 0x2400-0x243F
  {(CHAR16)0x245F,  1},       // Optical character recognition. 0x2440-0x245F
  {(CHAR16)0x24FF,  1},       // Enclosed alphanumerics. 0x2460-0x24FF
  {(CHAR16)0x257F,  1},       // Box drawing. 0x2500-0x257F
  {(CHAR16)0x259F,  1},       // Block elements. 0x2580-0x259F
  {(CHAR16)0x25FF,  1},       // Geometric shapes. 0x25A0-0x25FF
  {(CHAR16)0x26FF,  1},       // Miscellaneous symbols. 0x2600-0x26FF
  {(CHAR16)0x27BF,  1},       // Dingbats. 0x2700-0x27BF
  {(CHAR16)0x2FFF,  0},       // Reserved. 0x27C0-0x2FFF
  *
  */

  //
  // CJK phonetics and symbol area
  //
  {(CHAR16)0x33FF,  2},
  /*
   * Merge the blocks and replace them with the above entry as they fall to
   * the same category and they are all wide glyph. This will reduce search
   * time and table size. The merge will omit the reserved code.
   *
   * Remove the above item if below is un-commented.
   *
  {(CHAR16)0x303F,  2},       // CJK symbols and punctuation. 0x3000-0x303F
  {(CHAR16)0x309F,  2},       // Hiragana. 0x3040-0x309F
  {(CHAR16)0x30FF,  2},       // Katakana. 0x30A0-0x30FF
  {(CHAR16)0x312F,  2},       // Bopomofo. 0x3100-0x312F
  {(CHAR16)0x318F,  2},       // Hangul compatibility jamo. 0x3130-0x318F
  {(CHAR16)0x319F,  2},       // Kanbun. 0x3190-0x319F
  {(CHAR16)0x31FF,  0},       // Reserved. As Bopomofo extended in ver3.0. 0x31A0-0x31FF
  {(CHAR16)0x32FF,  2},       // Enclosed CJK letters and months. 0x3200-0x32FF
  {(CHAR16)0x33FF,  2},       // CJK compatibility. 0x3300-0x33FF
  *
  */

  //
  // CJK ideograph area
  //
  {(CHAR16)0x9FFF,  2},
  /*
   * Merge the blocks and replace them with the above entry as they fall to
   * the same category and they are all wide glyph. This will reduce search
   * time and table size. The merge will omit the reserved code.
   *
   * Remove the above item if below is un-commented.
   *
  {(CHAR16)0x4DFF,  0},       // Reserved. 0x3400-0x4DBF as CJK unified ideographs
                      // extension A in ver3.0. 0x3400-0x4DFF
  {(CHAR16)0x9FFF,  2},       // CJK unified ideographs. 0x4E00-0x9FFF
  *
  */

  //
  // Reserved
  //
  {(CHAR16)0xABFF,  0},       // Reserved. 0xA000-0xA490 as Yi syllables. 0xA490-0xA4D0
  // as Yi radicals in ver3.0. 0xA000-0xABFF
  //
  // Hangul syllables
  //
  {(CHAR16)0xD7FF,  2},
  /*
   * Merge the blocks and replace them with the above entry as they fall to
   * the same category and they are all wide glyph. This will reduce search
   * time and table size. The merge will omit the reserved code.
   *
   * Remove the above item if below is un-commented.
   *
  {(CHAR16)0xD7A3,  2},       // Hangul syllables. 0xAC00-0xD7A3
  {(CHAR16)0xD7FF,  0},       // Reserved. 0xD7A3-0xD7FF
  *
  */

  //
  // Surrogates area
  //
  {(CHAR16)0xDFFF,  0},       // Surrogates, not used now. 0xD800-0xDFFF

  //
  // Private use area
  //
  {(CHAR16)0xF8FF,  0},       // Private use area. 0xE000-0xF8FF

  //
  // Compatibility area and specials
  //
  {(CHAR16)0xFAFF,  2},       // CJK compatibility ideographs. 0xF900-0xFAFF
  {(CHAR16)0xFB4F,  1},       // Alphabetic presentation forms. 0xFB00-0xFB4F
  {(CHAR16)0xFDFF,  1},       // Arabic presentation forms-A. 0xFB50-0xFDFF
  {(CHAR16)0xFE1F,  0},       // Reserved. As variation selectors in ver3.0. 0xFE00-0xFE1F
  {(CHAR16)0xFE2F,  1},       // Combining half marks. 0xFE20-0xFE2F
  {(CHAR16)0xFE4F,  2},       // CJK compatibility forms. 0xFE30-0xFE4F
  {(CHAR16)0xFE6F,  1},       // Small Form Variants. 0xFE50-0xFE6F
  {(CHAR16)0xFEFF,  1},       // Arabic presentation forms-B. 0xFE70-0xFEFF
  {(CHAR16)0xFFEF,  1},       // Half width and full width forms. 0xFF00-0xFFEF
  {(CHAR16)0xFFFF,  0},       // Speicials. 0xFFF0-0xFFFF
};

/**
  Retrieves the width of a Unicode character.

  This function computes and returns the width of the Unicode character specified
  by UnicodeChar.

  @param  UnicodeChar   A Unicode character.

  @retval 0             The width if UnicodeChar could not be determined.
  @retval 1             UnicodeChar is a narrow glyph.
  @retval 2             UnicodeChar is a wide glyph.

**/
UINTN
EFIAPI
GetGlyphWidth (
  IN CHAR16  UnicodeChar
  )
{
  UINTN                     Index;
  UINTN                     Low;
  UINTN                     High;
  CONST UNICODE_WIDTH_ENTRY *Item;

  Item  = NULL;
  Low   = 0;
  High  = (sizeof (mUnicodeWidthTable)) / (sizeof (UNICODE_WIDTH_ENTRY)) - 1;
  while (Low <= High) {
    Index = (Low + High) >> 1;
    Item  = &(mUnicodeWidthTable[Index]);
    if (Index == 0) {
      if (UnicodeChar <= Item->WChar) {
        break;
      }

      return 0;
    }

    if (UnicodeChar > Item->WChar) {
      Low = Index + 1;
    } else if (UnicodeChar <= mUnicodeWidthTable[Index - 1].WChar) {
      High = Index - 1;
    } else {
      //
      // Index - 1 < UnicodeChar <= Index. Found
      //
      break;
    }
  }

  if (Low <= High) {
    return Item->Width;
  }

  return 0;
}

/**
  Computes the display length of a Null-terminated Unicode String.

  This function computes and returns the display length of the Null-terminated
  Unicode string specified by String.  If String is NULL then 0 is returned. If
  any of the widths of the Unicode characters in String can not be determined,
  then 0 is returned. The display width of String can be computed by summing the
  display widths of each Unicode character in String.  Unicode characters that
  are narrow glyphs have a width of 1, and Unicode characters that are width glyphs
  have a width of 2.  If String is not aligned on a 16-bit boundary, then ASSERT().

  @param  String      A pointer to a Null-terminated Unicode string.

  @return The display length of the Null-terminated Unicode string specified by String.

**/
UINTN
EFIAPI
UnicodeStringDisplayLength (
  IN CONST CHAR16  *String
  )
{
  UINTN      Length;
  UINTN      Width;

  if (String == NULL) {
    return 0;
  }

  Length = 0;
  while (*String != 0) {
    Width = GetGlyphWidth (*String);
    if (Width == 0) {
      return 0;
    }

    Length += Width;
    String++;
  }

  return Length;
}

/**
  Count the storage space of a Unicode string.

  This function handles the Unicode string with NARROW_CHAR
  and WIDE_CHAR control characters. NARROW_HCAR and WIDE_CHAR
  does not count in the resultant output. If a WIDE_CHAR is
  hit, then 2 Unicode character will consume an output storage
  space with size of CHAR16 till a NARROW_CHAR is hit.

  @param String          The input string to be counted.
  @param LimitLen        Whether need to limit the string length.
  @param MaxWidth        The max length this function supported.
  @param Offset          The max index of the string can be show out.

  @return Storage space for the input string.

**/
UINTN
UefiLibGetStringWidth (
  IN  CHAR16               *String,
  IN  BOOLEAN              LimitLen,
  IN  UINTN                MaxWidth,
  OUT UINTN                *Offset
  )
{
  UINTN Index;
  UINTN Count;
  UINTN IncrementValue;

  if (String == NULL) {
    return 0;
  }

  Index           = 0;
  Count           = 0;
  IncrementValue  = 1;

  do {
    //
    // Advance to the null-terminator or to the first width directive
    //
    for (;(String[Index] != NARROW_CHAR) && (String[Index] != WIDE_CHAR) && (String[Index] != 0); Index++) {
      Count = Count + IncrementValue;

      if (LimitLen && Count > MaxWidth) {
        break;
      }
    }

    //
    // We hit the null-terminator, we now have a count
    //
    if (String[Index] == 0) {
      break;
    }

    if (LimitLen && Count > MaxWidth) {
      *Offset = Index;
      break;
    }

    //
    // We encountered a narrow directive - strip it from the size calculation since it doesn't get printed
    // and also set the flag that determines what we increment by.(if narrow, increment by 1, if wide increment by 2)
    //
    if (String[Index] == NARROW_CHAR) {
      //
      // Skip to the next character
      //
      Index++;
      IncrementValue = 1;
    } else {
      //
      // Skip to the next character
      //
      Index++;
      IncrementValue = 2;
    }
  } while (String[Index] != 0);

  return Count * sizeof (CHAR16);
}

/**
  Draws a dialog box to the console output device specified by
  ConOut defined in the EFI_SYSTEM_TABLE and waits for a keystroke
  from the console input device specified by ConIn defined in the
  EFI_SYSTEM_TABLE.

  If there are no strings in the variable argument list, then ASSERT().
  If all the strings in the variable argument list are empty, then ASSERT().

  @param[in]   Attribute  Specifies the foreground and background color of the popup.
  @param[out]  Key        A pointer to the EFI_KEY value of the key that was
                          pressed.  This is an optional parameter that may be NULL.
                          If it is NULL then no wait for a keypress will be performed.
  @param[in]  ...         The variable argument list that contains pointers to Null-
                          terminated Unicode strings to display in the dialog box.
                          The variable argument list is terminated by a NULL.

**/
VOID
EFIAPI
CreatePopUp (
  IN  UINTN          Attribute,
  OUT EFI_INPUT_KEY  *Key,      OPTIONAL
  ...
  )
{
  EFI_STATUS                       Status;
  VA_LIST                          Args;
  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *ConOut;
  EFI_SIMPLE_TEXT_OUTPUT_MODE      SavedConsoleMode;
  UINTN                            Columns;
  UINTN                            Rows;
  UINTN                            Column;
  UINTN                            Row;
  UINTN                            NumberOfLines;
  UINTN                            MaxLength;
  CHAR16                           *String;
  UINTN                            Length;
  CHAR16                           *Line;
  UINTN                            EventIndex;
  CHAR16                           *TmpString;

  //
  // Determine the length of the longest line in the popup and the the total
  // number of lines in the popup
  //
  VA_START (Args, Key);
  MaxLength = 0;
  NumberOfLines = 0;
  while ((String = VA_ARG (Args, CHAR16 *)) != NULL) {
    MaxLength = MAX (MaxLength, UefiLibGetStringWidth (String, FALSE, 0, NULL) / 2);
    NumberOfLines++;
  }
  VA_END (Args);

  //
  // If the total number of lines in the popup is zero, then ASSERT()
  //
  ASSERT (NumberOfLines != 0);

  //
  // If the maximum length of all the strings is zero, then ASSERT()
  //
  ASSERT (MaxLength != 0);

  //
  // Cache a pointer to the Simple Text Output Protocol in the EFI System Table
  //
  ConOut = gST->ConOut;

  //
  // Save the current console cursor position and attributes
  //
  CopyMem (&SavedConsoleMode, ConOut->Mode, sizeof (SavedConsoleMode));

  //
  // Retrieve the number of columns and rows in the current console mode
  //
  ConOut->QueryMode (ConOut, SavedConsoleMode.Mode, &Columns, &Rows);

  //
  // Disable cursor and set the foreground and background colors specified by Attribute
  //
  ConOut->EnableCursor (ConOut, FALSE);
  ConOut->SetAttribute (ConOut, Attribute);

  //
  // Limit NumberOfLines to height of the screen minus 3 rows for the box itself
  //
  NumberOfLines = MIN (NumberOfLines, Rows - 3);

  //
  // Limit MaxLength to width of the screen minus 2 columns for the box itself
  //
  MaxLength = MIN (MaxLength, Columns - 2);

  //
  // Compute the starting row and starting column for the popup
  //
  Row    = (Rows - (NumberOfLines + 3)) / 2;
  Column = (Columns - (MaxLength + 2)) / 2;

  //
  // Allocate a buffer for a single line of the popup with borders and a Null-terminator
  //
  Line = AllocateZeroPool ((MaxLength + 3) * sizeof (CHAR16));
  ASSERT (Line != NULL);

  //
  // Draw top of popup box
  //
  SetMem16 (Line, (MaxLength + 2) * 2, BOXDRAW_HORIZONTAL);
  Line[0]             = BOXDRAW_DOWN_RIGHT;
  Line[MaxLength + 1] = BOXDRAW_DOWN_LEFT;
  Line[MaxLength + 2] = L'\0';
  ConOut->SetCursorPosition (ConOut, Column, Row++);
  ConOut->OutputString (ConOut, Line);

  //
  // Draw middle of the popup with strings
  //
  VA_START (Args, Key);
  while ((String = VA_ARG (Args, CHAR16 *)) != NULL && NumberOfLines > 0) {
    SetMem16 (Line, (MaxLength + 2) * 2, L' ');
    Line[0]             = BOXDRAW_VERTICAL;
    Line[MaxLength + 1] = BOXDRAW_VERTICAL;
    Line[MaxLength + 2] = L'\0';
    ConOut->SetCursorPosition (ConOut, Column, Row);
    ConOut->OutputString (ConOut, Line);
    Length = UefiLibGetStringWidth (String, FALSE, 0, NULL) / 2;
    if (Length <= MaxLength) {
      //
      // Length <= MaxLength
      //
      ConOut->SetCursorPosition (ConOut, Column + 1 + (MaxLength - Length) / 2, Row++);
      ConOut->OutputString (ConOut, String);
    } else {
      //
      // Length > MaxLength
      //
      UefiLibGetStringWidth (String, TRUE, MaxLength, &Length);
      TmpString = AllocateZeroPool ((Length + 1) * sizeof (CHAR16));
      ASSERT (TmpString != NULL);
      StrnCpyS (TmpString, Length + 1, String, Length - 3);
      StrCatS (TmpString, Length + 1, L"...");

      ConOut->SetCursorPosition (ConOut, Column + 1, Row++);
      ConOut->OutputString (ConOut, TmpString);
      FreePool (TmpString);
    }
    NumberOfLines--;
  }
  VA_END (Args);

  //
  // Draw bottom of popup box
  //
  SetMem16 (Line, (MaxLength + 2) * 2, BOXDRAW_HORIZONTAL);
  Line[0]             = BOXDRAW_UP_RIGHT;
  Line[MaxLength + 1] = BOXDRAW_UP_LEFT;
  Line[MaxLength + 2] = L'\0';
  ConOut->SetCursorPosition (ConOut, Column, Row++);
  ConOut->OutputString (ConOut, Line);

  //
  // Free the allocated line buffer
  //
  FreePool (Line);

  //
  // Restore the cursor visibility, position, and attributes
  //
  ConOut->EnableCursor      (ConOut, SavedConsoleMode.CursorVisible);
  ConOut->SetCursorPosition (ConOut, SavedConsoleMode.CursorColumn, SavedConsoleMode.CursorRow);
  ConOut->SetAttribute      (ConOut, SavedConsoleMode.Attribute);

  //
  // Wait for a keystroke
  //
  if (Key != NULL) {
    while (TRUE) {
      Status = gST->ConIn->ReadKeyStroke (gST->ConIn, Key);
      if (!EFI_ERROR (Status)) {
        break;
      }

      //
      // If we encounter error, continue to read another key in.
      //
      if (Status != EFI_NOT_READY) {
        continue;
      }
      gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
    }
  }
}


text:
@interface NYAlertViewDismissalAnimationController : NSObject <UIViewControllerAnimatedTransitioning>

@property NYAlertViewControllerTransitionStyle transitionStyle;
@property CGFloat duration;

@end


text:
/**
 * @file   FsCanonicalTest.cpp
 * @brief  FsCanonical class tester.
 * @author zer0
 * @date   2017-03-22
 */

#include <gtest/gtest.h>
#include <tester/DemoAsset.hpp>
#include <libtbag/filesystem/details/FsCanonical.hpp>

using namespace libtbag;
using namespace libtbag::filesystem;
using namespace libtbag::filesystem::details;
using namespace libtbag::test_data;

TEST(FsCanonicalTest, RemoveLastSeparator)
{
    std::string const UTF8_SOURCE_WINDOWS = UTF8_SOURCE + PATH_SEPARATOR_OF_WINDOWS + PATH_SEPARATOR_OF_WINDOWS;
    std::string const UTF8_SOURCE_POSIX   = UTF8_SOURCE + PATH_SEPARATOR_OF_POSIX   + PATH_SEPARATOR_OF_POSIX;
    std::string const UTF8_SOURCE_WINDOWS_POSIX = UTF8_SOURCE_WINDOWS + PATH_SEPARATOR_OF_POSIX;
    std::string const UTF8_SOURCE_POSIX_WINDOWS = UTF8_SOURCE_POSIX + PATH_SEPARATOR_OF_WINDOWS;

    ASSERT_EQ(UTF8_SOURCE, windows::removeLastSeparator(UTF8_SOURCE_WINDOWS));
    ASSERT_EQ(UTF8_SOURCE, windows::removeLastSeparator(UTF8_SOURCE_POSIX));
    ASSERT_EQ(UTF8_SOURCE, windows::removeLastSeparator(UTF8_SOURCE_WINDOWS_POSIX));
    ASSERT_EQ(UTF8_SOURCE, windows::removeLastSeparator(UTF8_SOURCE_POSIX_WINDOWS));

    ASSERT_EQ(UTF8_SOURCE_WINDOWS      , unix::removeLastSeparator(UTF8_SOURCE_WINDOWS));
    ASSERT_EQ(UTF8_SOURCE              , unix::removeLastSeparator(UTF8_SOURCE_POSIX));
    ASSERT_EQ(UTF8_SOURCE_WINDOWS      , unix::removeLastSeparator(UTF8_SOURCE_WINDOWS_POSIX));
    ASSERT_EQ(UTF8_SOURCE_POSIX_WINDOWS, unix::removeLastSeparator(UTF8_SOURCE_POSIX_WINDOWS));

    ASSERT_EQ(UTF8_SOURCE, removeLastSeparator(UTF8_SOURCE_POSIX));
}

TEST(FsCanonicalTest, RemoveDuplicateSeparators)
{
    std::string const TEMP = "/\\////\\\\" + UTF8_SOURCE + "\\//\\/";
    std::string const RESULT_WINDOWS = "\\" + UTF8_SOURCE + "\\";
    std::string const RESULT_POSIX   = "/\\/\\\\" + UTF8_SOURCE + "\\/\\/";
    std::string const RESULT_GENERIC = "/" + UTF8_SOURCE + "/";

    ASSERT_EQ(RESULT_WINDOWS, windows::removeDuplicateSeparators(TEMP));
    ASSERT_EQ(RESULT_POSIX, unix::removeDuplicateSeparators(TEMP));

    ASSERT_EQ(RESULT_GENERIC, windows::removeDuplicateSeparatorsWithGeneric(TEMP));
    ASSERT_EQ(RESULT_POSIX, unix::removeDuplicateSeparatorsWithGeneric(TEMP));

    ASSERT_EQ(UTF8_SOURCE, removeDuplicateSeparators(UTF8_SOURCE));
    ASSERT_EQ(UTF8_SOURCE, removeDuplicateSeparatorsWithGeneric(UTF8_SOURCE));
}

TEST(FsCanonicalTest, RemoveLastNode)
{
    std::string temp;
    std::string result_windows;
    std::string result_posix;

    temp = "/" + UTF8_SOURCE;
    result_windows = "/";
    result_posix   = "/";
    ASSERT_EQ(result_windows, windows::removeLastNode(temp));
    ASSERT_EQ(result_posix  ,    unix::removeLastNode(temp));

    temp = UTF8_SOURCE;
    result_windows = "";
    result_posix   = "";
    ASSERT_EQ(result_windows, windows::removeLastNode(temp));
    ASSERT_EQ(result_posix  ,    unix::removeLastNode(temp));

    temp = "";
    result_windows = "";
    result_posix   = "";
    ASSERT_EQ(result_windows, windows::removeLastNode(temp));
    ASSERT_EQ(result_posix  ,    unix::removeLastNode(temp));

    temp = "\\" + UTF8_SOURCE + "\\";
    result_windows = "\\";
    result_posix   = "";
    ASSERT_EQ(result_windows, windows::removeLastNode(temp));
    ASSERT_EQ(result_posix  ,    unix::removeLastNode(temp));

    temp = "\\";
    result_windows = "";
    result_posix   = "";
    ASSERT_EQ(result_windows, windows::removeLastNode(temp));
    ASSERT_EQ(result_posix  ,    unix::removeLastNode(temp));

    temp = "/" + UTF8_SOURCE;
    result_windows = "/";
    result_posix   = "/";
    ASSERT_EQ(result_windows, windows::removeLastNode(temp));
    ASSERT_EQ(result_posix  ,    unix::removeLastNode(temp));

    temp = "/" + UTF8_SOURCE + "/";
    result_windows = "/";
    result_posix   = "/";
    ASSERT_EQ(result_windows, windows::removeLastNode(temp));
    ASSERT_EQ(result_posix  ,    unix::removeLastNode(temp));

    temp = "/";
    result_windows = "";
    result_posix   = "";
    ASSERT_EQ(result_windows, windows::removeLastNode(temp));
    ASSERT_EQ(result_posix  ,    unix::removeLastNode(temp));
}

TEST(FsCanonicalTest, RemoveLastNode_Windows)
{
    std::string const TEMP0 = "G:/" + UTF8_SOURCE + "\\//\\/.///..//TEST\\/";
    std::string const TEMP1 = "G:/" + UTF8_SOURCE + "\\//\\/.///..//";
    std::string const TEMP2 = "G:/" + UTF8_SOURCE + "\\//\\/.///";
    std::string const TEMP3 = "G:/" + UTF8_SOURCE + "\\//\\/";
    std::string const TEMP4 = "G:/";
    std::string const TEMP5 = "";

    ASSERT_EQ(TEMP1, windows::removeLastNode(TEMP0));
    ASSERT_EQ(TEMP2, windows::removeLastNode(TEMP1));
    ASSERT_EQ(TEMP3, windows::removeLastNode(TEMP2));
    ASSERT_EQ(TEMP4, windows::removeLastNode(TEMP3));
    ASSERT_EQ(TEMP5, windows::removeLastNode(TEMP4));
}

TEST(FsCanonicalTest, RemoveLastNode_Unix)
{
    std::string const TEMP0 = "/" + UTF8_SOURCE + "\\//\\/.///..//TEST\\/";
    std::string const TEMP1 = "/" + UTF8_SOURCE + "\\//\\/.///..//";
    std::string const TEMP2 = "/" + UTF8_SOURCE + "\\//\\/.///";
    std::string const TEMP3 = "/" + UTF8_SOURCE + "\\//\\/";
    std::string const TEMP4 = "/" + UTF8_SOURCE + "\\//";
    std::string const TEMP5 = "/";
    std::string const TEMP6 = "";

    ASSERT_EQ(TEMP1, unix::removeLastNode(TEMP0));
    ASSERT_EQ(TEMP2, unix::removeLastNode(TEMP1));
    ASSERT_EQ(TEMP3, unix::removeLastNode(TEMP2));
    ASSERT_EQ(TEMP4, unix::removeLastNode(TEMP3));
    ASSERT_EQ(TEMP5, unix::removeLastNode(TEMP4));
    ASSERT_EQ(TEMP6, unix::removeLastNode(TEMP5));
}


text:
/**
 *
 */

package org.opensaml.saml2.metadata.validator;

import org.opensaml.saml2.metadata.AttributeConsumingService;
import org.opensaml.xml.validation.ValidationException;
import org.opensaml.xml.validation.Validator;

/**
 * Checks {@link org.opensaml.saml2.metadata.AttributeConsumingService} for Schema compliance.
 */
public class AttributeConsumingServiceSchemaValidator implements Validator<AttributeConsumingService> {

    /** Constructor */
    public AttributeConsumingServiceSchemaValidator() {

    }

    /** {@inheritDoc} */
    public void validate(AttributeConsumingService attributeConsumingService) throws ValidationException {
        validateIndex(attributeConsumingService);
        validateServiceNames(attributeConsumingService);
        validateRequestedAttributes(attributeConsumingService);
    }

    /**
     * Checks that Index is positive.
     *
     * @param attributeConsumingService
     * @throws ValidationException
     */
    protected void validateIndex(AttributeConsumingService attributeConsumingService) throws ValidationException {
        if (attributeConsumingService.getIndex() < 0) {
            throw new ValidationException("Index must be positive integer");
        }
    }

    /**
     * Checks that one or more Service Names are present.
     *
     * @param attributeConsumingService
     * @throws ValidationException
     */
    protected void validateServiceNames(AttributeConsumingService attributeConsumingService) throws ValidationException {
        if (attributeConsumingService.getNames() == null || attributeConsumingService.getNames().size() == 0) {
            throw new ValidationException("Must have one or more Service Names.");
        }
    }

    /**
     * Checks that one or more Requested Attributes are present.
     *
     * @param attributeConsumingService
     * @throws ValidationException
     */
    protected void validateRequestedAttributes(AttributeConsumingService attributeConsumingService)
            throws ValidationException {
        if (attributeConsumingService.getRequestAttributes() == null
                || attributeConsumingService.getRequestAttributes().size() == 0) {
            throw new ValidationException("Must have one or more Requested Attributes.");
        }
    }
}


text:
gnome-terminal \
--tab -e "roslaunch vision run_vision.launch" \
--tab -e "rosrun unball measurement_system_node" \
--tab -e "./simulator/unball_simulator.x86_64" \
--tab -e "rosrun rosbridge_server rosbridge_websocket" \


text:
'use strict';

// MODULES //

var getSynsetString = require( './getSynsetString.js' );
var sqlite3 = require( 'sqlite3' ).verbose();
var Promise = require( 'bluebird' );
var _ = require( 'underscore' );
var fs = require( 'fs' );
var path = require( 'path' );

// Extend prototype objects...

// Strings:
if (!String.prototype.hasOwnProperty( 'repeat' ) ) {
	String.prototype.repeat = function( num ) {
		return new Array( num + 1 ).join( this );
	};
}

if (!String.prototype.hasOwnProperty("endsWith")){
	String.prototype.endsWith = function( str ) {
		var myRegExp = new RegExp(str + "$");
		return myRegExp.test(this);
	};
}

// Arrays:
if ( !Array.prototype.hasOwnProperty( 'pick' ) ) {
	Array.prototype.pick = function( name ) {
		return this.map( function( elem ) {
			return elem[name];
		});
	};
}

if ( !Array.prototype.hasOwnProperty( 'contains' ) ) {
	Array.prototype.contains = function( elem ) {
		var q;
		for ( q = 0; q < this.length; q++ ) {
			if ( elem === this[q] ) {
				return true;
			}
		}
		return false;
	};
}

// WORDNET //

/* WordNet Revealing Closure Pattern: */
function makeWordNet( inputPath, preload ) {
	var exists;
	var file;
	var db;
	if ( !inputPath ) {
		// Initialize with standard path...
		file =  path.normalize( __dirname + '/../data/sqlite-31.db' );
		exists = fs.existsSync( file );
		if ( exists ) {
				db = Promise.promisifyAll( new sqlite3.Database( file ) );
		} else {
			console.log( 'Couldn\'t find file \'sqlite-31.db\' in data subdirectory. ' +
				'Please supply the correct path by using .registerDatabase(path), otherwise ' +
				'the module does not work.' );
		}
	} else {
		// Initialize with supplied path...
		db = Promise.promisifyAll( new sqlite3.Database( inputPath ) );
	}

	var wn = {};
	wn.preload = preload ? preload : false;

	if ( wn.preload === true ) {
		wn.SAMPLES = db.allAsync( "SELECT * FROM samples" ).then( function( d ) {
			return _.groupBy(d, "synsetid");
		});
		wn.SEMLINKS = db.allAsync( "SELECT synset1id, synset2id, linkid FROM semlinks" );

		wn.SEMLINKS.HYPERNYMS = db.allAsync("SELECT synset1id, synset2id, linkid FROM semlinks WHERE linkid = 1").then(function(d){
			return _.groupBy(d, "synset1id");
		});

		wn.SEMLINKS.SISTERS = db.allAsync("SELECT synset1id, synset2id, linkid FROM semlinks WHERE linkid = 1").then(function(d){
			return _.groupBy(d, "synset2id");
		});

		var long_query = "SELECT s.synsetid AS synsetid, s.definition AS definition, s.pos AS pos, s.lemma AS lemma, " +
			"s.sensenum AS sensenum, l.lexdomainname AS lexdomain " +
			"FROM wordsXsensesXsynsets AS s LEFT JOIN lexdomains AS l ON l.lexdomainid = s.lexdomainid";

		wn.WORDSxSENSESxSYNSETSxLEXDOMAINS = db.allAsync(long_query).then(function(d){
			return _.groupBy(d, "lemma");
		});

		var synXlex_query = "SELECT ss.synsetid AS synsetid, ss.pos AS pos, ld.lexdomainname AS lexdomain, ss.definition AS definition";
		synXlex_query += " FROM synsets AS ss INNER JOIN lexdomains AS ld ON ld.lexdomainid = ss.lexdomainid";
		wn.SYNSETSxLEXDOMAINS = db.allAsync(synXlex_query).then(function(d){
			return _.indexBy(d, "synsetid");
		});
	}

	// METHODS //

	wn.morphy = function morphy( str, pos, callback ) {
		return wn.morphyPromise( str, pos ).nodeify( callback );
	}; // end METHOD morphy()

	wn.morphyPromise = require( './morphy.js' );

	return wn;
} // end FUNCTION makeWordNet()

// EXPORTS //

module.exports = makeWordNet;


text:
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateEditorsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('editors', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->unsigned();
            $table->foreign('user_id')->references('id')->on('users');

            $table->integer('category_id')->unsigned();
            $table->foreign('category_id')->references('id')->on('categories');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('editors');
    }
}


text:
	#include "c_hl2mp_player.h"
	#include "haj_player_c.h"
	#include "prediction.h"

	extern ConVar cl_returntoironsights( "cl_returntoironsights", "1", FCVAR_USERINFO + FCVAR_ARCHIVE, "Return to ironsights after shooting?");
#else
	#include "hl2mp_player.h"
	#include "haj_player.h"
#endif

#include "haj_weapon_boltrifle.h"
#include "in_buttons.h"

// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"

IMPLEMENT_NETWORKCLASS_ALIASED( HAJBoltRifle, DT_HAJBoltRifle )

BEGIN_NETWORK_TABLE( CHAJBoltRifle, DT_HAJBoltRifle )
#ifdef CLIENT_DLL
	RecvPropBool( RECVINFO( m_bSighted ) ),
	RecvPropBool( RECVINFO( m_bWasSighted )),
	RecvPropBool( RECVINFO( m_bNeedsCocking )),
	RecvPropBool( RECVINFO( m_bIsCocking )),
#else
	SendPropBool( SENDINFO( m_bSighted )),
	SendPropBool( SENDINFO( m_bWasSighted)),
	SendPropBool( SENDINFO( m_bNeedsCocking ) ),
	SendPropBool( SENDINFO( m_bIsCocking ) ),
#endif
END_NETWORK_TABLE()

BEGIN_PREDICTION_DATA( CHAJBoltRifle )
END_PREDICTION_DATA()

//=========================================================
//	>> CHLSelectFireMachineGun
//=========================================================
BEGIN_DATADESC( CHAJBoltRifle )
END_DATADESC()

//-----------------------------------------------------------------------------
// Purpose: Construtor
//-----------------------------------------------------------------------------
CHAJBoltRifle::CHAJBoltRifle( void )
{
	SetPredictionEligible( true );
	AddSolidFlags( FSOLID_TRIGGER ); // Nothing collides with these but it gets touches.

	m_bFiresUnderwater = false;
	m_bFireOnEmpty = true;

	m_iClipsLeft = 0;
	m_bSighted = false;

	m_bNeedsCocking = false;
	m_bIsCocking = false;

#ifdef GAME_DLL
	UseClientSideAnimation();
#endif
}

bool CHAJBoltRifle::CanReload( void )
{
	if( m_bIsCocking || m_bNeedsCocking )
		return false;

	return true;
}

//-----------------------------------------------------------------------------
// Purpose: Handles firing the weapon
//-----------------------------------------------------------------------------
void CHAJBoltRifle::PrimaryAttack( void )
{
	if( IsHolstered() || IsLowered() || m_nShotsFired >= 1 )
		return;

	// Only the player fires this way so we can cast
	CHajPlayer *pPlayer = ToHajPlayer( GetOwner() );
	if ( !pPlayer || ( pPlayer->GetFlags() & FL_ATCONTROLS ) )
		return;

	if( m_bNeedsCocking || m_bIsCocking )
	{
		if( !m_bIsCocking )
			CockWeapon();

		return;
	}

	// don't allow firing on a ladder
	if ( pPlayer->GetMoveType() == MOVETYPE_LADDER )
	{
		m_flNextPrimaryAttack = gpGlobals->curtime + 0.15;
		return;
	}

	// don't allow firing when in a prone transition
	// don't allow firing when the sprint button is pressed and your moving
	if( !m_bIsBipodDeployed )
	{
		if ( pPlayer->m_Local.m_bProning || ( pPlayer->m_Local.m_bProned && pPlayer->GetAbsVelocity().Length2D() >= 5 ) || ( pPlayer->IsSprinting() && pPlayer->GetAbsVelocity().Length2D() >= 5 ) )
		{
			m_flNextPrimaryAttack = gpGlobals->curtime + 0.15;
			return;
		}
	}

	// reload if we're out of ammo
	if ( ( UsesClipsForAmmo1() && m_iClip1 == 0) || ( !UsesClipsForAmmo1() && !pPlayer->GetAmmoCount(m_iPrimaryAmmoType) ) )
	{
		if ( !m_bFireOnEmpty )
		{
			Reload();
		}
		else
		{
			WeaponSound( EMPTY );
			m_flNextPrimaryAttack = 0.15;
		}
		return;

	}

	CBasePlayer *pBasePlayer = ToBasePlayer( GetOwner() );

	// Fire the bullets
	FireBulletsInfo_t info;
	info.m_iShots = 1;
	info.m_vecSrc = pPlayer->Weapon_ShootPosition( );
	info.m_vecDirShooting = pBasePlayer->GetAutoaimVector( AUTOAIM_5DEGREES );

	if( IsIronsighted() )
	{
		Vector NewSpread;
		VectorMultiply( pPlayer->GetAttackSpread( this ), Vector( 0.6, 0.6, 0.6 ), NewSpread );
		info.m_vecSpread = NewSpread;
	}
	else
		info.m_vecSpread = pPlayer->GetAttackSpread( this );

	info.m_flDistance = MAX_TRACE_LENGTH;
	info.m_iAmmoType = m_iPrimaryAmmoType;
	info.m_iTracerFreq = 1; // for rifles, assume every round is tracer as we use invisible tracers that just make a whizz sound

	pPlayer->FireBullets( info );

	m_nShotsFired++;

	WeaponSound( SINGLE );
	pPlayer->DoMuzzleFlash();

	// set animations
	SendWeaponAnim( GetPrimaryAttackActivity() );

	// set the next attack time to after the length of the shoot
	// sequence. this means we can't fire again until after the bolt
	// working anim has done.
	MDLCACHE_CRITICAL_SECTION();
	float flSequenceEndTime = gpGlobals->curtime + SequenceDuration();
	//pPlayer->SetNextAttack( flSequenceEndTime );
	m_flNextPrimaryAttack = flSequenceEndTime;

	pPlayer->DoAnimationEvent( PLAYERANIMEVENT_ATTACK_PRIMARY );

	SetWeaponIdleTime( flSequenceEndTime );

	m_iClip1 -= 1;

	if( m_iClip1 > 0 )
		m_bNeedsCocking = true;

	AddViewKick();
}

#ifdef CLIENT_DLL
float CHAJBoltRifle::SwayScale( void )
{
	if( m_bSighted )
		return 0.1f;

	return BaseClass::SwayScale( );
}
#endif

void CHAJBoltRifle::ItemPostFrame( void )
{
	if( HolsterTimeThink() )
		return;

	if ( !IsHolstered() && HasWeaponIdleTimeElapsed() )
	{
		if( m_bNeedsCocking && !m_bIsCocking )
		{
			CockWeapon();
			return;
		}
	}

	if( gpGlobals->curtime >= m_flFinishCockingTime && m_bIsCocking )
	{
		FinishCocking();
	}

	BaseClass::ItemPostFrame( );
}

void CHAJBoltRifle::WeaponIdle( void )
{
	if( IsHolstered() )
		return;

	if ( HasWeaponIdleTimeElapsed() && !m_bIsCocking )
	{
		if( IsIronsighted() )
			SendWeaponAnim( ACT_VM_IRONSIGHT_IDLE );
		else if( IsLowered() )
			SendWeaponAnim( ACT_VM_IDLE_LOWERED );
		else
			BaseClass::WeaponIdle();
	}
}

void CHAJBoltRifle::CockWeapon( void )
{
	if( IsIronsighted() )
		SendWeaponAnim( ACT_VM_IRONSIGHT_COCK );
	else
		SendWeaponAnim( ACT_VM_COCK );

	m_flFinishCockingTime = gpGlobals->curtime + SequenceDuration();
	SetWeaponIdleTime( gpGlobals->curtime + SequenceDuration() );

	m_bIsCocking = true;
	m_bNeedsCocking = true;
}

void CHAJBoltRifle::FinishCocking()
{
	m_bNeedsCocking = false;
	m_bIsCocking = false;
	m_flFinishCockingTime = -1;
}

//-----------------------------------------------------------------------------
// Purpose:
// Output : Activity
//-----------------------------------------------------------------------------
Activity CHAJBoltRifle::GetPrimaryAttackActivity( void )
{
	if( IsIronsighted() )
		return ACT_VM_IRONSIGHT_PRIMARYATTACK;

	return ACT_VM_PRIMARYATTACK;
}

bool CHAJBoltRifle::Holster( CBaseCombatWeapon *pSwitchingTo )
{
#ifndef CLIENT_DLL
	ExitIronsights();
#endif

	if( m_bIsCocking && m_bNeedsCocking )
	{
		m_bIsCocking = false;
	}

	return BaseClass::Holster( pSwitchingTo );
}

void CHAJBoltRifle::Drop( const Vector &vecVelocity )
{
#ifndef CLIENT_DLL
	ExitIronsights();
#endif

	if( m_bIsCocking && m_bNeedsCocking )
	{
		m_bIsCocking = false;
	}

	BaseClass::Drop( vecVelocity );
}

void CHAJBoltRifle::SecondaryAttack( void )
{

}

void CHAJBoltRifle::FakeHolster()
{
	if( !IsHolstered() && m_bIsCocking )
	{
		m_bIsCocking = false;
	}

	BaseClass::FakeHolster();
}

bool CHAJBoltRifle::IsWeaponBusy()
{
	if( m_bIsCocking )
		return true;

	return BaseClass::IsWeaponBusy();
}


text:
using System.ComponentModel.DataAnnotations;

namespace BuildFeed.Model
{
    public enum ProjectFamily
    {
        None = 0,

        [Display(Name = "NT 5.0", Description = "Windows 2000")]
        Windows2000 = 1,

        [Display(Name = "Neptune")]
        Neptune = 2,

        [Display(Name = "Whistler", Description = "Windows XP")]
        WindowsXP = 3,

        [Display(Name = ".NET Server", Description = "Server 2003")]
        Server2003 = 4,

        [Display(Name = "Longhorn")]
        Longhorn = 5,

        [Display(Name = "Longhorn", Description = "Windows Vista")]
        WindowsVista = 6,

        [Display(Name = "Windows 7")]
        Windows7 = 7,

        [Display(Name = "Windows 8")]
        Windows8 = 8,

        [Display(Name = "Windows Blue", Description = "Windows 8.1")]
        WindowsBlue = 9,

        [Display(Name = "Threshold", Description = "Windows 10 (Initial Release)")]
        Threshold = 10,

        [Display(Name = "Threshold 2", Description = "Windows 10 (November Update)")]
        Threshold2 = 20,

        [Display(Name = "Redstone", Description = "Windows 10 (Anniversary Update)")]
        Redstone = 30,

        [Display(Name = "Redstone 2", Description = "Windows 10 (Creators Update)")]
        Redstone2 = 40,

        [Display(Name = "Redstone 2 (Feature Update)")]
        Feature2 = 41,

        [Display(Name = "Redstone 3", Description = "Windows 10 (Fall Creators Update)")]
        Redstone3 = 50,

        [Display(Name = "Redstone 4", Description = "Windows 10 (Spring Creators Update)")]
        Redstone4 = 60,

        [Display(Name = "Redstone 5")]
        Redstone5 = 70
    }
}


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<template type="basic" name="nCA1dSCANS" author="Agilent" investigator=""
        time_created="20120331T120000" tabname="BioSolidsPack" menu1="Experiments(ahYX)" menu2="Standard" apptype="solidsseq1d"
        application="BioSolids" scans="nCA1dSCANS" seqfil="ahYX">
  <protocol title="nCA1dSCANS" type="protocol">
    <action  type="LIB" status="Ready" lock="off" title="nCA1dSCANS" exp="nCA1dSCANS"
        time="1:45" macro="nCA1dSCANS" data="" />
  </protocol>
</template>


text:
{% extends 'template.html' %}
{% from 'macros.html' import render_stream %}

{% block title %}{{ user.username }} {{ super() }}{% endblock %}

{% block body %}

{{ user.username }} {% if not g.user.username == user.username %}
	| {% if g.user._get_current_object() in user.followers %}un{% endif %}follow
	{% else %}
		| edit
	{% endif %}
	{% if g.user._get_current_object().is_admin and not g.user._get_current_object().username == user.username %} |  edit
	{% endif %}

Followers: {{ user.followers.count() }}

Following: {{ user.following.count() }}

{{ render_stream(stream) }}

{% endblock %}


text:
NAME := bodytrack
SRC := AnnealingFactor BodyGeometry BodyPose CameraModel CovarianceMatrix ImageMeasurements ImageProjection \
       RandomGenerator TrackingModel main

SUB_DIRS := FlexImageLib

ifneq ($(strip $(NUM_THREADS)),1)
	SRC += AsyncIO TrackingModelPthread
	SUB_DIRS += threads
	CCFLAGS += -DHAVE_LIBPTHREAD
endif

SRC += $(SUB_DIRS)

VPATH := src
INC_DIR += $(PROJ_ROOT)/src/parsec/bodytrack/src/FlexImageLib $(PROJ_ROOT)/src/parsec/bodytrack/src
CCFLAGS += -DHAVE_CONFIG_H -std=c++98
CXXFLAGS += -fexceptions

include Makefile.$(BUILD_TYPE)
include ../parsec_common.mk

export  # make sure that makefiles in the subdirectories have the same environment

# enforce build order
all:
	@${MAKE} prebuild
	@${MAKE} $(BUILD_DIR)/$(NAME)

.PHONY: prebuild
prebuild:
	$(foreach dir,$(SUB_DIRS),$(MAKE) -C src/$(dir) &&) printf ""


text:
//---------------------------------------------------------------------
// <copyright file="AstoriaProductAnnotationConverter.cs" company="Microsoft">
//      Copyright (C) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
// </copyright>
//---------------------------------------------------------------------

namespace Microsoft.Test.Taupo.Astoria.EntityModel
{
    using System;
    using System.Collections.Generic;
    using System.Globalization;
    using System.Linq;
    using System.Xml.Linq;
    using Microsoft.Test.Taupo.Astoria.Contracts;
    using Microsoft.Test.Taupo.Astoria.Contracts.EntityModel;
    using Microsoft.Test.Taupo.Astoria.Contracts.OData;
    using Microsoft.Test.Taupo.Common;
    using Microsoft.Test.Taupo.Contracts;
    using Microsoft.Test.Taupo.Contracts.EntityModel;
    using Microsoft.Test.Taupo.Contracts.EntityModel.Edm;

    /// <summary>
    /// Looks at test annotations and converts it to product annotation in a <see cref="EntityModelSchema"/>.
    /// </summary>
    [ImplementationName(typeof(ITestToProductAnnotationConverter), "Default")]
    public class AstoriaProductAnnotationConverter : ITestToProductAnnotationConverter
    {
        // TODO: Rename this converter; it converts from higher-level test annotations to the serializable
        //               annotations in CSDL.

        /// <summary>
        /// Performs the conversion.
        /// </summary>
        /// <param name="model">Model to perform conversion on.</param>
        /// <returns>A clone of the <paramref name="model"/> with the converted annotations.</returns>
        public EntityModelSchema ConvertToProductAnnotations(EntityModelSchema model)
        {
            // we have to clone the model here since we will modify it by adding the converted annotations;
            // we do this in all cases even if there are no annotations to convert; if this becomes a performance problem
            // we can change this going forward (to do the clone on-demand).
            model = model.Clone();

            // TODO: support for MimeTypeAnnotation on service operations and primitive properties
            foreach (var entityType in model.EntityTypes)
            {
                if (entityType.HasStream())
                {
                    var attribute = new XAttribute(ODataConstants.DataServicesMetadataNamespace.GetName(ODataConstants.HasStreamAttributeName), true);
                    AddAnnotationIfDoesntExist(entityType, new AttributeAnnotation(attribute));
                }
            }

            return model;
        }

        private static void AddAnnotationIfDoesntExist(AnnotatedItem payload, AttributeAnnotation annotation)
        {
            var exists = payload.Annotations.OfType<AttributeAnnotation>().Any(a =>
            {
                ExceptionUtilities.CheckObjectNotNull(a.Content, "Content expected for attribute");
                return a.Content.Name.Equals(annotation.Content.Name);
            });

            if (!exists)
            {
                payload.Annotations.Add(annotation);
            }
        }
    }
}


text:
```python
from poloniex.app import AsyncApp

API_KEY = "YOUR_API_KEY"
API_SECRET = "YOUR_API_SECRET"

class App(AsyncApp):
    def ticker(self, **kwargs):
        self.logger.info(kwargs)

    def trades(self, **kwargs):
        self.logger.info(kwargs)

    async def main(self):
        self.push.subscribe(topic="BTC_ETH", handler=self.trades)
        self.push.subscribe(topic="ticker", handler=self.ticker)
        volume = await self.public.return24hVolume()

        self.logger.info(volume)

app = App(api_key=API_KEY, api_sec=API_SECRET)
app.run()

```

## Sync Example
```python
from poloniex.app import SyncApp

API_KEY = "YOUR_API_KEY"
API_SECRET = "YOUR_API_SECRET"

app = SyncApp(api_key=API_KEY, api_sec=API_SECRET)
app.logger.debug(app.public.return24hVolume())
```


text:
<html>
   <head>
    <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
    <meta content="utf-8" http-equiv="encoding">
    <title>Eugene Wu</title>
  </head>
<body style="margin-bottom: 5em;">

{% include ninjas.html ninjas=site.data.ninjas.ninjas %}

</body>

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-112401455-1"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-112401455-1');
</script>


text:
u64 htonll(u64 value);
u64 ntohll(u64 value);
u32 socketGetHostIP();
int socketListen(u16 port);
FILE* socketAccept(int listeningSocket, std::string* acceptedIp = NULL);
FILE* socketConnect(const std::string ipAddress, u16 port, int timeout = 10);

#endif


text:
ANSIBLE_METADATA = {'status': ['preview'],
                    'supported_by': 'community',
                    'version': '1.0'}

DOCUMENTATION = '''
---
module: ipa_sudorule
author: Thomas Krahn (@Nosmoht)
short_description: Manage FreeIPA sudo rule
description:
- Add, modify or delete sudo rule within IPA server using IPA API.
options:
  cn:
    description:
    - Canonical name.
    - Can not be changed as it is the unique identifier.
    required: true
    aliases: ['name']
  cmdcategory:
    description:
    - Command category the rule applies to.
    choices: ['all']
    required: false
  cmd:
    description:
    - List of commands assigned to the rule.
    - If an empty list is passed all commands will be removed from the rule.
    - If option is omitted commands will not be checked or changed.
    required: false
  host:
    description:
    - List of hosts assigned to the rule.
    - If an empty list is passed all hosts will be removed from the rule.
    - If option is omitted hosts will not be checked or changed.
    - Option C(hostcategory) must be omitted to assign hosts.
    required: false
  hostcategory:
    description:
    - Host category the rule applies to.
    - If 'all' is passed one must omit C(host) and C(hostgroup).
    - Option C(host) and C(hostgroup) must be omitted to assign 'all'.
    choices: ['all']
    required: false
  hostgroup:
    description:
    - List of host groups assigned to the rule.
    - If an empty list is passed all host groups will be removed from the rule.
    - If option is omitted host groups will not be checked or changed.
    - Option C(hostcategory) must be omitted to assign host groups.
    required: false
  user:
    description:
    - List of users assigned to the rule.
    - If an empty list is passed all users will be removed from the rule.
    - If option is omitted users will not be checked or changed.
    required: false
  usercategory:
    description:
    - User category the rule applies to.
    choices: ['all']
    required: false
  usergroup:
    description:
    - List of user groups assigned to the rule.
    - If an empty list is passed all user groups will be removed from the rule.
    - If option is omitted user groups will not be checked or changed.
    required: false
  state:
    description: State to ensure
    required: false
    default: present
    choices: ['present', 'absent', 'enabled', 'disabled']
  ipa_port:
    description: Port of IPA server
    required: false
    default: 443
  ipa_host:
    description: IP or hostname of IPA server
    required: false
    default: "ipa.example.com"
  ipa_user:
    description: Administrative account used on IPA server
    required: false
    default: "admin"
  ipa_pass:
    description: Password of administrative user
    required: true
  ipa_prot:
    description: Protocol used by IPA server
    required: false
    default: "https"
    choices: ["http", "https"]
  validate_certs:
    description:
    - This only applies if C(ipa_prot) is I(https).
    - If set to C(no), the SSL certificates will not be validated.
    - This should only set to C(no) used on personally controlled sites using self-signed certificates.
    required: false
    default: true
version_added: "2.3"
'''

EXAMPLES = '''
# Ensure sudo rule is present thats allows all every body to execute any command on any host without beeing asked for a password.
- ipa_sudorule:
    name: sudo_all_nopasswd
    cmdcategory: all
    description: Allow to run every command with sudo without password
    hostcategory: all
    sudoopt:
    - '!authenticate'
    usercategory: all
    ipa_host: ipa.example.com
    ipa_user: admin
    ipa_pass: topsecret
# Ensure user group developers can run every command on host group db-server as well as on host db01.example.com.
- ipa_sudorule:
    name: sudo_dev_dbserver
    description: Allow developers to run every command with sudo on all database server
    cmdcategory: all
    host:
    - db01.example.com
    hostgroup:
    - db-server
    sudoopt:
    - '!authenticate'
    usergroup:
    - developers
    ipa_host: ipa.example.com
    ipa_user: admin
    ipa_pass: topsecret
'''

RETURN = '''
sudorule:
  description: Sudorule as returned by IPA
  returned: always
  type: dict
'''

from ansible.module_utils.ipa import IPAClient

class SudoRuleIPAClient(IPAClient):

    def __init__(self, module, host, port, protocol):
        super(SudoRuleIPAClient, self).__init__(module, host, port, protocol)

    def sudorule_find(self, name):
        return self._post_json(method='sudorule_find', name=None, item={'all': True, 'cn': name})

    def sudorule_add(self, name, item):
        return self._post_json(method='sudorule_add', name=name, item=item)

    def sudorule_mod(self, name, item):
        return self._post_json(method='sudorule_mod', name=name, item=item)

    def sudorule_del(self, name):
        return self._post_json(method='sudorule_del', name=name)

    def sudorule_add_option(self, name, item):
        return self._post_json(method='sudorule_add_option', name=name, item=item)

    def sudorule_add_option_ipasudoopt(self, name, item):
        return self.sudorule_add_option(name=name, item={'ipasudoopt': item})

    def sudorule_remove_option(self, name, item):
        return self._post_json(method='sudorule_remove_option', name=name, item=item)

    def sudorule_remove_option_ipasudoopt(self, name, item):
        return self.sudorule_remove_option(name=name, item={'ipasudoopt': item})

    def sudorule_add_host(self, name, item):
        return self._post_json(method='sudorule_add_host', name=name, item=item)

    def sudorule_add_host_host(self, name, item):
        return self.sudorule_add_host(name=name, item={'host': item})

    def sudorule_add_host_hostgroup(self, name, item):
        return self.sudorule_add_host(name=name, item={'hostgroup': item})

    def sudorule_remove_host(self, name, item):
        return self._post_json(method='sudorule_remove_host', name=name, item=item)

    def sudorule_remove_host_host(self, name, item):
        return self.sudorule_remove_host(name=name, item={'host': item})

    def sudorule_remove_host_hostgroup(self, name, item):
        return self.sudorule_remove_host(name=name, item={'hostgroup': item})

    def sudorule_add_allow_command(self, name, item):
        return self._post_json(method='sudorule_add_allow_command', name=name, item=item)

    def sudorule_remove_allow_command(self, name, item):
        return self._post_json(method='sudorule_remove_allow_command', name=name, item=item)

    def sudorule_add_user(self, name, item):
        return self._post_json(method='sudorule_add_user', name=name, item=item)

    def sudorule_add_user_user(self, name, item):
        return self.sudorule_add_user(name=name, item={'user': item})

    def sudorule_add_user_group(self, name, item):
        return self.sudorule_add_user(name=name, item={'group': item})

    def sudorule_remove_user(self, name, item):
        return self._post_json(method='sudorule_remove_user', name=name, item=item)

    def sudorule_remove_user_user(self, name, item):
        return self.sudorule_remove_user(name=name, item={'user': item})

    def sudorule_remove_user_group(self, name, item):
        return self.sudorule_remove_user(name=name, item={'group': item})

def get_sudorule_dict(cmdcategory=None, description=None, hostcategory=None, ipaenabledflag=None, usercategory=None):
    data = {}
    if cmdcategory is not None:
        data['cmdcategory'] = cmdcategory
    if description is not None:
        data['description'] = description
    if hostcategory is not None:
        data['hostcategory'] = hostcategory
    if ipaenabledflag is not None:
        data['ipaenabledflag'] = ipaenabledflag
    if usercategory is not None:
        data['usercategory'] = usercategory
    return data

def get_sudorule_diff(ipa_sudorule, module_sudorule):
    data = []
    for key in module_sudorule.keys():
        module_value = module_sudorule.get(key, None)
        ipa_value = ipa_sudorule.get(key, None)
        if isinstance(ipa_value, list) and not isinstance(module_value, list):
            module_value = [module_value]
        if isinstance(ipa_value, list) and isinstance(module_value, list):
            ipa_value = sorted(ipa_value)
            module_value = sorted(module_value)
        if ipa_value != module_value:
            data.append(key)
    return data

def modify_if_diff(module, name, ipa_list, module_list, add_method, remove_method):
    changed = False
    diff = list(set(ipa_list) - set(module_list))
    if len(diff) > 0:
        changed = True
        if not module.check_mode:
            for item in diff:
                remove_method(name=name, item=item)

    diff = list(set(module_list) - set(ipa_list))
    if len(diff) > 0:
        changed = True
        if not module.check_mode:
            for item in diff:
                add_method(name=name, item=item)

    return changed

def category_changed(module, client, category_name, ipa_sudorule):
    if ipa_sudorule.get(category_name, None) == ['all']:
        if not module.check_mode:
            # cn is returned as list even with only a single value.
            client.sudorule_mod(name=ipa_sudorule.get('cn')[0], item={category_name: None})
        return True
    return False

def ensure(module, client):
    state = module.params['state']
    name = module.params['name']
    cmd = module.params['cmd']
    cmdcategory = module.params['cmdcategory']
    host = module.params['host']
    hostcategory = module.params['hostcategory']
    hostgroup = module.params['hostgroup']

    if state in ['present', 'enabled']:
        ipaenabledflag = 'TRUE'
    else:
        ipaenabledflag = 'FALSE'

    sudoopt = module.params['sudoopt']
    user = module.params['user']
    usercategory = module.params['usercategory']
    usergroup = module.params['usergroup']

    module_sudorule = get_sudorule_dict(cmdcategory=cmdcategory,
                                        description=module.params['description'],
                                        hostcategory=hostcategory,
                                        ipaenabledflag=ipaenabledflag,
                                        usercategory=usercategory)
    ipa_sudorule = client.sudorule_find(name=name)

    changed = False
    if state in ['present', 'disabled', 'enabled']:
        if not ipa_sudorule:
            changed = True
            if not module.check_mode:
                ipa_sudorule = client.sudorule_add(name=name, item=module_sudorule)
        else:
            diff = get_sudorule_diff(ipa_sudorule, module_sudorule)
            if len(diff) > 0:
                changed = True
                if not module.check_mode:
                    if 'hostcategory' in diff:
                        if ipa_sudorule.get('memberhost_host', None) is not None:
                            client.sudorule_remove_host_host(name=name, item=ipa_sudorule.get('memberhost_host'))
                        if ipa_sudorule.get('memberhost_hostgroup', None) is not None:
                            client.sudorule_remove_host_hostgroup(name=name,
                                                                  item=ipa_sudorule.get('memberhost_hostgroup'))

                    client.sudorule_mod(name=name, item=module_sudorule)

        if cmd is not None:
            changed = category_changed(module, client, 'cmdcategory', ipa_sudorule) or changed
            if not module.check_mode:
                client.sudorule_add_allow_command(name=name, item=cmd)

        if host is not None:
            changed = category_changed(module, client, 'hostcategory', ipa_sudorule) or changed
            changed = modify_if_diff(module, name, ipa_sudorule.get('memberhost_host', []), host,
                                     client.sudorule_add_host_host,
                                     client.sudorule_remove_host_host) or changed

        if hostgroup is not None:
            changed = category_changed(module, client, 'hostcategory', ipa_sudorule) or changed
            changed = modify_if_diff(module, name, ipa_sudorule.get('memberhost_hostgroup', []), hostgroup,
                                     client.sudorule_add_host_hostgroup,
                                     client.sudorule_remove_host_hostgroup) or changed
        if sudoopt is not None:
            changed = modify_if_diff(module, name, ipa_sudorule.get('ipasudoopt', []), sudoopt,
                                     client.sudorule_add_option_ipasudoopt,
                                     client.sudorule_remove_option_ipasudoopt) or changed
        if user is not None:
            changed = category_changed(module, client, 'usercategory', ipa_sudorule) or changed
            changed = modify_if_diff(module, name, ipa_sudorule.get('memberuser_user', []), user,
                                     client.sudorule_add_user_user,
                                     client.sudorule_remove_user_user) or changed
        if usergroup is not None:
            changed = category_changed(module, client, 'usercategory', ipa_sudorule) or changed
            changed = modify_if_diff(module, name, ipa_sudorule.get('memberuser_group', []), usergroup,
                                     client.sudorule_add_user_group,
                                     client.sudorule_remove_user_group) or changed
    else:
        if ipa_sudorule:
            changed = True
            if not module.check_mode:
                client.sudorule_del(name)

    return changed, client.sudorule_find(name)

def main():
    module = AnsibleModule(
        argument_spec=dict(
            cmd=dict(type='list', required=False),
            cmdcategory=dict(type='str', required=False, choices=['all']),
            cn=dict(type='str', required=True, aliases=['name']),
            description=dict(type='str', required=False),
            host=dict(type='list', required=False),
            hostcategory=dict(type='str', required=False, choices=['all']),
            hostgroup=dict(type='list', required=False),
            sudoopt=dict(type='list', required=False),
            state=dict(type='str', required=False, default='present',
                       choices=['present', 'absent', 'enabled', 'disabled']),
            user=dict(type='list', required=False),
            usercategory=dict(type='str', required=False, choices=['all']),
            usergroup=dict(type='list', required=False),
            ipa_prot=dict(type='str', required=False, default='https', choices=['http', 'https']),
            ipa_host=dict(type='str', required=False, default='ipa.example.com'),
            ipa_port=dict(type='int', required=False, default=443),
            ipa_user=dict(type='str', required=False, default='admin'),
            ipa_pass=dict(type='str', required=True, no_log=True),
            validate_certs=dict(type='bool', required=False, default=True),
        ),
        mutually_exclusive=[['cmdcategory', 'cmd'],
                            ['hostcategory', 'host'],
                            ['hostcategory', 'hostgroup'],
                            ['usercategory', 'user'],
                            ['usercategory', 'usergroup']],
        supports_check_mode=True,
    )

    client = SudoRuleIPAClient(module=module,
                               host=module.params['ipa_host'],
                               port=module.params['ipa_port'],
                               protocol=module.params['ipa_prot'])
    try:
        client.login(username=module.params['ipa_user'],
                     password=module.params['ipa_pass'])
        changed, sudorule = ensure(module, client)
        module.exit_json(changed=changed, sudorule=sudorule)
    except Exception:
        e = get_exception()
        module.fail_json(msg=str(e))

from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.pycompat24 import get_exception

if __name__ == '__main__':
    main()


text:
import {Directionality} from '@angular/cdk/bidi';
import {ESCAPE} from '@angular/cdk/keycodes';
import {
  BlockScrollStrategy,
  Overlay,
  OverlayConfig,
  OverlayRef,
  ScrollStrategy,
} from '@angular/cdk/overlay';
import {ComponentPortal, ComponentType, PortalInjector, TemplatePortal} from '@angular/cdk/portal';
import {Location} from '@angular/common';
import {
  ComponentRef,
  Inject,
  Injectable,
  InjectionToken,
  Injector,
  Optional,
  SkipSelf,
  TemplateRef,
} from '@angular/core';
import {Observable} from 'rxjs/Observable';
import {defer} from 'rxjs/observable/defer';
import {of as observableOf} from 'rxjs/observable/of';
import {filter} from 'rxjs/operators/filter';
import {startWith} from 'rxjs/operators/startWith';
import {Subject} from 'rxjs/Subject';
import {MatDialogConfig} from './dialog-config';
import {MatDialogContainer} from './dialog-container';
import {MatDialogRef} from './dialog-ref';

export const MAT_DIALOG_DATA = new InjectionToken<any>('MatDialogData');

/** Injection token that determines the scroll handling while the dialog is open. */
export const MAT_DIALOG_SCROLL_STRATEGY =
    new InjectionToken<() => ScrollStrategy>('mat-dialog-scroll-strategy');

/** @docs-private */
export function MAT_DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay: Overlay):
    () => BlockScrollStrategy {
  return () => overlay.scrollStrategies.block();
}

/** @docs-private */
export const MAT_DIALOG_SCROLL_STRATEGY_PROVIDER = {
  provide: MAT_DIALOG_SCROLL_STRATEGY,
  deps: [Overlay],
  useFactory: MAT_DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY,
};

/**
 * Service to open Material Design modal dialogs.
 */
@Injectable()
export class MatDialog {
  private _openDialogsAtThisLevel: MatDialogRef<any>[] = [];
  private _afterAllClosedAtThisLevel = new Subject<void>();
  private _afterOpenAtThisLevel = new Subject<MatDialogRef<any>>();

  /** Keeps track of the currently-open dialogs. */
  get openDialogs(): MatDialogRef<any>[] {
    return this._parentDialog ? this._parentDialog.openDialogs : this._openDialogsAtThisLevel;
  }

  /** Stream that emits when a dialog has been opened. */
  get afterOpen(): Subject<MatDialogRef<any>> {
    return this._parentDialog ? this._parentDialog.afterOpen : this._afterOpenAtThisLevel;
  }

  get _afterAllClosed() {
    const parent = this._parentDialog;
    return parent ? parent._afterAllClosed : this._afterAllClosedAtThisLevel;
  }

  /**
   * Stream that emits when all open dialog have finished closing.
   * Will emit on subscribe if there are no open dialogs to begin with.
   */
  afterAllClosed: Observable<void> = defer<void>(() => this.openDialogs.length ?
      this._afterAllClosed :
      this._afterAllClosed.pipe(startWith(undefined)));

  constructor(
      private _overlay: Overlay,
      private _injector: Injector,
      @Optional() location: Location,
      @Inject(MAT_DIALOG_SCROLL_STRATEGY) private _scrollStrategy,
      @Optional() @SkipSelf() private _parentDialog: MatDialog) {

    // Close all of the dialogs when the user goes forwards/backwards in history or when the
    // location hash changes. Note that this usually doesn't include clicking on links (unless
    // the user is using the `HashLocationStrategy`).
    if (!_parentDialog && location) {
      location.subscribe(() => this.closeAll());
    }
  }

  /**
   * Opens a modal dialog containing the given component.
   * @param componentOrTemplateRef Type of the component to load into the dialog,
   *     or a TemplateRef to instantiate as the dialog content.
   * @param config Extra configuration options.
   * @returns Reference to the newly-opened dialog.
   */
  open<T, D = any>(componentOrTemplateRef: ComponentType<T> | TemplateRef<T>,
          config?: MatDialogConfig<D>): MatDialogRef<T> {

    config = _applyConfigDefaults(config);

    if (config.id && this.getDialogById(config.id)) {
      throw Error(`Dialog with id "${config.id}" exists already. The dialog id must be unique.`);
    }

    const overlayRef = this._createOverlay(config);
    const dialogContainer = this._attachDialogContainer(overlayRef, config);
    const dialogRef =
        this._attachDialogContent<T>(componentOrTemplateRef, dialogContainer, overlayRef, config);

    this.openDialogs.push(dialogRef);
    dialogRef.afterClosed().subscribe(() => this._removeOpenDialog(dialogRef));
    this.afterOpen.next(dialogRef);

    return dialogRef;
  }

  /**
   * Closes all of the currently-open dialogs.
   */
  closeAll(): void {
    let i = this.openDialogs.length;

    while (i--) {
      // The `_openDialogs` property isn't updated after close until the rxjs subscription
      // runs on the next microtask, in addition to modifying the array as we're going
      // through it. We loop through all of them and call close without assuming that
      // they'll be removed from the list instantaneously.
      this.openDialogs[i].close();
    }
  }

  /**
   * Finds an open dialog by its id.
   * @param id ID to use when looking up the dialog.
   */
  getDialogById(id: string): MatDialogRef<any> | undefined {
    return this.openDialogs.find(dialog => dialog.id === id);
  }

  /**
   * Creates the overlay into which the dialog will be loaded.
   * @param config The dialog configuration.
   * @returns A promise resolving to the OverlayRef for the created overlay.
   */
  private _createOverlay(config: MatDialogConfig): OverlayRef {
    const overlayConfig = this._getOverlayConfig(config);
    return this._overlay.create(overlayConfig);
  }

  /**
   * Creates an overlay config from a dialog config.
   * @param dialogConfig The dialog configuration.
   * @returns The overlay configuration.
   */
  private _getOverlayConfig(dialogConfig: MatDialogConfig): OverlayConfig {
    const state = new OverlayConfig({
      positionStrategy: this._overlay.position().global(),
      scrollStrategy: this._scrollStrategy(),
      panelClass: dialogConfig.panelClass,
      hasBackdrop: dialogConfig.hasBackdrop,
      direction: dialogConfig.direction,
      minWidth: dialogConfig.minWidth,
      minHeight: dialogConfig.minHeight,
      maxWidth: dialogConfig.maxWidth,
      maxHeight: dialogConfig.maxHeight
    });

    if (dialogConfig.backdropClass) {
      state.backdropClass = dialogConfig.backdropClass;
    }

    return state;
  }

  /**
   * Attaches an MatDialogContainer to a dialog's already-created overlay.
   * @param overlay Reference to the dialog's underlying overlay.
   * @param config The dialog configuration.
   * @returns A promise resolving to a ComponentRef for the attached container.
   */
  private _attachDialogContainer(overlay: OverlayRef, config: MatDialogConfig): MatDialogContainer {
    let containerPortal = new ComponentPortal(MatDialogContainer, config.viewContainerRef);
    let containerRef: ComponentRef<MatDialogContainer> = overlay.attach(containerPortal);
    containerRef.instance._config = config;

    return containerRef.instance;
  }

  /**
   * Attaches the user-provided component to the already-created MatDialogContainer.
   * @param componentOrTemplateRef The type of component being loaded into the dialog,
   *     or a TemplateRef to instantiate as the content.
   * @param dialogContainer Reference to the wrapping MatDialogContainer.
   * @param overlayRef Reference to the overlay in which the dialog resides.
   * @param config The dialog configuration.
   * @returns A promise resolving to the MatDialogRef that should be returned to the user.
   */
  private _attachDialogContent<T>(
      componentOrTemplateRef: ComponentType<T> | TemplateRef<T>,
      dialogContainer: MatDialogContainer,
      overlayRef: OverlayRef,
      config: MatDialogConfig): MatDialogRef<T> {

    // Create a reference to the dialog we're creating in order to give the user a handle
    // to modify and close it.
    const dialogRef = new MatDialogRef<T>(overlayRef, dialogContainer, config.id);

    // When the dialog backdrop is clicked, we want to close it.
    if (config.hasBackdrop) {
      overlayRef.backdropClick().subscribe(() => {
        if (!dialogRef.disableClose) {
          dialogRef.close();
        }
      });
    }

    // Close when escape keydown event occurs
    overlayRef.keydownEvents().pipe(
      filter(event => event.keyCode === ESCAPE && !dialogRef.disableClose)
    ).subscribe(() => dialogRef.close());

    if (componentOrTemplateRef instanceof TemplateRef) {
      dialogContainer.attachTemplatePortal(
        new TemplatePortal<T>(componentOrTemplateRef, null!,
          <any>{ $implicit: config.data, dialogRef }));
    } else {
      const injector = this._createInjector<T>(config, dialogRef, dialogContainer);
      const contentRef = dialogContainer.attachComponentPortal<T>(
          new ComponentPortal(componentOrTemplateRef, undefined, injector));
      dialogRef.componentInstance = contentRef.instance;
    }

    dialogRef
      .updateSize(config.width, config.height)
      .updatePosition(config.position);

    return dialogRef;
  }

  /**
   * Creates a custom injector to be used inside the dialog. This allows a component loaded inside
   * of a dialog to close itself and, optionally, to return a value.
   * @param config Config object that is used to construct the dialog.
   * @param dialogRef Reference to the dialog.
   * @param container Dialog container element that wraps all of the contents.
   * @returns The custom injector that can be used inside the dialog.
   */
  private _createInjector<T>(
      config: MatDialogConfig,
      dialogRef: MatDialogRef<T>,
      dialogContainer: MatDialogContainer): PortalInjector {

    const userInjector = config && config.viewContainerRef && config.viewContainerRef.injector;
    const injectionTokens = new WeakMap();

    injectionTokens.set(MatDialogRef, dialogRef);
    // The MatDialogContainer is injected in the portal as the MatDialogContainer and the dialog's
    // content are created out of the same ViewContainerRef and as such, are siblings for injector
    // purposes.  To allow the hierarchy that is expected, the MatDialogContainer is explicitly
    // added to the injection tokens.
    injectionTokens.set(MatDialogContainer, dialogContainer);
    injectionTokens.set(MAT_DIALOG_DATA, config.data);
    injectionTokens.set(Directionality, {
      value: config.direction,
      change: observableOf()
    });

    return new PortalInjector(userInjector || this._injector, injectionTokens);
  }

  /**
   * Removes a dialog from the array of open dialogs.
   * @param dialogRef Dialog to be removed.
   */
  private _removeOpenDialog(dialogRef: MatDialogRef<any>) {
    const index = this.openDialogs.indexOf(dialogRef);

    if (index > -1) {
      this.openDialogs.splice(index, 1);

      // no open dialogs are left, call next on afterAllClosed Subject
      if (!this.openDialogs.length) {
        this._afterAllClosed.next();
      }
    }
  }
}

/**
 * Applies default options to the dialog config.
 * @param config Config to be modified.
 * @returns The new configuration object.
 */
function _applyConfigDefaults(config?: MatDialogConfig): MatDialogConfig {
  return {...new MatDialogConfig(), ...config};
}


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

package net.groboclown.idea.altmock;

import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;

public class MockFileType implements FileType {
    public static final FileType MOCK = new MockFileType();

    @NotNull
    @Override
    public String getName() {
        return "mock";
    }

    @NotNull
    @Override
    public String getDescription() {
        return "mock";
    }

    @NotNull
    @Override
    public String getDefaultExtension() {
        return ".mock";
    }

    @Nullable
    @Override
    public Icon getIcon() {
        return null;
    }

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

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

    @Nullable
    @Override
    public String getCharset(@NotNull VirtualFile file, @NotNull byte[] content) {
        return null;
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/colorWhite"
    android:orientation="vertical">

    <android.support.v7.widget.CardView
        android:id="@+id/item_home_card"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="4dp"
        android:layout_marginTop="6dp"
        android:clickable="true"
        app:cardPreventCornerOverlap="false"
        app:cardUseCompatPadding="true">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:paddingTop="16dp">

            <de.hdodenhof.circleimageview.CircleImageView
                android:id="@+id/item_home_img_head"
                android:layout_width="40dp"
                android:layout_height="40dp"
                android:layout_marginLeft="16dp"
                android:layout_marginStart="16dp"
                android:src="@drawable/charonhead"
                />

            <TextView
                android:id="@+id/item_home_name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentTop="true"
                android:layout_marginLeft="16dp"
                android:layout_marginStart="16dp"
                android:layout_toEndOf="@+id/item_home_img_head"
                android:layout_toRightOf="@+id/item_home_img_head"
                android:text="陈恳"
                android:textColor="@color/colorTextPrimary"
                android:textSize="14sp" />

            <TextView
                android:id="@+id/item_home_time"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignBottom="@+id/item_home_img_head"
                android:layout_alignLeft="@+id/item_home_name"
                android:layout_alignStart="@+id/item_home_name"
                android:text="2017年5月30日    18:52"
                android:textSize="14sp" />

            <TextView
                android:id="@+id/item_home_content"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_alignLeft="@+id/item_home_img_head"
                android:layout_alignStart="@+id/item_home_img_head"
                android:layout_below="@+id/item_home_img_head"
                android:textSize="14sp"
                android:layout_marginEnd="16dp"
                android:layout_marginRight="16dp"
                android:layout_marginTop="16dp"
                android:layout_marginBottom="16dp"
                android:text="今天我们来带了这里看了大家特么撒了点附近萨洛克附件三了吉林省的房间里了点附近萨洛克附件三了吉林省的房间里了点附近萨洛克附件三了吉林省的房间里了点附近萨洛克附件三了吉林省的房间里" />

            <ImageView
                android:id="@+id/item_home_img_comment"
                android:layout_width="48dp"
                android:layout_height="48dp"
                android:layout_alignEnd="@+id/item_home_content"
                android:layout_alignRight="@+id/item_home_content"
                android:layout_below="@+id/item_home_content"
                android:layout_marginEnd="8dp"
                android:layout_marginRight="8dp"
                android:padding="16dp"
                android:scaleType="centerInside"
                android:src="@drawable/item_home_comment"
                android:visibility="gone"/>

            <ImageView
                android:id="@+id/item_home_like"
                android:layout_width="48dp"
                android:layout_height="48dp"
                android:layout_below="@+id/item_home_content"
                android:layout_marginEnd="8dp"
                android:layout_marginRight="8dp"
                android:layout_toLeftOf="@id/item_home_img_comment"
                android:layout_toStartOf="@id/item_home_img_comment"
                android:padding="16dp"
                android:scaleType="centerInside"
                android:src="@drawable/item_home_like"
                android:visibility="gone"/>
        </RelativeLayout>

    </android.support.v7.widget.CardView>
</LinearLayout>


text:
#ifndef _PROTON_SRC_REACTOR_H
#define _PROTON_SRC_REACTOR_H 1

#include <proton/reactor.h>

void pni_record_init_reactor(pn_record_t *record, pn_reactor_t *reactor);

#endif /* src/reactor.h */


text:
function result = cropAndClean(imgData, dataDim)
    % Convert the image to an inverted binary representation
    compImg = imcomplement(im2bw(imgData));

    % Extract connected components
    [Ilabel, ~] = bwlabel(compImg);
    Iprops = regionprops(Ilabel);
    Ibox = [Iprops.BoundingBox];
    Ibox = reshape(Ibox, [4, length(Ibox)/4]);

    out = ceil(Ibox(1:2, 1));

    % Calculate the crop margins
    OCRStartCol = out(1, 1);
    OCRStartRow = out(2, 1);
    OCREndCol = OCRStartCol + ceil(Ibox(3, 1)) - 1;
    OCREndRow = OCRStartRow + ceil(Ibox(4, 1)) - 1;

    % Crop and resize the original image
    croppedChar = compImg(OCRStartRow:OCREndRow, OCRStartCol:OCREndCol);
    result = imresize(croppedChar, dataDim, 'lanczos3', 'antialiasing', false);
end


text:
.class public interface abstract Lo/rE$ˊ;
.super Ljava/lang/Object;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lo/rE;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x609
    name = "\u02ca"
.end annotation

# virtual methods
.method public abstract ˊ(ILandroid/app/PendingIntent;)V
.end method

.method public abstract ˊ(I[Ljava/lang/String;)V
.end method