text:
package org.lastaflute.job.log;

import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.stream.Collectors;

import org.dbflute.helper.message.ExceptionMessageBuilder;
import org.dbflute.optional.OptionalThing;
import org.lastaflute.job.LaJobHistory;
import org.lastaflute.job.exception.JobHistoryNotFoundException;

/**
 * @author jflute
 * @since 0.2.8 (2017/03/04 Saturday)
 */
public class SavedHistoryCache {

    // ===================================================================================
    //                                                                           Attribute
    //                                                                           =========
    // basically synchronized but just in case
    protected final Map<String, LaJobHistory> historyMap = new ConcurrentHashMap<String, LaJobHistory>();
    protected final List<String> historyKeyList = new CopyOnWriteArrayList<String>();

    // ===================================================================================
    //                                                                           Operation
    //                                                                           =========
    // -----------------------------------------------------
    //                                                 Find
    //                                                ------
    public synchronized OptionalThing<LaJobHistory> find(String historyKey) {
        final LaJobHistory found = historyMap.get(historyKey);
        return OptionalThing.ofNullable(found, () -> {
            final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
            br.addNotice("Not found the job history by the job thread.");
            br.addItem("History Key");
            br.addElement(historyKey);
            br.addItem("Existing Key");
            if (!historyKeyList.isEmpty()) {
                for (String existingKey : historyKeyList) { // using list for order
                    br.addElement(existingKey + " = " + historyMap.get(existingKey));
                }
            } else {
                br.addElement("*No history");
            }
            final String msg = br.buildExceptionMessage();
            throw new JobHistoryNotFoundException(msg);
        });
    }

    // -----------------------------------------------------
    //                                                Record
    //                                                ------
    public synchronized void record(String historyKey, LaJobHistory jobHistory, int limit) {
        if (historyMap.size() >= limit) {
            final String removedKey = historyKeyList.remove(0); // oldest
            historyMap.remove(removedKey);
        }
        historyMap.put(historyKey, jobHistory);
        historyKeyList.add(historyKey);
    }

    // -----------------------------------------------------
    //                                                 List
    //                                                ------
    public synchronized List<LaJobHistory> list() {
        return historyKeyList.stream().map(key -> { // using list for order
            return historyMap.get(key); // basically not null
        }).collect(Collectors.toList());
    }

    // -----------------------------------------------------
    //                                                 Clear
    //                                                 -----
    public synchronized void clear() {
        historyMap.clear();
        historyKeyList.clear();
    }
}


text:
namespace
{

double ConvertWidth(double w, double scale)
{
  return max(w * scale, 1.0);
}

}

namespace df
{
namespace watch
{

dp::Color ConvertColor(uint32_t c)
{
  return dp::Extract(c, 255 - (c >> 24));
}

void ConvertStyle(LineDefProto const * pSrc, double scale, PenInfo & dest)
{
  double offset = 0.0;
  vector<double> v;

  if (pSrc->has_dashdot())
  {
    DashDotProto const & dd = pSrc->dashdot();

    int const count = dd.dd_size();
    v.reserve(count);
    for (int i = 0; i < count; ++i)
      v.push_back(dd.dd(i) * scale);

    if (dd.has_offset())
      offset = dd.offset() * scale;
  }

  dest = PenInfo(ConvertColor(pSrc->color()),
                 ConvertWidth(pSrc->width(), scale),
                 v.empty() ? 0 : &v[0], v.size(), offset);

  if (pSrc->has_pathsym())
  {
    PathSymProto const & ps = pSrc->pathsym();

    dest.m_step = ps.step() * scale;
    dest.m_icon.m_name = ps.name();

    if (ps.has_offset())
      dest.m_offset = ps.offset() * scale;
  }

  if (pSrc->has_join())
  {
    switch (pSrc->join())
    {
    case ROUNDJOIN:
      dest.m_join = dp::RoundJoin;
      break;
    case BEVELJOIN:
      dest.m_join = dp::BevelJoin;
      break;
    case NOJOIN:
      dest.m_join = dp::MiterJoin;
      break;
    default:
      break;
    }
  }

  if (pSrc->has_cap())
  {
    switch (pSrc->cap())
    {
    case ROUNDCAP:
      dest.m_cap = dp::RoundCap;
      break;
    case BUTTCAP:
      dest.m_cap = dp::ButtCap;
      break;
    case SQUARECAP:
      dest.m_cap = dp::SquareCap;
      break;
    default:
      break;
    }
  }
}

void ConvertStyle(AreaRuleProto const * pSrc, BrushInfo & dest)
{
  dest.m_color = ConvertColor(pSrc->color());
}

void ConvertStyle(SymbolRuleProto const * pSrc, IconInfo & dest)
{
  dest.m_name = pSrc->name();
}

void ConvertStyle(CaptionDefProto const * pSrc, double scale, dp::FontDecl & dest, m2::PointD & offset)
{
  // fonts smaller than 8px look "jumpy" on LDPI devices
  uint8_t const h = max(8, static_cast<int>(pSrc->height() * scale));

  offset = m2::PointD(0, 0);
  if (pSrc->has_offset_x())
    offset.x = scale * pSrc->offset_x();
  if (pSrc->has_offset_y())
    offset.y = scale * pSrc->offset_y();

  dest = dp::FontDecl(ConvertColor(pSrc->color()), h);

  if (pSrc->has_stroke_color())
    dest.m_outlineColor = ConvertColor(pSrc->stroke_color());
}

void ConvertStyle(ShieldRuleProto const * pSrc, double scale, dp::FontDecl & dest)
{
  // fonts smaller than 8px look "jumpy" on LDPI devices
  uint8_t const h = max(8, static_cast<int>(pSrc->height() * scale));

  dest = dp::FontDecl(ConvertColor(pSrc->color()), h);

  if (pSrc->has_stroke_color())
    dest.m_outlineColor = ConvertColor(pSrc->stroke_color());
}

uint8_t GetFontSize(CaptionDefProto const * pSrc)
{
  return pSrc->height();
}

}
}

redpajama_set_name: RedPajamaGithub


text:
export default class EventEmitter {

  listeners = [];

  on(cb) {
    this.listeners.push(cb);
    return () => {
      const index = this.listeners.indexOf(cb);
      if (index !== -1)
        this.listeners.splice(index, 1);
    };
  }

  emit(data) {
    this.listeners.forEach(fn => fn(data));
  };
}


text:
<?php
/**
 * The base configurations of the WordPress.
 *
 * This file has the following configurations: MySQL settings, Table Prefix,
 * Secret Keys, WordPress Language, and ABSPATH. You can find more information
 * by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
 * wp-config.php} Codex page. You can get the MySQL settings from your web host.
 *
 * This file is used by the wp-config.php creation script during the
 * installation. You don't have to use the web site, you can just copy this file
 * to "wp-config.php" and fill in the values.
 *
 * @package WordPress
 */

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'bryanduckworth_com_8');

/** MySQL database username */
define('DB_USER', 'xwnpqtad');

/** MySQL database password */
define('DB_PASSWORD', 'nV^3ScnF');

/** MySQL hostname */
define('DB_HOST', 'mysql-1.bryanduckworth.com');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

/**#@+
 * Authentication Unique Keys and Salts.
 *
 * Change these to different unique phrases!
 * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
 * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
 *
 * @since 2.6.0
 */
define('AUTH_KEY',         'i;PaFav+uic6?OW8BX(@w2u7G*dp+RWuNN`:_%L3kyFt7xTzi$lD|0VHmE5d*XFY');
define('SECURE_AUTH_KEY',  'S9vWrfPDg`qVY(kG7lpHsNM8HcVU;oAfPr"_vd6;mfL!:|QODkWFaX:0+U_pTJCs');
define('LOGGED_IN_KEY',    ':fRRMrIqQqkZQZ+QVy*(4%PmT_NM8!K2"+^p@JE3bK+o%);#$2Y"q/EiSK6W|MNf');
define('NONCE_KEY',        'tkHxS&k#p#|O72)mzAcCNIeVkpX`wcrCIkAe3Uj|mWgela7jM6//Ri*J:yl1!IBP');
define('AUTH_SALT',        '/x2xJNQt:D(N`%VKUDW3E)xM)XOv4k4?*4MuzTR2l"`?l1/5P9nBZ"g*vV~n@0)n');
define('SECURE_AUTH_SALT', 'UnNiWw1LmSDL@9ViCztXjjG|en&vlVG?NQ!DFA$X%+qr*zlb_T~Lk+kSV?Tp(h5?');
define('LOGGED_IN_SALT',   'sVIWTanm8l$QgiWc1!gYG3t2FXW@&5DHljzwoSXE:Rx4nozLcgJ+*cfTS%buh+sm');
define('NONCE_SALT',       'ttxw7~&p+j%SncvHm77h*quirnB8xQYzi7nO|_2B#*i+KW7!?_#O%BlN;lp)tR1U');

/**#@-*/

/**
 * WordPress Database Table prefix.
 *
 * You can have multiple installations in one database if you give each a unique
 * prefix. Only numbers, letters, and underscores please!
 */
$table_prefix  = 'wp_cjdpeb_';

/**
 * Limits total Post Revisions saved per Post/Page.
 * Change or comment this line out if you would like to increase or remove the limit.
 */
define('WP_POST_REVISIONS',  10);

/**
 * WordPress Localized Language, defaults to English.
 *
 * Change this to localize WordPress. A corresponding MO file for the chosen
 * language must be installed to wp-content/languages. For example, install
 * de_DE.mo to wp-content/languages and set WPLANG to 'de_DE' to enable German
 * language support.
 */
define('WPLANG', '');

/**
 * For developers: WordPress debugging mode.
 *
 * Change this to true to enable the display of notices during development.
 * It is strongly recommended that plugin and theme developers use WP_DEBUG
 * in their development environments.
 */
define('WP_DEBUG', false);

/* That's all, stop editing! Happy blogging. */

/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
	define('ABSPATH', dirname(__FILE__) . '/');

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');


text:
import scrapeIt from 'scrape-it';
import { promises as fs } from 'fs';
import { prefectures, PrefectureKanji, PrefectureRomaji } from './prefectures';

interface City {
    name: string;
    key: string;
}

interface HiddenValue {
    ar: string;
    bs: string;
    ta: string;
}

export const fetchData = async (prefectureRomaji: PrefectureRomaji) => {
    const citySelectionUrl = `https://suumo.jp/chintai/${prefectureRomaji}/city/`;
    const result = await scrapeIt<{
        cities: City[];
        ar: string;
        bs: string;
        ta: string;
    }>(citySelectionUrl, {
        cities: {
            listItem: '.searchitem-list li',
            data: {
                name: {
                    selector: 'label span',
                    eq: 0,
                },
                key: {
                    selector: 'input',
                    attr: 'value',
                },
            },
        },
        ar: { selector: 'input[name=ar]', attr: 'value' },
        bs: { selector: 'input[name=bs]', attr: 'value' },
        ta: { selector: 'input[name=ta]', attr: 'value' },
    });
    return result.data;
};

(async () => {
    const cityDictionary: {[key in PrefectureKanji]?: {[key: string]: string}} = {};
    const hiddenValueDictionary: {[key in PrefectureKanji]?: HiddenValue} = {};
    for (const prefKanji of Object.keys(prefectures) as PrefectureKanji[]) {
        const prefRomaji = prefectures[prefKanji];
        const { cities, ar, bs, ta } = await fetchData(prefRomaji);
        const dict: {[key: string]: string} = {};
        cities.forEach(city => { dict[city.name] = city.key });
        cityDictionary[prefKanji] = dict;
        hiddenValueDictionary[prefKanji] = { ar, bs, ta };
    }
    const cityJson = JSON.stringify(cityDictionary, null, '    ');
    const hiddenValueJson = JSON.stringify(hiddenValueDictionary, null, '    ');
    await fs.writeFile(`${__dirname}/data.json`, `{ "sc": ${cityJson}, "hiddenValue": ${hiddenValueJson}}`);
})();


text:
/*
 * Info.java
 *
 * Created on September 1, 2015, 10:38 AM
 */

package xal;

import xal.tools.ResourceManager;
import xal.tools.coding.json.JSONCoder;

import java.util.*;
import java.net.*;
import java.io.*;

/**
 * Info about the current Open XAL.
 */
public class Info {
	/** Label for this version of Open XAL */
	final private static String LABEL;

	// static initializer
	static {
		// assign the default label
		String label = "Open XAL";

		// attempt to load info properties from the "info.json" file
		System.out.println( "Getting info resource..." );
		final URL infoLocation = ResourceManager.getResourceURL( Info.class, "info.json" );
		if ( infoLocation != null ) {
			try {
				//System.out.println( "Attempting to load Info from URL: " + infoLocation );
				final StringBuffer buffer = new StringBuffer();
				final InputStream infoStream = infoLocation.openStream();
				final BufferedReader infoReader = new BufferedReader( new InputStreamReader( infoStream ) );
				while( true ) {
					final String nextLine = infoReader.readLine();
					if ( nextLine != null ) {
						buffer.append( nextLine );
						buffer.append( "\n" );
					} else {
						break;	// end of input
					}
				}
				infoStream.close();

				//System.out.println( "Buffer: " + buffer.toString() );

				@SuppressWarnings("unchecked")
				final Map<String,Object> infoMap = (Map<String,Object>)JSONCoder.defaultDecode( buffer.toString() );

				//System.out.println( "Info map: " + infoMap );

				label = (String)infoMap.get("label");
			} catch( Exception exception ) {
				System.err.println( "Exception attempting to load Open XAL info from: " + infoLocation );
				exception.printStackTrace();
				System.err.println( "Will revert to default info label: " + label );
			}
		}

		// assign the Info propreties
		LABEL = label;
	}

	/** Get the label for this version of Open XAL */
	static public String getLabel() {
		return LABEL;
	}
}


text:
package db

import (
	"fmt"
	"os"
	"path"
	"path/filepath"

	"github.com/go-xorm/core"
	"github.com/go-xorm/xorm"
	"github.com/zaaksam/dproxy/go/model"
)

// IModel 模型接口
type IModel interface {
	TableName() string
	NewItems() interface{}
}

// Engine 数据库引擎
var Engine *xorm.Engine
var tables []xorm.TableName

func init() {
	tables = make([]xorm.TableName, 20)

	dir := path.Dir(os.Args[0])
	dir = filepath.ToSlash(dir) // .../dproxy/go
	file := filepath.Join(dir, "dproxy.db")

	_, err := os.Stat(file)
	if err != nil && os.IsNotExist(err) {
		_, err = os.Create(file)
		if err != nil {
			panic(fmt.Errorf("创建DB文件错误:%s", err))
		}
	}

	Engine, err = xorm.NewEngine("sqlite3", file)

	err = Engine.Ping()
	if err != nil {
		panic(fmt.Sprintf("DB连接不通:%s", err))
	}

	//结构体命名与数据库一致
	Engine.SetMapper(core.NewCacheMapper(new(core.SameMapper)))

	err = createTable(
		&model.LogModel{},
		&model.WhiteListModel{},
		&model.PortMapModel{},
	)
	if err != nil {
		os.Remove(file)
		panic(err)
	}
}

func createTable(beans ...xorm.TableName) (err error) {
	// tables, err := Engine.DBMetas()
	// if err != nil {
	// 	panic(fmt.Sprintf("获取DB信息错误:%s", err))
	// }

	for i, l := 0, len(beans); i < l; i++ {
		err = Engine.CreateTables(beans[i])
		if err != nil {
			return fmt.Errorf("创建数据库表[%s]失败:%s", beans[i].TableName(), err)
		}
	}
	return
}

// NewSession 创建新的数据库操作对象
func NewSession() *xorm.Session {
	session := Engine.NewSession()
	session.IsAutoClose(true)
	return session
}

// GetList 获取分页数据
func GetList(session *xorm.Session, md IModel, pageIndex, pageSize int) (list *model.ListModel, err error) {
	list = &model.ListModel{
		PageIndex: pageIndex,
		PageSize:  pageSize,
		Items:     md.NewItems(),
	}

	//克隆查询对象
	sessionCount := session.Clone()
	defer sessionCount.Close()

	statement := sessionCount.Statement()

	//清空Orderby条件,在某些数据库count不能带orderby
	statement.OrderStr = ""

	if groupBy := statement.GroupByStr; groupBy != "" {
		statement.GroupByStr = "" // count不能带groupby
		list.Total, err = sessionCount.Select("count(DISTINCT " + groupBy + ")").Count(md)
	} else {
		sessionCount.Select("") // select置空
		list.Total, err = sessionCount.Count(md)
	}
	if err != nil {
		return
	}

	//计算分页
	resetPagination(list)

	//没有数据,提前返回
	if list.Total <= 0 {
		return
	}

	recordIndex := (list.PageIndex - 1) * list.PageSize
	session.Limit(list.PageSize, recordIndex)

	err = session.Table(md).Find(list.Items)
	return
}

func resetPagination(list *model.ListModel) {
	//检查页面长度
	if list.PageSize <= 0 {
		list.PageSize = 10
	} else if list.PageSize > 500 {
		list.PageSize = 500
	}

	//计算总页数
	cnt := int(list.Total / int64(list.PageSize))
	mod := int(list.Total % int64(list.PageSize))
	if mod > 0 {
		cnt++
	}

	//检查页面索引
	switch {
	case cnt == 0:
		list.PageIndex = 1
	case list.PageIndex > cnt:
		list.PageIndex = cnt
	case list.PageIndex <= 0:
		list.PageIndex = 1
	}

	//设置页面总页数
	list.PageCount = cnt
}


text:
package com.templaro.opsiz.aka;

public enum MorseBit {
	DOT, DASH, GAP, LETTER_GAP, WORD_GAP
}


text:
cask 'time-lapse-assembler' do
  version :latest
  sha256 :no_check

  url 'http://www.dayofthenewdan.com/TimeLapseAssembler.dmg'
  name 'Time Lapse Assembler'
  homepage 'http://www.dayofthenewdan.com/projects/time-lapse-assembler-1/'

  app 'Time Lapse Assembler.app'
end


text:
set -eu

# Inputs / outputs
IN_PACKAGES=("$@")
OUT_DIR=licenses

# Clean up before we start our work
rm -rf ${OUT_DIR:?}/*/

# Download dependencies of the requested packages, excluding the main module.
# - https://golang.org/ref/mod#glos-main-module
module=$(go list -m)
modules=$(go list -deps -f '{{with .Module}}{{.Path}}{{"\t"}}{{.Dir}}{{end}}' "${IN_PACKAGES[@]}")
dependencies=$(grep -v "^${module}" <<< "${modules}")

while IFS=$'\t' read -r module directory; do
	licenses=$(find "${directory}" -type f -ipath '*license*' -not -name '*.go')
	[ -n "${licenses}" ] || continue

	while IFS= read -r license; do
		# Replace the local module directory with the module path.
		# - https://golang.org/ref/mod#module-path
		relative="${module}${license:${#directory}}"

		# Copy the license file with the same layout as the module.
		destination="${OUT_DIR}/${relative%/*}"
		install -d "${destination}"
		install -m 0644 "${license}" "${destination}"
	done <<< "${licenses}"
done <<< "${dependencies}"


text:
define([
    'underscore',
    'contrail-view',
    'knockback'
], function (_, ContrailView, Knockback) {
    var gridElId = '#' + ctwc.FIREWALL_APPLICATION_POLICY_GRID_ID,
        prefixId = ctwc.FIREWALL_APPLICATION_POLICY_PREFIX_ID,
        modalId = 'configure-' + prefixId,
        formId = '#' + modalId + '-form';

    var applicationPolicyEditView = ContrailView.extend({
        renderAddEditApplicationPolicy: function(options) {
            var editTemplate =
                contrail.getTemplate4Id(ctwl.TMPL_CORE_GENERIC_EDIT),
                editLayout = editTemplate({prefixId: prefixId, modalId: modalId}),
                self = this,disable = false;
                var mode = options.mode;
                if(mode === 'edit'){
                    disable = true;
                }
            cowu.createModal({'modalId': modalId, 'className': 'modal-700',
                             'title': options['title'], 'body': editLayout,
                             'onSave': function () {
                self.model.addEditApplicationPolicy({
                    init: function () {
                        cowu.enableModalLoading(modalId);
                    },
                    success: function () {
                        options['callback']();
                        $("#" + modalId).modal('hide');
                    },
                    error: function (error) {
                        cowu.disableModalLoading(modalId, function () {
                            self.model.showErrorAttr(prefixId +
                                                     cowc.FORM_SUFFIX_ID,
                                                     error.responseText);
                        });
                    }
                }, options);
                // TODO: Release binding on successful configure
            }, 'onCancel': function () {
                Knockback.release(self.model, document.getElementById(modalId));
                kbValidation.unbind(self);
                $("#" + modalId).modal('hide');
            }});

            self.renderView4Config($("#" + modalId).find(formId),
                                   this.model,
                                   getApplicationPolicyViewConfig(disable, options),
                                   "applicationPolicyValidation",
                                   null, null, function() {
                self.model.showErrorAttr(prefixId + cowc.FORM_SUFFIX_ID, false);
                Knockback.applyBindings(self.model,
                                        document.getElementById(modalId));
                kbValidation.bind(self);
            },null,false);
        },
        renderDeleteApplicationPolicy: function(options) {
            var delTemplate =
                contrail.getTemplate4Id('core-generic-delete-form-template');
            var self = this;

            var delLayout = delTemplate({prefixId: prefixId});
            cowu.createModal({'modalId': modalId, 'className': 'modal-480',
                             'title': options['title'], 'btnName': 'Confirm',
                             'body': delLayout,
               'onSave': function () {
                self.model.deleteApplicationPolicy(options['selectedGridData'], {
                    init: function () {
                        cowu.enableModalLoading(modalId);
                    },
                    success: function () {
                        options['callback']();
                        $("#" + modalId).modal('hide');
                    },
                    error: function (error) {
                        cowu.disableModalLoading(modalId, function () {
                            self.model.showErrorAttr(prefixId +
                                                     cowc.FORM_SUFFIX_ID,
                                                     error.responseText);
                        });
                    }
                });
            }, 'onCancel': function () {
                Knockback.release(self.model, document.getElementById(modalId));
                kbValidation.unbind(self);
                $("#" + modalId).modal('hide');
            }});
            self.model.showErrorAttr(prefixId + cowc.FORM_SUFFIX_ID, false);
            Knockback.applyBindings(self.model,
                document.getElementById(modalId));
            kbValidation.bind(self);
        }
    });
    function firwallPolicyDropDownFormatter(response){
        var firewallList = [], isGlobal = this.isGlobal;
        var policyList = getValueByJsonPath(response, "0;firewall-policys", []);
        $.each(policyList, function (i, obj) {
            if(isGlobal){
                if(obj['firewall-policy']['fq_name'].length < 3){
                    var fqNameJoin = obj['firewall-policy']['fq_name'].join(':');
                    var fqName = obj['firewall-policy']['fq_name'];
                    fqName = fqName[fqName.length-1];
                    firewallList.push({id: fqNameJoin, text: fqName});
                }
            } else{
                var fqNameJoin, fqName;
                if(obj['firewall-policy']['fq_name'].length < 3){
                    var fqNameJoin = obj['firewall-policy']['fq_name'].join(':');
                    var fqName = obj['firewall-policy']['fq_name'];
                    fqName = 'global:' + fqName[fqName.length-1];
                } else{
                    var fqNameJoin = obj['firewall-policy']['fq_name'].join(':');
                    var fqName = obj['firewall-policy']['fq_name'];
                    fqName = fqName[fqName.length-1];
                }
                firewallList.push({id: fqNameJoin, text: fqName});
            }
         });
        return firewallList;
    };
    var getApplicationPolicyViewConfig = function (isDisable, options) {
        var policyParam = {data: [{type: 'firewall-policys'}]};
        var tagsFiiteredArray = [];
        var tagsArray = [], tagName;
        return {
            elementId: ctwc.SEC_POLICY_ADDRESS_GRP_PREFIX_ID,
            view: 'SectionView',
            title: "Application Policy",
           // active:false,
            viewConfig: {
                rows: [
                    {
                        columns: [
                            {
                                elementId: 'name',
                                view: 'FormInputView',
                                viewConfig: {
                                    label: 'Name',
                                    path: 'name',
                                    class: 'col-xs-6',
                                    dataBindValue: 'name',
                                    disabled : isDisable
                                }
                            }
                        ]
                    },
                       {
                           columns: [
                               {
                                   elementId: 'Application',
                                   view: 'FormMultiselectView',
                                   viewConfig: {
                                       visible:
                                           'name() !== "' + ctwc.GLOBAL_APPLICATION_POLICY_SET + '"',
                                       label: "Application Tags",
                                       path: 'Applicaton',
                                       dataBindValue: 'Application',
                                       class: 'col-xs-10',
                                       elementConfig: {
                                           dataTextField: "text",
                                           dataValueField: "value",
                                           placeholder:
                                               "Select Tags",
                                               dataSource : {
                                                   type: 'remote',
                                                   requestType: 'post',
                                                   postData: JSON.stringify(
                                                         {data: [{type: 'tags'}]}),
                                                   url:'/api/tenants/config/get-config-details',
                                                   parse: function(result) {
                                                       for(var i=0; i<result.length; i++){
                                                         tagsDetails = result[i].tags;
                                                         for(var j= 0; j<tagsDetails.length; j++){
                                                             var domain = contrail.getCookie(cowc.COOKIE_DOMAIN_DISPLAY_NAME);
                                                             var project = contrail.getCookie(cowc.COOKIE_PROJECT_DISPLAY_NAME);
                                                             if (tagsDetails[j]['tag'].fq_name.length > 1 &&
                                                                     (domain != tagsDetails[j]['tag'].fq_name[0] ||
                                                                     project != tagsDetails[j]['tag'].fq_name[1])) {
                                                                 continue;
                                                             }
                                                             if(tagsDetails[j].tag.fq_name &&
                                                                     tagsDetails[j].tag.fq_name.length === 1) {
                                                                 actValue = tagsDetails[j].tag.fq_name[0];
                                                             }
                                                             else{
                                                                 actValue =  tagsDetails[j].tag.fq_name[0] +
                                                                 ":" + tagsDetails[j].tag.fq_name[1] +
                                                                 ":" + tagsDetails[j].tag.fq_name[2];
                                                             }
                                                             if(options.isGlobal){
                                                                 tagName = (tagsDetails[j]['tag'].fq_name.length == 1)?
                                                                         tagsDetails[j].tag.name : '';
                                                              }else{
                                                                  tagName = (tagsDetails[j]['tag'].fq_name.length == 1)?
                                                                          "global:" + tagsDetails[j].tag.name :
                                                                              tagsDetails[j].tag.name;
                                                              }
                                                              if(tagName !== ''){
                                                                  data = {
                                                                          "text": tagName,
                                                                          "value":actValue
                                                                     };
                                                                  if (tagsDetails[j].tag.tag_type_name === 'application') {
                                                                      tagsArray.push(data);
                                                                  }
                                                              }
                                                         }
                                                       }
                                                       return tagsArray;
                                                   }
                                               }
                                       }
                                   }
                               }
                           ]

                       },
                       {
                           columns: [{
                               elementId: 'firewall_policy',
                               view: "FormMultiselectView",
                               viewConfig: {
                                   label: 'Firewall Policy(s)',
                                   class: "col-xs-10",
                                   path: "firewall_policy",
                                   dataBindValue: "firewall_policy",
                                   elementConfig:{
                                       dataTextField: "text",
                                       placeholder:"Select Firewall Policies",
                                       dataValueField: "id",
                                       separator: cowc.DROPDOWN_VALUE_SEPARATOR,
                                       dataSource: {
                                           type: "remote",
                                           requestType: "POST",
                                           url: "/api/tenants/config/get-config-details",
                                           postData: JSON.stringify(policyParam),
                                           parse : firwallPolicyDropDownFormatter.bind(options)
                                       }
                                    }
                               }
                          }]

                       }
                ]
            }
        }
    };

    return applicationPolicyEditView;
});


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

import com.facebook.airlift.json.JsonCodec;
import com.facebook.presto.RowPagesBuilder;
import com.facebook.presto.block.BlockEncodingManager;
import com.facebook.presto.common.block.Block;
import com.facebook.presto.common.type.ArrayType;
import com.facebook.presto.common.type.RowType;
import com.facebook.presto.common.type.SqlDate;
import com.facebook.presto.common.type.SqlTime;
import com.facebook.presto.common.type.StandardTypes;
import com.facebook.presto.common.type.Type;
import com.facebook.presto.common.type.TypeManager;
import com.facebook.presto.common.type.TypeSignature;
import com.facebook.presto.common.type.TypeSignatureParameter;
import com.facebook.presto.metadata.FunctionManager;
import com.facebook.presto.orc.OrcBatchRecordReader;
import com.facebook.presto.orc.OrcDataSource;
import com.facebook.presto.spi.PrestoException;
import com.facebook.presto.spi.classloader.ThreadContextClassLoader;
import com.facebook.presto.sql.analyzer.FeaturesConfig;
import com.facebook.presto.type.TypeRegistry;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import org.joda.time.DateTime;
import org.joda.time.Days;
import org.joda.time.chrono.ISOChronology;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import java.io.File;
import java.util.List;

import static com.facebook.airlift.json.JsonCodec.jsonCodec;
import static com.facebook.presto.common.type.BigintType.BIGINT;
import static com.facebook.presto.common.type.BooleanType.BOOLEAN;
import static com.facebook.presto.common.type.DateType.DATE;
import static com.facebook.presto.common.type.DoubleType.DOUBLE;
import static com.facebook.presto.common.type.TimeType.TIME;
import static com.facebook.presto.common.type.TimeZoneKey.UTC_KEY;
import static com.facebook.presto.common.type.TimestampType.TIMESTAMP;
import static com.facebook.presto.common.type.TimestampWithTimeZoneType.TIMESTAMP_WITH_TIME_ZONE;
import static com.facebook.presto.common.type.VarbinaryType.VARBINARY;
import static com.facebook.presto.common.type.VarcharType.createVarcharType;
import static com.facebook.presto.raptor.storage.OrcTestingUtil.createFileWriter;
import static com.facebook.presto.raptor.storage.OrcTestingUtil.createReader;
import static com.facebook.presto.raptor.storage.OrcTestingUtil.fileOrcDataSource;
import static com.facebook.presto.raptor.storage.OrcTestingUtil.octets;
import static com.facebook.presto.testing.DateTimeTestingUtils.sqlTimestampOf;
import static com.facebook.presto.testing.TestingConnectorSession.SESSION;
import static com.facebook.presto.tests.StructuralTestUtil.arrayBlockOf;
import static com.facebook.presto.tests.StructuralTestUtil.arrayBlocksEqual;
import static com.facebook.presto.tests.StructuralTestUtil.mapBlockOf;
import static com.facebook.presto.tests.StructuralTestUtil.mapBlocksEqual;
import static com.google.common.io.Files.createTempDir;
import static com.google.common.io.MoreFiles.deleteRecursively;
import static com.google.common.io.RecursiveDeleteOption.ALLOW_INSECURE;
import static io.airlift.slice.Slices.utf8Slice;
import static io.airlift.slice.Slices.wrappedBuffer;
import static java.util.Locale.ENGLISH;
import static java.util.concurrent.TimeUnit.NANOSECONDS;
import static org.joda.time.DateTimeZone.UTC;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;

public class TestShardWriter
{
    private File directory;

    private static final JsonCodec<OrcFileMetadata> METADATA_CODEC = jsonCodec(OrcFileMetadata.class);

    @DataProvider(name = "useOptimizedOrcWriter")
    public static Object[][] useOptimizedOrcWriter()
    {
        return new Object[][] {{true}, {false}};
    }

    @BeforeClass
    public void setup()
    {
        directory = createTempDir();
    }

    @AfterClass(alwaysRun = true)
    public void tearDown()
            throws Exception
    {
        deleteRecursively(directory.toPath(), ALLOW_INSECURE);
    }

    @Test(dataProvider = "useOptimizedOrcWriter")
    public void testWriter(boolean useOptimizedOrcWriter)
            throws Exception
    {
        TypeManager typeManager = new TypeRegistry();
        // associate typeManager with a function manager
        new FunctionManager(typeManager, new BlockEncodingManager(typeManager), new FeaturesConfig());

        List<Long> columnIds = ImmutableList.of(1L, 2L, 4L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L);
        ArrayType arrayType = new ArrayType(BIGINT);
        ArrayType arrayOfArrayType = new ArrayType(arrayType);
        Type mapType = typeManager.getParameterizedType(StandardTypes.MAP, ImmutableList.of(
                TypeSignatureParameter.of(createVarcharType(10).getTypeSignature()),
                TypeSignatureParameter.of(BOOLEAN.getTypeSignature())));
        List<Type> columnTypes = ImmutableList.of(BIGINT, createVarcharType(10), VARBINARY, DOUBLE, BOOLEAN, arrayType, mapType, arrayOfArrayType, TIMESTAMP, TIME, DATE);
        File file = new File(directory, System.nanoTime() + ".orc");

        byte[] bytes1 = octets(0x00, 0xFE, 0xFF);
        byte[] bytes3 = octets(0x01, 0x02, 0x19, 0x80);

        long timestampValue = sqlTimestampOf(2002, 4, 6, 7, 8, 9, 0, UTC, UTC_KEY, SESSION).getMillisUtc();
        long timeValue = new SqlTime(NANOSECONDS.toMillis(new DateTime(2004, 11, 29, 0, 0, 0, 0, UTC).toLocalTime().getMillisOfDay())).getMillis();
        DateTime date = new DateTime(2001, 11, 22, 0, 0, 0, 0, UTC);
        int dateValue = new SqlDate(Days.daysBetween(new DateTime(0, ISOChronology.getInstanceUTC()), date).getDays()).getDays();
        RowPagesBuilder rowPagesBuilder = RowPagesBuilder.rowPagesBuilder(columnTypes)
                .row(123L, "hello", wrappedBuffer(bytes1), 123.456, true, arrayBlockOf(BIGINT, 1, 2), mapBlockOf(createVarcharType(5), BOOLEAN, "k1", true), arrayBlockOf(arrayType, arrayBlockOf(BIGINT, 5)), timestampValue, timeValue, dateValue)
                .row(null, "world", null, Double.POSITIVE_INFINITY, null, arrayBlockOf(BIGINT, 3, null), mapBlockOf(createVarcharType(5), BOOLEAN, "k2", null), arrayBlockOf(arrayType, null, arrayBlockOf(BIGINT, 6, 7)), timestampValue, timeValue, dateValue)
                .row(456L, "bye \u2603", wrappedBuffer(bytes3), Double.NaN, false, arrayBlockOf(BIGINT), mapBlockOf(createVarcharType(5), BOOLEAN, "k3", false), arrayBlockOf(arrayType, arrayBlockOf(BIGINT)), timestampValue, timeValue, dateValue);

        try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(new EmptyClassLoader());
                FileWriter writer = createFileWriter(columnIds, columnTypes, file)) {
            writer.appendPages(rowPagesBuilder.build());
        }

        try (OrcDataSource dataSource = fileOrcDataSource(file)) {
            OrcBatchRecordReader reader = createReader(dataSource, columnIds, columnTypes);
            assertEquals(reader.getReaderRowCount(), 3);
            assertEquals(reader.getReaderPosition(), 0);
            assertEquals(reader.getFileRowCount(), reader.getReaderRowCount());
            assertEquals(reader.getFilePosition(), reader.getFilePosition());

            assertEquals(reader.nextBatch(), 3);
            assertEquals(reader.getReaderPosition(), 0);
            assertEquals(reader.getFilePosition(), reader.getFilePosition());

            Block column0 = reader.readBlock(0);
            assertEquals(column0.isNull(0), false);
            assertEquals(column0.isNull(1), true);
            assertEquals(column0.isNull(2), false);
            assertEquals(BIGINT.getLong(column0, 0), 123L);
            assertEquals(BIGINT.getLong(column0, 2), 456L);

            Block column1 = reader.readBlock(1);
            assertEquals(createVarcharType(10).getSlice(column1, 0), utf8Slice("hello"));
            assertEquals(createVarcharType(10).getSlice(column1, 1), utf8Slice("world"));
            assertEquals(createVarcharType(10).getSlice(column1, 2), utf8Slice("bye \u2603"));

            Block column2 = reader.readBlock(2);
            assertEquals(VARBINARY.getSlice(column2, 0), wrappedBuffer(bytes1));
            assertEquals(column2.isNull(1), true);
            assertEquals(VARBINARY.getSlice(column2, 2), wrappedBuffer(bytes3));

            Block column3 = reader.readBlock(3);
            assertEquals(column3.isNull(0), false);
            assertEquals(column3.isNull(1), false);
            assertEquals(column3.isNull(2), false);
            assertEquals(DOUBLE.getDouble(column3, 0), 123.456);
            assertEquals(DOUBLE.getDouble(column3, 1), Double.POSITIVE_INFINITY);
            assertEquals(DOUBLE.getDouble(column3, 2), Double.NaN);

            Block column4 = reader.readBlock(4);
            assertEquals(column4.isNull(0), false);
            assertEquals(column4.isNull(1), true);
            assertEquals(column4.isNull(2), false);
            assertEquals(BOOLEAN.getBoolean(column4, 0), true);
            assertEquals(BOOLEAN.getBoolean(column4, 2), false);

            Block column5 = reader.readBlock(5);
            assertEquals(column5.getPositionCount(), 3);

            assertTrue(arrayBlocksEqual(BIGINT, arrayType.getObject(column5, 0), arrayBlockOf(BIGINT, 1, 2)));
            assertTrue(arrayBlocksEqual(BIGINT, arrayType.getObject(column5, 1), arrayBlockOf(BIGINT, 3, null)));
            assertTrue(arrayBlocksEqual(BIGINT, arrayType.getObject(column5, 2), arrayBlockOf(BIGINT)));

            Block column6 = reader.readBlock(6);
            assertEquals(column6.getPositionCount(), 3);

            assertTrue(mapBlocksEqual(createVarcharType(5), BOOLEAN, arrayType.getObject(column6, 0), mapBlockOf(createVarcharType(5), BOOLEAN, "k1", true)));
            Block object = arrayType.getObject(column6, 1);
            Block k2 = mapBlockOf(createVarcharType(5), BOOLEAN, "k2", null);
            assertTrue(mapBlocksEqual(createVarcharType(5), BOOLEAN, object, k2));
            assertTrue(mapBlocksEqual(createVarcharType(5), BOOLEAN, arrayType.getObject(column6, 2), mapBlockOf(createVarcharType(5), BOOLEAN, "k3", false)));

            Block column7 = reader.readBlock(7);
            assertEquals(column7.getPositionCount(), 3);

            assertTrue(arrayBlocksEqual(arrayType, arrayOfArrayType.getObject(column7, 0), arrayBlockOf(arrayType, arrayBlockOf(BIGINT, 5))));
            assertTrue(arrayBlocksEqual(arrayType, arrayOfArrayType.getObject(column7, 1), arrayBlockOf(arrayType, null, arrayBlockOf(BIGINT, 6, 7))));
            assertTrue(arrayBlocksEqual(arrayType, arrayOfArrayType.getObject(column7, 2), arrayBlockOf(arrayType, arrayBlockOf(BIGINT))));

            Block column8 = reader.readBlock(8);
            assertEquals(TIMESTAMP.getLong(column8, 0), timestampValue);
            assertEquals(TIMESTAMP.getLong(column8, 1), timestampValue);
            assertEquals(TIMESTAMP.getLong(column8, 2), timestampValue);

            Block column9 = reader.readBlock(9);
            assertEquals(TIME.getLong(column9, 0), timeValue);
            assertEquals(TIME.getLong(column9, 1), timeValue);
            assertEquals(TIME.getLong(column9, 2), timeValue);

            Block column10 = reader.readBlock(10);
            assertEquals(DATE.getLong(column10, 0), dateValue);
            assertEquals(DATE.getLong(column10, 1), dateValue);
            assertEquals(DATE.getLong(column10, 2), dateValue);

            assertEquals(reader.nextBatch(), -1);
            assertEquals(reader.getReaderPosition(), 3);
            assertEquals(reader.getFilePosition(), reader.getFilePosition());

            OrcFileMetadata orcFileMetadata = METADATA_CODEC.fromJson(reader.getUserMetadata().get(OrcFileMetadata.KEY).getBytes());
            assertEquals(orcFileMetadata, new OrcFileMetadata(ImmutableMap.<Long, TypeSignature>builder()
                    .put(1L, BIGINT.getTypeSignature())
                    .put(2L, createVarcharType(10).getTypeSignature())
                    .put(4L, VARBINARY.getTypeSignature())
                    .put(6L, DOUBLE.getTypeSignature())
                    .put(7L, BOOLEAN.getTypeSignature())
                    .put(8L, arrayType.getTypeSignature())
                    .put(9L, mapType.getTypeSignature())
                    .put(10L, arrayOfArrayType.getTypeSignature())
                    .put(11L, TIMESTAMP.getTypeSignature())
                    .put(12L, TIME.getTypeSignature())
                    .put(13L, DATE.getTypeSignature())
                    .build()));
        }

        File crcFile = new File(file.getParentFile(), "." + file.getName() + ".crc");
        assertFalse(crcFile.exists());

        // Test unsupported types
        for (Type type : ImmutableList.of(TIMESTAMP_WITH_TIME_ZONE, RowType.anonymous(ImmutableList.of(BIGINT, DOUBLE)))) {
            try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(new EmptyClassLoader())) {
                createFileWriter(ImmutableList.of(1L), ImmutableList.of(type), file);
                fail();
            }
            catch (PrestoException e) {
                assertTrue(e.getMessage().toLowerCase(ENGLISH).contains("type"));
            }
        }
    }

    @SuppressWarnings("EmptyTryBlock")
    @Test
    public void testWriterZeroRows()
            throws Exception
    {
        List<Long> columnIds = ImmutableList.of(1L);
        List<Type> columnTypes = ImmutableList.of(BIGINT);

        File file = new File(directory, System.nanoTime() + ".orc");

        // optimized ORC writer will flush metadata on close
        try (FileWriter ignored = createFileWriter(columnIds, columnTypes, file)) {
            // no rows
        }

        try (OrcDataSource dataSource = fileOrcDataSource(file)) {
            OrcBatchRecordReader reader = createReader(dataSource, columnIds, columnTypes);
            assertEquals(reader.getReaderRowCount(), 0);
            assertEquals(reader.getReaderPosition(), 0);

            assertEquals(reader.nextBatch(), -1);
        }
    }

    @SuppressWarnings("EmptyClass")
    private static class EmptyClassLoader
            extends ClassLoader
    {
        protected EmptyClassLoader()
        {
            super(null);
        }
    }
}


text:
<?php

namespace Comparator\Bundle\BaseBundle\DependencyInjection;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;

/**
 * This is the class that loads and manages your bundle configuration
 *
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
 */
class ComparatorBaseExtension extends Extension
{
    /**
     * {@inheritdoc}
     */
    public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('services.yml');
    }
}


text:
New Post

        <form class="form-horizontal" data-ng-submit="create()" novalidate>
            <fieldset>

                    Title

                        <input type="text" data-ng-model="title" id="title" class="form-control" placeholder="Title" required>

                    Post

                        <input type="text" data-ng-model="post_body" id="post_body" class="form-control" placeholder="Post text" required>

                    <input type="submit" class="btn btn-default">

            </fieldset>
        </form>


text:
export default class Key {
  constructor(outputs, labels, { size = 1 } = {}) {
    if (labels === undefined || labels.length === 0) {
      labels = outputs;
    }

    // shift, non-shift
    this._labels = labels.slice().reverse();
    this._size = size;

    const [character, shiftChar] = outputs;
    this._char = character;
    this._shiftChar = shiftChar;
  }

  getValue({ shiftKey }) {
    return shiftKey ? this._shiftChar : this._char;
  }

  getLabels() {
    return this._labels.slice();
  }

  getSize() {
    return this._size;
  }

  isPrintable() {
    return this._char !== undefined;
  }
}


text:
// ----------------------------------------------------------------------------
#ifndef Main_Module_H
#define Main_Module_H
// ----------------------------------------------------------------------------

#include "iniParser.h"
#include "clUARFCN.h"
#include "common.h"
#include <stdlib.h>

#include <iostream>
#include <fstream>
#include <sstream>
#include <algorithm>
#include <string>

#include "Top_Module.h"
#include "TxLpf_Module.h"
#include "TxRf_Module.h"
#include "RxVGA2_Module.h"
#include "RxFe_Module.h"
#include "TxPLL_Module.h"
#include "ADDC_Module.h"
#include "TxRf_Module.h"
#include "RegisterTest.h"
#include "ADF_Module.h"

class ConnectionManager;
class Top_Module;
class TxLPF_Module;
class TxPLL_Module;
class TxPLL_Module;
class TxRf_Module;
class RxVGA2_Module;
class RxFe_Module;
class ADDC_Module;
class Board2_Module;
class ADF_Module;

class Si5351C;

enum eMessageLogCodes
{
	PROJECT_FILE_OPENED = 0,
	PROJECT_FILE_CREATED,
	PROJECT_FILE_SAVED_AS,
	PROJECT_FILE_SAVED,
	DEFAULT_CONFIG_LOADED,
	CONFIGURATION_SENT_TO_HARDWARE,
	PARALLEL_PORT_INITIALIZED,
	RESET_SIGNAL_ACTIVE,
	RESET_SIGNAL_INACTIVE,
	AUTOMATIC_DOWNLOAD_MODE,
	MANUAL_DOWNLOAD_MODE,
	SERIAL_PORT_INITIALIZED,
	SERIAL_PORT_NOT_ACCESSABLE
};

// ----------------------------------------------------------------------------
class Main_Module
{

public:
	static Main_Module *g_pMain;

	int StartMessagePump();
	int StopMessagePump();

	void (*updateInterfaceCallback)(int, char *);
	void UpdateInterface(int code, char *opt_Msg);

	Main_Module();
	~Main_Module();
	void initialize();

	void slLogMesg(int num);
	void slLogMesg(const char *msg);

	void FileNewExecute();
	void FileOpenExecute(string link);
	void FileSaveAs(string link);
	void FileSave();

	string getFileName();
	string getApplicationName();
	void getVerRevMask(int &ver, int &rev, int &mask);

	void setAutoDownload(bool state);
	bool getAutoDownload();
	void ReadConfiguration(string link);

	void Download();
	void LoadConfiguration(string sIniName);

	void setRefClk(double dRefClk_Hz);
	double getRefClk();

// ------------------------------------------------------------------------------
// Customer Interface
// ------------------------------------------------------------------------------
	void Cust_CalibrateTx();
	void Cust_CalibrateRx();
	void Cust_CalibrateRxTIA();

	void Cust_setLNASEL(int index);

	void Cust_setRxBypass(int index);
	void Cust_setTxBypass(int index);
	void Cust_setLoopback(int index);

	void Cust_setDLTXBand(int index);
	void Cust_setDLTXChannel(int index);

	void Cust_setULRXBand(int index);
	void Cust_setULRXChannel(int index);

	const string *Cust_getDLTXBands(int &count) const ;
	const string *Cust_getULRXBands(int &count) const ;
	const string *Cust_getDLTXChannels(int &count) const ;
	const string *Cust_getULRXChannels(int &count) const ;

	double Cust_getDLTXFreq()
	{
		return m_UARFCNDef.m_dDLTXFreq;
	};

	double Cust_getULRXFreq()
	{
		return m_UARFCNDef.m_dULRXFreq;
	};

	void CompareChipToGUI();
	void SaveRegisters(string link);
	void MatchGUIToChip();

	void CMLog(int LParam);
	void CMRead(int Wparam, int addr);
	void CMAutoDownload(char addr);
	void CMResetAct();
	void CMResetInAct();
	void CMADDC2LPF(int addr);
	void CMUpdateLNA(int LParam);
	void CMSoftTxPD(int LParam);

	void ShowMessage(string msg);

	void SaveRefClkToReg(double Freq);
	double ReadRefClkFromReg(void);

	void CalLPFCore();
	void SaveUnderRVF_Format(string link, int dec);
	// dec = 1 if format is decimal, dec = 0 if format is hexadecimal;
	void SaveUnderRFIF_Format(string link, int rfifParam);

	bool TestRegisters();
	bool TestRegistersTrial();
   	void EnableSPIClockByMask(int Mask);
	void EnableAllSPIClocks();
	void RestoreAllSPIClocks();
	void setCurrentFileName(string fileName);

	CUARFCN* getUARFCNdata();

	ConnectionManager *getSerPort() { return m_serPort;};
	Top_Module *getTop() { return m_TopModule;};
	TxPLL_Module *getTxPLL() {return m_TxPLLModule;};
	TxPLL_Module *getRxPLL() {return m_RxPLLModule;};
	TxLPF_Module *getTxLpf() {return m_TxLpfModule;};
	TxLPF_Module *getRxLpf() {return m_RxLpfModule;};
	TxRf_Module *getTxRf() {return m_TxRfModule;};
	RxVGA2_Module *getRxVga2() {return m_RxVga2Module;};
	RxFe_Module *getRxFe() {return m_RxFeModule;};
	ADDC_Module *getADDC() {return m_ADDCModule;};
	ADF_Module *getADF() { return m_ADFModule;};
	Si5351C *getSi5351C() { return m_Si5351CModule;};

	RegisterTest *dRegTest;
	TextLog messagesLog;

	void UpdateVerRevMask();
	void SetGPIO(unsigned int msb, unsigned int lsb, int value);
	unsigned char GetGPIO() {return m_GPIO;};

private:
    bool m_initialized;

	ConnectionManager *m_serPort;
	Top_Module *m_TopModule;
	TxPLL_Module *m_TxPLLModule;
	TxPLL_Module *m_RxPLLModule;
	TxLPF_Module *m_TxLpfModule;
	TxLPF_Module *m_RxLpfModule;
	TxRf_Module *m_TxRfModule;
	RxVGA2_Module *m_RxVga2Module;
	RxFe_Module *m_RxFeModule;
	ADDC_Module *m_ADDCModule;
	Board2_Module *m_Board2Module;
	ADF_Module *m_ADFModule;

	Si5351C *m_Si5351CModule;

	CUARFCN m_UARFCNDef;
	sPrData m_sInterPD; // Interprocess communication data

	char m_ver;
	char m_rev;
	char m_mask;

	bool autoDownload;
	string sbMain[2];

	string m_sFileName;
	string Caption; // application name

	int m_RFIFParam;

	void SetLnaChain(int iChain);
	void SetBypassLoopback();
	bool FileIsNotEmpty(string filename);
	void LoadAdditionalSettings();

	int m_iRefVCnt;
	double *m_dFVco1;
	double *m_dFVco2;
	double *m_dFVco3;
	double *m_dFVco4;
	int *m_iCVco1;
	int *m_iCVco2;
	int *m_iCVco3;
	int *m_iCVco4;

	// Reference clock MHz
	double m_RefClk;
	char cTempChar;

	// ---System fields-----
	SelectionContainer cmbLNASEL_Cust;
	SelectionContainer cmbRxBypass;
	SelectionContainer cmbTxBypass;
	SelectionContainer cmbLoopback;

	unsigned char m_GPIO;
};
// ----------------------------------------------------------------------------
#endif //Main_Module_H


text:
// Generated by dts-bundle v0.7.3-fork.1
// Dependencies for this module:
//   ../../../../../moment-timezone/builds/moment-timezone-with-data
//   ../../../../../@fullcalendar/core

declare module '@fullcalendar/moment-timezone' {
    import 'moment-timezone/builds/moment-timezone-with-data';
    const _default: import("@fullcalendar/core").PluginDef;
    export default _default;
}


text:
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>W28914_text</title>
        <link rel="stylesheet" type="text/css" href="style.css" />

                «

    <p class="styleSans8.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">CONFIDENTIAL: FILED AS A PART OF AN APD

    <p class="styleSans12.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">STATE OF NORTH DAKOTA§
§ COUNTY OF WARD §

    <p class="styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">AFFIDAVIT TO THE PUBLIC

    <p class="styleSans11.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Before me, the undersigned authority, on this day personally appeared Eric Rolli, as Facilities Engineering Team Lead for Hess Bakken Investments 1], LLC, with an address of 3015 16'h Street SW, #20, Minot, North Dakota 58701 ("Hess"), who, after being by me duly sworn,
upon oath states:
In conjunction with Hess' submission of the EN-VP & R Gas Capture Plan ("GCP") to the Oil and Gas Division of the North Dakota Industrial Commission, Hess representatives communicated with Nate Hagerott of Hess North Dakota Pipelines LLC (Gatherco) (the "Gas Gatherer") and provided Gas Gatherer with the anticipated completion dates and anticipated production rates of the following wells: EN-VP & R-154—94-2536H-1, EN-VP & R-154-942536H-2, EN-VP & R—lS4-94-2536I—l-3, EN-VP & R-154-94-2536H-4.

    <p class="styleSans17.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Executed this 9" day of My ,20/_Z

    <p class="styleSans4.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">
Eric Rolli

    <p class="styleSans36.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">SUBSCRIBED AND SWORN TO before me, the undersigned authog't'xA by Eric Rojli, as
6/ to: A.» 7a.: 4/for Hess Bakken Investments 11, LLC on this day of 2011.
// MA /

    <p class="styleSans65.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">
WHITNEY MONTONYE Notary Public State of North Dakota My Commission Expires December 9. 2019

    <p class="styleSans13.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">L/éZZ [ZW/ Notar ublic, State of W W


text:
using System;
using System.Collections.Generic;
using System.Text;
using Bagombo.EFCore;
using Bagombo.Models;

namespace Bagombo.tests
{
  public class SeedBlogDbContext
  {
    public static void SeedData(BlogDbContext _context)
    {
      // Seed the given context with data for unit testing

      Author JohnSmith = new Author()
      {
        ApplicationUserId = Guid.NewGuid().ToString(),
        FirstName = "John",
        LastName = "Smith",
        Biography = "Born someday",
      };

      Author JaneSmith = new Author()
      {
        ApplicationUserId = Guid.NewGuid().ToString(),
        FirstName = "Jane",
        LastName = "Smith",
        Biography = "Born some other day"
      };

      _context.Authors.Add(JohnSmith);
      _context.Authors.Add(JaneSmith);

      BlogPost bp1 = new BlogPost()
      {
        Author = JohnSmith,
        Title = "bp1",
        Description = "bp1 Description",
        Content = "bp 1 Content xyz123",
        CreatedAt = new DateTime(2017, 3, 30, 14, 20, 20),
        Public = true,
        ModifiedAt = DateTime.Now,
        PublishOn = new DateTime(2017, 4, 1, 0, 0, 0)
      };

      BlogPost bp2 = new BlogPost()
      {
        Author = JaneSmith,
        Title = "bp2",
        Description = "bp2 Description",
        Content = "bp 2 Content xyz123  zyx321",
        CreatedAt = new DateTime(2017, 3, 29, 14, 20, 20),
        Public = true,
        ModifiedAt = DateTime.Now,
        PublishOn = new DateTime(2017, 3, 30, 0, 0, 0)
      };

      BlogPost bp3 = new BlogPost()
      {
        Author = JaneSmith,
        Title = "bp3",
        Description = "bp3 Description",
        Content = "bp 3 Content xyz123  zyx321 abcdef",
        CreatedAt = new DateTime(2017, 3, 29, 14, 20, 20),
        Public = true,
        ModifiedAt = DateTime.Now,
        PublishOn = new DateTime(2017, 3, 30, 0, 0, 0)
      };

      _context.BlogPosts.Add(bp1);
      _context.BlogPosts.Add(bp2);
      _context.BlogPosts.Add(bp3);

      Topic f1 = new Topic()
      {
        Title = "Feature 1",
        Description = "Feature 1 Description"
      };

      Topic f2 = new Topic()
      {
        Title = "Feature 2",
        Description = "Feature 2 Description"
      };

      _context.Topics.Add(f1);
      _context.Topics.Add(f2);

      var bpfList = new List<BlogPostTopic>()
      {
        new BlogPostTopic()
        {
          BlogPost = bp1,
          Topic = f1
        },
        new BlogPostTopic()
        {
          BlogPost = bp1,
          Topic = f2
        },
        new BlogPostTopic()
        {
          BlogPost = bp2,
          Topic = f1
        },
        new BlogPostTopic()
        {
          BlogPost = bp3,
          Topic = f1
        }
      };

      _context.BlogPostTopic.AddRange(bpfList);

      Category c1 = new Category()
      {
        Name = "c1",
        Description = "c1 Description"
      };

      Category c2 = new Category()
      {
        Name = "c2",
        Description = "c2 Description"
      };

      Category c3 = new Category()
      {
        Name = "c3",
        Description = "c3 Description"
      };

      _context.Categories.Add(c1);
      _context.Categories.Add(c2);
      _context.Categories.Add(c3);

      var bpcList = new List<BlogPostCategory>()
      {
        new BlogPostCategory()
        {
          BlogPost = bp1,
          Category = c1
        },
        new BlogPostCategory()
        {
          BlogPost = bp1,
          Category = c2
        },
        new BlogPostCategory()
        {
          BlogPost = bp1,
          Category = c3
        },
        new BlogPostCategory()
        {
          BlogPost = bp2,
          Category = c2
        },
        new BlogPostCategory()
        {
          BlogPost = bp2,
          Category = c3
        },
        new BlogPostCategory()
        {
          BlogPost = bp3,
          Category = c3
        }
      };

      _context.BlogPostCategory.AddRange(bpcList);

      _context.SaveChanges();

    }
  }
}


text:
package com.scand.realmbrowser.breadcrumbs;

import java.lang.reflect.Field;

import io.realm.RealmObject;

/**
 * Created by amykh on 04.08.2015.
 */
public class StateHolder {
    private String caption;
    private RealmObject obj;
    private Field field;

    public StateHolder(String caption, RealmObject obj, Field field) {
        this.caption = caption;
        this.obj = obj;
        this.field = field;
    }

    public String getCaption() {
        return caption;
    }

    public Field getField() {
        return field;
    }

    public RealmObject getObject() {
        return obj;
    }
}


text:
package testPullUpGen.test19.expectedresult;

public abstract class S {

}


text:
package org.apache.camel.component.freemarker;

import java.net.URL;
import java.util.Map;

import freemarker.cache.NullCacheStorage;
import freemarker.cache.URLTemplateLoader;
import freemarker.template.Configuration;
import org.apache.camel.Endpoint;
import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.annotations.Component;
import org.apache.camel.support.DefaultComponent;
import org.apache.camel.support.ResourceHelper;
import org.apache.camel.util.ObjectHelper;

/**
 * Freemarker component.
 */
@Component("freemarker")
public class FreemarkerComponent extends DefaultComponent {

    @Metadata(label = "advanced")
    private Configuration configuration;
    private Configuration noCacheConfiguration;

    public FreemarkerComponent() {
    }

    @Override
    protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
        // should we use regular configuration or no cache (content cache is default true)
        Configuration config;
        String encoding = getAndRemoveParameter(parameters, "encoding", String.class);
        boolean cache = getAndRemoveParameter(parameters, "contentCache", Boolean.class, Boolean.TRUE);
        int templateUpdateDelay = getAndRemoveParameter(parameters, "templateUpdateDelay", Integer.class, 0);
        if (cache) {
            config = getConfiguration();
            if (templateUpdateDelay > 0) {
                config.setTemplateUpdateDelay(templateUpdateDelay);
            }
        } else {
            config = getNoCacheConfiguration();
        }

        FreemarkerEndpoint endpoint = new FreemarkerEndpoint(uri, this, remaining);
        if (ObjectHelper.isNotEmpty(encoding)) {
            endpoint.setEncoding(encoding);
        }
        endpoint.setContentCache(cache);
        endpoint.setConfiguration(config);
        endpoint.setTemplateUpdateDelay(templateUpdateDelay);

        // if its a http resource then append any remaining parameters and update the resource uri
        if (ResourceHelper.isHttpUri(remaining)) {
            remaining = ResourceHelper.appendParameters(remaining, parameters);
            endpoint.setResourceUri(remaining);
        }

        return endpoint;
    }

    public synchronized Configuration getConfiguration() {
        if (configuration == null) {
            configuration = new Configuration();
            configuration.setTemplateLoader(new URLTemplateLoader() {
                @Override
                protected URL getURL(String name) {
                    try {
                        return ResourceHelper.resolveMandatoryResourceAsUrl(getCamelContext().getClassResolver(), name);
                    } catch (Exception e) {
                        // freemarker prefers to ask for locale first (eg xxx_en_GB, xxX_en), and then fallback without locale
                        // so we should return null to signal the resource could not be found
                        return null;
                    }
                }
            });
        }
        return (Configuration) configuration.clone();
    }

    /**
     * To use an existing {@link freemarker.template.Configuration} instance as the configuration.
     */
    public void setConfiguration(Configuration configuration) {
        this.configuration = configuration;
    }

    private synchronized Configuration getNoCacheConfiguration() {
        if (noCacheConfiguration == null) {
            // create a clone of the regular configuration
            noCacheConfiguration = (Configuration) getConfiguration().clone();
            // set this one to not use cache
            noCacheConfiguration.setCacheStorage(new NullCacheStorage());
        }
        return noCacheConfiguration;
    }

}


text:
SET FOREIGN_KEY_CHECKS = 0;
SET GROUP_CONCAT_MAX_LEN=32768;

SET @tables = NULL;
SELECT GROUP_CONCAT('`', table_name, '`') INTO @tables
  FROM information_schema.tables
  WHERE table_schema = (SELECT DATABASE());
SELECT IFNULL(@tables,'dummy') INTO @tables;

SET @tables = CONCAT('DROP TABLE IF EXISTS ', @tables);
PREPARE stmt_table FROM @tables;
EXECUTE stmt_table;
DEALLOCATE PREPARE stmt_table;

SET @views = NULL;
SELECT GROUP_CONCAT('`', TABLE_NAME, '`') INTO @views
  FROM information_schema.views
  WHERE table_schema = (SELECT DATABASE());
SELECT IFNULL(@views,'dummy') INTO @views;

SET @views = CONCAT('DROP VIEW IF EXISTS ', @views);
PREPARE stmt_view FROM @views;
EXECUTE stmt_view;
DEALLOCATE PREPARE stmt_view;


text:
This library is deprecated in favor of `iOS 12` [CAGradientLayer](https://developer.apple.com/documentation/quartzcore/cagradientlayer) layer type [.conic](https://developer.apple.com/documentation/quartzcore/cagradientlayertype)

See [ConicSample project](ConicSample/) for `CAGradientLayer` examples ported from `AngleGradientLayer`.

[![cocoapods](https://img.shields.io/cocoapods/v/AngleGradientLayer.svg)](https://cocoapods.org/pods/AngleGradientLayer)

# AngleGradientLayer

**AngleGradientLayer** is a **CALayer** implementation of angle gradient.

![screenshot](https://github.com/paiv/AngleGradientLayer/raw/master/screenshot.png)

## Installing

```ruby
pod 'AngleGradientLayer', '~> 1.0'
```

## [Swift] Using in your code

```swift
import AngleGradientLayer

class MyView: UIView {

    override class func layerClass() -> AnyClass {
        return AngleGradientLayer.self
    }

    override init(frame: CGRect) {
        super.init(frame: frame)

        let l: AngleGradientLayer = self.layer as! AngleGradientLayer
        l.colors = [
            UIColor(red: 0, green: 0, blue: 0.5, alpha: 1).CGColor,
            UIColor(red: 1, green: 1, blue: 0.4, alpha: 1).CGColor]
    }
}
```

## [Objective-C] Using in your code

(See demo project for more.)

```objective-c
#import "AngleGradientLayer.h"

@interface MyView : UIView
@end

@implementation MyView

+ (Class)layerClass
{
	return [AngleGradientLayer class];
}

- (id)initWithFrame:(CGRect)frame
{
	if (!(self = [super initWithFrame:frame]))
		return nil;

	AngleGradientLayer *l = (AngleGradientLayer *)self.layer;
	l.colors = [NSArray arrayWithObjects:
		(id)[UIColor colorWithRed:0 green:0 blue:0.5 alpha:1].CGColor,
		(id)[UIColor colorWithRed:1 green:1 blue:0.4 alpha:1].CGColor,
		nil];

	return self;
}

@end
```

## Notes

When working with semi-transparent views, be sure to set `backgroundColor` property on the layer's view

```swift
myview.backgroundColor = UIColor.clearColor()
```

`backgroundColor` by default is `nil`, blending to black color.


text:
module Mongoid::Multitenancy::Sidekiq
  class Railtie < Rails::Railtie
    initializer "mongoid-multitenancy.sidekiq" do
      Mongoid::Multitenancy::Sidekiq::Middleware.run
    end
  end
end


text:
=head1 LICENSE

  Copyright (c) 1999-2011 The European Bioinformatics Institute and
  Genome Research Limited.  All rights reserved.

  This software is distributed under a modified Apache license.
  For license details, please see

    http://www.ensembl.org/info/about/code_licence.html

=head1 CONTACT

  Please email comments or questions to the public Ensembl
  developers list at <dev@ensembl.org>.

  Questions may also be sent to the Ensembl help desk at
  <helpdesk@ensembl.org>.

=cut

=head1 NAME

Bio::EnsEMBL::MiscSet - This is a set representing a classification of
a group of miscellaneuos features.

=head1 SYNOPSIS

  use Bio::EnsEMBL::MiscSet;

  my $misc_set = Bio::EnsEMBL::MiscSet->new(
    1234, $adaptor, 'tilepath',
    'Assembly Tiling Path',
    'The tiling path of clones', 1e6
  );

  my $misc_feature->add_set($misc_set);

=head1 DESCRIPTION

MiscSets represent classsifications or groupings of MiscFeatures.
Features are classified into sets essentially to define what they are
and how they may be used.  Generally MiscFeatures are retrieved on
the basis of their associated sets. See Bio::EnsEMBL::MiscFeature,
Bio::EnsEMBL::DBSQL::MiscFeatureAdaptor.

Note that MiscSets and MiscFeatures were formerly known as MapSets and
MapFrags

=head1 METHODS

=cut

package Bio::EnsEMBL::MiscSet;

use strict;

use Bio::EnsEMBL::Storable;
use Bio::EnsEMBL::Utils::Argument qw(rearrange);

use vars qw(@ISA);

@ISA = qw(Bio::EnsEMBL::Storable);

=head2 new

  Arg [1]    : int $misc_set_id
               The internal identifier for this misc set
  Arg [2]    : string $code
               The unique code which identifies this set type
  Arg [3]    : string $name
               The human readable name of this set
  Arg [4]    : string $desc
               The description of this set
  Arg [5]    : int $max_len
               The maximum length of features of this mapset
  Example    : $set = new Bio::EnsEMBL::MiscSet(1234, 'tilepath',
                                                'Assembly Tiling Path',
                                                'The tiling path of clones',
                                                1e6);
  Description: Instantiates a Bio::EnsEMBL::MiscSet
  Returntype : Bio::EnsEMBL::MiscSet
  Exceptions : none
  Caller     : MiscFeatureAdaptor
  Status     : Stable

=cut

sub new {
  my $caller = shift;

  my $class = ref($caller) || $caller;

  my $self = $class->SUPER::new(@_);

  my($code, $name, $desc, $max_len) =
    rearrange([qw(CODE NAME DESCRIPTION LONGEST_FEATURE)], @_);

  $self->{'code'} = $code;
  $self->{'name'} = $name;
  $self->{'description'} = $desc;
  $self->{'longest_feature'} = $max_len;

  return $self;
}

=head2 code

  Arg [1]    : string $newval (optional)
               The new value to set the code attribute to
  Example    : $code = $obj->code()
  Description: Getter/Setter for the code attribute
  Returntype : string
  Exceptions : none
  Caller     : general
  Status     : Stable

=cut

sub code{
  my $self = shift;
  $self->{'code'} = shift if(@_);
  return $self->{'code'};
}

=head2 name

  Arg [1]    : string $newval (optional)
               The new value to set the code attribute to
  Example    : $name = $obj->name()
  Description: Getter/Setter for the name attribute
  Returntype : string
  Exceptions : none
  Caller     : general
  Status     : Stable

=cut

sub name {
  my $self = shift;
  $self->{'name'} = shift if(@_);
  return $self->{'name'};
}

=head2 description

  Arg [1]    : string $newval (optional)
               The new value to set the description attribute to
  Example    : $description = $obj->description()
  Description: Getter/Setter for the description attribute
  Returntype : string
  Exceptions : none
  Caller     : general
  Status     : Stable

=cut

sub description{
  my $self = shift;
  $self->{'description'} = shift if(@_);
  return $self->{'description'};
}

=head2 longest_feature

  Arg [1]    : int $newval (optional)
               The new value to set the longest_feature attribute to
  Example    : $longest_feature = $obj->longest_feature()
  Description: Getter/Setter for the longest_feature attribute
  Returntype : int
  Exceptions : none
  Caller     : general
  Status     : Stable

=cut

sub longest_feature{
  my $self = shift;
  $self->{'longest_feature'} = shift if(@_);
  return $self->{'longest_feature'};
}

1;


text:
<!--
  Copyright 2014 Google Inc. All rights reserved.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

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

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/main_blue"
    android:orientation="vertical"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainActivity$PlaceholderFragment">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="3"
        android:paddingBottom="16dp">
    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="5"
        android:layout_gravity="bottom"
        android:gravity="bottom"
        android:src="@drawable/logo_splash"/>
    </LinearLayout>
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:text="@string/welcome_text"
        android:paddingLeft="48dp"
        android:textAppearance="@android:style/TextAppearance.Large"
        android:textColor="@color/white"
        android:paddingBottom="16dp"
        android:gravity="bottom"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="4"
        android:layout_gravity="top">

        <Button
            android:id="@+id/sign_in_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="2"
            android:background="@color/white"
            android:text="@string/sign_in_label"
            android:textColor="@color/main_blue" />
    </LinearLayout>

</LinearLayout>


text:
import { assert } from 'chai';

import { AbstractRule } from '../../src/rules/abstract-rule';
import { EndsWith } from '../../src/rules/ends-with';

describe('EndsWith', () => {

    it('is rule', () => {
        assert.instanceOf(new EndsWith('foo'), AbstractRule);
    });

    it('values is valid', () => {
        assert.isTrue(new EndsWith('foo').validate('Foo'));
        assert.isTrue(new EndsWith('foo', true).validate('foo'));
        assert.isTrue(new EndsWith('foo').validate('barbazFOO'));
        assert.isTrue(new EndsWith('foo').validate('barbazfoo'));
        assert.isTrue(new EndsWith('foo').validate('foobazfoo'));
        assert.isTrue(new EndsWith('foo').validate(['bar', 'foo']));
        assert.isTrue(new EndsWith('1').validate([3, 2, 1]));
        assert.isTrue(new EndsWith('1', true).validate([3 , 2, '1']));
        assert.isTrue(new EndsWith(1, true).validate([3, 2, 1]));
    });

    it('values is not valid', () => {
        assert.isFalse(new EndsWith('foo').validate(''));
        assert.isFalse(new EndsWith('bat').validate(['foo', 'bar']));
        assert.isFalse(new EndsWith('foo').validate('barfaabaz'));
        assert.isFalse(new EndsWith('foo', true).validate('FOObarbaz'));
        assert.isFalse(new EndsWith('foo').validate('faabarbaz'));
        assert.isFalse(new EndsWith('foo').validate('baabazfaa'));
        assert.isFalse(new EndsWith('foo').validate('baafoofaa'));
        assert.isFalse(new EndsWith('1', true).validate([3, 2, 1]));
        assert.isFalse(new EndsWith(1, true).validate([3, 2, '1']));
    });

});


text:
package firehose

import (
	"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol"
)

const (

	// ErrCodeConcurrentModificationException for service response error code
	// "ConcurrentModificationException".
	//
	// Another modification has already happened. Fetch VersionId again and use
	// it to update the destination.
	ErrCodeConcurrentModificationException = "ConcurrentModificationException"

	// ErrCodeInvalidArgumentException for service response error code
	// "InvalidArgumentException".
	//
	// The specified input parameter has a value that is not valid.
	ErrCodeInvalidArgumentException = "InvalidArgumentException"

	// ErrCodeInvalidKMSResourceException for service response error code
	// "InvalidKMSResourceException".
	//
	// Kinesis Data Firehose throws this exception when an attempt to put records
	// or to start or stop delivery stream encryption fails. This happens when the
	// KMS service throws one of the following exception types: AccessDeniedException,
	// InvalidStateException, DisabledException, or NotFoundException.
	ErrCodeInvalidKMSResourceException = "InvalidKMSResourceException"

	// ErrCodeLimitExceededException for service response error code
	// "LimitExceededException".
	//
	// You have already reached the limit for a requested resource.
	ErrCodeLimitExceededException = "LimitExceededException"

	// ErrCodeResourceInUseException for service response error code
	// "ResourceInUseException".
	//
	// The resource is already in use and not available for this operation.
	ErrCodeResourceInUseException = "ResourceInUseException"

	// ErrCodeResourceNotFoundException for service response error code
	// "ResourceNotFoundException".
	//
	// The specified resource could not be found.
	ErrCodeResourceNotFoundException = "ResourceNotFoundException"

	// ErrCodeServiceUnavailableException for service response error code
	// "ServiceUnavailableException".
	//
	// The service is unavailable. Back off and retry the operation. If you continue
	// to see the exception, throughput limits for the delivery stream may have
	// been exceeded. For more information about limits and how to request an increase,
	// see Amazon Kinesis Data Firehose Limits (https://docs.aws.amazon.com/firehose/latest/dev/limits.html).
	ErrCodeServiceUnavailableException = "ServiceUnavailableException"
)

var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{
	"ConcurrentModificationException": newErrorConcurrentModificationException,
	"InvalidArgumentException":        newErrorInvalidArgumentException,
	"InvalidKMSResourceException":     newErrorInvalidKMSResourceException,
	"LimitExceededException":          newErrorLimitExceededException,
	"ResourceInUseException":          newErrorResourceInUseException,
	"ResourceNotFoundException":       newErrorResourceNotFoundException,
	"ServiceUnavailableException":     newErrorServiceUnavailableException,
}


text:
package com.indentaCode.util.indentor.core;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

//import org.apache.regexp.RE;

public abstract class Indentor {

	protected int _numTabs = 0;
	protected String _pattern1 = null;
	protected String _pattern2 = null;

	public void format( String inputFile, String outputFile ) {

		try
		{
			this.format( new FileInputStream(inputFile), new FileOutputStream(outputFile) );
		}
		catch ( Exception e )
		{
			e.printStackTrace();
		}

	}

	public void format( FileInputStream inputFile, FileOutputStream outputFile ) {
		Pattern pattern1 = null;
		Pattern pattern2 = null;
//		RE regExp1 = null;
//		RE regExp2 = null;

		DataInputStream in = null;
		DataOutputStream out = null;

		String line = null;
		String tmpTabs = null;

		try {
			pattern1 = Pattern.compile(_pattern1);
			pattern2 = Pattern.compile(_pattern2);

//			regExp1 = new RE(_pattern1);
//			regExp2 = new RE(_pattern2);

			in = new DataInputStream(inputFile);
			out = new DataOutputStream(outputFile);

			while (in.available() != 0) {
				// TODO: change the way the lines are read
				line = in.readLine().trim() + "\n";
				Matcher matcher1 = pattern1.matcher(line);
				Matcher matcher2 = pattern2.matcher(line);

				if (matcher1.matches() && matcher2.matches()) {
					out.writeBytes((tmpTabs == null ? "" : tmpTabs) + line);
				}
				else if(matcher1.matches()) {
					out.writeBytes((tmpTabs == null ? "" : tmpTabs) + line);

					this._numTabs++;
					tmpTabs = addElimTabs();
				}
				else if(matcher2.matches()) {
					this._numTabs--;
					tmpTabs = addElimTabs();

					out.writeBytes((tmpTabs == null ? "" : tmpTabs) + line);
				}
				else {
					out.writeBytes((tmpTabs == null ? "" : tmpTabs) + line);
				}
			}
		}
		catch(Exception e) {
			System.out.println(e.getMessage() + " " + e.getCause() + " " + e.getClass());
		}
		finally {
			pattern1 = null;
			pattern2 = null;

			if (in != null){
				try {
					in.close();
				}
				catch (Exception e) {
					System.out.println(e.getMessage() + " " + e.getCause() + " " + e.getClass());
				}
			}

			if (out != null) {
				try {
					out.close();
				}
				catch(Exception e) {
					System.out.println(e.getMessage() + " " + e.getCause() + " " + e.getClass());
				}
			}
		}
	}

	private String addElimTabs(){
		String tmpString = "";

		for(int i = 0; i < _numTabs; i++) {
			tmpString += "\t";
		}

		return tmpString;
	}
}


text:
"use strict";

var $ = require('jquery'),
    _ = require('underscore'),
    Backbone = require('backbone'),
    models = require('../models'),
    utils = require('../utils'),
    BaseView = require('./base_view');

module.exports = BaseView.extend(require('./mixins/actions'), require('./mixins/form'), {
  template: require('../templates/project_list.ejs'),

  afterInit: function() {
    this.listenForChanges();
  },

  afterRender: function() {
    $('.selectize-target').selectize({
      highlight: false,
      onDropdownOpen: function(){
        utils.fixSelectizeInputSizing($('.selectize-target'), $('.selectize-dropdown-content'));
      }
    });
  },

  listenForChanges: function() {
    this.listenTo(this.app.listener, 'change:project',
                  this.updateStatus, this);
  },

  stopListeningForChanges: function() {
    this.stopListening(this.app.listener);
  },

  updateStatus: function(data) {
    var model = this.collection.get(data.id);
    if ( model ) {
      model.set('status', data.status);
      this.render();
    }
  }
} );


text:
module ChatBot
  class Dialog < ActiveRecord::Base
    extend FriendlyId

    friendly_id :dialog_code, use: [:slugged, :history]

    def dialog_code
      code.gsub('.', '_').to_url
    end

    RESPONSE_TYPES = { 'ch' => 'Choice', 'cnt' => 'Botcontinue',
                       'slt' => 'Single line text', 'mlt' => 'Multi line text',
                       'ddw' => 'Dropdown', 'date' => 'Date', 'attach' => 'Attach'}

    MESSAGE_TYPES = { 'txt' => 'TEXT', 'utube' => 'VIDEO:YOUTUBE',
                      'vimeo' => 'VIDEO:VIMEO', 'link' => 'LINK', 'img' => 'IMAGE'}

    has_many :options, class_name: 'ChatBot::Option', inverse_of: :dialog
    belongs_to :sub_category, class_name: 'ChatBot::SubCategory'

    attr_accessor :parent_dialog_code

    validates :message, presence: true
    validates :user_input_type, inclusion: RESPONSE_TYPES.keys
    validates :message_type, inclusion: MESSAGE_TYPES.keys
    validates :sub_category, presence: true
    validates :repeat_limit, numericality: {only_integer: true, greater_than: -1}

    validates_associated :sub_category

    before_validation :set_dialog_code, on: :create

    ## Class methods
    def self.generate_code(for_code = nil)
      if for_code.present?
        match_number = for_code.match(/^T(\d*)(\.(\d*))?$/)

        base, precision = match_number[1].to_i, match_number[3]
        precision = precision.to_i if precision.present? # We don't want nil or '' to convert to 0
        existing_codes = all.collect(&:code)

        # Logic will work as follows:
        # if for_code is T123.45 will return
        #   T124 if doesn't exists
        #   otherwise will return T123.46 if doens't exists
        #   otherwise will return T123.451 or T123.452 or T123.452... and so on

        case true
        when !existing_codes.include?("T#{base+1}")
          return "T#{base+1}"
        when (precision.present? and !existing_codes.include?("T#{base}.#{precision+1}"))
          return "T#{base}.#{precision+1}"
        else
          next_precision = "#{precision}1".to_i
          loop do
            next_code = "T#{base}.#{next_precision}"
            return next_code if !existing_codes.include?(next_code)
            next_precision += 1
          end
        end
      else
        "T#{all.collect{|d| d.code.split('.').first.gsub('T', '').to_i}.sort.last.to_i + 1}"
      end
    end

    ## Object methods
    def set_dialog_code
      self.code = Dialog.generate_code(parent_dialog_code) if code.nil?
    end

    def data_attributes
      { id: slug, message: message,
        user_input_type: user_input_type,
        formatted_message: formatted_message,
        options: options.collect{|option|
          {id: option.id, name: option.name}
        }
      }
    end

    def formatted_message
      case message_type
      when 'utube'
        ""
      when 'vimeo'
        ""
      when 'link'
        "Click here."
      when 'img'
        ""
      else
        message
      end
    end

  end
end