text:
The roadmap is a living document, and it is likely that priorities will change, but the list below should give some indication of our plans for the next major release, and for the future.

### 0.15.0

#### Breaking Changes

- Remove deprecated usage of JSON to generate children across the components.
- [[#3108](https://github.com/callemall/material-ui/pull/3108)] Remove deprecated components, methods & props.
- [[#2957](https://github.com/callemall/material-ui/issues/2957)] Standardize callback signatures.
- [[#2980](https://github.com/callemall/material-ui/issues/2980)] [[#1839](https://github.com/callemall/material-ui/issues/1839)] Standardise Datepicker for ISO 8601.

#### Deprecations

- [[#2880](https://github.com/callemall/material-ui/issues/2880)] Deprecate valueLink.
- [[#1793](https://github.com/callemall/material-ui/issues/1793)][[#2679](https://github.com/callemall/material-ui/issues/2679)] PascalCase component names and reorganise directory structure. Deprecate old names.
- [[#2697](https://github.com/callemall/material-ui/issues/2697)] Rename LeftNav and deprecate old name.

#### Core

- [[#2903](https://github.com/callemall/material-ui/issues/2903)] Enforce eslint rules.
- [[#2493](https://github.com/callemall/material-ui/pull/2493)] Use higher order components across the library to abstract themes passed down from context.
- [[#2627](https://github.com/callemall/material-ui/issues/2627)] Improve overall theme handling.
- [[#2573](https://github.com/callemall/material-ui/issues/2573)] Remove the usage of isMounted().
- [[#2437](https://github.com/callemall/material-ui/issues/2437)] Remove mixins.

#### Major features

- [[#1321](https://github.com/callemall/material-ui/pull/1321#issuecomment-174108805)] Composable AppBar component.
- [[#3132](https://github.com/callemall/material-ui/pull/3132)] New Stepper component.
- [[#2861](https://github.com/callemall/material-ui/pull/2861)] Scrollable Tabs.
- [[#2979](https://github.com/callemall/material-ui/pull/2979)] New Subheader component.

#### Documentation

- [[#1986](https://github.com/callemall/material-ui/issues/1986)]Documentation versioning.
- Add example on how to use [react-list](https://github.com/orgsync/react-list) for lists, menu items and table.
- [[#2635](https://github.com/callemall/material-ui/pull/2635)] Document the new theme calculation, and it's usage.
- [[#3191](https://github.com/callemall/material-ui/issues/3191)] Improve component property documentation.

### Future

#### Deprecations

- Deprecate & eventually remove all imperative methods.

#### Core

- Make extensive use of `popover` and `render-to-layer`.
- [[#458](https://github.com/callemall/material-ui/issues/458)] Migrate components to [ES6 Classes](https://github.com/callemall/material-ui/tree/es6-classes).
- [[#2784](https://github.com/callemall/material-ui/issues/2784)] Stateless components.
- Improve performance with `shouldComponentUpdate` and removed inefficient computations.
- Standardize API naming and available `prop` convention across the library.
- Better accessibility support.
- Better keyboard navigation support.

#### Features

- [[#2416](https://github.com/callemall/material-ui/issues/2416)] TextField as a composable component for various field types.
- Responsive components to better support MD spec for mobile component sizes, and in preparation for react-native support.
- [[#2863](https://github.com/callemall/material-ui/issues/2863)] Add missing components, and missing features from current ones.
- [[#2251](https://github.com/callemall/material-ui/issues/2251)] Full featured Table.
- Full Featured Tabs (close, [disable](https://github.com/callemall/material-ui/issues/1613), move, sizing, [scrolling](https://github.com/callemall/material-ui/pull/2861)).
- Full support for react-native
- [[#1673](https://github.com/callemall/material-ui/issues/1673)] I18n for the doc-site.


text:
<!DOCTYPE HTML>

      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title>Collation - Quire 5</title>
      <meta name="description" content="Collation of Othmer MS 8: gathering 5">
      <meta name="keywords" content="HTML,CSS,XML,SVG,JavaScript">
      <meta name="keywords" content="collation, gathering structure">
      <meta name="source" content="Othmer MS 8">
      <meta name="creator" content="VisColl 2.0">
      <meta name="software" content="https://github.com/leoba/VisColl">
      <meta name="date" content="14 June 2019 at 14:07:05">
      <meta name="rights" content="CC BY 3.0"><link rel="stylesheet" type="text/css" href="https://cdn.rawgit.com/leoba/VisColl/master/data/support/jquery.fancybox.css?v=2.1.5" media="screen">
      <link rel="stylesheet" type="text/css" href="https://cdn.rawgit.com/leoba/VisColl/master/data/support/jquery.fancybox.css">
      <link rel="stylesheet" type="text/css" href="https://cdn.rawgit.com/leoba/VisColl/master/data/support/collation.css">

Generated using the Schoenberg Institute for Manuscript Studies Collation Modeller

Opera, including Lucidarium artis transmutationis metallorum; extracts from the
               Sommeta and Violetta; and Epistola, OthmerMS8      <select name="quirelist" id="quirelist" onchange="MM_jumpMenu('parent',this,1)">
            <option>Select a Gathering</option>
            <option value="OthmerMS8-1.html"> Gathering 1
               (7)
            </option>
            <option value="OthmerMS8-2.html"> Gathering 2
               (16)
            </option>
            <option value="OthmerMS8-3.html"> Gathering 3
               (16)
            </option>
            <option value="OthmerMS8-4.html"> Gathering 4
               (16)
            </option>
            <option value="OthmerMS8-5.html"> Gathering 5
               (16)
            </option>
            <option value="OthmerMS8-6.html"> Gathering 6
               (16)
            </option></select>

 Gathering 5 (16)

<object data-current-id="g5-1-16_leaf" class="svg" data="../../SVG/OthmerMS8-5.svg" type="image/svg+xml">Error: SVG file not found</object>

56v 71r

71v 56r

<object data-current-id="g5-2-15_leaf" class="svg" data="../../SVG/OthmerMS8-5.svg" type="image/svg+xml">Error: SVG file not found</object>

57v 70r

70v 57r

<object data-current-id="g5-3-14_leaf" class="svg" data="../../SVG/OthmerMS8-5.svg" type="image/svg+xml">Error: SVG file not found</object>

58v 69r

69v 58r

<object data-current-id="g5-4-13_leaf" class="svg" data="../../SVG/OthmerMS8-5.svg" type="image/svg+xml">Error: SVG file not found</object>

59v 68r

68v 59r

<object data-current-id="g5-5-12_leaf" class="svg" data="../../SVG/OthmerMS8-5.svg" type="image/svg+xml">Error: SVG file not found</object>

60v 67r

67v 60r

<object data-current-id="g5-6-11_leaf" class="svg" data="../../SVG/OthmerMS8-5.svg" type="image/svg+xml">Error: SVG file not found</object>

61v 66r

66v 61r

<object data-current-id="g5-7-10_leaf" class="svg" data="../../SVG/OthmerMS8-5.svg" type="image/svg+xml">Error: SVG file not found</object>

62v 65r

65v 62r

<object data-current-id="g5-8-9_leaf" class="svg" data="../../SVG/OthmerMS8-5.svg" type="image/svg+xml">Error: SVG file not found</object>

63v 64r

64v 63r

redpajama_set_name: RedPajamaGithub


text:
#include "Reply.h"

namespace http {

void Reply::setSize(const unsigned size) {
    BOOST_FOREACH ( Header& h,  headers) {
        if("Content-Length" == h.name) {
            std::string sizeString;
            intToString(size,h.value);
        }
    }
}

std::vector<boost::asio::const_buffer> Reply::toBuffers(){
    std::vector<boost::asio::const_buffer> buffers;
    buffers.push_back(ToBuffer(status));
    BOOST_FOREACH(const Header & h, headers) {
        buffers.push_back(boost::asio::buffer(h.name));
        buffers.push_back(boost::asio::buffer(seperators));
        buffers.push_back(boost::asio::buffer(h.value));
        buffers.push_back(boost::asio::buffer(crlf));
    }
    buffers.push_back(boost::asio::buffer(crlf));
    BOOST_FOREACH(const std::string & line, content) {
        buffers.push_back(boost::asio::buffer(line));
    }
    return buffers;
}

std::vector<boost::asio::const_buffer> Reply::HeaderstoBuffers(){
    std::vector<boost::asio::const_buffer> buffers;
    buffers.push_back(ToBuffer(status));
    for (std::size_t i = 0; i < headers.size(); ++i) {
        Header& h = headers[i];
        buffers.push_back(boost::asio::buffer(h.name));
        buffers.push_back(boost::asio::buffer(seperators));
        buffers.push_back(boost::asio::buffer(h.value));
        buffers.push_back(boost::asio::buffer(crlf));
    }
    buffers.push_back(boost::asio::buffer(crlf));
    return buffers;
}

Reply Reply::StockReply(Reply::status_type status) {
    Reply rep;
    rep.status = status;
    rep.content.clear();
    rep.content.push_back( ToString(status) );
    rep.headers.resize(3);
    rep.headers[0].name = "Access-Control-Allow-Origin";
    rep.headers[0].value = "*";
    rep.headers[1].name = "Content-Length";

    std::string s;
    intToString(rep.content.size(), s);

    rep.headers[1].value = s;
    rep.headers[2].name = "Content-Type";
    rep.headers[2].value = "text/html";
    return rep;
}

std::string Reply::ToString(Reply::status_type status) {
    switch (status) {
    case Reply::ok:
        return okHTML;
    case Reply::badRequest:
        return badRequestHTML;
    default:
        return internalServerErrorHTML;
    }
}

boost::asio::const_buffer Reply::ToBuffer(Reply::status_type status) {
    switch (status) {
    case Reply::ok:
        return boost::asio::buffer(okString);
    case Reply::internalServerError:
        return boost::asio::buffer(internalServerErrorString);
    default:
        return boost::asio::buffer(badRequestString);
    }
}

Reply::Reply() : status(ok) {

}

}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <title>Blog 申明 — 寒咯</title>
    <link rel="stylesheet" href="/assets/vendor/primer-css/css/primer.css">
    <link rel="stylesheet" href="/assets/vendor/primer-markdown/dist/user-content.min.css">
    <link rel="stylesheet" href="/assets/vendor/octicons/octicons/octicons.css">
    <link rel="stylesheet" href="/assets/css/components/collection.css">
    <link rel="stylesheet" href="/assets/css/components/repo-card.css">
    <link rel="stylesheet" href="/assets/css/sections/repo-list.css">
    <link rel="stylesheet" href="/assets/css/sections/mini-repo-list.css">
    <link rel="stylesheet" href="/assets/css/components/boxed-group.css">
    <link rel="stylesheet" href="/assets/css/globals/common.css">
    <link rel="stylesheet" href="/assets/vendor/share.js/dist/css/share.min.css">
    <link rel="stylesheet" href="/assets/css/globals/responsive.css">
    <link rel="stylesheet" href="/assets/css/posts/index.css">

    <link rel="canonical" href="http://localhost:4000/2017/05/16/Blog/">
    <link rel="alternate" type="application/atom+xml" title="寒咯" href="/feed.xml">
    <link rel="shortcut icon" href="/icon.ico">

    <meta property="og:title" content="Blog 申明">

    <meta name="keywords" content="Jekyll, GitHub, 博客">
    <meta name="og:keywords" content="Jekyll, GitHub, 博客">

    <meta name="description" content="我的博客主题来自这里刚刚搭建,目前只供自己使用,还有很多东西没有来得及修改,很多地方都还是主题博主的设置。如有任何侵权,请马上告知,我接10层锅。">
    <meta name="og:description" content="我的博客主题来自这里刚刚搭建,目前只供自己使用,还有很多东西没有来得及修改,很多地方都还是主题博主的设置。如有任何侵权,请马上告知,我接10层锅。">

    <meta property="og:url" content="http://localhost:4000/2017/05/16/Blog/">
    <meta property="og:site_name" content="寒咯">
    <meta property="og:type" content="article">
    <meta property="og:locale" content="zh_CN" />

    <meta property="article:published_time" content="2017-05-16">

 寒咯

            <button class="collapsed mobile-visible" type="button" onclick="toggleMenu();">

            </button>

                首页

                分类

                维基

                链接

                关于

Blog 申明

             2017/05/16

            其它

我的博客主题来自这里刚刚搭建,目前只供自己使用,还有很多东西没有来得及修改,很多地方都还是主题博主的设置。如有任何侵权,请马上告知,我接10层锅。

简述博客搭建过程,主要记录搭建过程中遇到的一些问题,和感兴趣的东西。

1.搭建的过程比较简单,而且网上有大量资源,而且内容大同小异,以下两篇是我参考的文章:

"授人以渔"的教你搭建个人独立博客

我的 Github 个人博客是怎样炼成的

2.Jekyll

使用教程 Youtube Jekyll

用 terminal cd /repository根目录下 运行 bundle exec jekyll serve ,然后就可以在浏览器输入 localhost:4000 进行本地调试。

有时运行上面代码的时候会报错jekyll 3.4.3 | Error:  Address already in use - bind(2) for 127.0.0.1:4000这种情况,需要先杀掉运行进程。

ps 命令查看 jekyll 相关进程 PID。

kill -9 PID 这里不是指 -9 这个 9 是进程号,而是 kill -9 这一段都是指令,后面还需要跟一个进程号。

3.Sublime Text 3

如何优雅的使用 Sublime Text3

使用Sublime Text 3进行Markdown 编辑+实时预览

Please enable JavaScript to view the comments powered by Disqus.

Search

    <input type="text" id="search_box" placeholder="Search">
    <button class="btn btn-default" id="site_search_do"></button>

<link rel="stylesheet" type="text/css" href="/assets/css/modules/sidebar-search.css">

Post Directory

                    © 2015
                    Xuehan Gong
                    TOP

                    TOP

                    首页

                    分类

                    维基

                    链接

                    关于

    <link rel="stylesheet" href="/assets/css/globals/prism.css">


text:
package restic

import (
	"fmt"

	log "github.com/Sirupsen/logrus"
	"github.com/spf13/cobra"

	"github.com/camptocamp/bivac/cmd"
	"github.com/camptocamp/bivac/pkg/client"
)

var (
	remoteAddress string
	psk           string
	volumeID      string
)

var envs = make(map[string]string)

var resticCmd = &cobra.Command{
	Use:   "restic --volume [VOLUME_ID] -- [RESTIC_COMMAND]",
	Short: "Run Restic command on a volume's repository",
	Args:  cobra.ArbitraryArgs,
	PreRun: func(cmd *cobra.Command, args []string) {
		if volumeID == "" {
			log.Fatal("You must provide a volume ID.")
			return
		}
	},
	Run: func(cmd *cobra.Command, args []string) {
		c, err := client.NewClient(remoteAddress, psk)
		if err != nil {
			log.Errorf("failed to create new client: %s", err)
			return
		}

		output, err := c.RunRawCommand(volumeID, args)
		if err != nil {
			log.Errorf("failed to run command: %s", err)
			return
		}

		fmt.Println(output)
	},
}

func init() {
	resticCmd.Flags().StringVarP(&remoteAddress, "remote.address", "", "http://127.0.0.1:8182", "Address of the remote Bivac server.")
	envs["BIVAC_REMOTE_ADDRESS"] = "remote.address"

	resticCmd.Flags().StringVarP(&psk, "server.psk", "", "", "Pre-shared key.")
	envs["BIVAC_SERVER_PSK"] = "server.psk"

	resticCmd.Flags().StringVarP(&volumeID, "volume", "", "", "Volume ID")

	cmd.SetValuesFromEnv(envs, resticCmd.Flags())
	cmd.RootCmd.AddCommand(resticCmd)
}


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.anarres.ipmi.protocol.packet.asf;

import com.google.common.primitives.UnsignedBytes;
import javax.annotation.Nonnegative;
import javax.annotation.Nonnull;
import org.anarres.ipmi.protocol.packet.common.Code;
import org.anarres.ipmi.protocol.packet.ipmi.IpmiSessionStatus;
import static org.anarres.ipmi.protocol.packet.asf.AsfRmcpMessageType.*;

/**
 * RSSP and RAKP Status Codes.
 *
 * [ASF] Section 3.2.3.5.1 page 32.
 *
 * @see IpmiSessionStatus
 * @author shevek
 */
public enum AsfRsspSessionStatus implements Code.Wrapper {

    NO_ERROR(0x00, OpenSessionResponse, CloseSessionResponse, RAKPMessage2, RAKPMessage3),
    INSUFFICIENT_RESOURCES(0x01, OpenSessionResponse),
    INVALID_SESSION_ID(0x02, OpenSessionResponse, CloseSessionResponse, RAKPMessage2, RAKPMessage3),
    INVALID_PAYLOAD_TYPE(0x03, OpenSessionResponse),
    INVALID_AUTHENTICATION_ALGORITHM(0x04, OpenSessionResponse),
    INVALID_INTEGRITY_ALGORITHM(0x05, OpenSessionResponse),
    NO_MATCHING_AUTHENTICATION_PAYLOAD(0x06, OpenSessionResponse),
    NO_MATCHING_INTEGRITY_PAYLOAD(0x07, OpenSessionResponse),
    INACTIVE_SESSION_ID(0x08, CloseSessionResponse, RAKPMessage2, RAKPMessage3),
    INVALID_ROLE(0x09, RAKPMessage2),
    UNAUTHORIZED_ROLE(0x0A, RAKPMessage2),
    INSUFFICIENT_RESOURCES_FOR_ROLE(0x0B, RAKPMessage2),
    INVALID_NAME_LENGTH(0x0C, RAKPMessage2),
    UNAUTHORIZED_NAME(0x0D, RAKPMessage2),
    UNAUTHORIZED_GUID(0x0E, RAKPMessage3),
    INVALID_INTEGRITY_CHECK_VALUE(0x0F, RAKPMessage3);
    private final byte code;
    private final AsfRmcpMessageType[] messageTypes;

    private AsfRsspSessionStatus(@Nonnegative int code, @Nonnull AsfRmcpMessageType... messageTypes) {
        this.code = UnsignedBytes.checkedCast(code);
        this.messageTypes = messageTypes;
    }

    @Override
    public byte getCode() {
        return code;
    }
}


text:
package io.vamp.model.notification

import io.vamp.common.notification.{ DefaultPackageMessageResolverProvider, LoggingNotificationProvider }

trait ModelNotificationProvider extends LoggingNotificationProvider with DefaultPackageMessageResolverProvider


text:
define(['./keys'], function(keys) {

  /**
   * Creates an object composed of the inverted keys and values of the given object.
   *
   * @static
   * @memberOf _
   * @category Objects
   * @param {Object} object The object to invert.
   * @returns {Object} Returns the created inverted object.
   * @example
   *
   * _.invert({ 'first': 'fred', 'second': 'barney' });
   * // => { 'fred': 'first', 'barney': 'second' }
   */
  function invert(object) {
    var index = -1,
        props = keys(object),
        length = props.length,
        result = {};

    while (++index < length) {
      var key = props[index];
      result[object[key]] = key;
    }
    return result;
  }

  return invert;
});


text:
"""
Given an array of integers nums sorted in ascending order, find the starting and ending position of a given target value.

Your algorithm's runtime complexity must be in the order of O(log n).

If the target is not found in the array, return [-1, -1].

Example 1:

Input: nums = [5,7,7,8,8,10], target = 8
Output: [3,4]
Example 2:

Input: nums = [5,7,7,8,8,10], target = 6
Output: [-1,-1]
"""

class Solution:
    # @param A, a list of integers
    # @param target, an integer to be searched
    # @return a list of length 2, [index1, index2]
    def searchRange(self, A, target):
        start = 0
        end = len(A) - 1
        bound = [-1, -1]

        # Check for left bound
        while start + 1 < end:
            mid = (start + end) / 2
            if A[mid] == target:
                end = mid
            elif A[mid] < target:
                start = mid
            else:
                end = mid

        if A[start] == target:
            bound[0] = start
        elif A[end] == target:
            bound[0] = end
        else:
            return bound

        # Check right bound
        start = 0
        end = len(A) - 1
        while start + 1 < end:
            mid = (start + end) / 2
            if A[mid] == target:
                start = mid
            elif A[mid] < target:
                start = mid
            else:
                end = mid

        if A[end] == target:
            bound[1] = end
        elif A[start] == target:
            bound[1] = start

        return bound


text:
from django.template import TemplateSyntaxError
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.http import Http404
from django.utils.encoding import smart_unicode
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe

def inlines(value, return_list=False):
    try:
        from BeautifulSoup import BeautifulStoneSoup
    except ImportError:
        from beautifulsoup import BeautifulStoneSoup

    content = BeautifulStoneSoup(value, selfClosingTags=['inline','img','br','input','meta','link','hr'])
    inline_list = []

    if return_list:
        for inline in content.findAll('inline'):
            rendered_inline = render_inline(inline)
            inline_list.append(rendered_inline['context'])
        return inline_list
    else:
        for inline in content.findAll('inline'):
            rendered_inline = render_inline(inline)
            inline.replaceWith(render_to_string(rendered_inline['template'], rendered_inline['context']))
        return mark_safe(content)

def render_inline(inline):
    """
    Replace inline markup with template markup that matches the
    appropriate app and model.

    """

    # Look for inline type, 'app.model'
    try:
        app_label, model_name = inline['type'].split('.')
    except:
        if settings.DEBUG:
            raise TemplateSyntaxError, "Couldn't find the attribute 'type' in the <inline> tag."
        else:
            return ''

    # Look for content type
    try:
        content_type = ContentType.objects.get(app_label=app_label, model=model_name)
        model = content_type.model_class()
    except ContentType.DoesNotExist:
        if settings.DEBUG:
            raise TemplateSyntaxError, "Inline ContentType not found."
        else:
            return ''

    # Check for an inline class attribute
    try:
        inline_class = smart_unicode(inline['class'])
    except:
        inline_class = ''

    try:
        try:
            id_list = [int(i) for i in inline['ids'].split(',')]
            obj_list = model.objects.in_bulk(id_list)
            obj_list = list(obj_list[int(i)] for i in id_list)
            context = { 'object_list': obj_list, 'class': inline_class }
        except ValueError:
            if settings.DEBUG:
                raise ValueError, "The <inline> ids attribute is missing or invalid."
            else:
                return ''
    except KeyError:
        try:
            obj = model.objects.get(pk=inline['id'])
            context = { 'content_type':"%s.%s" % (app_label, model_name), 'object': obj, 'class': inline_class, 'settings': settings }
        except model.DoesNotExist:
            if settings.DEBUG:
                raise model.DoesNotExist, "Object matching '%s' does not exist"
            else:
                return ''
        except:
            if settings.DEBUG:
                raise TemplateSyntaxError, "The <inline> id attribute is missing or invalid."
            else:
                return ''

    template = ["inlines/%s_%s.html" % (app_label, model_name), "inlines/default.html"]
    rendered_inline = {'template':template, 'context':context}

    return rendered_inline


text:
package org.lwjgl.opengl;

import org.lwjgl.util.generator.*;
import org.lwjgl.util.generator.opengl.GLenum;
import org.lwjgl.util.generator.opengl.GLsizei;

import java.nio.*;

public interface EXT_multi_draw_arrays {
	void glMultiDrawArraysEXT(@GLenum int mode, IntBuffer piFirst, @Check("piFirst.remaining()") @GLsizei IntBuffer piCount, @AutoSize("piFirst") int primcount);
}


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Phyllachora agrostis Orton

### Remarks
null


text:
package org.xtreemfs.common.monitoring;

import javax.management.MBeanServer;

import org.xtreemfs.common.monitoring.generatedcode.Dir;

/**
 * This class represents the monitoring information exposed by the SNMP agent regarding to the
 * Directory Service.
 *
 * <br>May 5, 2011
 *
 * @author bzcseife
 */
@SuppressWarnings("serial")
public class DirImpl extends Dir {

    public DirImpl(XTREEMFS_MIBImpl myMib, StatusMonitor statusMonitor) {
        super(myMib);

        AddressMappingCount = 0;
        ServiceCount = 0;

        // Set a reference to this Object to be able to access it within
        // the application
        statusMonitor.setDirGroup(this);

    }

    public DirImpl(XTREEMFS_MIBImpl myMib, MBeanServer server, StatusMonitor statusMonitor) {
        super(myMib, server);

        AddressMappingCount = 0;
        ServiceCount = 0;

        // Set a reference to this Object to be able to access it within
        // the application
        statusMonitor.setDirGroup(this);

    }

    /**
     * This method will be called when a AddressMapping is registered at the DIR.
     **/
    protected void addressMappingAdded() {
        AddressMappingCount++;
    }

    /**
     * This method will be called when a AddressMapping is deregistered at the DIR.
     **/
    protected void addressMappingDeleted() {
        AddressMappingCount--;
    }

    /**
     * This method will be called when a Service is registered at the DIR.
     **/
    protected void serviceRegistered() {
        ServiceCount++;
    }

    /**
     * This method will be called when a Service is deregistered at the DIR.
     **/
    protected void serviceDeregistered() {
        ServiceCount--;
    }

}


text:
package com.winterwell.maths.timeseries;

import java.io.Serializable;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import com.winterwell.json.JSONObject;
import com.winterwell.utils.containers.ArrayMap;
import com.winterwell.utils.log.Log;
import com.winterwell.utils.time.Period;
import com.winterwell.utils.time.TUnit;
import com.winterwell.utils.time.Time;
import com.winterwell.utils.time.TimeUtils;
import com.winterwell.utils.web.IHasJson;

/**
 * Training proceeds both historically (through the database, oldest first)
 * And with live stuff, as it comes in.
 *
 * TODO refactor to remove SoDash bits
 * @author daniel
 *
 */
public class TrainingInfo implements Serializable, IHasJson {

	public TrainingInfo() {
		coverage = new TimeCoverage(slicer());
	}

	volatile private boolean live = true;

	public boolean isLive() {
		return live;
	}

	/**
	 * Kill the MODEL.
	 * @WARNING Use with caution!
	 * This means the associated model/classifier is dead & must not be used anymore!
	 */
	public void kill() {
		Log.i("ai.life", "Killed "+this);
		live = false;
	}

	private static final long serialVersionUID = 1L;
	public final Time wentLive = new Time();

	volatile int cntLive;
	volatile int cntHistorical;

	/**
	 * Track per-language training.
	 * ISO 2-letter lang-code to training count.
	 */
	Map<String,Integer> cntLang = Collections.synchronizedMap(new HashMap());

	@Override
	public String toString() {
		return (isLive()?"":"DEAD")+"TrainingInfo[wentLive="+ wentLive
				+ ", cntLive=" + cntLive
				+ ", cntHistorical="+ cntHistorical + "]";
	}

	public int getTrainingCntLive() {
		return cntLive;
	}

	public int getTrainingCntHistorical() {
		return cntHistorical;
	}

	/**
	 * @return total training count, live + historical
	 */
	public int getTrainingCnt() {
		return cntLive + cntHistorical;
	}

	/**
	 * @param langCode
	 * @return How much training in this language?
	 */
	public int getTrainingCntLang(String langCode) {
		// HACK update old objects
		if (cntLang==null) cntLang = Collections.synchronizedMap(new HashMap());

		Integer v = cntLang.get(langCode);
		return v==null? 0 : v;
	}

	/**
	 * Taking calendar months from Jan 2012, ie. Jan 2012 = 0
	 */
	Map<Integer,TrainingInfo2> month2info = new HashMap();

	private final TimeCoverage coverage;

	public TimeCoverage getCoverage() {
		return coverage;
	}

	/**
	 * @return [distant-past upto start-of-day(wentLive+1)]
	 */
	private ITimeGrid slicer() {
		// include today in the "past" which will get trained on
		Time sod = TimeUtils.getStartOfDay(wentLive.plus(TUnit.DAY));
		assert sod.isAfterOrEqualTo(wentLive) : sod+" "+wentLive;
		SimpleTimeGrid stg = new SimpleTimeGrid(sod, TUnit.DAY);
		stg.setLimit(new Period(sod.minus(3, TUnit.YEAR), sod));
		return stg;
	}

	private TrainingInfo2 getTI2(Time t) {
//		assert period.length(TUnit.MILLISECOND) < TUnit.MONTH.getMillisecs()*1.5 : period;
//		Time t = period.first;
		// too far future? Given that the slicer will make all those buckets
		if (t.isAfter(new Time().plus(2, TUnit.YEAR))) {
			throw new IllegalArgumentException(t+" in "+this);
		}

		TrainingInfo2 ti2 = getTrainingInfo2(t);
		return ti2;
	}
	private TrainingInfo2 getTrainingInfo2(Time t) {
		int bi = slicer().getBucket(t);
		TrainingInfo2 ti2 = month2info.get(bi);
		if (ti2==null) {
			ti2 = new TrainingInfo2();
			month2info.put(bi, ti2);
		}
		return ti2;
	}

	public void update(boolean online, Time trainingEvent) {
		if (online) {
			cntLive++;
		} else {
			cntHistorical++;
		}
		TrainingInfo2 ti2 = getTI2(trainingEvent);
		ti2.cnt ++;
	}

	@Override
	public String toJSONString() {
		return new JSONObject(toJson2()).toString();
	}

	@Override
	public Map toJson2() throws UnsupportedOperationException {
		return new ArrayMap(
				"wentLive", wentLive,
				"cnt", getTrainingCnt(),
				"coverage", getCoverage().getProgress()
		);
	}

	@Override
	public void appendJson(StringBuilder sb) {
		sb.append(toJSONString());
	}
}

class TrainingInfo2 implements Serializable {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;
	@Override
	public String toString() {
		return "TI2[cnt=" + cnt+"]";
	}

//	/**
//	 * For debugging
//	 */
//	Set<XId> seen = new HashSet();

	public int cnt;
//	ConfusionMatrix<String> confMatrix;

}


text:
<?php

namespace Yumcha\Bundle\WebsiteBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class SpecialBubbleType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('name')
            ->add('textCa', 'textarea', array(
                    'attr' => array(
                        'class' => 'tinymce',
                        'data-theme' => 'simple' // simple, advanced, bbcode
                    )
                ))
            ->add('textEs', 'textarea', array(
                    'attr' => array(
                        'class' => 'tinymce',
                        'data-theme' => 'simple' // simple, advanced, bbcode
                    )
                ))
            ->add('textEn', 'textarea', array(
                    'attr' => array(
                        'class' => 'tinymce',
                        'data-theme' => 'simple' // simple, advanced, bbcode
                    )
                ))
            ->add('file')
        ;
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Yumcha\Bundle\WebsiteBundle\Entity\SpecialBubble'
        ));
    }

    public function getName()
    {
        return 'yumcha_bundle_websitebundle_specialbubbletype';
    }
}


text:
BINARY=build/bin/minishift
ISO=file://$(pwd)/build/minishift-b2d.iso
EXTRA_FLAGS="--show-libmachine-logs"

function print_success_message() {
  echo ""
  echo " ------------ [ $1 - Passed ]"
  echo ""
}

function exit_with_message() {
  if [[ "$1" != 0 ]]; then
    echo "$2"
    exit 1
  fi
}

function assert_equal() {
  if [ "$1" != "$2" ]; then
    echo "Expected '$2' but got '$1'"
    exit 1
  fi
}

# http://www.linuxjournal.com/content/validating-ip-address-bash-script
function assert_valid_ip() {
  local ip=$1
  local valid=1

  if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
    OIFS=$IFS
    IFS='.'
    ip=($ip)
    IFS=$OIFS
    [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \
    && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]]
    valid=$?
  fi

  if [[ "$valid" != 0 ]]; then
    echo "IP '$1' is invalid"
    exit 1
  fi
 }

function verify_start_instance() {
  $BINARY start --iso-url $ISO $EXTRA_FLAGS
  exit_with_message "$?" "Error starting Minishift VM"
  output=`$BINARY status | sed -n 1p`
  assert_equal "$output" "Minishift:  Running"
  print_success_message "Starting VM"
}

function verify_stop_instance() {
  $BINARY stop
  exit_with_message "$?" "Error starting Minishift VM"
  output=`$BINARY status | sed -n 1p`
  assert_equal "$output" "Minishift:  Stopped"
  print_success_message "Stopping VM"
}

function verify_ssh_connection() {
  output=`$BINARY ssh -- echo hello`
  assert_equal "$output" "hello"
  print_success_message "SSH Connection"
}

function verify_vm_ip() {
  output=`$BINARY ip`
  assert_valid_ip $output
  print_success_message "Getting VM IP"
}

function verify_cifs_installation() {
  expected="mount.cifs version: 6.2"
  output=`$BINARY ssh -- sudo /sbin/mount.cifs -V`
  assert_equal "$output" "$expected"
  print_success_message "CIFS installation"
}

function verify_sshfs_installation() {
  expected="SSHFS version 2.5"
  output=`$BINARY ssh -- sudo sshfs -V`
  echo $output | grep "$expected" > /dev/null
  if [ "$?" != "0" ]; then
    echo "Expected exit status of command '$BINARY ssh -- sudo sshfs -V' to be 0."
    exit 1
  fi
  print_success_message "SSHFS installation"
}

function verify_nfs_installation() {
  expected="mount.nfs: (linux nfs-utils 1.3.3)"
  output=`$BINARY ssh -- sudo /sbin/mount.nfs -V /need/for/version`
  assert_equal "$output" "$expected"
  print_success_message "NFS installation"
}

function verify_bind_mount() {
  output=`$BINARY ssh 'mount | grep /dev/sda1 | grep /var/lib/ | wc -l'`
  assert_equal $output "5"
  print_success_message "Bind mount check"
}

function verify_delete() {
  $BINARY delete --force
  exit_with_message "$?" "Error deleting Minishift VM"
  output=`$BINARY status`
}

# Tests
verify_start_instance
verify_ssh_connection
verify_vm_ip
verify_cifs_installation
verify_sshfs_installation
verify_nfs_installation
verify_bind_mount
verify_stop_instance
verify_delete


text:
<?php

namespace Symfony\Component\Notifier\Tests;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Channel\SmsChannel;
use Symfony\Component\Notifier\Exception\LogicException;
use Symfony\Component\Notifier\Notification\Notification;
use Symfony\Component\Notifier\Notifier;
use Symfony\Component\Notifier\Transport\NullTransport;

/**
 * @author Smaïne Milianni <smaine.milianni@gmail.com>
 */
final class NotifierTest extends TestCase
{
    public function testItThrowAnExplicitErrorIfAnSmsChannelDoesNotHaveRecipient()
    {
        $this->expectException(LogicException::class);
        $this->expectExceptionMessage('The "sms" channel needs a Recipient.');

        $notifier = new Notifier(['sms' => new SmsChannel(new NullTransport())]);
        $notifier->send(new Notification('Hello World!', ['sms/twilio']));
    }
}


text:
> The Apache Thrift software framework, for scalable cross-language
> services development, combines a software stack with a code generation
> engine to build services that work efficiently and seamlessly between
> C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa,
> JavaScript, Node.js, Smalltalk, OCaml and Delphi and other languages.

Read more about [Thrift](https://thrift.apache.org).

# How To Use This Image

This is image is intended to run as an executable. Files are provided
by mounting a directory. Here's an example of compiling
`service.thrift` to ruby to the current directory.

    docker run -v "$(pwd):/data" thrift thrift -o /data --gen rb /data/service.thrift

Note, that you may want to include `-u $(id -u)` to set the UID on
generated files. The thrift process runs as root by default which will
generate root owned files depending on your docker setup.


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
    <entry key="com.alibaba.p3c.analytics.action_group.text">Alibaba Coding Guidelines</entry>
    <entry key="com.alibaba.p3c.action.switch_language.text.cur_zh">Switch language to English</entry>
    <entry key="com.alibaba.p3c.action.switch_language.text.cur_en">Switch language to Chinese</entry>
    <entry key="com.alibaba.p3c.action.switch_language.text.success">
        <![CDATA[Switch language success,restart to get effect.]]></entry>
    <entry key="com.alibaba.p3c.idea.action.AliInspectionAction.text">Alibaba Coding Guidelines Analyze</entry>
    <entry key="com.alibaba.p3c.idea.action.ToggleProjectInspectionAction.text.close">Close inspection on the fly
    </entry>
    <entry key="com.alibaba.p3c.idea.action.ToggleProjectInspectionAction.text.open">Open inspection on the fly</entry>
    <entry key="com.alibaba.p3c.idea.quickfix.delete_$">Delete starting '$' or '_'</entry>
    <entry key="com.alibaba.p3c.idea.quickfix.generate.author">Add/Extract @author</entry>
    <entry key="com.alibaba.p3c.idea.quickfix.field.to.upperCaseWithUnderscore">Refactor to upper case with underscore
    </entry>
    <entry key="com.alibaba.p3c.idea.quickfix.variable.lowerCamelCase">Refactor to lower camel case name</entry>
    <entry key="com.alibaba.p3c.idea.quickfix.vm.add!">Add '!' for variable</entry>
    <entry key="com.alibaba.p3c.idea.quickfix.replace.with">Replace with</entry>
    <entry key="com.alibaba.p3c.idea.quickfix.standalone.AliAccessStaticViaInstanceInspection">Access static '%s.%s' via
        class '%s' reference.
    </entry>
    <entry key="com.alibaba.p3c.idea.quickfix.standalone.AliMissingOverrideAnnotationInspection">Add @Override
        annotation
    </entry>
    <entry key="com.alibaba.p3c.idea.quickfix.NeedBraceRule">Add braces to statement</entry>
    <entry key="com.alibaba.p3c.idea.quickfix.AliEqualsAvoidNull">Flip 'equals()'</entry>
    <entry key="com.alibaba.p3c.idea.quickfix.ArrayNamingShouldHaveBracketRule">Replace with Java-style array
        declaration
    </entry>
    <entry key="com.alibaba.p3c.idea.quickfix.AliLongLiteralsEndingWithLowercaseL">Replace 'l' with 'L'</entry>

    <entry key="com.alibaba.p3c.idea.inspection.equals.instead.quality">
        <![CDATA[#ref should replace with equals for wrapper type #loc]]></entry>
    <entry key="com.alibaba.p3c.idea.inspection.standalone.AliAccessStaticViaInstanceInspection.message">A static field
        or method should be directly referred by its class name instead of its corresponding object name.
    </entry>
    <entry key="com.alibaba.p3c.idea.inspection.standalone.AliAccessStaticViaInstanceInspection.errMsg">%s access static
        member via class instance is prohibited #loc
    </entry>

    <entry key="com.alibaba.p3c.idea.inspection.standalone.AliDeprecationInspection.message">Using a deprecated class or
        method is prohibited.
    </entry>
    <entry key="com.alibaba.p3c.idea.inspection.standalone.AliMissingOverrideAnnotationInspection.message">An overridden
        method from an interface or abstract class must be marked with @Override annotation.
    </entry>
    <entry key="com.alibaba.p3c.idea.inspection.standalone.AliMissingOverrideAnnotationInspection.errMsg">
        <![CDATA[Missing '@Override' annotation on #ref() #loc]]></entry>
    <entry key="com.alibaba.p3c.idea.inspection.standalone.MapOrSetKeyShouldOverrideHashCodeEqualsInspection.message">
        Custom class must override 'hashCode' and 'equals' while use as key for Map or value for Set.
    </entry>
    <entry key="com.alibaba.p3c.idea.inspection.standalone.MapOrSetKeyShouldOverrideHashCodeEqualsInspection.errMsg">
        Type of parameter %s does not override 'hashCode' and 'equals' #loc
    </entry>
    <entry key="com.alibaba.p3c.idea.inspection.rule.AvoidCallStaticSimpleDateFormatRule.errMsg">
        <![CDATA[#ref is unsafe,lock or use local variable #loc]]></entry>
    <entry key="com.alibaba.p3c.idea.inspection.rule.NeedBraceRule.errMsg">
        <![CDATA[#ref without braces #loc]]></entry>
    <entry key="com.alibaba.p3c.idea.inspection.rule.AliEqualsAvoidNull.errMsg">
        <![CDATA[#ref is argument of '%s()', instead of its target #loc]]></entry>
    <entry key="com.alibaba.p3c.idea.inspection.rule.AliLongLiteralsEndingWithLowercaseL.errMsg">
        <![CDATA['long' literal #ref ends with lowercase 'l' #loc]]></entry>
    <entry key="com.alibaba.p3c.idea.inspection.rule.WrapperTypeEqualityRule.errMsg">
        <![CDATA[The wrapper classes should be compared by equals method rather than by symbol of '==' directly #loc]]></entry>

    <entry key="com.alibaba.p3c.idea.inspection.rule.ArrayNamingShouldHaveBracketRule.errMsg">
        <![CDATA[C-style array declaration of {0, choice, 1#field|2#parameter|3#local variable} #ref #loc]]></entry>

    <entry key="com.alibaba.p3c.idea.inspection.standalone.AliAccessStaticViaInstanceInspection.desc"><![CDATA[

A static field or method should be directly referred by its class name instead of its corresponding object name.

]]></entry>
    <entry key="com.alibaba.p3c.idea.inspection.standalone.AliDeprecationInspection.desc"><![CDATA[

Using a deprecated class or method is prohibited.

Note: For example, decode(String source, String encode) should be used instead of the deprecated method decode(String encodeStr). Once an interface has been deprecated, the interface provider has the obligation to provide a new one. At the same time, client programmers have the obligation to check out what its new implementation is.

]]></entry>
    <entry key="com.alibaba.p3c.idea.inspection.standalone.AliMissingOverrideAnnotationInspection.desc"><![CDATA[

An overridden method from an interface or abstract class must be marked with @Override annotation.

Counter example: For getObject() and get0bject(), the first one has a letter 'O', and the second one has a number '0'. To accurately determine whether the overriding is successful, an @Override annotation is necessary. Meanwhile, once the method signature in the abstract class is changed, the implementation class will report a compile-time error immediately.

]]></entry>
    <entry key="com.alibaba.p3c.idea.inspection.standalone.MapOrSetKeyShouldOverrideHashCodeEqualsInspection.desc">
        <![CDATA[

Custom class must override 'hashCode' and 'equals' while use as key for Map or value for Set.

The usage of hashCode and equals should follow:

 1) Override hashCode if equals is overridden.

 2) These two methods must be overridden for Set since they are used to ensure that no duplicate object will be inserted in Set.

 3) These two methods must be overridden if self-defined object is used as the key of Map.

Note: String can be used as the key of Map since these two methods have been rewritten.

]]></entry>
</properties>


text:
export declare class JsonValueConverter {
    toView(value: any): string;
}
export declare class MarkdownValueConverter {
    toView(value: string): string;
}
export declare class PhoneValueConverter {
    toView(value: string, country?: string): string;
}
export declare class DateValueConverter {
    toView(value: string, format?: string): any;
}
export declare class TimeValueConverter {
    toView(value: string, format?: string): any;
}
export declare class DatetimeValueConverter {
    toView(value: string, format?: string): any;
}
export declare class FromNowValueConverter {
    toView(value: string): string;
}
export declare class UtcValueConverter {
    toView(value: string): any;
}
export declare class NumberValueConverter {
    toView(value: string, format?: string): string;
}
export declare class CurrencyValueConverter {
    toView(value: string, symbol?: string, format?: string): string;
}
export declare class PercentValueConverter {
    toView(value: string): string;
}


text:
package javax.servlet;

import java.util.*;
import javax.servlet.annotation.HttpMethodConstraint;
import javax.servlet.annotation.ServletSecurity;

/**
 * Java Class represntation of a {@link ServletSecurity} annotation value.
 *
 * @since Servlet 3.0
 */
public class ServletSecurityElement extends HttpConstraintElement {

    private Collection<String> methodNames;
    private Collection<HttpMethodConstraintElement> methodConstraints;

    /**
     * Constructs an instance using the default
     * HttpConstraintElement value as the default Constraint
     * element and with no HTTP Method specific constraint elements.
     */
    public ServletSecurityElement() {
        methodConstraints = new HashSet<HttpMethodConstraintElement>();
        methodNames = new HashSet<String>();
    }

    /**
     * Constructs an instance with a default Constraint element
     * and with no HTTP Method specific constraint elements.
     *
     * @param constraint the HttpConstraintElement to be
     * applied to all HTTP methods other than those represented in the
     * <tt>methodConstraints</tt>
     */
    public ServletSecurityElement(HttpConstraintElement constraint) {
        super(constraint.getEmptyRoleSemantic(),
                constraint.getTransportGuarantee(),
                constraint.getRolesAllowed());
        methodConstraints = new HashSet<HttpMethodConstraintElement>();
        methodNames = new HashSet<String>();
    }

    /**
     * Constructs an instance using the default
     * HttpConstraintElement value as the default Constraint
     * element and with a collection of HTTP Method specific constraint
     * elements.
     *
     * @param methodConstraints the collection of HTTP method specific
     * constraint elements
     *
     * @throws IllegalArgumentException if duplicate method names are
     * detected
     */
    public ServletSecurityElement(
            Collection<HttpMethodConstraintElement> methodConstraints) {
        this.methodConstraints = (methodConstraints == null ?
            new HashSet<HttpMethodConstraintElement>() : methodConstraints);
        methodNames = checkMethodNames(this.methodConstraints);
    }

    /**
     * Constructs an instance with a default Constraint element
     * and with a collection of HTTP Method specific constraint elements.
     *
     * @param constraint the HttpConstraintElement to be
     * applied to all HTTP methods other than those represented in the
     * <tt>methodConstraints</tt>
     * @param methodConstraints the collection of HTTP method specific
     * constraint elements.
     *
     * @throws IllegalArgumentException if duplicate method names are
     * detected
     */
    public ServletSecurityElement(HttpConstraintElement constraint,
            Collection<HttpMethodConstraintElement> methodConstraints) {
        super(constraint.getEmptyRoleSemantic(),
                constraint.getTransportGuarantee(),
                constraint.getRolesAllowed());
        this.methodConstraints = (methodConstraints == null ?
            new HashSet<HttpMethodConstraintElement>() : methodConstraints);
        methodNames = checkMethodNames(this.methodConstraints);
    }

    /**
     * Constructs an instance from a {@link ServletSecurity} annotation value.
     *
     * @param annotation the annotation value
     *
     * @throws IllegalArgumentException if duplicate method names are
     * detected
     */
    public ServletSecurityElement(ServletSecurity annotation) {
        super(annotation.value().value(),
                annotation.value().transportGuarantee(),
                annotation.value().rolesAllowed());
        this.methodConstraints = new HashSet<HttpMethodConstraintElement>();
        for (HttpMethodConstraint constraint :
                annotation.httpMethodConstraints()) {
            this.methodConstraints.add(
                new HttpMethodConstraintElement(
                    constraint.value(),
                    new HttpConstraintElement(constraint.emptyRoleSemantic(),
                        constraint.transportGuarantee(),
                        constraint.rolesAllowed())));
        }
        methodNames = checkMethodNames(this.methodConstraints);
    }

    /**
     * Gets the (possibly empty) collection of HTTP Method specific
     * constraint elements.
     *
     * @return the (possibly empty) collection of HttpMethodConstraintElement
     * objects
     */
    public Collection<HttpMethodConstraintElement> getHttpMethodConstraints() {
        return methodConstraints;
    }

    /**
     * Gets the set of HTTP methid names named by the HttpMethodConstraints.
     *
     * @return the set of String method names
     */
    public Collection<String> getMethodNames() {
        return methodNames;
    }

    /**
     * Checks for duplicate method names in methodConstraints.
     *
     * @param methodConstraints
     *
     * @retrun Set of method names
     *
     * @throws IllegalArgumentException if duplicate method names are
     * detected
     */
    private Collection<String> checkMethodNames(
            Collection<HttpMethodConstraintElement> methodConstraints) {
        Collection<String> methodNames = new HashSet<String>();
        for (HttpMethodConstraintElement methodConstraint :
                        methodConstraints) {
            String methodName = methodConstraint.getMethodName();
            if (methodNames.contains(methodName)) {
                throw new IllegalArgumentException(
                    "Duplicate HTTP method name: " + methodName);
            }
            methodNames.add(methodName);
        }
        return methodNames;
    }
}


text:
package magefortress.map;

import java.util.logging.Logger;
import magefortress.core.MFEDirection;
import magefortress.creatures.behavior.movable.MFCapability;

/**
 * Calculates clearance values for a map
 */
public class MFClearanceCalculator
{

  public MFClearanceCalculator(MFMap _map)
  {
    if (_map == null) {
      String msg = "Cannot create without a map.";
      logger.severe(msg);
      throw new IllegalArgumentException(msg);
    }
    this.map = _map;
  }

  public void calculateAllLevels(MFCapability _capability)
  {
    for (int z = 0; z < this.map.getDepth(); ++z) {
      this.calculateLevel(z, _capability);
    }
  }

  public void calculateLevel(int _z, MFCapability _capability)
  {
    MFTile[][] level = this.map.getLevelMap(_z);

    for (int x=this.map.getWidth()-1; x >= 0; --x) {
      for (int y=this.map.getHeight()-1; y>=0; --y) {

        final MFTile tile = level[x][y];
        final int clearance = calculateClearance(tile, _capability);
        tile.setClearance(_capability, clearance);

      }
    }
  }

  //---vvv---      PRIVATE METHODS      ---vvv---
  private static final Logger logger = Logger.getLogger(MFClearanceCalculator.class.getName());
  private final MFMap map;

  /**
   * Calculates the clearance for one tile
   * @param _tile the tile to update
   * @param _capability the capability of the creature
   * @return the highest possible clearance for this tile
   */
  private int calculateClearance(MFTile _tile, MFCapability _capability)
  {
    int result;

    if (!_tile.isWalkable(_capability)) {
      result = 0;
    } else {
      final MFTile neighborE  = this.map.getNeighbor(_tile, MFEDirection.E);
      final MFTile neighborS  = this.map.getNeighbor(_tile, MFEDirection.S);
      final MFTile neighborSE = this.map.getNeighbor(_tile, MFEDirection.SE);

      boolean accessible = canAccessNeighbors(_tile, _capability,
                                                neighborE, neighborS, neighborSE);

      // not placed on edge and neighbors are all accessible
      if (accessible) {
          // calculate clearance
          final int clearanceE  = neighborE.getClearance(_capability);
          final int clearanceS  = neighborS.getClearance(_capability);
          final int clearanceSE = neighborSE.getClearance(_capability);
          result = Math.min(clearanceE, Math.min(clearanceS, clearanceSE)) + 1;
      // placed on edge or no access to neighboring tiles
      } else {
        result = 1;
      }
    }

    return result;
  }

  private boolean canAccessNeighbors(MFTile _tile, MFCapability _capability,
                          MFTile _neighborE, MFTile _neighborS, MFTile _neighborSE)
  {
    // Do we have neighbors?
    if (_neighborE == null || _neighborS == null || _neighborSE == null) {
      return false;
    }

    boolean result = true;

    // Can we move to every neighboring tile?
    if (!_neighborE.isWalkable(_capability) ||
        !_neighborS.isWalkable(_capability) ||
        !_neighborSE.isWalkable(_capability)) {
      result = false;
    }

    // no walls placed between neighbors and tile
    if (result && (_tile.hasWallEast() || _tile.hasWallSouth())) {
      result = false;
    }

    return result;
  }

}


text:
package org.skywalking.apm.plugin.jdbc.connectionurl.parser;

public class URLLocation {
    private final int startIndex;
    private final int endIndex;

    public URLLocation(int startIndex, int endIndex) {
        this.startIndex = startIndex;
        this.endIndex = endIndex;
    }

    public int startIndex() {
        return startIndex;
    }

    public int endIndex() {
        return endIndex;
    }
}


text:
import * as React from 'react'
import * as Kb from '../../../common-adapters'
import FromField from './from-field'
import {
  ToKeybaseUserProps,
  ToKeybaseUser,
  ToStellarPublicKeyProps,
  ToStellarPublicKey,
  ToOtherAccount,
} from './to-field'
import {AccountID} from '../../../constants/types/wallets'

const ParticipantsKeybaseUser = (props: ToKeybaseUserProps) => (
  <Kb.Box2 direction="vertical" fullWidth={true}>
    <ToKeybaseUser {...props} />
  </Kb.Box2>
)

const ParticipantsStellarPublicKey = (props: ToStellarPublicKeyProps) => (
  <Kb.Box2 direction="vertical" fullWidth={true}>
    <ToStellarPublicKey {...props} />
  </Kb.Box2>
)

export type Account = {
  contents: string
  name: string
  id: AccountID
  isDefault: boolean
  unknown?: boolean
}

type ParticipantsOtherAccountProps = {
  user: string
  fromAccount: Account
  toAccount?: Account
  allAccounts: Account[]
  onChangeFromAccount: (accountID: AccountID) => void
  onChangeRecipient: (recipient: string) => void
  onLinkAccount: () => void
  onCreateNewAccount: () => void
  showSpinner: boolean
}

const ParticipantsOtherAccount = (props: ParticipantsOtherAccountProps) => (
  <Kb.Box2 direction="vertical" fullWidth={true}>
    <FromField
      initialAccount={props.fromAccount}
      accounts={props.allAccounts}
      onChangeSelectedAccount={props.onChangeFromAccount}
      user={props.user}
    />
    <ToOtherAccount
      user={props.user}
      toAccount={props.toAccount}
      allAccounts={props.allAccounts}
      onChangeRecipient={props.onChangeRecipient}
      onLinkAccount={props.onLinkAccount}
      showSpinner={props.showSpinner}
      onCreateNewAccount={props.onCreateNewAccount}
    />
  </Kb.Box2>
)

export {ParticipantsKeybaseUser, ParticipantsStellarPublicKey, ParticipantsOtherAccount}


text:
.wufoo {
    font-family: "Lato","Helvetica Neue",Helvetica,Arial,sans-serif;
    letter-spacing: 0.01em;
}

.wufoo .info {
    display: none;
}

#container {
    text-align: left;
    background: #18bc9c !important;
    border: 0px;
}

input.text, input.search, textarea.textarea {
    border: 1px solid #ddd;
    background: #fff;
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;
    height: 25px;
}

input.text, input.search, input.file, textarea.textarea, select.select {
    font-family: "Lato","Helvetica Neue",Helvetica,Arial,sans-serif;
    font-size: 16px !important;
    color: #333;
    margin: 5px;
    padding: 5px 0;
}

.wufoo li div label, form li span label {
    margin-left: 5px;
    padding-top: 3px;
    clear: both;
    font-size: 100%;
    line-height: 160%;
    color: #fff !important;
    display: block;
}

label.desc, legend.desc {
    font-size: 16px !important;
    font-weight: bold !important;
    color: #fff !important;
    line-height: 150% !important;
    margin-left: 5px;
    padding: 0 0 3px 0;
    border: none;
    display: block;
    white-space: normal;
    width: 100%;
}

.wufoo li.focused {
    background-color: #149e83 !important;
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
	border-radius: 10px;
}

.wufoo span.req {
    display: inline;
    float: none;
    color: #fff !important;
    font-weight: bold;
    margin: 0;
    padding: 0;
}

.safari input.btTxt {
    font-size: 130%;
}

.wufoo li {
    width: 84%;
}

.wufoo li.buttons input {
    font-size: 130%;
    margin-right: 5px;
    border-radius: 6px;
    border: 1px solid transparent;
    margin-left: 5px;
    padding: 18px 27px;
    background-color: #fff;
    color: #18bc9c;
    font-family: "Lato","Helvetica Neue",Helvetica,Arial,sans-serif;
}

.wufoo li.buttons input:hover {
    background-color: #f1f1f1;
    cursor: pointer;
}

.wufoo li.buttons input:active {
    background-color: #e6e6e6;
    cursor: pointer;
}

input.large, select.large {
    width: 98%;
}

textarea.textarea {
    width: 293px;
    min-width: 98%;
    max-width: 98%;
    height: 150px;
}

.wufoo li.focused .instruct, form li:hover .instruct {
    left: 100%;
    visibility: hidden;
    opacity: 1;
}

.wufoo li.error {
    display: block !important;
    background-color: #ffdfdf !important;
    border: 1px transparent;
    border-radius: 10px;
}


text:
This rule disallows using `PRINT` statements.

Examples of **incorrect** code for this rule:

```tsql
PRINT 'This is a debug message.'
```

Examples of **correct** code for this rule:

```tsql
RAISERROR('This is a debug message.', 160, 1);
```


text:
/**
 *     This code was auto-generated by a tool.
 *
 *     Changes to this file may cause incorrect behavior and will be lost if
 *     the code is regenerated.
 */
package com.mozu.api.contracts.reference;

import java.util.List;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.joda.time.DateTime;
import com.mozu.api.contracts.reference.Field;

/**
 *	Describes the structure of postal addresses based on the country specified. Because addresses vary from country to country, this schema allows a flexible storage structure.
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class AddressSchema implements Serializable
{
	// Default Serial Version UID
	private static final long serialVersionUID = 1L;

	/**
	 * The 2-letter geographic code representing the country for the physical or mailing address. Currently limited to the US.
	 */
	protected String countryCode;

	public String getCountryCode() {
		return this.countryCode;
	}

	public void setCountryCode(String countryCode) {
		this.countryCode = countryCode;
	}

	/**
	 * The label associated with this country.
	 */
	protected String countryLabel;

	public String getCountryLabel() {
		return this.countryLabel;
	}

	public void setCountryLabel(String countryLabel) {
		this.countryLabel = countryLabel;
	}

	/**
	 * The unique identifier of this postal address schema.
	 */
	protected Integer id;

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * The fields to display for postal addresses associated with this country.
	 */
	protected List<Field> fields;
	public List<Field> getFields() {
		return this.fields;
	}
	public void setFields(List<Field> fields) {
		this.fields = fields;
	}

}


text:
#include "builtin.h"
#include "config.h"
#include "blob.h"
#include "quote.h"
#include "parse-options.h"
#include "exec_cmd.h"

/*
 * This is to create corrupt objects for debugging and as such it
 * needs to bypass the data conversion performed by, and the type
 * limitation imposed by, index_fd() and its callees.
 */
static int hash_literally(unsigned char *sha1, int fd, const char *type, unsigned flags)
{
	struct strbuf buf = STRBUF_INIT;
	int ret;

	if (strbuf_read(&buf, fd, 4096) < 0)
		ret = -1;
	else
		ret = hash_sha1_file_literally(buf.buf, buf.len, type, sha1, flags);
	strbuf_release(&buf);
	return ret;
}

static void hash_fd(int fd, const char *type, const char *path, unsigned flags,
		    int literally)
{
	struct stat st;
	unsigned char sha1[20];

	if (fstat(fd, &st) < 0 ||
	    (literally
	     ? hash_literally(sha1, fd, type, flags)
	     : index_fd(sha1, fd, &st, type_from_string(type), path, flags)))
		die((flags & HASH_WRITE_OBJECT)
		    ? "Unable to add %s to database"
		    : "Unable to hash %s", path);
	printf("%s\n", sha1_to_hex(sha1));
	maybe_flush_or_die(stdout, "hash to stdout");
}

static void hash_object(const char *path, const char *type, const char *vpath,
			unsigned flags, int literally)
{
	int fd;
	fd = open(path, O_RDONLY);
	if (fd < 0)
		die_errno("Cannot open '%s'", path);
	hash_fd(fd, type, vpath, flags, literally);
}

static void hash_stdin_paths(const char *type, int no_filters, unsigned flags,
			     int literally)
{
	struct strbuf buf = STRBUF_INIT;
	struct strbuf unquoted = STRBUF_INIT;

	while (strbuf_getline(&buf, stdin) != EOF) {
		if (buf.buf[0] == '"') {
			strbuf_reset(&unquoted);
			if (unquote_c_style(&unquoted, buf.buf, NULL))
				die("line is badly quoted");
			strbuf_swap(&buf, &unquoted);
		}
		hash_object(buf.buf, type, no_filters ? NULL : buf.buf, flags,
			    literally);
	}
	strbuf_release(&buf);
	strbuf_release(&unquoted);
}

int cmd_hash_object(int argc, const char **argv, const char *prefix)
{
	static const char * const hash_object_usage[] = {
		N_("git hash-object [-t <type>] [-w] [--path=<file> | --no-filters] [--stdin] [--] <file>..."),
		N_("git hash-object  --stdin-paths"),
		NULL
	};
	const char *type = blob_type;
	int hashstdin = 0;
	int stdin_paths = 0;
	int no_filters = 0;
	int literally = 0;
	int nongit = 0;
	unsigned flags = HASH_FORMAT_CHECK;
	const char *vpath = NULL;
	const struct option hash_object_options[] = {
		OPT_STRING('t', NULL, &type, N_("type"), N_("object type")),
		OPT_BIT('w', NULL, &flags, N_("write the object into the object database"),
			HASH_WRITE_OBJECT),
		OPT_COUNTUP( 0 , "stdin", &hashstdin, N_("read the object from stdin")),
		OPT_BOOL( 0 , "stdin-paths", &stdin_paths, N_("read file names from stdin")),
		OPT_BOOL( 0 , "no-filters", &no_filters, N_("store file as is without filters")),
		OPT_BOOL( 0, "literally", &literally, N_("just hash any random garbage to create corrupt objects for debugging Git")),
		OPT_STRING( 0 , "path", &vpath, N_("file"), N_("process file as it were from this path")),
		OPT_END()
	};
	int i;
	const char *errstr = NULL;

	argc = parse_options(argc, argv, NULL, hash_object_options,
			     hash_object_usage, 0);

	if (flags & HASH_WRITE_OBJECT)
		prefix = setup_git_directory();
	else
		prefix = setup_git_directory_gently(&nongit);

	if (vpath && prefix)
		vpath = xstrdup(prefix_filename(prefix, vpath));

	git_config(git_default_config, NULL);

	if (stdin_paths) {
		if (hashstdin)
			errstr = "Can't use --stdin-paths with --stdin";
		else if (argc)
			errstr = "Can't specify files with --stdin-paths";
		else if (vpath)
			errstr = "Can't use --stdin-paths with --path";
	}
	else {
		if (hashstdin > 1)
			errstr = "Multiple --stdin arguments are not supported";
		if (vpath && no_filters)
			errstr = "Can't use --path with --no-filters";
	}

	if (errstr) {
		error("%s", errstr);
		usage_with_options(hash_object_usage, hash_object_options);
	}

	if (hashstdin)
		hash_fd(0, type, vpath, flags, literally);

	for (i = 0 ; i < argc; i++) {
		const char *arg = argv[i];
		char *to_free = NULL;

		if (prefix)
			arg = to_free = prefix_filename(prefix, arg);
		hash_object(arg, type, no_filters ? NULL : vpath ? vpath : arg,
			    flags, literally);
		free(to_free);
	}

	if (stdin_paths)
		hash_stdin_paths(type, no_filters, flags, literally);

	return 0;
}


text:
//
// Created by Christopher Miller on 2/17/17.
//

#include "SecretKeySpec.h"

SecretKeySpec::SecretKeySpec() : JavaClass() {}

/**
* Here you can construct the SecretKeySpec object how ever you need to,
* as well as load signatures for the Java instance method calls.
*/
SecretKeySpec::SecretKeySpec(JNIEnv *env, jbyteArray array, jint start, jint end, jstring algorithm) : JavaClass(env)
{
    initialize(env);

//    jstring algorithm = JavaString("AES").toJavaString(env);
    thisObj = env->NewObject(_clazz, getMethod("<init>"), array, start, end, algorithm);

    if (thisObj == NULL) {
        JavaExceptionUtils::throwExceptionOfType(env, kTypeIllegalStateException,
                                                 "SecretKeySpec's thisObj variable not intialized, methods of this class use the thisObj Java instance.");
    }
}
SecretKeySpec::SecretKeySpec(JNIEnv *env, jbyteArray array, jstring algorithm) : JavaClass(env)
{
    initialize(env);

//    jstring algorithm = JavaString("AES").toJavaString(env);
    thisObj = env->NewObject(_clazz, getMethod("<init>"), array, algorithm);

    if (thisObj == NULL) {
        JavaExceptionUtils::throwExceptionOfType(env, kTypeIllegalStateException,
                                                 "SecretKeySpec's thisObj variable not intialized, methods of this class use the thisObj Java instance.");
    }
}

void SecretKeySpec::initialize(JNIEnv *env)
{
    setClass(env);

//    cacheSignature(env, "<init>", "([BLjava/lang/String;)V");
    cacheSignature(env, "<init>", "([BIILjava/lang/String;)V");
    cacheSignature(env, "getAlgorithm", "()Ljava/lang/String;");
    cacheSignature(env, "getFormat", "()Ljava/lang/String;");
    cacheSignature(env, "getEncoded", "()[B");
    cacheSignature(env, "hashCode", "()I");
    cacheSignature(env, "equals", "(Ljava/lang/Object;)Z");

    registerNativeMethods(env);
}

void SecretKeySpec::mapFields()
{
    //mapField("encodedString", kTypeString, &encodedString);
}

jstring SecretKeySpec::getAlgorithm(JNIEnv *env)
{
    jobject result = env->CallObjectMethod(thisObj, getMethod(__FUNCTION__));
    JavaExceptionUtils::checkException(env);
    return (jstring) result;
}

jstring SecretKeySpec::getFormat(JNIEnv *env)
{
    jobject result = env->CallObjectMethod(thisObj, getMethod(__FUNCTION__));
    JavaExceptionUtils::checkException(env);
    return (jstring) result;
}

jbyteArray SecretKeySpec::getEncoded(JNIEnv *env)
{
    jbyteArray result = (jbyteArray) env->CallObjectMethod(thisObj, getMethod(__FUNCTION__));
    JavaExceptionUtils::checkException(env);
    return result;
}

jint SecretKeySpec::hashCode(JNIEnv *env)
{
    jint result = env->CallIntMethod(thisObj, getMethod(__FUNCTION__));
    JavaExceptionUtils::checkException(env);
    return result;
}

jboolean SecretKeySpec::equals(JNIEnv *env, jobject jobjectValue1)
{
    jboolean result = env->CallBooleanMethod(thisObj, getMethod(__FUNCTION__), jobjectValue1);
    JavaExceptionUtils::checkException(env);
    return result;
}


text:
package com.helicalinsight.efw.serviceframework;

/**
 * Created by author on 08-09-2015.
 *
 * @author Rajasekhar
 */
@SuppressWarnings("unused")
public class GenericServiceImplementation implements IService {

    @Override
    public boolean isThreadSafeToCache() {
        return true;
    }

    @Override
    public String doService(String type, String serviceType, String service, String formData) {
        return ServiceUtils.execute(type, serviceType, service, formData);
    }
}


text:
// ----------------------------------------------------------------------------------------------------------------------
// Author: Tanveer Yousuf (@tanveery)
// ----------------------------------------------------------------------------------------------------------------------
// Copyright © Ejyle Technologies (P) Ltd. All rights reserved.
// Licensed under the MIT license. See the LICENSE file in the project's root directory for complete license information.
// ----------------------------------------------------------------------------------------------------------------------

using System.Configuration;

namespace Ejyle.DevAccelerate.Core.Configuration
{
    /// <summary>
    /// Represents the collection of provider configuration elements.
    /// </summary>
    public class DaProviderConfigurationElementCollection : DaProviderConfigurationElementCollection<DaProviderConfigurationElement>
    {
        /// <summary>
        /// Creates a new instance of <see cref="DaProviderConfigurationElement"/>.
        /// </summary>
        /// <returns>Returns an instance of the type <see cref="ConfigurationElement"/>.</returns>
        protected override ConfigurationElement CreateNewElement()
        {
            return new DaProviderConfigurationElement();
        }
    }

    /// <summary>
    /// Represents the collection of provider configuration elements.
    /// </summary>
    /// <typeparam name="TDaProviderConfigurationElement">The type of the provider element.</typeparam>
    public abstract class DaProviderConfigurationElementCollection<TDaProviderConfigurationElement> : ConfigurationElementCollection
        where TDaProviderConfigurationElement : DaProviderConfigurationElement
    {
        /// <summary>
        /// Gets the key for a provider configuration element.
        /// </summary>
        /// <param name="element">The element to return the key for.</param>
        /// <returns>Returns an instance of <see cref="System.Object"/>.</returns>
        protected override object GetElementKey(ConfigurationElement element)
        {
            return ((TDaProviderConfigurationElement)element).Name;
        }

        /// <summary>
        /// Gets provider configuration element by its name.
        /// </summary>
        /// <param name="name">The name of the provider configuration element.</param>
        /// <returns>Returns an instance of the type <see cref="DaProviderConfigurationElement"/>.</returns>
        public TDaProviderConfigurationElement GetByName(string name)
        {
            return (TDaProviderConfigurationElement)this.BaseGet((object)name);
        }

        /// <summary>
        /// Adds a provider configuration element to the configuration collection.
        /// </summary>
        /// <param name="element">The element to be added.</param>
        public void Add(TDaProviderConfigurationElement element)
        {
            this.BaseAdd(element);
        }

        /// <summary>
        /// Removes a provider configuration element from the configuration collection.
        /// </summary>
        /// <param name="name">The name of the element to be removed.</param>
        public void Remove(object name)
        {
            this.BaseRemove(name);
        }

        /// <summary>
        /// Removes a provider configuration element by its index from the configuration collection.
        /// </summary>
        /// <param name="index">The index of the element to be removed.</param>
        public void RemoveAt(int index)
        {
            this.BaseRemoveAt(index);
        }
    }
}


text:
import {RTC_VENDORS} from '../callout-vendors';
import {isSecureUrlDeprecated} from '../../../../src/url';

// The keys of RTC_VENDORS are not allowed to have any capital letters.
// This test acts as a presubmit to enforce that.
describe('RTC_VENDORS', () => {
  it('should have all lowercase keys', () =>
    Object.keys(RTC_VENDORS).forEach(
        key => expect(key).to.equal(key.toLowerCase())
    ));
  it('should all use https', () =>
    Object.keys(RTC_VENDORS).forEach(key => {
      expect(isSecureUrlDeprecated(RTC_VENDORS[key].url)).to.be.true;
      expect(!RTC_VENDORS[key].errorReportingUrl || isSecureUrlDeprecated(
          RTC_VENDORS[key].errorReportingUrl)).to.be.true;
    }));
});


text:
package org.cuisine.utility;

import java.util.ArrayList;
import java.util.List;

import org.dozer.DozerBeanMapperSingletonWrapper;
import org.dozer.Mapper;

/**
 * @author Michal Bocek
 * @since 1.0.0
 */
public final class DTOConverter {

	private DTOConverter() {
	}

	public static <T> T convert(final Object source, final Class<T> destinationClass) {
		final Mapper instance = DozerBeanMapperSingletonWrapper.getInstance();
		return instance.map(source, destinationClass);
	}

	public static void convert(final Object source, final Object destination) {
		final Mapper instance = DozerBeanMapperSingletonWrapper.getInstance();
		instance.map(source, destination);
	}

	public static <T, TT> List<T> convertList(final List<TT> list, final Class<T> destinationClass) {
		List<T> result = null;
		if (list != null) {
			final Mapper instance = DozerBeanMapperSingletonWrapper.getInstance();
			result = new ArrayList<T>(list.size());
			for (TT sourceObject : list) {
				final T destination = instance.map(sourceObject, destinationClass);
				result.add(destination);
			}
		}
		return result;
	}
}


text:
package com.hcl.appscan.sdk;

/**
 * Messages class.
 */
public class Messages {

	private static final MessagesBundle BUNDLE =
			new MessagesBundle("com.hcl.appscan.sdk.messages", Messages.class.getClassLoader()); //$NON-NLS-1$

	/**
	 * Get a message.
	 *
	 * @param key The key for the message.
	 * @param args Optional list of objects to be inserted into the message.
	 * @return The message.
	 */
	public static String getMessage(String key, Object... args) {
		return BUNDLE.getMessage(key, args);
	}
}


text:
package dal

// Config is config for the DAL
type Config struct {
	URL, User, Password string
}


text:
from distutils.util import get_platform
import sys
def configuration(parent_package='',top_path=None):
    from numpy.distutils.misc_util import Configuration, get_info
    config = Configuration('cross', parent_package, top_path)
    config.add_subpackage('rectcross')

    return config

if __name__ == '__main__':
    print 'This is the wrong setup.py to run'


text:
"use strict";

module.exports = require("./lib/finance");


text:
/*******************************
           Watch Task
*******************************/

var
  gulp         = require('gulp'),

  // node dependencies
  console      = require('better-console'),
  fs           = require('fs'),

  // gulp dependencies
  autoprefixer = require('gulp-autoprefixer'),
  chmod        = require('gulp-chmod'),
  clone        = require('gulp-clone'),
  gulpif       = require('gulp-if'),
  less         = require('gulp-less'),
  minifyCSS    = require('gulp-minify-css'),
  plumber      = require('gulp-plumber'),
  print        = require('gulp-print'),
  rename       = require('gulp-rename'),
  replace      = require('gulp-replace'),
  uglify       = require('gulp-uglify'),
  util         = require('gulp-util'),
  watch        = require('gulp-watch'),

  // user config
  config       = require('./config/user'),

  // task config
  tasks        = require('./config/tasks'),
  install      = require('./config/project/install'),

  // shorthand
  globs        = config.globs,
  assets       = config.paths.assets,
  output       = config.paths.output,
  source       = config.paths.source,

  banner       = tasks.banner,
  comments     = tasks.regExp.comments,
  log          = tasks.log,
  settings     = tasks.settings

;

// add tasks that shouldn't be exposed to end-user
require('./collections/internal')(gulp);

// export task
module.exports = function(callback) {

  if( !install.isSetup() ) {
    console.error('Cannot watch files. Run "gulp install" to set-up Semantic');
    return;
  }

  // check for right-to-left (RTL) language
  if(config.rtl == 'both') {
    gulp.start('watch-rtl');
  }
  if(config.rtl === true || config.rtl === 'Yes') {
    gulp.start('watch-rtl');
    return;
  }

  //console.clear();
  console.log('Watching source files for changes');

  /*--------------
      Watch CSS
  ---------------*/

  gulp
    .watch([
      source.config,
      source.definitions   + '/**/*.less',
      source.site          + '/**/*.{overrides,variables}',
      source.themes        + '/**/*.{overrides,variables}'
    ], function(file) {

      var
        lessPath,

        stream,
        compressedStream,
        uncompressedStream,

        isDefinition,
        isPackagedTheme,
        isSiteTheme,
        isConfig
      ;

      // log modified file
      gulp.src(file.path)
        .pipe(print(log.modified))
      ;

      /*--------------
         Find Source
      ---------------*/

      // recompile on *.override , *.variable change
      isConfig        = (file.path.indexOf('theme.config') !== -1 || file.path.indexOf('site.variables') !== -1);
      isPackagedTheme = (file.path.indexOf(source.themes) !== -1);
      isSiteTheme     = (file.path.indexOf(source.site) !== -1);
      isDefinition    = (file.path.indexOf(source.definitions) !== -1);

      if(isConfig) {
        console.info('Rebuilding all UI');
        // impossible to tell which file was updated in theme.config, rebuild all
        gulp.start('build-css');
        return;
      }
      else if(isPackagedTheme) {
        console.log('Change detected in packaged theme');
        lessPath = util.replaceExtension(file.path, '.less');
        lessPath = lessPath.replace(tasks.regExp.theme, source.definitions);
      }
      else if(isSiteTheme) {
        console.log('Change detected in site theme');
        lessPath = util.replaceExtension(file.path, '.less');
        lessPath = lessPath.replace(source.site, source.definitions);
      }
      else {
        console.log('Change detected in definition');
        lessPath = file.path;
      }

      /*--------------
         Create CSS
      ---------------*/

      if( fs.existsSync(lessPath) ) {

        // unified css stream
        stream = gulp.src(lessPath)
          .pipe(plumber(settings.plumber.less))
          .pipe(less(settings.less))
          .pipe(print(log.created))
          .pipe(replace(comments.variables.in, comments.variables.out))
          .pipe(replace(comments.license.in, comments.license.out))
          .pipe(replace(comments.large.in, comments.large.out))
          .pipe(replace(comments.small.in, comments.small.out))
          .pipe(replace(comments.tiny.in, comments.tiny.out))
          .pipe(autoprefixer(settings.prefix))
          .pipe(gulpif(config.hasPermission, chmod(config.permission)))
        ;

        // use 2 concurrent streams from same pipe
        uncompressedStream = stream.pipe(clone());
        compressedStream   = stream.pipe(clone());

        uncompressedStream
          .pipe(plumber())
          .pipe(replace(assets.source, assets.uncompressed))
          .pipe(gulp.dest(output.uncompressed))
          .pipe(print(log.created))
          .on('end', function() {
            gulp.start('package uncompressed css');
          })
        ;

        compressedStream = stream
          .pipe(plumber())
          .pipe(replace(assets.source, assets.compressed))
          .pipe(minifyCSS(settings.minify))
          .pipe(rename(settings.rename.minCSS))
          .pipe(gulp.dest(output.compressed))
          .pipe(print(log.created))
          .on('end', function() {
            gulp.start('package compressed css');
          })
        ;
      }
      else {
        console.log('Cannot find UI definition at path', lessPath);
      }
    })
  ;

  /*--------------
      Watch JS
  ---------------*/

  gulp
    .watch([
      source.definitions   + '/**/*.js'
    ], function(file) {
      gulp.src(file.path)
        .pipe(plumber())
        .pipe(replace(comments.license.in, comments.license.out))
        .pipe(gulpif(config.hasPermission, chmod(config.permission)))
        .pipe(gulp.dest(output.uncompressed))
        .pipe(print(log.created))
        .pipe(uglify(settings.uglify))
        .pipe(rename(settings.rename.minJS))
        .pipe(gulp.dest(output.compressed))
        .pipe(print(log.created))
        .on('end', function() {
          gulp.start('package compressed js');
          gulp.start('package uncompressed js');
        })
      ;
    })
  ;

  /*--------------
    Watch Assets
  ---------------*/

  // only copy assets that match component names (or their plural)
  gulp
    .watch([
      source.themes   + '/**/assets/**/*.*'
    ], function(file) {
      // copy assets
      gulp.src(file.path, { base: source.themes })
        .pipe(gulpif(config.hasPermission, chmod(config.permission)))
        .pipe(gulp.dest(output.themes))
        .pipe(print(log.created))
      ;
    })
  ;

};


text:
package utils

import (
	"net/http"
	"runtime/debug"

	"github.com/jinzhu/gorm"
)

//TODO MOVE TO ERROR PACKAGE

type HttpError struct {
	Error string
	Code int
	InternalError string
}

func AssociationError(db *gorm.Association) *HttpError {
	return InternalServerError(db.Error.Error())
}

func DatabaseError(db *gorm.DB) *HttpError {
	if db.RecordNotFound() {
		return NotFound(db.Error.Error())
	}
	return InternalServerError(db.Error.Error())
}

func BadRequest(error string) *HttpError {
	debug.PrintStack()
	return &HttpError { http.StatusText(http.StatusBadRequest), http.StatusBadRequest, error }
}

func InternalServerError(error string) *HttpError {
	debug.PrintStack()
	return &HttpError { http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError, error }
}

func NotFound(error string) *HttpError {
	debug.PrintStack()
	return &HttpError { http.StatusText(http.StatusNotFound), http.StatusNotFound, error }
}


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Erythrochlamys fruticosa O.Ryding

### Remarks
null


text:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
some.html in folder
</body>
</html>


text:
(function() {
  Bootstrap.BsWizardStep = Bootstrap.ItemView.extend(Bootstrap.ItemSelection, Bootstrap.NavItem, {
    classNames: ['wizard-step'],
    classNameBindings: ['completed'],
    completed: false,
    template: Ember.Handlebars.compile(['{{view view.stepAsLink}}'].join("\n")),
    stepAsLink: Ember.View.extend({
      tagName: 'a',
      template: Ember.Handlebars.compile('{{view.parentView.title}}'),
      attributeBindings: ['href'],
      href: "#"
    })
  });

  Bootstrap.BsWizardSteps = Bootstrap.ItemsView.extend(Bootstrap.Nav, {
    navType: 'pills',
    classNames: ['wizard-steps'],
    itemViewClass: Bootstrap.BsWizardStep,
    currentItemIdx: (function() {
      var i, selected, selectedItem, view, _i, _len, _ref;
      selected = this.get('selected');
      i = 0;
      _ref = this._childViews;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        view = _ref[_i];
        if (view.get('content') === selected) {
          selectedItem = view;
          break;
        }
        i++;
      }
      if (selectedItem) {
        return i;
      } else {
        return null;
      }
    }).property('selected')
  });

  Bootstrap.BsWizardStepPane = Bootstrap.ItemPaneView.extend();

  Bootstrap.BsWizardStepsPanes = Bootstrap.ItemsPanesView.extend({
    classNames: ['wizard-panes'],
    itemViewClass: Bootstrap.BsWizardStepPane
  });

  Bootstrap.BsWizardComponent = Ember.ContainerView.extend(Ember.TargetActionSupport, {
    classNames: ['wizard'],
    childViews: ['steps', 'panes', 'controls'],
    prevAllowed: true,
    items: (function() {
      var _ref;
      return (_ref = this._childViews) != null ? _ref[0] : void 0;
    }).property('content'),
    panes: (function() {
      return this._childViews[1];
    }).property('content'),
    steps: Bootstrap.BsWizardSteps.extend({
      contentBinding: 'parentView.content',
      selectedBinding: 'parentView.selected'
    }),
    panes: Bootstrap.BsWizardStepsPanes.extend({
      contentBinding: 'parentView.content'
    }),
    controls: Ember.ContainerView.extend({
      childViews: ['prev', 'next', 'finish'],
      prev: Bootstrap.BsButtonComponent.extend({
        layoutName: 'components/bs-button',
        title: 'Prev',
        size: 'xs',
        "data-rel": 'PREV',
        isVisible: (function() {
          return this.get('parentView').get('parentView').get('hasPrev');
        }).property('parentView.parentView.items.selected')
      }),
      next: Bootstrap.BsButtonComponent.extend({
        layoutName: 'components/bs-button',
        title: 'Next',
        size: 'xs',
        "data-rel": 'NEXT',
        isVisible: (function() {
          return this.get('parentView').get('parentView').get('hasNext');
        }).property('parentView.parentView.items.selected')
      }),
      finish: Bootstrap.BsButtonComponent.extend({
        layoutName: 'components/bs-button',
        title: 'Finish',
        size: 'xs',
        "data-rel": 'FINISH',
        isVisible: (function() {
          return this.get('parentView').get('parentView').get('isLast');
        }).property('parentView.parentView.items.selected')
      })
    }),
    currentStepIdx: (function() {
      return this.get('items').get('currentItemIdx');
    }).property('items.selected'),
    willInsertElement: function() {
      this.get('panes').set('items-id', this.get('items').get('elementId'));
      return this.get('items').set('default', this.get('items')._childViews[0].get('content').get('title'));
    },
    click: function(event) {
      var b;
      b = event.target.getAttribute("data-rel");
      if (b === 'PREV') {
        this.prev();
      }
      if (b === 'NEXT') {
        this.next();
      }
      if (b === 'FINISH') {
        return this.close();
      }
    },
    next: function() {
      var currIdx;
      if (this.get('hasNext')) {
        this.stepCompleted(this.get('currentStepIdx'));
        currIdx = this.get('currentStepIdx') + 1;
        this.move(currIdx);
        return this.triggerAction({
          action: 'onNext',
          actionContext: this.get('targetObject')
        });
      }
    },
    prev: function() {
      var currIdx;
      if (this.get('hasPrev')) {
        currIdx = this.get('currentStepIdx') - 1;
        this.stepCompleted(currIdx, false);
        this.move(currIdx);
        return this.triggerAction({
          action: 'onPrev',
          actionContext: this.get('targetObject')
        });
      }
    },
    move: function(idx) {
      var _ref, _ref1;
      return (_ref = this._childViews[0]) != null ? _ref.set('selected', (_ref1 = this._childViews[0]._childViews[idx]) != null ? _ref1.get('content') : void 0) : void 0;
    },
    hasNext: (function() {
      return this.get('items')._childViews.length > this.get('currentStepIdx') + 1;
    }).property('currentStepIdx'),
    hasPrev: (function() {
      this.get('currentStepIdx') > 0;
      return this.get('currentStepIdx') > 0 && this.get('prevAllowed');
    }).property('currentStepIdx'),
    isLast: (function() {
      return this.get('items')._childViews.length === this.get('currentStepIdx') + 1;
    }).property('currentStepIdx'),
    close: (function() {
      this.triggerAction({
        action: 'onFinish',
        actionContext: this.get('targetObject')
      });
      return this.destroy();
    }),
    stepCompleted: function(idx, compl) {
      if (compl == null) {
        compl = true;
      }
      return this._childViews[0]._childViews[idx].set('completed', compl);
    }
  });

  Bootstrap.BsWizardComponent = Bootstrap.BsWizardComponent.reopenClass({
    build: function(options) {
      var wizard;
      if (!options) {
        options = {};
      }
      options.manual = true;
      wizard = this.create(options);
      return wizard.append();
    }
  });

  Ember.Handlebars.helper('bs-wizard', Bootstrap.BsWizardComponent);

}).call(this);