text:
module GoodData

  class Row < FasterCSV::Row
    def ==(other)
       len = length()
       return false if len != other.length
       result = true

       len.times do |i|
         result = false unless convert_field(field(i)) == convert_field(other.field(i))
       end
       result
    end

    private
    def convert_field(val)
      if val.is_a?(String) && val.match(/^[-+]?\d*\.?\d+(?:[eE][-+]?\d+)?$/)
        # Is it a Number?
        val = val.scan(/[-+]?\d*\.?\d+(?:[eE][-+]?\d+)?/).first
        val = val.include?('.') ? val.to_f.round : val.to_i
        return val
      elsif val.nil? || (val.respond_to?(:strip) && val.strip.empty?)
        #is ia a String
        return ''
      elsif val.respond_to? :round
        # No idea what that one does
        return val.round
      else
        return val
      end
    end
  end

  class DataResult

    attr_reader :data

    def initialize(data)
      @data = data
    end

    def print
      puts to_s
    end

    def to_s
      a = to_table.to_a
      a.transpose.unshift((1..a.length).to_a).each_with_index.map{|col, i|
        col.unshift(i.zero?? nil : i)   # inserts row labels #
        w = col.map{|cell| cell.to_s.length}.max   # w = "column width" #
        col.each_with_index.map{|cell, i|
          i.zero?? cell.to_s.center(w) : cell.to_s.ljust(w)}   # alligns the column #
      }.transpose.map{|row| "[#{row.join(' | ')}]"}.join("\n")
    end

    def to_table
      raise "Should be implemented in subclass"
    end

  end

  class EmptyResult < DataResult

    def initialize(data, options = {})
      super(data)
      @options = options
      assemble_table
    end

    def to_s
      "No Data"
    end

    def assemble_table
      @table = FasterCSV::Table.new([GoodData::Row.new([],[],false)])
    end

    def to_table
      @table
    end

    def without_column_headers
      @table
    end

    def == (otherDataResult)
      false
    end

    def diff(otherDataResult)
      ['empty']
    end
  end

  class SFDataResult < DataResult

    def initialize(data, options = {})
      super(data)
      @options = options
      assemble_table
    end

    def assemble_table
      sf_data = data[:queryResponse][:result][:records]
      sf_data = sf_data.is_a?(Hash) ? [sf_data] : sf_data
      if @options[:soql]
        # puts @options[:soql]
        fields = @options[:soql].strip.match(/SELECT (.*) FROM/i)[1]
        @headers = fields.strip.split(",").map do |item|
          item.strip.split(/\s/)
        end.map do |item|
          item.last.to_sym
        end
        # pp @headers
      elsif @options[:headers]
        @headers = @options[:headers]
      else
        @headers = sf_data.first.keys - [:type, :Id]
      end
      @table = FasterCSV::Table.new(sf_data.collect do |line|
        GoodData::Row.new([], @headers.map {|h| line[h] || ' '}, false)
      end)
    rescue
      fail "Unable to assemble the table. Either the data provided are empty or the SOQL is malformed."
    end

    def to_table
      @table
    end

    def == (otherDataResult)
      result = true
      len =  @table.length
      other_table = otherDataResult.to_table
      if len != other_table.length
        # puts "TABLES ARE OF DIFFERENT SIZES"
        return false
      end

      diff(otherDataResult).empty?() ? true : false

    end

    def diff(otherDataResult)
      other_table = otherDataResult.to_table
      differences = []

      @table.each do |row|
        differences << row unless other_table.detect {|r| r == row}
      end
      differences
    end

  end

  class ReportDataResult < DataResult

    attr_reader :row_headers, :column_headers, :table, :headers_height, :headers_width

    def initialize(data)
      super
      @row_headers      = []
      @column_headers   = []
      @table            = []

      @row_headers, @headers_width = tabularize_rows
      @column_headers, @headers_height = tabularize_columns

      assemble_table
    end

    def without_column_headers
      @table = table.transpose[headers_height, 1000000].transpose
      self
    end

    def each_line
      table.transpose.each {|line| yield line}
    end

    def to_table
      FasterCSV::Table.new(table.transpose.map {|line| GoodData::Row.new([], line.map {|item| item || ' '}, false)})
    end

    def == (otherDataResult)
      result = true
      csv_table = to_table
      len =  csv_table.length
      return false if len != otherDataResult.to_table.length

      result
    end

    def diff(otherDataResult)
      csv_table = to_table
      other_table = otherDataResult.to_table
      differences = []

      csv_table.each do |row|
        differences << row unless other_table.detect {|r| r == row}
      end
      differences
    end

    private
    def each_level(table, level, children, lookup)
      max_level = level + 1
      children.each do |kid|
        first = kid["first"]
        last = kid["last"]
        repetition = last - first + 1
        repetition.times do |i|
          table[first + i] ||= []
          if kid["type"] == 'total'
            table[first + i][level] = kid["id"]
          else
            table[first + i][level] = lookup[level][kid["id"].to_s]
          end
        end
        if (!kid["children"].empty?)
          new_level = each_level(table, level+1, kid["children"], lookup)
          max_level = [max_level, new_level].max
        end
      end
      max_level
    end

    def tabularize_rows
      rows    = data["xtab_data"]["rows"]
      kids = rows["tree"]["children"]

      if kids.empty? || (kids.size == 1 && kids.first['type'] == 'metric')
        headers, size = [[nil]], 0
      else
        headers = []
        size = each_level(headers, 0, rows["tree"]["children"], rows["lookups"])
      end
      return headers, size
    end

    def tabularize_columns
      columns = data["xtab_data"]["columns"]
      kids = columns["tree"]["children"]

      if kids.empty? || (kids.size == 1 && kids.first['type'] == 'metric')
        headers, size = [[nil]], 0
      else
        headers = []
        size = each_level(headers, 0, columns["tree"]["children"], columns["lookups"])
      end
      return headers, size
    end

    def assemble_table()
  #    puts "=== COLUMNS === #{column_headers.size}x#{headers_height}"
      (column_headers.size).times do |i|
        (headers_height).times do |j|
          table[headers_width + i] ||= []
  #        puts "[#{headers_width + i}][#{j}] #{column_headers[i][j]}"
          table[headers_width + i][j] = column_headers[i][j]
        end
      end

  #    puts "=== ROWS ==="
      (row_headers.size).times do |i|
        (headers_width).times do |j|
          table[j] ||= []
  #        puts "[#{j}][#{headers_height + i}] #{row_headers[i][j]}"
          table[j][headers_height + i] = row_headers[i][j]
        end
      end

      xtab_data = data["xtab_data"]["data"]
  #    puts "=== DATA === #{column_headers.size}x#{row_headers.size}"
      (column_headers.size).times do |i|
        (row_headers.size).times do |j|
          table[headers_width + i] ||= []
  #        puts "[#{headers_width + i}, #{headers_height + j}] [#{i}][#{j}]=#{xtab_data[j][i]}"
          table[headers_width + i][headers_height + j] = xtab_data[j][i]
        end
      end
    end
  end
end


text:
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)

if (NOT CMAKE_DSM_COMPILER)
  message(FATAL_ERROR "Need CMAKE_DSM_COMPILER set")
endif()

_cmake_find_compiler_path(DSM)
mark_as_advanced(CMAKE_DSM_COMPILER)

if (NOT CMAKE_DSM_COMPILER_ID)
  # Table of per-vendor compiler id flags with expected output.
  list(APPEND CMAKE_DSM_COMPILER_ID_VENDORS GNU )
  set(CMAKE_DSM_COMPILER_ID_VENDOR_FLAGS_GNU "--version")
  set(CMAKE_DSM_COMPILER_ID_VENDOR_REGEX_GNU "(GNU assembler)|(GCC)|(Free Software Foundation)")

  include(CMakeDetermineCompilerId)
  cmake_determine_compiler_id_vendor(DSM "")

endif()

if (NOT _CMAKE_TOOLCHAIN_LOCATION)
  get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_DSM_COMPILER}" PATH)
endif()

if (CMAKE_DSM_COMPILER_ID)
  if (CMAKE_DSM_COMPILER_VERSION)
    set(_version " ${CMAKE_DSM_COMPILER_VERSION}")
  else()
    set(_version "")
  endif()
  message(STATUS "The DSM compiler identification is ${CMAKE_DSM_COMPILER_ID}${_version}")
  unset(_version)
else()
  message(STATUS "The DSM compiler identification is unknown")
endif()

if (NOT _CMAKE_TOOLCHAIN_PREFIX)
  get_filename_component(COMPILER_BASENAME "${CMAKE_DSM_COMPILER}" NAME)
  if (COMPILER_BASENAME MATCHES "^(.+1)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
    set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
  endif()

endif()

set(_CMAKE_PROCESSING_LANGUAGE "DSM")
find_program(CMAKE_DSM_COMPILER_AR NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ar HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
find_program(CMAKE_DSM_COMPILER_RANLIB NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ranlib HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
find_program(CMAKE_DSM_COMPILER_STRIP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}strip HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
find_program(CMAKE_DSM_COMPILER_NM NAMES ${_CMAKE_TOOLCHAIN_PREFIX}nm HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
find_program(CMAKE_DSM_COMPILER_OBJDUMP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objdump HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
find_program(CMAKE_DSM_COMPILER_OBJCOPY NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objcopy HINTS ${_CMAKE_TOOLCHAIN_LOCATION})

unset(_CMAKE_PROCESSING_LANGUAGE)

set(CMAKE_DSM_COMPILER_ENV_VAR "DSM")

if (CMAKE_DSM_COMPILER)
  message(STATUS "Found DSM assembler: ${CMAKE_DSM_COMPILER}")
else()
  message(STATUS "Didn't find assembler")
endif()

foreach(_var
    COMPILER
    COMPILER_ID
    COMPILER_ARG1
    COMPILER_ENV_VAR
    COMPILER_AR
    COMPILER_RANLIB
    COMPILER_VERSION
    )
  set(_CMAKE_DSM_${_var} "${CMAKE_DSM_${_var}}")
endforeach()

configure_file("${CMAKE_CURRENT_LIST_DIR}/CMakeDSMCompiler.cmake.in"
    "${CMAKE_PLATFORM_INFO_DIR}/CMakeDSMCompiler.cmake" @ONLY)

foreach(_var
    COMPILER
    COMPILER_ID
    COMPILER_ARG1
    COMPILER_ENV_VAR
    COMPILER_AR
    COMPILER_VERSION
  )
  unset(_CMAKE_DSM_${_var})
endforeach()

redpajama_set_name: RedPajamaGithub


text:
<!-- Copyright (c) [2016] [Luan Thanh Thai] -->
<!-- See the file LICENSE.txt for copying permission -->

<resources>

    <!-- Base application theme. -->
    <style name="MaterialTheme" parent="MaterialTheme.Base" />

    <style name="MaterialTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
        <item name="colorPrimary">@color/LightBlue_500</item>
        <item name="colorPrimaryDark">@color/LightBlue_700</item>
        <item name="colorAccent">@color/IndigoAccent_200</item>
        <item name="android:textColorPrimary">@color/Black_opacity_87</item>
        <item name="android:textColorSecondary">@color/Black_opacity_54</item>
        <item name="android:textColorHint">@color/Black_opacity_38</item>
        <item name="android:divider">@color/Black_opacity_12</item>
    </style>

    <style name="Toolbar.TitleText" parent="TextAppearance.Widget.AppCompat.Toolbar.Title">
        <item name="android:textSize">18sp</item>
    </style>

    <style name="KeypadLayoutStyle" parent="MaterialTheme.Base">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">@dimen/button_height</item>
        <item name="android:textColor">@color/colorKeypadButtonText</item>
        <item name="android:background">?android:attr/selectableItemBackground</item>
        <item name="android:layout_margin">@dimen/keypad_button_margins</item>
        <item name="android:textSize">@dimen/keypad_button_text_size</item>
    </style>

    <style name="TimerButtons">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">@dimen/button_height</item>
        <item name="android:textSize">@dimen/timer_button_text_size</item>
        <item name="android:textColor">@color/White</item>
        <item name="android:layout_weight">1</item>
    </style>

    <style name="DigitalTimerView">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:textSize">@dimen/timer_view_text_size</item>
        <item name="android:textColor">@color/Black_opacity_87</item>
        <item name="android:clickable">true</item>
    </style>

    <style name="ListItemText">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:textSize">@dimen/list_item_text_size</item>
        <item name="android:textColor">@color/Black_opacity_87</item>
    </style>

    <style name="ListItemImageButton" parent="MaterialTheme.Base">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">@dimen/button_height</item>
        <item name="android:textColor">@color/colorKeypadButtonText</item>
        <item name="android:background">?android:attr/selectableItemBackground</item>
    </style>

    <style name="TimerDigitsSettings">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:padding">@dimen/text_view_padding</item>
        <item name="android:gravity">center</item>
        <item name="android:textSize">@dimen/text_view_size</item>
        <item name="android:color">@color/Black_opacity_38</item>
        <item name="android:text">@string/default_time</item>
        <item name="android:inputType">number</item>
        <item name="android:background">@android:color/transparent</item>
        <item name="android:focusable">false</item>
        <item name="android:clickable">true</item>
    </style>

</resources>


text:
namespace TestWin
{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.textBox1 = new System.Windows.Forms.TextBox();
            this.SuspendLayout();
            //
            // button1
            //
            this.button1.Location = new System.Drawing.Point(43, 52);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(144, 45);
            this.button1.TabIndex = 0;
            this.button1.Text = "button1";
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // textBox1
            //
            this.textBox1.Location = new System.Drawing.Point(43, 103);
            this.textBox1.Multiline = true;
            this.textBox1.Name = "textBox1";
            this.textBox1.Size = new System.Drawing.Size(237, 138);
            this.textBox1.TabIndex = 1;
            //
            // Form1
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(292, 266);
            this.Controls.Add(this.textBox1);
            this.Controls.Add(this.button1);
            this.Name = "Form1";
            this.Text = "Form1";
            this.Load += new System.EventHandler(this.Form1_Load);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.TextBox textBox1;
    }
}


text:
package cli

import (
	"context"
	"os"
	"os/exec"
	"syscall"

	"golang.org/x/sys/windows"

	"go.chromium.org/luci/common/logging"
)

// setSysProcAttr sets flags which ensure the process starts in its own
// process group so that we can send signal to.
func setSysProcAttr(c *exec.Cmd) {
	c.SysProcAttr = &syscall.SysProcAttr{
		CreationFlags: syscall.CREATE_NEW_PROCESS_GROUP,
	}
}

func terminate(ctx context.Context, p *os.Process) error {
	logging.Infof(ctx, "Sending CTRL_BREAK_EVENT to the subprocess")
	return windows.GenerateConsoleCtrlEvent(windows.CTRL_BREAK_EVENT, uint32(p.Pid))
}


text:
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
<!--

-->
  <id>lib-package</id>
  <formats>
    <format>tar.gz</format>
  </formats>
  <includeBaseDirectory>true</includeBaseDirectory>

  <fileSets>
    <fileSet>
      <!-- ZooKeeper C client lib and include files -->
      <directory>${project.basedir}/../zookeeper-client/zookeeper-client-c/target/c</directory>
      <outputDirectory>usr</outputDirectory>
      <includes>
        <include>include/**/*</include>
        <include>lib/*</include>
      </includes>
      <fileMode>${rw.file.permission}</fileMode>
      <directoryMode>${rwx.file.permission}</directoryMode>
    </fileSet>
    <fileSet>
      <!-- ZooKeeper C client binaries-->
      <directory>${project.basedir}/../zookeeper-client/zookeeper-client-c/target/c</directory>
      <outputDirectory>usr</outputDirectory>
      <includes>
        <include>bin/*</include>
      </includes>
      <fileMode>${rwx.file.permission}</fileMode>
      <directoryMode>${rwx.file.permission}</directoryMode>
    </fileSet>
    <fileSet>
      <!-- ZooKeeper license -->
      <directory>${project.basedir}/../zookeeper-client/zookeeper-client-c</directory>
      <includes>
        <include>LICENSE</include>
      </includes>
      <outputDirectory>.</outputDirectory>
      <fileMode>${rw.file.permission}</fileMode>
      <directoryMode>${rwx.file.permission}</directoryMode>
    </fileSet>

  </fileSets>

</assembly>


text:
#region Copyright

#endregion

using System;
using System.Collections.Generic;
using System.Windows.Controls;
using Dynamo.Controls;
using Dynamo.Models;
using Dynamo.Wpf;
using ProtoCore.AST.AssociativeAST;
using Wosad.Common.CalculationLogger;
using Wosad.Dynamo.Common;

using System.Xml;
using Dynamo.Nodes;
using Dynamo.Graph;
using Dynamo.Graph.Nodes;

namespace Wosad.Steel.AISC.Connection
{

    /// <summary>
    ///Bolt thread inclusion selection
    /// </summary>

    [NodeName("Bolt thread inclusion selection")]
    [NodeCategory("Wosad.Steel.AISC.Connection.Bolted")]
    [NodeDescription("Bolt thread inclusion selection")]
    [IsDesignScriptCompatible]
    public class BoltThreadInclusionSelection : UiNodeBase
    {

        public BoltThreadInclusionSelection()
        {

            //OutPortData.Add(new PortData("ReportEntry", "Calculation log entries (for reporting)"));
            OutPortData.Add(new PortData("BoltThreadCase", "Identifies whether threads are included or excluded from shear planes"));
            RegisterAllPorts();
            //PropertyChanged += NodePropertyChanged;
            SetDefaultParameters();

        }

        private void SetDefaultParameters()
        {
            ReportEntry = "";
            BoltThreadCase = "N";
        }

        /// <summary>
        ///     Gets the type of this class, to be used in base class for reflection
        /// </summary>
        protected override Type GetModelType()
        {
            return GetType();
        }

        #region properties

        #region InputProperties

	    #endregion

        #region OutputProperties

		#region BoltThreadCaseProperty

		/// <summary>
		/// BoltThreadCase property
		/// </summary>
		/// <value>Identifies whether threads are included or excluded from shear planes</value>
		public string _BoltThreadCase;

		public string BoltThreadCase
		{
		    get { return _BoltThreadCase; }
		    set
		    {
		        _BoltThreadCase = value;
		        RaisePropertyChanged("BoltThreadCase");
		        OnNodeModified(true);
		    }
		}
		#endregion

        #region ReportEntryProperty

        /// <summary>
        /// log property
        /// </summary>
        /// <value>Calculation entries that can be converted into a report.</value>

        public string reportEntry;

        public string ReportEntry
        {
            get { return reportEntry; }
            set
            {
                reportEntry = value;
                RaisePropertyChanged("ReportEntry");
                OnNodeModified(true);
            }
        }

        #endregion

        #endregion
        #endregion

        #region Serialization

        /// <summary>
        ///Saves property values to be retained when opening the node
        /// </summary>
        protected override void SerializeCore(XmlElement nodeElement, SaveContext context)
        {
            base.SerializeCore(nodeElement, context);
            nodeElement.SetAttribute("BoltThreadCase", BoltThreadCase);
        }

        /// <summary>
        ///Retrieved property values when opening the node
        /// </summary>
        protected override void DeserializeCore(XmlElement nodeElement, SaveContext context)
        {
            base.DeserializeCore(nodeElement, context);
            var attrib = nodeElement.Attributes["BoltThreadCase"];
            if (attrib == null)
                return;

            BoltThreadCase = attrib.Value;

        }

        #endregion

        /// <summary>
        ///Customization of WPF view in Dynamo UI
        /// </summary>
        public class BoltThreadInclusionSelectionViewCustomization : UiNodeBaseViewCustomization,
            INodeViewCustomization<BoltThreadInclusionSelection>
        {
            public void CustomizeView(BoltThreadInclusionSelection model, NodeView nodeView)
            {
                base.CustomizeView(model, nodeView);

                BoltThreadCaseView control = new BoltThreadCaseView();
                control.DataContext = model;

                nodeView.inputGrid.Children.Add(control);
                base.CustomizeView(model, nodeView);
            }

        }
    }
}


text:
import { autoBindMethodsForReact } from 'class-autobind-decorator';
import React, { PureComponent } from 'react';

import { AUTOBIND_CFG } from '../../../common/constants';
import { Workspace } from '../../../models/workspace';
import { Modal } from '../base/modal';
import { ModalBody } from '../base/modal-body';
import { ModalFooter } from '../base/modal-footer';
import { ModalHeader } from '../base/modal-header';
import { TagEditor } from '../templating/tag-editor';
import { VariableEditor } from '../templating/variable-editor';

interface Props {
  uniqueKey: string;
  workspace: Workspace;
}

interface State {
  defaultTemplate: string;
}

@autoBindMethodsForReact(AUTOBIND_CFG)
export class NunjucksModal extends PureComponent<Props, State> {
  state: State = {
    defaultTemplate: '',
  };

  _onDone: Function | null = null;
  _currentTemplate: string | null = null;
  modal: Modal | null = null;

  _setModalRef(n: Modal) {
    this.modal = n;
  }

  _handleTemplateChange(template: string | null) {
    this._currentTemplate = template;
  }

  _handleSubmit(e) {
    e.preventDefault();
    this.hide();
  }

  _handleModalHide() {
    if (this._onDone) {
      this._onDone(this._currentTemplate);

      this.setState({
        defaultTemplate: '',
      });
    }
  }

  show({ template, onDone }) {
    this._onDone = onDone;
    this._currentTemplate = template;
    this.setState({
      defaultTemplate: template,
    });
    this.modal?.show();
  }

  hide() {
    this.modal?.hide();
  }

  render() {
    const { uniqueKey, workspace } = this.props;
    const { defaultTemplate } = this.state;
    let editor: JSX.Element | null = null;
    let title = '';

    if (defaultTemplate.indexOf('{{') === 0) {
      title = 'Variable';
      editor = <VariableEditor onChange={this._handleTemplateChange} defaultValue={defaultTemplate} />;
    } else if (defaultTemplate.indexOf('{%') === 0) {
      title = 'Tag';
      editor = <TagEditor onChange={this._handleTemplateChange} defaultValue={defaultTemplate} workspace={workspace} />;
    }

    return (
      <Modal ref={this._setModalRef} onHide={this._handleModalHide} key={uniqueKey}>
        <ModalHeader>Edit {title}</ModalHeader>
        <ModalBody className="pad" key={defaultTemplate}>
          <form onSubmit={this._handleSubmit}>{editor}</form>
        </ModalBody>
        <ModalFooter>
          <button className="btn" onClick={this.hide}>
            Done
          </button>
        </ModalFooter>
      </Modal>
    );
  }
}


text:
import ReactVersion from 'shared/ReactVersion';
import {
  REACT_CONCURRENT_MODE_TYPE,
  REACT_FRAGMENT_TYPE,
  REACT_PROFILER_TYPE,
  REACT_STRICT_MODE_TYPE,
  REACT_SUSPENSE_TYPE,
} from 'shared/ReactSymbols';
import {enableHooks} from 'shared/ReactFeatureFlags';

import {Component, PureComponent} from './ReactBaseClasses';
import {createRef} from './ReactCreateRef';
import {forEach, map, count, toArray, only} from './ReactChildren';
import {
  createElement,
  createFactory,
  cloneElement,
  isValidElement,
} from './ReactElement';
import {createContext} from './ReactContext';
import {lazy} from './ReactLazy';
import forwardRef from './forwardRef';
import memo from './memo';
import {
  useCallback,
  useContext,
  useEffect,
  useImperativeMethods,
  useLayoutEffect,
  useMemo,
  useMutationEffect,
  useReducer,
  useRef,
  useState,
} from './ReactHooks';
import {
  createElementWithValidation,
  createFactoryWithValidation,
  cloneElementWithValidation,
} from './ReactElementValidator';
import ReactSharedInternals from './ReactSharedInternals';
import {enableStableConcurrentModeAPIs} from 'shared/ReactFeatureFlags';

const React = {
  Children: {
    map,
    forEach,
    count,
    toArray,
    only,
  },

  createRef,
  Component,
  PureComponent,

  createContext,
  forwardRef,
  lazy,
  memo,

  Fragment: REACT_FRAGMENT_TYPE,
  StrictMode: REACT_STRICT_MODE_TYPE,
  Suspense: REACT_SUSPENSE_TYPE,

  createElement: __DEV__ ? createElementWithValidation : createElement,
  cloneElement: __DEV__ ? cloneElementWithValidation : cloneElement,
  createFactory: __DEV__ ? createFactoryWithValidation : createFactory,
  isValidElement: isValidElement,

  version: ReactVersion,

  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactSharedInternals,
};

if (enableStableConcurrentModeAPIs) {
  React.ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
  React.Profiler = REACT_PROFILER_TYPE;
} else {
  React.unstable_ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
  React.unstable_Profiler = REACT_PROFILER_TYPE;
}

if (enableHooks) {
  React.useCallback = useCallback;
  React.useContext = useContext;
  React.useEffect = useEffect;
  React.useImperativeMethods = useImperativeMethods;
  React.useLayoutEffect = useLayoutEffect;
  React.useMemo = useMemo;
  React.useMutationEffect = useMutationEffect;
  React.useReducer = useReducer;
  React.useRef = useRef;
  React.useState = useState;
}

export default React;


text:
import {DOM} from 'angular2/src/core/dom/dom_adapter';
import {ListWrapper} from 'angular2/src/core/facade/collection';
import {
  StringWrapper,
  RegExp,
  RegExpWrapper,
  RegExpMatcherWrapper,
  isPresent,
  isBlank
} from 'angular2/src/core/facade/lang';

/**
 * This file is a port of shadowCSS from webcomponents.js to TypeScript.
 *
 * Please make sure to keep to edits in sync with the source file.
 *
 * Source:
 * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js
 *
 * The original file level comment is reproduced below
 */

/*
  This is a limited shim for ShadowDOM css styling.
  https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#styles

  The intention here is to support only the styling features which can be
  relatively simply implemented. The goal is to allow users to avoid the
  most obvious pitfalls and do so without compromising performance significantly.
  For ShadowDOM styling that's not covered here, a set of best practices
  can be provided that should allow users to accomplish more complex styling.

  The following is a list of specific ShadowDOM styling features and a brief
  discussion of the approach used to shim.

  Shimmed features:

  * :host, :host-context: ShadowDOM allows styling of the shadowRoot's host
  element using the :host rule. To shim this feature, the :host styles are
  reformatted and prefixed with a given scope name and promoted to a
  document level stylesheet.
  For example, given a scope name of .foo, a rule like this:

    :host {
        background: red;
      }
    }

  becomes:

    .foo {
      background: red;
    }

  * encapsultion: Styles defined within ShadowDOM, apply only to
  dom inside the ShadowDOM. Polymer uses one of two techniques to imlement
  this feature.

  By default, rules are prefixed with the host element tag name
  as a descendant selector. This ensures styling does not leak out of the 'top'
  of the element's ShadowDOM. For example,

  div {
      font-weight: bold;
    }

  becomes:

  x-foo div {
      font-weight: bold;
    }

  becomes:

  Alternatively, if WebComponents.ShadowCSS.strictStyling is set to true then
  selectors are scoped by adding an attribute selector suffix to each
  simple selector that contains the host element tag name. Each element
  in the element's ShadowDOM template is also given the scope attribute.
  Thus, these rules match only elements that have the scope attribute.
  For example, given a scope name of x-foo, a rule like this:

    div {
      font-weight: bold;
    }

  becomes:

    div[x-foo] {
      font-weight: bold;
    }

  Note that elements that are dynamically added to a scope must have the scope
  selector added to them manually.

  * upper/lower bound encapsulation: Styles which are defined outside a
  shadowRoot should not cross the ShadowDOM boundary and should not apply
  inside a shadowRoot.

  This styling behavior is not emulated. Some possible ways to do this that
  were rejected due to complexity and/or performance concerns include: (1) reset
  every possible property for every possible selector for a given scope name;
  (2) re-implement css in javascript.

  As an alternative, users should make sure to use selectors
  specific to the scope in which they are working.

  * ::distributed: This behavior is not emulated. It's often not necessary
  to style the contents of a specific insertion point and instead, descendants
  of the host element can be styled selectively. Users can also create an
  extra node around an insertion point and style that node's contents
  via descendent selectors. For example, with a shadowRoot like this:

    <style>
      ::content(div) {
        background: red;
      }
    </style>
    <content></content>

  could become:

    <style>
      / *@polyfill .content-container div * /
      ::content(div) {
        background: red;
      }
    </style>
    <div class="content-container">
      <content></content>
    </div>

  Note the use of @polyfill in the comment above a ShadowDOM specific style
  declaration. This is a directive to the styling shim to use the selector
  in comments in lieu of the next selector when running under polyfill.
*/

export class ShadowCss {
  strictStyling: boolean = true;

  constructor() {}

  /*
  * Shim a style element with the given selector. Returns cssText that can
  * be included in the document via WebComponents.ShadowCSS.addCssToDocument(css).
  */
  shimStyle(style: string, selector: string, hostSelector: string = ''): string {
    var cssText = DOM.getText(style);
    return this.shimCssText(cssText, selector, hostSelector);
  }

  /*
  * Shim some cssText with the given selector. Returns cssText that can
  * be included in the document via WebComponents.ShadowCSS.addCssToDocument(css).
  *
  * When strictStyling is true:
  * - selector is the attribute added to all elements inside the host,
  * - hostSelector is the attribute added to the host itself.
  */
  shimCssText(cssText: string, selector: string, hostSelector: string = ''): string {
    cssText = this._insertDirectives(cssText);
    return this._scopeCssText(cssText, selector, hostSelector);
  }

  _insertDirectives(cssText: string): string {
    cssText = this._insertPolyfillDirectivesInCssText(cssText);
    return this._insertPolyfillRulesInCssText(cssText);
  }

  /*
   * Process styles to convert native ShadowDOM rules that will trip
   * up the css parser; we rely on decorating the stylesheet with inert rules.
   *
   * For example, we convert this rule:
   *
   * polyfill-next-selector { content: ':host menu-item'; }
   * ::content menu-item {
   *
   * to this:
   *
   * scopeName menu-item {
   *
  **/
  _insertPolyfillDirectivesInCssText(cssText: string): string {
    // Difference with webcomponents.js: does not handle comments
    return StringWrapper.replaceAllMapped(cssText, _cssContentNextSelectorRe,
                                          function(m) { return m[1] + '{'; });
  }

  /*
   * Process styles to add rules which will only apply under the polyfill
   *
   * For example, we convert this rule:
   *
   * polyfill-rule {
   *   content: ':host menu-item';
   * ...
   * }
   *
   * to this:
   *
   * scopeName menu-item {...}
   *
  **/
  _insertPolyfillRulesInCssText(cssText: string): string {
    // Difference with webcomponents.js: does not handle comments
    return StringWrapper.replaceAllMapped(cssText, _cssContentRuleRe, function(m) {
      var rule = m[0];
      rule = StringWrapper.replace(rule, m[1], '');
      rule = StringWrapper.replace(rule, m[2], '');
      return m[3] + rule;
    });
  }

  /* Ensure styles are scoped. Pseudo-scoping takes a rule like:
   *
   *  .foo {... }
   *
   *  and converts this to
   *
   *  scopeName .foo { ... }
  */
  _scopeCssText(cssText: string, scopeSelector: string, hostSelector: string): string {
    var unscoped = this._extractUnscopedRulesFromCssText(cssText);
    cssText = this._insertPolyfillHostInCssText(cssText);
    cssText = this._convertColonHost(cssText);
    cssText = this._convertColonHostContext(cssText);
    cssText = this._convertShadowDOMSelectors(cssText);
    if (isPresent(scopeSelector)) {
      _withCssRules(cssText,
                    (rules) => { cssText = this._scopeRules(rules, scopeSelector, hostSelector); });
    }
    cssText = cssText + '\n' + unscoped;
    return cssText.trim();
  }

  /*
   * Process styles to add rules which will only apply under the polyfill
   * and do not process via CSSOM. (CSSOM is destructive to rules on rare
   * occasions, e.g. -webkit-calc on Safari.)
   * For example, we convert this rule:
   *
   * @polyfill-unscoped-rule {
   *   content: 'menu-item';
   * ... }
   *
   * to this:
   *
   * menu-item {...}
   *
  **/
  _extractUnscopedRulesFromCssText(cssText: string): string {
    // Difference with webcomponents.js: does not handle comments
    var r = '', m;
    var matcher = RegExpWrapper.matcher(_cssContentUnscopedRuleRe, cssText);
    while (isPresent(m = RegExpMatcherWrapper.next(matcher))) {
      var rule = m[0];
      rule = StringWrapper.replace(rule, m[2], '');
      rule = StringWrapper.replace(rule, m[1], m[3]);
      r += rule + '\n\n';
    }
    return r;
  }

  /*
   * convert a rule like :host(.foo) > .bar { }
   *
   * to
   *
   * scopeName.foo > .bar
  */
  _convertColonHost(cssText: string): string {
    return this._convertColonRule(cssText, _cssColonHostRe, this._colonHostPartReplacer);
  }

  /*
   * convert a rule like :host-context(.foo) > .bar { }
   *
   * to
   *
   * scopeName.foo > .bar, .foo scopeName > .bar { }
   *
   * and
   *
   * :host-context(.foo:host) .bar { ... }
   *
   * to
   *
   * scopeName.foo .bar { ... }
  */
  _convertColonHostContext(cssText: string): string {
    return this._convertColonRule(cssText, _cssColonHostContextRe,
                                  this._colonHostContextPartReplacer);
  }

  _convertColonRule(cssText: string, regExp: RegExp, partReplacer: Function): string {
    // p1 = :host, p2 = contents of (), p3 rest of rule
    return StringWrapper.replaceAllMapped(cssText, regExp, function(m) {
      if (isPresent(m[2])) {
        var parts = m[2].split(','), r = [];
        for (var i = 0; i < parts.length; i++) {
          var p = parts[i];
          if (isBlank(p)) break;
          p = p.trim();
          r.push(partReplacer(_polyfillHostNoCombinator, p, m[3]));
        }
        return r.join(',');
      } else {
        return _polyfillHostNoCombinator + m[3];
      }
    });
  }

  _colonHostContextPartReplacer(host: string, part: string, suffix: string): string {
    if (StringWrapper.contains(part, _polyfillHost)) {
      return this._colonHostPartReplacer(host, part, suffix);
    } else {
      return host + part + suffix + ', ' + part + ' ' + host + suffix;
    }
  }

  _colonHostPartReplacer(host: string, part: string, suffix: string): string {
    return host + StringWrapper.replace(part, _polyfillHost, '') + suffix;
  }

  /*
   * Convert combinators like ::shadow and pseudo-elements like ::content
   * by replacing with space.
  */
  _convertShadowDOMSelectors(cssText: string): string {
    for (var i = 0; i < _shadowDOMSelectorsRe.length; i++) {
      cssText = StringWrapper.replaceAll(cssText, _shadowDOMSelectorsRe[i], ' ');
    }
    return cssText;
  }

  // change a selector like 'div' to 'name div'
  _scopeRules(cssRules, scopeSelector: string, hostSelector: string): string {
    var cssText = '';
    if (isPresent(cssRules)) {
      for (var i = 0; i < cssRules.length; i++) {
        var rule = cssRules[i];
        if (DOM.isStyleRule(rule) || DOM.isPageRule(rule)) {
          cssText += this._scopeSelector(rule.selectorText, scopeSelector, hostSelector,
                                         this.strictStyling) +
                     ' {\n';
          cssText += this._propertiesFromRule(rule) + '\n}\n\n';
        } else if (DOM.isMediaRule(rule)) {
          cssText += '@media ' + rule.media.mediaText + ' {\n';
          cssText += this._scopeRules(rule.cssRules, scopeSelector, hostSelector);
          cssText += '\n}\n\n';
        } else {
          // KEYFRAMES_RULE in IE throws when we query cssText
          // when it contains a -webkit- property.
          // if this happens, we fallback to constructing the rule
          // from the CSSRuleSet
          // https://connect.microsoft.com/IE/feedbackdetail/view/955703/accessing-csstext-of-a-keyframe-rule-that-contains-a-webkit-property-via-cssom-generates-exception
          try {
            if (isPresent(rule.cssText)) {
              cssText += rule.cssText + '\n\n';
            }
          } catch (x) {
            if (DOM.isKeyframesRule(rule) && isPresent(rule.cssRules)) {
              cssText += this._ieSafeCssTextFromKeyFrameRule(rule);
            }
          }
        }
      }
    }
    return cssText;
  }

  _ieSafeCssTextFromKeyFrameRule(rule): string {
    var cssText = '@keyframes ' + rule.name + ' {';
    for (var i = 0; i < rule.cssRules.length; i++) {
      var r = rule.cssRules[i];
      cssText += ' ' + r.keyText + ' {' + r.style.cssText + '}';
    }
    cssText += ' }';
    return cssText;
  }

  _scopeSelector(selector: string, scopeSelector: string, hostSelector: string,
                 strict: boolean): string {
    var r = [], parts = selector.split(',');
    for (var i = 0; i < parts.length; i++) {
      var p = parts[i];
      p = p.trim();
      if (this._selectorNeedsScoping(p, scopeSelector)) {
        p = strict && !StringWrapper.contains(p, _polyfillHostNoCombinator) ?
                this._applyStrictSelectorScope(p, scopeSelector) :
                this._applySelectorScope(p, scopeSelector, hostSelector);
      }
      r.push(p);
    }
    return r.join(', ');
  }

  _selectorNeedsScoping(selector: string, scopeSelector: string): boolean {
    var re = this._makeScopeMatcher(scopeSelector);
    return !isPresent(RegExpWrapper.firstMatch(re, selector));
  }

  _makeScopeMatcher(scopeSelector: string): RegExp {
    var lre = /\[/g;
    var rre = /\]/g;
    scopeSelector = StringWrapper.replaceAll(scopeSelector, lre, '\\[');
    scopeSelector = StringWrapper.replaceAll(scopeSelector, rre, '\\]');
    return RegExpWrapper.create('^(' + scopeSelector + ')' + _selectorReSuffix, 'm');
  }

  _applySelectorScope(selector: string, scopeSelector: string, hostSelector: string): string {
    // Difference from webcomponentsjs: scopeSelector could not be an array
    return this._applySimpleSelectorScope(selector, scopeSelector, hostSelector);
  }

  // scope via name and [is=name]
  _applySimpleSelectorScope(selector: string, scopeSelector: string, hostSelector: string): string {
    if (isPresent(RegExpWrapper.firstMatch(_polyfillHostRe, selector))) {
      var replaceBy = this.strictStyling ? `[${hostSelector}]` : scopeSelector;
      selector = StringWrapper.replace(selector, _polyfillHostNoCombinator, replaceBy);
      return StringWrapper.replaceAll(selector, _polyfillHostRe, replaceBy + ' ');
    } else {
      return scopeSelector + ' ' + selector;
    }
  }

  // return a selector with [name] suffix on each simple selector
  // e.g. .foo.bar > .zot becomes .foo[name].bar[name] > .zot[name]
  _applyStrictSelectorScope(selector: string, scopeSelector: string): string {
    var isRe = /\[is=([^\]]*)\]/g;
    scopeSelector = StringWrapper.replaceAllMapped(scopeSelector, isRe, (m) => m[1]);
    var splits = [' ', '>', '+', '~'], scoped = selector, attrName = '[' + scopeSelector + ']';
    for (var i = 0; i < splits.length; i++) {
      var sep = splits[i];
      var parts = scoped.split(sep);
      scoped = ListWrapper.map(parts, function(p) {
                            // remove :host since it should be unnecessary
                            var t = StringWrapper.replaceAll(p.trim(), _polyfillHostRe, '');
                            if (t.length > 0 && !ListWrapper.contains(splits, t) &&
                                !StringWrapper.contains(t, attrName)) {
                              var re = /([^:]*)(:*)(.*)/g;
                              var m = RegExpWrapper.firstMatch(re, t);
                              if (isPresent(m)) {
                                p = m[1] + attrName + m[2] + m[3];
                              }
                            }
                            return p;
                          }).join(sep);
    }
    return scoped;
  }

  _insertPolyfillHostInCssText(selector: string): string {
    selector = StringWrapper.replaceAll(selector, _colonHostContextRe, _polyfillHostContext);
    selector = StringWrapper.replaceAll(selector, _colonHostRe, _polyfillHost);
    return selector;
  }

  _propertiesFromRule(rule): string {
    var cssText = rule.style.cssText;
    // TODO(sorvell): Safari cssom incorrectly removes quotes from the content
    // property. (https://bugs.webkit.org/show_bug.cgi?id=118045)
    // don't replace attr rules
    var attrRe = /['"]+|attr/g;
    if (rule.style.content.length > 0 &&
        !isPresent(RegExpWrapper.firstMatch(attrRe, rule.style.content))) {
      var contentRe = /content:[^;]*;/g;
      cssText =
          StringWrapper.replaceAll(cssText, contentRe, 'content: \'' + rule.style.content + '\';');
    }
    // TODO(sorvell): we can workaround this issue here, but we need a list
    // of troublesome properties to fix https://github.com/Polymer/platform/issues/53
    //
    // inherit rules can be omitted from cssText
    // TODO(sorvell): remove when Blink bug is fixed:
    // https://code.google.com/p/chromium/issues/detail?id=358273
    // var style = rule.style;
    // for (var i = 0; i < style.length; i++) {
    //  var name = style.item(i);
    //  var value = style.getPropertyValue(name);
    //  if (value == 'initial') {
    //    cssText += name + ': initial; ';
    //  }
    //}
    return cssText;
  }
}
var _cssContentNextSelectorRe =
    /polyfill-next-selector[^}]*content:[\s]*?['"](.*?)['"][;\s]*}([^{]*?){/gim;
var _cssContentRuleRe = /(polyfill-rule)[^}]*(content:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim;
var _cssContentUnscopedRuleRe =
    /(polyfill-unscoped-rule)[^}]*(content:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim;
var _polyfillHost = '-shadowcsshost';
// note: :host-context pre-processed to -shadowcsshostcontext.
var _polyfillHostContext = '-shadowcsscontext';
var _parenSuffix = ')(?:\\((' +
                   '(?:\\([^)(]*\\)|[^)(]*)+?' +
                   ')\\))?([^,{]*)';
var _cssColonHostRe = RegExpWrapper.create('(' + _polyfillHost + _parenSuffix, 'im');
var _cssColonHostContextRe = RegExpWrapper.create('(' + _polyfillHostContext + _parenSuffix, 'im');
var _polyfillHostNoCombinator = _polyfillHost + '-no-combinator';
var _shadowDOMSelectorsRe = [
  />>>/g,
  /::shadow/g,
  /::content/g,
  // Deprecated selectors
  // TODO(vicb): see https://github.com/angular/clang-format/issues/16
  // clang-format off
  /\/deep\//g,         // former >>>
  /\/shadow-deep\//g,  // former /deep/
  /\/shadow\//g,       // former ::shadow
  // clanf-format on
];
var _selectorReSuffix = '([>\\s~+\[.,{:][\\s\\S]*)?$';
var _polyfillHostRe = RegExpWrapper.create(_polyfillHost, 'im');
var _colonHostRe = /:host/gim;
var _colonHostContextRe = /:host-context/gim;

function _cssToRules(cssText: string) {
  return DOM.cssToRules(cssText);
}

function _withCssRules(cssText: string, callback: Function) {
  // Difference from webcomponentjs: remove the workaround for an old bug in Chrome
  if (isBlank(callback)) return;
  var rules = _cssToRules(cssText);
  callback(rules);
}


text:
package eu.eumssi.uima.reader;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;
import java.util.logging.Logger;

import org.apache.uima.cas.CAS;
import org.apache.uima.cas.CASException;
import org.apache.uima.collection.CollectionException;
import org.apache.uima.fit.descriptor.ConfigurationParameter;
import org.apache.uima.fit.factory.CollectionReaderFactory;
import org.apache.uima.jcas.JCas;
import org.apache.uima.resource.ResourceInitializationException;
import org.xml.sax.SAXException;

import com.mongodb.DBObject;

import eu.eumssi.uima.reader.util.EumssiMetaLoader;
import eu.eumssi.uima.ts.AsrFiller;
import eu.eumssi.uima.ts.AsrToken;
import eu.eumssi.uima.ts.AsrWord;
import eu.eumssi.uima.ts.Segment;
import eu.eumssi.uima.ts.SourceMeta;

public class AsrReader extends MongoReaderBase {

	private static final Logger logger = Logger.getLogger(AsrReader.class.toString());

	// additional parameters

	/**
	 * only mark word tokens (no fillers, etc.)
	 */
	public static final String PARAM_ONLYWORDS = "OnlyWords";
	@ConfigurationParameter(name=PARAM_ONLYWORDS, mandatory=false, defaultValue="false",
			description="only mark word tokens (no fillers, etc.)")
	private Boolean onlyWords = false;

	/* (non-Javadoc)
	 * @see org.apache.uima.collection.CollectionReader#getNext(org.apache.uima.cas.CAS)
	 */
	public void getNext(CAS aCAS) throws IOException, CollectionException {
		JCas jcas;
		try{
			jcas = aCAS.getJCas();
		}
		catch(CASException e){
			throw new CollectionException(e);
		}
		DBObject doc = this.resCursor.next();
		String documentId = doc.get("id").toString(); // hopefully correct conversion to string
		logger.fine(documentId);

		// create document text from all available text fields
		StringBuilder documentText = new StringBuilder();
		Integer segmentIndex = 0;
		Integer tokenIndex = 0;
		for (String f: this.fieldsList) { // just one field normally
			try {
				segmentIndex = documentText.length(); // TODO: check for off-by-one
				if (segmentIndex > 0) {
					// separate segments with newlines
					documentText.append("\n\n\n");
					segmentIndex += 3;
					tokenIndex += 3;
				}
				List<DBObject> tokenList = (List<DBObject>) ((DBObject) doc.get(f.replaceAll("\\.", SEPARATOR))).get("content");
				for (DBObject token : tokenList) {
					tokenIndex = documentText.length();
					String tokenText = token.get("item").toString(); // should be a String field anyway
					int beginTime = (int) Double.parseDouble(token.get("start").toString())*1000;
					int endTime = (int) Double.parseDouble(token.get("end").toString())*1000;
					double conf = Double.parseDouble(token.get("conf").toString());
					String type = token.get("type").toString();
					if (tokenIndex > 0) {
						documentText.append(" ");
						tokenIndex++;
					}
					documentText.append(tokenText);
					AsrToken tokenAnno;
					if (type.equals("word")) {
						tokenAnno = new AsrWord(jcas);
					} else if (onlyWords) { // don't mark fillers or others
						continue;
					} else if (type.equals("filler")) {
						tokenAnno = new AsrFiller(jcas);
					} else {
						tokenAnno = new AsrToken(jcas);
						logger.info(String.format("unknown token type %s in document %s", type, documentId));
					}
					tokenAnno.setBegin(tokenIndex);
					tokenAnno.setEnd(documentText.length());
					tokenAnno.setBeginTime(beginTime);
					tokenAnno.setEndTime(endTime);
					tokenAnno.setConfidence(conf);
					tokenAnno.setTokenType(type);
					tokenAnno.addToIndexes();
				}
				// create segment annotation
				Segment segAnno = new Segment(jcas);
				segAnno.setBegin(segmentIndex);
				segAnno.setEnd(documentText.length());
				segAnno.setSourceField(f);
				try {
					segAnno.setName(f.split("\\.")[-1]);
				} catch (Exception e) {
					segAnno.setName(f);
				}
				segAnno.addToIndexes();
			} catch (NullPointerException e) {
				// just leave text empty if document doesn't have one
			}
		}
		jcas.setDocumentText(documentText.toString());
		// create metadata annotation
		SourceMeta metadata = EumssiMetaLoader.getMeta(jcas, doc);
		metadata.addToIndexes();

		this.completed++;

	}

	/**
	 * return example descriptor (XML) when calling main method
	 * @param args not used
	 * @throws ResourceInitializationException
	 * @throws FileNotFoundException
	 * @throws SAXException
	 * @throws IOException
	 */
	public static void main(String[] args) throws ResourceInitializationException, FileNotFoundException, SAXException, IOException {
		CollectionReaderFactory.createReaderDescription(AsrReader.class).toXML(System.out);
	}

}


text:
require 'spec_helper'

describe Datagrid::Filters::CompositeFilters do

  describe ".date_range_filters" do

    it "should generate from date and to date filters" do
      e1 = Entry.create!(:shipping_date => 6.days.ago)
      e2 = Entry.create!(:shipping_date => 4.days.ago)
      e3 = Entry.create!(:shipping_date => 1.days.ago)
      assets = test_report(:from_shipping_date => 5.days.ago, :to_shipping_date => 2.day.ago) do
        scope {Entry}
        date_range_filters(:shipping_date)
      end.assets

      expect(assets).to include(e2)
      expect(assets).not_to include(e1, e3)
    end

    it "should support options" do
      report = test_report do
        report = date_range_filters(:shipping_date, {:default => 10.days.ago.to_date}, {:default => Date.today})
      end
      expect(report.from_shipping_date).to eq(10.days.ago.to_date)
      expect(report.to_shipping_date).to eq(Date.today)
    end
    it "should support table name in field" do
      report = test_report do
        report = date_range_filters("entries.shipping_date", {:default => 10.days.ago.to_date}, {:default => Date.today})
      end
      expect(report.from_entries_shipping_date).to eq(10.days.ago.to_date)
      expect(report.to_entries_shipping_date).to eq(Date.today)
    end
  end

  describe ".integer_range_filters" do

    it "should generate from integer and to integer filters" do
      e1 = Entry.create!(:group_id => 1)
      e2 = Entry.create!(:group_id => 3)
      e3 = Entry.create!(:group_id => 5)
      assets = test_report(:from_group_id => 2, :to_group_id => 4) do
        scope {Entry}
        integer_range_filters(:group_id)
      end.assets

      expect(assets).to include(e2)
      expect(assets).not_to include(e1, e3)
    end
    it "should support options" do
      report = test_report do
        report = integer_range_filters(:group_id, {:default => 0}, {:default => 100})
      end
      expect(report.from_group_id).to eq(0)
      expect(report.to_group_id).to eq(100)
    end
    it "should table name in field name" do
      report = test_report do
        report = integer_range_filters("entries.group_id", {:default => 0}, {:default => 100})
      end
      expect(report.from_entries_group_id).to eq(0)
      expect(report.to_entries_group_id).to eq(100)
    end
  end
end


text:
**Do you remember:**

Hit `Ctrl-Enter` to run your code!


text:
var CodeMirror = module.exports = require("code-mirror");
CodeMirror.defineMode("ruby", function(config) {
  function wordObj(words) {
    var o = {};
    for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true;
    return o;
  }
  var keywords = wordObj([
    "alias", "and", "BEGIN", "begin", "break", "case", "class", "def", "defined?", "do", "else",
    "elsif", "END", "end", "ensure", "false", "for", "if", "in", "module", "next", "not", "or",
    "redo", "rescue", "retry", "return", "self", "super", "then", "true", "undef", "unless",
    "until", "when", "while", "yield", "nil", "raise", "throw", "catch", "fail", "loop", "callcc",
    "caller", "lambda", "proc", "public", "protected", "private", "require", "load",
    "require_relative", "extend", "autoload", "__END__", "__FILE__", "__LINE__", "__dir__"
  ]);
  var indentWords = wordObj(["def", "class", "case", "for", "while", "module", "then",
                             "catch", "loop", "proc", "begin"]);
  var dedentWords = wordObj(["end", "until"]);
  var matching = {"[": "]", "{": "}", "(": ")"};
  var curPunc;

  function chain(newtok, stream, state) {
    state.tokenize.push(newtok);
    return newtok(stream, state);
  }

  function tokenBase(stream, state) {
    curPunc = null;
    if (stream.sol() && stream.match("=begin") && stream.eol()) {
      state.tokenize.push(readBlockComment);
      return "comment";
    }
    if (stream.eatSpace()) return null;
    var ch = stream.next(), m;
    if (ch == "`" || ch == "'" || ch == '"') {
      return chain(readQuoted(ch, "string", ch == '"' || ch == "`"), stream, state);
    } else if (ch == "/" && !stream.eol() && stream.peek() != " ") {
      if (stream.eat("=")) return "operator";
      return chain(readQuoted(ch, "string-2", true), stream, state);
    } else if (ch == "%") {
      var style = "string", embed = true;
      if (stream.eat("s")) style = "atom";
      else if (stream.eat(/[WQ]/)) style = "string";
      else if (stream.eat(/[r]/)) style = "string-2";
      else if (stream.eat(/[wxq]/)) { style = "string"; embed = false; }
      var delim = stream.eat(/[^\w\s]/);
      if (!delim) return "operator";
      if (matching.propertyIsEnumerable(delim)) delim = matching[delim];
      return chain(readQuoted(delim, style, embed, true), stream, state);
    } else if (ch == "#") {
      stream.skipToEnd();
      return "comment";
    } else if (ch == "<" && (m = stream.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/))) {
      return chain(readHereDoc(m[1]), stream, state);
    } else if (ch == "0") {
      if (stream.eat("x")) stream.eatWhile(/[\da-fA-F]/);
      else if (stream.eat("b")) stream.eatWhile(/[01]/);
      else stream.eatWhile(/[0-7]/);
      return "number";
    } else if (/\d/.test(ch)) {
      stream.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/);
      return "number";
    } else if (ch == "?") {
      while (stream.match(/^\\[CM]-/)) {}
      if (stream.eat("\\")) stream.eatWhile(/\w/);
      else stream.next();
      return "string";
    } else if (ch == ":") {
      if (stream.eat("'")) return chain(readQuoted("'", "atom", false), stream, state);
      if (stream.eat('"')) return chain(readQuoted('"', "atom", true), stream, state);

      // :> :>> :< :<< are valid symbols
      if (stream.eat(/[\<\>]/)) {
        stream.eat(/[\<\>]/);
        return "atom";
      }

      // :+ :- :/ :* :| :& :! are valid symbols
      if (stream.eat(/[\+\-\*\/\&\|\:\!]/)) {
        return "atom";
      }

      // Symbols can't start by a digit
      if (stream.eat(/[a-zA-Z$@_]/)) {
        stream.eatWhile(/[\w]/);
        // Only one ? ! = is allowed and only as the last character
        stream.eat(/[\?\!\=]/);
        return "atom";
      }
      return "operator";
    } else if (ch == "@" && stream.match(/^@?[a-zA-Z_]/)) {
      stream.eat("@");
      stream.eatWhile(/[\w]/);
      return "variable-2";
    } else if (ch == "$") {
      if (stream.eat(/[a-zA-Z_]/)) {
        stream.eatWhile(/[\w]/);
      } else if (stream.eat(/\d/)) {
        stream.eat(/\d/);
      } else {
        stream.next(); // Must be a special global like $: or $!
      }
      return "variable-3";
    } else if (/[a-zA-Z_]/.test(ch)) {
      stream.eatWhile(/[\w]/);
      stream.eat(/[\?\!]/);
      if (stream.eat(":")) return "atom";
      return "ident";
    } else if (ch == "|" && (state.varList || state.lastTok == "{" || state.lastTok == "do")) {
      curPunc = "|";
      return null;
    } else if (/[\(\)\[\]{}\\;]/.test(ch)) {
      curPunc = ch;
      return null;
    } else if (ch == "-" && stream.eat(">")) {
      return "arrow";
    } else if (/[=+\-\/*:\.^%<>~|]/.test(ch)) {
      stream.eatWhile(/[=+\-\/*:\.^%<>~|]/);
      return "operator";
    } else {
      return null;
    }
  }

  function tokenBaseUntilBrace() {
    var depth = 1;
    return function(stream, state) {
      if (stream.peek() == "}") {
        depth--;
        if (depth == 0) {
          state.tokenize.pop();
          return state.tokenize[state.tokenize.length-1](stream, state);
        }
      } else if (stream.peek() == "{") {
        depth++;
      }
      return tokenBase(stream, state);
    };
  }
  function tokenBaseOnce() {
    var alreadyCalled = false;
    return function(stream, state) {
      if (alreadyCalled) {
        state.tokenize.pop();
        return state.tokenize[state.tokenize.length-1](stream, state);
      }
      alreadyCalled = true;
      return tokenBase(stream, state);
    };
  }
  function readQuoted(quote, style, embed, unescaped) {
    return function(stream, state) {
      var escaped = false, ch;

      if (state.context.type === 'read-quoted-paused') {
        state.context = state.context.prev;
        stream.eat("}");
      }

      while ((ch = stream.next()) != null) {
        if (ch == quote && (unescaped || !escaped)) {
          state.tokenize.pop();
          break;
        }
        if (embed && ch == "#" && !escaped) {
          if (stream.eat("{")) {
            if (quote == "}") {
              state.context = {prev: state.context, type: 'read-quoted-paused'};
            }
            state.tokenize.push(tokenBaseUntilBrace());
            break;
          } else if (/[@\$]/.test(stream.peek())) {
            state.tokenize.push(tokenBaseOnce());
            break;
          }
        }
        escaped = !escaped && ch == "\\";
      }
      return style;
    };
  }
  function readHereDoc(phrase) {
    return function(stream, state) {
      if (stream.match(phrase)) state.tokenize.pop();
      else stream.skipToEnd();
      return "string";
    };
  }
  function readBlockComment(stream, state) {
    if (stream.sol() && stream.match("=end") && stream.eol())
      state.tokenize.pop();
    stream.skipToEnd();
    return "comment";
  }

  return {
    startState: function() {
      return {tokenize: [tokenBase],
              indented: 0,
              context: {type: "top", indented: -config.indentUnit},
              continuedLine: false,
              lastTok: null,
              varList: false};
    },

    token: function(stream, state) {
      if (stream.sol()) state.indented = stream.indentation();
      var style = state.tokenize[state.tokenize.length-1](stream, state), kwtype;
      if (style == "ident") {
        var word = stream.current();
        style = keywords.propertyIsEnumerable(stream.current()) ? "keyword"
          : /^[A-Z]/.test(word) ? "tag"
          : (state.lastTok == "def" || state.lastTok == "class" || state.varList) ? "def"
          : "variable";
        if (indentWords.propertyIsEnumerable(word)) kwtype = "indent";
        else if (dedentWords.propertyIsEnumerable(word)) kwtype = "dedent";
        else if ((word == "if" || word == "unless") && stream.column() == stream.indentation())
          kwtype = "indent";
        else if (word == "do" && state.context.indented < state.indented)
          kwtype = "indent";
      }
      if (curPunc || (style && style != "comment")) state.lastTok = word || curPunc || style;
      if (curPunc == "|") state.varList = !state.varList;

      if (kwtype == "indent" || /[\(\[\{]/.test(curPunc))
        state.context = {prev: state.context, type: curPunc || style, indented: state.indented};
      else if ((kwtype == "dedent" || /[\)\]\}]/.test(curPunc)) && state.context.prev)
        state.context = state.context.prev;

      if (stream.eol())
        state.continuedLine = (curPunc == "\\" || style == "operator");
      return style;
    },

    indent: function(state, textAfter) {
      if (state.tokenize[state.tokenize.length-1] != tokenBase) return 0;
      var firstChar = textAfter && textAfter.charAt(0);
      var ct = state.context;
      var closing = ct.type == matching[firstChar] ||
        ct.type == "keyword" && /^(?:end|until|else|elsif|when|rescue)\b/.test(textAfter);
      return ct.indented + (closing ? 0 : config.indentUnit) +
        (state.continuedLine ? config.indentUnit : 0);
    },

    electricChars: "}de", // enD and rescuE
    lineComment: "#"
  };
});

CodeMirror.defineMIME("text/x-ruby", "ruby");


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <title>Your Awesome Title</title>
    <link href='https://fonts.googleapis.com/css?family=Lora:400,400italic,700,700italic' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="/css/report.css">
    <link rel="stylesheet" href="/css/blocks.css">

Awesome Title Goes Here

  Top
  Summary
  Intro
  Projects
  Conclusion

Executive Summary

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Significant words

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

More significant words

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Duis aute irure dolor in reprehenderit

Excepteur sint occaecat

Lorem ipsum dolor sit amet

Ut enim ad minim veniam

Duis aute irure dolor in reprehenderit

Excepteur sint occaecat

Lorem ipsum dolor sit amet

Ut enim ad minim veniam

"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."

-- Important Figure, remarks to important people, November 1, 2016

Intro

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Projects

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Project 1

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Project 2

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Conclusion

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Recommendations & Future Work

Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

:)


text:
var alt = require('../alt');
var assign = require('object-assign');

var CheckedEmailStore = require('./CheckedEmailStore');
var ContextMenuActionCreators = require('../actions/ContextMenuActionCreators');

function ContextMenuStore() {
  this.bindActions(ContextMenuActionCreators);

  this.isActive = false;
  this.menuState = {
    xPos: 0,
    yPos: 0,
    id: -1
  };

  this.exportPublicMethods({

    isMenuActive: function() {
      return this.getState().isActive;
    },

    getMenuState: function() {
      return this.getState().menuState;
    }

  });
}

ContextMenuStore.prototype.onShowMenu = function(obj) {
  this.waitFor([CheckedEmailStore.dispatchToken]);
  this.isActive = true;
  assign(this.menuState, obj);
};

ContextMenuStore.prototype.onHideMenu = function() {
  this.isActive = false;
};

module.exports = alt.createStore(ContextMenuStore, 'ContextMenuStore');


text:
""" Blenderbot model configuration """

from ...configuration_utils import PretrainedConfig
from ...utils import logging

logger = logging.get_logger(__name__)

BLENDERBOT_PRETRAINED_CONFIG_ARCHIVE_MAP = {
    "facebook/blenderbot-3B": "https://huggingface.co/facebook/blenderbot-3B/resolve/main/config.json",
    # See all Blenderbot models at https://huggingface.co/models?filter=blenderbot
}

class BlenderbotConfig(PretrainedConfig):
    r"""
    This is the configuration class to store the configuration of a :class:`~transformers.BlenderbotModel`. It is used
    to instantiate an Blenderbot model according to the specified arguments, defining the model architecture.
    Instantiating a configuration with the defaults will yield a similar configuration to that of the Blenderbot
    `facebook/blenderbot-3B <https://huggingface.co/facebook/blenderbot-3B>`__ architecture.

    Configuration objects inherit from :class:`~transformers.PretrainedConfig` and can be used to control the model
    outputs. Read the documentation from :class:`~transformers.PretrainedConfig` for more information.

    Args:
        vocab_size (:obj:`int`, `optional`, defaults to 50265):
            Vocabulary size of the Blenderbot model. Defines the number of different tokens that can be represented by
            the :obj:`inputs_ids` passed when calling :class:`~transformers.BlenderbotModel` or
            :class:`~transformers.TFBlenderbotModel`.
        d_model (:obj:`int`, `optional`, defaults to 1024):
            Dimensionality of the layers and the pooler layer.
        encoder_layers (:obj:`int`, `optional`, defaults to 12):
            Number of encoder layers.
        decoder_layers (:obj:`int`, `optional`, defaults to 12):
            Number of decoder layers.
        encoder_attention_heads (:obj:`int`, `optional`, defaults to 16):
            Number of attention heads for each attention layer in the Transformer encoder.
        decoder_attention_heads (:obj:`int`, `optional`, defaults to 16):
            Number of attention heads for each attention layer in the Transformer decoder.
        decoder_ffn_dim (:obj:`int`, `optional`, defaults to 4096):
            Dimensionality of the "intermediate" (often named feed-forward) layer in decoder.
        encoder_ffn_dim (:obj:`int`, `optional`, defaults to 4096):
            Dimensionality of the "intermediate" (often named feed-forward) layer in decoder.
        activation_function (:obj:`str` or :obj:`function`, `optional`, defaults to :obj:`"gelu"`):
            The non-linear activation function (function or string) in the encoder and pooler. If string,
            :obj:`"gelu"`, :obj:`"relu"`, :obj:`"silu"` and :obj:`"gelu_new"` are supported.
        dropout (:obj:`float`, `optional`, defaults to 0.1):
            The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.
        attention_dropout (:obj:`float`, `optional`, defaults to 0.0):
            The dropout ratio for the attention probabilities.
        activation_dropout (:obj:`float`, `optional`, defaults to 0.0):
            The dropout ratio for activations inside the fully connected layer.
        classifier_dropout (:obj:`float`, `optional`, defaults to 0.0):
            The dropout ratio for classifier.
        max_position_embeddings (:obj:`int`, `optional`, defaults to 1024):
            The maximum sequence length that this model might ever be used with. Typically set this to something large
            just in case (e.g., 512 or 1024 or 2048).
        init_std (:obj:`float`, `optional`, defaults to 0.02):
            The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
        encoder_layerdrop: (:obj:`float`, `optional`, defaults to 0.0):
            The LayerDrop probability for the encoder. See the `LayerDrop paper <see
            https://arxiv.org/abs/1909.11556>`__ for more details.
        decoder_layerdrop: (:obj:`float`, `optional`, defaults to 0.0):
            The LayerDrop probability for the decoder. See the `LayerDrop paper <see
            https://arxiv.org/abs/1909.11556>`__ for more details.
        gradient_checkpointing (:obj:`bool`, `optional`, defaults to :obj:`False`):
            If True, use gradient checkpointing to save memory at the expense of slower backward pass.
        scale_embedding (:obj:`bool`, `optional`, defaults to :obj:`False`):
            Scale embeddings by diving by sqrt(d_model).
        use_cache (:obj:`bool`, `optional`, defaults to :obj:`True`):
            Whether or not the model should return the last key/values attentions (not used by all models)
        forced_eos_token_id (:obj:`int`, `optional`, defaults to 2):
            The id of the token to force as the last generated token when :obj:`max_length` is reached. Usually set to
            :obj:`eos_token_id`.

    Example::

        >>> from transformers import BlenderbotModel, BlenderbotConfig

        >>> # Initializing a Blenderbot facebook/blenderbot-3B style configuration
        >>> configuration = BlenderbotConfig()

        >>> # Initializing a model from the facebook/blenderbot-3B style configuration
        >>> model = BlenderbotModel(configuration)

        >>> # Accessing the model configuration
        >>> configuration = model.config
    """
    model_type = "blenderbot"
    keys_to_ignore_at_inference = ["past_key_values"]

    def __init__(
        self,
        vocab_size=8008,
        max_position_embeddings=128,
        encoder_layers=2,
        encoder_ffn_dim=10240,
        encoder_attention_heads=32,
        decoder_layers=24,
        decoder_ffn_dim=10240,
        decoder_attention_heads=32,
        encoder_layerdrop=0.0,
        decoder_layerdrop=0.0,
        use_cache=True,
        is_encoder_decoder=True,
        activation_function="gelu",
        d_model=2560,
        dropout=0.1,
        attention_dropout=0.0,
        activation_dropout=0.0,
        init_std=0.02,
        decoder_start_token_id=1,
        classifier_dropout=0.0,
        scale_embedding=False,
        gradient_checkpointing=False,
        pad_token_id=0,
        bos_token_id=1,
        eos_token_id=2,
        encoder_no_repeat_ngram_size=3,
        forced_eos_token_id=2,
        **kwargs
    ):
        super().__init__(
            pad_token_id=pad_token_id,
            bos_token_id=bos_token_id,
            eos_token_id=eos_token_id,
            is_encoder_decoder=is_encoder_decoder,
            decoder_start_token_id=decoder_start_token_id,
            encoder_no_repeat_ngram_size=encoder_no_repeat_ngram_size,
            forced_eos_token_id=forced_eos_token_id,
            **kwargs,
        )

        self.vocab_size = vocab_size
        self.max_position_embeddings = max_position_embeddings
        self.d_model = d_model
        self.encoder_ffn_dim = encoder_ffn_dim
        self.encoder_layers = encoder_layers
        self.encoder_attention_heads = encoder_attention_heads
        self.decoder_ffn_dim = decoder_ffn_dim
        self.decoder_layers = decoder_layers
        self.decoder_attention_heads = decoder_attention_heads
        self.dropout = dropout
        self.attention_dropout = attention_dropout
        self.activation_dropout = activation_dropout
        self.activation_function = activation_function
        self.init_std = init_std
        self.encoder_layerdrop = encoder_layerdrop
        self.decoder_layerdrop = decoder_layerdrop
        self.classifier_dropout = classifier_dropout
        self.use_cache = use_cache
        self.num_hidden_layers = encoder_layers
        self.gradient_checkpointing = gradient_checkpointing
        self.scale_embedding = scale_embedding  # scale factor will be sqrt(d_model) if True

    @property
    def num_attention_heads(self) -> int:
        return self.encoder_attention_heads

    @property
    def hidden_size(self) -> int:
        return self.d_model


text:
// This file is part of Karesansui Core.
//
// Copyright (C) 2009-2012 HDE, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
// Authors:
//     Kei Funagayama <kei@karesansui-project.info>
//

function make_tr(name, value, is_plane){
    var name_tag = "" + name + "	";
    var image_tag = "	";
    if(typeof(is_plane) == "undefined"){
        is_plane = false;
    }

    if(is_plane == true){
        var value_tag = "" + value + "	";
    } else {
        var value_tag = "
" + jQuery("" + value + "").text() + "
	";
    }

    return "
" + name_tag + image_tag + value_tag + "
";
}

function make_toggle_tr(toggle_button_id, toggle_value_id, desc_data, detail_data, is_plane){
    var detail_data_tag = '';

    for(i=0; i<detail_data.length; i++){
        var detail_name_tag = detail_data[i]['name'];
        var detail_value_tag = detail_data[i]['value'];
        if(is_plane == false){
            detail_value_tag = '
' + detail_value_tag + '
';
        }

        if(detail_name_tag == ''){
            detail_data_tag += '\

\
                                \
                                    ' + detail_value_tag + '\
                                	\

\
            ';
        } else {
            detail_data_tag += '\

\
                                \
                                    ' + detail_name_tag + '\
                                	\
                                \
                                    ' + detail_value_tag + '\
                                	\

\
            ';
        }
    }

    var tag = '\

\
    \

\

\
                ' + desc_data['name'] + '\

\

\
                ' + desc_data['value'] + '\

\

\

\

\

\

\
                        ' + detail_data_tag + '\

\

\

\

\

\
\
';

    return tag;
}

function make_status_bar(name, total, free){
    var used = Math.round(total - free);
    var used_percent = Math.round(100 - ((free / total) * 100));
    var _status;

    total = Math.round(total);
    free = Math.round(free);

    _status_bar = '
'
                    + ''
                    + used_percent + '%	'
                    + used + ' / '
                    + total + ' MB
';
    return make_tr(name, _status_bar, true);
}

function make_space(){
    return "

";
}

function format_cputime(num){
    num = num.toString();
    var int_part = num.split(".")[0];
    var dec_part = num.split(".")[1];

    var ret = "";
    if(dec_part == undefined){
        ret = int_part + ".00";
    } else {
        ret = int_part + "." + dec_part.slice(0, 2);
    }

    return ret;
}

function show_detail_event(){
    $("#show_detail_switch").click(function(){
        if($("#detail_value").html() != "--"){
            var src_val = "${ctx.homepath}/static/images/tree-close.gif";

            $("#detail_value").toggle(500);
            if($(this).attr("src").indexOf("tree-open.gif") == -1){
                src_val = "${ctx.homepath}/static/images/tree-open.gif";
            }
            $(this).attr("src", src_val);
        }
    });
}

function join_comma(value){
    var ret = "";

    for(var i = 0; i < value.length; i++){
        ret += value[i] + ", ";
    }

    ret = ret.slice(0, ret.length - 2);

    return ret;
}

function str_status(status){
    if(status == VIR_DOMAIN_NOSTATE){
        return 'NOSTATE';
    } else if(status == VIR_DOMAIN_CRASHED){
        return 'CRASHED';
    } else if(status == VIR_DOMAIN_SHUTOFF){
        return 'SHUTOFF';
    } else if(status == VIR_DOMAIN_SHUTDOWN){
        return 'SHUTDOWN';
    } else if(status == VIR_DOMAIN_PAUSED){
        return 'PAUSED';
    } else if(status == VIR_DOMAIN_BLOCKED){
        return 'BLOCKED';
    } else if(status == VIR_DOMAIN_RUNNING){
        return 'RUNNING';
    } else{
        return null;
    }
}

function toggle_button_event(button_id, value_id, default_status, style, speed){
    if(typeof(default_status) == "undefined"){
        var default_status = "open";
    }

    if(typeof(style) == "undefined"){
        var style = "default";
    }

    if(typeof(speed) == "undefined"){
        var speed = 500;
    }

    if($(button_id).hasClass("tree-toggle") == true){
        return true;
    }

    $(button_id).addClass("tree-toggle");

    var str_button_id = button_id.replace("#", "");

    var open_img = "${ctx.homepath}/static/images/tree-open.gif"
    var close_img = "${ctx.homepath}/static/images/tree-close.gif";
    if(style == "black"){
        open_img = "${ctx.homepath}/static/images/tree-open-bk.png"
        close_img = "${ctx.homepath}/static/images/tree-close-bk.png";
    }

    $(button_id+'_img').css('cursor', 'pointer');

    if(default_status == "open"){
        $(button_id).prepend('');
        $(button_id+'_img').attr("src", open_img);
        $(value_id).show();
    } else {
        $(button_id).prepend('');
        $(button_id+'_img').attr("src", close_img);
        $(value_id).hide();
    }

    var click_event_func = function(){
        if($(this).attr("src") == open_img){
            $(this).attr("src", close_img);
            $(value_id).hide(speed);
        } else {
            $(this).attr("src", open_img);
            $(value_id).show(speed);
        }
    }

    /*
     * Click event may not be effective.
     * Toggle event avoided.
     */
    $(button_id+"_img").toggle(
        click_event_func,
        click_event_func
    );

    return true;
}

function autounit(t, unit){
    var _t = parseFloat(t);
    var now = 0;
    var _u = 1;
    while(true){
        var ret = Math.floor(_t / _u);
        if(0 == ret || now == unit.length){
            break;
        }
        _u *= 1024;
        now += 1;
    }

    if(0 < now){
       _u /= 1024;
       now -= 1;
    }

    if(unit.length < now){
        return [_t, unit[0]];
    }
    return [_t / _u, unit[now]];
}

function view_autounit(t, unit, decimal_point, print_unit){
    if(typeof(unit) == 'undefined' || unit == null){
        unit = ['B','KB','MB','GB','TB', 'PB', 'EB'];
    }

    if(typeof(print_unit) == 'undefined' || print_unit == null){
        print_unit = false;
    }

    if(typeof(decimal_point) == 'undefined' || decimal_point == null){
        decimal_point = 0;
    }

    var ret = autounit(t, unit);

    var view_number = ret[0].toFixed(decimal_point);
    var view_unit = ret[1];

    if(print_unit == true){
        return view_number + view_unit;
    } else {
        return view_number;
    }
}

function megaunit(t, now_unit){
    var UNIT = ['B','KB','MB','GB','TB', 'PB', 'EB'];
    var MEGA_POS = 2;

    var _t = parseFloat(t);
    var _u = 1;

    var now_pos = 0;
    for(var i=0; i<UNIT.length; i++){
        if(now_unit == UNIT[i]){
            now_pos = i;
            break;
        }
    }

    if(MEGA_POS <= now_pos){
        var unit_reach = now_pos - MEGA_POS;
        for(var i=0; i<unit_reach; i++){
            _u *= 1024;
        }
        return _t * _u;
    } else {
        var unit_reach = MEGA_POS - now_pos;
        for(var i=0; i<unit_reach; i++){
            _u *= 1024;
        }
        return _t / _u;
    }
}

function view_megaunit(t, now_unit, decimal_point, print_unit){
    if(typeof(print_unit) == 'undefined' || print_unit == null){
        print_unit = false;
    }

    if(typeof(decimal_point) == 'undefined' || decimal_point == null){
        decimal_point = 0;
    }

    var ret = megaunit(t, now_unit);

    var view_number = ret.toFixed(decimal_point);

    if(print_unit == true){
        return view_number + 'MB';
    } else {
        return view_number;
    }
}


text:
require 'rake-tasks/checks'

#:available => whether this browser is available on this computer. Defaults to true.

BROWSERS = {
  "ff" => {
    :python => {
      :ignore => "firefox", # py.test string used for ignoring
      :dir => "firefox", # Directory to put tests in/read tests from
      :file_string => "ff", # Browser-string to use in test filenames
      :class => "Firefox", # As per py/selenium/webdriver/__init__.py
      :resources => [
        { "//javascript/firefox-driver:webdriver" => "selenium/webdriver/firefox/" },
        { "//cpp:noblur" => "selenium/webdriver/firefox/x86/x_ignore_nofocus.so" },
        { "//cpp:noblur64" => "selenium/webdriver/firefox/amd64/x_ignore_nofocus.so" }
      ]
    },
    :java => {
      :class => "org.openqa.selenium.firefox.SynthesizedFirefoxDriver",
      :deps => [ "//java/client/test/org/openqa/selenium/testing/drivers" ]
    },
    :browser_name => "firefox",
  },
  "marionette" => {
    :python => {
      :ignore => "marionette", # py.test string used for ignoring
      :dir => "firefox", # Directory to put tests in/read tests from
      :file_string => "marionette", # Browser-string to use in test filenames
      :class => "Firefox", # As per py/selenium/webdriver/__init__.py
    },
    :java => {
      :class => "org.openqa.selenium.firefox.SynthesizedFirefoxDriver",
      :deps => [ "//java/client/test/org/openqa/selenium/testing/drivers" ]
    },
    :browser_name => "firefox",
  },
  "ie" => {
    :python => {
      :ignore => "ie",
      :dir => "ie",
      :file_string => "ie",
      :class => "Ie"
    },
    :java => {
      :class => "org.openqa.selenium.ie.InternetExplorerDriver",
      :deps => [ "//java/client/src/org/openqa/selenium/ie:ie", "//cpp/iedriverserver:win32" ]
    },
    :browser_name => "internet explorer",
    :available => windows?
  },
  "edge" => {
    :python => {
      :ignore => "edge",
      :dir => "edge",
      :file_string => "edge",
      :class => "Edge"
    },
    :browser_name => "MicrosoftEdge",
    :available => windows?
  },
  "chrome" => {
    :python => {
      :ignore => "chrome",
      :dir => "chrome",
      :file_string => "chrome",
      :class => "Chrome"
    },
    :java => {
      :class => "org.openqa.selenium.chrome.ChromeDriver",
      :deps => [ "//java/client/src/org/openqa/selenium/chrome:chrome" ]
    },
    :browser_name => "chrome",
    :available => chrome?
  },
  "blackberry" => {
    :python => {
      :ignore => "blackberry",
      :dir => "blackberry",
      :file_string => "blackberry",
      :class => "BlackBerry",
      :constructor_args => "device_password='password'"
    },
    :browser_name => "blackberry"
  },
  "phantomjs" => {
    :python => {
      :ignore => "phantomjs",
      :dir => "phantomjs",
      :file_string => "phantomjs",
      :class => "PhantomJS",
    },
    :browser_name => "phantomjs"
  },
  "remote_firefox" => {
    :python => {
      :dir => "remote",
      :file_string => "remote",
      :deps => [:remote_client, :'selenium-server-standalone', '//java/server/test/org/openqa/selenium/remote/server/auth:server:uber'],
      :custom_test_import => "from selenium.test.selenium.common import utils",
      :custom_test_setup => "utils.start_server(module)",
      :custom_test_teardown => "utils.stop_server(module)",
      :class => "Remote",
      :constructor_args => "desired_capabilities=webdriver.DesiredCapabilities.FIREFOX"
    }
  },
  "safari" => {
    :python => {
      :ignore => "safari",
      :dir => "safari",
      :file_string => "safari",
      :class => "Safari"
    },
    :java => {
      :class => "org.openqa.selenium.safari.SafariDriver",
      :deps => [ "//java/client/src/org/openqa/selenium/safari:safari" ]
    },
    :browser_name => "safari",
    :available => mac?
  }
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Führ. Pilzk. (Zwickau) 114 (1871)

#### Original name
Agaricus anthracophilus Lasch, 1829

### Remarks
null


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <title>Redirecting…</title>
  <link rel="canonical" href="/eu/dep/aux_.html">

  <meta http-equiv="refresh" content="0; url=/eu/dep/aux_.html">
  <meta name="robots" content="noindex">

Redirecting…

  Click here if you are not redirected.


text:
<?php

namespace ByTIC\Payments\Models\AbstractModels\HasPaymentMethod;

use ByTIC\Payments\Models\Methods\PaymentMethod;

/**
 * Trait HasPaymentMethodRecord
 * @package ByTIC\Payments\Models\AbstractModels\HasPaymentMethod
 *
 * @property int $id_method
 * @method PaymentMethod getPaymentMethod()
 */
trait HasPaymentMethodRecord
{
    /**
     * @param PaymentMethod $method
     */
    public function populateFromPaymentMethod($method)
    {
        if (is_object($method)) {
            $this->getRelation('PaymentMethod')->setResults($method);
            $method = $method->id;
        }
        $this->id_method = $method;
    }
}


text:
require 'spec_helper'

class Model
  include ActiveModel::Validations
  attr_accessor :options
end

describe ArrayEnumValidator do
  context 'definition' do
    before :each do
      Model.clear_validators!
    end

    it 'returns error if enum option is absent' do
      class Model
        validates :options, array_enum: {}
      end
      @model = Model.new
      expect(@model).to be_invalid
      expect(@model.errors[:base]).to include('Precondition failed: enum option required')
    end

    it 'returns error if value is nil' do
      class Model
        validates :options, array_enum: {enum: {a: 'A'}}
      end
      @model = Model.new
      expect(@model).to be_invalid
      expect(@model.errors[:base]).to include('Precondition failed: value is nil')
    end
  end

  context 'simple enum' do
    before do
      Model.clear_validators!
      class Model
        validates :options, array_enum: { enum: {a: 'A', b: 'B'} }
      end
    end

    before :each do
      @model = Model.new
    end

    it 'is valid with valid entries' do
      @model.options = ['A']
      expect(@model).to be_valid

      @model.options = ['B']
      expect(@model).to be_valid

      @model.options = ['A', 'B']
      expect(@model).to be_valid
    end

    it 'is invalid with invalid entries' do
      expect(@model).to be_invalid

      @model.options = ['C']
      expect(@model).to be_invalid
    end

    it 'is invalid with duplicate entries' do
      @model.options = ['A', 'A']
      expect(@model).to be_invalid

      @model.options = ['C', 'C']
      expect(@model).to be_invalid
    end
  end

  context 'enum allowing wildcard' do
    before do
      Model.clear_validators!
      class Model
        validates :options, array_enum: { enum: {a: 'A', b: 'B'}, allow_wildcard: true }
      end
    end

    before :each do
      @model = Model.new
    end

    it 'is valid with valid entries' do
      @model.options = ['A']
      expect(@model).to be_valid

      @model.options = ['B']
      expect(@model).to be_valid

      @model.options = ['A', 'B']
      expect(@model).to be_valid

      @model.options = ['derp']
      expect(@model).to be_valid

      @model.options = ['A', 'derp']
      expect(@model).to be_valid

      @model.options = ['B', 'derp']
      expect(@model).to be_valid

      @model.options = ['A', 'B', 'derp']
      expect(@model).to be_valid

      @model.options = ['derp', 'A', 'B']
      expect(@model).to be_valid
    end

    it 'is invalid with invalid entries' do
      @model.options = ['derp', 'A', 'B', 'herp']
      expect(@model).to be_invalid

      @model.options = ['derp', 'herp']
      expect(@model).to be_invalid
    end

    it 'is invalid with duplicate entries' do

      @model.options = ['derp', 'derp']
      expect(@model).to be_invalid

      @model.options = ['A', 'A', 'derp']
      expect(@model).to be_invalid
    end

    it 'returns error if more than one wildcard used' do
      @model.options = ['derp', 'herp']
      expect(@model).to be_invalid
      expect(@model.errors.messages[:options]).to include("herp is not permissible: wildcard 'derp' already used")
    end
  end
end


text:
FROM ubuntu:14.04
ENV DEBIAN_FRONTEND noninteractive
MAINTAINER Kaiyuanshe

ENV CHEF_CLIENT_VER 12.2.1-1

#change apt source list
COPY sources.list /tmp/sources.list
RUN cat /tmp/sources.list >> /etc/apt/sources.list

# Install basic tools
RUN apt-get update && \
    apt-get install -y git vim

# Install chef-client
#RUN cd /tmp && wget -q -H     && \

ADD chef_${CHEF_CLIENT_VER}_amd64.deb /tmp/chef_${CHEF_CLIENT_VER}_amd64.deb
RUN cd /tmp && dpkg -i chef_${CHEF_CLIENT_VER}_amd64.deb

# Config SSH
RUN  apt-get install openssh-server -y && \
     mkdir /var/run/sshd && \
     echo 'root:acoman' | chpasswd && \
     sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \
     echo 'ClientAliveInterval 120' >> /etc/ssh/sshd_config

# Add chef-repo files to docker
RUN mkdir /etc/chef
COPY . /etc/chef
RUN cd /etc/chef && \
    chef-client -r 'role[hackathon-docker]' --environment hackathon-docker

# Install supervisor
RUN  apt-get install supervisor -y

COPY services.conf /etc/supervisor/conf.d/services.conf
#RUN touch /etc/supervisor/conf.d/services.conf && \
#    echo "[program:tomcat]" >> /etc/supervisor/conf.d/services.conf && \
#    echo "command= service tomcat7 start" >> /etc/supervisor/conf.d/services.conf && \
#    echo "redirect_stderr=true" >> /etc/supervisor/conf.d/services.conf

EXPOSE 22 80 8000 8080 15000

CMD ["supervisord", "-c", "/etc/supervisor.conf"]