text:
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
	license agreements. See the NOTICE file distributed with this work for additional
	information regarding copyright ownership. The ASF licenses this file to
	you 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. -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

	<modelVersion>4.0.0</modelVersion>
	<parent>
        <groupId>org.apache.felix</groupId>
        <artifactId>felix-parent</artifactId>
        <version>2.1</version>
		<relativePath>../../../pom/pom.xml</relativePath>
	</parent>

	<artifactId>org.apache.felix.webconsole.plugins.gogo</artifactId>
	<packaging>bundle</packaging>
	<version>0.0.1-SNAPSHOT</version>

	<name>Apache Felix Web Gogo Shell Plugin</name>
	<description>
        This is a plugin for the Apache Felix OSGi web console that provides access to Gogo shell commands.
    </description>

    <properties>
        <dollar>$</dollar>
    </properties>

	<scm>
		<connection>scm:svn:http://svn.apache.org/repos/asf/felix/trunk/webconsole-plugins/gogo</connection>
		<developerConnection>scm:svn:https://svn.apache.org/repos/asf/felix/trunk/webconsole-plugins/gogo</developerConnection>
		<url>http://svn.apache.org/viewvc/felix/trunk/webconsole-plugins/gogo</url>
	</scm>

	<build>
		<plugins>
			<!-- translate UTF-8 encoded properties files to ISO-8859-1 -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>native2ascii-maven-plugin</artifactId>
                <version>1.0-beta-1</version>
				<executions>
					<execution>
						<goals>
							<goal>native2ascii</goal>
						</goals>
						<configuration>
							<encoding>UTF-8</encoding>
						</configuration>
					</execution>
				</executions>
			</plugin>

            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>

			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<version>2.3.6</version>
				<extensions>true</extensions>
				<configuration>
					<instructions>
						<Bundle-SymbolicName>
							${project.artifactId}
                        </Bundle-SymbolicName>
						<Bundle-Activator>
							org.apache.felix.webconsole.plugins.gogo.impl.Activator
                        </Bundle-Activator>
                        <Embed-Dependency>
                            jline;inline=true
                        </Embed-Dependency>
                        <Bundle-NativeCode>
                            META-INF/native/windows32/jansi.dll;osname=Win32;processor=x86,
                            META-INF/native/windows64/jansi.dll;osname=Win32;processor=x86-64,
                            <!--
                            META-INF/native/linux32/libjansi.so;osname=Linux;processor=x86,
                            META-INF/native/linux64/libjansi.so;osname=Linux;processor=x86-64,
                            META-INF/native/osx/libjansi.jnilib;osname=MacOSX,
                            -->
                            *
                        </Bundle-NativeCode>
					</instructions>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<dependencies>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.gogo.runtime</artifactId>
            <version>0.6.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
            <version>4.0.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.compendium</artifactId>
            <version>4.0.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.webconsole</artifactId>
            <version>3.0.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.3</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.sonatype.jline</groupId>
            <artifactId>jline</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>
 	</dependencies>
</project>


text:
package pages;

import org.openqa.selenium.WebDriver;

public class AbstractPage {

	protected WebDriver driver;

	public AbstractPage (WebDriver driver) {
	this.driver = driver;
	}

	public void setupTest() {
		driver.manage().window().maximize();
		driver.manage().deleteAllCookies();
		driver.get("http://live.guru99.com");
	}

	public void cleanupTest() {
	    driver.quit();
	}

}

redpajama_set_name: RedPajamaGithub


text:
package com.snowvsman.towers;

import com.mhframework.platform.MHPlatform;
import com.mhframework.platform.graphics.MHBitmapImage;
import com.mhframework.resources.MHResourceManager;

public class SVMTowerBase
{
	private static MHBitmapImage images[] = null;
	private int towerClass;
	private double damageModifier;
	private double attackRateModifier;

	public SVMTowerBase()
	{
		damageModifier = 1.0;
		attackRateModifier = 1.0;
		towerClass = 1;

		if (images == null)
		{
			images = new MHBitmapImage[4];
			images[0] = MHResourceManager.getInstance().getImage(MHPlatform.getAssetsDirectory() + "images/Shadow.png");//MHPlatform.createImage(MHPlatform.getAssetsDirectory() + "images/Shadow.png");
			images[1] = MHResourceManager.getInstance().getImage(MHPlatform.getAssetsDirectory() + "images/Base1.png");//MHPlatform.createImage(MHPlatform.getAssetsDirectory() + "images/Base1.png");
		}

	}

	public void upgrade()
	{
		if (towerClass < 3)
			towerClass++;
		else
			towerClass = 3;

		switch(towerClass)
		{
		case 3:
			damageModifier = 2.0;
			attackRateModifier = 0.5;
			break;
		case 2:
			damageModifier = 1.5;
			attackRateModifier = 0.75;
			break;
		default:
			break;
		}
	}

	public int getTowerClass() {
		return towerClass;
	}

	public double getDamageModifier() {
		return damageModifier;
	}

	public double getAttackRateModifier() {
		return attackRateModifier;
	}

	public MHBitmapImage getShadowImage()
	{
		return images[0];
	}

	public MHBitmapImage getImage()
	{
		return images[towerClass];
	}
}


text:
import Promise from 'bluebird'
import { notebookDao, uniqueError } from '../models'
import crypto from 'crypto'
import uuid from 'node-uuid'
import _ from 'lodash'
import * as Tools from '../common/tools'
import * as CODE from '../error'
import moment from 'moment'
import * as syncdataProxy from './syncdata'
import * as deleteProxy from './delete'
import mongoose from 'mongoose'
//import { notebookProxy } from '../../proxys'

// 创建一条数据
export const create = info => {
  return new Promise( (resolve, reject) => {
    notebookDao.create(info, (err, doc) => {
      if (err) {
        reject(err)
      }
      else {
        resolve(doc)
      }
    })
  })
}

// 查询单条数据
export const findOne = info => {
  return new Promise( (resolve, reject) => {
    notebookDao.one(info, (err, doc) => {
      if (err) {
        reject(err)
      }
      else {
        resolve(doc)
      }
    })
  })
}

// 按条件删除数据
export function remove (query) {
  return new Promise( (resolve, reject) => {
    notebookDao.delete(query, err => {
      if (err) {
        reject(err)
      }
      else {
        resolve(null)
      }
    })
  })
}

// 删除所有数据
export const removeAll = () => {
  return new Promise( (resolve, reject) => {
    notebookDao.deleteAll( err => {
      if (err) {
        reject(err)
      }
      else {
        resolve(null)
      }
    })
  })
}

// 查询多条数据
export const find = (query, populate = { path: '' }, fields = null, sort = { _id: -1 }, limit = 0, skip = 0) => {
  return new Promise( (resolve, reject) => {
    notebookDao.model.find(query)
      .populate(populate)
      .select(fields)
      .sort(sort)
      .limit(limit)
      .skip(skip)
      .exec( (err, doc) => {
        if (err) {
          reject(err)
        }
        else {
          resolve(doc)
        }
      })
  })
}

// 更新单条数据
function updateOne (query, info) {
  return new Promise( (resolve, reject) => {
    notebookDao.updateOne(query, info, (err, doc) => {
      if (err) {
        reject(err)
      }
      else {
        resolve(doc)
      }
    })
  })
}

// 创建新笔记本
export const addNoteBook = info => {
  return findOne(info)
    .then( doc => {
      if (doc) {
        let e = new Error(Tools.errInfo(CODE.ERROR_NOTEBOOK_UNIQUE).message)
        e.code = CODE.ERROR_NOTEBOOK_UNIQUE
        throw e
      }
      return syncdataProxy.getSyncInfo(info.user)
    })
    .then( doc => {
      let updateCount = doc.updateCount + 1
      return create({ ...info, usn: updateCount })
    })
    .then( doc => {
      return syncdataProxy.setSyncInfo(info.user, doc)
    })
    .then( doc => _.pick(doc, ['_id', 'name', 'create_at', 'update_at']))
}

// 修改笔记本
export const editNoteBook = (id, info, user) => {
  let _doc = null
  let updateAt
  return findOne({ name: info.name, _id: { $ne: id }, user: user})
    .then( doc => {
      if (doc) {
        let e = new Error(Tools.errInfo(CODE.ERROR_NOTEBOOK_UNIQUE).message)
        e.code = CODE.ERROR_NOTEBOOK_UNIQUE
        throw e
      }
      return findOne({ _id: id })
    })
    .then( doc => {
      let e
      if (!doc) {
        e = new Error(Tools.errInfo(CODE.ERROR_NOTEBOOK_MARKUP).message)
        e.code = CODE.ERROR_NOTEBOOK_MARKUP
        throw e
      }
      if (doc.user.toString() !== user.toString()) {
        e = new Error(Tools.errInfo(CODE.ERROR_NOTEBOOK_USER).message)
        e.code = CODE.ERROR_NOTEBOOK_USER
        throw e
      }
      _doc = doc
      return syncdataProxy.getSyncInfo(user)
    })
    .then( doc => {
      let updateCount = doc.updateCount + 1
      updateAt = moment().format()
      return updateOne({ _id: id }, { ...info, usn: updateCount, update_at: updateAt })
    })
    .then( doc => {
      return syncdataProxy.setSyncInfo(user, _doc)
    })
    .then( doc => {
      let e = Object.assign(doc, info, { update_at: updateAt })
      return _.pick(e, ['_id', 'name', 'create_at', 'update_at'])
    })
}

// 删除笔记本
export const deleteByIds = (uid, ids = []) => {
  return remove({ user: uid, _id: { $in: ids }})
    .then( () => {
      return deleteProxy.setSyncData(uid, 'notebook', ids)
    })
    .then( () => {
      return syncdataProxy.setSyncInfo(uid)
    })
}

// 获取笔记本列表
export const noteBookList = (query, populate = null, fields = null, sort = { _id: -1 }, limit = 0, skip = 0) => {
  populate = populate ? populate : { path: '' }
  return find(query, populate, fields, sort, limit, skip)
}

// 获取完全同步数据
export const fullSyncData = (user) => {
  return noteBookList({ user: user }, null, { _id: 1, name: 1, create_at: 1, update_at: 1 })
}

// 获取增量同步数据
export const increaseSyncData = (user, usn) => {
  let info = {}
  return noteBookList({ user: user, usn: { $gt: usn } }, null, { _id: 1, name: 1, create_at: 1, update_at: 1 })
    .then( doc => {
      info.result = doc
      return deleteProxy.getSyncData({ user: user, related_table: 'notebook', usn: { $gt: usn } })
    })
    .then( doc => {
      let deleteIds = _.uniq(_.flatten(_.map(doc, 'related_id')))
      return { ...info, delete: deleteIds }
    })
}

// 大批量更新
export const batchUpdate = (data, uid) => {
  let operations = []
  let { payload, updateCount } = data
  let times = moment().format()
  payload = payload || []
  updateCount = updateCount + 1
  for (let item of payload) {
    let oneInc
    if (item.serverId && item.serverId.length == 24) {
      oneInc = {
        updateOne: {
          filter: { _id: mongoose.Types.ObjectId(item.serverId) },
          update: {
            $set: {
              name: item.name,
              update_at: times,
              usn: updateCount
            }
          }
        },
      }
    }
    else {
      oneInc = {
        insertOne: {
          document: {
            name: item.name,
            user: uid,
            create_at: times,
            update_at: times,
            usn: updateCount
          }
        }
      }
    }
    operations.push(oneInc)
  }
  if (operations.length === 0) {
    return null
  }
  return bulkWrite(operations)
    .then( doc => {
      let { insertedIds, upsertedIds } = doc
      return { ...insertedIds, ...upsertedIds}
    })
    .then( doc => {
      let info = []
      for (let i = 0; i < payload.length; i++) {
        let opts = payload[i].serverId == '' ? { serverId: doc[i], createAt: times } : null
        info[i] = {
          ...payload[i],
          ...opts,
          updateAt: times,
          is_sync: false
        }
      }
      return info
    })
}

// 集合操作
export const bulkWrite = (payload) => {
  return new Promise( (resolve, reject) => {
    notebookDao.model.collection.bulkWrite(payload, (err, doc) => {
      if (err) {
        reject(err)
      }
      else {
        resolve(doc)
      }
    })
  })
}


text:
import {CommonSignals} from './common-signals';
import {Services} from './services';
import {
  createElementWithAttributes,
  removeElement,
} from './dom';
import {devAssert} from './log';
import {dict} from './utils/object';
import {isArray, toWin} from './types';
import {triggerAnalyticsEvent} from './analytics';

/**
 * Method to create scoped analytics element for any element.
 * TODO: Make this function private
 * @param {!Element} parentElement
 * @param {!JsonObject} config
 * @param {boolean=} loadAnalytics
 * @param {boolean=} disableImmediate
 * @return {!Element} created analytics element
 */
export function insertAnalyticsElement(
  parentElement, config, loadAnalytics = false, disableImmediate = false) {
  const doc = /** @type {!Document} */ (parentElement.ownerDocument);
  const analyticsElem = createElementWithAttributes(
      doc,
      'amp-analytics', dict({
        'sandbox': 'true',
        'trigger': disableImmediate ? '' : 'immediate',
      }));
  const scriptElem = createElementWithAttributes(
      doc,
      'script', dict({
        'type': 'application/json',
      }));
  scriptElem.textContent = JSON.stringify(config);
  analyticsElem.appendChild(scriptElem);
  analyticsElem.CONFIG = config;

  // Force load analytics extension if script not included in page.
  if (loadAnalytics) {
    // Get Extensions service and force load analytics extension.
    const extensions =
        Services.extensionsFor(toWin(parentElement.ownerDocument.defaultView));
    const ampdoc = Services.ampdoc(parentElement);
    extensions./*OK*/installExtensionForDoc(ampdoc, 'amp-analytics');
  } else {
    Services.analyticsForDocOrNull(parentElement).then(analytics => {
      devAssert(analytics);
    });
  }
  parentElement.appendChild(analyticsElem);
  return analyticsElem;
}

/**
 * A class that handles customEvent reporting of extension element through
 * amp-analytics. This class is not exposed to extension element directly to
 * restrict the genration of the config Please use CustomEventReporterBuilder to
 * build a CustomEventReporter instance.
 */
class CustomEventReporter {
  /**
   * @param {!Element} parent
   * @param {!JsonObject} config
   */
  constructor(parent, config) {
    devAssert(config['triggers'], 'Config must have triggers defined');
    /** @private {string} */
    this.id_ = parent.getResourceId();

    /** @private {!AmpElement} */
    this.parent_ = parent;

    /** @private {JsonObject} */
    this.config_ = config;

    for (const event in config['triggers']) {
      const eventType = config['triggers'][event]['on'];
      devAssert(eventType,
          'CustomEventReporter config must specify trigger eventType');
      const newEventType = this.getEventTypeInSandbox_(eventType);
      config['triggers'][event]['on'] = newEventType;
    }

    this.parent_.signals().whenSignal(CommonSignals.LOAD_START).then(() => {
      insertAnalyticsElement(this.parent_, config, true);
    });
  }

  /**
   * @param {string} eventType
   * @param {!JsonObject=} opt_vars A map of vars and their values.
   */
  trigger(eventType, opt_vars) {
    devAssert(this.config_['triggers'][eventType],
        'Cannot trigger non initiated eventType');
    triggerAnalyticsEvent(this.parent_,
        this.getEventTypeInSandbox_(eventType), opt_vars);
  }
  /**
   * @param {string} eventType
   * @return {string}
   */
  getEventTypeInSandbox_(eventType) {
    return `sandbox-${this.id_}-${eventType}`;
  }
}

/**
 * A builder class that enable extension elements to easily build and get a
 * CustomEventReporter instance. Its constructor requires the parent AMP
 * element. It provides two methods #track() and #build() to build the
 * CustomEventReporter instance.
 */
export class CustomEventReporterBuilder {
  /** @param {!AmpElement} parent */
  constructor(parent) {

    /** @private {!AmpElement} */
    this.parent_ = parent;

    /** @private {?JsonObject} */
    this.config_ = /** @type {JsonObject} */ ({
      'requests': {},
      'triggers': {},
    });
  }

  /**
   * @param {!JsonObject} transportConfig
   */
  setTransportConfig(transportConfig) {
    this.config_['transport'] = transportConfig;
  }

  /**
   * The #track() method takes in a unique custom-event name, and the
   * corresponding request url (or an array of request urls). One can call
   * #track() multiple times with different eventType name (order doesn't
   * matter) before #build() is called.
   * @param {string} eventType
   * @param {string|!Array<string>} request
   */
  track(eventType, request) {
    request = isArray(request) ? request : [request];
    devAssert(!this.config_['triggers'][eventType],
        'customEventReporterBuilder should not track same eventType twice');
    const requestList = [];
    for (let i = 0; i < request.length; i++) {
      const requestName = `${eventType}-request-${i}`;
      this.config_['requests'][requestName] = request[i];
      requestList.push(requestName);
    }
    this.config_['triggers'][eventType] = {
      'on': eventType,
      'request': requestList,
    };
    return this;
  }

  /**
   * Call the #build() method to build and get the CustomEventReporter instance.
   * One CustomEventReporterBuilder instance can only build one reporter, which
   * means #build() should only be called once after all eventType are added.
   */
  build() {
    devAssert(this.config_, 'CustomEventReporter already built');
    const report = new CustomEventReporter(
        this.parent_, /** @type {!JsonObject} */ (this.config_));
    this.config_ = null;
    return report;
  }
}

/**
 * A helper method that should be used by all extension elements to add their
 * sandbox analytics tracking. This method takes care of insert and remove the
 * analytics tracker at the right time of the element lifecycle.
 * @param {!AmpElement} element
 * @param {!Promise<!JsonObject>} promise
 */
export function useAnalyticsInSandbox(element, promise) {
  let analyticsElement = null;
  let configPromise = promise;
  // Listener to LOAD_START signal. Insert analytics element on LOAD_START
  element.signals().whenSignal(CommonSignals.LOAD_START).then(() => {
    if (analyticsElement || !configPromise) {
      return;
    }
    configPromise.then(config => {
      if (!configPromise) {
        // If config promise resolve after unload, do nothing.
        return;
      }
      configPromise = null;
      analyticsElement = insertAnalyticsElement(element, config, false);
    });
  });

  // Listener to UNLOAD signal. Destroy remove element on UNLOAD
  element.signals().whenSignal(CommonSignals.UNLOAD).then(() => {
    configPromise = null;
    if (analyticsElement) {
      removeElement(analyticsElement);
      analyticsElement = null;
    }
  });
}


text:
<?php

use GuzzleHttp\Message\RequestInterface;
use GuzzleHttp\Message\ResponseInterface;
use GuzzleHttp\ClientInterface;
use GuzzleHttp\Exception\RequestException;

/**
 * This class implements the RESTful transport of apiServiceRequest()'s
 */
class Google_Http_REST
{
  /**
   * Executes a GuzzleHttp\Message\Request and (if applicable) automatically retries
   * when errors occur.
   *
   * @param Google_Client $client
   * @param GuzzleHttp\Message\Request $req
   * @return array decoded result
   * @throws Google_Service_Exception on server side error (ie: not authenticated,
   *  invalid or malformed post body, invalid url)
   */
  public static function execute(
      ClientInterface $client,
      RequestInterface $request,
      $config = array(),
      $retryMap = null
  ) {
    $runner = new Google_Task_Runner(
        $config,
        sprintf('%s %s', $request->getMethod(), $request->getUrl()),
        array(get_class(), 'doExecute'),
        array($client, $request)
    );

    if (!is_null($retryMap)) {
      $runner->setRetryMap($retryMap);
    }

    return $runner->run();
  }

  /**
   * Executes a GuzzleHttp\Message\RequestInterface
   *
   * @param Google_Client $client
   * @param GuzzleHttp\Message\RequestInterface $request
   * @return array decoded result
   * @throws Google_Service_Exception on server side error (ie: not authenticated,
   *  invalid or malformed post body, invalid url)
   */
  public static function doExecute(ClientInterface $client, RequestInterface $request)
  {
    try {
      $response = $client->send($request);
    } catch (RequestException $e) {
      // if Guzzle throws an exception, catch it and handle the response
      if (!$e->hasResponse()) {
        throw $e;
      }
      $response = $e->getResponse();
    }

    return self::decodeHttpResponse($response, $request);
  }

  /**
   * Decode an HTTP Response.
   * @static
   * @throws Google_Service_Exception
   * @param GuzzleHttp\Message\RequestInterface $response The http response to be decoded.
   * @param GuzzleHttp\Message\ResponseInterface $response
   * @return mixed|null
   */
  public static function decodeHttpResponse(
      ResponseInterface $response,
      RequestInterface $request = null
  ) {
    $body = (string) $response->getBody();
    $code = $response->getStatusCode();

    // retry strategy
    if ((intVal($code)) >= 300) {
      $errors = null;
      $result = $response->json();
      // Specific check for APIs which don't return error details, such as Blogger.
      if (isset($result['error']) && isset($result['error']['errors'])) {
        $errors = $result['error']['errors'];
      }
      throw new Google_Service_Exception($body, $code, null, $errors);
    }

    // return raw response when "alt" is "media"
    if ($request && $request->getQuery()->get('alt') == 'media') {
      return $body;
    }

    return $response->json();
  }
}


text:
module Quantify
  module Mongoid

    class UnitValidator < ActiveModel::EachValidator

      def check_validity!
        raise ArgumentError.new("You can specify either :units or :dimension but not both") if options[:units].present? && options[:dimension].present?
      end

      def validate_each(document, attribute, value)
        begin
          unit = Unit.for(value)
          if options[:units].present?
            if unit == nil
              document.errors.add(attribute, :invalid, options)
            else
              document.errors.add(attribute, :invalid, options) unless options[:units].include?(unit.label.to_s)
            end
          end

          if options[:dimension].present?
            if unit == nil
              document.errors.add(attribute, :invalid, options)
            else
              document.errors.add(attribute, :invalid, options) unless unit.measures == options[:dimension]
            end
          end

        rescue Quantify::Exceptions::InvalidUnitError
          document.errors.add(attribute, :invalid, options)
        end
      end

    end
  end
end


text:
package com.farmgeek.iTogether.models;

import com.estimote.sdk.Beacon;
import com.estimote.sdk.Region;
import com.estimote.sdk.Utils;

/**
 * Created by john on 25/04/2014.
 */
public class User {

    // Y positions are relative to height of bg_distance image.
    private static final double RELATIVE_START_POS = 320.0 / 1110.0;
    private static final double RELATIVE_STOP_POS  = 885.0 / 1110.0;

    private Beacon _beacon = null;
    private Region _region = null;
    private String _name = "";
    private int _major = 0;
    private int _minor = 0;
    private String _uuid = "";
    private double _distance = 0.00;

    public User(Beacon beacon, Region region) {
        this._beacon = beacon;
        this._name   = beacon.getName();
        this._uuid   = "" + this._major + ":" + this._minor;
    }

    /**
     * setName
     * @param name
     */
    public void setName(String name) {
        this._name = name;
    }

    /**
     * setRegion
     * @param region
     */
    public void setRegion(Region region) {
        this._region = region;
    }

    /**
     * setUUID
     * @param String
     */
    public void setRegion(String uuid) {
        this._uuid = uuid;
    }

    public String get_uuid() {
        return this._uuid;
    }

    /**
     * getDistance
     *
     * @return double The distance
     */
    public double get_distance() {
        // Let's put dot at the end of the scale when it's further than 6m.
        this._distance = Math.min(Utils.computeAccuracy(this._beacon), 6.0);
        return this._distance;
    }

}


text:
Sequel.migration do
  up do
    create_table(:groups) do
      primary_key :id
      String :name, :size=>255
      Integer :is_admin
      Integer :create_posts
      Integer :edit_posts
      Integer :delete_posts
    end

    create_table(:posts) do
      primary_key :id
      String :title, :size=>255
      String :slug, :size=>255
      String :body, :text=>true
      Integer :user_id
      Integer :published_at
      Integer :created_at
      Integer :updated_at, :default=>0
    end

    create_table(:settings) do
      String :setting, :size=>255
      String :value, :text=>true
    end

    create_table(:users) do
      primary_key :id
      String :username, :size=>255
      String :password, :size=>255
      String :email, :size=>255
      String :group_id, :size=>255
    end
  end

  down do
    drop_table(:groups, :posts, :schema_info, :settings, :users)
  end
end


text:
using Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSix;
using umbraco.BusinessLogic;
using umbraco.interfaces;

namespace Umbraco.Web.Strategies.Migrations
{
    /// <summary>
    /// This is kind of a hack to ensure that Apps and Trees that might still reside in the db is
    /// written to the 'new' applications.config and trees.config files upon upgrade to version 6.0
    /// </summary>
    public class EnsureAppsTreesUpdatedOnUpgrade : IApplicationStartupHandler
    {
        public EnsureAppsTreesUpdatedOnUpgrade()
        {
            //This event will be triggered once the EnsureAppsTreesUpdated Up() method is run during upgrades
            EnsureAppsTreesUpdated.Upgrading += EnsureAppsTreesUpdated_Upgrading;
        }

        void EnsureAppsTreesUpdated_Upgrading(object sender, EnsureAppsTreesUpdated.UpgradingEventArgs e)
        {
            var treeRegistrar = new ApplicationTreeRegistrar();
            var appRegistrar = new ApplicationRegistrar();
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<MasterConfiguration xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <client>
    <address>127.0.0.1</address>
    <port>20000</port>
    <minRetryMs>5000</minRetryMs>
    <maxRetryMs>60000</maxRetryMs>
    <reconnectDelayMs>2000</reconnectDelayMs>
    <level>15</level>
  </client>
  <master>
    <master>
      <timeSyncMode>None</timeSyncMode>
      <disableUnsolOnStartup>true</disableUnsolOnStartup>
      <unsolClassMask>
        <Class0>false</Class0>
        <Class1>true</Class1>
        <Class2>true</Class2>
        <Class3>true</Class3>
      </unsolClassMask>
      <startupIntegrityClassMask>
        <Class0>true</Class0>
        <Class1>true</Class1>
        <Class2>true</Class2>
        <Class3>true</Class3>
      </startupIntegrityClassMask>
      <integrityOnEventOverflowIIN>true</integrityOnEventOverflowIIN>
      <eventScanOnEventsAvailableClassMask>
        <Class0>false</Class0>
        <Class1>false</Class1>
        <Class2>false</Class2>
        <Class3>false</Class3>
      </eventScanOnEventsAvailableClassMask>
      <controlQualifierMode>always_two_bytes</controlQualifierMode>
      <TaskResponseTimeoutMilliseconds>5000</TaskResponseTimeoutMilliseconds>
      <TaskRetryPeriodMilliseconds>5000</TaskRetryPeriodMilliseconds>
      <TaskStartTimeoutMilliseconds>10000</TaskStartTimeoutMilliseconds>
    </master>
    <link>
      <isMaster>true</isMaster>
      <localAddr>1</localAddr>
      <remoteAddr>1024</remoteAddr>
      <ResponeTimeoutMilliseconds>1000</ResponeTimeoutMilliseconds>
      <KeepAliveTimeoutMilliseconds>60000</KeepAliveTimeoutMilliseconds>
    </link>
  </master>
</MasterConfiguration>


text:
package taskmodel

import (
	"context"
	"encoding/json"
	"errors"
	"fmt"
	"strconv"
	"time"

	"github.com/influxdata/flux/ast"
	"github.com/influxdata/flux/ast/astutil"
	"github.com/influxdata/flux/ast/edit"
	"github.com/influxdata/influxdb/v2/kit/platform"
	errors2 "github.com/influxdata/influxdb/v2/kit/platform/errors"
	"github.com/influxdata/influxdb/v2/query/fluxlang"
	"github.com/influxdata/influxdb/v2/task/options"
)

const (
	TaskDefaultPageSize = 100
	TaskMaxPageSize     = 500

	// TODO(jsteenb2): make these constants of type Status

	TaskStatusActive   = "active"
	TaskStatusInactive = "inactive"
)

var (
	// TaskSystemType is the type set in tasks' for all crud requests
	TaskSystemType = "system"
	// TaskBasicType is short-hand used by the UI to request a minimal subset of system task metadata
	TaskBasicType = "basic"
)

// Task is a task. 🎊
type Task struct {
	ID              platform.ID            `json:"id"`
	Type            string                 `json:"type,omitempty"`
	OrganizationID  platform.ID            `json:"orgID"`
	Organization    string                 `json:"org"`
	OwnerID         platform.ID            `json:"ownerID"`
	Name            string                 `json:"name"`
	Description     string                 `json:"description,omitempty"`
	Status          string                 `json:"status"`
	Flux            string                 `json:"flux"`
	Every           string                 `json:"every,omitempty"`
	Cron            string                 `json:"cron,omitempty"`
	Offset          time.Duration          `json:"offset,omitempty"`
	LatestCompleted time.Time              `json:"latestCompleted,omitempty"`
	LatestScheduled time.Time              `json:"latestScheduled,omitempty"`
	LatestSuccess   time.Time              `json:"latestSuccess,omitempty"`
	LatestFailure   time.Time              `json:"latestFailure,omitempty"`
	LastRunStatus   string                 `json:"lastRunStatus,omitempty"`
	LastRunError    string                 `json:"lastRunError,omitempty"`
	CreatedAt       time.Time              `json:"createdAt,omitempty"`
	UpdatedAt       time.Time              `json:"updatedAt,omitempty"`
	Metadata        map[string]interface{} `json:"metadata,omitempty"`
}

// EffectiveCron returns the effective cron string of the options.
// If the cron option was specified, it is returned.
// If the every option was specified, it is converted into a cron string using "@every".
// Otherwise, the empty string is returned.
// The value of the offset option is not considered.
func (t *Task) EffectiveCron() string {
	if t.Cron != "" {
		return t.Cron
	}
	if t.Every != "" {
		return "@every " + t.Every
	}
	return ""
}

// Run is a record createId when a run of a task is scheduled.
type Run struct {
	ID           platform.ID `json:"id,omitempty"`
	TaskID       platform.ID `json:"taskID"`
	Status       string      `json:"status"`
	ScheduledFor time.Time   `json:"scheduledFor"`          // ScheduledFor is the Now time used in the task's query
	RunAt        time.Time   `json:"runAt"`                 // RunAt is the time the task is scheduled to be run, which is ScheduledFor + Offset
	Flux         string      `json:"flux"`                  // Flux used in run
	StartedAt    time.Time   `json:"startedAt,omitempty"`   // StartedAt is the time the executor begins running the task
	FinishedAt   time.Time   `json:"finishedAt,omitempty"`  // FinishedAt is the time the executor finishes running the task
	RequestedAt  time.Time   `json:"requestedAt,omitempty"` // RequestedAt is the time the coordinator told the scheduler to schedule the task
	Log          []Log       `json:"log,omitempty"`

	TraceID   string `json:"traceID"`   // TraceID preserves the trace id
	IsSampled bool   `json:"isSampled"` // IsSampled preserves whether this run was sampled
}

// Log represents a link to a log resource
type Log struct {
	RunID   platform.ID `json:"runID,omitempty"`
	Time    string      `json:"time"`
	Message string      `json:"message"`
}

func (l Log) String() string {
	return l.Time + ": " + l.Message
}

// TaskService represents a service for managing one-off and recurring tasks.
type TaskService interface {
	// FindTaskByID returns a single task
	FindTaskByID(ctx context.Context, id platform.ID) (*Task, error)

	// FindTasks returns a list of tasks that match a filter (limit 100) and the total count
	// of matching tasks.
	FindTasks(ctx context.Context, filter TaskFilter) ([]*Task, int, error)

	// CreateTask creates a new task.
	// The owner of the task is inferred from the authorizer associated with ctx.
	CreateTask(ctx context.Context, t TaskCreate) (*Task, error)

	// UpdateTask updates a single task with changeset.
	UpdateTask(ctx context.Context, id platform.ID, upd TaskUpdate) (*Task, error)

	// DeleteTask removes a task by ID and purges all associated data and scheduled runs.
	DeleteTask(ctx context.Context, id platform.ID) error

	// FindLogs returns logs for a run.
	FindLogs(ctx context.Context, filter LogFilter) ([]*Log, int, error)

	// FindRuns returns a list of runs that match a filter and the total count of returned runs.
	FindRuns(ctx context.Context, filter RunFilter) ([]*Run, int, error)

	// FindRunByID returns a single run.
	FindRunByID(ctx context.Context, taskID, runID platform.ID) (*Run, error)

	// CancelRun cancels a currently running run.
	CancelRun(ctx context.Context, taskID, runID platform.ID) error

	// RetryRun creates and returns a new run (which is a retry of another run).
	RetryRun(ctx context.Context, taskID, runID platform.ID) (*Run, error)

	// ForceRun forces a run to occur with unix timestamp scheduledFor, to be executed as soon as possible.
	// The value of scheduledFor may or may not align with the task's schedule.
	ForceRun(ctx context.Context, taskID platform.ID, scheduledFor int64) (*Run, error)
}

// TaskCreate is the set of values to create a task.
type TaskCreate struct {
	Type           string                 `json:"type,omitempty"`
	Flux           string                 `json:"flux"`
	Description    string                 `json:"description,omitempty"`
	Status         string                 `json:"status,omitempty"`
	OrganizationID platform.ID            `json:"orgID,omitempty"`
	Organization   string                 `json:"org,omitempty"`
	OwnerID        platform.ID            `json:"-"`
	Metadata       map[string]interface{} `json:"-"` // not to be set through a web request but rather used by a http service using tasks backend.
}

func (t TaskCreate) Validate() error {
	switch {
	case t.Flux == "":
		return errors.New("missing flux")
	case !t.OrganizationID.Valid() && t.Organization == "":
		return errors.New("missing orgID and org")
	case t.Status != "" && t.Status != TaskStatusActive && t.Status != TaskStatusInactive:
		return fmt.Errorf("invalid task status: %q", t.Status)
	}
	return nil
}

// TaskUpdate represents updates to a task. Options updates override any options set in the Flux field.
type TaskUpdate struct {
	Flux        *string `json:"flux,omitempty"`
	Status      *string `json:"status,omitempty"`
	Description *string `json:"description,omitempty"`

	// LatestCompleted us to set latest completed on startup to skip task catchup
	LatestCompleted *time.Time             `json:"-"`
	LatestScheduled *time.Time             `json:"-"`
	LatestSuccess   *time.Time             `json:"-"`
	LatestFailure   *time.Time             `json:"-"`
	LastRunStatus   *string                `json:"-"`
	LastRunError    *string                `json:"-"`
	Metadata        map[string]interface{} `json:"-"` // not to be set through a web request but rather used by a http service using tasks backend.

	// Options gets unmarshalled from json as if it was flat, with the same level as Flux and Status.
	Options options.Options // when we unmarshal this gets unmarshalled from flat key-values
}

func (t *TaskUpdate) UnmarshalJSON(data []byte) error {
	// this is a type so we can marshal string into durations nicely
	jo := struct {
		Flux        *string `json:"flux,omitempty"`
		Status      *string `json:"status,omitempty"`
		Name        string  `json:"name,omitempty"`
		Description *string `json:"description,omitempty"`

		// Cron is a cron style time schedule that can be used in place of Every.
		Cron string `json:"cron,omitempty"`

		// Every represents a fixed period to repeat execution.
		// It gets marshalled from a string duration, i.e.: "10s" is 10 seconds
		Every options.Duration `json:"every,omitempty"`

		// Offset represents a delay before execution.
		// It gets marshalled from a string duration, i.e.: "10s" is 10 seconds
		Offset *options.Duration `json:"offset,omitempty"`

		Concurrency *int64 `json:"concurrency,omitempty"`

		Retry *int64 `json:"retry,omitempty"`
	}{}

	if err := json.Unmarshal(data, &jo); err != nil {
		return err
	}
	t.Options.Name = jo.Name
	t.Description = jo.Description
	t.Options.Cron = jo.Cron
	t.Options.Every = jo.Every
	if jo.Offset != nil {
		offset := *jo.Offset
		t.Options.Offset = &offset
	}
	t.Options.Concurrency = jo.Concurrency
	t.Options.Retry = jo.Retry
	t.Flux = jo.Flux
	t.Status = jo.Status
	return nil
}

func (t *TaskUpdate) MarshalJSON() ([]byte, error) {
	jo := struct {
		Flux        *string `json:"flux,omitempty"`
		Status      *string `json:"status,omitempty"`
		Name        string  `json:"name,omitempty"`
		Description *string `json:"description,omitempty"`

		// Cron is a cron style time schedule that can be used in place of Every.
		Cron string `json:"cron,omitempty"`

		// Every represents a fixed period to repeat execution.
		Every options.Duration `json:"every,omitempty"`

		// Offset represents a delay before execution.
		Offset *options.Duration `json:"offset,omitempty"`

		Concurrency *int64 `json:"concurrency,omitempty"`

		Retry *int64 `json:"retry,omitempty"`
	}{}
	jo.Name = t.Options.Name
	jo.Cron = t.Options.Cron
	jo.Every = t.Options.Every
	jo.Description = t.Description
	if t.Options.Offset != nil {
		offset := *t.Options.Offset
		jo.Offset = &offset
	}
	jo.Concurrency = t.Options.Concurrency
	jo.Retry = t.Options.Retry
	jo.Flux = t.Flux
	jo.Status = t.Status
	return json.Marshal(jo)
}

func (t *TaskUpdate) Validate() error {
	switch {
	case !t.Options.Every.IsZero() && t.Options.Cron != "":
		return errors.New("cannot specify both every and cron")
	case !t.Options.Every.IsZero():
		if _, err := options.ParseSignedDuration(t.Options.Every.String()); err != nil {
			return fmt.Errorf("every: %s is invalid", err)
		}
	case t.Options.Offset != nil && !t.Options.Offset.IsZero():
		if _, err := time.ParseDuration(t.Options.Offset.String()); err != nil {
			return fmt.Errorf("offset: %s, %s is invalid, the largest unit supported is h", t.Options.Offset.String(), err)
		}
	case t.Flux == nil && t.Status == nil && t.Options.IsZero():
		return errors.New("cannot update task without content")
	case t.Status != nil && *t.Status != TaskStatusActive && *t.Status != TaskStatusInactive:
		return fmt.Errorf("invalid task status: %q", *t.Status)
	}
	return nil
}

// safeParseSource calls the Flux parser.ParseSource function
// and is guaranteed not to panic.
func safeParseSource(parser fluxlang.FluxLanguageService, f string) (pkg *ast.Package, err error) {
	if parser == nil {
		return nil, &errors2.Error{
			Code: errors2.EInternal,
			Msg:  "flux parser is not configured; updating a task requires the flux parser to be set",
		}
	}
	defer func() {
		if r := recover(); r != nil {
			err = &errors2.Error{
				Code: errors2.EInternal,
				Msg:  "internal error in flux engine; unable to parse",
			}
		}
	}()

	return parser.Parse(f)
}

// UpdateFlux updates the TaskUpdate to go from updating options to updating a
// flux string, that now has those updated options in it. It zeros the options
// in the TaskUpdate.
func (t *TaskUpdate) UpdateFlux(parser fluxlang.FluxLanguageService, oldFlux string) error {
	return t.updateFlux(parser, oldFlux)
}

func (t *TaskUpdate) updateFlux(parser fluxlang.FluxLanguageService, oldFlux string) error {
	if t.Flux != nil && *t.Flux != "" {
		oldFlux = *t.Flux
	}
	toDelete := map[string]struct{}{}
	parsedPKG, err := safeParseSource(parser, oldFlux)
	if err != nil {
		return err
	}

	parsed := parsedPKG.Files[0]
	if !t.Options.Every.IsZero() && t.Options.Cron != "" {
		return errors.New("cannot specify both cron and every")
	}
	op := make(map[string]ast.Expression, 4)

	if t.Options.Name != "" {
		op["name"] = &ast.StringLiteral{Value: t.Options.Name}
	}
	if !t.Options.Every.IsZero() {
		op["every"] = &t.Options.Every.Node
	}
	if t.Options.Cron != "" {
		op["cron"] = &ast.StringLiteral{Value: t.Options.Cron}
	}
	if t.Options.Offset != nil {
		if !t.Options.Offset.IsZero() {
			op["offset"] = &t.Options.Offset.Node
		} else {
			toDelete["offset"] = struct{}{}
		}
	}
	if len(op) > 0 || len(toDelete) > 0 {
		editFunc := func(opt *ast.OptionStatement) (ast.Expression, error) {
			a, ok := opt.Assignment.(*ast.VariableAssignment)
			if !ok {
				return nil, errors.New("option assignment must be variable assignment")
			}
			obj, ok := a.Init.(*ast.ObjectExpression)
			if !ok {
				return nil, fmt.Errorf("value is is %s, not an object expression", a.Init.Type())
			}
			// modify in the keys and values that already are in the ast
			for i, p := range obj.Properties {
				k := p.Key.Key()
				if _, ok := toDelete[k]; ok {
					obj.Properties = append(obj.Properties[:i], obj.Properties[i+1:]...)
				}
				switch k {
				case "name":
					if name, ok := op["name"]; ok && t.Options.Name != "" {
						delete(op, "name")
						p.Value = name
					}
				case "offset":
					if offset, ok := op["offset"]; ok && t.Options.Offset != nil {
						delete(op, "offset")
						p.Value = offset.Copy().(*ast.DurationLiteral)
					}
				case "every":
					if every, ok := op["every"]; ok && !t.Options.Every.IsZero() {
						p.Value = every.Copy().(*ast.DurationLiteral)
						delete(op, "every")
					} else if cron, ok := op["cron"]; ok && t.Options.Cron != "" {
						delete(op, "cron")
						p.Value = cron
						p.Key = &ast.Identifier{Name: "cron"}
					}
				case "cron":
					if cron, ok := op["cron"]; ok && t.Options.Cron != "" {
						delete(op, "cron")
						p.Value = cron
					} else if every, ok := op["every"]; ok && !t.Options.Every.IsZero() {
						delete(op, "every")
						p.Key = &ast.Identifier{Name: "every"}
						p.Value = every.Copy().(*ast.DurationLiteral)
					}
				}
			}
			// add in new keys and values to the ast
			for k := range op {
				obj.Properties = append(obj.Properties, &ast.Property{
					Key:   &ast.Identifier{Name: k},
					Value: op[k],
				})
			}
			return nil, nil
		}

		ok, err := edit.Option(parsed, "task", editFunc)

		if err != nil {
			return err
		}
		if !ok {
			return errors.New("unable to edit option")
		}

		t.Options.Clear()
		s, err := astutil.Format(parsed)
		if err != nil {
			return err
		}
		t.Flux = &s
	}
	return nil
}

// TaskFilter represents a set of filters that restrict the returned results
type TaskFilter struct {
	Type           *string
	Name           *string
	After          *platform.ID
	OrganizationID *platform.ID
	Organization   string
	User           *platform.ID
	Limit          int
	Status         *string
}

// QueryParams Converts TaskFilter fields to url query params.
func (f TaskFilter) QueryParams() map[string][]string {
	qp := map[string][]string{}
	if f.After != nil {
		qp["after"] = []string{f.After.String()}
	}

	if f.OrganizationID != nil {
		qp["orgID"] = []string{f.OrganizationID.String()}
	}

	if f.Organization != "" {
		qp["org"] = []string{f.Organization}
	}

	if f.User != nil {
		qp["user"] = []string{f.User.String()}
	}

	if f.Limit > 0 {
		qp["limit"] = []string{strconv.Itoa(f.Limit)}
	}

	return qp
}

// RunFilter represents a set of filters that restrict the returned results
type RunFilter struct {
	// Task ID is required for listing runs.
	Task platform.ID

	After      *platform.ID
	Limit      int
	AfterTime  string
	BeforeTime string
}

// LogFilter represents a set of filters that restrict the returned log results.
type LogFilter struct {
	// Task ID is required.
	Task platform.ID

	// The optional Run ID limits logs to a single run.
	Run *platform.ID
}

type TaskStatus string

const (
	TaskActive   TaskStatus = "active"
	TaskInactive TaskStatus = "inactive"

	DefaultTaskStatus TaskStatus = TaskActive
)

type RunStatus int

const (
	RunStarted RunStatus = iota
	RunSuccess
	RunFail
	RunCanceled
	RunScheduled
)

func (r RunStatus) String() string {
	switch r {
	case RunStarted:
		return "started"
	case RunSuccess:
		return "success"
	case RunFail:
		return "failed"
	case RunCanceled:
		return "canceled"
	case RunScheduled:
		return "scheduled"
	}
	panic(fmt.Sprintf("unknown RunStatus: %d", r))
}

// RequestStillQueuedError is returned when attempting to retry a run which has not yet completed.
type RequestStillQueuedError struct {
	// Unix timestamps matching existing request's start and end.
	Start, End int64
}

const fmtRequestStillQueued = "previous retry for start=%s end=%s has not yet finished"

func (e RequestStillQueuedError) Error() string {
	return fmt.Sprintf(fmtRequestStillQueued,
		time.Unix(e.Start, 0).UTC().Format(time.RFC3339),
		time.Unix(e.End, 0).UTC().Format(time.RFC3339),
	)
}

// ParseRequestStillQueuedError attempts to parse a RequestStillQueuedError from msg.
// If msg is formatted correctly, the resultant error is returned; otherwise it returns nil.
func ParseRequestStillQueuedError(msg string) *RequestStillQueuedError {
	var s, e string
	n, err := fmt.Sscanf(msg, fmtRequestStillQueued, &s, &e)
	if err != nil || n != 2 {
		return nil
	}

	start, err := time.Parse(time.RFC3339, s)
	if err != nil {
		return nil
	}

	end, err := time.Parse(time.RFC3339, e)
	if err != nil {
		return nil
	}

	return &RequestStillQueuedError{Start: start.Unix(), End: end.Unix()}
}


text:
.class Lio/socket/client/Manager$11;
.super Ljava/util/TimerTask;
.source "Manager.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lio/socket/client/Manager;->reconnect()V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$0:Lio/socket/client/Manager;

.field final synthetic val$self:Lio/socket/client/Manager;

# direct methods
.method constructor <init>(Lio/socket/client/Manager;Lio/socket/client/Manager;)V
    .locals 0
    .param p1, "this$0"    # Lio/socket/client/Manager;

    .prologue
    .line 576
    iput-object p1, p0, Lio/socket/client/Manager$11;->this$0:Lio/socket/client/Manager;

    iput-object p2, p0, Lio/socket/client/Manager$11;->val$self:Lio/socket/client/Manager;

    invoke-direct {p0}, Ljava/util/TimerTask;-><init>()V

    return-void
.end method

# virtual methods
.method public run()V
    .locals 1

    .prologue
    .line 579
    new-instance v0, Lio/socket/client/Manager$11$1;

    invoke-direct {v0, p0}, Lio/socket/client/Manager$11$1;-><init>(Lio/socket/client/Manager$11;)V

    invoke-static {v0}, Lio/socket/thread/EventThread;->exec(Ljava/lang/Runnable;)V

    .line 608
    return-void
.end method


text:
package edu.wustl.catissuecore.bizlogic.magetab;

import java.util.List;
import java.util.Map;

public class MaterialTypeTransformerConfig {
	private TermSource termSource;
	Map<String, String> materialTypesMap;
	List<String> knownMolecularTypes;

	public MaterialTypeTransformerConfig(TermSource termSource, Map<String, String> materialTypesMap,List<String> knownMolecularTypes ) {
		this.termSource = termSource;
		this.materialTypesMap = materialTypesMap;
		this.knownMolecularTypes=knownMolecularTypes;
	}

	public TermSource getTermSource() {
		return termSource;
	}

	public Map<String, String> getMaterialTypesMap() {
		return materialTypesMap;
	}

	public List<String> getKnownMolecularTypes() {
		return knownMolecularTypes;
	}

}


text:
Octo-Node
=========
Octo-Node is a P2P networking library written in node.js

Download
========
In a terminal:

	git clone https://github.com/Sxw1212/octo-node.git
	npm install # C++ compiler required!
	cp example-config.json config.json

Use your favorite to edit config.json.

	maxPeers: The maximum amount of peers your node will connect to
	seeds: An array of initial nodes to connect to
	leech: If true, your node will not connect to any other nodes by itself
	debug: If true, your console will be spammed with random text

Setup
=====
Depending on your router, you may not need to port forward.
To find out, run `node index.js` and see if it connects to the default server.
If it does, your node will be able to connect, but probably not receive connections.
If not, you will need to port forward

Running multiple nodes under one external IP
============================================
You can run multiple nodes under one IP, but you will need to use a different port on each node. There are also some quirks when nodes are run with this.


text:
/* This file was generated by SableCC's ObjectMacro. */

package org.sablecc.sablecc.codegeneration.java.macro;

import java.util.*;

public class MParserException {

    private final List<Object> eDefaultPackage_SpecifiedPackage = new LinkedList<Object>();

    public MParserException() {

    }

    public MDefaultPackage newDefaultPackage(
            String pLanguageName) {

        MDefaultPackage lDefaultPackage = new MDefaultPackage(pLanguageName);
        this.eDefaultPackage_SpecifiedPackage.add(lDefaultPackage);
        return lDefaultPackage;
    }

    public MSpecifiedPackage newSpecifiedPackage(
            String pLanguageName,
            String pPackage) {

        MSpecifiedPackage lSpecifiedPackage = new MSpecifiedPackage(
                pLanguageName, pPackage);
        this.eDefaultPackage_SpecifiedPackage.add(lSpecifiedPackage);
        return lSpecifiedPackage;
    }

    @Override
    public String toString() {

        StringBuilder sb = new StringBuilder();
        sb.append(new MHeader().toString());
        if (this.eDefaultPackage_SpecifiedPackage.size() > 0) {
            sb.append(System.getProperty("line.separator"));
        }
        for (Object oDefaultPackage_SpecifiedPackage : this.eDefaultPackage_SpecifiedPackage) {
            sb.append(oDefaultPackage_SpecifiedPackage.toString());
        }
        sb.append(System.getProperty("line.separator"));
        sb.append("public class ParserException");
        sb.append(System.getProperty("line.separator"));
        sb.append("    extends Exception {");
        sb.append(System.getProperty("line.separator"));
        sb.append(System.getProperty("line.separator"));
        sb.append("  private Token token;");
        sb.append(System.getProperty("line.separator"));
        sb.append(System.getProperty("line.separator"));
        sb.append("  public ParserException(Token token) {");
        sb.append(System.getProperty("line.separator"));
        sb.append("    this.token = token;");
        sb.append(System.getProperty("line.separator"));
        sb.append("  }");
        sb.append(System.getProperty("line.separator"));
        sb.append(System.getProperty("line.separator"));
        sb.append("  public Token getToken() {");
        sb.append(System.getProperty("line.separator"));
        sb.append("    return this.token;");
        sb.append(System.getProperty("line.separator"));
        sb.append("  }");
        sb.append(System.getProperty("line.separator"));
        sb.append(System.getProperty("line.separator"));
        sb.append("  public String getMessage() {");
        sb.append(System.getProperty("line.separator"));
        sb.append("    return \"unexpected token '\" + this.token.getText() + \"' on line \" + this.token.getLine() + \", pos \" + this.token.getPos();");
        sb.append(System.getProperty("line.separator"));
        sb.append("  }");
        sb.append(System.getProperty("line.separator"));
        sb.append("}");
        sb.append(System.getProperty("line.separator"));
        return sb.toString();
    }

}


text:
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/**
 * @fileoverview A utility class for general braille functionality.
 */

goog.provide('cvox.BrailleUtil');

goog.require('cvox.ChromeVox');
goog.require('cvox.DomUtil');
goog.require('cvox.EditableTextAreaShadow');
goog.require('cvox.Focuser');
goog.require('cvox.NavBraille');
goog.require('cvox.NodeStateUtil');
goog.require('cvox.Spannable');
goog.require('cvox.ValueSelectionSpan');
goog.require('cvox.ValueSpan');

/**
 * Trimmable whitespace character that appears between consecutive items in
 * braille.
 * @const {string}
 */
cvox.BrailleUtil.ITEM_SEPARATOR = ' ';

/**
 * Messages considered as containers in braille.
 * Containers are distinguished from roles by their appearance higher up in the
 * DOM tree of a selected node.
 * This list should be very short.
 * @type {!Array<string>}
 */
cvox.BrailleUtil.CONTAINER = [
  'tag_h1_brl',
  'tag_h2_brl',
  'tag_h3_brl',
  'tag_h4_brl',
  'tag_h5_brl',
  'tag_h6_brl'
];

/**
 * Maps a ChromeVox message id to a braille template.
 * The template takes one-character specifiers:
 * n: replaced with braille name.
 * r: replaced with braille role.
 * s: replaced with braille state.
 * c: replaced with braille container role; this potentially returns whitespace,
 * so place at the beginning or end of templates for trimming.
 * v: replaced with braille value.
 * @type {Object<string>}
 */
cvox.BrailleUtil.TEMPLATE = {
  'base': 'c n v r s',
  'aria_role_alert': 'r: n',
  'aria_role_button': 'n r s',
  'aria_role_checkbox': 'n r (s)',
  'aria_role_menuitemcheckbox': 'n r (s)',
  'aria_role_menuitemradio': 'n r (s)',
  'aria_role_radio': 'n r (s)',
  'aria_role_textbox': 'n: v r s',
  'input_type_button': 'n r s',
  'input_type_checkbox': 'n r (s)',
  'input_type_email': 'n: v r s',
  'input_type_number': 'n: v r s',
  'input_type_password': 'n: v r s',
  'input_type_radio': 'n r (s)',
  'input_type_search': 'n: v r s',
  'input_type_submit': 'n r s',
  'input_type_text': 'n: v r s',
  'input_type_tel': 'n: v r s',
  'input_type_url': 'n: v r s',
  'tag_button': 'n r s',
  'tag_textarea': 'n: v r s'
};

/**
 * Gets the braille name for a node.
 * See DomUtil for a more precise definition of 'name'.
 * Additionally, whitespace is trimmed.
 * @param {Node} node The node.
 * @return {string} The string representation.
 */
cvox.BrailleUtil.getName = function(node) {
  if (!node) {
    return '';
  }
  return cvox.DomUtil.getName(node).trim();
};

/**
 * Gets the braille role message id for a node.
 * See DomUtil for a more precise definition of 'role'.
 * @param {Node} node The node.
 * @return {string} The string representation.
 */
cvox.BrailleUtil.getRoleMsg = function(node) {
  if (!node) {
    return '';
  }
  var roleMsg = cvox.DomUtil.getRoleMsg(node, cvox.VERBOSITY_VERBOSE);
  if (roleMsg) {
    roleMsg = cvox.DomUtil.collapseWhitespace(roleMsg);
  }
  if (roleMsg && (roleMsg.length > 0)) {
    if (cvox.ChromeVox.msgs.getMsg(roleMsg + '_brl')) {
      roleMsg += '_brl';
    }
  }
  return roleMsg;
};

/**
 * Transforms a {@code cvox.NodeState} list of state messages to the
 * corresponding messages for braille and expands them into a localized
 * string suitable for output on a braille display.
 * @param {cvox.NodeState} stateMsgs The states to expand.  The content of this
 *     array is modified.
 * @return {string} The string representation.
 * @private
 */
cvox.BrailleUtil.expandStateMsgs_ = function(stateMsgs) {
  stateMsgs.forEach(function(state) {
    // Check to see if a variant of the message with '_brl' exists,
    // and use it if so.
    //
    // Note: many messages are templatized, and if we don't pass any
    // argument to substitute, getMsg might throw an error if the
    // resulting string is empty. To avoid this, we pass a dummy
    // substitution string array here.
    var dummySubs = ['dummy', 'dummy', 'dummy'];
    if (cvox.ChromeVox.msgs.getMsg(state[0] + '_brl', dummySubs)) {
      state[0] += '_brl';
    }
  });
  return cvox.NodeStateUtil.expand(stateMsgs);
};

/**
 * Gets the braille container role of a node.
 * @param {Node} prev The previous node in navigation.
 * @param {Node} node The node.
 * @return {string} The string representation.
 */
cvox.BrailleUtil.getContainer = function(prev, node) {
  if (!prev || !node) {
    return '';
  }
  var ancestors = cvox.DomUtil.getUniqueAncestors(prev, node);
  for (var i = 0, container; container = ancestors[i]; i++) {
    var msg = cvox.BrailleUtil.getRoleMsg(container);
    if (msg && cvox.BrailleUtil.CONTAINER.indexOf(msg) != -1) {
      return cvox.ChromeVox.msgs.getMsg(msg);
    }
  }
  return '';
};

/**
 * Gets the braille value of a node. A {@code cvox.ValueSpan} will be
 * attached, along with (possibly) a {@code cvox.ValueSelectionSpan}.
 * @param {Node} node The node.
 * @return {!cvox.Spannable} The value spannable.
 */
cvox.BrailleUtil.getValue = function(node) {
  if (!node) {
    return new cvox.Spannable();
  }
  var valueSpan = new cvox.ValueSpan(0 /* offset */);
  if (cvox.DomUtil.isInputTypeText(node)) {
    var value = node.value;
    if (node.type === 'password') {
      value = value.replace(/./g, '*');
    }
    var spannable = new cvox.Spannable(value, valueSpan);
    if (node === document.activeElement &&
        cvox.DomUtil.doesInputSupportSelection(node)) {
      var selectionStart = cvox.BrailleUtil.clamp_(
          node.selectionStart, 0, spannable.getLength());
      var selectionEnd = cvox.BrailleUtil.clamp_(
          node.selectionEnd, 0, spannable.getLength());
      spannable.setSpan(new cvox.ValueSelectionSpan(),
                        Math.min(selectionStart, selectionEnd),
                        Math.max(selectionStart, selectionEnd));
    }
    return spannable;
  } else if (node instanceof HTMLTextAreaElement) {
    var shadow = new cvox.EditableTextAreaShadow();
    shadow.update(node);
    var lineIndex = shadow.getLineIndex(node.selectionEnd);
    var lineStart = shadow.getLineStart(lineIndex);
    var lineEnd = shadow.getLineEnd(lineIndex);
    var lineText = node.value.substring(lineStart, lineEnd);
    valueSpan.offset = lineStart;
    var spannable = new cvox.Spannable(lineText, valueSpan);
    if (node === document.activeElement) {
      var selectionStart = cvox.BrailleUtil.clamp_(
          node.selectionStart - lineStart, 0, spannable.getLength());
      var selectionEnd = cvox.BrailleUtil.clamp_(
          node.selectionEnd - lineStart, 0, spannable.getLength());
      spannable.setSpan(new cvox.ValueSelectionSpan(),
                        Math.min(selectionStart, selectionEnd),
                        Math.max(selectionStart, selectionEnd));
    }
    return spannable;
  } else {
    return new cvox.Spannable(cvox.DomUtil.getValue(node), valueSpan);
  }
};

/**
 * Gets the templated representation of braille.
 * @param {Node} prev The previous node (during navigation).
 * @param {Node} node The node.
 * @param {{name:(undefined|string),
 * role:(undefined|string),
 * roleMsg:(undefined|string),
 * state:(undefined|string),
 * container:(undefined|string),
 * value:(undefined|cvox.Spannable)}|Object=} opt_override Override a
 * specific property for the given node.
 * @return {!cvox.Spannable} The string representation.
 */
cvox.BrailleUtil.getTemplated = function(prev, node, opt_override) {
  opt_override = opt_override ? opt_override : {};
  var roleMsg = opt_override.roleMsg ||
      (node ? cvox.DomUtil.getRoleMsg(node, cvox.VERBOSITY_VERBOSE) : '');
  var template = cvox.BrailleUtil.TEMPLATE[roleMsg] ||
      cvox.BrailleUtil.TEMPLATE['base'];
  var state = opt_override.state;
  if (!state) {
    if (node) {
      state = cvox.BrailleUtil.expandStateMsgs_(
          cvox.DomUtil.getStateMsgs(node, true));
    } else {
      state = '';
    }
  }
  var role = opt_override.role || '';
  if (!role && roleMsg) {
    role = cvox.ChromeVox.msgs.getMsg(roleMsg + '_brl') ||
        cvox.ChromeVox.msgs.getMsg(roleMsg);
  }

  var templated = new cvox.Spannable();
  var mapChar = function(c) {
    switch (c) {
      case 'n':
        return opt_override.name || cvox.BrailleUtil.getName(node);
      case 'r':
        return role;
      case 's':
        return state;
      case 'c':
        return opt_override.container ||
            cvox.BrailleUtil.getContainer(prev, node);
      case 'v':
        return opt_override.value || cvox.BrailleUtil.getValue(node);
      default:
        return c;
    }
  };
  for (var i = 0; i < template.length; i++) {
    var component = mapChar(template[i]);
    templated.append(component);
    // Ignore the next whitespace separator if the current component is empty,
    // unless the empty value has a selection, in which case the cursor
    // should be placed on the empty space after the empty value.
    if (!component.toString() && template[i + 1] == ' ' &&
        (!(component instanceof cvox.Spannable) ||
        !/**@type {cvox.Spannable}*/(component).getSpanInstanceOf(
            cvox.ValueSelectionSpan))) {
      i++;
    }
  }
  return templated.trimRight();
};

/**
 * Creates a braille value from a string and, optionally, a selection range.
 * A {@code cvox.ValueSpan} will be attached, along with a
 * {@code cvox.ValueSelectionSpan} if applicable.
 * @param {string} text The text to display as the value.
 * @param {number=} opt_selStart Selection start.
 * @param {number=} opt_selEnd Selection end if different from selection start.
 * @param {number=} opt_textOffset Start offset of text.
 * @return {!cvox.Spannable} The value spannable.
 */
cvox.BrailleUtil.createValue = function(text, opt_selStart, opt_selEnd,
                                        opt_textOffset) {
  var spannable = new cvox.Spannable(
      text, new cvox.ValueSpan(opt_textOffset || 0));
  if (goog.isDef(opt_selStart)) {
    opt_selEnd = goog.isDef(opt_selEnd) ? opt_selEnd : opt_selStart;
    // TODO(plundblad): This looses the distinction between the selection
    // anchor (start) and focus (end).  We should use that information to
    // decide where to pan the braille display.
    if (opt_selStart > opt_selEnd) {
      var temp = opt_selStart;
      opt_selStart = opt_selEnd;
      opt_selEnd = temp;
    }

    spannable.setSpan(new cvox.ValueSelectionSpan(), opt_selStart, opt_selEnd);
  }
  return spannable;
};

/**
 * Activates a position in a nav braille.  Moves the caret in text fields
 * and simulates a mouse click on the node at the position.
 *
 * @param {!cvox.NavBraille} braille the nav braille representing the display
 *        content that was active when the user issued the key command.
 *        The annotations in the spannable are used to decide what
 *        node to activate and what part of the node value (if any) to
 *        move the caret to.
 * @param {number=} opt_displayPosition position of the display that the user
 *                  activated, relative to the start of braille.
 */
cvox.BrailleUtil.click = function(braille, opt_displayPosition) {
  var handled = false;
  var spans = braille.text.getSpans(opt_displayPosition || 0);
  var node = spans.filter(function(n) { return n instanceof Node; })[0];
  if (node) {
    if (goog.isDef(opt_displayPosition) &&
        (cvox.DomUtil.isInputTypeText(node) ||
            node instanceof HTMLTextAreaElement)) {
      var valueSpan = spans.filter(
          function(s) {
            return s instanceof cvox.ValueSpan;
          })[0];
      if (valueSpan) {
        if (document.activeElement !== node) {
          cvox.Focuser.setFocus(node);
        }
        var cursorPosition = opt_displayPosition -
            braille.text.getSpanStart(valueSpan) +
            valueSpan.offset;
        cvox.ChromeVoxEventWatcher.setUpTextHandler();
        node.selectionStart = node.selectionEnd = cursorPosition;
        cvox.ChromeVoxEventWatcher.handleTextChanged(true);
        handled = true;
      }
    }
  }
  if (!handled) {
    cvox.DomUtil.clickElem(
        node || cvox.ChromeVox.navigationManager.getCurrentNode(),
        false, false, false, true);
  }
};

/**
 * Clamps a number so it is within the given boundaries.
 * @param {number} number The number to clamp.
 * @param {number} min The minimum value to return.
 * @param {number} max The maximum value to return.
 * @return {number} {@code number} if it is within the bounds, or the nearest
 *     number within the bounds otherwise.
 * @private
 */
cvox.BrailleUtil.clamp_ = function(number, min, max) {
  return Math.min(Math.max(number, min), max);
};


text:
#pragma once
#include <aws/sagemaker/SageMaker_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace SageMaker
{
namespace Model
{

  /**
   *
The Liquid template for the worker user interface.

See Also:

   * AWS
   * API Reference

   */
  class AWS_SAGEMAKER_API UiTemplate
  {
  public:
    UiTemplate();
    UiTemplate(Aws::Utils::Json::JsonView jsonValue);
    UiTemplate& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     *
The content of the Liquid template for the worker user interface.

     */
    inline const Aws::String& GetContent() const{ return m_content; }

    /**
     *
The content of the Liquid template for the worker user interface.

     */
    inline bool ContentHasBeenSet() const { return m_contentHasBeenSet; }

    /**
     *
The content of the Liquid template for the worker user interface.

     */
    inline void SetContent(const Aws::String& value) { m_contentHasBeenSet = true; m_content = value; }

    /**
     *
The content of the Liquid template for the worker user interface.

     */
    inline void SetContent(Aws::String&& value) { m_contentHasBeenSet = true; m_content = std::move(value); }

    /**
     *
The content of the Liquid template for the worker user interface.

     */
    inline void SetContent(const char* value) { m_contentHasBeenSet = true; m_content.assign(value); }

    /**
     *
The content of the Liquid template for the worker user interface.

     */
    inline UiTemplate& WithContent(const Aws::String& value) { SetContent(value); return *this;}

    /**
     *
The content of the Liquid template for the worker user interface.

     */
    inline UiTemplate& WithContent(Aws::String&& value) { SetContent(std::move(value)); return *this;}

    /**
     *
The content of the Liquid template for the worker user interface.

     */
    inline UiTemplate& WithContent(const char* value) { SetContent(value); return *this;}

  private:

    Aws::String m_content;
    bool m_contentHasBeenSet = false;
  };

} // namespace Model
} // namespace SageMaker
} // namespace Aws