text:
.store-cart-option {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.store-cart-option .item-image {
  border-radius: 10px;
  background-color: white;
  width: 110px;
  height: 110px;
  margin: 5px;
  line-height: 110px;
}

.store-cart-option .item-name {
  height: 100px;
  width: 200px;
  background-color: khaki;
  margin: 5px;
  line-height: 100px;
}

.store-cart-option .item-price {
  height: 100px;
  width: 100px;
  background-color: khaki;
  margin: 5px;
  line-height: 100px;
}

.store-cart-option .remove-item {
  height: 50px;
  background-color: white;
  width: 50px;
  border: none;
}

redpajama_set_name: RedPajamaGithub


text:
package co.cask.cdap.etl.common;

import co.cask.cdap.api.data.format.StructuredRecord;
import co.cask.cdap.api.data.schema.Schema;
import org.junit.Assert;
import org.junit.Test;

/**
 * Unit Tests for {@link StructuredRecordUtils}.
 */
public class StructuredRecordUtilsTest {

  @Test
  public void testLowerAndUpperCaseTransformation() throws Exception {
    StructuredRecord record = StructuredRecord.builder(
      Schema.recordOf("dbrecord",
                      Schema.Field.of("Name", Schema.nullableOf(Schema.of(Schema.Type.STRING))),
                      Schema.Field.of("Age", Schema.of(Schema.Type.INT)))).set("Name", "Abcd").set("Age", 10).build();
    StructuredRecord upperCaseRecord = StructuredRecordUtils.convertCase(
      record, FieldCase.toFieldCase("upPer"));
    Assert.assertEquals("Abcd", upperCaseRecord.get("NAME"));
    Assert.assertEquals(10, upperCaseRecord.get("AGE"));
    Assert.assertNull(upperCaseRecord.get("Age"));
    Assert.assertNull(upperCaseRecord.get("Name"));

    StructuredRecord lowerCaseRecord = StructuredRecordUtils.convertCase(
      record, FieldCase.toFieldCase("lowEr"));
    Assert.assertEquals("Abcd", lowerCaseRecord.get("name"));
    Assert.assertEquals(10, lowerCaseRecord.get("age"));
    Assert.assertNull(upperCaseRecord.get("Age"));
    Assert.assertNull(upperCaseRecord.get("Name"));

    StructuredRecord noChangeRecord = StructuredRecordUtils.convertCase(
      record, FieldCase.toFieldCase("no change"));
    Assert.assertEquals("Abcd", noChangeRecord.get("Name"));
    Assert.assertEquals(10, noChangeRecord.get("Age"));
  }

  @Test
  public void testInvalidTransformation() throws Exception {
    StructuredRecord record = StructuredRecord.builder(
      Schema.recordOf("dbrecord",
                      Schema.Field.of("age", Schema.nullableOf(Schema.of(Schema.Type.STRING))),
                      Schema.Field.of("Age", Schema.of(Schema.Type.INT)))).set("age", "10").set("Age", 10).build();

    try {
      StructuredRecordUtils.convertCase(record, FieldCase.toFieldCase("lower"));
      Assert.fail();
    } catch (Exception e) {
      //expected
    }
  }
}


text:
/**
 * TODO Javadoc
 */
package hm.edu.hmcheckin.test.unit;

import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;

/**
 * TODO Javadoc
 *
 * @author @author Roman Podolski
 *
 */
@RunWith(Suite.class)
@SuiteClasses({ AppTest.class, AsyncHttpClientTest.class,
		AsyncNetworkTaskTest.class, BaseFriendAdapterTest.class,
		BaseListItemTest.class, CheckInActivityTest.class, EventsTest.class,
		FriendListAdapterTest.class, FriendListFragmentTest.class,
		FriendSearchFragmentTest.class, FriendTest.class,
		InvitationFragmentTest.class, InvitationListAdapterTest.class,
		InvitationTest.class, LandingActivityTest.class,
		LaunchActivityTest.class, ListItemTypeTest.class,
		LoginActivityTest.class, PageAdapterTest.class, ParserKeysTest.class,
		RegisterActivityTest.class, RegisterResponseTest.class,
		ResponseParserTest.class, ResponseParserv2Test.class,
		SearchListAdapterTest.class, SpinnerAdapterTest.class,
		UserStateTest.class, WifiConnectorTest.class,
		WifiListAdapterTest.class, WifiTest.class })
public class AllTests {

}


text:
<!DOCTYPE html>

        <meta charset="UTF-8" />
        <meta name="robots" content="index, follow, all" />
        <title>HealthCareAbroad\HelperBundle\DependencyInjection\HelperExtension | HealthCareAbroad API</title>
                    <link rel="stylesheet" type="text/css" href="../../../stylesheet.css">

Classes

Namespaces

Interfaces

Index

HealthCareAbroad API

Class

HealthCareAbroad\HelperBundle\DependencyInjection\HelperExtension

class    HelperExtension        extends Extension

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}

Methods

                    load(array $configs, ContainerBuilder $container)

{@inheritDoc}

Details

at line 20

                    public
    load(array $configs, ContainerBuilder $container)

{@inheritDoc}

Parameters

                array
                $configs

                ContainerBuilder
                $container

        Generated by Sami, the API Documentation Generator.


text:
require "active_job"

module ActionMailer
  # The <tt>ActionMailer::DeliveryJob</tt> class is used when you
  # want to send emails outside of the request-response cycle.
  #
  # Exceptions are rescued and handled by the mailer class.
  class DeliveryJob < ActiveJob::Base # :nodoc:
    queue_as { ActionMailer::Base.deliver_later_queue_name }

    rescue_from StandardError, with: :handle_exception_with_mailer_class

    def perform(mailer, mail_method, delivery_method, *args) #:nodoc:
      mailer.constantize.public_send(mail_method, *args).send(delivery_method)
    end

    private
      # "Deserialize" the mailer class name by hand in case another argument
      # (like a Global ID reference) raised DeserializationError.
      def mailer_class
        if mailer = Array(@serialized_arguments).first || Array(arguments).first
          mailer.constantize
        end
      end

      def handle_exception_with_mailer_class(exception)
        if klass = mailer_class
          klass.handle_exception exception
        else
          raise exception
        end
      end
  end
end


text:
<template name="UserCreate">

Create New User

This will exist in the future.

</template>


text:
"""Script to run tests with pre-configured command line arguments.

NOTICE: This test is designed to be run from the build output folder! It is
copied automatically during build.

With this script, it's easier for anyone to enable/disable or extend a test that
runs on the buildbots. It is also easier for developers to run the tests in the
same way as they run on the bots.
"""

import optparse
import os
import subprocess
import sys

_CURRENT_DIR = os.path.abspath(os.path.dirname(__file__))
_HOME = os.environ.get('HOME', '')

_VIE_AUTO_TEST_CMD_LIST = [
    'vie_auto_test',
    '--automated',
    '--gtest_filter=-ViERtpFuzzTest*',
    '--capture_test_ensure_resolution_alignment_in_capture_device=false']
_WIN_TESTS = {
    'vie_auto_test': _VIE_AUTO_TEST_CMD_LIST,
    'voe_auto_test': ['voe_auto_test',
                      '--automated'],
}
_MAC_TESTS = {
    'vie_auto_test': _VIE_AUTO_TEST_CMD_LIST,
    'voe_auto_test': ['voe_auto_test',
                      '--automated',
                      ('--gtest_filter='
                       '-VolumeTest.SetVolumeBeforePlayoutWorks' # bug 527
                       )],
}
_LINUX_TESTS = {
    'vie_auto_test': _VIE_AUTO_TEST_CMD_LIST,
    'voe_auto_test': ['voe_auto_test',
                      '--automated',
                      '--gtest_filter=-RtpFuzzTest.*'],
    'audio_e2e_test': ['python',
                       'run_audio_test.py',
                       '--input=../../resources/e2e_audio_in.pcm',
                       '--output=/tmp/e2e_audio_out.pcm',
                       '--codec=L16',
                       '--harness=%s/audio_e2e_harness' % _CURRENT_DIR,
                       '--compare=%s/bin/compare-audio +16000 +wb' % _HOME,
                       '--regexp=(\d\.\d{3})'],
    'audioproc_perf': ['audioproc',
                       '-aecm', '-ns', '-agc', '--fixed_digital', '--perf',
                       '-pb', '../../resources/audioproc.aecdump'],
    'isac_fixed_perf': ['iSACFixtest',
                        '32000', '../../resources/speech_and_misc_wb.pcm',
                        'isac_speech_and_misc_wb.pcm'],
}

def main():
  parser = optparse.OptionParser('usage: %prog -t <test> [-t <test> ...]\n'
                                 'If no test is specified, all tests are run.')
  parser.add_option('-l', '--list', action='store_true', default=False,
                    help='Lists all currently supported tests.')
  parser.add_option('-t', '--test', action='append', default=[],
                    help='Which test to run. May be specified multiple times.')
  options, _ = parser.parse_args()

  if sys.platform.startswith('win'):
    test_dict = _WIN_TESTS
  elif sys.platform.startswith('linux'):
    test_dict = _LINUX_TESTS
  elif sys.platform.startswith('darwin'):
    test_dict = _MAC_TESTS
  else:
    parser.error('Unsupported platform: %s' % sys.platform)

  if options.list:
    print 'Available tests:'
    print 'Test name              Command line'
    print '=========              ============'
    for test, cmd_line in test_dict.items():
      print '%-20s   %s' % (test, ' '.join(cmd_line))
    return

  if not options.test:
    options.test = test_dict.keys()
  for test in options.test:
    if test not in test_dict:
      parser.error('Test "%s" is not supported (use --list to view supported '
                   'tests).')

  # Change current working directory to the script's dir to make the relative
  # paths always work.
  os.chdir(_CURRENT_DIR)
  print 'Changed working directory to: %s' % _CURRENT_DIR

  print 'Running WebRTC Buildbot tests: %s' % options.test
  for test in options.test:
    cmd_line = test_dict[test]

    # Create absolute paths to test executables for non-Python tests.
    if cmd_line[0] != 'python':
      cmd_line[0] = os.path.join(_CURRENT_DIR, cmd_line[0])

    print 'Running: %s' % ' '.join(cmd_line)
    try:
      subprocess.check_call(cmd_line)
    except subprocess.CalledProcessError as e:
      print >> sys.stderr, ('An error occurred during test execution: return '
                            'code: %d' % e.returncode)
      return -1

  print 'Testing completed successfully.'
  return 0

if __name__ == '__main__':
  sys.exit(main())


text:
<!DOCTYPE html>

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>The source code</title>
  <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />

/**
 * Layout class for {@link Ext.form.field.TextArea} fields. Handles sizing the textarea field.
 * @private
 */
Ext.define('Ext.layout.component.field.TextArea', {
    extend: 'Ext.layout.component.field.Text',
    alias: 'layout.textareafield',

    type: 'textareafield',

    canGrowWidth: false,

    beginLayout: function(ownerContext){
        this.callParent(arguments);
        ownerContext.target.inputEl.setStyle('height', '');
    },

    measureContentHeight: function (ownerContext) {
        var me = this,
            owner = me.owner,
            height = me.callParent(arguments),
            inputContext, inputEl, value, max, curWidth, calcHeight;

        if (owner.grow && !ownerContext.state.growHandled) {
            inputContext = ownerContext.inputContext;
            inputEl = owner.inputEl;
            curWidth = inputEl.getWidth(true); //subtract border/padding to get the available width for the text

            // Get and normalize the field value for measurement
            value = Ext.util.Format.htmlEncode(inputEl.dom.value) || '&#160;';
            value += owner.growAppend;

            // Translate newlines to <br> tags
            value = value.replace(/\n/g, '<br/>');

            // Find the height that contains the whole text value
            calcHeight = Ext.util.TextMetrics.measure(inputEl, value, curWidth).height +
                         inputContext.getBorderInfo().height + inputContext.getPaddingInfo().height;

            // Constrain
            calcHeight = Ext.Number.constrain(calcHeight, owner.growMin, owner.growMax);
            inputContext.setHeight(calcHeight);
            ownerContext.state.growHandled = true;

            // Now that we've set the inputContext, we need to recalculate the width
            inputContext.domBlock(me, 'height');
            height = NaN;
        }
        return height;
    }
});


text:
package org.apache.wiki.search;

import org.apache.wiki.api.core.Context;
import org.apache.wiki.api.core.Page;
import org.apache.wiki.api.exceptions.ProviderException;
import org.apache.wiki.api.providers.WikiProvider;
import org.apache.wiki.api.search.SearchResult;

import java.io.IOException;
import java.util.Collection;

/**
 *  Interface for the search providers that handle searching the Wiki
 *
 *  @since 2.2.21.
 */
public interface SearchProvider extends WikiProvider {

    /**
     * Delete a page from the search index.
     *
     * @param page Page to remove from search index.
     */
    void pageRemoved( Page page );

    /**
     * Adds a WikiPage for indexing queue. This is called a queue, since this method is expected to return pretty quickly, and indexing to
     * be done in a separate thread.
     *
     *  @param page The WikiPage to be indexed.
     */
    void reindexPage( Page page );

    /**
     * Search for pages matching a search query.
     *
     * @param query query to search for
     * @param wikiContext the context within which to run the search
     * @return collection of pages that match query
     * @throws ProviderException if the search provider failed.
     * @throws IOException if for some reason the query could not be executed.
     */
    Collection< SearchResult > findPages( String query, Context wikiContext ) throws ProviderException, IOException;

}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using Microsoft.Rest.Generator.ClientModel;
using Microsoft.Rest.Generator.Python;
using Microsoft.Rest.Generator.Utilities;
using System.Collections.Generic;
using System.Linq;

namespace Microsoft.Rest.Generator.Azure.Python
{
    public class AzureParameterTemplateModel : ParameterTemplateModel
    {
        public AzureParameterTemplateModel(Parameter source)
            : base(source)
        {
        }

        /// <summary>
        /// Gets parameter declaration
        /// </summary>
        public override string DeclarationExpression
        {
            get { return this.Type.Name; }
        }
    }
}


text:
package com.blastersmiths.baton.product.model;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 *
This class solves two problems:

 *
Problem One: Foo widget can use pink 25mm webbing, Bar widget is never
 * sold with pink 25mm webbing

 *

 * The solution, of course, is to add some kind of, err, {@code Exclusion} that
 * for the Bar widget component, saying that the pink 25mm webbing (which is a
 * member of the "25mm webbing" {@link MaterialClass}) is not allowed. This is
 * excluding a specific material unconditionally.
 *

 *
Problem Two: Foo widget has a panel, and some straps. It can be sold as a
 * green panel and black straps, but not as a black panel
 * with green straps
 The solution here is to add an exclusion that
 * is conditional - the predicate is the black panel material, and the
 * exclusion is the green strap material. By having many of these kinds
 * of exclusions, the number of possible product combinations is constrained
 * (both in number, and aesthetic taste).
 *

 */
@Data
@EqualsAndHashCode(callSuper = true)
public class Exclusion extends AbstractEntity {

    /**
     * Name, likely to contain, eg, "Prevent green straps on black panels",
     * "Ban pink webbing"
     */
    private String name;

    /** Excluded material, mandatory */
    private Material excludedMaterial;

    /**
     * Predicate material, optional. If {@code null}, then the exclusion is
     * assumed to be unconditional
     */
    private Material predicateMaterial;

}


text: Apparently this week's Gunn Together is with period 5 again?


text:
@interface ViewController : UIViewController <UITextFieldDelegate>
@property (weak, nonatomic) IBOutlet UILabel *stringLabel;
@property (weak, nonatomic) IBOutlet UITextField *textField;

@end


text:
import ctypes
import ctypes.util
import os

########################################################
# constants from linux/gpio.h
########################################################

GPIOHANDLES_MAX = 64

GPIOHANDLE_REQUEST_INPUT = 1 << 0
GPIOHANDLE_REQUEST_OUTPUT = 1 << 1
GPIOHANDLE_REQUEST_ACTIVE_LOW = 1 << 2
GPIOHANDLE_REQUEST_OPEN_DRAIN = 1 << 3
GPIOHANDLE_REQUEST_OPEN_SOURCE = 1 << 4

GPIOEVENT_REQUEST_RISING_EDGE = 1 << 0
GPIOEVENT_REQUEST_FALLING_EDGE = 1 << 1
GPIOEVENT_REQUEST_BOTH_EDGES = (1 << 0 | 1 << 1)

########################################################
# helpers
########################################################

def get_library(name):
    '''Find library in a current directory

    We add 'lib' and '.so' to the name.
    '''

    path = os.path.dirname(__file__)
    files = os.listdir(path)

    for file in files:
        if file.startswith("lib{name}".format(name=name)):
            if file.endswith(".so"):
                return os.path.join(path, file)
    return None

libgpioctl = ctypes.CDLL(get_library("gpioctl"))

libc = ctypes.CDLL(ctypes.util.find_library('c'))
f_read = libc.read

c32 = ctypes.c_char * 32

cul_MAX = ctypes.c_ulong * GPIOHANDLES_MAX
cu8_MAX = ctypes.c_ubyte * GPIOHANDLES_MAX

########################################################
# ctypes structures
########################################################

class _gpiochip_info (ctypes.Structure):
    _fields_ = [
        ("name", c32),
        ("label", c32),
        ("lines", ctypes.c_long),
    ]

class _gpioline_info (ctypes.Structure):
    _fields_ = [
        ("line", ctypes.c_long),
        ("flags", ctypes.c_ulong),
        ("name", c32),
        ("consumer", c32),
    ]

class _gpiohandle_request (ctypes.Structure):
    _fields_ = [
        ('lineoffsets', cul_MAX),
        ('flags', ctypes.c_ulong),
        ('default_values', cu8_MAX),
        ('consumer_label', c32),
        ('lines', ctypes.c_ulong),
        ('fd', ctypes.c_int),
    ]

class _gpioevent_request (ctypes.Structure):
    _fields_ = [
        ('lineoffset', ctypes.c_ulong),
        ('handleflags', ctypes.c_ulong),
        ('eventflags', ctypes.c_ulong),
        ('consumer_label', c32),
        ('fd', ctypes.c_int),
    ]

class _gpiohandle_data (ctypes.Structure):
    _fields_ = [
        ('values', cu8_MAX),
    ]

class gpioevent_data (ctypes.Structure):
    _fields_ = [
        ("timestamp", ctypes.c_ulonglong),
        ('id', ctypes.c_ulong),
    ]

########################################################

_GPIO = "/dev/gpiochip0"

class GPIOError(IOError):
    pass

class _GPIOChip():

    def __init__(self, path):
        self.path = path

        self.fd = os.open(self.path, os.O_RDWR)

    def info(self):
        _info = _gpiochip_info()
        status = libgpioctl.get_chipinfo(self.fd, ctypes.byref(_info))
        if status != 0:
            raise GPIOError("get_chipinfo call returned non-zero status")

        info = {
            "name": _info.name,
            "label": _info.label,
            "lines": _info.lines,
            }

        return info

    def line_info(self, line):
        _info = _gpioline_info(line=line)

        status = libgpioctl.get_lineinfo(self.fd, ctypes.byref(_info))
        if status != 0:
            raise GPIOError("get_chipinfo call returned non-zero status")

        info = {
            "line": _info.line,
            "flags": _info.flags,
            "name": _info.name,
            "consumer": _info.consumer,
        }

        return info

    def get_handle(self, *args, **kwargs):
        return GPIOHandle(*args, **kwargs, gpio=self)

    def get_event_handle(self, *args, **kwargs):
        return GPIOEventHandle(*args, **kwargs, gpio=self)

class GPIOChip():

    _chips = {}

    def __new__(cls, name=_GPIO):
        if name not in cls._chips:
            chip = _GPIOChip(name)
            cls._chips[name] = chip
        return cls._chips[name]

class GPIOHandle:

    _FLAGS = {
        'out': GPIOHANDLE_REQUEST_OUTPUT,
        'in': GPIOHANDLE_REQUEST_INPUT,
    }

    def __init__(
            self,
            lines,
            mode="out",
            defaults=None,
            label='',
            gpio=None,
    ):
        self.num_lines = len(lines)

        if self.num_lines > GPIOHANDLES_MAX:
            raise GPIOError(
                "Can not create handle: "
                "number of lines {0} exceeds the limit ({1})"
                .format(self.num_lines, GPIOHANDLES_MAX)
            )

        self.flags = self._FLAGS.get(mode, mode)

        if not defaults:
            defaults = (0,) * self.num_lines

        self.defaults = tuple(defaults)
        self.lines = tuple(lines)
        self.label = label

        if not gpio:
            gpio = GPIOChip(_GPIO)
        self.gpio = gpio

        _request = _gpiohandle_request(
            lineoffsets=self.lines,
            flags=self.flags,
            default_values=self.defaults,
            consumer_label=self.label.encode('utf-8'),
            lines=self.num_lines,
        )

        status = libgpioctl.get_linehandle(
            self.gpio.fd,
            ctypes.byref(_request),
        )

        if status != 0:
            raise GPIOError("get_linehandle call returned non-zero status")

        self.handle = _request.fd

    def set_values(self, values):
        values = tuple(values)
        if len(values) != self.num_lines:
            raise GPIOError(
                "Number of values {0} doesn't match number of lines {1}"
                .format(len(values), self.num_lines)
            )

        if self.flags & GPIOHANDLE_REQUEST_OUTPUT == 0:
            raise GPIOError("Can not set values, as we are not in output mode")

        _data = _gpiohandle_data(values)
        status = libgpioctl.set_line_values(self.handle, ctypes.byref(_data))
        if status != 0:
            raise GPIOError("set_line_values call returned non-zero status")

    def get_values(self):
        _data = _gpiohandle_data()
        status = libgpioctl.get_line_values(self.handle, ctypes.byref(_data))
        if status != 0:
            raise GPIOError("get_line_values call returned non-zero status")

        return tuple(_data.values[:self.num_lines])

    def flip(self):
        """Change all values to the opposite"""

        current_values = self.get_values()
        new_values = tuple([1 - value for value in current_values])
        self.set_values(new_values)

class GPIOEventHandle:

    _FLAGS = {
        "rising": GPIOEVENT_REQUEST_RISING_EDGE,
        "falling": GPIOEVENT_REQUEST_FALLING_EDGE,
        "both": GPIOEVENT_REQUEST_BOTH_EDGES,
    }

    def __init__(
            self,
            line,
            mode="both",
            label='',
            gpio=None,
    ):
        self.line = line

        self.flags = self._FLAGS.get(mode, mode)

        if self.line > GPIOHANDLES_MAX:
            raise GPIOError(
                "Can not read line {0}. Line offset exceeds the limit ({1})"
                .format(self.line, GPIOHANDLES_MAX)
            )

        self.label = label
        if not gpio:
            self.gpio = GPIOChip(_GPIO)

        handle_flags = GPIOHANDLE_REQUEST_INPUT

        _request = _gpioevent_request(
            lineoffset=self.line,
            handleflags=handle_flags,
            eventflags=self.flags,
            consumer_label=self.label.encode('utf-8'),
        )

        status = libgpioctl.get_lineevent(
            self.gpio.fd,
            ctypes.byref(_request),
        )

        if status != 0:
            raise GPIOError("get_lineevent call returned non-zero status")

        self.handle = _request.fd

    def get(self):
        _data = gpioevent_data()

        status = f_read(self.handle, ctypes.byref(_data), ctypes.sizeof(_data))
        if status != ctypes.sizeof(_data):
            raise GPIOError("get_event_data error")
        return (float(_data.timestamp) / 1e9, _data.id)


text:
class Queue

  MAX_SIZE = 10

  def initialize
    @queue = []
  end

  def enqueue(elem)
    raise "Stack Overflow" if full?
    @queue.unshift(elem)
  end

  def dequeue
    raise "Nothing in Queue" if empty?
    @queue.pop
  end

  def peek
    @queue.last
  end

  def size
    @queue.size
  end

  private

  def full?
    @queue.length == MAX_SIZE
  end

  def empty?
    @queue.empty?
  end

end


text:
/**
 * TODO:
 * - Custom path support
 */

var _ = require('underscore'),
	React = require('react'),
	Field = require('../Field'),
	Note = require('../../components/Note');

module.exports = Field.create({

	componentWillMount: function() {

		var collapsedFields = {};

		_.each(['number', 'name', 'street2', 'geo'], function(i) {
			if (!this.props.value[i]) {
				collapsedFields[i] = true;
			}
		}, this);

		this.setState({
			collapsedFields: collapsedFields
		});

	},

	componentDidUpdate: function(prevProps, prevState) {
		if (prevState.fieldsCollapsed && !this.state.fieldsCollapsed) {
			this.refs.number.getDOMNode().focus();
		}
	},

	shouldCollapse: function() {
		return this.formatValue() ? false : true;
	},

	uncollapseFields: function() {
		this.setState({
			collapsedFields: {}
		});
	},

	fieldChanged: function(path, event) {
		var value = this.props.value;
		value[path] = event.target.value;
		this.props.onChange({
			path: this.props.path,
			value: value
		});
	},

	geoChanged: function(i, event) {
		var value = this.props.value;
		if (!value.geo) {
			value.geo = ['',''];
		}
		value.geo[i] = event.target.value;
		this.props.onChange({
			path: this.props.path,
			value: value
		});
	},

	formatValue: function() {
		return _.compact([
			this.props.value.number,
			this.props.value.name,
			this.props.value.street1,
			this.props.value.street2,
			this.props.value.suburb,
			this.props.value.state,
			this.props.value.postcode,
			this.props.value.country
		]).join(', ');
	},

	renderValue: function() {
		return
{this.formatValue() || '(no value)'}
;
	},

	renderField: function(path, label, collapse) {

		if (this.state.collapsedFields[path]) {
			return null;
		}

		return

				{label}

				<input type="text" name={this.props.path + '.' + path} ref={path} value={this.props.value[path]} onChange={this.fieldChanged.bind(this, path)} className="form-control" />

;

	},

	renderStateAndPostcode: function() {
		return

				State/Postcode

					<input type="text" name={this.props.path + '.state'} ref="state" value={this.props.value.state} onChange={this.fieldChanged.bind(this, 'state')} className="form-control" placeholder="State" />

					<input type="text" name={this.props.path + '.postcode'} ref="postcode" value={this.props.value.postcode} onChange={this.fieldChanged.bind(this, 'postcode')} className="form-control" placeholder="Postcode" />

;
	},

	renderGeo: function() {

		if (this.state.collapsedFields.geo) {
			return null;
		}

		return

				Lng / Lat

					<input type="text" name={this.props.paths.geo} ref="geo0" value={this.props.value.geo ? this.props.value.geo[0] : ''} onChange={this.geoChanged.bind(this, 0)} placeholder="Longitude" className="form-control" />

					<input type="text" name={this.props.paths.geo} ref="geo1" value={this.props.value.geo ? this.props.value.geo[1] : ''} onChange={this.geoChanged.bind(this, 1)} placeholder="Latitude" className="form-control" />

;

	},

	renderUI: function() {

		if (!this.shouldRenderField()) {
			return

				{this.props.label}

					{this.renderValue()}

;
		}

		var showMore = !_.isEmpty(this.state.collapsedFields)
			? (show more fields)
			: null;

		return

				{this.props.label}
				{showMore}
				{this.renderField('number', 'PO Box / Shop', true)}
				{this.renderField('name', 'Building Name', true)}
				{this.renderField('street1', 'Street Address')}
				{this.renderField('street2', 'Street Address 2', true)}
				{this.renderField('suburb', 'Suburb')}
				{this.renderStateAndPostcode()}
				{this.renderField('country', 'Country')}
				{this.renderGeo()}
				<Note note={this.props.note} />

;

	}

});


text:
title: "Get started with Sensu"
linkTitle: "Get Started with Sensu"
description: "Sensu is the industry leading solution for multi-cloud monitoring at scale. The Sensu monitoring event pipeline empowers businesses to automate their monitoring workflows and gain deep visibility into their multi-cloud environments. Get started now and feel the #monitoringlove."
version: "5.7"
weight: 1
product: "Sensu Go"
menu:
  sensu-go-5.7:
    parent: getting-started
---

### Learn Sensu in 15 minutes

Create your first monitoring event pipeline using a local development environment pre-installed with the essential Sensu stack.

- [Download the sandbox and learn Sensu Go][7]
- [See more sandbox lessons][1]
- [Join the community][8]

### Install Sensu Go (free tier)

Sensu Go is the flexible monitoring event pipeline, designed for container-based and multi-cloud infrastructures.
Get started with the free tier by installing an official Sensu distribution.

- [Install Sensu Go][2]
- [Discover Sensu assets][6]
- [Learn about license-activated features][12]

### Monitor at scale (licensed tier)

Sensu Inc. offers support packages for Sensu Go as well as license-activated features designed for monitoring at scale.

- [Learn about license-activated features][12]
- [Contact the sales team for a free trial][4]
- [Activate your Sensu license][5]

### Build from source (OSS tier)
Sensu Go's core is open source software, freely available under an MIT license.

- [Visit Sensu Go on GitHub][10]
- [Learn about OSS-tier features][12]
- [Build from source][11]

[1]: ../sandbox
[2]: ../../installation/install-sensu
[3]: https://sensu.io/products/enterprise
[4]: https://sensu.io/sales/
[5]: ../enterprise
[6]: https://bonsai.sensu.io
[7]: ../learn-sensu
[8]: https://sensu.io/community
[9]: ../../reference/license
[10]: https://github.com/sensu/sensu-go
[11]: https://github.com/sensu/sensu-go/blob/master/CONTRIBUTING.md#building
[12]: https://sensu.io/products


text:
/*
 * Table styles
 */
table.dataTable {
    width: 100%;
    margin: 0 auto;
    clear: both;
    border-spacing: 0;
    /*
     * Header and footer styles
     */
    /*
     * Body styles
     */
}

table.dataTable thead th,
table.dataTable tfoot th {
    font-weight: bold;
}

table.dataTable thead th,
table.dataTable thead td {
    border-bottom: 1px solid #111111;
}

table.dataTable thead th:active,
table.dataTable thead td:active {
    outline: none;
}

table.dataTable tfoot th,
table.dataTable tfoot td {
    border-top: 1px solid #111111;
}

table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc,
table.dataTable thead .sorting {
    cursor: pointer;
    *cursor: hand;
}

table.dataTable thead .sorting {
    background: url("/img/dataTables/sort_both.png") no-repeat center right;
}

table.dataTable thead .sorting_asc {
    background: url("/img/dataTables/sort_asc.png") no-repeat center right;
}

table.dataTable thead .sorting_desc {
    background: url("/img/dataTables/sort_desc.png") no-repeat center right;
}

table.dataTable thead .sorting_asc_disabled {
    background: url("/img/dataTables/sort_asc_disabled.png") no-repeat center right;
}

table.dataTable thead .sorting_desc_disabled {
    background: url("/img/dataTables/sort_desc_disabled.png") no-repeat center right;
}

table.dataTable tbody tr {
    background-color: white;
}

table.dataTable tbody tr.selected {
    background-color: #b0bed9;
}

table.dataTable.row-border tbody th, table.dataTable.row-border tbody td, table.dataTable.display tbody th, table.dataTable.display tbody td {
    border-top: 1px solid #dddddd;
}

table.dataTable.row-border tbody tr:first-child th,
table.dataTable.row-border tbody tr:first-child td, table.dataTable.display tbody tr:first-child th,
table.dataTable.display tbody tr:first-child td {
    border-top: none;
}

table.dataTable.cell-border tbody th, table.dataTable.cell-border tbody td {
    border-top: 1px solid #dddddd;
    border-right: 1px solid #dddddd;
}

table.dataTable.cell-border tbody tr th:first-child,
table.dataTable.cell-border tbody tr td:first-child {
    border-left: 1px solid #dddddd;
}

table.dataTable.cell-border tbody tr:first-child th,
table.dataTable.cell-border tbody tr:first-child td {
    border-top: none;
}

table.dataTable.stripe tbody tr.odd, table.dataTable.display tbody tr.odd {
    background-color: #f9f9f9;
}

table.dataTable.stripe tbody tr.odd.selected, table.dataTable.display tbody tr.odd.selected {
    background-color: #abb9d3;
}

table.dataTable.hover tbody tr:hover,
table.dataTable.hover tbody tr.odd:hover,
table.dataTable.hover tbody tr.even:hover, table.dataTable.display tbody tr:hover,
table.dataTable.display tbody tr.odd:hover,
table.dataTable.display tbody tr.even:hover {
    background-color: whitesmoke;
}

table.dataTable.hover tbody tr:hover.selected,
table.dataTable.hover tbody tr.odd:hover.selected,
table.dataTable.hover tbody tr.even:hover.selected, table.dataTable.display tbody tr:hover.selected,
table.dataTable.display tbody tr.odd:hover.selected,
table.dataTable.display tbody tr.even:hover.selected {
    background-color: #a9b7d1;
}

table.dataTable.order-column tbody tr > .sorting_1,
table.dataTable.order-column tbody tr > .sorting_2,
table.dataTable.order-column tbody tr > .sorting_3, table.dataTable.display tbody tr > .sorting_1,
table.dataTable.display tbody tr > .sorting_2,
table.dataTable.display tbody tr > .sorting_3 {
    background-color: #f9f9f9;
}

table.dataTable.order-column tbody tr.selected > .sorting_1,
table.dataTable.order-column tbody tr.selected > .sorting_2,
table.dataTable.order-column tbody tr.selected > .sorting_3, table.dataTable.display tbody tr.selected > .sorting_1,
table.dataTable.display tbody tr.selected > .sorting_2,
table.dataTable.display tbody tr.selected > .sorting_3 {
    background-color: #acbad4;
}

table.dataTable.display tbody tr.odd > .sorting_1, table.dataTable.order-column.stripe tbody tr.odd > .sorting_1 {
    background-color: #f1f1f1;
}

table.dataTable.display tbody tr.odd > .sorting_2, table.dataTable.order-column.stripe tbody tr.odd > .sorting_2 {
    background-color: #f3f3f3;
}

table.dataTable.display tbody tr.odd > .sorting_3, table.dataTable.order-column.stripe tbody tr.odd > .sorting_3 {
    background-color: whitesmoke;
}

table.dataTable.display tbody tr.odd.selected > .sorting_1, table.dataTable.order-column.stripe tbody tr.odd.selected > .sorting_1 {
    background-color: #a6b3cd;
}

table.dataTable.display tbody tr.odd.selected > .sorting_2, table.dataTable.order-column.stripe tbody tr.odd.selected > .sorting_2 {
    background-color: #a7b5ce;
}

table.dataTable.display tbody tr.odd.selected > .sorting_3, table.dataTable.order-column.stripe tbody tr.odd.selected > .sorting_3 {
    background-color: #a9b6d0;
}

table.dataTable.display tbody tr.even > .sorting_1, table.dataTable.order-column.stripe tbody tr.even > .sorting_1 {
    background-color: #f9f9f9;
}

table.dataTable.display tbody tr.even > .sorting_2, table.dataTable.order-column.stripe tbody tr.even > .sorting_2 {
    background-color: #fbfbfb;
}

table.dataTable.display tbody tr.even > .sorting_3, table.dataTable.order-column.stripe tbody tr.even > .sorting_3 {
    background-color: #fdfdfd;
}

table.dataTable.display tbody tr.even.selected > .sorting_1, table.dataTable.order-column.stripe tbody tr.even.selected > .sorting_1 {
    background-color: #acbad4;
}

table.dataTable.display tbody tr.even.selected > .sorting_2, table.dataTable.order-column.stripe tbody tr.even.selected > .sorting_2 {
    background-color: #adbbd6;
}

table.dataTable.display tbody tr.even.selected > .sorting_3, table.dataTable.order-column.stripe tbody tr.even.selected > .sorting_3 {
    background-color: #afbdd8;
}

table.dataTable.display tbody tr:hover > .sorting_1,
table.dataTable.display tbody tr.odd:hover > .sorting_1,
table.dataTable.display tbody tr.even:hover > .sorting_1, table.dataTable.order-column.hover tbody tr:hover > .sorting_1,
table.dataTable.order-column.hover tbody tr.odd:hover > .sorting_1,
table.dataTable.order-column.hover tbody tr.even:hover > .sorting_1 {
    background-color: #eaeaea;
}

table.dataTable.display tbody tr:hover > .sorting_2,
table.dataTable.display tbody tr.odd:hover > .sorting_2,
table.dataTable.display tbody tr.even:hover > .sorting_2, table.dataTable.order-column.hover tbody tr:hover > .sorting_2,
table.dataTable.order-column.hover tbody tr.odd:hover > .sorting_2,
table.dataTable.order-column.hover tbody tr.even:hover > .sorting_2 {
    background-color: #ebebeb;
}

table.dataTable.display tbody tr:hover > .sorting_3,
table.dataTable.display tbody tr.odd:hover > .sorting_3,
table.dataTable.display tbody tr.even:hover > .sorting_3, table.dataTable.order-column.hover tbody tr:hover > .sorting_3,
table.dataTable.order-column.hover tbody tr.odd:hover > .sorting_3,
table.dataTable.order-column.hover tbody tr.even:hover > .sorting_3 {
    background-color: #eeeeee;
}

table.dataTable.display tbody tr:hover.selected > .sorting_1,
table.dataTable.display tbody tr.odd:hover.selected > .sorting_1,
table.dataTable.display tbody tr.even:hover.selected > .sorting_1, table.dataTable.order-column.hover tbody tr:hover.selected > .sorting_1,
table.dataTable.order-column.hover tbody tr.odd:hover.selected > .sorting_1,
table.dataTable.order-column.hover tbody tr.even:hover.selected > .sorting_1 {
    background-color: #a1aec7;
}

table.dataTable.display tbody tr:hover.selected > .sorting_2,
table.dataTable.display tbody tr.odd:hover.selected > .sorting_2,
table.dataTable.display tbody tr.even:hover.selected > .sorting_2, table.dataTable.order-column.hover tbody tr:hover.selected > .sorting_2,
table.dataTable.order-column.hover tbody tr.odd:hover.selected > .sorting_2,
table.dataTable.order-column.hover tbody tr.even:hover.selected > .sorting_2 {
    background-color: #a2afc8;
}

table.dataTable.display tbody tr:hover.selected > .sorting_3,
table.dataTable.display tbody tr.odd:hover.selected > .sorting_3,
table.dataTable.display tbody tr.even:hover.selected > .sorting_3, table.dataTable.order-column.hover tbody tr:hover.selected > .sorting_3,
table.dataTable.order-column.hover tbody tr.odd:hover.selected > .sorting_3,
table.dataTable.order-column.hover tbody tr.even:hover.selected > .sorting_3 {
    background-color: #a4b2cb;
}

table.dataTable.no-footer {
    border-bottom: 1px solid #111111;
}

table.dataTable.nowrap th, table.dataTable.nowrap td {
    white-space: nowrap;
}

table.dataTable th.dt-left,
table.dataTable td.dt-left {
    text-align: left;
}

table.dataTable th.dt-center,
table.dataTable td.dt-center,
table.dataTable td.dataTables_empty {
    text-align: center;
}

table.dataTable th.dt-right,
table.dataTable td.dt-right {
    text-align: right;
}

table.dataTable th.dt-justify,
table.dataTable td.dt-justify {
    text-align: justify;
}

table.dataTable th.dt-nowrap,
table.dataTable td.dt-nowrap {
    white-space: nowrap;
}

table.dataTable thead th.dt-head-left,
table.dataTable thead td.dt-head-left,
table.dataTable tfoot th.dt-head-left,
table.dataTable tfoot td.dt-head-left {
    text-align: left;
}

table.dataTable thead th.dt-head-center,
table.dataTable thead td.dt-head-center,
table.dataTable tfoot th.dt-head-center,
table.dataTable tfoot td.dt-head-center {
    text-align: center;
}

table.dataTable thead th.dt-head-right,
table.dataTable thead td.dt-head-right,
table.dataTable tfoot th.dt-head-right,
table.dataTable tfoot td.dt-head-right {
    text-align: right;
}

table.dataTable thead th.dt-head-justify,
table.dataTable thead td.dt-head-justify,
table.dataTable tfoot th.dt-head-justify,
table.dataTable tfoot td.dt-head-justify {
    text-align: justify;
}

table.dataTable thead th.dt-head-nowrap,
table.dataTable thead td.dt-head-nowrap,
table.dataTable tfoot th.dt-head-nowrap,
table.dataTable tfoot td.dt-head-nowrap {
    white-space: nowrap;
}

table.dataTable tbody th.dt-body-left,
table.dataTable tbody td.dt-body-left {
    text-align: left;
}

table.dataTable tbody th.dt-body-center,
table.dataTable tbody td.dt-body-center {
    text-align: center;
}

table.dataTable tbody th.dt-body-right,
table.dataTable tbody td.dt-body-right {
    text-align: right;
}

table.dataTable tbody th.dt-body-justify,
table.dataTable tbody td.dt-body-justify {
    text-align: justify;
}

table.dataTable tbody th.dt-body-nowrap,
table.dataTable tbody td.dt-body-nowrap {
    white-space: nowrap;
}

table.dataTable,
table.dataTable th,
table.dataTable td {
    -webkit-box-sizing: content-box;
    -moz-box-sizing: content-box;
    box-sizing: content-box;
}

/*
 * Control feature layout
 */
.dataTables_wrapper {
    position: relative;
    clear: both;
    padding-top: 10px;
    padding-bottom: 10px;
    *zoom: 1;
    zoom: 1;
}

.dataTables_wrapper .dataTables_length {
    float: left;
}

.dataTables_wrapper .dataTables_filter {
    float: right;
    text-align: right;
}

.dataTables_wrapper .dataTables_filter input {
    margin-right: 0.5em;
}

.dataTables_wrapper .dataTables_length select {
    height: 2rem;
}

.dataTables_wrapper .dataTables_length label {
    height: 2rem;
}

.dataTables_wrapper .dataTables_info {
    clear: both;
    float: left;
    padding-top: 0.755em;
}

.dataTables_paginate:first-child > a, .dataTables_paginate:first-child > span {
    margin-left: 0;
}

.dataTables_wrapper .dataTables_paginate {
    float: right;
    text-align: right;
    margin-top: 0.25em;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    box-sizing: border-box;
    display: inline-block;
    min-width: 1.5em;
    padding: 0.5em 1em;
    text-align: center;
    text-decoration: none !important;
    cursor: pointer;
    *cursor: hand;
    color: #333333 !important;
    border: 1px solid transparent;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current, .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    color: #333333 !important;
    background-color: #cacaca;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled, .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover, .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active {
    cursor: not-allowed;
    color: #666 !important;
    border: 1px solid transparent;
    background: transparent;
    box-shadow: none;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    color: white !important;
    background-color: #585858;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:active {
    outline: none;
    background-color: #2b2b2b;
}

.dataTables_wrapper .dataTables_processing {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 40px;
    margin-left: -50%;
    margin-top: -25px;
    padding-top: 20px;
    text-align: center;
    font-size: 1.2em;
    background-color: white;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_paginate {
    color: #333333;
}

.dataTables_wrapper .dataTables_scroll {
    clear: both;
}

.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody {
    *margin-top: -1px;
    -webkit-overflow-scrolling: touch;
}

.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody th > div.dataTables_sizing,
.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody td > div.dataTables_sizing {
    height: 0;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
}

.dataTables_wrapper.no-footer .dataTables_scrollBody {
    border-bottom: 1px solid #111111;
}

.dataTables_wrapper.no-footer div.dataTables_scrollHead table,
.dataTables_wrapper.no-footer div.dataTables_scrollBody table {
    border-bottom: none;
}

.dataTables_wrapper:after {
    visibility: hidden;
    display: block;
    content: "";
    clear: both;
    height: 0;
}

@media screen and (max-width: 767px) {
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        float: none;
        text-align: center;
    }

    .dataTables_wrapper .dataTables_paginate {
        margin-top: 0.5em;
    }
}

@media screen and (max-width: 640px) {
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        float: none;
        text-align: center;
    }

    .dataTables_wrapper .dataTables_filter {
        margin-top: 0.5em;
    }
}


text:
from pinball_ext.job.hadoop_jobs import HadoopJob

class EmrWordCount(HadoopJob):
    def _get_class_name(self):
        return 'wordcount.WordCount'

    def _setup(self):
        self.extra_arguments = [
            # your input path
            's3://your_bucket/data/wordcount.input',
            # your output path
            's3://your_bucket/data/%(end_date)s/wordcount.output'
            % self.params
        ]


text:
package io.netty.buffer;

import io.netty.util.internal.PlatformDependent;
import org.junit.BeforeClass;

import java.nio.ByteBuffer;

import static org.junit.Assume.assumeTrue;

public class ReadOnlyUnsafeDirectByteBufferBufTest extends ReadOnlyDirectByteBufferBufTest {

    /**
     * Needs unsafe to run
     */
    @BeforeClass
    public static void assumeConditions() {
        assumeTrue("sun.misc.Unsafe not found, skip tests", PlatformDependent.hasUnsafe());
    }

    @Override
    protected ByteBuf buffer(ByteBuffer buffer) {
        return new ReadOnlyUnsafeDirectByteBuf(UnpooledByteBufAllocator.DEFAULT, buffer);
    }
}


text:
package monkey

import (
	"flag"
	"math/rand"
	"net"
	"time"

	"github.com/ian-kent/linkio"
)

// Jim is a chaos monkey
type Jim struct {
	DisconnectChance      float64
	AcceptChance          float64
	LinkSpeedAffect       float64
	LinkSpeedMin          float64
	LinkSpeedMax          float64
	RejectSenderChance    float64
	RejectRecipientChance float64
	RejectAuthChance      float64
	logf                  func(message string, args ...interface{})
}

// RegisterFlags implements ChaosMonkey.RegisterFlags
func (j *Jim) RegisterFlags() {
	flag.Float64Var(&j.DisconnectChance, "jim-disconnect", 0.005, "Chance of disconnect")
	flag.Float64Var(&j.AcceptChance, "jim-accept", 0.99, "Chance of accept")
	flag.Float64Var(&j.LinkSpeedAffect, "jim-linkspeed-affect", 0.1, "Chance of affecting link speed")
	flag.Float64Var(&j.LinkSpeedMin, "jim-linkspeed-min", 1024, "Minimum link speed (in bytes per second)")
	flag.Float64Var(&j.LinkSpeedMax, "jim-linkspeed-max", 10240, "Maximum link speed (in bytes per second)")
	flag.Float64Var(&j.RejectSenderChance, "jim-reject-sender", 0.05, "Chance of rejecting a sender (MAIL FROM)")
	flag.Float64Var(&j.RejectRecipientChance, "jim-reject-recipient", 0.05, "Chance of rejecting a recipient (RCPT TO)")
	flag.Float64Var(&j.RejectAuthChance, "jim-reject-auth", 0.05, "Chance of rejecting authentication (AUTH)")
}

// Configure implements ChaosMonkey.Configure
func (j *Jim) Configure(logf func(string, ...interface{})) {
	j.logf = logf
	rand.Seed(time.Now().Unix())
}

// ConfigureFrom lets us configure a new Jim from an old one without
// having to expose logf (and any other future private vars)
func (j *Jim) ConfigureFrom(j2 *Jim) {
	j.Configure(j2.logf)
}

// Accept implements ChaosMonkey.Accept
func (j *Jim) Accept(conn net.Conn) bool {
	if rand.Float64() > j.AcceptChance {
		j.logf("Jim: Rejecting connection\n")
		return false
	}
	j.logf("Jim: Allowing connection\n")
	return true
}

// LinkSpeed implements ChaosMonkey.LinkSpeed
func (j *Jim) LinkSpeed() *linkio.Throughput {
	rand.Seed(time.Now().Unix())
	if rand.Float64() < j.LinkSpeedAffect {
		lsDiff := j.LinkSpeedMax - j.LinkSpeedMin
		lsAffect := j.LinkSpeedMin + (lsDiff * rand.Float64())
		f := linkio.Throughput(lsAffect) * linkio.BytePerSecond
		j.logf("Jim: Restricting throughput to %s\n", f)
		return &f
	}
	j.logf("Jim: Allowing unrestricted throughput")
	return nil
}

// ValidRCPT implements ChaosMonkey.ValidRCPT
func (j *Jim) ValidRCPT(rcpt string) bool {
	if rand.Float64() < j.RejectRecipientChance {
		j.logf("Jim: Rejecting recipient %s\n", rcpt)
		return false
	}
	j.logf("Jim: Allowing recipient%s\n", rcpt)
	return true
}

// ValidMAIL implements ChaosMonkey.ValidMAIL
func (j *Jim) ValidMAIL(mail string) bool {
	if rand.Float64() < j.RejectSenderChance {
		j.logf("Jim: Rejecting sender %s\n", mail)
		return false
	}
	j.logf("Jim: Allowing sender %s\n", mail)
	return true
}

// ValidAUTH implements ChaosMonkey.ValidAUTH
func (j *Jim) ValidAUTH(mechanism string, args ...string) bool {
	if rand.Float64() < j.RejectAuthChance {
		j.logf("Jim: Rejecting authentication %s: %s\n", mechanism, args)
		return false
	}
	j.logf("Jim: Allowing authentication %s: %s\n", mechanism, args)
	return true
}

// Disconnect implements ChaosMonkey.Disconnect
func (j *Jim) Disconnect() bool {
	if rand.Float64() < j.DisconnectChance {
		j.logf("Jim: Being nasty, kicking them off\n")
		return true
	}
	j.logf("Jim: Being nice, letting them stay\n")
	return false
}


text:
/*!
 * vue-resource v1.3.3
 * https://github.com/pagekit/vue-resource
 * Released under the MIT License.
 */

(function (global, factory) {
	typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
	typeof define === 'function' && define.amd ? define(factory) :
	(global.VueResource = factory());
}(this, (function () { 'use strict';

/**
 * Promises/A+ polyfill v1.1.4 (https://github.com/bramstein/promis)
 */

var RESOLVED = 0;
var REJECTED = 1;
var PENDING  = 2;

function Promise$1(executor) {

    this.state = PENDING;
    this.value = undefined;
    this.deferred = [];

    var promise = this;

    try {
        executor(function (x) {
            promise.resolve(x);
        }, function (r) {
            promise.reject(r);
        });
    } catch (e) {
        promise.reject(e);
    }
}

Promise$1.reject = function (r) {
    return new Promise$1(function (resolve, reject) {
        reject(r);
    });
};

Promise$1.resolve = function (x) {
    return new Promise$1(function (resolve, reject) {
        resolve(x);
    });
};

Promise$1.all = function all(iterable) {
    return new Promise$1(function (resolve, reject) {
        var count = 0, result = [];

        if (iterable.length === 0) {
            resolve(result);
        }

        function resolver(i) {
            return function (x) {
                result[i] = x;
                count += 1;

                if (count === iterable.length) {
                    resolve(result);
                }
            };
        }

        for (var i = 0; i < iterable.length; i += 1) {
            Promise$1.resolve(iterable[i]).then(resolver(i), reject);
        }
    });
};

Promise$1.race = function race(iterable) {
    return new Promise$1(function (resolve, reject) {
        for (var i = 0; i < iterable.length; i += 1) {
            Promise$1.resolve(iterable[i]).then(resolve, reject);
        }
    });
};

var p$1 = Promise$1.prototype;

p$1.resolve = function resolve(x) {
    var promise = this;

    if (promise.state === PENDING) {
        if (x === promise) {
            throw new TypeError('Promise settled with itself.');
        }

        var called = false;

        try {
            var then = x && x['then'];

            if (x !== null && typeof x === 'object' && typeof then === 'function') {
                then.call(x, function (x) {
                    if (!called) {
                        promise.resolve(x);
                    }
                    called = true;

                }, function (r) {
                    if (!called) {
                        promise.reject(r);
                    }
                    called = true;
                });
                return;
            }
        } catch (e) {
            if (!called) {
                promise.reject(e);
            }
            return;
        }

        promise.state = RESOLVED;
        promise.value = x;
        promise.notify();
    }
};

p$1.reject = function reject(reason) {
    var promise = this;

    if (promise.state === PENDING) {
        if (reason === promise) {
            throw new TypeError('Promise settled with itself.');
        }

        promise.state = REJECTED;
        promise.value = reason;
        promise.notify();
    }
};

p$1.notify = function notify() {
    var promise = this;

    nextTick(function () {
        if (promise.state !== PENDING) {
            while (promise.deferred.length) {
                var deferred = promise.deferred.shift(),
                    onResolved = deferred[0],
                    onRejected = deferred[1],
                    resolve = deferred[2],
                    reject = deferred[3];

                try {
                    if (promise.state === RESOLVED) {
                        if (typeof onResolved === 'function') {
                            resolve(onResolved.call(undefined, promise.value));
                        } else {
                            resolve(promise.value);
                        }
                    } else if (promise.state === REJECTED) {
                        if (typeof onRejected === 'function') {
                            resolve(onRejected.call(undefined, promise.value));
                        } else {
                            reject(promise.value);
                        }
                    }
                } catch (e) {
                    reject(e);
                }
            }
        }
    });
};

p$1.then = function then(onResolved, onRejected) {
    var promise = this;

    return new Promise$1(function (resolve, reject) {
        promise.deferred.push([onResolved, onRejected, resolve, reject]);
        promise.notify();
    });
};

p$1.catch = function (onRejected) {
    return this.then(undefined, onRejected);
};

/**
 * Promise adapter.
 */

if (typeof Promise === 'undefined') {
    window.Promise = Promise$1;
}

function PromiseObj(executor, context) {

    if (executor instanceof Promise) {
        this.promise = executor;
    } else {
        this.promise = new Promise(executor.bind(context));
    }

    this.context = context;
}

PromiseObj.all = function (iterable, context) {
    return new PromiseObj(Promise.all(iterable), context);
};

PromiseObj.resolve = function (value, context) {
    return new PromiseObj(Promise.resolve(value), context);
};

PromiseObj.reject = function (reason, context) {
    return new PromiseObj(Promise.reject(reason), context);
};

PromiseObj.race = function (iterable, context) {
    return new PromiseObj(Promise.race(iterable), context);
};

var p = PromiseObj.prototype;

p.bind = function (context) {
    this.context = context;
    return this;
};

p.then = function (fulfilled, rejected) {

    if (fulfilled && fulfilled.bind && this.context) {
        fulfilled = fulfilled.bind(this.context);
    }

    if (rejected && rejected.bind && this.context) {
        rejected = rejected.bind(this.context);
    }

    return new PromiseObj(this.promise.then(fulfilled, rejected), this.context);
};

p.catch = function (rejected) {

    if (rejected && rejected.bind && this.context) {
        rejected = rejected.bind(this.context);
    }

    return new PromiseObj(this.promise.catch(rejected), this.context);
};

p.finally = function (callback) {

    return this.then(function (value) {
            callback.call(this);
            return value;
        }, function (reason) {
            callback.call(this);
            return Promise.reject(reason);
        }
    );
};

/**
 * Utility functions.
 */

var ref = {};
var hasOwnProperty = ref.hasOwnProperty;

var ref$1 = [];
var slice = ref$1.slice;
var debug = false;
var ntick;

var inBrowser = typeof window !== 'undefined';

var Util = function (ref) {
    var config = ref.config;
    var nextTick = ref.nextTick;

    ntick = nextTick;
    debug = config.debug || !config.silent;
};

function warn(msg) {
    if (typeof console !== 'undefined' && debug) {
        console.warn('[VueResource warn]: ' + msg);
    }
}

function error(msg) {
    if (typeof console !== 'undefined') {
        console.error(msg);
    }
}

function nextTick(cb, ctx) {
    return ntick(cb, ctx);
}

function trim(str) {
    return str ? str.replace(/^\s*|\s*$/g, '') : '';
}

function trimEnd(str, chars) {

    if (str && chars === undefined) {
        return str.replace(/\s+$/, '');
    }

    if (!str || !chars) {
        return str;
    }

    return str.replace(new RegExp(("[" + chars + "]+$")), '');
}

function toLower(str) {
    return str ? str.toLowerCase() : '';
}

function toUpper(str) {
    return str ? str.toUpperCase() : '';
}

var isArray = Array.isArray;

function isString(val) {
    return typeof val === 'string';
}

function isFunction(val) {
    return typeof val === 'function';
}

function isObject(obj) {
    return obj !== null && typeof obj === 'object';
}

function isPlainObject(obj) {
    return isObject(obj) && Object.getPrototypeOf(obj) == Object.prototype;
}

function isBlob(obj) {
    return typeof Blob !== 'undefined' && obj instanceof Blob;
}

function isFormData(obj) {
    return typeof FormData !== 'undefined' && obj instanceof FormData;
}

function when(value, fulfilled, rejected) {

    var promise = PromiseObj.resolve(value);

    if (arguments.length < 2) {
        return promise;
    }

    return promise.then(fulfilled, rejected);
}

function options(fn, obj, opts) {

    opts = opts || {};

    if (isFunction(opts)) {
        opts = opts.call(obj);
    }

    return merge(fn.bind({$vm: obj, $options: opts}), fn, {$options: opts});
}

function each(obj, iterator) {

    var i, key;

    if (isArray(obj)) {
        for (i = 0; i < obj.length; i++) {
            iterator.call(obj[i], obj[i], i);
        }
    } else if (isObject(obj)) {
        for (key in obj) {
            if (hasOwnProperty.call(obj, key)) {
                iterator.call(obj[key], obj[key], key);
            }
        }
    }

    return obj;
}

var assign = Object.assign || _assign;

function merge(target) {

    var args = slice.call(arguments, 1);

    args.forEach(function (source) {
        _merge(target, source, true);
    });

    return target;
}

function defaults(target) {

    var args = slice.call(arguments, 1);

    args.forEach(function (source) {

        for (var key in source) {
            if (target[key] === undefined) {
                target[key] = source[key];
            }
        }

    });

    return target;
}

function _assign(target) {

    var args = slice.call(arguments, 1);

    args.forEach(function (source) {
        _merge(target, source);
    });

    return target;
}

function _merge(target, source, deep) {
    for (var key in source) {
        if (deep && (isPlainObject(source[key]) || isArray(source[key]))) {
            if (isPlainObject(source[key]) && !isPlainObject(target[key])) {
                target[key] = {};
            }
            if (isArray(source[key]) && !isArray(target[key])) {
                target[key] = [];
            }
            _merge(target[key], source[key], deep);
        } else if (source[key] !== undefined) {
            target[key] = source[key];
        }
    }
}

/**
 * Root Prefix Transform.
 */

var root = function (options$$1, next) {

    var url = next(options$$1);

    if (isString(options$$1.root) && !/^(https?:)?\//.test(url)) {
        url = trimEnd(options$$1.root, '/') + '/' + url;
    }

    return url;
};

/**
 * Query Parameter Transform.
 */

var query = function (options$$1, next) {

    var urlParams = Object.keys(Url.options.params), query = {}, url = next(options$$1);

    each(options$$1.params, function (value, key) {
        if (urlParams.indexOf(key) === -1) {
            query[key] = value;
        }
    });

    query = Url.params(query);

    if (query) {
        url += (url.indexOf('?') == -1 ? '?' : '&') + query;
    }

    return url;
};

/**
 * URL Template v2.0.6 (https://github.com/bramstein/url-template)
 */

function expand(url, params, variables) {

    var tmpl = parse(url), expanded = tmpl.expand(params);

    if (variables) {
        variables.push.apply(variables, tmpl.vars);
    }

    return expanded;
}

function parse(template) {

    var operators = ['+', '#', '.', '/', ';', '?', '&'], variables = [];

    return {
        vars: variables,
        expand: function expand(context) {
            return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
                if (expression) {

                    var operator = null, values = [];

                    if (operators.indexOf(expression.charAt(0)) !== -1) {
                        operator = expression.charAt(0);
                        expression = expression.substr(1);
                    }

                    expression.split(/,/g).forEach(function (variable) {
                        var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
                        values.push.apply(values, getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
                        variables.push(tmp[1]);
                    });

                    if (operator && operator !== '+') {

                        var separator = ',';

                        if (operator === '?') {
                            separator = '&';
                        } else if (operator !== '#') {
                            separator = operator;
                        }

                        return (values.length !== 0 ? operator : '') + values.join(separator);
                    } else {
                        return values.join(',');
                    }

                } else {
                    return encodeReserved(literal);
                }
            });
        }
    };
}

function getValues(context, operator, key, modifier) {

    var value = context[key], result = [];

    if (isDefined(value) && value !== '') {
        if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
            value = value.toString();

            if (modifier && modifier !== '*') {
                value = value.substring(0, parseInt(modifier, 10));
            }

            result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : null));
        } else {
            if (modifier === '*') {
                if (Array.isArray(value)) {
                    value.filter(isDefined).forEach(function (value) {
                        result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : null));
                    });
                } else {
                    Object.keys(value).forEach(function (k) {
                        if (isDefined(value[k])) {
                            result.push(encodeValue(operator, value[k], k));
                        }
                    });
                }
            } else {
                var tmp = [];

                if (Array.isArray(value)) {
                    value.filter(isDefined).forEach(function (value) {
                        tmp.push(encodeValue(operator, value));
                    });
                } else {
                    Object.keys(value).forEach(function (k) {
                        if (isDefined(value[k])) {
                            tmp.push(encodeURIComponent(k));
                            tmp.push(encodeValue(operator, value[k].toString()));
                        }
                    });
                }

                if (isKeyOperator(operator)) {
                    result.push(encodeURIComponent(key) + '=' + tmp.join(','));
                } else if (tmp.length !== 0) {
                    result.push(tmp.join(','));
                }
            }
        }
    } else {
        if (operator === ';') {
            result.push(encodeURIComponent(key));
        } else if (value === '' && (operator === '&' || operator === '?')) {
            result.push(encodeURIComponent(key) + '=');
        } else if (value === '') {
            result.push('');
        }
    }

    return result;
}

function isDefined(value) {
    return value !== undefined && value !== null;
}

function isKeyOperator(operator) {
    return operator === ';' || operator === '&' || operator === '?';
}

function encodeValue(operator, value, key) {

    value = (operator === '+' || operator === '#') ? encodeReserved(value) : encodeURIComponent(value);

    if (key) {
        return encodeURIComponent(key) + '=' + value;
    } else {
        return value;
    }
}

function encodeReserved(str) {
    return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
        if (!/%[0-9A-Fa-f]/.test(part)) {
            part = encodeURI(part);
        }
        return part;
    }).join('');
}

/**
 * URL Template (RFC 6570) Transform.
 */

var template = function (options) {

    var variables = [], url = expand(options.url, options.params, variables);

    variables.forEach(function (key) {
        delete options.params[key];
    });

    return url;
};

/**
 * Service for URL templating.
 */

function Url(url, params) {

    var self = this || {}, options$$1 = url, transform;

    if (isString(url)) {
        options$$1 = {url: url, params: params};
    }

    options$$1 = merge({}, Url.options, self.$options, options$$1);

    Url.transforms.forEach(function (handler) {

        if (isString(handler)) {
            handler = Url.transform[handler];
        }

        if (isFunction(handler)) {
            transform = factory(handler, transform, self.$vm);
        }

    });

    return transform(options$$1);
}

/**
 * Url options.
 */

Url.options = {
    url: '',
    root: null,
    params: {}
};

/**
 * Url transforms.
 */

Url.transform = {template: template, query: query, root: root};
Url.transforms = ['template', 'query', 'root'];

/**
 * Encodes a Url parameter string.
 *
 * @param {Object} obj
 */

Url.params = function (obj) {

    var params = [], escape = encodeURIComponent;

    params.add = function (key, value) {

        if (isFunction(value)) {
            value = value();
        }

        if (value === null) {
            value = '';
        }

        this.push(escape(key) + '=' + escape(value));
    };

    serialize(params, obj);

    return params.join('&').replace(/%20/g, '+');
};

/**
 * Parse a URL and return its components.
 *
 * @param {String} url
 */

Url.parse = function (url) {

    var el = document.createElement('a');

    if (document.documentMode) {
        el.href = url;
        url = el.href;
    }

    el.href = url;

    return {
        href: el.href,
        protocol: el.protocol ? el.protocol.replace(/:$/, '') : '',
        port: el.port,
        host: el.host,
        hostname: el.hostname,
        pathname: el.pathname.charAt(0) === '/' ? el.pathname : '/' + el.pathname,
        search: el.search ? el.search.replace(/^\?/, '') : '',
        hash: el.hash ? el.hash.replace(/^#/, '') : ''
    };
};

function factory(handler, next, vm) {
    return function (options$$1) {
        return handler.call(vm, options$$1, next);
    };
}

function serialize(params, obj, scope) {

    var array = isArray(obj), plain = isPlainObject(obj), hash;

    each(obj, function (value, key) {

        hash = isObject(value) || isArray(value);

        if (scope) {
            key = scope + '[' + (plain || hash ? key : '') + ']';
        }

        if (!scope && array) {
            params.add(value.name, value.value);
        } else if (hash) {
            serialize(params, value, key);
        } else {
            params.add(key, value);
        }
    });
}

/**
 * XDomain client (Internet Explorer).
 */

var xdrClient = function (request) {
    return new PromiseObj(function (resolve) {

        var xdr = new XDomainRequest(), handler = function (ref) {
            var type = ref.type;

            var status = 0;

            if (type === 'load') {
                status = 200;
            } else if (type === 'error') {
                status = 500;
            }

            resolve(request.respondWith(xdr.responseText, {status: status}));
        };

        request.abort = function () { return xdr.abort(); };

        xdr.open(request.method, request.getUrl());

        if (request.timeout) {
            xdr.timeout = request.timeout;
        }

        xdr.onload = handler;
        xdr.onabort = handler;
        xdr.onerror = handler;
        xdr.ontimeout = handler;
        xdr.onprogress = function () {};
        xdr.send(request.getBody());
    });
};

/**
 * CORS Interceptor.
 */

var SUPPORTS_CORS = inBrowser && 'withCredentials' in new XMLHttpRequest();

var cors = function (request, next) {

    if (inBrowser) {

        var orgUrl = Url.parse(location.href);
        var reqUrl = Url.parse(request.getUrl());

        if (reqUrl.protocol !== orgUrl.protocol || reqUrl.host !== orgUrl.host) {

            request.crossOrigin = true;
            request.emulateHTTP = false;

            if (!SUPPORTS_CORS) {
                request.client = xdrClient;
            }
        }
    }

    next();
};

/**
 * Form data Interceptor.
 */

var form = function (request, next) {

    if (isFormData(request.body)) {

        request.headers.delete('Content-Type');

    } else if (isObject(request.body) && request.emulateJSON) {

        request.body = Url.params(request.body);
        request.headers.set('Content-Type', 'application/x-www-form-urlencoded');
    }

    next();
};

/**
 * JSON Interceptor.
 */

var json = function (request, next) {

    var type = request.headers.get('Content-Type') || '';

    if (isObject(request.body) && type.indexOf('application/json') === 0) {
        request.body = JSON.stringify(request.body);
    }

    next(function (response) {

        return response.bodyText ? when(response.text(), function (text) {

            type = response.headers.get('Content-Type') || '';

            if (type.indexOf('application/json') === 0 || isJson(text)) {

                try {
                    response.body = JSON.parse(text);
                } catch (e) {
                    response.body = null;
                }

            } else {
                response.body = text;
            }

            return response;

        }) : response;

    });
};

function isJson(str) {

    var start = str.match(/^\[|^\{(?!\{)/), end = {'[': /]$/, '{': /}$/};

    return start && end[start[0]].test(str);
}

/**
 * JSONP client (Browser).
 */

var jsonpClient = function (request) {
    return new PromiseObj(function (resolve) {

        var name = request.jsonp || 'callback', callback = request.jsonpCallback || '_jsonp' + Math.random().toString(36).substr(2), body = null, handler, script;

        handler = function (ref) {
            var type = ref.type;

            var status = 0;

            if (type === 'load' && body !== null) {
                status = 200;
            } else if (type === 'error') {
                status = 500;
            }

            if (status && window[callback]) {
                delete window[callback];
                document.body.removeChild(script);
            }

            resolve(request.respondWith(body, {status: status}));
        };

        window[callback] = function (result) {
            body = JSON.stringify(result);
        };

        request.abort = function () {
            handler({type: 'abort'});
        };

        request.params[name] = callback;

        if (request.timeout) {
            setTimeout(request.abort, request.timeout);
        }

        script = document.createElement('script');
        script.src = request.getUrl();
        script.type = 'text/javascript';
        script.async = true;
        script.onload = handler;
        script.onerror = handler;

        document.body.appendChild(script);
    });
};

/**
 * JSONP Interceptor.
 */

var jsonp = function (request, next) {

    if (request.method == 'JSONP') {
        request.client = jsonpClient;
    }

    next();
};

/**
 * Before Interceptor.
 */

var before = function (request, next) {

    if (isFunction(request.before)) {
        request.before.call(this, request);
    }

    next();
};

/**
 * HTTP method override Interceptor.
 */

var method = function (request, next) {

    if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {
        request.headers.set('X-HTTP-Method-Override', request.method);
        request.method = 'POST';
    }

    next();
};

/**
 * Header Interceptor.
 */

var header = function (request, next) {

    var headers = assign({}, Http.headers.common,
        !request.crossOrigin ? Http.headers.custom : {},
        Http.headers[toLower(request.method)]
    );

    each(headers, function (value, name) {
        if (!request.headers.has(name)) {
            request.headers.set(name, value);
        }
    });

    next();
};

/**
 * XMLHttp client (Browser).
 */

var xhrClient = function (request) {
    return new PromiseObj(function (resolve) {

        var xhr = new XMLHttpRequest(), handler = function (event) {

            var response = request.respondWith(
                'response' in xhr ? xhr.response : xhr.responseText, {
                    status: xhr.status === 1223 ? 204 : xhr.status, // IE9 status bug
                    statusText: xhr.status === 1223 ? 'No Content' : trim(xhr.statusText)
                }
            );

            each(trim(xhr.getAllResponseHeaders()).split('\n'), function (row) {
                response.headers.append(row.slice(0, row.indexOf(':')), row.slice(row.indexOf(':') + 1));
            });

            resolve(response);
        };

        request.abort = function () { return xhr.abort(); };

        if (request.progress) {
            if (request.method === 'GET') {
                xhr.addEventListener('progress', request.progress);
            } else if (/^(POST|PUT)$/i.test(request.method)) {
                xhr.upload.addEventListener('progress', request.progress);
            }
        }

        xhr.open(request.method, request.getUrl(), true);

        if (request.timeout) {
            xhr.timeout = request.timeout;
        }

        if (request.responseType && 'responseType' in xhr) {
            xhr.responseType = request.responseType;
        }

        if (request.withCredentials || request.credentials) {
            xhr.withCredentials = true;
        }

        if (!request.crossOrigin) {
            request.headers.set('X-Requested-With', 'XMLHttpRequest');
        }

        request.headers.forEach(function (value, name) {
            xhr.setRequestHeader(name, value);
        });

        xhr.onload = handler;
        xhr.onabort = handler;
        xhr.onerror = handler;
        xhr.ontimeout = handler;
        xhr.send(request.getBody());
    });
};

/**
 * Http client (Node).
 */

var nodeClient = function (request) {

    var client = require('got');

    return new PromiseObj(function (resolve) {

        var url = request.getUrl();
        var body = request.getBody();
        var method = request.method;
        var headers = {}, handler;

        request.headers.forEach(function (value, name) {
            headers[name] = value;
        });

        client(url, {body: body, method: method, headers: headers}).then(handler = function (resp) {

            var response = request.respondWith(resp.body, {
                    status: resp.statusCode,
                    statusText: trim(resp.statusMessage)
                }
            );

            each(resp.headers, function (value, name) {
                response.headers.set(name, value);
            });

            resolve(response);

        }, function (error$$1) { return handler(error$$1.response); });
    });
};

/**
 * Base client.
 */

var Client = function (context) {

    var reqHandlers = [sendRequest], resHandlers = [], handler;

    if (!isObject(context)) {
        context = null;
    }

    function Client(request) {
        return new PromiseObj(function (resolve) {

            function exec() {

                handler = reqHandlers.pop();

                if (isFunction(handler)) {
                    handler.call(context, request, next);
                } else {
                    warn(("Invalid interceptor of type " + (typeof handler) + ", must be a function"));
                    next();
                }
            }

            function next(response) {

                if (isFunction(response)) {

                    resHandlers.unshift(response);

                } else if (isObject(response)) {

                    resHandlers.forEach(function (handler) {
                        response = when(response, function (response) {
                            return handler.call(context, response) || response;
                        });
                    });

                    when(response, resolve);

                    return;
                }

                exec();
            }

            exec();

        }, context);
    }

    Client.use = function (handler) {
        reqHandlers.push(handler);
    };

    return Client;
};

function sendRequest(request, resolve) {

    var client = request.client || (inBrowser ? xhrClient : nodeClient);

    resolve(client(request));
}

/**
 * HTTP Headers.
 */

var Headers = function Headers(headers) {
    var this$1 = this;

    this.map = {};

    each(headers, function (value, name) { return this$1.append(name, value); });
};

Headers.prototype.has = function has (name) {
    return getName(this.map, name) !== null;
};

Headers.prototype.get = function get (name) {

    var list = this.map[getName(this.map, name)];

    return list ? list.join() : null;
};

Headers.prototype.getAll = function getAll (name) {
    return this.map[getName(this.map, name)] || [];
};

Headers.prototype.set = function set (name, value) {
    this.map[normalizeName(getName(this.map, name) || name)] = [trim(value)];
};

Headers.prototype.append = function append (name, value){

    var list = this.map[getName(this.map, name)];

    if (list) {
        list.push(trim(value));
    } else {
        this.set(name, value);
    }
};

Headers.prototype.delete = function delete$1 (name){
    delete this.map[getName(this.map, name)];
};

Headers.prototype.deleteAll = function deleteAll (){
    this.map = {};
};

Headers.prototype.forEach = function forEach (callback, thisArg) {
        var this$1 = this;

    each(this.map, function (list, name) {
        each(list, function (value) { return callback.call(thisArg, value, name, this$1); });
    });
};

function getName(map, name) {
    return Object.keys(map).reduce(function (prev, curr) {
        return toLower(name) === toLower(curr) ? curr : prev;
    }, null);
}

function normalizeName(name) {

    if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
        throw new TypeError('Invalid character in header field name');
    }

    return trim(name);
}

/**
 * HTTP Response.
 */

var Response = function Response(body, ref) {
    var url = ref.url;
    var headers = ref.headers;
    var status = ref.status;
    var statusText = ref.statusText;

    this.url = url;
    this.ok = status >= 200 && status < 300;
    this.status = status || 0;
    this.statusText = statusText || '';
    this.headers = new Headers(headers);
    this.body = body;

    if (isString(body)) {

        this.bodyText = body;

    } else if (isBlob(body)) {

        this.bodyBlob = body;

        if (isBlobText(body)) {
            this.bodyText = blobText(body);
        }
    }
};

Response.prototype.blob = function blob () {
    return when(this.bodyBlob);
};

Response.prototype.text = function text () {
    return when(this.bodyText);
};

Response.prototype.json = function json () {
    return when(this.text(), function (text) { return JSON.parse(text); });
};

Object.defineProperty(Response.prototype, 'data', {

    get: function get() {
        return this.body;
    },

    set: function set(body) {
        this.body = body;
    }

});

function blobText(body) {
    return new PromiseObj(function (resolve) {

        var reader = new FileReader();

        reader.readAsText(body);
        reader.onload = function () {
            resolve(reader.result);
        };

    });
}

function isBlobText(body) {
    return body.type.indexOf('text') === 0 || body.type.indexOf('json') !== -1;
}

/**
 * HTTP Request.
 */

var Request = function Request(options$$1) {

    this.body = null;
    this.params = {};

    assign(this, options$$1, {
        method: toUpper(options$$1.method || 'GET')
    });

    if (!(this.headers instanceof Headers)) {
        this.headers = new Headers(this.headers);
    }
};

Request.prototype.getUrl = function getUrl (){
    return Url(this);
};

Request.prototype.getBody = function getBody (){
    return this.body;
};

Request.prototype.respondWith = function respondWith (body, options$$1) {
    return new Response(body, assign(options$$1 || {}, {url: this.getUrl()}));
};

/**
 * Service for sending network requests.
 */

var COMMON_HEADERS = {'Accept': 'application/json, text/plain, */*'};
var JSON_CONTENT_TYPE = {'Content-Type': 'application/json;charset=utf-8'};

function Http(options$$1) {

    var self = this || {}, client = Client(self.$vm);

    defaults(options$$1 || {}, self.$options, Http.options);

    Http.interceptors.forEach(function (handler) {

        if (isString(handler)) {
            handler = Http.interceptor[handler];
        }

        if (isFunction(handler)) {
            client.use(handler);
        }

    });

    return client(new Request(options$$1)).then(function (response) {

        return response.ok ? response : PromiseObj.reject(response);

    }, function (response) {

        if (response instanceof Error) {
            error(response);
        }

        return PromiseObj.reject(response);
    });
}

Http.options = {};

Http.headers = {
    put: JSON_CONTENT_TYPE,
    post: JSON_CONTENT_TYPE,
    patch: JSON_CONTENT_TYPE,
    delete: JSON_CONTENT_TYPE,
    common: COMMON_HEADERS,
    custom: {}
};

Http.interceptor = {before: before, method: method, jsonp: jsonp, json: json, form: form, header: header, cors: cors};
Http.interceptors = ['before', 'method', 'jsonp', 'json', 'form', 'header', 'cors'];

['get', 'delete', 'head', 'jsonp'].forEach(function (method$$1) {

    Http[method$$1] = function (url, options$$1) {
        return this(assign(options$$1 || {}, {url: url, method: method$$1}));
    };

});

['post', 'put', 'patch'].forEach(function (method$$1) {

    Http[method$$1] = function (url, body, options$$1) {
        return this(assign(options$$1 || {}, {url: url, method: method$$1, body: body}));
    };

});

/**
 * Service for interacting with RESTful services.
 */

function Resource(url, params, actions, options$$1) {

    var self = this || {}, resource = {};

    actions = assign({},
        Resource.actions,
        actions
    );

    each(actions, function (action, name) {

        action = merge({url: url, params: assign({}, params)}, options$$1, action);

        resource[name] = function () {
            return (self.$http || Http)(opts(action, arguments));
        };
    });

    return resource;
}

function opts(action, args) {

    var options$$1 = assign({}, action), params = {}, body;

    switch (args.length) {

        case 2:

            params = args[0];
            body = args[1];

            break;

        case 1:

            if (/^(POST|PUT|PATCH)$/i.test(options$$1.method)) {
                body = args[0];
            } else {
                params = args[0];
            }

            break;

        case 0:

            break;

        default:

            throw 'Expected up to 2 arguments [params, body], got ' + args.length + ' arguments';
    }

    options$$1.body = body;
    options$$1.params = assign({}, options$$1.params, params);

    return options$$1;
}

Resource.actions = {

    get: {method: 'GET'},
    save: {method: 'POST'},
    query: {method: 'GET'},
    update: {method: 'PUT'},
    remove: {method: 'DELETE'},
    delete: {method: 'DELETE'}

};

/**
 * Install plugin.
 */

function plugin(Vue) {

    if (plugin.installed) {
        return;
    }

    Util(Vue);

    Vue.url = Url;
    Vue.http = Http;
    Vue.resource = Resource;
    Vue.Promise = PromiseObj;

    Object.defineProperties(Vue.prototype, {

        $url: {
            get: function get() {
                return options(Vue.url, this, this.$options.url);
            }
        },

        $http: {
            get: function get() {
                return options(Vue.http, this, this.$options.http);
            }
        },

        $resource: {
            get: function get() {
                return Vue.resource.bind(this);
            }
        },

        $promise: {
            get: function get() {
                var this$1 = this;

                return function (executor) { return new Vue.Promise(executor, this$1); };
            }
        }

    });
}

if (typeof window !== 'undefined' && window.Vue) {
    window.Vue.use(plugin);
}

return plugin;

})));


text:
产品分类

                    -{{menu.name}}

                            -{{subMenu.name}}

新闻中心

                {{menu.name}}

                    {{news.title}}


text:
@InterfaceAudience.Private
@InterfaceStability.Unstable
package org.apache.hadoop.io.nativeio;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;


text:
import * as React from 'react';
import { useMemo } from 'react';
import { merge } from 'lodash';
import { VisTypeSelect } from '../sidebar/VisTypeSelect';
import { NumericalColumnSelect } from '../sidebar/NumericalColumnSelect';
import { WarningMessage } from '../sidebar/WarningMessage';
import { CategoricalColumnSelect } from '../sidebar/CategoricalColumnSelect';
const defaultExtensions = {
    prePlot: null,
    postPlot: null,
    preSidebar: null,
    postSidebar: null,
};
export function StripVisSidebar({ config, extensions, columns, setConfig, className = '', style: { width = '20em', ...style } = {}, }) {
    const mergedExtensions = useMemo(() => {
        return merge({}, defaultExtensions, extensions);
    }, [extensions]);
    return (React.createElement("div", { className: `container pb-3 pt-2 ${className}`, style: { width, ...style } },
        React.createElement(WarningMessage, null),
        React.createElement(VisTypeSelect, { callback: (type) => setConfig({ ...config, type }), currentSelected: config.type }),
        React.createElement("hr", null),
        React.createElement(NumericalColumnSelect, { callback: (numColumnsSelected) => setConfig({ ...config, numColumnsSelected }), columns: columns, currentSelected: config.numColumnsSelected || [] }),
        React.createElement(CategoricalColumnSelect, { callback: (catColumnsSelected) => setConfig({ ...config, catColumnsSelected }), columns: columns, currentSelected: config.catColumnsSelected || [] }),
        React.createElement("hr", null),
        mergedExtensions.preSidebar,
        mergedExtensions.postSidebar));
}
//# sourceMappingURL=StripVisSidebar.js.map


text:
"use strict";
var nmvc = null;
var fs = require('fs-extra');
var express = require('express');
var Sequelize = require('sequelize');
var path = require('path');

module.exports = class Nmvc {
	constructor() {
		nmvc = this;
		nmvc.root_dir = path.dirname(require.main.filename);
		require('./helpers/functions');

		nmvc.base_helper = require('./classes/base_helper');
		nmvc.base_model = require('./classes/base_model');
		nmvc.base_controller = require('./classes/base_controller');

		nmvc.app = express();
		nmvc.sequelize = require('sequelize');

		nmvc.env = 'dev';

		nmvc.config_dir = 'config/';
		nmvc.helper_dir = 'helpers/';
		nmvc.model_dir = 'models/';
		nmvc.controller_dir = 'controllers/';
		nmvc.views_dir = 'views/';
		nmvc.public_dir = 'assets/public/'
	}

	initEnv() {
		if (nmvc.env === 'dev') {
			nmvc.app.locals.pretty = true;
			process.env.NODE_ENV = 'dev';
		} else if (env === 'production') {
			process.env.NODE_ENV = 'production';
		}
	}

	initConfig() {
		nmvc.config = require(path.join(nmvc.root_dir, nmvc.config_dir + nmvc.env));
	}

	initHelpers() {
		nmvc.helpers = {};
		fs.readdirSync(nmvc.helper_dir).forEach(function (name) {
			if (name.substr(0, 1) == '.' || name.substr(0, 1) == '_' || name.indexOf('.js') == -1) {
				return;
			} else {
				var helper_name = name.replace('.js', '');
				console.log('Loading Helper ' + name + '...');
				var helper = require(path.join(nmvc.root_dir, nmvc.helper_dir + helper_name))
				nmvc.helpers[helper_name] = new helper();
			}
		});
	}

	initDatabases() {
		nmvc.dbs = [];
		for (var db in nmvc.config.databases) {
			console.log('Loading Database ' + db + '...');
			var new_db = nmvc.config.databases[db];
			var sequelize = new Sequelize(
				new_db.database,
				new_db.user,
				new_db.pass,
				new_db
			);
			nmvc.dbs[db] = sequelize;
		}
	}

	initModels() {
		nmvc.models = [];
		nmvc.sequelize_models = [];
		fs.readdirSync(nmvc.model_dir).forEach(function (name) {
			if (name.substr(0, 1) == '.' || name.substr(0, 1) == '_' || name.indexOf('.js') == -1) {
				return;
			} else {
				var model_name = name.replace('.js', '');
				console.log('Loading Model ' + model_name.toProperCase() + '...');
				var model = require(path.join(nmvc.root_dir, nmvc.model_dir + name));
				nmvc.models[model_name] = new model();
			}
		});

		for(var model in nmvc.models){
			nmvc.models[model].buildRelationships();
		}
		for (var db in nmvc.dbs){
			nmvc.syncDatabase(nmvc.dbs[db]);
		}
	}

	syncDatabase(db) {
		db.query('SET FOREIGN_KEY_CHECKS = 0')
		.then(function () {
			return db.sync({force: false});
		})
		.then(function () {
			return db.query('SET FOREIGN_KEY_CHECKS = 1')
		})
		.then(function () {
			console.log('Database synchronised.');
		}, function (err) {
			console.log(err);
		});
	}

	initControllers() {
		nmvc.controllers = {};
		fs.readdirSync(nmvc.controller_dir).forEach(function (name) {
			if (name.substr(0, 1) == '.' || name.substr(0, 1) == '_' || name == 'index.js' || name.indexOf('.js') == -1) {
				return;
			} else {
				var controller_name = name.replace('.js', '');
				console.log('Loading Controller ' + name.toProperCase() + '...');
				var controller = require(path.join(nmvc.root_dir, nmvc.controller_dir + controller_name));
				nmvc.controllers[controller_name] = new controller();
			}
		});
	}

	initRoutes() {
		nmvc.app.use('/', require('./router')(express.Router()));
	}

	initSocketIo(){
		nmvc.io = require('socket.io')(nmvc.server);
	}

	initViews() {
		nmvc.app.set('views', (path.join(nmvc.root_dir, nmvc.views_dir)));
		nmvc.app.set('view engine', 'jade');
	}

	initPublic() {
		nmvc.app.use(express.static(path.join(nmvc.root_dir, nmvc.public_dir)));
	}

	initSession() {
		var session = require('express-session');
		var MySQLStore = require('express-mysql-session')(session);

		var options = {
			host: nmvc.config.databases.main.host,
			port: nmvc.config.databases.main.port,
			user: nmvc.config.databases.main.user,
			password: nmvc.config.databases.main.pass,
			database: nmvc.config.databases.main.database
		};

		var sessionStore = new MySQLStore(options);

		nmvc.app.use(session({
			key: nmvc.config.server.name,
			secret: nmvc.config.server.secret,
			store: sessionStore,
			resave: false,
			saveUninitialized: false
		}));
	}

	run() {
		//Set up all of our custom directories
		nmvc.initEnv();
		nmvc.initConfig();
		nmvc.initHelpers();
		nmvc.initDatabases();
		nmvc.initModels();
		nmvc.initControllers();

		//Set up stuff you NEED
		var http = require('http');
		nmvc.config.server.port = normalizePort(nmvc.config.server.port || '8080');
		nmvc.app.set('port', nmvc.config.server.port);

		//Set up stuff that you probably want
		var compression = require('compression');
		nmvc.app.use(compression());

		var bodyParser = require('body-parser');
		nmvc.app.use(bodyParser.json());
		nmvc.app.use(bodyParser.urlencoded({extended: true}));

		var cookieParser = require('cookie-parser');
		nmvc.app.use(cookieParser());

		nmvc.initSession();

		//Set up http
		nmvc.server = http.createServer(nmvc.app);

		//set up SocketIo
		nmvc.initSocketIo();

		nmvc.initRoutes();
		nmvc.initViews();
		nmvc.initPublic();

		//Set up error handling for routing
		nmvc.app.use(onRequest404);
		nmvc.app.use(onRequestError);

		//Launch the server
		nmvc.server.listen(nmvc.config.server.port);
		nmvc.server.on('error', onError);
		nmvc.server.on('listening', onListening);
	}
};

function onError(error) {
	if (error.syscall !== 'listen') {
		throw error;
	}

	var bind = typeof this.port === 'string'
		? 'Pipe ' + this.port
		: 'Port ' + this.port;

	// handle specific listen errors with friendly messages
	switch (error.code) {
		case 'EACCES':
			console.error(bind + ' requires elevated privileges');
			process.exit(1);
			break;
		case 'EADDRINUSE':
			console.error(bind + ' is already in use');
			process.exit(1);
			break;
		default:
			throw error;
	}
}

function onListening() {
	var addr = this.address();
	var bind = typeof addr === 'string'
		? 'pipe ' + addr
		: 'port ' + addr.port;
	console.log('Listening on ' + bind);
}

function normalizePort(val) {
	var port = parseInt(val, 10);

	if (isNaN(port)) {
		// named pipe
		return val;
	}

	if (port >= 0) {
		// port number
		return port;
	}

	return false;
}

function onRequest404(req, res, next) {
	var err = new Error('Not Found');
	err.code = 404;
	next(err);
}

function onRequestError(err, req, res, next) {
	var fullUrl = req.protocol + '://' + req.get('host') + req.originalUrl;
	err.url = fullUrl;
	log(err);
	// development error handler
	// will print stacktrace
	if (nmvc.env === 'dev') {
		if (err.code != 404) {
			throw(err);
		}
		res.status(err.code || 500);
		var error = {
			name:    err,
			code:    (err.code || 500),
			message: (err.message || err)
		};
		res.render('error/index', {
			error: error
		});
	}
	// production error handler
	// no stacktraces leaked to user
	else {
		res.status(err.code || 500);
		var error = {
			name:    'Internal Server Error',
			code:    (err.code || 500),
			message: 'Internal Server Error'
		};
		res.render('error/index', {
			error: error
		});
	}
}


text:
Asyncplify.prototype.subscribeOn = function (options) {
    return new Asyncplify(SubscribeOn, options, this);
};

function SubscribeOn(options, sink, source) {
    this.origin = source;
    this.sink = sink;
    this.sink.source = this;
    this.scheduler = (typeof options === 'function' ? options : (options && options.scheduler || schedulers.immediate))();
    this.source = null;

    this.scheduler.schedule(this);
}

SubscribeOn.prototype = {
    action: function () {
        this.scheduler.setState(Asyncplify.states.CLOSED);
        this.scheduler = null;
        this.origin._subscribe(this);
        this.origin = null;
    },
    emit: function (value) {
        this.sink.emit(value);
    },
    end: function (err) {
        this.source = null;
        this.sink.end(err);
    },
    error: function (err) {
        if (this.scheduler) this.scheduler.setState(Asyncplify.states.CLOSED);
        if (this.source) this.source.setState(Asyncplify.states.CLOSED);
        this.scheduler = this.source = this.origin = null;
        this.sink.end(err);
    },
    setState: function (state) {
        if (this.scheduler) this.scheduler.setState(state);
        if (this.source) this.source.setState(state);
    }
};


text:
  Saint-Bonnet-le-Bourg est
       un village
       géographiquement positionné dans le département de Puy-de-Dôme en Auvergne. Elle comptait 141 habitants en 2008.

Si vous envisagez de venir habiter à Saint-Bonnet-le-Bourg, vous pourrez aisément trouver une maison à acheter.

La commune propose quelques  équipements sportifs, elle dispose, entre autres, de une boucle de randonnée.

Le parc d'habitations, à Saint-Bonnet-le-Bourg, se décomposait en 2011 en un appartements et 209 maisons soit
 un marché relativement équilibré.

À coté de Saint-Bonnet-le-Bourg sont positionnées géographiquement les communes de
Saint-Sauveur-la-Sagne située à 6 km, 110 habitants,
Fayet-Ronaye située à 5 km, 123 habitants,
Doranges située à 3 km, 153 habitants,
Novacelles située à 3 km, 150 habitants,
Saint-Vert située à 9 km, 103 habitants,
Fournols localisée à 9 km, 408 habitants,
 entre autres. De plus, Saint-Bonnet-le-Bourg est située à seulement 16 km de Ambert.