text:
import os
from functools import partial
from warnings import warn

from flask import url_for

from dxr.utils import BROWSE, search_url

def quote(qualname):
    """ Wrap qualname in quotes if it contains spaces """
    if ' ' in qualname:
        qualname = '"' + qualname + '"'
    return qualname

def truncate_value(value, typ=""):
    result = ""
    if value:
        eol = value.find('\n')
        if eol < 0:
            result = value.strip()
        else:
            value = value[0:eol]
            value = value.strip()
            result = value + " ..."

    if typ:
        if result:
            result = typ + ": " + result
        else:
            result = typ

    if not result:
        return None

    return result

def find_references_menu_item(tree_config, qualname, filter_name, kind):
    """A sort of compound menu that handles finding various sorts of
    references

    Should be broken into several.

    """
    return {'html':   "Find references",
            'title':  "Find references to this " + kind,
            'href':   search_url(tree_config, "+" + filter_name + ":%s" % quote(qualname)),
            'icon':   'reference'}

def std_lib_links_menu((doc_url, src_url, dxr_url), extra_text=""):
    # TODO: Stop storing entire URLs in ES.
    def get_domain(url):
        start = url.find('//') + 2
        return url[start:url.find('/', start)]

    def add_link_to_menu(url, html, title):
        if url:
            menu.append({'html': html,
                         'title': title,
                         'href': url,
                         'icon': 'jump'})

    menu = []
    add_link_to_menu(doc_url,
                     'Go to docs' + extra_text,
                     'Go to documentation for this crate on ' + get_domain(doc_url))
    add_link_to_menu(src_url,
                     'Go to source' + extra_text,
                     'Go to source code for this crate on ' + get_domain(doc_url))
    add_link_to_menu(dxr_url,
                     'Go to DXR index' + extra_text,
                     'Go to DXR index of this crate on ' + get_domain(doc_url))
    return menu

def call_menu(qualname, tree):
    return [{'html': "Find callers",
             'title': "Find functions that call this function",
             'href': search_url(tree, "+callers:%s" % quote(qualname)),
             'icon': 'method'},
            {'html': "Find callees",  # TODO: Probably useless. Remove.
             'title': "Find functions that are called by this function",
             'href': search_url(tree, "+called-by:%s" % quote(qualname)),
             'icon': 'method'}]

def generic_function_menu(qualname, tree_config):
    """Return menu makers shared by function def/decls and function refs."""

    menu = call_menu(qualname, tree_config)
    menu.append(find_references_menu_item(tree_config, qualname, "function-ref", "function"))
    return menu

def jump_to_target_menu_item(tree_config, path, row, target_name):
    """Make a menu that jumps straight to a specific line of a file."""

    return {'html': 'Jump to %s' % target_name,
            'title': "Jump to %s in '%s'" % (target_name,
                                             os.path.basename(path)),
            'href': url_for(BROWSE, tree=tree_config.name, path=path, _anchor=row),
            'icon': 'jump'}

def jump_to_target_from_decl(menu_maker, tree, decl):
    """Return a jump menu item from a declaration mapping.

    If the incoming declaration doesn't warrant the creation of a menu,
    return None.
    """

    path = decl['file_name']
    if path:
        return menu_maker(tree, path, decl['file_line'])
    else:
        warn("Can't add jump to empty path.")  # Can this happen?

jump_to_trait_method_menu_item = partial(jump_to_target_menu_item, target_name='trait method')
jump_to_definition_menu_item = partial(jump_to_target_menu_item, target_name='definition')
jump_to_module_definition_menu_item = partial(jump_to_target_menu_item, target_name='module definition')
jump_to_module_declaration_menu_item = partial(jump_to_target_menu_item, target_name='module declaration')
jump_to_alias_definition_menu_item = partial(jump_to_target_menu_item, target_name='alias definition')
jump_to_crate_menu_item = partial(jump_to_target_menu_item, target_name='crate')
jump_to_type_declaration_menu_item = partial(jump_to_target_menu_item, target_name='type declaration')
jump_to_variable_declaration_menu_item = partial(jump_to_target_menu_item, target_name='variable declaration')
jump_to_function_declaration_menu_item = partial(jump_to_target_menu_item, target_name='function declaration')

def trait_impl_menu_item(tree_config, qualname, count):
    return {'html': "Find implementations (%d)" % count,
            'title': "Find implementations of this trait method",
            'href': search_url(tree_config, "+fn-impls:%s" % quote(qualname)),
            'icon': 'method'}

def generic_variable_menu(datum, tree_config):
    return [find_references_menu_item(tree_config, datum['qualname'], "var-ref", "variable")]

def type_menu(tree_config, kind, qualname):
    if kind == 'trait':
        yield {'html': "Find sub-traits",
               'title': "Find sub-traits of this trait",
               'href': search_url(tree_config, "+derived:%s" % quote(qualname)),
               'icon': 'type'}
        yield {'html': "Find super-traits",
               'title': "Find super-traits of this trait",
               'href': search_url(tree_config, "+bases:%s" % quote(qualname)),
               'icon': 'type'}
    if kind == 'struct' or kind == 'enum' or kind == 'trait':
        yield {'html': "Find impls",
               'title': "Find impls which involve this " + kind,
               'href': search_url(tree_config, "+impl:%s" % quote(qualname)),
               'icon': 'reference'}

def generic_type_menu(datum, tree_config):
    kind = datum['kind']
    qualname = datum['qualname']
    menu = list(type_menu(tree_config, kind, qualname))
    menu.append(find_references_menu_item(tree_config, qualname, "type-ref", kind))
    return menu

def use_items_menu_item(tree_config, qualname):
    return {'html': "Find use items",
            'title': "Find instances of this module in 'use' items",
            'href': search_url(tree_config, "+module-use:%s" % quote(qualname)),
            'icon': 'reference'}

def generic_module_menu(datum, tree_config):
    return [use_items_menu_item(tree_config, datum['qualname']),
            find_references_menu_item(tree_config, datum['qualname'], "module-ref", "module")]


text:
def get_status_msgs(ds, videoplayer_mediastate, appname, said_start_playback, decodeprogress, totalhelping, totalspeed):
    intime = 'Not playing for quite some time.'
    ETA = ((900, 'Playing in less than 15 minutes.'),
     (600, 'Playing in less than 10 minutes.'),
     (300, 'Playing in less than 5 minutes.'),
     (60, 'Playing in less than a minute.'))
    topmsg = ''
    msg = ''
    logmsgs = ds.get_log_messages()
    logmsg = None
    if len(logmsgs) > 0:
        logmsg = logmsgs[-1][1]
    preprogress = ds.get_vod_prebuffering_progress()
    playable = ds.get_vod_playable()
    t = ds.get_vod_playable_after()
    intime = ETA[0][1]
    for eta_time, eta_msg in ETA:
        if t > eta_time:
            break
        intime = eta_msg

    if ds.get_status() == DLSTATUS_HASHCHECKING:
        genprogress = ds.get_progress()
        pstr = str(int(genprogress * 100))
        msg = 'Checking already downloaded parts ' + pstr + '% done'
    elif ds.get_status() == DLSTATUS_STOPPED_ON_ERROR:
        msg = 'Error playing: ' + str(ds.get_error())
    elif ds.get_progress() == 1.0:
        msg = ''
    elif playable:
        if not said_start_playback:
            msg = 'Starting playback...'
        if videoplayer_mediastate == MEDIASTATE_STOPPED and said_start_playback:
            if totalhelping == 0:
                topmsg = u'Please leave the ' + appname + ' running, this will help other ' + appname + ' users to download faster.'
            else:
                topmsg = u'Helping ' + str(totalhelping) + ' ' + appname + ' users to download. Please leave it running in the background.'
            msg = ''
        elif videoplayer_mediastate == MEDIASTATE_PLAYING:
            said_start_playback = True
            topmsg = ''
            decodeprogress += 1
            msg = ''
        elif videoplayer_mediastate == MEDIASTATE_PAUSED:
            msg = 'Buffering... ' + str(int(100.0 * preprogress)) + '%'
        else:
            msg = ''
    elif preprogress != 1.0:
        pstr = str(int(preprogress * 100))
        npeers = ds.get_num_peers()
        npeerstr = str(npeers)
        if npeers == 0 and logmsg is not None:
            msg = logmsg
        elif npeers == 1:
            msg = 'Prebuffering ' + pstr + '% done (connected to 1 stream)'
        else:
            msg = 'Prebuffering ' + pstr + '% done (connected to ' + npeerstr + ' streams)'
    else:
        minutes = int(t / 60)
        if minutes < 1:
            start_time = 'in less than one minute'
        elif minutes == 1:
            start_time = 'in one minute'
        elif minutes < 10:
            start_time = 'in ' + str(minutes) + ' minutes'
        else:
            if minutes < 20:
                precision = 2
            elif minutes < 40:
                precision = 5
            elif minutes < 60:
                precision = 10
            else:
                precision = 15
            minutes = precision * int(round(minutes / precision))
            if minutes > 120:
                start_time = 'soon'
            else:
                start_time = 'in ' + str(minutes) + ' minutes'
        msg = 'Playback will start ' + start_time
    return [topmsg,
     msg,
     said_start_playback,
     decodeprogress]

redpajama_set_name: RedPajamaGithub


text:
using System.Threading.Tasks;
using Sandbox.Server.DomainObjects.Interfaces.Handlers.Abstract;
using Sandbox.Server.DomainObjects.Models;

namespace Sandbox.Server.DomainObjects.Interfaces.Handlers
{
  public interface IArticleHandler: IEntityHandler<Article>
  {
        Task<Article> UpdateForSlug(string slug, Article entity);
  }
}


text:
using Google.Protobuf;
using SourceCode.Chasm.IO.Proto.Wire;
using SourceCode.Clay.Buffers;
using System;

namespace SourceCode.Chasm.IO.Proto
{
    partial class ProtoChasmSerializer // .Tree
    {
        #region Serialize

        public BufferSession Serialize(TreeNodeList model)
        {
            var wire = model.Convert();

            var size = wire.CalculateSize();
            var buffer = BufferSession.RentBuffer(size);

            using (var cos = new CodedOutputStream(buffer))
            {
                wire.WriteTo(cos);

                var segment = new ArraySegment<byte>(buffer, 0, (int)cos.Position);

                var session = new BufferSession(buffer, segment);
                return session;
            }
        }

        #endregion

        #region Deserialize

        public TreeNodeList DeserializeTree(ReadOnlySpan<byte> span)
        {
            if (span.IsEmpty) return default;

            var wire = new TreeWire();
            wire.MergeFrom(span.ToArray()); // TODO: Perf

            var model = wire.Convert();
            return model;
        }

        #endregion
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Uses of Class org.mortbay.jetty.plus.jaas.spi.UserInfo (Jetty Server Project 6.1.22 API)
</TITLE>

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../javadoc.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
org.mortbay.jetty.plus.jaas.spi.UserInfo

Packages that use UserInfo

org.mortbay.jetty.plus.jaas.ldap

org.mortbay.jetty.plus.jaas.spi

Uses of UserInfo in org.mortbay.jetty.plus.jaas.ldap

Methods in org.mortbay.jetty.plus.jaas.ldap that return UserInfo

 UserInfo
LdapLoginModule.getUserInfo(String username)

          get the available information about the user

 for this LoginModule, the credential can be null which will result in a
 binding ldap authentication scenario

 roles are also an optional concept if required

Uses of UserInfo in org.mortbay.jetty.plus.jaas.spi

Methods in org.mortbay.jetty.plus.jaas.spi that return UserInfo

 UserInfo
PropertyFileLoginModule.getUserInfo(String username)

          Don't implement this as we want to pre-fetch all of the
 users.

abstract  UserInfo
AbstractLoginModule.getUserInfo(String username)

 UserInfo
AbstractDatabaseLoginModule.getUserInfo(String userName)

          Load info from database

Methods in org.mortbay.jetty.plus.jaas.spi with parameters of type UserInfo

 void
AbstractLoginModule.JAASUserInfo.setUserInfo(UserInfo u)

Constructors in org.mortbay.jetty.plus.jaas.spi with parameters of type UserInfo

AbstractLoginModule.JAASUserInfo(UserInfo u)

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Copyright © 1995-2009 Mort Bay Consulting. All Rights Reserved.


text:
'use strict';

describe('Developer View', function () {
    var developerView;
    beforeEach(function() {
        // Set up model, initialise localStorage
        var developer = new PairGenerator.Models.Developer();
        developer.localStorage = new Store('DeveloperView-Tests');
        // Create View
        $('body').append('

');
        developerView = new PairGenerator.Views.DeveloperView({ model: developer });
    });

    afterEach(function() {
        developerView.remove();
        $('#container').remove();
    });

    it('should be rendered to the correct DOM element', function() {
        expect(developerView.tagName).to.be.equal('li');
        expect(developerView.el.tagName.toLowerCase()).to.be.equal('li');
    });

    it('is backed by the data provided in the model instance', function() {
        expect(developerView.model).to.exist;
        expect(developerView.model.get('paired')).to.be.false;
    });

    it('when rendered, the view is complete', function() {
        developerView.render();
        expect(developerView.$el).not.to.be.empty;
        expect(developerView.$el.find('label')).to.exist;
    });

    describe('Developer View Interactions', function() {
        beforeEach(function() {
            developerView.model.set({ name: 'Jack White' }, { silent: true });
            $('#container').append(developerView.render().el);
        });

        it('should enter editing mode', function() {
            $('#container').find('label').trigger('click');

            expect(developerView.$el.find('.edit').is(':visible')).to.be.true;
            expect(developerView.$el.find('.edit').val()).to.be.equal('Jack White');
        });

        it('should update on enter in editing mode', function() {
            $('#container').find('label').trigger('dblclick');

            var e = jQuery.Event('keypress');
            e.which = 13;
            developerView.$el.find('.edit').val('Jack White').trigger(e);

            expect(developerView.$el.find('label').text()).to.be.equal('Jack White');
            expect(developerView.model.get('name')).to.be.equal('Jack White');
        });

        it('should convert names to title case, ignoring names/acronyms in full capital case (eg."QA")', function() {
            $('#container').find('label').trigger('dblclick');
            var e = jQuery.Event('keypress');
            e.which = 13;
            developerView.$el.find('.edit').val('jAck White QA').trigger(e);
            expect(developerView.$el.find('label').text()).to.be.equal('Jack White QA');
            expect(developerView.model.get('name')).to.be.equal('Jack White QA');
        });

        it('should not accept if name is duplicate', function() {
            // Get Collection reference
            var developers = PairGenerator.developersList;
            // Set up second model
            var developerTwo = new PairGenerator.Models.Developer({ name: "Joe"});
            // Create View
            $('body').append('

');
            var developerTwoView = new PairGenerator.Views.DeveloperView({ model: developerTwo });
            // Add two models to the collection
            developers.add({name: "Jack"});
            developers.add({model: developerTwo});

            // Edit first developer model ('Joe') with the existing name
            $('#containertwo').find('label').trigger('dblclick');
            var e = jQuery.Event('keypress');
            e.which = 13;
            developerTwoView.$el.find('.edit').val('Jack').trigger(e);
            // Should have not changed
            expect(developerTwoView.model.get('name')).to.be.equal('Joe');
        });

        it('should remove item when enter empty in editing mode', function() {
            var spy = sinon.spy(developerView.model, 'destroy');
            $('#container').find('label').trigger('dblclick');

            var e = jQuery.Event('keypress');
            e.which = 13;
            developerView.$el.find('.edit').val('').trigger(e);

            expect($('#container').children()).to.have.length(0);

            sinon.assert.calledOnce(spy);
            developerView.model.destroy.restore();
        });

        it('should remove item when remove is clicked', function() {
            var spy = sinon.spy(developerView.model, 'destroy');

            $('#container').find('button').trigger('click');
            expect($('#container').children()).to.have.length(0);

            sinon.assert.calledOnce(spy);
            developerView.model.destroy.restore();
        });
    });
});


text:
//HintName: EnumExtensions.g.cs

namespace NetEscapades.EnumGenerators
{
    public static partial class ColourExtensions
    {
        public static string ToStringFast(this Colour value)
            => value switch
            {
                Colour.Red => nameof(Colour.Red),
                Colour.Blue => nameof(Colour.Blue),
                _ => value.ToString(),
            };
    }

    public static partial class DirectionExtensions
    {
        public static string ToStringFast(this Direction value)
            => value switch
            {
                Direction.Left => nameof(Direction.Left),
                Direction.Right => nameof(Direction.Right),
                Direction.Up => nameof(Direction.Up),
                Direction.Down => nameof(Direction.Down),
                _ => value.ToString(),
            };
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>TextParagraph (POI API Documentation)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

PREV CLASS

NEXT CLASS

FRAMES

NO FRAMES

All Classes

SUMMARY:

NESTED |

FIELD |

CONSTR |

METHOD

DETAIL:

FIELD |

CONSTR |

METHOD

org.apache.poi.sl.usermodel

Interface TextParagraph<S extends Shape<S,P>,P extends TextParagraph<S,P,T>,T extends TextRun>

All Superinterfaces:

java.lang.Iterable<T>

All Known Implementing Classes:

HSLFTextParagraph, XSLFTextParagraph

public interface TextParagraph<S extends Shape<S,P>,P extends TextParagraph<S,P,T>,T extends TextRun>
extends java.lang.Iterable<T>

Nested Class Summary

Nested Classes

Modifier and Type
Interface and Description

static interface
TextParagraph.BulletStyle

static class
TextParagraph.FontAlign

static class
TextParagraph.TextAlign

Specifies a list of text alignment types

Method Summary

Methods

Modifier and Type
Method and Description

TextParagraph.BulletStyle
getBulletStyle()

java.lang.String
getDefaultFontFamily()

java.lang.Double
getDefaultFontSize()

java.lang.Double
getDefaultTabSize()

TextParagraph.FontAlign
getFontAlign()

Returns the font alignment that is applied to the paragraph.

java.lang.Double
getIndent()

int
getIndentLevel()

java.lang.Double
getLeftMargin()

java.lang.Double
getLineSpacing()

Returns the vertical line spacing that is to be used within a paragraph.

TextShape<S,P>
getParentShape()

java.lang.Double
getRightMargin()

Specifies the right margin of the paragraph.

java.lang.Double
getSpaceAfter()

The amount of vertical white space after the paragraph
 This may be specified in two different ways, percentage spacing and font point spacing:

java.lang.Double
getSpaceBefore()

The amount of vertical white space before the paragraph
 This may be specified in two different ways, percentage spacing and font point spacing:

TextParagraph.TextAlign
getTextAlign()

Returns the alignment that is applied to the paragraph.

java.util.List<T>
getTextRuns()

Fetch the text runs that are contained within this block of text

boolean
isHeaderOrFooter()

Convenience method to determine if this text paragraph is part of
 the slide header or footer

void
setBulletStyle(java.lang.Object... styles)

Sets the bullet styles.

void
setIndent(java.lang.Double indent)

Specifies the indent size that will be applied to the first line of text in the paragraph.

void
setIndentLevel(int level)

Specifies the particular level text properties that this paragraph will follow.

void
setLeftMargin(java.lang.Double leftMargin)

Specifies the left margin of the paragraph.

void
setLineSpacing(java.lang.Double lineSpacing)

This element specifies the vertical line spacing that is to be used within a paragraph.

void
setRightMargin(java.lang.Double rightMargin)

void
setSpaceAfter(java.lang.Double spaceAfter)

Set the amount of vertical white space that will be present after the paragraph.

void
setSpaceBefore(java.lang.Double spaceBefore)

Set the amount of vertical white space that will be present before the paragraph.

void
setTextAlign(TextParagraph.TextAlign align)

Specifies the alignment that is to be applied to the paragraph.

Methods inherited from interface java.lang.Iterable

iterator

Method Detail

getSpaceBefore

java.lang.Double getSpaceBefore()

The amount of vertical white space before the paragraph
 This may be specified in two different ways, percentage spacing and font point spacing:

 If spaceBefore >= 0, then space is a percentage of normal line height.
 If spaceBefore < 0, the absolute value in points

Returns:

the vertical white space before the paragraph, or null if unset

setSpaceBefore

void setSpaceBefore(java.lang.Double spaceBefore)

Set the amount of vertical white space that will be present before the paragraph.
 This space is specified in either percentage or points:

 If spaceBefore >= 0, then space is a percentage of normal line height.
 If spaceBefore < 0, the absolute value of linespacing is the spacing in points

 Examples:

      // The paragraph will be formatted to have a spacing before the paragraph text.
      // The spacing will be 200% of the size of the largest text on each line
      paragraph.setSpaceBefore(200);

      // The spacing will be a size of 48 points
      paragraph.setSpaceBefore(-48.0);

Parameters:

spaceBefore - the vertical white space before the paragraph, null to unset

getSpaceAfter

java.lang.Double getSpaceAfter()

The amount of vertical white space after the paragraph
 This may be specified in two different ways, percentage spacing and font point spacing:

 If spaceBefore >= 0, then space is a percentage of normal line height.
 If spaceBefore < 0, the absolute value of linespacing is the spacing in points

Returns:

the vertical white space after the paragraph or null, if unset

setSpaceAfter

void setSpaceAfter(java.lang.Double spaceAfter)

Set the amount of vertical white space that will be present after the paragraph.
 This space is specified in either percentage or points:

 If spaceAfter >= 0, then space is a percentage of normal line height.
 If spaceAfter < 0, the absolute value of linespacing is the spacing in points

 Examples:

      // The paragraph will be formatted to have a spacing after the paragraph text.
      // The spacing will be 200% of the size of the largest text on each line
      paragraph.setSpaceAfter(200);

      // The spacing will be a size of 48 points
      paragraph.setSpaceAfter(-48.0);

Parameters:

spaceAfter - the vertical white space after the paragraph, null to unset

getLeftMargin

java.lang.Double getLeftMargin()

Returns:

the left margin (in points) of the paragraph or null, if unset

setLeftMargin

void setLeftMargin(java.lang.Double leftMargin)

Specifies the left margin of the paragraph. This is specified in addition to the text body
 inset and applies only to this text paragraph. That is the text body Inset and the LeftMargin
 attributes are additive with respect to the text position.

Parameters:

leftMargin - the left margin (in points) or null to unset

getRightMargin

java.lang.Double getRightMargin()

Specifies the right margin of the paragraph. This is specified in addition to the text body
 inset and applies only to this text paragraph. That is the text body Inset and the RightMargin
 attributes are additive with respect to the text position.

 The right margin is not support and therefore ignored by the HSLF implementation.

Returns:

the right margin (in points) of the paragraph or null, if unset

setRightMargin

void setRightMargin(java.lang.Double rightMargin)

Parameters:

rightMargin - the right margin (in points) of the paragraph

getIndent

java.lang.Double getIndent()

Returns:

the indent (in points) applied to the first line of text in the paragraph.
  or null, if unset

setIndent

void setIndent(java.lang.Double indent)

Specifies the indent size that will be applied to the first line of text in the paragraph.

Parameters:

indent - the indent (in points) applied to the first line of text in the paragraph

getIndentLevel

int getIndentLevel()

Returns:

the text level of this paragraph (0-based). Default is 0.

setIndentLevel

void setIndentLevel(int level)

Specifies the particular level text properties that this paragraph will follow.
 The value for this attribute formats the text according to the corresponding level
 paragraph properties defined in the SlideMaster.

Parameters:

level - the level (0 ... 4)

getLineSpacing

java.lang.Double getLineSpacing()

Returns the vertical line spacing that is to be used within a paragraph.
 This may be specified in two different ways, percentage spacing and font point spacing:

 If linespacing >= 0, then linespacing is a percentage of normal line height.
 If linespacing < 0, the absolute value of linespacing is the spacing in points

Returns:

the vertical line spacing or null, if unset

setLineSpacing

void setLineSpacing(java.lang.Double lineSpacing)

This element specifies the vertical line spacing that is to be used within a paragraph.
 This may be specified in two different ways, percentage spacing and font point spacing:

 If linespacing >= 0, then linespacing is a percentage of normal line height
 If linespacing < 0, the absolute value of linespacing is the spacing in points

 Examples:

      // spacing will be 120% of the size of the largest text on each line
      paragraph.setLineSpacing(120);

      // spacing will be 200% of the size of the largest text on each line
      paragraph.setLineSpacing(200);

      // spacing will be 48 points
      paragraph.setLineSpacing(-48.0);

Parameters:

lineSpacing - the vertical line spacing

getDefaultFontFamily

java.lang.String getDefaultFontFamily()

getDefaultFontSize

java.lang.Double getDefaultFontSize()

Returns:

the default font size, in case its not set in the textrun or null, if unset

getTextAlign

TextParagraph.TextAlign getTextAlign()

Returns the alignment that is applied to the paragraph.

 If this attribute is omitted, then null is returned.
 User code can imply the value TextParagraph.TextAlign.LEFT then.

Returns:

alignment that is applied to the paragraph

setTextAlign

void setTextAlign(TextParagraph.TextAlign align)

Specifies the alignment that is to be applied to the paragraph.
 Possible values for this include left, right, centered, justified and distributed,
 see TextParagraph.TextAlign.

Parameters:

align - text align

getFontAlign

TextParagraph.FontAlign getFontAlign()

Returns the font alignment that is applied to the paragraph.

 If this attribute is omitted, then null is return,
 user code can imply the a value of TextParagraph.FontAlign.AUTO

Returns:

alignment that is applied to the paragraph

getBulletStyle

TextParagraph.BulletStyle getBulletStyle()

Returns:

the bullet style of the paragraph, if null then no bullets are used

setBulletStyle

void setBulletStyle(java.lang.Object... styles)

Sets the bullet styles. If no styles are given, the bullets are omitted.
 Possible attributes are integer/double (bullet size), Color (bullet color),
 character (bullet character), string (bullet font), AutoNumberingScheme

Parameters:

styles -

getDefaultTabSize

java.lang.Double getDefaultTabSize()

Returns:

the default size for a tab character within this paragraph in points, null if unset

getParentShape

TextShape<S,P> getParentShape()

getTextRuns

java.util.List<T> getTextRuns()

Fetch the text runs that are contained within this block of text

isHeaderOrFooter

boolean isHeaderOrFooter()

Convenience method to determine if this text paragraph is part of
 the slide header or footer

Returns:

true if this paragraph is part of a header or footer placeholder

Since:

POI 3.15-beta2

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

PREV CLASS

NEXT CLASS

FRAMES

NO FRAMES

All Classes

SUMMARY:

NESTED |

FIELD |

CONSTR |

METHOD

DETAIL:

FIELD |

CONSTR |

METHOD

                Copyright 2016 The Apache Software Foundation or
        its licensors, as applicable.


text:
package ua.annalonskaya.addressbook.tests;

import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import ua.annalonskaya.addressbook.model.ContactData;
import ua.annalonskaya.addressbook.model.Contacts;
import ua.annalonskaya.addressbook.model.GroupData;
import ua.annalonskaya.addressbook.model.Groups;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;

public class ContactModificationTests extends TestBase {

  @BeforeMethod
  public void ensurePreconditions() {
    if (app.db().groups().size() == 0) {
      app.goTo().groupPage();
      app.group().create(new GroupData().withName("test1"));
    }
    if (app.db().contacts().size() == 0) {
      Groups groups = app.db().groups();
      app.goTo().gotoHomePage();
      app.contact().create(new ContactData().withLname("Sunny").withFname("Irina").withCompany("Incom")
              .withAddress("Street").withEmail("1@mail.ru").withHomePhone("123456789")
              .withDay(6).withMonth("May").withYear("2000").inGroup(groups.iterator().next()));
    }
  }

  @Test
  public void testContactModification() {
    Contacts before = app.db().contacts();
    ContactData modifiedContact = before.iterator().next();
    ContactData contact = new ContactData()
            .withId(modifiedContact.getId()).withLname("Groovy").withFname("Irina").withCompany("Incom")
            .withAddress("Street").withEmail("1@mail.ru").withHomePhone("123456789")
            .withDay(30).withMonth("May").withYear("1966");
    app.contact().modify(contact);
    assertThat(app.contact().count(),equalTo(before.size()));
    Contacts after = app.db().contacts();
    assertThat(after, equalTo(before.without(modifiedContact).withAdded(contact)));
    verifyContactListInUI();
  }

}


text:
id: version-5.3.0-hemera-vs-seneca
title: Hemera Vs Seneca
sidebar_label: Hemera Vs Seneca
original_id: hemera-vs-seneca
---

| Seneca                          | Supported                                                                              |
| ------------------------------- | -------------------------------------------------------------------------------------- |
| Async / Await                   | No                                                                                |
| Promises                        | No                                                                                |
| Payload agnostic                | No                                                                                |
| Load balancing                  | No                                                                                |
| Service Discovery               | No                                                                                |
| Slow consumer detection         | No                                                                                |
| Interoperability                | Only available for NodeJs.                                                             |
| Publish & Subscribe             | No                                                                                |
| Consistent Error-first-callback | No                                                                                |
| Clean error propagation         | In progress since 1 year [Github Issue](https://github.com/senecajs/seneca/issues/398) |
| Clean logging interface         | Open issues [Github Issue](https://github.com/senecajs/seneca/issues/565)              |
| Maintainability                 | There is no documentation about the internal concepts of seneca.                       |


text:
require "Physics3D/CollisionScene"
require "Physics3D/CollisionSceneEntity"
require "Physics3D/PhysicsScene"
require "Physics3D/PhysicsSceneEntity"
require "Physics3D/PhysicsCharacter"
require "Physics3D/PhysicsVehicle"


text:
===========================
libnacl 1.6.1 Release Notes
===========================

Add support for libsodium 1.0.15
================================

Make sure that libnacl runs correctly on the 1.0.15 release of libsodium


text:
This tool requires a test configuration that declares a set of source files which
should be checked for cyclic dependencies. e.g.

```
yarn ts-circular-deps --config ./test-config.js <check|approve>
```

### Limitations

In order to detect cycles, the tool currently visits each source file and runs
depth first search. If the DFS comes across any node that is part of the current
DFS path, then a cycle has been detected and the tool will capture it.

This algorithm has limitations. For example, consider the following graph:

![Example graph](./example-graph.png)

Depending on which source file is considered first, the output of the circular dependency tool
will be different. This is because the tool does not recursively find _all_ possible cycles. This
would be too inefficient for large graphs (especially in the `angular/angular` repository).

In this concrete example, the tool will visit `r3_test_bed` first. Then the first neighbour
(based on the import in the source file) will be visited. This is `test_bed`. Once done, the
tool will visit the first neighbour of `test_bed`. This is `r3_test_bed` again. The node has
already been visited, and also is part of the current DFS path. The tool captures this as cycle.

As no more nodes can be visited within that path, the tool continues (as per DFS algorithm)
with visiting the remaining neighbours of `r3_test_bed`. It will visit `test_bed_common` and
then come across `test_bed`. The tool only knows that `test_bed` has already been visited, but
it does not know that it would close a cycle. The tool certainly could know this by recursively
checking neighbours of `test_bed` again, but this is inefficient and will cause the algorithm
to eventually degenerate into brute-force.

In summary, the tool is unable to capture _all_ elementary cycles in the graph. This does not
mean though that the tool is incorrectly suggesting that there are _no_ cycles in a graph. The
tool is still able to correctly detect whether there are _any_ cycles in a graph or not. For
example, if edge from `r3_test_bed` to `test_bed` is removed, then the tool will be able to
capture at least one of the other cycles. The golden will change in an unexpected way, but it's
**expected** given the trade-off we take for an acceptable running time.

Other algorithms exist which are proven to print out _all_ the elementary cycles in a directed
graph. For example:

* [Johnson's algorithm for finding simple cycles][johnson-cycles].
* [Tarjan's algorithm for enumerating elementary circuits][tarjan-cycles].

Experiments with these algorithms unveiled that usual source file graphs we have in Angular
repositories are too large to be processed in acceptable time. At the time of writing, the
source file graph of `angular/angular` consists of 3350 nodes and 8730 edges.

Algorithms like the one from Donald B. Johnson, which first split the graph into strongly
connected components, and then search for elementary cycles in all components with at least
two vertices, are too inefficient for the source files graphs we have. Time complexity for
such algorithms is described to be `O((n + e)(c + 1))` where `c` is the number of elementary
circuits. Donald B. Johnson describes the number of elementary circuits the followed:

> Thus the number of elementary circuits in a directed graph can grow faster with n than
the exponential 2"

This shows quite well that these algorithms become quickly inefficient the more vertices, edges
and simple cycles a graph has. Finding elementary cycles of arbitrary length seems NP-complete as
finding a Hamiltonian cycle with length of `n` is NP-complete too. Below is a quote from a
[paper describing a randomized algorithm](np-complete-cycles) for finding simple cycles of a
_fixed_ length that seems to confirm this hypothesis:

> It is well known that finding the longest cycle in a graph is a hard problem, since finding
a hamiltonian cycle is NP-complete. Hence finding a simple cycle of length k, for an arbitrary
k, is NP-complete.

Other tools like `madge` or `dpdm` have the same limitations.

**Resources**:

* [Finding all the elementary circuits of a directed graph - Donald. B. Johnson][johnson-cycles]
* [Enumeration of the elementary circuits of a directed graph - Robert Tarjan][tarjan-cycles]
* [Once again: Finding simple cycles in graphs - Carsten Dorgerlohx; Jürgen Wirtgen][np-complete-cycles]

[johnson-cycles]: https://www.cs.tufts.edu/comp/150GA/homeworks/hw1/Johnson%2075.PDF
[tarjan-cycles]: https://ecommons.cornell.edu/bitstream/handle/1813/5941/72-145.pdf?sequence=1&isAllowed=y
[np-complete-cycles]: https://pdfs.semanticscholar.org/16b2/d1a3cf4a8a5dbcad10bb901724631ebead33.pdf


text:
package com.gmail.hexragon.gn4rBot.command.fun;

import com.gmail.hexragon.gn4rBot.managers.commands.CommandExecutor;
import com.gmail.hexragon.gn4rBot.managers.commands.annotations.Command;
import com.gmail.hexragon.gn4rBot.util.DiscordBotsUserInfo;
import com.gmail.hexragon.gn4rBot.util.GnarMessage;

@Command(
        aliases = {"dui", "bi", "discordbots", "discordpw"},
        usage = "(string)",
        description = "Get Discord user information"
)
public class DiscordBotsUserInfoCommand extends CommandExecutor
{

    @Override
    public void execute(GnarMessage message, String[] args)
    {
        if (args.length > 0)
        {
            if (message.getMentionedUsers().size() == 0)
            {
                String data = DiscordBotsUserInfo.getUserInfo(args[0]);
                message.reply(data);
            }
            else
            {
                String data = DiscordBotsUserInfo.getUserInfo(message.getMentionedUsers().get(0).getId());
                message.reply(data);

            }
        }
        else
        {
            message.reply("You must supply a bot ID or mention.");
        }
    }
}


text:
title: Wintersmith tutorial
author: Mati Pruvost
date: 2015-10-19
template: article.jade
comments: true
cc: false
---

Guía completa para generar un blog utilizando [Wintersmith](http://wintersmith.io/) y [GitHub Pages](https://pages.github.com/).

![Coding](coding.png)

# GitHub Pages

Con GitHub pages es posible crear un website personal rápidamente.
Se necesita:

- Crear una cuenta en GitHub.
- Crear el repositorio para tu website.
- Instalar Git.

Git es un controlador de versiones, por lo tanto, registra los cambios realizados sobre un archivo a lo largo del tiempo. Es un sistema muy utilizado en el desarrollo de software.

GitHub es una plataforma de desarrollo para alojar proyectos utilizando Git.

GitHub Pages es un servicio de GitHub para alojar páginas de una manera muy sencilla.

Entonces, se utiliza GitHub Pages para poder visualizar el website en la web, GitHub para poder alojar el website y Git para poder realizar todos los cambios posibles en el proyecto.

## Nueva cuenta en GitHub

Para crear una nueva cuenta en GitHub tenés que dirigirte a este [link](https://github.com/join). Hay dos tipos de cuentas:

- *Free*: Cantidad de proyectos públicos y colaboradores ilimitados.
- *Enterprise*: Crear proyectos privados.

Esta cuenta te servirá para alojar tu proyecto en un repositorio Git y para acceder al servicio de GitHub Pages.

## Crear el repositorio para tu website

Para crear el repositorio de tu website debes hacer el paso 1 de la guía de este [link](https://pages.github.com/). Los demás pasos los veremos más adelante. Si necesitas una mejor explicación del paso 1, este [link](https://help.github.com/articles/create-a-repo/) prevé una guía de 6 pasos más completa.

Lo importante es que tu repositorio sea nombrado de esta forma *username*.github.io, donde *username* es el nombre de usuario en GitHub.

## Instalar Git

Para instalar git tenés que dirigirte a este [link](https://git-scm.com/downloads). Deberás elegir entre los diferentes OS disponibles:

- [Linux](https://git-scm.com/download/linux)
- [Solaris](https://git-scm.com/download/linux)
- [MAC OS X](https://git-scm.com/download/mac)
- [Windows](https://git-scm.com/download/win)

En los links anteriores se encuentra la guía necesaria del proceso de instalación de cada OS.

# Wintersmith

Wintersmith es un generador de sitios estáticos muy flexible. Para instalarlo es necesario:

- Instalar Node.js
- Instalar npm
- Instalar Wintersmith

Node.js es una plataforma para desarrollar software, Wintersmith está desarrollado en Node.js y podemos descargar e instalar el proyecto utilizando el gestor de paquetes npm.

## Instalar Node.js y npm

Node.js es un runtime environment en Javascript, multiplataforma y basado en motor V8 de Chrome. Npm es el gestor de paquetes de Node.js.

Para instalar Node.js tenés que dirigirte a este [link](https://nodejs.org/en/download/)

## Instalar Wintersmith

Para instalar Wintersmith es necesario abrir la consola o terminal y ejecutar:

```bash
$ npm install wintersmith -g
```

El comando anterior es muy simple *npm* indica que se va a utilizar npm, *install* indica que se va a instalar un paquete, *wintersmith* indica el nombre del paquete que se va a instalar usando npm y la opción *-g* indica que el paquete será instalado en un contexto global y podrá ser accedido desde cualquier directorio.

# Crear el website

Para crear nuestro proyecto es necesario ejecutar:

```bash
$ wintersmith new <path>
```

Donde *wintersmith* indica que se utilizará ese comando, *new* indica que será un nuevo proyecto y *path* es la ruta al directorio donde el proyecto va a ser generado.

Para probar tu proyecto debes ejecutar los siguientes comandos:

```bash
$ cd <path>
```

Donde *path* es la ruta a tu proyecto. Luego debes ejecutar el siguiente comando para construir el website:

```bash
$ wintersmith build
```

Con el siguiente comando vas a levantar tu website en un servidor local en tu PC:

```bash
$ wintersmith preview
```

Ahora debes abrir el browser que tengas instalado en tu PC y escribir la siguiente url [http://localhost:8080/](http://localhost:8080/).

Lo que vas a observar es un website de ejemplo con algunos artículos ya creados y definidos.

# Estructura del proyecto

En el directorio `build/` se encuentra el website generado y en `contents/articles/` se alojan los artículos que vayas a escribir en tu website.

# Crear un artículo

Debes crear un directorio dentro del directorio `contents/articles/` con el nombre de tu artículo sin espacios por ejemplo `my-first-post/`, por lo tanto vas a obtener la siguiente estructura `contents/my-first-post/`.

Dentro del directorio `contents/my-first-post/` debes crear un archivo llamado `index.md`. En este archivo se escribirá el contenido de tu artículo.

Lo primero que debes escribir en el archivo `index.md` es lo siguiente:

```markdown
 ---
 title: My first post
 date: 2015-10-08 12:10
 author: Román Riquelme
 template: article.jade
 ---
```

*title* es el título de tu artículo, en este caso *My first post*. *title* es la fecha de publicación de tu artículo, en este caso *2015-10-08 12:10*, *author* es el autor del artículo, en este caso *Román Riquelme* y *template* es la plantilla que se ve a utilizar, en este caso *article.jade*.

A partir de aquí deberás crear el contenido de tu artículo, podrás insertar imágenes, links, crear tablas, listas, utilizar jerarquías de títulos, etc. Para esto Wintersmith utiliza Markdown que es una forma simple de escribir código HTML para web. Para obtener una guía básica de como escribir Markdown tenés que dirigirte a este [link](https://help.github.com/articles/markdown-basics/).

# Publicar el website en GitHub Pages

En primer lugar deberás abrir tu consola o terminal y dirigirte al directorio `build/` de tu proyecto:

```bash
$ cd <path-to-project>/build
```

Luego es necesario inicializar un repositorio git dentro del directorio, debes ejecutar:

```bash
$ git init
```

A continuación debes agregar el repositorio remoto que fue creado en GitHub, debes ejecutar:

```bash
$ git remote add origin git@github.com:username/username.github.io.git
```

*username* es el nombre de usuario de la cuenta de github.

En este momento ya tenemos conectados el repositorio local con el repositorio alojado en GitHub. Por lo tanto, los dos comandos anteriores solo son necesarios de ejecutar la primera vez.

El siguiente paso es agregar nuestros archivos al staging area de Git. Ejecutar:

```bash
$ git add --all
```

A continuación se deberán agregar los archivos que están en staging area al project history. Ejecutar:

```bash
$ git commit -m "Comment about changes"
```

Debes incluir un comentario que indique que cambios vas a introducir al historial de git. El comentario es personal y es importante que sea preciso, de esta amanera nos ayuda a saber que es lo que hicimos.

Por último debes publicar los cambios en el repositorio remoto en GitHub. Debes ejecutar:

```bash
$ git push
```

Ahora tus cambios están en el repositorio remoto y el website ya está disponible para ser accedido en la web mediante la url de tu website, por ejemplo [http://username.github.io/](http://username.github.io/).

# Lista de pasos del tutorial

A continuación se encuentra la lista de tareas y procedimientos que debes seguir para tener disponible tu website en internet.

		<input type="checkbox">
		Crear una cuenta en GitHub

		<input type="checkbox">
		Crear un repositorio en GitHub llamado *username*.github.io

		<input type="checkbox">
		Instalar Git en tu PC

		<input type="checkbox">
		Instalar Node.js y npm en tu PC

		<input type="checkbox">
		Instalar Wintersmith en tu PC

		<input type="checkbox">
		Crear tu proyecto utilizando Wintersmith

		<input type="checkbox">
		Crear un artículo dentro del proyecto

		<input type="checkbox">
		Crear un repositorio Git dentro del directorio `build/`

		<input type="checkbox">
		Agregar el repositorio creado en GitHub al repositorio Git creado en tu PC

		<input type="checkbox">
		Hacer un commit de los cambios

		<input type="checkbox">
		Publicar los cambios en el repositorio de GitHub

		<input type="checkbox">
		Acceder al website mediante la URL del proyecto


text:
.aimDefault .imWidget {
	height: 100%;
	width: 100%;
}

.aimDefault .imWidget .conversation {
	height: 150px;
	background-color: #fff;
	overflow: auto;
	margin-left: 7px;
	padding-top: 5px;
}

.aimDefault .imWidget .imBlock {
	padding-bottom: 3px;
	display: block;
}

.aimDefault .imWidget .systemIm {
	color: gray;
	font-size: 11px;
	display: block;
	text-align: center;
}

.aimDefault .imWidget .localMessage {
	color: #000;
	font-weight: bold;
	display: block;
	text-align: center;
}

.aimDefault .imWidget .localMessage .aimLink {
	font-weight: normal;
}

.aimDefault .imWidget .userImName {
	font-weight: bold;
	color: red;
}

.aimDefault .imWidget .buddyImName {
	font-weight: bold;
	color: blue;
}

.aimDefault .imWidget .imTimeStamp {
	font-weight: normal;
    font-size: 10px;
}

.aimDefault .imWidget .userIm div {
	display: inline;
}

.aimDefault .imWidget .screenNameContainer {
	padding: 5px;
	white-space: nowrap;
}
.aimDefault .imWidget .aimInput {
	border: 1px solid #95c2ec;
	padding: 0;
	margin: 0;
}

.aimDefault .imWidget .inputContainer {
	border: 1px solid #95c2ec;
	margin: 0 6px;
	padding: 0px;
	overflow: hidden;
}

.dj_gecko .aimDefault .imWidget .inputContainer,
.dj_gecko .aimDefault .imWidget .phonePane,
.dj_gecko .aimDefault .imWidget .screenNameContainer {
	overflow: auto; /* Fixes the missing-cursor bug in Firefox.  Don't want this to apply to IE6 because it adds scrollbars. */
}

.aimDefault .imWidget textarea.aimInput {
	border: none;
	margin: 0;
	width: 100%;
	height: 50px;
	overflow: auto;
}

.aimDefault .imWidget .typing {
	color: gray;
	font-weight: normal;
	text-align: center;
    height: 14px;
    font-size: 10px;
}

.aimDefault .imWidget .buttonPane {
	margin-right: 20px;
	margin-left: 6px;
}

.aimDefault .imWidget .sendButton {
	margin: 4px auto 4px;
	float: right;
}

.aimDefault .imWidget .saveButton {
	font-size: 10px;
	font-family: Verdana;
	margin-left: 6px;
	margin-bottom: 4px;
	float: left;
	height: 20px;
}

body.aimDefault .imWidget .saveButton .content {
	height: 20px;
	border: 1px solid #fff;
	padding: 3px 6px 0;
	margin-top: 2px;
	overflow: hidden;
}

body.aimDefault .imWidget .saveButtonHover .content,
body.aimDefault .imWidget .saveButton:hover .content {
	border: 1px solid gray;
}
body.aimDefault .saveButton .arrow {
	padding-left: 3px;
	border-left: 1px solid #fff;
}
body.aimDefault .imWidget .saveButtonHover .arrow,
body.aimDefault .imWidget .saveButton:hover .arrow {
	border-left: 1px solid gray;
}
body.aimDefault .saveButton .aimArrow {
	margin: 8px 0;
}

.aimDefault .imWidget .mailLink,
.aimDefault .imWidget .imLink,
.aimDefault .imWidget .mobileLink {
	margin-top: 4px;
}

.aimDefault .imWidget .imLinkModeSelect {
	background-position: -670px -77px;
}
.aimDefault .imWidget .mobileLinkModeSelect {
	background-position: -693px -77px;
}

.aimDefault .imWidget .phonePane {
	background-color: #c5e2ff;
	height: 18px;
	border: 1px solid #95c2ec;
	border-bottom: none;
	margin: 0 6px 0 6px;
}

.aimDefault .imWidget .phoneIcon {
	position: absolute;
	width: 7px;
	height: 11px;
	background: url("images/main.gif") -800px -61px;
	left: 6px;
	top: 3px;
}

.aimDefault .imWidget .phonePane .aimInput {
	right: 0;
	position: absolute;
	left: 18px;
	background-color: #c5e2ff;
	border: none;
}

.aimDefault .imWidget .blockMsg {
	background-color: #e0e0e0;
	color: black;
}

.aimDefault .imWidget .blockMsgText {
	height: 20px;
	font-weight: bold;
	padding-top: 8px;
}

.aimDefault .imWidget .blockMsgUser {
	font-weight: bold;
	font-size: 14px;
	margin-bottom: 10px;
}

.aimDefault .imWidget .blockMsgLink {
	font-size: 12px;
}


text:
<?php

namespace AppBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Session\Session;

class BaseController extends Controller
{
    protected function shouldBeAuthorized()
    {
        if (!$this->get('security_service')->isAuthorized($this)) {
            return $this->redirectToRoute('authorization');
        }
    }

    protected function updateUserActivity()
    {
        $session = new Session();
        if (!$session->get('userInfo')) {
            return;
        }

        $activityId = $session->get('userInfo')['activityId'];

        $activity = $this->getDoctrine()
            ->getRepository('AppBundle\Entity\Activity')
            ->find($activityId);

        $em = $this->getDoctrine()->getManager();
        $activity->setTimestamp(time());
        $em->persist($activity);
        $em->flush();
    }
}


text:
package org.cyclops.integrateddynamics.part.aspect.read.world;

import org.cyclops.integrateddynamics.api.part.PartTarget;
import org.cyclops.integrateddynamics.api.part.aspect.property.IAspectProperties;
import org.cyclops.integrateddynamics.core.evaluate.variable.ValueTypeInteger;

/**
 * Aspect that displays the world dimension id.
 * @author rubensworks
 */
public class AspectReadIntegerWorldDimension extends AspectReadIntegerWorldBase {

    @Override
    protected String getUnlocalizedIntegerWorldType() {
        return "dimension";
    }

    @SuppressWarnings("unchecked")
    @Override
    protected ValueTypeInteger.ValueInteger getValue(PartTarget target, IAspectProperties properties) {
        return ValueTypeInteger.ValueInteger.of(target.getTarget().getPos().getWorld().provider.getDimensionId());
    }
}


text:
#ifndef KERNEL_ANNOTABLE_HH
#define KERNEL_ANNOTABLE_HH

#include <string>
#include <vector>

#include <kernel/Annotation.hh>
#include <utils/unordered11.hh>

/* ***************************************************/
/**
 * \brief  Interface for annotable objects
 */
/* ***************************************************/
class Annotable
{
public:
  typedef std::string AnnotationId;
  typedef std::unordered_map<AnnotationId,Annotation*> AnnotationMap;

  Annotable(const AnnotationMap *o = 0);
  Annotable(AnnotationMap &o);

  /*! \brief Copy constructor */
  Annotable(const Annotable &o);
  /*! \brief Destructor */
  virtual ~Annotable();

  /*! \brief get annotations. Renamed this method in order to
   * lower the number of name conflicts on methods such as begin().
   * That's why the inheritance on std::unordered_map is private */
  const AnnotationMap *get_annotations() const;
  /*! \brief get a specific annotation. */
  Annotation *get_annotation(const AnnotationId &id) const;
  /*! \brief get a specific annotation. */
  Annotation *get_annotation(const char *id) const;
  /*! \brief get a vector of sorted annotation ids to help determinism */
  std::vector<AnnotationId> *get_sorted_annotation_ids() const;

  /*! \brief add an annotation. Cf. previous remark */
  void add_annotation(const AnnotationId &id, Annotation *a);
  /*! \brief add an annotation. Cf. previous remark */
  void add_annotation(const char id[], Annotation *a);
  /*! \brief returns true if contains at least one annotation */
  bool is_annotated() const;
  /*! \brief returns true if contains an annotation of id \code id */
  bool has_annotation(const AnnotationId &id) const;

  /*! \brief returns true if contains an annotation of id \code id */
  bool has_annotation(const char *id) const;

  /*! \brief delete an annotation of id \code id */
  void del_annotation(const char *id);
  /*! \brief delete an annotation of id \code id  */
  void del_annotation(const AnnotationId &id);

  void output_annotations (std::ostream &) const;

private:
  void copy_from_map(const AnnotationMap &o);

  AnnotationMap amap;
};

#endif /* KERNEL_ANNOTABLE_HH */


text:
<?xml version='1.0' encoding='utf-8'?>
<Jobs>
  <ApplicationJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Guid="fe0a1f9a-c51e-47cf-b848-97426d61d003">
    <WebsiteUrl />
    <UserAgent />
    <UserNotes />
    <LastFileSize>98093120</LastFileSize>
    <LastFileDate>2015-02-13T11:46:54.4323407</LastFileDate>
    <IgnoreFileInformation>false</IgnoreFileInformation>
    <DownloadBeta>Avoid</DownloadBeta>
    <DownloadDate xsi:nil="true" />
    <CheckForUpdatesOnly>false</CheckForUpdatesOnly>
    <VariableChangeIndicator />
    <CanBeShared>true</CanBeShared>
    <ShareApplication>false</ShareApplication>
    <ExclusiveDownload>false</ExclusiveDownload>
    <HttpReferer />
    <SetupInstructions />
    <Variables>
      <item>
        <key>
          <string>url</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>Textual</VariableType>
            <Regex />
            <TextualContent>{getUrl}</TextualContent>
            <Name>url</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>version</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>RegularExpression</VariableType>
            <Regex>arduino-([\d\.]+)-windows\.exe</Regex>
            <Url>http://arduino.cc/en/Main/Software</Url>
            <TextualContent />
            <Name>version</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>getUrl</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>RegularExpression</VariableType>
            <Regex>([^ "'<>\*]+\.exe)</Regex>
            <Url>http://arduino.cc/en/Main/Software</Url>
            <Name>getUrl</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>nopush</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>Textual</VariableType>
            <Regex />
            <TextualContent>--nopush</TextualContent>
            <Name>nopush</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>cscript</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>Textual</VariableType>
            <Regex />
            <TextualContent>2</TextualContent>
            <Name>cscript</Name>
          </UrlVariable>
        </value>
      </item>
    </Variables>
    <ExecuteCommand />
    <ExecutePreCommand />
    <ExecuteCommandType>Batch</ExecuteCommandType>
    <ExecutePreCommandType>Batch</ExecutePreCommandType>
    <Category />
    <SourceType>FixedUrl</SourceType>
    <PreviousLocation>C:\ProgramData\chocolatey\_work\arduino-1.6.0-windows.exe</PreviousLocation>
    <DeletePreviousFile>true</DeletePreviousFile>
    <Enabled>true</Enabled>
    <FileHippoId />
    <LastUpdated>2015-02-13T11:46:54.4323407</LastUpdated>
    <TargetPath>{workdir}\</TargetPath>
    <FixedDownloadUrl>{url}</FixedDownloadUrl>
    <Name>arduinoide</Name>
  </ApplicationJob>
</Jobs>


text:
package org.apache.geronimo.common.propertyeditor;

/**
 *
 *
 * @version $Rev$ $Date$
 *
 * */
public class ShortEditor extends TextPropertyEditorSupport {
    public Object getValue()
    {
        try {
            String text = getAsText();
            return Short.valueOf(text);
        }
        catch (Exception e) {
            throw new PropertyEditorException(e.getMessage(), e);
        }
    }
}


text:
export DURATION=${PERF_DURATION:-150}
export TARGET_URL=${PERF_TARGET_URL:-/solr/collection1}
export COLLECTION=${PERF_COLLECTION:-collection1}
export SERVER=${PERF_SERVER:-localhost}
export PORT=${PERF_PORT:-9983}


text:
/*
/*
  Created by: Stuart Mead
  Creation date: $Date$

  Released under BSD 3 clause.
  Use it however you want, but I cannot guarantee it is right.
  Also don't use my name, the name of collaborators and my/their affiliations
  as endorsement.

*/

#include <cassert>
#include <iostream>

#include <qstring.h>

#include "Workspace/DataExecution/DataObjects/typedobject.h"
#include "Workspace/DataExecution/InputOutput/inputarray.h"
#include "Workspace/DataExecution/InputOutput/simpleoperationio.h"
#include "Workspace/DataExecution/Operations/typedoperationfactory.h"

#include "volcanoplugin.h"
#include "volcanoutils.h"

#include "volcanoplugin.h"
#include "fuzzylocation.h"

//Include opencv processes
#include "opencv2/imgproc/imgproc.hpp"

namespace RF
{
    /**
     * \internal
     */
    class FuzzyLocationImpl
    {
        // Allow string translation to work properly
        Q_DECLARE_TR_FUNCTIONS(RF::FuzzyLocationImpl)

    public:
        FuzzyLocation&  op_;

        // Data objects

        // Inputs and outputs
        CSIRO::DataExecution::SimpleInput< GDALDatasetH > categoricalMap_;
		CSIRO::DataExecution::SimpleInput< bool > threshold_;
		CSIRO::DataExecution::SimpleInput< double > thresholdVal_;
		CSIRO::DataExecution::SimpleInput< int > kernelSize_;
        CSIRO::DataExecution::TypedObject< RF::FuzzyMembershipType > memberType_;
        CSIRO::DataExecution::SimpleInput< QString > outputName_;
        CSIRO::DataExecution::SimpleOutput< GDALDatasetH > outputDataset_;

		CSIRO::DataExecution::InputScalar inputMemberType_;

        FuzzyLocationImpl(FuzzyLocation& op);

        bool  execute();
        void  logText(const QString& msg)   { op_.logText(msg); }
    };

    /**
     *
     */
    FuzzyLocationImpl::FuzzyLocationImpl(FuzzyLocation& op) :
        op_(op),
        categoricalMap_("Categorical map",  op_),
		threshold_("Threshold data", op_),
		thresholdVal_("Threshold value", op_),
		kernelSize_("Kernel size", op_),
        memberType_(RF::FuzzyMembershipType::GAUSSIAN),
        outputName_("Output dataset name",  op_),
        outputDataset_("Output dataset",  op_),
		inputMemberType_("Membership weighting", memberType_, op_)
    {
        // Make sure all of our inputs have data by default. If your operation accepts a
        // large data structure as input, you may wish to remove this call and replace it
        // with constructors for each input in the initialisation list above.
        op_.ensureHasData();
		threshold_.input_.setDescription(tr("Create a boolean threshold for everything above the given value."));
        // Recommend setting a description of the operation and each input / output here:
        // op_.setDescription(tr("My operation does this, that and this other thing."));
        // input1_.input_.setDescription(tr("Used for such and such."));
        // output1_.output_.setDescription(tr("Results of the blah-di-blah."));
    }

    /**
     *
     */
    bool FuzzyLocationImpl::execute()
    {
        const GDALDatasetH&     categoricalMap = *categoricalMap_;
        const RF::FuzzyMembershipType& memberType     = *memberType_;
        const QString&          outputName     = *outputName_;
		const int& kernelSize = *kernelSize_;
        GDALDatasetH&     outputDataset  = *outputDataset_;

		//Check kernel size is odd
		if (!(kernelSize & 1)) {
			std::cout << QString("ERROR: Kernel size must be odd-numbered, is %1").arg(kernelSize % 2) + "\n";
			return false;
		}

		GDALRasterBandH hBand = GDALGetRasterBand(categoricalMap, 1);

		float *data;
		data = new float[GDALGetRasterBandXSize(hBand)*GDALGetRasterBandYSize(hBand)];

		GDALRasterIO(hBand, GF_Read,
			0, 0,
			GDALGetRasterBandXSize(hBand), GDALGetRasterBandYSize(hBand),
			data,
			GDALGetRasterBandXSize(hBand), GDALGetRasterBandYSize(hBand),
			GDT_Float32,
			0, 0);

		int srcNoData;
		float srcNoDataValue;

		srcNoDataValue = (float)GDALGetRasterNoDataValue(hBand, &srcNoData);

		//Convert float array to an openCV mat (assuming rows = Y)
		cv::Mat dataToMat(GDALGetRasterBandYSize(hBand), GDALGetRasterBandXSize(hBand), CV_32F, data);

		//Thresholding
		if (*threshold_) {
			cv::threshold(dataToMat.clone(), dataToMat, *thresholdVal_, 1.0, CV_THRESH_BINARY);
		}

		//Create dilated (Category 1) and eroded (Category 0) mat
		cv::Mat dilationCategory(dataToMat.size(), dataToMat.type());
		cv::Mat erosionCategory(dataToMat.size(), dataToMat.type());

		//Create kernel input for erosion and dilation
		cv::Mat kernel = cv::Mat::zeros(cv::Size(kernelSize,kernelSize), CV_32F);
		//Create dilation and erosion doubles
		double dilation, erosion;

		if (memberType == RF::FuzzyMembershipType::LINEAR) {
			double length = (int)(kernelSize / 2); //Cast to int should floor without negative infinite
			double dist = sqrt(length*length + length*length);
			double m = -1.0 / dist; //Calculate slope, is negative to go from 0 to distance
			//Generate kernel
			for (int ki = 0; ki < kernel.rows; ++ki) {
				double rlength = fabs(ki - (int)(kernelSize / 2)); //Cast to int should floor without negative infinite
				for (int kj = 0; kj < kernel.cols; ++kj) {
					double clength = fabs(kj - (int)(kernelSize / 2));
					//Calculate distance
					double kdist = sqrt(rlength*rlength + clength*clength);
					kernel.at<float>(ki, kj) = float(m*kdist + 1.0);
				}
			}
			std::cout << "Linear Mat = " << std::endl << kernel << std::endl;
			//Now convolve the kernels
			for (int i = 0; i < dataToMat.rows; ++i) {
				int rowStart = std::max(i - ((kernelSize - 1) / 2), 0);
				int rowEnd = std::min(i + ((kernelSize - 1) / 2) + 1, dataToMat.rows);
				for (int j = 0; j < dataToMat.cols; ++j) {
					int colStart = std::max(j - ((kernelSize - 1) / 2), 0);
					int colEnd = std::min(j + ((kernelSize - 1) / 2) + 1, dataToMat.cols);

					cv::Mat R = dataToMat(cv::Range(rowStart, rowEnd), cv::Range(colStart, colEnd));

					if (R.total() != kernel.total()) { /*
													   if (rowStart == 0) {
													   if (colStart == 0) {
													   cv::minMaxLoc(R.mul(kernel(cv::Range(kernelSize - R.size().height, R.size().height), //Rows
													   cv::Range(kernelSize - R.size().width, R.size().width)), scaleFactor), //Cols
													   &erosion, &dilation, NULL, NULL);
													   }
													   else if (colEnd == dataToMat.cols) {
													   cv::minMaxLoc(R.mul(kernel(cv::Range(kernelSize - R.size().height, R.size().height), //Rows
													   cv::Range(0, R.size().width)), scaleFactor), //Cols
													   &erosion, &dilation, NULL, NULL);
													   }
													   else {
													   cv::minMaxLoc(R.mul(kernel(cv::Range(kernelSize - R.size().height, R.size().height), //Rows
													   cv::Range::all()), scaleFactor), //Cols
													   &erosion, &dilation, NULL, NULL);
													   }
													   }
													   else if (rowEnd == dataToMat.rows) {
													   if (colStart == 0) {
													   cv::minMaxLoc(R.mul(kernel(cv::Range(0, R.size().height), //Rows
													   cv::Range(kernelSize - R.size().width, R.size().width)), scaleFactor), //Cols
													   &erosion, &dilation, NULL, NULL);
													   }
													   else if (colEnd == dataToMat.cols) {
													   cv::minMaxLoc(R.mul(kernel(cv::Range(0, R.size().height), //Rows
													   cv::Range(0, R.size().width)), scaleFactor), //Cols
													   &erosion, &dilation, NULL, NULL);
													   }
													   else {
													   cv::minMaxLoc(R.mul(kernel(cv::Range(0, R.size().height), //Rows
													   cv::Range::all()), scaleFactor), //Cols
													   &erosion, &dilation, NULL, NULL);
													   }
													   }
													   else if (colStart == 0) {
													   //Rowstart and end cases dealth with
													   cv::minMaxLoc(R.mul(kernel(cv::Range::all(), //Rows
													   cv::Range(kernelSize - R.size().width, R.size().width)), scaleFactor), //Cols
													   &erosion, &dilation, NULL, NULL);
													   }
													   else if (colEnd == dataToMat.cols) {
													   cv::minMaxLoc(R.mul(kernel(cv::Range::all(), //Rows
													   cv::Range(0, R.size().width)), scaleFactor), //Cols
													   &erosion, &dilation, NULL, NULL);
													   }
													   */
						dilation = 0;
						erosion = 0;
					}
					else {
						cv::minMaxLoc(R.mul(kernel), &erosion, &dilation, NULL, NULL);
					}

					dilationCategory.at<float>(i, j) = float(dilation);
					erosionCategory.at<float>(i, j) = float(erosion);
				}
			}
		}
		else if (memberType == RF::FuzzyMembershipType::CONSTANT) {
			kernel = cv::getStructuringElement(cv::MorphShapes::MORPH_RECT, kernel.size());
			//Create dilation band
			cv::dilate(dataToMat, dilationCategory, kernel);
			//Create erosion band
			cv::erode(dataToMat, erosionCategory, kernel);
		}
		else if (memberType == RF::FuzzyMembershipType::GAUSSIAN) {
			kernel = cv::getGaussianKernel(kernelSize, -1, CV_32F) * cv::getGaussianKernel(kernelSize, -1, CV_32F).t();
			float scaleFactor = 1.0 / kernel.at<float>((kernelSize - 1) / 2, (kernelSize - 1) / 2);
			//std::cout << "Mat = " << std::endl << kernel << std::endl;
			//Run convolution
			for (int i = 0; i < dataToMat.rows; ++i) {
				int rowStart = std::max(i - ((kernelSize - 1) / 2), 0);
				int rowEnd = std::min(i + ((kernelSize - 1) / 2) + 1, dataToMat.rows);
				for (int j = 0; j < dataToMat.cols; ++j) {
					int colStart = std::max(j - ((kernelSize - 1) / 2), 0);
					int colEnd = std::min(j + ((kernelSize - 1) / 2) + 1, dataToMat.cols);

					cv::Mat R = dataToMat(cv::Range(rowStart, rowEnd), cv::Range(colStart, colEnd));

					if (R.total() != kernel.total()) { /*
						if (rowStart == 0) {
							if (colStart == 0) {
								cv::minMaxLoc(R.mul(kernel(cv::Range(kernelSize - R.size().height, R.size().height), //Rows
									cv::Range(kernelSize - R.size().width, R.size().width)), scaleFactor), //Cols
									&erosion, &dilation, NULL, NULL);
							}
							else if (colEnd == dataToMat.cols) {
								cv::minMaxLoc(R.mul(kernel(cv::Range(kernelSize - R.size().height, R.size().height), //Rows
									cv::Range(0, R.size().width)), scaleFactor), //Cols
									&erosion, &dilation, NULL, NULL);
							}
							else {
								cv::minMaxLoc(R.mul(kernel(cv::Range(kernelSize - R.size().height, R.size().height), //Rows
									cv::Range::all()), scaleFactor), //Cols
									&erosion, &dilation, NULL, NULL);
							}
						}
						else if (rowEnd == dataToMat.rows) {
							if (colStart == 0) {
								cv::minMaxLoc(R.mul(kernel(cv::Range(0, R.size().height), //Rows
									cv::Range(kernelSize - R.size().width, R.size().width)), scaleFactor), //Cols
									&erosion, &dilation, NULL, NULL);
							}
							else if (colEnd == dataToMat.cols) {
								cv::minMaxLoc(R.mul(kernel(cv::Range(0, R.size().height), //Rows
									cv::Range(0, R.size().width)), scaleFactor), //Cols
									&erosion, &dilation, NULL, NULL);
							}
							else {
								cv::minMaxLoc(R.mul(kernel(cv::Range(0, R.size().height), //Rows
									cv::Range::all()), scaleFactor), //Cols
									&erosion, &dilation, NULL, NULL);
							}
						}
						else if (colStart == 0) {
							//Rowstart and end cases dealth with
							cv::minMaxLoc(R.mul(kernel(cv::Range::all(), //Rows
								cv::Range(kernelSize - R.size().width, R.size().width)), scaleFactor), //Cols
								&erosion, &dilation, NULL, NULL);
						}
						else if (colEnd == dataToMat.cols) {
							cv::minMaxLoc(R.mul(kernel(cv::Range::all(), //Rows
								cv::Range(0, R.size().width)), scaleFactor), //Cols
								&erosion, &dilation, NULL, NULL);
						}
						*/
						dilation = 0;
						erosion = 0;
					}
					else {
						cv::minMaxLoc(R.mul(kernel, scaleFactor), &erosion, &dilation, NULL, NULL);
					}

					dilationCategory.at<float>(i, j) = float(dilation);
					erosionCategory.at<float>(i, j) = float(erosion);
				}
			}

		}

		outputDataset = GDALCreate(GDALGetDriverByName("GTiff"),//GDALGetDatasetDriver(categoricalMap),
			outputName.toLocal8Bit().constData(),
			GDALGetRasterXSize(categoricalMap), GDALGetRasterYSize(categoricalMap),
			2,//Dilation an derosion map
			GDT_Float32, NULL);
		double transform[6];
		GDALGetGeoTransform(categoricalMap, transform);

		GDALRasterBandH dilationBand = GDALGetRasterBand(outputDataset, 1);
		GDALRasterBandH erosionBand = GDALGetRasterBand(outputDataset, 2);
		GDALSetGeoTransform(outputDataset, transform);
		GDALSetProjection(outputDataset, GDALGetProjectionRef(categoricalMap));

		GDALSetRasterNoDataValue(dilationBand, srcNoDataValue);

		GDALRasterIO(dilationBand, GF_Write,
			0, 0,
			GDALGetRasterBandXSize(hBand), GDALGetRasterBandYSize(hBand),
			dilationCategory.data,
			GDALGetRasterBandXSize(hBand), GDALGetRasterBandYSize(hBand),
			GDT_Float32,
			0, 0);

		GDALRasterIO(erosionBand, GF_Write,
			0, 0,
			GDALGetRasterBandXSize(hBand), GDALGetRasterBandYSize(hBand),
			erosionCategory.data,
			GDALGetRasterBandXSize(hBand), GDALGetRasterBandYSize(hBand),
			GDT_Float32,
			0, 0);

		GDALClose(outputDataset);

        return true;
    }

    /**
     *
     */
    FuzzyLocation::FuzzyLocation() :
        CSIRO::DataExecution::Operation(
            CSIRO::DataExecution::OperationFactoryTraits< FuzzyLocation >::getInstance(),
            tr("Fuzzy location classifier"))
    {
        pImpl_ = new FuzzyLocationImpl(*this);
    }

    /**
     *
     */
    FuzzyLocation::~FuzzyLocation()
    {
        delete pImpl_;
    }

    /**
     *
     */
    bool  FuzzyLocation::execute()
    {
        return pImpl_->execute();
    }
}

using namespace RF;
DEFINE_WORKSPACE_OPERATION_FACTORY(FuzzyLocation,
                                   RF::VolcanoPlugin::getInstance(),
                                   CSIRO::DataExecution::Operation::tr("Geospatial"))


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

package webservice;

import de.undercouch.actson.JsonEvent;
import io.vertx.core.Promise;
import io.vertx.core.http.HttpServerOptions;
import io.vertx.rxjava.core.AbstractVerticle;
import io.vertx.rxjava.core.Vertx;
import io.vertx.rxjava.core.http.HttpServer;
import io.vertx.rxjava.core.http.HttpServerRequest;
import io.vertx.rxjava.core.http.HttpServerResponse;
import rx.Observable;
import rxjava.JsonParserOperator;
import rxjava.Result;

import java.util.concurrent.atomic.AtomicInteger;

/**
 *
This example combines Vert.x, RxJava and Actson to a reactive web service.
 * The HTTP service accepts JSON arrays and returns the number of elements in
 * this array. It can handle arbitrarily large files and multiple requests in
 * parallel without becoming unresponsive.

 *
Start the application and then use curl to send a JSON file:

 *
curl http://localhost:8080 --data @file.json

 * @author Michel Kraemer
 */
public class WebServiceExample extends AbstractVerticle {
  /**
   * The main program
   * @param args the program arguments
   */
  public static void main(String[] args) {
    Vertx vertx = Vertx.vertx();
    vertx.rxDeployVerticle(WebServiceExample.class.getName())
      .subscribe(v -> System.out.println("Web service successfully deployed"), err -> {
        err.printStackTrace();
        System.exit(1);
      });
  }

  @Override
  public void start(Promise<Void> startFuture) {
    // deploy the web server
    HttpServerOptions options = new HttpServerOptions()
        .setCompressionSupported(true);
    HttpServer server = vertx.createHttpServer(options);
    server.requestHandler(this::onRequest);
    server.rxListen(8080) // listen on port 8080
      .subscribe(v -> startFuture.complete(), startFuture::fail);
  }

  /**
   * Handle an HTTP request
   * @param request the HTTP request
   */
  private void onRequest(HttpServerRequest request) {
    // count the hierarchical level in the JSON file
    AtomicInteger level = new AtomicInteger(0);

    request.toObservable()
      .map(buf -> buf.getDelegate().getBytes())
      .lift(new JsonParserOperator()) // convert JSON file to JSON events
      .map(Result::getEvent)
      .flatMap(event -> {
        if (event == JsonEvent.EOF) {
          // skip EOF event
          return Observable.empty();
        }

        int l = level.get();
        if (l == 0 && event != JsonEvent.START_ARRAY) {
          // check that the top-level element is an array
          return Observable.error(new IllegalStateException("Array expected"));
        }

        // count hierarchical level
        if (event == JsonEvent.START_ARRAY || event == JsonEvent.START_OBJECT) {
          level.incrementAndGet();
        } else if (event == JsonEvent.END_ARRAY || event == JsonEvent.END_OBJECT) {
          level.decrementAndGet();
        }

        if (l == 1 && event != JsonEvent.END_ARRAY) {
          // count all elements in level 1 (the top-level array)
          return Observable.just(null);
        } else {
          // skip everything else
          return Observable.empty();
        }
      })
      .count() // count the number of elements
      .subscribe(v -> {
        // send counter back to client
        HttpServerResponse res = request.response();
        res.setStatusCode(200).end("{\"count:\": " + v + "}");
      }, err -> {
        // send error back to client
        HttpServerResponse res = request.response();
        if (err instanceof IllegalStateException) {
          res.setStatusCode(400);
        } else {
          res.setStatusCode(500);
        }
        res.end(err.getMessage());
      });
  }
}


text:
using NoiseLab.PolyGen.Core.Domain;

namespace NoiseLab.PolyGen.Core.FluentConfiguration.PropertyTypeSpecifications
{
    public class Int64PropertySpecificationBuilder : PropertySpecificationBuilderBase
    {
        public new Int64PropertySpecificationBuilder Nullable()
        {
            base.Nullable();
            return this;
        }

        public new Int64PropertySpecificationBuilder Identity()
        {
            base.Identity();
            return this;
        }

        public new Int64PropertySpecificationBuilder Computed()
        {
            base.Computed();
            return this;
        }

        protected internal override AbstractDataType DataType { get; } = AbstractDataType.Int64;

        internal Int64PropertySpecificationBuilder(PropertyBuilderBase propertyBuilder)
            : base(propertyBuilder)
        {
        }
    }
}


text:
package com.cc.dumpapk.util;

public class Constant {

	public static String FILESAVEPATH = "XAndReverseTool";

}


text:
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');

const extractCSS = new ExtractTextPlugin('styles/[name].css');

module.exports = {
    devtool: 'source-map', // 'cheap-module-eval-source-map'
    module: {
        rules: [{
            test: /\.css$/,
            use: [
                extractCSS.extract('style'),
                'css-loader?localIdentName=[path][name]--[local]',
                'postcss-loader'
            ]
        }, {
            test: /\.scss$/,
            use: [
                extractCSS.extract('style'),
                'css-loader?localIdentName=[path][name]--[local]',
                'postcss-loader',
                'sass-loader',
            ]
        }],
    },
    plugins: [
        extractCSS
    ]
};


text:
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Net.Http.Headers;
using System.Web.Http;
using Newtonsoft.Json.Serialization;

namespace FalconSharp.TestHarness
{
	public static class WebApiConfig
	{
		public static void Register(HttpConfiguration config)
		{
			// Web API configuration and services
			var jsonFormatter = new JsonMediaTypeFormatter();
			jsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();

			config.Services.Replace(typeof(IContentNegotiator), new JsonContentNegotiator(jsonFormatter));

			// Web API routes
			config.MapHttpAttributeRoutes();

			config.Routes.MapHttpRoute(
				name: "FalconApi_Channels",
				routeTemplate: "api/falcon/channels",
				defaults: new { controller = "FakeFalconApi", action = "channels" }
			);

			config.Routes.MapHttpRoute(
				name: "FalconApi_Content",
				routeTemplate: "api/falcon/channels/{channelId}/content",
				defaults: new { controller = "FakeFalconApi", action = "content" }
			);

			config.Routes.MapHttpRoute(
				name: "DefaultApi",
				routeTemplate: "api/{controller}/{id}",
				defaults: new { id = RouteParameter.Optional }
			);
		}
	}

	public class JsonContentNegotiator : IContentNegotiator
	{
		private readonly JsonMediaTypeFormatter _jsonFormatter;

		public JsonContentNegotiator(JsonMediaTypeFormatter formatter)
		{
			_jsonFormatter = formatter;
		}

		public ContentNegotiationResult Negotiate(
				Type type,
				HttpRequestMessage request,
				IEnumerable<MediaTypeFormatter> formatters)
		{
			return new ContentNegotiationResult(
				_jsonFormatter,
				new MediaTypeHeaderValue("application/json"));
		}
	}
}


text:
package com.eaw1805.www.fieldbattle.widgets;

import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.MouseDownEvent;
import com.google.gwt.event.dom.client.MouseDownHandler;
import com.google.gwt.event.dom.client.MouseOutEvent;
import com.google.gwt.event.dom.client.MouseOutHandler;
import com.google.gwt.event.dom.client.MouseOverEvent;
import com.google.gwt.event.dom.client.MouseOverHandler;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import com.eaw1805.www.fieldbattle.tooltips.Tips;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public abstract class SelectEAW<J>
        extends VerticalPanel {

    private final SimplePanel selectionView;
    private final PopupPanel dropDown;

    private final AbsolutePanel container;
    private final Map<Integer, Widget> indexToOption;
    private final Map<Integer, J> indexToValue;
    private final VerticalPanel dropDownView;
    private final HorizontalPanel selectionContainer;
    private final List<Widget> options;
    private final List<J> values;
    private int selectedIndex = -1;
    private int totalNumber = -1;
    private boolean opened = false;
    private final ScrollVerticalBar scroll;

    private String defaultStyle = "none";
    private String hoverStyle = "none";
    private String selectedStyle = "none";
    private final Image openCloseImg;
    private final int MAX_HEIGHT = 200;
    private int optionWidth;
    private int optionHeight;
    private boolean debug = false;

    public SelectEAW(final String title) {
        if (title != null) {
            Tips.generateTip(this, title);
        }
        selectionContainer = new HorizontalPanel();
        container = new AbsolutePanel();
        indexToOption = new HashMap<Integer, Widget>();
        indexToValue = new HashMap<Integer, J>();
        dropDown = new PopupPanel() {
            public void onDetach() {
                super.onDetach();
                opened = false;
                onSelectorDetach();
            }

            public void onAttach() {
                super.onAttach();
                fixSize();
                onSelectorAttach();
            }
        };
        dropDown.addDomHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent clickEvent) {
                clickEvent.stopPropagation();
                clickEvent.preventDefault();
            }
        }, ClickEvent.getType());
        dropDown.addDomHandler(new MouseDownHandler() {
            @Override
            public void onMouseDown(MouseDownEvent mouseDownEvent) {
                mouseDownEvent.stopPropagation();
                mouseDownEvent.preventDefault();
            }
        }, MouseDownEvent.getType());

        selectionView = new SimplePanel();
        selectionView.setStyleName("clearFontMedMini whiteText");
        selectionView.addDomHandler(new ClickHandler() {
            public void onClick(final ClickEvent clickEvent) {
                if (opened) {
                    dropDown.hide();
                    opened = false;
                } else {
                    dropDown.showRelativeTo(selectionContainer);
                    opened = true;
                }
            }
        }, ClickEvent.getType());

        selectionView.setStyleName("pointer", true);

        dropDownView = new VerticalPanel();

        options = new ArrayList<Widget>();
        values = new ArrayList<J>();
        scroll = new ScrollVerticalBar(dropDownView, 15);
        container.add(scroll);
//        dropDown.setAnimationEnabled(true);
        dropDown.setWidget(container);
        dropDown.setAutoHideEnabled(true);
        //assign a very big z-index so it will always be on top
        dropDown.getElement().getStyle().setZIndex(10000);
        selectionContainer.add(selectionView);
        add(selectionContainer);

        openCloseImg = new Image("http://static.eaw1805.com/images/layout/buttons/minimapMenu/ButZoomOutOff.png");
        openCloseImg.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                if (opened) {
                    dropDown.hide();
                    opened = false;
                } else {
                    dropDown.showRelativeTo(selectionContainer);
                    opened = true;
                }
            }
        });

        openCloseImg.setSize("20px", "20px");
        selectionContainer.add(openCloseImg);
    }

    public void setDebug(boolean value) {
        debug = value;
    }

    protected void onSelectorAttach() {
        //for override purposes.
    }

    protected void onSelectorDetach() {
        //for override purposes.
    }

    boolean hideSidebar = false;

    public void hideSideBar() {
        hideSidebar = true;
        scroll.hideSideBar();
    }

    public void fixSize() {
        int scrollWidgetHeight = dropDownView.getOffsetHeight();
        if (scrollWidgetHeight > MAX_HEIGHT) {
            scrollWidgetHeight = MAX_HEIGHT;
        }

        openCloseImg.setSize(optionHeight + "px", optionHeight + "px");
        selectionView.setSize((optionWidth) + "px", optionHeight + "px");
        container.setSize((optionWidth + 26) + "px", (scrollWidgetHeight + 15) + "px");

        scroll.setSize(optionWidth + 11, scrollWidgetHeight);
        scroll.resizeBar();
        container.setWidgetPosition(scroll, 5, 10);
    }

    public void setDropDownStyleName(final String styleName) {
        dropDown.setStyleName("fieldArmySelector");
        scroll.setStyleName("selectorOption");
    }

    public void onAttach() {
        super.onAttach();
        fixSize();
    }

    public void clearOptions() {
        selectedIndex = -1;
        totalNumber = -1;
        indexToOption.clear();
        indexToValue.clear();
        dropDownView.clear();
        options.clear();
        values.clear();
    }

    public void addOption(final OptionEAW option, final J value) {
        optionWidth = option.getWidth();
        optionHeight = option.getHeight();
        options.add(option);
        dropDownView.add(option);
        values.add(value);
        totalNumber++;
        final int thisNumber = totalNumber;
        indexToValue.put(thisNumber, value);
        indexToOption.put(thisNumber, option);
        option.setStyleName(defaultStyle, true);
        option.addDomHandler(new ClickHandler() {
            public void onClick(final ClickEvent clickEvent) {
                selectOption(thisNumber);

                clickEvent.stopPropagation();
            }
        }, ClickEvent.getType());

        option.addDomHandler(new MouseOverHandler() {
            public void onMouseOver(final MouseOverEvent mouseOverEvent) {
                option.setStyleName(hoverStyle, true);
            }
        }, MouseOverEvent.getType());

        option.addDomHandler(new MouseOutHandler() {
            public void onMouseOut(final MouseOutEvent event) {
                option.removeStyleName(hoverStyle);
            }
        }, MouseOutEvent.getType());
        fixSize();
        scroll.resizeBar();

    }

    public void setOptionsStyles(final String defaultStyle, final String hoverStyle, final String selectedStyle) {
        this.defaultStyle = defaultStyle;
        this.hoverStyle = hoverStyle;
        this.selectedStyle = selectedStyle;
    }

    public void selectOptionByValue(final J value) {
        if (debug) {
            Window.alert(value.toString() + ", " + values.contains(value) + ", " + values.indexOf(value));
        }
        if (values.contains(value)) {
            selectOption(values.indexOf(value));
        } else {
            selectOption(0);
        }
    }

    public void selectOption(final int index) {
        try {
            DOM.setInnerHTML(selectionView.getElement(), "");
            if (selectedIndex != -1) {
                indexToOption.get(selectedIndex).removeStyleName(selectedStyle);
                indexToOption.get(selectedIndex).setStyleName(defaultStyle, true);
            }

            selectedIndex = index;
            indexToOption.get(selectedIndex).removeStyleName(defaultStyle);
            indexToOption.get(selectedIndex).removeStyleName(hoverStyle);
            indexToOption.get(selectedIndex).setStyleName(selectedStyle, true);
            Element clone = null;
            try {
                clone = DOM.clone(indexToOption.get(selectedIndex).getElement(), true);
            } catch (Exception e) {

            }
            try {
                DOM.appendChild(selectionView.getElement(), (com.google.gwt.user.client.Element) clone);
            } catch (Exception e) {

            }

            dropDown.hide();
            scroll.scrollToTop();
            opened = false;
            onChange();

        } catch (Exception e) {
            Window.alert("Comeon!!: " + e.toString());
        }
    }

    public J getValue() {
        return values.get(selectedIndex);
    }

    public List<J> getValues() {
        return values;
    }

    public Widget getSelectedOption() {
        return options.get(selectedIndex);
    }

    public Object getOption(final int index) {
        return options.get(index);
    }

    public abstract void onChange();
}


text:
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Accessor_1 = require("./Accessor");
var query_1 = require("../query");
var NoFiltersHitCountAccessor = (function (_super) {
    __extends(NoFiltersHitCountAccessor, _super);
    function NoFiltersHitCountAccessor() {
        _super.apply(this, arguments);
        this.aggsKey = "no_filters_top_hits";
    }
    NoFiltersHitCountAccessor.prototype.getCount = function () {
        return this.getAggregations([this.aggsKey, "hits", "total"], 0);
    };
    NoFiltersHitCountAccessor.prototype.buildOwnQuery = function (query) {
        if (query.getQueryString() && query.getSelectedFilters().length > 0) {
            return query.setAggs(query_1.TopHitsMetric(this.aggsKey, {
                size: 1, _source: false
            }));
        }
        return query;
    };
    return NoFiltersHitCountAccessor;
}(Accessor_1.Accessor));
exports.NoFiltersHitCountAccessor = NoFiltersHitCountAccessor;
//# sourceMappingURL=NoFiltersHitCountAccessor.js.map


text:
class SkinHueAverager {
public:
    SkinHueAverager();
    virtual ~SkinHueAverager();

    float average(cv::Mat& face);
    float display(cv::Mat& face);

private:
    class SkinHueAveragerImpl;
    std::unique_ptr<SkinHueAveragerImpl> pimpl;
};