text:
package org.apache.hadoop.ozone.container.common.utils;

import com.google.common.annotations.VisibleForTesting;
import org.apache.commons.lang3.StringUtils;
import org.apache.hadoop.ozone.OzoneConsts;
import org.apache.hadoop.ozone.common.InconsistentStorageStateException;
import org.apache.hadoop.ozone.container.common.DataNodeLayoutVersion;
import org.apache.hadoop.ozone.container.common.volume.HddsVolume;
import org.apache.hadoop.util.Time;
import org.slf4j.Logger;

import java.io.File;
import java.io.IOException;
import java.util.Properties;
import java.util.UUID;

/**
 * A util class for {@link HddsVolume}.
 */
public final class HddsVolumeUtil {

  // Private constructor for Utility class. Unused.
  private HddsVolumeUtil() {
  }

  private static final String VERSION_FILE   = "VERSION";
  private static final String STORAGE_ID_PREFIX = "DS-";

  public static File getVersionFile(File rootDir) {
    return new File(rootDir, VERSION_FILE);
  }

  public static String generateUuid() {
    return STORAGE_ID_PREFIX + UUID.randomUUID();
  }

  /**
   * Get hddsRoot from volume root. If volumeRoot points to hddsRoot, it is
   * returned as is.
   * For a volumeRoot /data/disk1, the hddsRoot is /data/disk1/hdds.
   * @param volumeRoot root of the volume.
   * @return hddsRoot of the volume.
   */
  public static String getHddsRoot(String volumeRoot) {
    if (volumeRoot.endsWith(HddsVolume.HDDS_VOLUME_DIR)) {
      return volumeRoot;
    } else {
      File hddsRoot = new File(volumeRoot, HddsVolume.HDDS_VOLUME_DIR);
      return hddsRoot.getPath();
    }
  }

  /**
   * Returns storageID if it is valid. Throws an exception otherwise.
   */
  @VisibleForTesting
  public static String getStorageID(Properties props, File versionFile)
      throws InconsistentStorageStateException {
    return getProperty(props, OzoneConsts.STORAGE_ID, versionFile);
  }

  /**
   * Returns clusterID if it is valid. It should match the clusterID from the
   * Datanode. Throws an exception otherwise.
   */
  @VisibleForTesting
  public static String getClusterID(Properties props, File versionFile,
      String clusterID) throws InconsistentStorageStateException {
    String cid = getProperty(props, OzoneConsts.CLUSTER_ID, versionFile);

    if (clusterID == null) {
      return cid;
    }
    if (!clusterID.equals(cid)) {
      throw new InconsistentStorageStateException("Mismatched " +
          "ClusterIDs. Version File : " + versionFile + " has clusterID: " +
          cid + " and Datanode has clusterID: " + clusterID);
    }
    return cid;
  }

  /**
   * Returns datanodeUuid if it is valid. It should match the UUID of the
   * Datanode. Throws an exception otherwise.
   */
  @VisibleForTesting
  public static String getDatanodeUUID(Properties props, File versionFile,
      String datanodeUuid)
      throws InconsistentStorageStateException {
    String datanodeID = getProperty(props, OzoneConsts.DATANODE_UUID,
        versionFile);

    if (datanodeUuid != null && !datanodeUuid.equals(datanodeID)) {
      throw new InconsistentStorageStateException("Mismatched " +
          "DatanodeUUIDs. Version File : " + versionFile + " has datanodeUuid: "
          + datanodeID + " and Datanode has datanodeUuid: " + datanodeUuid);
    }
    return datanodeID;
  }

  /**
   * Returns creationTime if it is valid. Throws an exception otherwise.
   */
  @VisibleForTesting
  public static long getCreationTime(Properties props, File versionFile)
      throws InconsistentStorageStateException {
    String cTimeStr = getProperty(props, OzoneConsts.CTIME, versionFile);

    long cTime = Long.parseLong(cTimeStr);
    long currentTime = Time.now();
    if (cTime > currentTime || cTime < 0) {
      throw new InconsistentStorageStateException("Invalid Creation time in " +
          "Version File : " + versionFile + " - " + cTime + ". Current system" +
          " time is " + currentTime);
    }
    return cTime;
  }

  /**
   * Returns layOutVersion if it is valid. Throws an exception otherwise.
   */
  @VisibleForTesting
  public static int getLayOutVersion(Properties props, File versionFile) throws
      InconsistentStorageStateException {
    String lvStr = getProperty(props, OzoneConsts.LAYOUTVERSION, versionFile);

    int lv = Integer.parseInt(lvStr);
    if(DataNodeLayoutVersion.getLatestVersion().getVersion() != lv) {
      throw new InconsistentStorageStateException("Invalid layOutVersion. " +
          "Version file has layOutVersion as " + lv + " and latest Datanode " +
          "layOutVersion is " +
          DataNodeLayoutVersion.getLatestVersion().getVersion());
    }
    return lv;
  }

  private static String getProperty(Properties props, String propName, File
      versionFile)
      throws InconsistentStorageStateException {
    String value = props.getProperty(propName);
    if (StringUtils.isBlank(value)) {
      throw new InconsistentStorageStateException("Invalid " + propName +
          ". Version File : " + versionFile + " has null or empty " + propName);
    }
    return value;
  }

  /**
   * Check Volume is consistent state or not.
   * @param hddsVolume
   * @param scmId
   * @param clusterId
   * @param logger
   * @return true - if volume is in consistent state, otherwise false.
   */
  public static boolean checkVolume(HddsVolume hddsVolume, String scmId, String
      clusterId, Logger logger) {
    File hddsRoot = hddsVolume.getHddsRootDir();
    String volumeRoot = hddsRoot.getPath();
    File scmDir = new File(hddsRoot, scmId);

    try {
      hddsVolume.format(clusterId);
    } catch (IOException ex) {
      logger.error("Error during formatting volume {}, exception is {}",
          volumeRoot, ex);
      return false;
    }

    File[] hddsFiles = hddsRoot.listFiles();

    if(hddsFiles == null) {
      // This is the case for IOException, where listFiles returns null.
      // So, we fail the volume.
      return false;
    } else if (hddsFiles.length == 1) {
      // DN started for first time or this is a newly added volume.
      // So we create scm directory.
      if (!scmDir.mkdir()) {
        logger.error("Unable to create scmDir {}", scmDir);
        return false;
      }
      return true;
    } else if(hddsFiles.length == 2) {
      // The files should be Version and SCM directory
      if (scmDir.exists()) {
        return true;
      } else {
        logger.error("Volume {} is in Inconsistent state, expected scm " +
                "directory {} does not exist", volumeRoot, scmDir
            .getAbsolutePath());
        return false;
      }
    } else {
      // The hdds root dir should always have 2 files. One is Version file
      // and other is SCM directory.
      return false;
    }

  }
}


text:
module NiceBootstrap3Form::Classes
  def _form_group_classes(attribute, *classes)
    classes.tap do |klasses|
      klasses << 'form-group' << ('has-error' if errors_on?(attribute))
    end.compact_squish_join
  end

  def _btn_toolbar_classes(offset, *classes)
    classes.tap do |klasses|
      klasses << 'btn-toolbar'
      klasses << group_sizing_classes(offset)
    end.compact_squish_join
  end

  def _btn_group_classes(size, *classes)
    classes.tap do |klasses|
      klasses << 'btn-group'
      klasses << "btn-group-#{size}" if size
    end.compact_squish_join
  end

  def _control_label_classes(attribute = nil, *classes)
    classes.tap do |klasses|
      klasses << 'control-label' << ('has-error' if errors_on?(attribute))
      if @inside_group
        klasses << 'input-group-addon'
      elsif horizontal
        klasses << @label_width_class
      else
        klasses << 'show'
      end
    end.compact_squish_join
  end

  def _form_control_classes(attribute, *classes)
    classes.tap do |klasses|
      klasses << 'form-control'
      klasses << "input-#{@size}" if @size
      klasses << 'pull-left show' if @inside_group
    end.compact_squish_join
  end

  def _input_group_classes(size, offset, *classes)
    classes.tap do |klasses|
      klasses << 'input-group'
      klasses << "input-group-#{size}" if size
      klasses << group_sizing_classes(offset)
    end.compact_squish_join
  end

  def _input_offset_classes
    ["col-#{@media}-offset-#{@label_width}", "#{@input_width_class}"]
  end

  def _input_addon_classes(*classes)
    classes.tap do |klasses|
      klasses << 'input-group-addon'
    end.compact_squish_join
  end

  def _toggle_class(toggle_type)
    if @inside_group
      'input-group-addon'
    elsif toggle_type.eql?(:check_box)
      'checkbox'
    else
      'radio'
    end
  end

  private

  def group_sizing_classes(offset)
    if offset
      _input_offset_classes
    elsif horizontal
      @input_width_class
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
#ifndef SkOpAngle_DEFINED
#define SkOpAngle_DEFINED

#include "SkLineParameters.h"
#include "SkOpSpan.h"
#include "SkPath.h"
#include "SkPathOpsCubic.h"
#include "SkTDArray.h"

// sorting angles
// given angles of {dx dy ddx ddy dddx dddy} sort them
class SkOpAngle {
public:
    bool operator<(const SkOpAngle& rh) const;
    double dx() const {
        return fTangent1.dx();
    }

    double dy() const {
        return fTangent1.dy();
    }

    int end() const {
        return fEnd;
    }

    bool isHorizontal() const {
        return dy() == 0 && fVerb == SkPath::kLine_Verb;
    }

    bool lengthen();
    bool reverseLengthen();
    void set(const SkPoint* orig, SkPath::Verb verb, const SkOpSegment* segment,
            int start, int end, const SkTDArray<SkOpSpan>& spans);

    void setSpans();
    SkOpSegment* segment() const {
        return const_cast<SkOpSegment*>(fSegment);
    }

    int sign() const {
        return SkSign32(fStart - fEnd);
    }

    const SkTDArray<SkOpSpan>* spans() const {
        return fSpans;
    }

    int start() const {
        return fStart;
    }

    bool unsortable() const {
        return fUnsortable;
    }

#if DEBUG_ANGLE
    const SkPoint* pts() const {
        return fPts;
    }

    SkPath::Verb verb() const {
        return fVerb;
    }

    void debugShow(const SkPoint& a) const {
        SkDebugf("    d=(%1.9g,%1.9g) side=%1.9g\n", dx(), dy(), fSide);
    }
#endif

private:
    const SkPoint* fPts;
    SkDCubic fCurvePart;
    SkPath::Verb fVerb;
    double fSide;
    SkLineParameters fTangent1;
    const SkTDArray<SkOpSpan>* fSpans;
    const SkOpSegment* fSegment;
    int fStart;
    int fEnd;
    bool fReversed;
    mutable bool fUnsortable;  // this alone is editable by the less than operator
};

#endif


text:
module ShareLayouts
end


text:
'use strict';

import * as path from 'path';
import * as Q from 'q';
import * as nopt from 'nopt';

import { DataSource, DataSourceJS } from '../common/models/index';
import { DataSourceManager, dataSourceManagerFactory, loadFileSync, dataSourceToYAML, properDruidRequesterFactory, dataSourceFillerFactory } from './utils/index';

export interface PivotConfig {
  port?: number;
  verbose?: boolean;
  druidHost?: string;
  timeout?: number;
  useSegmentMetadata?: string;
  sourceListScan?: string;
  sourceListRefreshInterval?: number;
  dataSources?: DataSourceJS[];
}

var packageObj = loadFileSync(path.join(__dirname, '../../package.json'), 'json') || {};
export const VERSION = packageObj.version;

function errorExit(e: Error): void {
  console.error(e.message);
  console.error((e as any).stack);
  process.exit(1);
}

function printUsage() {
  console.log(`
Usage: plywood-proxy [options]

Possible usage:

  plywood-proxy --example wiki
  plywood-proxy --druid your.broker.host:8082

      --help                  Print this help message
      --version               Display the version number
  -v, --verbose               Display the DB queries that are being made
  -p, --port                  The port pivot will run on
      --example               Start pivot with some example data (overrides all other options)
  -c, --config                The configuration YAML files to use

      --print-config          Prints out the auto generated config
      --with-comments         Adds comments when printing the auto generated config
      --data-sources-only     Only print the data sources in the auto generated config

  -f, --file                  Start pivot on top of this file based data source (must be JSON, CSV, or TSV)

  -d, --druid                 The Druid broker node to connect to
      --use-segment-metadata  Use the segmentMetadata query for introspection instead of GET /druid/v2/datasources/...
`
  );
}

function parseArgs() {
  return nopt(
    {
      "help": Boolean,
      "version": Boolean,
      "verbose": Boolean,
      "port": Number,
      "example": String,
      "config": String,

      "print-config": Boolean,
      "with-comments": Boolean,
      "data-sources-only": Boolean,

      "file": String,

      "druid": String,
      "use-segment-metadata": Boolean
    },
    {
      "v": ["--verbose"],
      "p": ["--port"],
      "c": ["--config"],
      "f": ["--file"],
      "d": ["--druid"]
    },
    process.argv
  );
}

var parsedArgs = parseArgs();
//console.log(parsedArgs);

if (parsedArgs['help']) {
  printUsage();
  process.exit();
}

if (parsedArgs['version']) {
  console.log(packageObj.version);
  process.exit();
}

const DEFAULT_CONFIG: PivotConfig = {
  port: 9090,
  sourceListScan: 'auto',
  sourceListRefreshInterval: 10000,
  dataSources: []
};

var exampleConfig: PivotConfig = null;
if (parsedArgs['example']) {
  delete parsedArgs['druid'];
  var example = parsedArgs['example'];
  if (example === 'wiki') {
    exampleConfig = loadFileSync(path.join(__dirname, `../../config-example-${example}.yaml`), 'yaml');
  } else {
    console.log(`Unknown example '${example}'. Possible examples are: wiki`);
    process.exit();
  }
}

if (!parsedArgs['example'] && !parsedArgs['config'] && !parsedArgs['druid'] && !parsedArgs['file']) {
  printUsage();
  process.exit();
}

var configFilePath = parsedArgs['config'];
var config: PivotConfig;
if (configFilePath) {
  config = loadFileSync(configFilePath, 'yaml');
  if (!config) {
    config = DEFAULT_CONFIG;
    console.log(`Could not load config from '${configFilePath}', using default`);
  }
} else {
  config = DEFAULT_CONFIG;
}

// If there is an example config take its dataSources
if (exampleConfig && Array.isArray(exampleConfig.dataSources)) {
  config.dataSources = exampleConfig.dataSources;
}

// If a file is specified add it as a dataSource
var file = parsedArgs['file'];
if (file) {
  config.dataSources.push({
    name: path.basename(file, path.extname(file)),
    engine: 'native',
    source: file
  });
}

export const PRINT_CONFIG = Boolean(parsedArgs['print-config']);
export const START_SERVER = !PRINT_CONFIG;
export const VERBOSE = Boolean(parsedArgs['verbose'] || config.verbose);

export const PORT = parseInt(parsedArgs['port'] || config.port, 10);
export const DRUID_HOST = parsedArgs['druid'] || config.druidHost;
export const TIMEOUT = parseInt(<any>config.timeout, 10) || 30000;

export const USE_SEGMENT_METADATA = Boolean(parsedArgs["use-segment-metadata"] || config.useSegmentMetadata);
export const SOURCE_LIST_SCAN = START_SERVER ? config.sourceListScan : 'disable';
export const SOURCE_LIST_REFRESH_INTERVAL = START_SERVER ? (parseInt(<any>config.sourceListRefreshInterval, 10) || 10000) : 0;

if (SOURCE_LIST_REFRESH_INTERVAL && SOURCE_LIST_REFRESH_INTERVAL < 1000) {
  errorExit(new Error('can not refresh more often than once per second'));
}

export const DATA_SOURCES: DataSource[] = (config.dataSources || []).map((dataSourceJS: DataSourceJS, i: number) => {
  if (typeof dataSourceJS !== 'object') errorExit(new Error(`DataSource ${i} is not valid`));
  var dataSourceName = dataSourceJS.name;
  if (typeof dataSourceName !== 'string') errorExit(new Error(`DataSource ${i} must have a name`));

  // Convert maxTime into refreshRule if a maxTime exists
  if (dataSourceJS.maxTime && (typeof dataSourceJS.maxTime === 'string' || (<any>dataSourceJS.maxTime).toISOString)) {
    dataSourceJS.refreshRule = { rule: 'fixed', time: <any>dataSourceJS.maxTime };
    console.warn('maxTime found in config, this is deprecated please convert it to a refreshRule like so:', dataSourceJS.refreshRule);
    delete dataSourceJS.maxTime;
  }

  try {
    return DataSource.fromJS(dataSourceJS);
  } catch (e) {
    errorExit(e);
  }
});

var druidRequester = properDruidRequesterFactory({
  druidHost: DRUID_HOST,
  timeout: TIMEOUT,
  verbose: VERBOSE,
  concurrentLimit: 5
});

var fileDirectory = path.join(__dirname, '../..');

export const DATA_SOURCE_MANAGER: DataSourceManager = dataSourceManagerFactory({
  dataSources: DATA_SOURCES,
  druidRequester,
  dataSourceFiller: dataSourceFillerFactory(druidRequester, fileDirectory, TIMEOUT, USE_SEGMENT_METADATA),
  sourceListScan: SOURCE_LIST_SCAN,
  sourceListRefreshInterval: SOURCE_LIST_REFRESH_INTERVAL,
  log: PRINT_CONFIG ? null : (line: string) => console.log(line)
});

if (PRINT_CONFIG) {
  var withComments = Boolean(parsedArgs['with-comments']);
  var dataSourcesOnly = Boolean(parsedArgs['data-sources-only']);

  DATA_SOURCE_MANAGER.getQueryableDataSources().then((dataSources) => {
    var lines = [
      `# generated by Pivot version ${VERSION}`,
      ''
    ];

    if (!dataSourcesOnly) {
      if (VERBOSE) {
        if (withComments) {
          lines.push("# Run Pivot in verbose mode so it prints out the queries that it issues");
        }
        lines.push(`verbose: true`, '');
      }

      if (withComments) {
        lines.push("# The port on which the Pivot server will listen on");
      }
      lines.push(`port: ${PORT}`, '');

      if (DRUID_HOST) {
        if (withComments) {
          lines.push("# A Druid broker node that can serve data (only used if you have Druid based data source)");
        }
        lines.push(`druidHost: ${DRUID_HOST}`, '');

        if (withComments) {
          lines.push("# A timeout for the Druid queries in ms (default: 30000)");
          lines.push("#timeout: 30000", '');
        }
      }

      if (USE_SEGMENT_METADATA) {
        if (withComments) {
          lines.push("# Use the segmentMetadata query for introspection (only works well with Druid >= 0.8.2)");
        }
        lines.push(`useSegmentMetadata: true`, '');
      }

      lines.push("# Should new datasources automatically be added");
      lines.push(`sourceListScan: disable`, '');
    }

    if (dataSources.length) {
      lines.push('dataSources:');
      lines = lines.concat.apply(lines, dataSources.map(d => dataSourceToYAML(d, withComments)));
    } else {
      lines.push('dataSources: [] # Could not find any data sources please verify network connectivity');
    }

    console.log(lines.join('\n'));
  }).done();
}


text:
using System;
using System.Globalization;
using System.IO;
using System.Xml.Linq;
using Palmmedia.ReportGenerator.Logging;
using Palmmedia.ReportGenerator.Parser;
using Palmmedia.ReportGenerator.Properties;

namespace Palmmedia.ReportGenerator.Reporting
{
    /// <summary>
    /// Generates historic report containing coverage information of current test run.
    /// This information is used to create historic charts in reports.
    /// </summary>
    internal class HistoryReportGenerator
    {
        /// <summary>
        /// The Logger.
        /// </summary>
        private static readonly ILogger Logger = LoggerFactory.GetLogger(typeof(HistoryReportGenerator));

        /// <summary>
        /// The parser to use.
        /// </summary>
        private readonly IParser parser;

        /// <summary>
        /// The history directory.
        /// </summary>
        private readonly string historyDirectory;

        /// <summary>
        /// Initializes a new instance of the <see cref="HistoryReportGenerator"/> class.
        /// </summary>
        /// <param name="parser">The parser.</param>
        /// <param name="historyDirectory">The history directory.</param>
        internal HistoryReportGenerator(IParser parser, string historyDirectory)
        {
            if (parser == null)
            {
                throw new ArgumentNullException(nameof(parser));
            }

            if (historyDirectory == null)
            {
                throw new ArgumentNullException(nameof(historyDirectory));
            }

            this.parser = parser;
            this.historyDirectory = historyDirectory;
        }

        /// <summary>
        /// Starts the generation of the report.
        /// </summary>
        /// <param name="executionTime">The execution time.</param>
        internal void CreateReport(DateTime executionTime)
        {
            Logger.Info(Resources.CreatingHistoryReport);

            string date = executionTime.ToString("yyyy-MM-dd_HH-mm-ss", CultureInfo.InvariantCulture);

            var rootElement = new XElement(
                "coverage",
                new XAttribute("version", "1.0"),
                new XAttribute("date", date));

            foreach (var assembly in this.parser.Assemblies)
            {
                var assemblyElement = new XElement(
                    "assembly",
                    new XAttribute("name", assembly.Name));

                foreach (var @class in assembly.Classes)
                {
                    var classElement = new XElement(
                       "class",
                       new XAttribute("name", @class.Name),
                       new XAttribute("coveredlines", @class.CoveredLines.ToString(CultureInfo.InvariantCulture)),
                       new XAttribute("coverablelines", @class.CoverableLines.ToString(CultureInfo.InvariantCulture)),
                       new XAttribute("totallines", @class.TotalLines.GetValueOrDefault().ToString(CultureInfo.InvariantCulture)),
                       new XAttribute("coveredbranches", @class.CoveredBranches.GetValueOrDefault().ToString(CultureInfo.InvariantCulture)),
                       new XAttribute("totalbranches", @class.TotalBranches.GetValueOrDefault().ToString(CultureInfo.InvariantCulture)));

                    assemblyElement.Add(classElement);
                }

                rootElement.Add(assemblyElement);
            }

            var document = new XDocument(new XDeclaration("1.0", "UTF-8", "yes"), rootElement);
            document.Save(Path.Combine(this.historyDirectory, date + "_CoverageHistory.xml"));
        }
    }
}


text:
#include "set/hdr_set.h"
#include <cds/container/lazy_list_hrc.h>
#include <cds/container/michael_set.h>

namespace set {

    namespace {
        struct set_traits: public cc::michael_set::type_traits
        {
            typedef HashSetHdrTest::hash_int            hash            ;
            typedef HashSetHdrTest::simple_item_counter item_counter    ;
        };

        struct HRC_cmp_traits: public cc::lazy_list::type_traits
        {
            typedef HashSetHdrTest::cmp<HashSetHdrTest::item>   compare ;
        };

        struct HRC_less_traits: public cc::lazy_list::type_traits
        {
            typedef HashSetHdrTest::less<HashSetHdrTest::item>   less ;
        };

        struct HRC_cmpmix_traits: public cc::lazy_list::type_traits
        {
            typedef HashSetHdrTest::cmp<HashSetHdrTest::item>   compare ;
            typedef HashSetHdrTest::less<HashSetHdrTest::item>   less ;
        };
    }

    void HashSetHdrTest::Lazy_HRC_cmp()
    {
        typedef cc::LazyList< cds::gc::HRC, item, HRC_cmp_traits > list   ;

        // traits-based version
        typedef cc::MichaelHashSet< cds::gc::HRC, list, set_traits > set     ;
        test_int< set >()  ;

        // option-based version
        typedef cc::MichaelHashSet< cds::gc::HRC, list,
            cc::michael_set::make_traits<
                cc::opt::hash< hash_int >
                ,cc::opt::item_counter< simple_item_counter >
            >::type
        > opt_set   ;
        test_int< opt_set >()  ;
    }

    void HashSetHdrTest::Lazy_HRC_less()
    {
        typedef cc::LazyList< cds::gc::HRC, item, HRC_less_traits > list   ;

        // traits-based version
        typedef cc::MichaelHashSet< cds::gc::HRC, list, set_traits > set     ;
        test_int< set >()  ;

        // option-based version
        typedef cc::MichaelHashSet< cds::gc::HRC, list,
            cc::michael_set::make_traits<
                cc::opt::hash< hash_int >
                ,cc::opt::item_counter< simple_item_counter >
            >::type
        > opt_set   ;
        test_int< opt_set >()  ;
    }

    void HashSetHdrTest::Lazy_HRC_cmpmix()
    {
        typedef cc::LazyList< cds::gc::HRC, item, HRC_cmpmix_traits > list   ;

        // traits-based version
        typedef cc::MichaelHashSet< cds::gc::HRC, list, set_traits > set     ;
        test_int< set >()  ;

        // option-based version
        typedef cc::MichaelHashSet< cds::gc::HRC, list,
            cc::michael_set::make_traits<
                cc::opt::hash< hash_int >
                ,cc::opt::item_counter< simple_item_counter >
            >::type
        > opt_set   ;
        test_int< opt_set >()  ;
    }

} // namespace set


text:
import { MainContext, MainThreadStorageShape, ExtHostStorageShape } from './extHost.protocol';
import { Emitter } from 'vs/base/common/event';
import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import { IExtensionIdWithVersion } from 'vs/platform/extensionManagement/common/extensionStorage';
import { ILogService } from 'vs/platform/log/common/log';

export interface IStorageChangeEvent {
	shared: boolean;
	key: string;
	value: object;
}

export class ExtHostStorage implements ExtHostStorageShape {

	readonly _serviceBrand: undefined;

	private _proxy: MainThreadStorageShape;

	private readonly _onDidChangeStorage = new Emitter<IStorageChangeEvent>();
	readonly onDidChangeStorage = this._onDidChangeStorage.event;

	constructor(
		mainContext: IExtHostRpcService,
		private readonly _logService: ILogService
	) {
		this._proxy = mainContext.getProxy(MainContext.MainThreadStorage);
	}

	registerExtensionStorageKeysToSync(extension: IExtensionIdWithVersion, keys: string[]): void {
		this._proxy.$registerExtensionStorageKeysToSync(extension, keys);
	}

	async initializeExtensionStorage(shared: boolean, key: string, defaultValue?: object): Promise<object | undefined> {
		const value = await this._proxy.$initializeExtensionStorage(shared, key);

		let parsedValue: object | undefined;
		if (value) {
			parsedValue = this.safeParseValue(shared, key, value);
		}

		return parsedValue || defaultValue;
	}

	setValue(shared: boolean, key: string, value: object): Promise<void> {
		return this._proxy.$setValue(shared, key, value);
	}

	$acceptValue(shared: boolean, key: string, value: string): void {
		const parsedValue = this.safeParseValue(shared, key, value);
		if (parsedValue) {
			this._onDidChangeStorage.fire({ shared, key, value: parsedValue });
		}
	}

	private safeParseValue(shared: boolean, key: string, value: string): object | undefined {
		try {
			return JSON.parse(value);
		} catch (error) {
			// Do not fail this call but log it for diagnostics
			// https://github.com/microsoft/vscode/issues/132777
			this._logService.error(`[extHostStorage] unexpected error parsing storage contents (extensionId: ${key}, global: ${shared}): ${error}`);
		}

		return undefined;
	}
}

export interface IExtHostStorage extends ExtHostStorage { }
export const IExtHostStorage = createDecorator<IExtHostStorage>('IExtHostStorage');


text:
CREATE OR REPLACE FUNCTION clamp_above(bigistore, integer)
 RETURNS bigistore
 LANGUAGE c
 IMMUTABLE STRICT
AS 'istore', $function$bigistore_clamp_above$function$;
----
CREATE OR REPLACE FUNCTION clamp_below(bigistore, integer)
 RETURNS bigistore
 LANGUAGE c
 IMMUTABLE STRICT
AS 'istore', $function$bigistore_clamp_below$function$;
----
CREATE OR REPLACE FUNCTION clamp_above(istore, integer)
 RETURNS istore
 LANGUAGE c
 IMMUTABLE STRICT
AS 'istore', $function$istore_clamp_above$function$;
----
CREATE OR REPLACE FUNCTION clamp_below(istore, integer)
 RETURNS istore
 LANGUAGE c
 IMMUTABLE STRICT
AS 'istore', $function$istore_clamp_below$function$;


text:
layout: page
title: Alvarado Family Reunion
date: 2016-05-24
author: Michelle Carson
tags: weekly links, java
status: published
summary: Mauris hendrerit imperdiet fringilla. Suspendisse gravida.
banner: images/banner/leisure-02.jpg
booking:
  startDate: 04/15/2019
  endDate: 04/20/2019
  ctyhocn: PFNPPHX
  groupCode: AFR
published: true
---
Suspendisse ut cursus sem, eu dapibus enim. Aenean eget ante vulputate, gravida massa a, ullamcorper purus. Donec nec arcu ut leo tincidunt accumsan. Proin rutrum rhoncus velit, in tempor purus ullamcorper sed. Cras consectetur faucibus ipsum, at commodo urna fermentum a. Sed ornare neque convallis dignissim scelerisque. Integer lobortis magna ac fermentum aliquet. Sed varius sit amet odio eget varius. Donec nulla neque, sollicitudin non nisl sed, ultricies lobortis velit.

* Etiam viverra diam ac ante hendrerit vehicula
* Proin finibus lacus et faucibus dapibus
* Nam ut sapien elementum purus semper sollicitudin sit amet ut dui.

Curabitur mattis ligula eu elit fringilla, ac tempor enim congue. Vestibulum ac urna euismod, convallis mauris quis, suscipit lorem. Quisque purus tellus, consequat sit amet augue a, condimentum pharetra mi. Nulla faucibus posuere est. Sed maximus odio eu aliquet tristique. Etiam pulvinar hendrerit diam sollicitudin aliquam. Vivamus vestibulum ac ex in consectetur. Fusce quis scelerisque justo, at aliquam nisl. Suspendisse potenti. Ut eu massa maximus, lacinia lectus ac, ullamcorper turpis. Duis et mattis urna. Cras ac nisi erat.
Nam risus nisl, placerat et tortor in, finibus efficitur eros. In hac habitasse platea dictumst. Donec hendrerit, ex ut finibus finibus, dolor ex finibus sem, eu efficitur ipsum dui ut justo. Sed luctus euismod risus. Duis vulputate lacus quis purus faucibus luctus in et enim. Nulla euismod quam id metus suscipit dictum. Nam ullamcorper elit sit amet nisl mattis tristique. Nam at metus vitae felis bibendum vestibulum eu quis dolor. Vivamus nec nisi tempus, ultricies turpis sed, pellentesque diam. Proin eget elit tempor, sodales massa sit amet, bibendum ex. Vivamus eu dolor dui. Donec volutpat et nunc sagittis posuere. Sed vel tincidunt ex, eu malesuada diam.


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

namespace ManaPHP\Helper;

use ManaPHP\Di\FactoryInterface;
use ManaPHP\Di\InjectorInterface;
use ManaPHP\Di\InvokerInterface;
use Psr\Container\ContainerInterface;

class Container
{
    public static function get(string $id): mixed
    {
        /** @var ContainerInterface $container */
        $container = $GLOBALS['Psr\Container\ContainerInterface'];

        return $container->get($id);
    }

    public static function has(string $id): bool
    {
        /** @var ContainerInterface $container */
        $container = $GLOBALS['Psr\Container\ContainerInterface'];

        return $container->has($id);
    }

    public static function make(string $class, array $parameters = []): mixed
    {
        /** @var ContainerInterface $container */
        $container = $GLOBALS['Psr\Container\ContainerInterface'];

        return $container->get(FactoryInterface::class)->make($class, $parameters);
    }

    public static function call(callable $callable, array $parameters = []): mixed
    {
        /** @var ContainerInterface $container */
        $container = $GLOBALS['Psr\Container\ContainerInterface'];

        return $container->get(InvokerInterface::class)->call($callable, $parameters);
    }

    public static function inject(object $object, string $property): mixed
    {
        /** @var ContainerInterface $container */
        $container = $GLOBALS['Psr\Container\ContainerInterface'];

        return $container->get(InjectorInterface::class)->inject($object, $property);
    }

    public static function canInject(object $object, string $property): bool
    {
        /** @var ContainerInterface $container */
        $container = $GLOBALS['Psr\Container\ContainerInterface'];

        return $container->get(InjectorInterface::class)->canInject($object, $property);
    }
}


text:
require 'eventmachine'
require 'test/unit'
require 'rbconfig'
require 'socket'

class Test::Unit::TestCase
  class EMTestTimeout < StandardError ; end

  def setup_timeout(timeout = TIMEOUT_INTERVAL)
    EM.schedule {
      EM.add_timer(timeout) {
        raise EMTestTimeout, "Test was cancelled after #{timeout} seconds."
      }
    }
  end

  def port_in_use?(port, host="127.0.0.1")
    s = TCPSocket.new(host, port)
    s.close
    s
  rescue Errno::ECONNREFUSED
    false
  end

  def next_port
    @@port ||= 9000
    begin
      @@port += 1
    end while port_in_use?(@@port)

    @@port
  end

  # Returns true if the host have a localhost 127.0.0.1 IPv4.
  def self.local_ipv4?
    return @@has_local_ipv4 if defined?(@@has_local_ipv4)
    begin
      get_my_ipv4_address "127.0.0.1"
      @@has_local_ipv4 = true
    rescue
      @@has_local_ipv4 = false
    end
  end

  # Returns true if the host have a public IPv4 and stores it in
  # @@public_ipv4.
  def self.public_ipv4?
    return @@has_public_ipv4 if defined?(@@has_public_ipv4)
    begin
      @@public_ipv4 = get_my_ipv4_address "1.2.3.4"
      @@has_public_ipv4 = true
    rescue
      @@has_public_ipv4 = false
    end
  end

  # Returns true if the host have a localhost ::1 IPv6.
  def self.local_ipv6?
    return @@has_local_ipv6 if defined?(@@has_local_ipv6)
    begin
      get_my_ipv6_address "::1"
      @@has_local_ipv6 = true
    rescue
      @@has_local_ipv6 = false
    end
  end

  # Returns true if the host have a public IPv6 and stores it in
  # @@public_ipv6.
  def self.public_ipv6?
    return @@has_public_ipv6 if defined?(@@has_public_ipv6)
    begin
      @@public_ipv6 = get_my_ipv6_address "2001::1"
      @@has_public_ipv6 = true
    rescue
      @@has_public_ipv6 = false
    end
  end

  # Returns an array with the localhost addresses (IPv4 and/or IPv6).
  def local_ips
    return @@local_ips if defined?(@@local_ips)
    @@local_ips = []
    @@local_ips << "127.0.0.1" if self.class.local_ipv4?
    @@local_ips << "::1" if self.class.local_ipv6?
    @@local_ips
  end

  def exception_class
    jruby? ? NativeException : RuntimeError
  end

  module PlatformHelper
    # http://blog.emptyway.com/2009/11/03/proper-way-to-detect-windows-platform-in-ruby/
    def windows?
      RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
    end

    def solaris?
      RUBY_PLATFORM =~ /solaris/
    end

    # http://stackoverflow.com/questions/1342535/how-can-i-tell-if-im-running-from-jruby-vs-ruby/1685970#1685970
    def jruby?
      defined? JRUBY_VERSION
    end

    def rbx?
      defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
    end
  end

  include PlatformHelper
  extend PlatformHelper

  # Tests run significantly slower on windows. YMMV
  TIMEOUT_INTERVAL = windows? ? 1 : 0.25

  def silent
    backup, $VERBOSE = $VERBOSE, nil
    begin
      yield
    ensure
      $VERBOSE = backup
    end
  end

  private

  def self.get_my_ipv4_address ip
    orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true  # turn off reverse DNS resolution temporarily
    UDPSocket.open(Socket::AF_INET) do |s|
      s.connect ip, 1
      s.addr.last
    end
  ensure
    Socket.do_not_reverse_lookup = orig
  end

  def self.get_my_ipv6_address ip
    orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true  # turn off reverse DNS resolution temporarily
    UDPSocket.open(Socket::AF_INET6) do |s|
      s.connect ip, 1
      s.addr.last
    end
  ensure
    Socket.do_not_reverse_lookup = orig
  end

end


text:
require 'test_helper'

module Booking
  class CustomersControllerTest < ActionController::TestCase
    setup do
      @customer = booking_customers(:one)
      @routes = Engine.routes
    end

    test "should get index" do
      get :index
      assert_response :success
      assert_not_nil assigns(:customers)
    end

    test "should get new" do
      get :new
      assert_response :success
    end

    test "should create customer" do
      assert_difference('Customer.count') do
        post :create, customer: { address: @customer.address, city: @customer.city, country: @customer.country, email: @customer.email, first_name: @customer.first_name, last_name: @customer.last_name, phone: @customer.phone, state: @customer.state, title: @customer.title, zip: @customer.zip }
      end

      assert_redirected_to customer_path(assigns(:customer))
    end

    test "should show customer" do
      get :show, id: @customer
      assert_response :success
    end

    test "should get edit" do
      get :edit, id: @customer
      assert_response :success
    end

    test "should update customer" do
      patch :update, id: @customer, customer: { address: @customer.address, city: @customer.city, country: @customer.country, email: @customer.email, first_name: @customer.first_name, last_name: @customer.last_name, phone: @customer.phone, state: @customer.state, title: @customer.title, zip: @customer.zip }
      assert_redirected_to customer_path(assigns(:customer))
    end

    test "should destroy customer" do
      assert_difference('Customer.count', -1) do
        delete :destroy, id: @customer
      end

      assert_redirected_to customers_path
    end
  end
end


text:
import wx

# popup menu class
class MyPopupMenu(wx.Menu):
    def __init__(self, parent):
        super(MyPopupMenu, self).__init__()

        self.parent = parent

        mmi = wx.MenuItem(self, wx.NewId(), 'Minimize')
        self.Append(mmi)
        self.Bind(wx.EVT_MENU, self.OnMinimize, mmi)

        cmi = wx.MenuItem(self, wx.NewId(), 'Maximum')
        self.Append(cmi)
        self.Bind(wx.EVT_MENU, self.OnMaximize, cmi)

    def OnMinimize(self, e):
        self.parent.Iconize()

    def OnMaximize(self, e):
        self.parent.Maximize()

# Frame class
APP_EXIT = 1
class Example_Frame(wx.Frame):
    def __init__(self, parent, title):
        super(Example_Frame, self).__init__(parent, title=title,
                                      size=(250, 200))
        self.initUI()

    def initUI(self):
        menubar = wx.MenuBar() # create a menubar instance
        # --- the first menu ---
        fileMenu = wx.Menu()  # create a menu instance
        fitem = wx.MenuItem(fileMenu, APP_EXIT, '&Quit\tCtrl+Q') # create a menuitem with an ID
        img = wx.Image('exit.bmp') # load an image (64x64)
        img = img.Scale(16, 16) # resize the image
        fitem.SetBitmap(wx.Bitmap(img)) # set to the menuitem
        fileMenu.Append(fitem) # add menuitem to menu
        self.Bind(wx.EVT_MENU, self.OnQuit, id = APP_EXIT) # bind the menuitem to menuitem ID
        # = self.Bind(wx.EVT_MENU, self.OnQuit, fitem)
        menubar.Append(fileMenu, '&File') # add menu to menubar

        # --- the second menu with a sub menu ----
        editMenu = wx.Menu()
        editMenu.Append(wx.ID_COPY, '&Copy\tCtrl+C')
        editMenu.Append(wx.ID_PASTE, '&Paste\tCtrl+P')
        editMenu.AppendSeparator()
        # sub menu
        imp = wx.Menu()
        imp.Append(wx.ID_ANY, 'Import newsfeed list...')
        imp.Append(wx.ID_ANY, 'Import bookmarks...')
        imp.Append(wx.ID_ANY, 'Import mail...')
        editMenu.Append(wx.ID_ANY, 'I&mport', imp)
        menubar.Append(editMenu, '&Edit')

        # ---  the third menu with checkbox menu items connected to toolbar and statusbar ---
        viewMenu = wx.Menu()
        self.shst = viewMenu.Append(wx.ID_ANY, 'Show statusbar', 'Show Status Bar', kind=wx.ITEM_CHECK)
        self.shtl = viewMenu.Append(wx.ID_ANY, 'Show toolbar', 'Show Tool Bar', kind=wx.ITEM_CHECK)
        viewMenu.Check(self.shst.GetId(), True)
        viewMenu.Check(self.shtl.GetId(), True)
        self.Bind(wx.EVT_MENU, self.ToggleStatusBar, self.shst)
        self.Bind(wx.EVT_MENU, self.ToggleToolBar, self.shtl)
        menubar.Append(viewMenu, '&View')

        self.SetMenuBar(menubar) # add menubar to frame
        # add toolbar
        self.toolbar = self.CreateToolBar()
        self.toolbar.AddTool(wx.ID_ANY, '', wx.Bitmap('new.bmp'))
        self.toolbar.AddTool(wx.ID_EXIT, '', wx.Bitmap('exit.bmp'))
        self.toolbar.EnableTool(wx.ID_EXIT, False)
        self.toolbar.Realize()
        # add status bar
        self.statusbar = self.CreateStatusBar(3)
        self.statusbar.SetStatusText('Ready',2)
        # bind right down
        self.popMenu = MyPopupMenu(self)
        self.Bind(wx.EVT_RIGHT_DOWN, self.OnRightDown)

    def OnQuit(self, e):
        self.Close()

    def show(self):
        self.Center()
        self.Move((800, 250))
        self.Show()

    def ToggleStatusBar(self, e):

        if self.shst.IsChecked():
            self.statusbar.Show()
        else:
            self.statusbar.Hide()

    def ToggleToolBar(self, e):

        if self.shtl.IsChecked():
            self.toolbar.Show()
        else:
            self.toolbar.Hide()

    def OnRightDown(self, e):
        self.PopupMenu(self.popMenu, e.GetPosition())

if __name__ == '__main__':
    # must have App()
    app = wx.App()
    # wx.Frame(wx.Window parent, int id=-1, string title='', wx.Point pos = wx.DefaultPosition,
    #  wx.Size size = wx.DefaultSize, style = wx.DEFAULT_FRAME_STYLE, string name = "frame")
#    frame = wx.Frame(None, style = wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX | wx.RESIZE_BORDER
#                               | wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX | wx.CLIP_CHILDREN)
#    frame.Show()

    # sample of using Eample class
    ef = Example_Frame(None, title='Size')
    Example_Frame.show(ef)
    app.MainLoop()


text:
var express = require('express');
var flash = require('connect-flash');
var passport = require('passport');
var router = express.Router();

/* GET login form. */
router.get('/login', function(req, res) {
  res.render('login', {
    title: 'Smarty login',
    message: req.flash('loginMessage')
  });
});

/* GET signup form */
router.get('/signup', function(req, res) {
  res.render('signup', {
    title: 'Smarty sign up',
    message: req.flash('signupMessage')
  });
});

router.get('/logout', function(req, res) {
	req.logout();
	res.redirect('/');
});

/* POST login form */
router.post('/login', passport.authenticate('local-login', {
		successRedirect : '/',
		failureRedirect : '/login',
		failureFlash : true
	}));

/* POST signup form */
router.post('/signup', passport.authenticate('local-signup', {
	successRedirect : '/',
	failureRedirect : '/signup',
	failureFlash : true
}));

module.exports = router;


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Heterosporium munduleae Syd. & P. Syd.

### Remarks
null


text:
import compose from './compose'
import $zip from './$zip'
import $filter from './$filter'
import $map from './$map'

export default function $compress (...args) {
  return compose(
    $map(entry => entry[0]),
    $filter(entry => entry[1]),
    (iterable, compress) => $zip(iterable, compress)
  )(...args)
}


text:
*Topic automatically generated on: 2015-04-29*

Adds a HTML based publishing page layout
##Syntax
```powershell
Add-SPOHtmlPublishingPageLayout -SourceFilePath <String> -Title <String> -Description <String> -AssociatedContentTypeID <String> [-Web <WebPipeBind>]```

##Parameters
Parameter|Type|Required|Description
---------|----|--------|-----------
AssociatedContentTypeID|String|True|
Description|String|True|
SourceFilePath|String|True|Path to the file which will be uploaded
Title|String|True|
Web|WebPipeBind|False|The web to apply the command to. Omit this parameter to use the current web.
<!-- Ref: B7CF06C9FEDB780C7D0CED67D7CF7079 -->


text:
'use strict';

const BbPromise = require('bluebird');
const _ = require('lodash');

class PushLink {
  constructor(davis, options) {
    this.davis = davis;
    this.options = options;

    this.intents = {
      showMe: {
        usage: 'Push link to browser',
        lifecycleEvents: [
          'showMe',
        ],
        phrases: [
          'Push that to my browser.',
          'Show me in my browser.',
          'Send me that link.',
          'Show me that link.',
          'Send that to my browser.',
          'open dynatrace',
          'display dynatrace',
          'show me dynatrace',
          'show dynatrace',
          'display dynatrace',
          'dynatrace dashboard',
          'open dashboard',
          'show dashboard',
          'show me the root cause',
          'open root cause',
          'display root cause',
        ],
        regex: /^show me|^open /i,
        clarification: 'I think you were asking me to send a link to your browser.',
      },
      pushLink: {
        skipHelp: true,
        usage: 'Push link to user via socket to Chrome extension',
        lifecycleEvents: [
          'pushLink',
        ],
        phrases: [],
      },
    };

    this.hooks = {
      'showMe:showMe': (exchange) => {
        exchange.addContext({ choice: true });
        return this.davis.pluginManager.run(exchange, 'pushLink');
      },
      'pushLink:pushLink': this.pushLink.bind(this),
    };
  }

  pushLink(exchange, context) { // eslint-disable-line consistent-return
    const raw = exchange.getRawRequest();
    const choice = context.choice;
    const linkUrl = exchange.getLinkUrl();

    // data extraction
    const vrp = /resolution path|vrp/i.test(raw);
    const system = /system|smart/i.test(raw);
    const dynatrace = /dashboard|dynatrace|d(i|y).{0,10}trace/i.test(raw);
    const rootcause = /root cause|rootcause|root|cause/i.test(raw);
    const list = /list/i.test(raw);
    const router = this.davis.pluginManager.getIntent('routing').regex.test(raw);

    if (router) {
      return this.davis.pluginManager.run(exchange, 'routing');
    }

    if (list) {
      if (context.paging) {
        return this.davis.pluginManager.run(exchange, 'showPage');
      }

      return exchange.response('There is currently nothing to list.');
    }

    if (!this.davis.server.isSocketConnected(exchange.user)) {
      return exchange.response("Unfortunetly, it appears that you don't have the Voice Navigator (Chrome extension) enabled. Look for a download link under the Chrome section in the Davis account settings. For more information, see the davis GitHub wiki on enabling the Voice Navigator.");
    }

    if (_.isNil(choice)) {
      if (vrp) {
        // user asked about visual resolution path

        if (!context.pid) {
          return exchange.response("I'm not sure which problem you are referring to.");
        }
        return this.davis.dynatrace.problemDetails(context.pid)
          .then((detail) => {
            if (!detail.rankedEvents[0].isRootCause) {
              return exchange.response("I'm sorry, I can only show you the visual resolution path for problems that have detected root causes.");
            }

            this.davis.server.pushLinkToUser(exchange.user, this.davis.linker.vrp(context.pid), true);
            return exchange.response(`Here is the visual resolution path for problem ${detail.displayName}.`);
          });
      } else if (system) {
        // user asked about their system

        this.davis.server.pushLinkToUser(exchange.user, this.davis.linker.smartScape(), true);
        return BbPromise.all([
          exchange.davis.dynatrace.getApplicationEntities(),
          exchange.davis.dynatrace.getServiceEntities(),
          exchange.davis.dynatrace.getInfrastructureEntities(),
        ]).spread((applications, services, hosts) => {
          const numOfApps = _.filter(applications, app => app.applicationType !== 'SYNTHETIC').length;
          const numOfServices = services.length;
          const numOfHosts = hosts.length;
          const app = (numOfApps === 1) ? 'application' : 'applications';
          const service = (numOfServices === 1) ? 'service' : 'services';
          const host = (numOfHosts === 1) ? 'host' : 'hosts';
          return exchange.response(`Okay, here is your Dynatrace SmartScape.  Currently, it includes ${numOfApps} active ${app} consisting of around ${numOfServices} ${service} across ${numOfHosts} ${host}!`);
        });
      } else if (dynatrace) {
        // user asked to open dynatrace

        this.davis.server.pushLinkToUser(exchange.user, this.davis.linker.home(), true);
        return exchange.davis.dynatrace.problemStatus()
          .then((problems) => {
            const currentProblemCount = problems.result.totalOpenProblemsCount;
            const phrase = "Okay, no problem, here's your Dynatrace dashboard.";
            if (currentProblemCount === 0) {
              return exchange.response(`${phrase}  Good news!  It looks like there are no active issues.`);
            } else if (currentProblemCount === 1) {
              return exchange
                .setTarget('problem')
                .response(phrase)
                .followUp('Would you like to investigate the open issue?');
            }
            return exchange
              .setTarget('problem')
              .response(phrase)
              .followUp(`Would you like to investigate the ${currentProblemCount} active issues?`);
          });
      } else if (rootcause) {
        // user asked to open root cause

        if (!context.pid) {
          return exchange.response("I'm not sure which problem you are referring to.");
        }
        return this.davis.dynatrace.problemDetails(context.pid)
          .then((detail) => {
            if (!detail.rankedEvents[0].isRootCause) {
              return exchange.response("This problem doesn't appear to have a detected root cause.");
            }

            this.davis.server.pushLinkToUser(exchange.user, this.davis.linker.rootCause(detail), true);
            return exchange.response("Got it, here's some details about this problem's root cause.");
          });
      }

      if (linkUrl) {
        this.davis.server.pushLinkToUser(exchange.user, linkUrl, true);
        return exchange.response("I'm sending the link to you now!").end();
      }
      return exchange.response("I couldn't find a link to send you.");
    }

    // user gave a yes/no answer
    if (_.isBoolean(choice)) {
      if (choice) { // user said yes
        if (_.isNil(linkUrl)) {
          this.davis.logger.warn('linkUrl undefined');
          exchange.response('Sorry, the link is unavailable.');
        } else {
          this.davis.server.pushLinkToUser(exchange.user, linkUrl, true);
          exchange.response("I'm sending the link to you now!").end();
        }
      } else { // user said no
        exchange
          .addContext({ targetIntent: 'problemDetails' })
          .response('OK, no problem.')
          .followUp('Would you like to hear about another problem?');
      }
    } else if (!_.isNil(choice)) {
      // if user didn't answer yes or no, did they mean to ask about another problem?
      return this.davis.pluginManager.run(exchange, 'problemDetails');
    }
  }
}

module.exports = PushLink;


text:
use lib 'lib';
use strict;
use warnings;
use utf8;
use File::Slurp; # From CPAN
use JSON;

use AsposeOcrCloud::OcrApi;
use AsposeOcrCloud::ApiClient;
use AsposeOcrCloud::Configuration;

my $configFile = '../../Config/config.json';
my $configPropsText = read_file($configFile);
my $configProps = decode_json($configPropsText);

my $data_path = '../../../../Data/';
my $out_path = $configProps->{'out_folder'};;

#ExStart:1
$AsposeOcrCloud::Configuration::app_sid = $configProps->{'app_sid'};
$AsposeOcrCloud::Configuration::api_key = $configProps->{'api_key'};
$AsposeOcrCloud::Configuration::debug = 1;

# Instantiate Aspose.OCR API SDK
my $ocrApi = AsposeOcrCloud::OcrApi->new();

# Set the image file name
my $name = 'Sampleocr.bmp';

# Set the language of the document
my $language = 'English';

# Set the spelling correction is used
my $useDefaultDictionaries = 'true';

# Invoke Aspose.OCR Cloud SDK API to extract image text from local file
my $response = $ocrApi->PostOcrFromUrlOrContent(language=> $language, useDefaultDictionaries=>$useDefaultDictionaries, file => $data_path.$name);

if($response->{'Status'} eq 'OK'){
    print "\n Text :: " . $response->{'Text'};

    print "\n Extract OCR or HOCR Text from Images without using Storage, Done!";

}
#ExEnd:1


text:
<?xml version="1.0" ?>
<!--

    Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.

    This program and the accompanying materials are made available under the
    terms of the Eclipse Distribution License v. 1.0, which is available at
    http://www.eclipse.org/org/documents/edl-v10.php.

    SPDX-License-Identifier: BSD-3-Clause

-->

<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <wsa:Address>http://localhost:2011/hello</wsa:Address>
    <wsa:Metadata>
        <definitions xmlns:tns="http://echo.org/" xmlns:abs="http://echo.abstract.org/"
                     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                     xmlns="http://schemas.xmlsoap.org/wsdl/"
                     targetNamespace="http://echo.org/" name="RpcLitEndpoint">

        <import namespace="http://echo.abstract.org" location="http://localhost:2011/hello?wsdl=1"></import>

        <binding type="abs:RpcLitIF" name="RpcLitPortBinding">
            <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"></soap:binding>
            <operation name="echoInteger">
                <soap:operation soapAction=""></soap:operation>
                <input>
                    <soap:body namespace="http://echo.org/" use="literal"></soap:body>
                </input>
                <output>
                    <soap:body namespace="http://echo.org/" use="literal"></soap:body>
                </output>
            </operation>
        </binding>
        <service name="RpcLitEndpoint">
            <port binding="tns:RpcLitPortBinding" name="RpcLitPort">
                <soap:address location="http://localhost:2011/hello"></soap:address>
            </port>
        </service>
        <!-- NOT_GENERATED -->
    </definitions>
</wsa:Metadata></wsa:EndpointReference>


text:
namespace blink {

class NFCMessage;

class MessageCallback : public GarbageCollectedFinalized<MessageCallback> {
 public:
  virtual ~MessageCallback() {}
  DEFINE_INLINE_VIRTUAL_TRACE() {}
  virtual void handleMessage(const NFCMessage&) = 0;
};

}  // namespace blink

#endif  // MessageCallback_h


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.Threading.Tasks;

namespace SharedPoolsOfWCFObjects
{
    public class HelloWorldTest : ITestTemplate<WcfService1.IService1>
    {
        public HelloWorldTest() { }
        public EndpointAddress CreateEndPointAddress()
        {
            return TestHelpers.CreateEndPointAddress();
        }

        public Binding CreateBinding()
        {
            return TestHelpers.CreateBinding();
        }

        public ChannelFactory<WcfService1.IService1> CreateChannelFactory()
        {
            return TestHelpers.CreateChannelFactory<WcfService1.IService1>(CreateEndPointAddress(), CreateBinding());
        }
        public void CloseFactory(ChannelFactory<WcfService1.IService1> factory)
        {
            TestHelpers.CloseFactory(factory);
        }
        public Task CloseFactoryAsync(ChannelFactory<WcfService1.IService1> factory)
        {
            return TestHelpers.CloseFactoryAsync(factory);
        }

        public WcfService1.IService1 CreateChannel(ChannelFactory<WcfService1.IService1> factory)
        {
            return TestHelpers.CreateChannel(factory);
        }
        public void CloseChannel(WcfService1.IService1 channel)
        {
            TestHelpers.CloseChannel(channel);
        }
        public Task CloseChannelAsync(WcfService1.IService1 channel)
        {
            return TestHelpers.CloseChannelAsync(channel);
        }

        public Action<WcfService1.IService1> UseChannel()
        {
            return (channel) => { channel.GetData(44); };
        }
        public Func<WcfService1.IService1, Task> UseAsyncChannel()
        {
            return (channel) => { return channel.GetDataAsync(44); };
        }
    }

}


text:
/**
 * grunt dist builds a minified/vulcanized version of the app in the dist/ folder in preparation for cf push-ing
 */
module.exports = function(grunt) {
    grunt.registerTask('dist', ['clean:build', 'jshint', 'test', 'vulcanize', 'copy:dist', 'requirejs']);
};


text:
namespace {

using AXRole = ax::mojom::Role;
using fuchsia::accessibility::semantics::MAX_LABEL_SIZE;
using fuchsia::accessibility::semantics::Role;

// Fuchsia's default root node ID.
constexpr uint32_t kFuchsiaRootNodeId = 0;

fuchsia::accessibility::semantics::Attributes ConvertAttributes(
    const ui::AXNode& node) {
  fuchsia::accessibility::semantics::Attributes attributes;
  if (node.HasStringAttribute(ax::mojom::StringAttribute::kName)) {
    const std::string& name =
        node.GetStringAttribute(ax::mojom::StringAttribute::kName);
    attributes.set_label(name.substr(0, MAX_LABEL_SIZE));
  }

  if (node.HasStringAttribute(ax::mojom::StringAttribute::kDescription)) {
    const std::string& description =
        node.GetStringAttribute(ax::mojom::StringAttribute::kDescription);
    attributes.set_secondary_label(description.substr(0, MAX_LABEL_SIZE));
  }

  if (node.data().IsRangeValueSupported()) {
    fuchsia::accessibility::semantics::RangeAttributes range_attributes;
    if (node.HasFloatAttribute(ax::mojom::FloatAttribute::kMinValueForRange)) {
      range_attributes.set_min_value(
          node.GetFloatAttribute(ax::mojom::FloatAttribute::kMinValueForRange));
    }
    if (node.HasFloatAttribute(ax::mojom::FloatAttribute::kMaxValueForRange)) {
      range_attributes.set_max_value(
          node.GetFloatAttribute(ax::mojom::FloatAttribute::kMaxValueForRange));
    }
    if (node.HasFloatAttribute(ax::mojom::FloatAttribute::kStepValueForRange)) {
      range_attributes.set_step_delta(node.GetFloatAttribute(
          ax::mojom::FloatAttribute::kStepValueForRange));
    }
    attributes.set_range(std::move(range_attributes));
  }

  if (node.IsTable()) {
    fuchsia::accessibility::semantics::TableAttributes table_attributes;
    auto col_count = node.GetTableColCount();
    if (col_count)
      table_attributes.set_number_of_columns(*col_count);

    auto row_count = node.GetTableRowCount();
    if (row_count)
      table_attributes.set_number_of_rows(*row_count);

    if (!table_attributes.IsEmpty())
      attributes.set_table_attributes(std::move(table_attributes));
  }

  if (node.IsTableRow()) {
    fuchsia::accessibility::semantics::TableRowAttributes table_row_attributes;
    auto row_index = node.GetTableRowRowIndex();
    if (row_index) {
      table_row_attributes.set_row_index(*row_index);
      attributes.set_table_row_attributes(std::move(table_row_attributes));
    }
  }

  if (node.IsTableCellOrHeader()) {
    fuchsia::accessibility::semantics::TableCellAttributes
        table_cell_attributes;

    auto col_index = node.GetTableCellColIndex();
    if (col_index)
      table_cell_attributes.set_column_index(*col_index);

    auto row_index = node.GetTableCellRowIndex();
    if (row_index)
      table_cell_attributes.set_row_index(*row_index);

    auto col_span = node.GetTableCellColSpan();
    if (col_span)
      table_cell_attributes.set_column_span(*col_span);

    auto row_span = node.GetTableCellRowSpan();
    if (row_span)
      table_cell_attributes.set_row_span(*row_span);

    if (!table_cell_attributes.IsEmpty())
      attributes.set_table_cell_attributes(std::move(table_cell_attributes));
  }

  return attributes;
}

// Converts an AXRole to a Fuchsia Role.
Role AxRoleToFuchsiaSemanticRole(AXRole role) {
  switch (role) {
    case AXRole::kButton:
      return Role::BUTTON;
    case AXRole::kCheckBox:
      return Role::CHECK_BOX;
    case AXRole::kHeader:
      return Role::HEADER;
    case AXRole::kImage:
      return Role::IMAGE;
    case AXRole::kLink:
      return Role::LINK;
    case AXRole::kRadioButton:
      return Role::RADIO_BUTTON;
    case AXRole::kSlider:
      return Role::SLIDER;
    case AXRole::kTextField:
      return Role::TEXT_FIELD;
    case AXRole::kStaticText:
      return Role::STATIC_TEXT;
    case AXRole::kSearchBox:
      return Role::SEARCH_BOX;
    case AXRole::kTextFieldWithComboBox:
      return Role::TEXT_FIELD_WITH_COMBO_BOX;
    case AXRole::kTable:
      return Role::TABLE;
    case AXRole::kGrid:
      return Role::GRID;
    case AXRole::kRow:
      return Role::TABLE_ROW;
    case AXRole::kCell:
      return Role::CELL;
    case AXRole::kColumnHeader:
      return Role::COLUMN_HEADER;
    case AXRole::kRowGroup:
      return Role::ROW_GROUP;
    case AXRole::kParagraph:
      return Role::PARAGRAPH;
    default:
      return Role::UNKNOWN;
  }
}

// This function handles conversions for all data that is part of a Semantic
// Node's state. The corresponding data in an AXNodeData is stored in various
// attributes.
fuchsia::accessibility::semantics::States ConvertStates(
    const ui::AXNodeData& node) {
  fuchsia::accessibility::semantics::States states;

  // Converts checked state of a node.
  if (node.HasIntAttribute(ax::mojom::IntAttribute::kCheckedState)) {
    ax::mojom::CheckedState ax_state = node.GetCheckedState();
    switch (ax_state) {
      case ax::mojom::CheckedState::kNone:
        states.set_checked_state(
            fuchsia::accessibility::semantics::CheckedState::NONE);
        break;
      case ax::mojom::CheckedState::kTrue:
        states.set_checked_state(
            fuchsia::accessibility::semantics::CheckedState::CHECKED);
        break;
      case ax::mojom::CheckedState::kFalse:
        states.set_checked_state(
            fuchsia::accessibility::semantics::CheckedState::UNCHECKED);
        break;
      case ax::mojom::CheckedState::kMixed:
        states.set_checked_state(
            fuchsia::accessibility::semantics::CheckedState::MIXED);
        break;
    }
  }

  // Indicates whether a node has been selected.
  if (node.HasBoolAttribute(ax::mojom::BoolAttribute::kSelected)) {
    states.set_selected(
        node.GetBoolAttribute(ax::mojom::BoolAttribute::kSelected));
  }

  // Indicates if the node is hidden.
  states.set_hidden(node.IsIgnored() || node.IsInvisible());

  // The user entered value of the node, if applicable.
  if (node.HasStringAttribute(ax::mojom::StringAttribute::kValue)) {
    const std::string& value =
        node.GetStringAttribute(ax::mojom::StringAttribute::kValue);
    states.set_value(value.substr(0, MAX_LABEL_SIZE));
  }

  // The value a range element currently has.
  if (node.HasFloatAttribute(ax::mojom::FloatAttribute::kValueForRange)) {
    states.set_range_value(
        node.GetFloatAttribute(ax::mojom::FloatAttribute::kValueForRange));
  }

  // The scroll offsets, if the element is a scrollable container.
  const float x_scroll_offset =
      node.GetIntAttribute(ax::mojom::IntAttribute::kScrollX);
  const float y_scroll_offset =
      node.GetIntAttribute(ax::mojom::IntAttribute::kScrollY);
  if (x_scroll_offset || y_scroll_offset)
    states.set_viewport_offset({x_scroll_offset, y_scroll_offset});

  if (node.HasState(ax::mojom::State::kFocusable))
    states.set_focusable(true);

  return states;
}

std::vector<fuchsia::accessibility::semantics::Action> ConvertActions(
    const ui::AXNodeData& node) {
  std::vector<fuchsia::accessibility::semantics::Action> fuchsia_actions;

  const bool has_default =
      node.HasAction(ax::mojom::Action::kDoDefault) ||
      node.GetDefaultActionVerb() != ax::mojom::DefaultActionVerb::kNone;
  if (has_default) {
    fuchsia_actions.push_back(
        fuchsia::accessibility::semantics::Action::DEFAULT);
  }
  if (node.HasAction(ax::mojom::Action::kFocus)) {
    fuchsia_actions.push_back(
        fuchsia::accessibility::semantics::Action::SET_FOCUS);
  }
  if (node.HasAction(ax::mojom::Action::kSetValue)) {
    fuchsia_actions.push_back(
        fuchsia::accessibility::semantics::Action::SET_VALUE);
  }
  if (node.HasAction(ax::mojom::Action::kScrollToMakeVisible)) {
    fuchsia_actions.push_back(
        fuchsia::accessibility::semantics::Action::SHOW_ON_SCREEN);
  }

  return fuchsia_actions;
}

std::vector<uint32_t> ConvertChildIds(std::vector<int32_t> ids,
                                      const ui::AXTreeID& tree_id,
                                      NodeIDMapper* id_mapper) {
  std::vector<uint32_t> child_ids;
  child_ids.reserve(ids.size());
  for (const auto& i : ids) {
    child_ids.push_back(id_mapper->ToFuchsiaNodeID(tree_id, i, false));
  }
  return child_ids;
}

fuchsia::ui::gfx::BoundingBox ConvertBoundingBox(gfx::RectF bounds) {
  fuchsia::ui::gfx::BoundingBox box;
  // Since the origin is at the top left, min should represent the top left and
  // max should be the bottom right.
  box.min = scenic::NewVector3({bounds.x(), bounds.y(), 0.0f});
  box.max = scenic::NewVector3({bounds.right(), bounds.bottom(), 0.0f});
  return box;
}

// The Semantics Manager applies this matrix to position the node and its
// subtree as an optimization to handle resizing or repositioning. This requires
// only one node to be updated on such an event.
fuchsia::ui::gfx::mat4 ConvertTransform(gfx::Transform* transform) {
  std::array<float, 16> mat = {};
  transform->matrix().getColMajor(mat.data());
  fuchsia::ui::gfx::Matrix4Value fuchsia_transform =
      scenic::NewMatrix4Value(mat);
  return fuchsia_transform.value;
}

}  // namespace

fuchsia::accessibility::semantics::Node AXNodeDataToSemanticNode(
    const ui::AXNode& ax_node,
    const ui::AXNode& container_node,
    const ui::AXTreeID& tree_id,
    bool is_root,
    float device_scale_factor,
    NodeIDMapper* id_mapper) {
  fuchsia::accessibility::semantics::Node fuchsia_node;
  fuchsia_node.set_node_id(
      id_mapper->ToFuchsiaNodeID(tree_id, ax_node.id(), is_root));
  const ui::AXNodeData& node = ax_node.data();
  fuchsia_node.set_role(AxRoleToFuchsiaSemanticRole(node.role));
  fuchsia_node.set_states(ConvertStates(node));
  fuchsia_node.set_attributes(ConvertAttributes(ax_node));
  fuchsia_node.set_actions(ConvertActions(node));
  fuchsia_node.set_child_ids(
      ConvertChildIds(node.child_ids, tree_id, id_mapper));
  fuchsia_node.set_location(ConvertBoundingBox(node.relative_bounds.bounds));
  fuchsia_node.set_container_id(
      id_mapper->ToFuchsiaNodeID(tree_id, container_node.data().id, false));

  // The transform field must be handled carefully to account for
  // the offsetting implied by the offset container's relative bounds.
  gfx::Transform transform;
  if (node.relative_bounds.transform) {
    transform = *node.relative_bounds.transform;
  }
  transform.PostTranslate(container_node.data().relative_bounds.bounds.x(),
                          container_node.data().relative_bounds.bounds.y());
  if (device_scale_factor > 0) {
    transform.PostScale(1 / device_scale_factor, 1 / device_scale_factor);
  }

  fuchsia_node.set_transform(ConvertTransform(&transform));

  return fuchsia_node;
}

bool ConvertAction(fuchsia::accessibility::semantics::Action fuchsia_action,
                   ax::mojom::Action* mojom_action) {
  switch (fuchsia_action) {
    case fuchsia::accessibility::semantics::Action::DEFAULT:
      *mojom_action = ax::mojom::Action::kDoDefault;
      return true;
    case fuchsia::accessibility::semantics::Action::DECREMENT:
      *mojom_action = ax::mojom::Action::kDecrement;
      return true;
    case fuchsia::accessibility::semantics::Action::INCREMENT:
      *mojom_action = ax::mojom::Action::kIncrement;
      return true;
    case fuchsia::accessibility::semantics::Action::SHOW_ON_SCREEN:
      *mojom_action = ax::mojom::Action::kScrollToMakeVisible;
      return true;
    case fuchsia::accessibility::semantics::Action::SECONDARY:
    case fuchsia::accessibility::semantics::Action::SET_FOCUS:
    case fuchsia::accessibility::semantics::Action::SET_VALUE:
      return false;
    default:
      LOG(WARNING)
          << "Unknown fuchsia::accessibility::semantics::Action with value "
          << static_cast<int>(fuchsia_action);
      return false;
  }
}

NodeIDMapper::NodeIDMapper()
    : root_(std::make_pair(ui::AXTreeIDUnknown(), 0)) {}

NodeIDMapper::~NodeIDMapper() = default;

uint32_t NodeIDMapper::ToFuchsiaNodeID(const ui::AXTreeID& ax_tree_id,
                                       int32_t ax_node_id,
                                       bool is_tree_root) {
  const bool should_change_root =
      is_tree_root && (root_.first != ax_tree_id || root_.second != ax_node_id);

  CHECK_LE(next_fuchsia_id_, UINT32_MAX);
  uint32_t fuchsia_node_id;
  if (should_change_root) {
    // The node that points to the root is changing. Update the old root to
    // receive an unique ID, and make the new root receive the default value.
    if (root_.first != ui::AXTreeIDUnknown())
      id_map_[root_.first][root_.second] = next_fuchsia_id_++;
    root_ = std::make_pair(ax_tree_id, ax_node_id);
    fuchsia_node_id = kFuchsiaRootNodeId;
  } else {
    auto it = id_map_.find(ax_tree_id);
    if (it != id_map_.end()) {
      auto node_id_it = it->second.find(ax_node_id);
      if (node_id_it != it->second.end())
        return node_id_it->second;
    }

    // The ID is not in the map yet, so give it a new value.
    fuchsia_node_id = next_fuchsia_id_++;
  }

  id_map_[ax_tree_id][ax_node_id] = fuchsia_node_id;
  return fuchsia_node_id;
}

absl::optional<std::pair<ui::AXTreeID, int32_t>> NodeIDMapper::ToAXNodeID(
    uint32_t fuchsia_node_id) {
  for (const auto& tree_id_to_node_ids : id_map_) {
    for (const auto& ax_id_to_fuchsia_id : tree_id_to_node_ids.second) {
      if (ax_id_to_fuchsia_id.second == fuchsia_node_id)
        return std::make_pair(tree_id_to_node_ids.first,
                              ax_id_to_fuchsia_id.first);
    }
  }

  return absl::nullopt;
}

bool NodeIDMapper::UpdateAXTreeIDForCachedNodeIDs(
    const ui::AXTreeID& old_ax_tree_id,
    const ui::AXTreeID& new_ax_tree_id) {
  if (old_ax_tree_id == new_ax_tree_id)
    return false;

  auto it = id_map_.find(old_ax_tree_id);
  if (it == id_map_.end())
    return false;

  // The iterator is not stable, so the order of operations here is important.
  auto data = std::move(it->second);
  id_map_.erase(it);
  id_map_[new_ax_tree_id] = std::move(data);
  return true;
}


text:
import { createStore, applyMiddleware, compose } from 'redux';
import thunk from 'redux-thunk';
import invariant from 'redux-immutable-state-invariant';
import logger from 'redux-logger';
import rootReducer from '../reducers/index.js';
import { syncHistory } from 'react-router-redux';
import { browserHistory } from 'react-router';

export default function configureStore(initialState) {
  // Sync dispatched route actions to the history
  const reduxRouterMiddleware = syncHistory(browserHistory);

  const finalCreateStore = compose(
    applyMiddleware(invariant(), thunk, reduxRouterMiddleware, logger()),
    window.devToolsExtension ? window.devToolsExtension() : f => f
  )(createStore);

  const store = finalCreateStore(rootReducer, initialState);

  if (module.hot) {
    // Enable Webpack hot module replacement for reducers
    module.hot.accept('../reducers', () => {
      const nextReducer = require('../reducers');
      store.replaceReducer(nextReducer);
    });
  }

  // Required for replaying actions from devtools to work
  reduxRouterMiddleware.listenForReplays(store);

  return store;
}


text:
using namespace std::chrono_literals;

Polly::Polly()
{
    _pollyCanTalk = false; ///< No talking while we instantiate
    _maxVA_length = MAX_VA_LENGTH; ///< set the maximum variadic argument length
    _pollyClient = Aws::MakeShared<Aws::Polly::PollyClient>(POLLY_MAIN_ALLOCATION_TAG); ///< create the AWS SDK client
    _manager = std::make_shared<Aws::TextToSpeech::TextToSpeechManager>(_pollyClient); ///< create TTS manager
    _manager->SetActiveVoice(_defaultPollyVoice.c_str()); ///< set the active voice

    // this is the worker thread - it blocks on _pollQueue until there is something to read

    std::shared_ptr<std::thread> pollyThread  = std::make_shared<std::thread>([=] {
        _threadManager.setThreadRunning(true);
        logger.log(LOG_INFO, " - Starting AWS Polly Service...");
        while (!_threadManager.threadCanceled()) {
            if (_pollyCanTalk) { ///< only do this if we are allowed to talk
                try {
                    auto item = _pollyQueue.pop(); ///< grab an item off the queue
                    using namespace std::placeholders;
                    _manager->SendTextToOutputDevice(item.c_str(), std::bind(&Polly::_handler, this, _1, _2, _3)); ///< send to AWS
                    _pollyCanTalk = false; ///< be quiet until the callback
                }
                catch (ConcurrentQueueInterrupted &except) {
                }
            }
        }
        _threadManager.setThreadRunning(false);
        logger.log(LOG_INFO, " - Terminated AWS Polly Service");
    });

    _threadManager.setManagedThread(pollyThread);

    _pollyCanTalk = true; ///< we can start talking because everything is ready to go
}

void Polly::shutdown(void)
{
    _pollyQueue.unblock();
    _threadManager.shutdownThread();

    // abort async operations
    _pollyClient->DisableRequestProcessing();

    // allow internall PollyClient threads to stop
    std::this_thread::sleep_for(1000ms);

    _pollyClient.reset();
}

void Polly::say(const char *pMsg, ...)
{

    va_list args; ///< variable arguement list (derived from  ...)
    char buffer[MAX_VA_LENGTH]; ///< buffer for formated output

    va_start(args, pMsg); ///< initializes args to retrieve the additional arguments after pMsg
    vsnprintf(buffer, _maxVA_length, pMsg, args); ///< variadic printf into buffer

    _pollyQueue.push(buffer); ///< enqueue the buffer to the API

    va_end(args); ///< finish with our variable arguement list
}

Polly::~Polly()
{
    _pollyCanTalk = false;
    logger.log(LOG_INFO, " - AWS Polly stopped");
}

void Polly::_handler(const char *device, const Aws::Polly::Model::SynthesizeSpeechOutcome &res, bool ret)
{
    _pollyCanTalk = true; ///< once the callback has completed we can talk again
}


text:
hotlibrary.directive('fileModel',function ($parse) {
  return {
    restrict: "A",
    link: function (scope, element, attrs) {

      element.bind('change', function(event){
        var files = event.target.files;
        $parse(attrs.fileModel).assign(scope,files);
        scope.$apply();
      });
    }
  };
})


text:
package org.liquidengine.legui.event;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.liquidengine.legui.component.Component;
import org.liquidengine.legui.component.Frame;
import org.liquidengine.legui.input.KeyAction;
import org.liquidengine.legui.input.KeyboardKey;
import org.liquidengine.legui.input.KeyMod;
import org.liquidengine.legui.system.context.Context;

import java.util.Arrays;
import java.util.Set;

/**
 * Created by ShchAlexander on 2/13/2017.
 */
public class KeyboardEvent<T extends Component> extends Event<T> {

    private final KeyAction action;
    private final KeyboardKey key;
    private final Set<KeyMod> mods;

    public KeyboardEvent(T component, Context context, Frame frame, KeyAction action, KeyboardKey key, Set<KeyMod> mods) {
        super(component, context, frame);
        this.action = action;
        this.key = key;
        this.mods = mods;
    }

    public KeyAction getAction() {
        return action;
    }

    public KeyboardKey getKey() {
        return key;
    }

    public Set<KeyMod> getMods() {
        return mods;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("targetComponent", getTargetComponent().getClass().getSimpleName())
                .append("action", action)
                .append("key", key)
                .append("mods", Arrays.toString(mods.toArray()))
                .toString();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;

        if (o == null || getClass() != o.getClass()) return false;

        KeyboardEvent<?> keyEvent = (KeyboardEvent<?>) o;

        return new EqualsBuilder()
                .appendSuper(super.equals(o))
                .append(action, keyEvent.action)
                .append(key, keyEvent.key)
                .append(mods, keyEvent.mods)
                .isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder(17, 37)
                .appendSuper(super.hashCode())
                .append(action)
                .append(key)
                .append(mods)
                .toHashCode();
    }
}


text:
{{CategoryInfosCtrl.category.name}}

        {{subCategory.name}}
        <input type="text" class="form-control input-sm small" ng-model="CategoryInfosCtrl.editedSubCategory.name" ng-show="CategoryInfosCtrl.editedSubCategory.id === subCategory.id"/>

        <input type="text"
               class="form-control input-sm small"
               ng-model="CategoryInfosCtrl.newSubCategory.name"/>

      Aucune sous-catégorie

  <button class="btn btn-sm" ng-show="!CategoryInfosCtrl.isCreating" ng-click="CategoryInfosCtrl.startCreating()">Nouveau</button>

  Période de référence
  <select id="duration"
          ng-model="CategoryInfosCtrl.duration"
          ng-change="CategoryInfosCtrl.updateChart()"
          ng-options="n for n in [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]">
  </select>
  <select id="period"
          ng-model="CategoryInfosCtrl.period"
          ng-change="CategoryInfosCtrl.updateChart()">
    <option value="month">Mois</option>
    <option value="year">Année</option>
  </select>

 CategoryInfosCtrl.today }"
        on-finish-render="ngRepeatFinished">
      {{operation.id}}
      {{operation.subCategory.name}}
      {{operation.bankNoteNum}}
      {{operation.operationDateHuman}}
      {{operation.thirdParty.name}}

        <span ng-class="{negative: operation.amount < 0}">{{operation.amount | currency}}


text:
<?php

namespace Modules\Entitizer\Common {

	trait User {

		# Common configuration

		protected static $table = TABLE_USERS;

		protected static $auto_increment = true, $nesting = false, $super = true;
	}
}


text:
import {PreactBaseElement} from '#preact/base-element';

import {BentoMegaMenu} from './component';
import {CSS as COMPONENT_CSS} from './component.jss';
import {BentoItem} from './component/BentoItem';

export class BaseElement extends PreactBaseElement {
  /** @override */
  init() {
    super.init();
    return {ItemWrapper: BentoItem};
  }
}

/** @override */
BaseElement['Component'] = BentoMegaMenu;

/** @override */
BaseElement['props'] = {
  'children': {
    selector: '*',
    single: false,
  },
};

/** @override */
BaseElement['usesShadowDom'] = true;

/** @override */
BaseElement['shadowCss'] = COMPONENT_CSS;


text:
// ==========================================================================
//                 SeqAn - The Library for Sequence Analysis
// ==========================================================================
// Copyright (c) 2006-2015, Knut Reinert, FU Berlin
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
//     * Redistributions of source code must retain the above copyright
//       notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above copyright
//       notice, this list of conditions and the following disclaimer in the
//       documentation and/or other materials provided with the distribution.
//     * Neither the name of Knut Reinert or the FU Berlin nor the names of
//       its contributors may be used to endorse or promote products derived
//       from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
// DAMAGE.
//
// ==========================================================================
// Author: David Weese <david.weese@fu-berlin.de>
// ==========================================================================

#ifndef SEQAN_INCLUDE_SEQAN_ALIGN_GAP_ANCHOR_H_
#define SEQAN_INCLUDE_SEQAN_ALIGN_GAP_ANCHOR_H_

namespace seqan {

// ============================================================================
// Forwards
// ============================================================================

// ============================================================================
// Tags, Classes, Enums
// ============================================================================

// TODO(holtgrew): Document?
// Sorting tags (just for lower_bound and upper_bound, positions are always sorted)

struct SortSeqPos_;
typedef Tag<SortSeqPos_> const SortSeqPos;

struct SortGapPos_;
typedef Tag<SortGapPos_> const SortGapPos;

// ----------------------------------------------------------------------------
// Specialization GapAnchor
// ----------------------------------------------------------------------------

// TODO(holtgrew): Make a class instead of a struct?

/*!
 * @class GapAnchor
 * @implements ComparableConcept
 * @headerfile <seqan/align.h>
 * @brief Stores the position of an alignment character in sequence-space and gap-space in @link AnchorGaps @endlink.
 *
 * @signature template <typename TPosition>
 *            struct GapAnchor;
 *
 * @tparam TPos Type to store gapped/ungapped positions.
 *
 * @section Remarks
 *
 * Used as value type for the <tt>gaps</tt> strings in @link ReadStoreElement @endlink and @link ContigStoreElement
 * @endlink.
 *
 * @see AnchorGaps
 */

// We store gap anchors only for the first text character behind a gap or a clipped sequence character

template <typename TPos>
struct GapAnchor
{
/*!
 * @var TPos GapAnchor::seqPos
 * @brief Sequence character position in the ungapped sequence.
 */
    TPos    seqPos;            // sequence character position in the ungapped sequence

/*!
 * @var TPos GapAnchor::gapPos
 * @brief Sequence character position in the gapped sequence.
 */
    TPos    gapPos;            // sequence character position in the gapped sequence

/*!
 * @fn GapAnchor::GapAnchor
 * @brief Constructor.
 *
 * @signature GapAnchor::GapAnchor([other]);
 * @signature GapAnchor::GapAnchor(seqPos, gapPos);
 *
 * @param[in] other  GapAnchor object to copy from.
 * @param[in] seqPos Sequence character position in the ungapped sequence (of type <tt>TPos</tt>).
 * @param[in] gapPos Sequence character position in the gapped sequence (of type <tt>TPos</tt>).
 *
 * @section Remarks
 *
 * The default constructor sets both positions to <tt>0</tt>.
 */

    GapAnchor() : seqPos(0), gapPos(0) {}
    GapAnchor(TPos sP, TPos gP) : seqPos(sP), gapPos(gP) {}

    template <typename TPos_>
    GapAnchor(GapAnchor<TPos_> const &other)
    {
        seqPos = other.seqPos;
        gapPos = other.gapPos;
    }

    template <typename TPos_>
    inline GapAnchor const &
    operator = (GapAnchor<TPos_> const &other)
    {
        seqPos = other.seqPos;
        gapPos = other.gapPos;
        return *this;
    }

    template <typename TOther>
    inline bool
    operator == (TOther const &other) const
    {
        return seqPos == other.seqPos && gapPos == other.gapPos;
    }

    template <typename TOther>
    inline bool
    operator != (TOther const &other) const
    {
        return !(*this == other);
    }

    template <typename TOther>
    inline bool
    operator < (TOther const &other) const
    {
        return seqPos < other.seqPos || gapPos < other.gapPos;
    }

    template <typename TOther>
    inline bool
    operator > (TOther const &other) const
    {
        return seqPos > other.seqPos || gapPos > other.gapPos;
    }

    template <typename TOther>
    inline bool
    operator <= (TOther const &other) const
    {
        return seqPos < other.seqPos || gapPos <= other.gapPos;
    }

    template <typename TOther>
    inline bool
    operator >= (TOther const &other) const
    {
        return seqPos > other.seqPos || gapPos >= other.gapPos;
    }
};

// ============================================================================
// Metafunctions
// ============================================================================

// ----------------------------------------------------------------------------
// Metafunction Size                                                [GapAnchor]
// ----------------------------------------------------------------------------

template <typename TPos>
struct Size<GapAnchor<TPos> >
{
    typedef TPos Type;
};

template <typename TPos>
struct Size<GapAnchor<TPos> const> : public Size<GapAnchor<TPos> >
{};

// ----------------------------------------------------------------------------
// Metafunction Position                                            [GapAnchor]
// ----------------------------------------------------------------------------

template <typename TPos>
struct Position<GapAnchor<TPos> >
{
    typedef TPos Type;
};

template <typename TPos>
struct Position<GapAnchor<TPos> const> : public Position<GapAnchor<TPos> >
{};

// ============================================================================
// Functions
// ============================================================================

// ----------------------------------------------------------------------------
// Functor _LessGapAnchor
// ----------------------------------------------------------------------------

// TODO(holtgrew): Leading underscore should become a trailing one.

template <typename TGapAnchor, typename TTag>
struct _LessGapAnchor;

template <typename TGapAnchor>
struct _LessGapAnchor<TGapAnchor, SortSeqPos> :
    public std::binary_function<TGapAnchor, TGapAnchor, bool>
{
    inline bool
    operator() (TGapAnchor const& a1, TGapAnchor const& a2) const {
        return (a1.seqPos) < (a2.seqPos);
    }
};

template <typename TGapAnchor>
struct _LessGapAnchor<TGapAnchor, SortGapPos> :
    public std::binary_function<TGapAnchor, TGapAnchor, bool>
{
    inline bool
    operator() (TGapAnchor const& a1, TGapAnchor const& a2) const {
        return (a1.gapPos) < (a2.gapPos);
    }
};

// ----------------------------------------------------------------------------
// Function lowerBoundGapAnchor()
// ----------------------------------------------------------------------------

template <typename TGapAnchor, typename TSearchValue>
inline typename Iterator<TGapAnchor const, Standard>::Type
lowerBoundGapAnchor(TGapAnchor const & gaps,
                    TSearchValue const val,
                    SortSeqPos)
{
    typedef typename Value<TGapAnchor>::Type TGapAnchorElement;
    TGapAnchorElement el;
    el.seqPos = val;
    return std::lower_bound(
        begin(gaps, Standard()),
        end(gaps, Standard()),
        el,
        _LessGapAnchor<typename Value<TGapAnchor>::Type, SortSeqPos const>() );
}

template <typename TGapAnchor, typename TSearchValue>
inline typename Iterator<TGapAnchor, Standard>::Type
lowerBoundGapAnchor(TGapAnchor & gaps,
                    TSearchValue const val,
                    SortSeqPos)
{
    typedef typename Value<TGapAnchor>::Type TGapAnchorElement;
    TGapAnchorElement el;
    el.seqPos = val;
    return std::lower_bound(
        begin(gaps, Standard()),
        end(gaps, Standard()),
        el,
        _LessGapAnchor<typename Value<TGapAnchor>::Type, SortSeqPos const>() );
}

template <typename TGapAnchor, typename TSearchValue>
inline typename Iterator<TGapAnchor const, Standard>::Type
lowerBoundGapAnchor(TGapAnchor const & gaps,
                    TSearchValue const val,
                    SortGapPos)
{
    typedef typename Value<TGapAnchor>::Type TGapAnchorElement;
    TGapAnchorElement el;
    el.gapPos = val;
    return std::lower_bound(
        begin(gaps, Standard()),
        end(gaps, Standard()),
        el,
        _LessGapAnchor<typename Value<TGapAnchor>::Type, SortGapPos const>() );
}

template <typename TGapAnchor, typename TSearchValue>
inline typename Iterator<TGapAnchor, Standard>::Type
lowerBoundGapAnchor(TGapAnchor & gaps,
                    TSearchValue const val,
                    SortGapPos)
{
    typedef typename Value<TGapAnchor>::Type TGapAnchorElement;
    TGapAnchorElement el;
    el.gapPos = val;
    return std::lower_bound(
        begin(gaps, Standard()),
        end(gaps, Standard()),
        el,
        _LessGapAnchor<typename Value<TGapAnchor>::Type, SortGapPos const>() );
}

// ----------------------------------------------------------------------------
// Function upperBoundGapAnchor()
// ----------------------------------------------------------------------------

template <typename TGapAnchors, typename TSearchValue>
inline typename Iterator<TGapAnchors const, Standard>::Type
upperBoundGapAnchor(TGapAnchors const & gaps,
                    TSearchValue const val,
                    SortSeqPos)
{
    typedef typename Value<TGapAnchors>::Type TGapAnchorElement;
    TGapAnchorElement el;
    el.seqPos = val;
    return std::upper_bound(
        begin(gaps, Standard()),
        end(gaps, Standard()),
        el,
        _LessGapAnchor<typename Value<TGapAnchors>::Type, SortSeqPos const>() );
}

template <typename TGapAnchors, typename TSearchValue>
inline typename Iterator<TGapAnchors, Standard>::Type
upperBoundGapAnchor(TGapAnchors & gaps,
                    TSearchValue const val,
                    SortSeqPos)
{
    typedef typename Value<TGapAnchors>::Type TGapAnchorElement;
    TGapAnchorElement el;
    el.seqPos = val;
    return std::upper_bound(
        begin(gaps, Standard()),
        end(gaps, Standard()),
        el,
        _LessGapAnchor<typename Value<TGapAnchors>::Type, SortSeqPos const>() );
}

template <typename TGapAnchors, typename TSearchValue>
inline typename Iterator<TGapAnchors const, Standard>::Type
upperBoundGapAnchor(TGapAnchors const & gaps,
                    TSearchValue const val,
                    SortGapPos)
{
    typedef typename Value<TGapAnchors>::Type TGapAnchorElement;
    TGapAnchorElement el;
    el.gapPos = val;
    return std::upper_bound(
        begin(gaps, Standard()),
        end(gaps, Standard()),
        el,
        _LessGapAnchor<typename Value<TGapAnchors>::Type, SortGapPos const>() );
}

template <typename TGapAnchors, typename TSearchValue>
inline typename Iterator<TGapAnchors, Standard>::Type
upperBoundGapAnchor(TGapAnchors & gaps,
                    TSearchValue const val,
                    SortGapPos)
{
    typedef typename Value<TGapAnchors>::Type TGapAnchorElement;
    TGapAnchorElement el;
    el.gapPos = val;
    return std::upper_bound(
        begin(gaps, Standard()),
        end(gaps, Standard()),
        el,
        _LessGapAnchor<typename Value<TGapAnchors>::Type, SortGapPos const>() );
}

}  // namespace seqan

#endif  // #ifndef SEQAN_INCLUDE_SEQAN_ALIGN_GAP_ANCHOR_H_