text:
var View           = require('famous/core/View');
var Surface        = require('famous/core/Surface');
var Transform      = require('famous/core/Transform');
var Modifier       = require('famous/core/Modifier');
var Transitionable = require('famous/transitions/Transitionable');
var StateModifier  = require('famous/modifiers/StateModifier');
var Easing         = require('famous/transitions/Easing');
var EventHandler   = require('famous/core/EventHandler');

var CUBE_TRANSITION = { duration: 500, curve: Easing.inOutElastic };
var CUBE_TRANSITION = { duration: 500, curve: Easing.inQuad };
var CUBE_TRANSITION = { duration: 500, curve: Easing.outQuad };
var CUBE_TRANSITION = { duration: 500, curve: Easing.inOutQuad };
var CUBE_TRANSITION = { duration: 500, curve: Easing.inCubic };
var CUBE_TRANSITION = { duration: 500, curve: Easing.outCubic };
var CUBE_TRANSITION = { duration: 500, curve: Easing.inOutCubic };

// var CUBE_TRANSITION = { duration: 500, curve: Easing.inOutSine };
// var CUBE_TRANSITION = { duration: 500, curve: Easing.inOutExpo };
// var CUBE_TRANSITION = { duration: 500, curve: Easing.inOutCirc };
// var CUBE_TRANSITION = { duration: 500, curve: Easing.inOutBounce };

var NINETY_DEGRESS = Math.PI/2;

var FACE_ROTATIONS = [
    [0, 0, 0],                    //FRONT
    [-NINETY_DEGRESS, 0, 0],      //LEFT
    [NINETY_DEGRESS, 0, 0],       //RIGHT
    [0, -NINETY_DEGRESS, 0],      //BOTTOM
    [0, NINETY_DEGRESS, 0],       //TOP
    [2 * NINETY_DEGRESS, 0, 0],   //BACK
]

var FACE_COLORS = [
    'black',    //off mode == 0
    'white',    //on mode  == 1
    'black',    //custom button 1
    'black',    //custom button 2
    'black',    //custom button 3
    'black',    //custom button 4
]

var SYMBOL_FACE_MAP = {
    '1' : 0,    //the one number is on face at index 0
    '%' : 1,
    'sqrt' : 2,
}

function CubicView() {
    View.apply(this, arguments);

    this._flipEndState = [0, 0, 0];
    this._currentFaceIndex = 0;
    this._currentShiftState = 0;
    this._cubeRotationState = new Transitionable([0, 0, 0]);
    this._cubeTranslationState = new Transitionable([0, 0, 0]);

    this._reversalChain = [];
    this._faces = [];

    this._index = this.options.index;
    this._rotationModifier = new Modifier({
        align: [0.5, 0.5],
        origin: [0.5, 0.5],
        transform: function() {
            var state = this._cubeRotationState.get();
            // return Transform.rotate(state[0], state[1], state[2]);
            return Transform.rotate.apply(this, state);
        }.bind(this)
    });

    this._translationModifier = new Modifier({
        transform : function () {
            var state = this._cubeTranslationState.get();
            return Transform.translate.apply(this, state);
        }.bind(this)
    })

    this._rootNode = this.add(this._translationModifier).add(this._rotationModifier);

    _createCube.call(this);
}

CubicView.prototype = Object.create(View.prototype);
CubicView.prototype.constructor = CubicView;

CubicView.DEFAULT_OPTIONS = {
    width : 50,
    height : 50,
    edgeLength : 50,
    translation : 25
};

CubicView.prototype.toggleJiggle = function() {
    if(this.jiggling) {
        clearInterval(this.jiggling);
        this.halt();
        this.jiggling = undefined;
    }else{
        // make jiggle
        this.jiggling = setInterval(function() {
            var i = Math.round(Math.random() * 5);
            this.flipTo(i);
            this.shiftTo(i%4 - 1);
        }.bind(this), 2000 + Math.round(Math.random() * 1000));
    }
}

CubicView.prototype.returnToStart = function(delay, callback) {
    var self = this;
    if(delay instanceof Function) callback = delay, delay = 0;

    self.flipTo(0, delay, function() {
        self.shiftTo(0, delay, function() {
            if(callback) return callback();
        });
    });
}

CubicView.prototype.halt = function() {
    this.shiftTo(this._currentShiftState);
    this.flipTo(this._currentFaceIndex);
}

CubicView.prototype.popFlipReturn = function popFlipReturn(index, popDirection, delay, callback) {
    var self = this;

    if(delay instanceof Function) callback = delay, delay = 0;

    self.shiftTo(popDirection, delay, function() {
        self.flipTo(index, delay, function() {
            self.shiftTo(0, delay, callback);
        });
    });
}

CubicView.prototype.shiftTo = function shiftTo(state, delay, callback) {
    if(delay instanceof Function) callback = delay, delay = 0;

    this._currentShiftState = state;
    this._cubeTranslationState.delay(delay);
    this._cubeTranslationState.set([0, 0, state * this.options.edgeLength], CUBE_TRANSITION, callback);
}

CubicView.prototype.flipTo = function flipTo(index, delay, callback) {
    var self = this;
    if(delay instanceof Function) callback = delay, delay = 0;

    self._currentFaceIndex = index;

    self._cubeRotationState.delay(delay);
    self.reverseRotations(function() {
        //finished reversing the rotations.
        var currentState = self._flipEndState;

        self._flipEndState = FACE_ROTATIONS[self._currentFaceIndex].map(function(n) { return -n });
        self._reversalChain.push(FACE_ROTATIONS[self._currentFaceIndex]);

        var states = _createStateArray(currentState, self._flipEndState);
        _flipChain.call(self, states, callback);
    });
}

CubicView.prototype.reverseRotations = function reverseRotations(callback) {
    if(this._reversalChain.length == 0) return callback();

    for(var i = 0; i<this._reversalChain.length; i++) {
        var reversal = this._reversalChain.pop();
        var currentState = this._flipEndState;
        this._flipEndState = _vecSum(this._flipEndState, reversal);

        var states = _createStateArray(currentState, this._flipEndState);
        _flipChain.call(this, states, callback);
    }
}

function _flipChain (stateArray, delay, callback) {
    if(delay instanceof Function) callback = delay, delay = 0;

    var self = this;
    if(stateArray.length == 0) {
        if(callback) callback();
    }else{
        var state = stateArray.shift();
        self._cubeRotationState.set(state, CUBE_TRANSITION, function() {
            _flipChain.call(self, stateArray, callback);
        });
    }

}

function _vecSum(a, b) {
    var res = [];
    for(var i=0; i<a.length; i++){
        res[i] = a[i] + b[i];
    }
    return res;
}

function _createStateArray (start, end) {
    //generate an array of states that goes from start to end face by face.
    var states = [];
    for(var i=0; i<start.length; i++){
        var sign = start[i] < end[i] ? 1 : -1; //add if less than, subtract if more than.
        while(start[i] != end[i]) {
            var tmp = [0, 0, 0]
            tmp[i] = start[i]+= sign * NINETY_DEGRESS;
            states.push(tmp);
        }
    }
    if(states.length == 0) states.push(end);
    return states;
}

function _createCube() {
    var self = this;
    for(var i=0; i<FACE_ROTATIONS.length; i++){
        // var face = _createFace.call(this, i, '' + i);
        var face = _createFace.call(this, i);
        // var rMod = new Modifier({
        //     opacity : 0.9,
        //     transform: Transform.rotate.apply(self, FACE_ROTATIONS[i])
        // });
        var zMod = new Modifier({
            //TODO HOW TO GET RENDERED WIDTH?
            // transform: Transform.translate(0, 0, this.options.edgeLength * 0.5)
            transform: Transform.multiply(
                Transform.rotate.apply(self, FACE_ROTATIONS[i]),
                Transform.translate(0, 0, this.options.edgeLength * 0.5)
            )
        });

        self._faces.push(face);
        // self._rootNode.add(rMod).add(zMod).add(face);
        self._rootNode.add(zMod).add(face);
    }
}

function _createFace(index, content) {
    var face = new Surface({
      content: content,
      classes: ['backfaceVisibility'],
      size: [this.options.edgeLength, this.options.edgeLength],
      properties: {
        color: 'white',
        textAlign: 'center',
        lineHeight: '50px',
        fontSize: '35px',
        // border: '1px solid white',
        // backgroundColor: FACE_COLORS[i]
        backgroundColor: 'hsl(' + (index * 36 / 3) + ', 80%, 40%)'
      }
    });

    face.on('mousedown', function() {
        console.log('mdown on cube', this._index, 'face', index);
    }.bind(this));

    face.on('mouseup', function() {
        console.log('mouseup on cube', this._index, 'face', index);
    }.bind(this));

    return face;
}

module.exports = CubicView;


text:
Graphene
========

------------

The documentation below is for the ``dev`` (prerelease) version of Graphene. To view the documentation for the latest stable Graphene version go to the `v2 docs <https://docs.graphene-python.org/en/stable/>`_.

------------

Contents:

.. toctree::
   :maxdepth: 2

   quickstart
   types/index
   execution/index
   relay/index
   testing/index
   api/index

.. _Integrations:

Integrations
------------

* `Graphene-Django <http://docs.graphene-python.org/projects/django/en/latest/>`_ (`source <https://github.com/graphql-python/graphene-django/>`_)
* Flask-Graphql (`source <https://github.com/graphql-python/flask-graphql>`_)
* `Graphene-SQLAlchemy <http://docs.graphene-python.org/projects/sqlalchemy/en/latest/>`_ (`source <https://github.com/graphql-python/graphene-sqlalchemy/>`_)
* `Graphene-GAE <http://docs.graphene-python.org/projects/gae/en/latest/>`_ (`source <https://github.com/graphql-python/graphene-gae/>`_)
* `Graphene-Mongo <http://graphene-mongo.readthedocs.io/en/latest/>`_ (`source <https://github.com/graphql-python/graphene-mongo>`_)
* `Starlette <https://www.starlette.io/graphql/>`_ (`source <https://github.com/encode/starlette>`_)
* `FastAPI <https://fastapi.tiangolo.com/advanced/graphql/>`_ (`source <https://github.com/tiangolo/fastapi>`_)

redpajama_set_name: RedPajamaGithub


text:
<?php

/**
 * This is the configuration-object
 *
 * @author Jan Moesen <jan.moesen@netlash.com>
 */
final class FrontendTestimonialsConfig extends FrontendBaseConfig
{
	/**
	 * The default action.
	 *
	 * @var  string
	 */
	protected $defaultAction = 'index';
}


text:
using System;
using Gtk;
using Moscrif.IDE.Controls;

namespace Moscrif.IDE.Actions
{
	public class AddDirectoryAction : Gtk.Action
	{
		public AddDirectoryAction() : base("adddirectory", MainClass.Languages.Translate("menu_add_dir"), MainClass.Languages.Translate("menu_title_add_dir"), null)
		{
		}

		protected override void OnActivated ()
		{
			base.OnActivated ();

			Gtk.FileChooserDialog fc = new Gtk.FileChooserDialog(MainClass.Languages.Translate("chose_dir_to_copy"),
			                                                     MainClass.MainWindow,
			                                                     FileChooserAction.SelectFolder,
			                                                     "Cancel", ResponseType.Cancel,
			                                                     "Open", ResponseType.Accept);

			if (fc.Run() == (int)ResponseType.Accept) {
				MainClass.MainWindow.AddDirectory(fc.Filename);
			}
			fc.Destroy();

		}
	}
}


text:
package de.tum.in.mislcontrol.wizard;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import org.codepond.wizardroid.WizardStep;

import de.tum.in.mislcontrol.R;

/**
 * The wizards page second step.
 */
public class Step2 extends WizardStep {

    //Wire the layout to the step
    public Step2() {
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View v = inflater.inflate(R.layout.wizard_instructionstep, container, false);
        TextView tv = (TextView) v.findViewById(R.id.instructionTextView);
        tv.setText(getText(R.string.wizard_step_2));

        return v;
    }
}


text:
package configo

import (
	"github.com/distributedio/configo/rule"
	"github.com/shafreeck/toml"
	"github.com/shafreeck/toml/ast"

	"fmt"
	goast "go/ast"
	"reflect"
	"strconv"
	"strings"
	"time"
	"unicode"
)

const (
	fieldTagName = "cfg"
)

func init() {
	toml.SetValue = fieldValidate
}

func fieldValidate(field string, rv reflect.Value, av ast.Value, tag *toml.CfgTag) error {
	if tag == nil {
		return nil
	}
	val, ok := av.(*ast.String)
	if tag.Check != "" && ok {
		return validate(field, val.Value, tag.Check)
	}
	return nil
}
func isEmptyValue(v reflect.Value) bool {
	switch v.Kind() {
	case reflect.String, reflect.Array:
		return v.Len() == 0
	case reflect.Map, reflect.Slice:
		return v.Len() == 0 || v.IsNil()
	case reflect.Bool:
		return !v.Bool()
	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
		return v.Int() == 0
	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
		return v.Uint() == 0
	case reflect.Float32, reflect.Float64:
		return v.Float() == 0
	case reflect.Interface, reflect.Ptr:
		return v.IsNil()
	}
	return reflect.DeepEqual(v.Interface(), reflect.Zero(v.Type()).Interface())
}

func extractTag(tag string) *toml.CfgTag {
	tags := strings.SplitN(tag, ";", 4)
	cfg := &toml.CfgTag{}
	switch c := len(tags); c {
	case 1:
		cfg.Name = strings.TrimSpace(tags[0])
	case 2:
		cfg.Name = strings.TrimSpace(tags[0])
		cfg.Value = strings.TrimSpace(tags[1])
	case 3:
		cfg.Name = strings.TrimSpace(tags[0])
		cfg.Value = strings.TrimSpace(tags[1])
		cfg.Check = strings.TrimSpace(tags[2])
	case 4:
		cfg.Name = strings.TrimSpace(tags[0])
		cfg.Value = strings.TrimSpace(tags[1])
		cfg.Check = strings.TrimSpace(tags[2])
		cfg.Description = strings.TrimSpace(tags[3])
	default:
		return nil
	}
	return cfg
}

func validate(key, value string, check string) error {
	r := rule.Rule(check)
	vlds, err := r.Parse()
	if err != nil {
		return err
	}
	for _, vld := range vlds {
		if err := vld.Validate(value); err != nil {
			return fmt.Errorf("validate %s failed, %s does not match rule %q, reason: %v", key, value, check, err)
		}
	}
	return nil
}

//parse a toml array
func unmarshalArray(key, value string, v interface{}) error {
	//construct a valid toml array
	data := key + " = " + value
	if err := toml.Unmarshal([]byte(data), v); err != nil {
		return err
	}
	return nil
}

func applyDefaultValue(fv reflect.Value, ft reflect.StructField, rv reflect.Value, ignoreRequired bool) (err error) {
	tag := extractTag(ft.Tag.Get(fieldTagName))

	//Default value is not supported
	if tag.Value == "required" {
		if ignoreRequired {
			return nil
		}
		return fmt.Errorf("value of %q is required in %v", ft.Name, rv.Type())
	}

	//No default value supplied
	if tag.Value == "" {
		return nil
	}

	//Validate the default value
	//reflect.Slice will be validated by unmarshalArray
	if tag.Check != "" && fv.Kind() != reflect.Slice {
		if err := validate(ft.Name, tag.Value, tag.Check); err != nil {
			return err
		}
	}

	//Set the default value
	switch fv.Kind() {
	case reflect.Int, reflect.Int8, reflect.Int16,
		reflect.Int32, reflect.Int64:
		var v int64
		if v, err = strconv.ParseInt(tag.Value, 10, 64); err != nil {
			if fv.Kind() == reflect.Int64 {
				//try to parse a time.Duration
				if d, err := time.ParseDuration(tag.Value); err == nil {
					fv.SetInt(int64(d))
					return nil
				}
			}
			return err
		}
		fv.SetInt(v)
	case reflect.Uint, reflect.Uint8, reflect.Uint16,
		reflect.Uint32, reflect.Uint64:
		var v uint64
		if v, err = strconv.ParseUint(tag.Value, 10, 64); err != nil {
			return err
		}
		fv.SetUint(v)
	case reflect.Float32, reflect.Float64:
		var v float64
		if v, err = strconv.ParseFloat(tag.Value, 64); err != nil {
			return err
		}
		fv.SetFloat(v)
	case reflect.Bool:
		var v bool
		if v, err = strconv.ParseBool(tag.Value); err != nil {
			return err
		}
		fv.SetBool(v)
	case reflect.String:
		fv.SetString(tag.Value)
	case reflect.Slice, reflect.Array:
		v := rv.Addr().Interface()
		if err := unmarshalArray(ft.Name, tag.Value, v); err != nil {
			return err
		}
	default:
		return fmt.Errorf("set default value of type %s is not supported yet", ft.Type)
	}
	return nil
}

//Notice toCamelCase is copied from github.com/naoina/toml
// toCamelCase returns a copy of the string s with all Unicode letters mapped to their camel case.
// It will convert to upper case previous letter of '_' and first letter, and remove letter of '_'.
func toUnderscore(s string) string {
	if s == "" {
		return ""
	}
	result := make([]rune, 0, len(s))

	result = append(result, unicode.ToLower(rune(s[0])))
	for _, r := range s[1:] {
		if unicode.ToUpper(r) == r {
			result = append(result, '_', unicode.ToLower(r))
			continue
		}
		result = append(result, r)
	}
	return string(result)
}

func findField(t *ast.Table, field reflect.StructField) (interface{}, bool) {
	if t == nil {
		return nil, false
	}
	tag := extractTag(field.Tag.Get(fieldTagName))
	if tag != nil && tag.Name != "" {
		if f, found := t.Fields[tag.Name]; found {
			return f, found
		}
		return nil, false
	}

	name := field.Name
	for _, n := range []string{name, strings.ToLower(name), toUnderscore(name)} {
		if f, found := t.Fields[n]; found {
			return f, found
		}
	}
	return nil, false
}

func applyDefault(rv reflect.Value, ignoreRequired bool) error {
	for rv.Kind() == reflect.Ptr {
		rv = rv.Elem()
	}

	rt := rv.Type()

	if kind := rt.Kind(); kind == reflect.Struct {
		for i := 0; i < rt.NumField(); i++ {
			ft := rt.Field(i)
			fv := rv.Field(i)
			if !goast.IsExported(ft.Name) {
				continue
			}
			for fv.Kind() == reflect.Ptr {
				fv = fv.Elem()
			}
			if fv.Kind() == reflect.Struct {
				if err := applyDefault(fv, ignoreRequired); err != nil {
					return err
				}
				continue
			}

			//Maybe array of table
			if fv.IsValid() && !isEmptyValue(fv) && (fv.Kind() == reflect.Slice || fv.Kind() == reflect.Array) {
				for j := 0; j < fv.Len(); j++ {
					ev := fv.Index(j)
					if err := applyDefault(ev, ignoreRequired); err != nil {
						return err
					}
				}
			}

			if fv.IsValid() && isEmptyValue(fv) {
				if err := applyDefaultValue(fv, ft, rv, ignoreRequired); err != nil {
					return err
				}
			}
		}
	}

	return nil
}

//Unmarshal data into struct v, v shoud be a pointer to struct
func Unmarshal(data []byte, v interface{}) error {
	table, err := toml.Parse(data)
	if err != nil {
		return err
	}

	if err := toml.UnmarshalTable(table, v); err != nil {
		return err
	}

	if err := applyDefault(reflect.ValueOf(v), false); err != nil {
		return err
	}
	return nil
}

//Marshal v to configuration in toml format
func Marshal(v interface{}) ([]byte, error) {
	rv := reflect.ValueOf(v)
	for rv.Kind() == reflect.Ptr {
		rv = rv.Elem()
	}
	pv := reflect.New(rv.Type())
	pv.Elem().Set(rv)

	if err := applyDefault(pv, true); err != nil {
		return nil, err
	}
	return toml.Marshal(pv.Interface())
}

//Patch the base using the value from v, the new bytes returned
//combines the base's value and v's default value
func Patch(base []byte, v interface{}) ([]byte, error) {
	//Clone struct v, v shoud not be modified
	rv := reflect.ValueOf(v)
	for rv.Kind() == reflect.Ptr {
		rv = rv.Elem()
	}
	pv := reflect.New(rv.Type())
	pv.Elem().Set(rv)

	nv := pv.Interface()

	//unmarshal base
	table, err := toml.Parse(base)
	if err != nil {
		return nil, err
	}

	if err := toml.UnmarshalTable(table, nv); err != nil {
		return nil, err
	}

	return Marshal(nv)
}


text:
<?php

namespace CAT\Game\Objects;

use CAT\Support\SortedObject;

class Deck extends SortedObject
{
    public $name;

    public $description;

    public $version;

    public $slug;

    public $calls;

    public $responses;

    public $cards;
}


text:
<?php

namespace Okipa\LaravelBootstrapTableList\Test\Fakers;

use Okipa\LaravelBootstrapTableList\Test\Models\Company;
use Okipa\LaravelBootstrapTableList\Test\Models\User;

trait CompaniesFaker
{
    public $data;

    public function createMultipleCompanies(int $count)
    {
        for ($ii = 0; $ii < $count; $ii++) {
            $this->createUniqueCompany();
        }

        return app(Company::class)->all();
    }

    public function createUniqueCompany()
    {
        $databaseUser = app(Company::class)->create($this->generateFakeCompanyData());

        return app(Company::class)->find($databaseUser->id);
    }

    public function generateFakeCompanyData()
    {
        $max = User::all()->count();

        return [
            'name'     => $this->faker->company,
            'owner_id' => rand(1, $max),
        ];
    }
}


text:
package com.intellij.refactoring.inline;

import com.intellij.lang.LangBundle;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.NlsContexts;
import com.intellij.psi.PsiJavaCodeReferenceElement;
import com.intellij.psi.PsiVariable;
import com.intellij.refactoring.HelpID;
import com.intellij.refactoring.JavaRefactoringSettings;
import com.intellij.refactoring.RefactoringBundle;

public class InlineLocalDialog extends AbstractInlineLocalDialog {
  private final PsiVariable myVariable;

  private int myOccurrencesNumber = -1;

  public InlineLocalDialog(Project project, PsiVariable variable, final PsiJavaCodeReferenceElement ref, int occurrencesCount) {
    super(project, variable, ref, occurrencesCount);
    myVariable = variable;
    myInvokedOnReference = ref != null;

    setTitle(getRefactoringName());
    myOccurrencesNumber = occurrencesCount;
    init();
  }

  @Override
  protected String getNameLabelText() {
    return LangBundle.message("label.local.variable", myVariable.getName());
  }

  @Override
  protected String getBorderTitle() {
    return RefactoringBundle.message("inline.method.border.title");
  }

  @Override
  protected String getInlineThisText() {
    return RefactoringBundle.message("this.reference.only.and.keep.the.variable");
  }

  @Override
  protected String getInlineAllText() {
    final String occurrencesString =
      myOccurrencesNumber > -1 ? " " + RefactoringBundle.message("occurrences.string", myOccurrencesNumber) : "";
    return RefactoringBundle.message("all.references.and.remove.the.local") + occurrencesString;
  }

  @Override
  protected void doAction() {
    JavaRefactoringSettings settings = JavaRefactoringSettings.getInstance();
    if(myRbInlineThisOnly.isEnabled() && myRbInlineAll.isEnabled()) {
      settings.INLINE_LOCAL_THIS = isInlineThisOnly();
    }
    close(OK_EXIT_CODE);
  }

  @Override
  protected String getHelpId() {
    return HelpID.INLINE_VARIABLE;
  }

  @Override
  protected boolean isInlineThis() {
    return JavaRefactoringSettings.getInstance().INLINE_LOCAL_THIS;
  }

  @Override
  protected boolean hasPreviewButton() {
    return false;
  }

  public static @NlsContexts.DialogTitle String getRefactoringName() {
    return RefactoringBundle.message("inline.variable.title");
  }
}


text:
from __future__ import absolute_import, division, print_function, unicode_literals

from unittest import TestCase

from jubakit.dumb import Graph
from jubakit._cli.service import GraphCLI

from .base import BaseCLITestCase

class GraphCLITest(BaseCLITestCase):
  def setUp(self):
    self._service = Graph.run(Graph.CONFIG)

  def tearDown(self):
    self._service.stop()

  def test_simple(self):
    self._ok([
      'clear',
      'create_node',            # 0
      'create_node',            # 1
      'create_node',            # 2
      'create_node',            # 3
      'update_node 1 k n1',
      'update_node 2 k n2',
      'update_node 3 k n3',
      'create_edge 1 2 k e4',   # 4
      'create_edge 2 3 k e5',   # 5
      'update_edge 4 1 2 k eX',
      'remove_edge 5',
      'remove_node 3',
      'add_centrality_query',
      'add_shortest_path_query',
      'update_index',
      'get_centrality 1 0',
      'get_shortest_path 1 2',
      'get_shortest_path 1 2 100',
      'remove_centrality_query',
      'remove_shortest_path_query',
      'get_node 1',
      'get_edge 4',
    ])
    self.assertEqual(self._service._client().get_node('1').property, {'k': 'n1'})
    self.assertEqual(self._service._client().get_edge('0', 4).property, {'k': 'eX'})

  def test_fail(self):
    self._fail([
      'create_node foo',
      'update_node',
      'update_node foo bar baz',
      'create_edge foo',
      'update_edge foo bar baz',
      'remove_node foo'
      'remove_edge foo'
      'add_centrality_query foo',
      'add_shortest_path_query foo',
      'update_index foo',
      'get_centrality',
      'get_shortest_path',
      'remove_centrality_query foo',
      'remove_shortest_path_query foo',
      'get_node',
      'get_edge',
    ])


text:
#include "gazebo/common/Exception.hh"
#include "gazebo/common/Console.hh"

#include "gazebo/physics/Model.hh"
#include "gazebo/physics/simbody/SimbodyLink.hh"
#include "gazebo/physics/simbody/SimbodyTypes.hh"
#include "gazebo/physics/simbody/SimbodyUniversalJoint.hh"

using namespace gazebo;
using namespace physics;

//////////////////////////////////////////////////
SimbodyUniversalJoint::SimbodyUniversalJoint(SimTK::MultibodySystem* /*_world*/,
  BasePtr _parent) : UniversalJoint<SimbodyJoint>(_parent)
{
  this->physicsInitialized = false;
}

//////////////////////////////////////////////////
SimbodyUniversalJoint::~SimbodyUniversalJoint()
{
}

//////////////////////////////////////////////////
void SimbodyUniversalJoint::Load(sdf::ElementPtr _sdf)
{
  UniversalJoint<SimbodyJoint>::Load(_sdf);
}

//////////////////////////////////////////////////
math::Vector3 SimbodyUniversalJoint::GetAnchor(unsigned int /*_index*/) const
{
  return this->anchorPos;
}

//////////////////////////////////////////////////
math::Vector3 SimbodyUniversalJoint::GetAxis(unsigned int /*_index*/) const
{
  return math::Vector3();
}

//////////////////////////////////////////////////
void SimbodyUniversalJoint::SetAxis(unsigned int /*_index*/,
                                   const math::Vector3 &/*_axis*/)
{
  /// Universal Joint are built in SimbodyPhysics.cc, so this init block
  /// actually does nothing.
  gzdbg << "SetAxis: setting axis is not yet implemented. The axes are set "
        << "during joint construction in SimbodyPhyiscs.cc for now.\n";
}

//////////////////////////////////////////////////
double SimbodyUniversalJoint::GetVelocity(unsigned int _index) const
{
  if (_index < this->GetAngleCount())
  {
    if (this->physicsInitialized &&
        this->simbodyPhysics->simbodyPhysicsInitialized)
    {
      return this->mobod.getOneU(
        this->simbodyPhysics->integ->getState(),
        SimTK::MobilizerUIndex(_index));
    }
    else
    {
      gzdbg << "GetVelocity() simbody not yet initialized, "
            << "initial velocity should be zero until restart from "
            << "state has been implemented.\n";
      return 0.0;
    }
  }
  else
  {
    gzerr << "Invalid index for joint, returning NaN\n";
    return SimTK::NaN;
  }
}

//////////////////////////////////////////////////
void SimbodyUniversalJoint::SetVelocity(unsigned int _index,
    double _rate)
{
  if (_index < this->GetAngleCount())
  {
    this->mobod.setOneU(
      this->simbodyPhysics->integ->updAdvancedState(),
      SimTK::MobilizerUIndex(_index), _rate);
    this->simbodyPhysics->system.realize(
      this->simbodyPhysics->integ->getAdvancedState(), SimTK::Stage::Velocity);
  }
  else
  {
    gzerr << "SetVelocity _index too large.\n";
  }
}

//////////////////////////////////////////////////
void SimbodyUniversalJoint::SetForceImpl(unsigned int _index,
    double _torque)
{
  if (_index < this->GetAngleCount() && this->physicsInitialized)
  {
    this->simbodyPhysics->discreteForces.setOneMobilityForce(
      this->simbodyPhysics->integ->updAdvancedState(),
      this->mobod, SimTK::MobilizerUIndex(_index), _torque);
  }
}

//////////////////////////////////////////////////
void SimbodyUniversalJoint::SetMaxForce(unsigned int /*_index*/, double /*_t*/)
{
  gzerr << "Not implemented\n";
}

//////////////////////////////////////////////////
double SimbodyUniversalJoint::GetMaxForce(unsigned int /*_index*/)
{
  gzerr << "Not implemented\n";
  return 0;
}

//////////////////////////////////////////////////
math::Vector3 SimbodyUniversalJoint::GetGlobalAxis(
    unsigned int _index) const
{
  if (this->simbodyPhysics &&
      this->simbodyPhysics->simbodyPhysicsStepped &&
      _index < this->GetAngleCount())
  {
    if (!this->mobod.isEmptyHandle())
    {
      if (_index == UniversalJoint::AXIS_PARENT)
      {
        // express X-axis of X_IF in world frame
        const SimTK::Transform &X_IF = this->mobod.getInboardFrame(
          this->simbodyPhysics->integ->getState());

        SimTK::Vec3 x_W(
          this->mobod.getParentMobilizedBody().expressVectorInGroundFrame(
          this->simbodyPhysics->integ->getState(), X_IF.x()));

        return SimbodyPhysics::Vec3ToVector3(x_W);
      }
      else if (_index == UniversalJoint::AXIS_CHILD)
      {
        // express Y-axis of X_OM in world frame
        const SimTK::Transform &X_OM = this->mobod.getOutboardFrame(
          this->simbodyPhysics->integ->getState());

        SimTK::Vec3 y_W(
          this->mobod.expressVectorInGroundFrame(
          this->simbodyPhysics->integ->getState(), X_OM.y()));

        return SimbodyPhysics::Vec3ToVector3(y_W);
      }
      else
      {
        gzerr << "GetGlobalAxis: internal error, GetAngleCount < 0.\n";
        return math::Vector3(SimTK::NaN, SimTK::NaN, SimTK::NaN);
      }
    }
    else
    {
      gzerr << "Joint mobod not initialized correctly.  Returning"
            << " initial axis vector in world frame (not valid if"
            << " joint frame has moved). Please file"
            << " a report on issue tracker.\n";
      return this->GetAxisFrame(_index).RotateVector(
        this->GetLocalAxis(_index));
    }
  }
  else
  {
    if (_index >= this->GetAngleCount())
    {
      gzerr << "index out of bound\n";
      return math::Vector3(SimTK::NaN, SimTK::NaN, SimTK::NaN);
    }
    else
    {
      gzdbg << "GetGlobalAxis() sibmody physics engine not yet initialized, "
            << "use local axis and initial pose to compute "
            << "global axis.\n";
      // if local axis specified in model frame (to be changed)
      // switch to code below if issue #494 is to be addressed
      return this->GetAxisFrame(_index).RotateVector(
        this->GetLocalAxis(_index));
    }
  }
}

//////////////////////////////////////////////////
math::Angle SimbodyUniversalJoint::GetAngleImpl(unsigned int _index) const
{
  if (_index < this->GetAngleCount())
  {
    if (this->physicsInitialized &&
        this->simbodyPhysics->simbodyPhysicsInitialized)
    {
      if (!this->mobod.isEmptyHandle())
      {
        return math::Angle(this->mobod.getOneQ(
          this->simbodyPhysics->integ->getState(), _index));
      }
      else
      {
        gzerr << "Joint mobod not initialized correctly.  Please file"
              << " a report on issue tracker.\n";
        return math::Angle(0.0);
      }
    }
    else
    {
      gzdbg << "GetAngleImpl(): simbody not yet initialized, "
            << "initial angle should be zero until <initial_angle> "
            << "is implemented.\n";
      return math::Angle(0.0);
    }
  }
  else
  {
    gzerr << "index out of bound\n";
    return math::Angle(SimTK::NaN);
  }
}


text:
A `checkThat()` metódus segítségével egy boolean típussal visszatérő feltételt tudok ellenőrizni. Ez hasznos tud például lenni akkor, amikor egy elem megjelenésének hatására valamilyen műveletet szeretnénk elvégezni. Nagyon fontos azonban, hogy a `checkThat()` nem várakozik. Ez a gyakorlatban azt jelenti, hogy amennyiben az ellenőrzés pillanatában még nem történt meg a változás, akkor hibás eredményt fogunk kapni.

```
public void click_send_message_button() {
    doWith(sendMessageButton).click();
    boolean msgDisplayed = checkThat(errorMessage).isDisplayed();
    if (msgDisplayed) {
        System.out.println("Error message is displayed");
    }
}
```

A fenti példánál látszik, hogy a `sendMessageButton` megnyomása után ellenőrizzük a felugró hibaüzenetet. Azonban ha az üzenet csak az ellenőrzés megtörténte után ugrik fel, akkor a feltétel nem teljesül. Ennek a problémának a kiküszöbölésére egy várakozó-ellenőrző metódus (`assume()`, `expect()`) használata kínál megoldást. Érdemes olyan feltételre várnunk, aminek teljesülése után a későbbi `checkThat` vizsgálat már biztosan elvégezhető.

```
public void click_send_message_button() {
    doWith(sendMessageButton).click();
    expectations().assume(resultPanel).toBe().displayed();
    boolean msgDisplayed = checkThat(errorMessage).isDisplayed();
    if (msgDisplayed) {
        System.out.println("Error message is displayed");
    }
}
```

Ebben az esetben a program az `expectations().assume(resultPanel).toBe().displayed()` sorban, előre definiált ideig várakozik. (Itt feltételezzük, hogy az `errorMessage` elem a `resultPanel` panelen jelenik meg.) Ha a feltétel teljesült, a következő `checkThat()` függvény is a helyes eredménnyel fog visszatérni. Amennyiben az `expectation()` kicsúszik a várakozási időből, a riportban hibaüzenet lesz látható.


text:
#include <aws/securityhub/model/AwsIamPolicyDetails.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::Utils::Json;
using namespace Aws::Utils;

namespace Aws
{
namespace SecurityHub
{
namespace Model
{

AwsIamPolicyDetails::AwsIamPolicyDetails() :
    m_attachmentCount(0),
    m_attachmentCountHasBeenSet(false),
    m_createDateHasBeenSet(false),
    m_defaultVersionIdHasBeenSet(false),
    m_descriptionHasBeenSet(false),
    m_isAttachable(false),
    m_isAttachableHasBeenSet(false),
    m_pathHasBeenSet(false),
    m_permissionsBoundaryUsageCount(0),
    m_permissionsBoundaryUsageCountHasBeenSet(false),
    m_policyIdHasBeenSet(false),
    m_policyNameHasBeenSet(false),
    m_policyVersionListHasBeenSet(false),
    m_updateDateHasBeenSet(false)
{
}

AwsIamPolicyDetails::AwsIamPolicyDetails(JsonView jsonValue) :
    m_attachmentCount(0),
    m_attachmentCountHasBeenSet(false),
    m_createDateHasBeenSet(false),
    m_defaultVersionIdHasBeenSet(false),
    m_descriptionHasBeenSet(false),
    m_isAttachable(false),
    m_isAttachableHasBeenSet(false),
    m_pathHasBeenSet(false),
    m_permissionsBoundaryUsageCount(0),
    m_permissionsBoundaryUsageCountHasBeenSet(false),
    m_policyIdHasBeenSet(false),
    m_policyNameHasBeenSet(false),
    m_policyVersionListHasBeenSet(false),
    m_updateDateHasBeenSet(false)
{
  *this = jsonValue;
}

AwsIamPolicyDetails& AwsIamPolicyDetails::operator =(JsonView jsonValue)
{
  if(jsonValue.ValueExists("AttachmentCount"))
  {
    m_attachmentCount = jsonValue.GetInteger("AttachmentCount");

    m_attachmentCountHasBeenSet = true;
  }

  if(jsonValue.ValueExists("CreateDate"))
  {
    m_createDate = jsonValue.GetString("CreateDate");

    m_createDateHasBeenSet = true;
  }

  if(jsonValue.ValueExists("DefaultVersionId"))
  {
    m_defaultVersionId = jsonValue.GetString("DefaultVersionId");

    m_defaultVersionIdHasBeenSet = true;
  }

  if(jsonValue.ValueExists("Description"))
  {
    m_description = jsonValue.GetString("Description");

    m_descriptionHasBeenSet = true;
  }

  if(jsonValue.ValueExists("IsAttachable"))
  {
    m_isAttachable = jsonValue.GetBool("IsAttachable");

    m_isAttachableHasBeenSet = true;
  }

  if(jsonValue.ValueExists("Path"))
  {
    m_path = jsonValue.GetString("Path");

    m_pathHasBeenSet = true;
  }

  if(jsonValue.ValueExists("PermissionsBoundaryUsageCount"))
  {
    m_permissionsBoundaryUsageCount = jsonValue.GetInteger("PermissionsBoundaryUsageCount");

    m_permissionsBoundaryUsageCountHasBeenSet = true;
  }

  if(jsonValue.ValueExists("PolicyId"))
  {
    m_policyId = jsonValue.GetString("PolicyId");

    m_policyIdHasBeenSet = true;
  }

  if(jsonValue.ValueExists("PolicyName"))
  {
    m_policyName = jsonValue.GetString("PolicyName");

    m_policyNameHasBeenSet = true;
  }

  if(jsonValue.ValueExists("PolicyVersionList"))
  {
    Array<JsonView> policyVersionListJsonList = jsonValue.GetArray("PolicyVersionList");
    for(unsigned policyVersionListIndex = 0; policyVersionListIndex < policyVersionListJsonList.GetLength(); ++policyVersionListIndex)
    {
      m_policyVersionList.push_back(policyVersionListJsonList[policyVersionListIndex].AsObject());
    }
    m_policyVersionListHasBeenSet = true;
  }

  if(jsonValue.ValueExists("UpdateDate"))
  {
    m_updateDate = jsonValue.GetString("UpdateDate");

    m_updateDateHasBeenSet = true;
  }

  return *this;
}

JsonValue AwsIamPolicyDetails::Jsonize() const
{
  JsonValue payload;

  if(m_attachmentCountHasBeenSet)
  {
   payload.WithInteger("AttachmentCount", m_attachmentCount);

  }

  if(m_createDateHasBeenSet)
  {
   payload.WithString("CreateDate", m_createDate);

  }

  if(m_defaultVersionIdHasBeenSet)
  {
   payload.WithString("DefaultVersionId", m_defaultVersionId);

  }

  if(m_descriptionHasBeenSet)
  {
   payload.WithString("Description", m_description);

  }

  if(m_isAttachableHasBeenSet)
  {
   payload.WithBool("IsAttachable", m_isAttachable);

  }

  if(m_pathHasBeenSet)
  {
   payload.WithString("Path", m_path);

  }

  if(m_permissionsBoundaryUsageCountHasBeenSet)
  {
   payload.WithInteger("PermissionsBoundaryUsageCount", m_permissionsBoundaryUsageCount);

  }

  if(m_policyIdHasBeenSet)
  {
   payload.WithString("PolicyId", m_policyId);

  }

  if(m_policyNameHasBeenSet)
  {
   payload.WithString("PolicyName", m_policyName);

  }

  if(m_policyVersionListHasBeenSet)
  {
   Array<JsonValue> policyVersionListJsonList(m_policyVersionList.size());
   for(unsigned policyVersionListIndex = 0; policyVersionListIndex < policyVersionListJsonList.GetLength(); ++policyVersionListIndex)
   {
     policyVersionListJsonList[policyVersionListIndex].AsObject(m_policyVersionList[policyVersionListIndex].Jsonize());
   }
   payload.WithArray("PolicyVersionList", std::move(policyVersionListJsonList));

  }

  if(m_updateDateHasBeenSet)
  {
   payload.WithString("UpdateDate", m_updateDate);

  }

  return payload;
}

} // namespace Model
} // namespace SecurityHub
} // namespace Aws


text:
/**
 * Bootstrap
 * (sails.config.bootstrap)
 *
 * An asynchronous bootstrap function that runs before your Sails app gets lifted.
 * This gives you an opportunity to set up your data model, run jobs, or perform some special logic.
 *
 * For more information on bootstrapping your app, check out:
 * http://sailsjs.org/#/documentation/reference/sails.config/sails.config.bootstrap.html
 */
var exec = require('child_process').exec;

module.exports.bootstrap = function(cb) {
  /*
   * Catch anything
   */
  process.on('uncaughtException', function (err) {
    // handle the error safely
    console.log(err);
  });

  /*
   * Look for processes that may have failed to be killed if server errored out
   */
  // exec('top', function(err, stdout, stderr) {
  //   // stdout is a string containing the output of the command.
  //   // parse it and look for the apache and mysql processes.
  // });
  /*
   * Start up video streams
   */
  Camera.find().exec(function (err, cameras) {
    cameras.forEach(function (camera) {
      if (camera.record) {
        Camera.initialize({
          id: camera.id
        }).then(function() {
          console.log('Camera fully initalized.')
        }).
        catch (function(err) {
          console.log('Failed to fully initalize camera.')
        });

        LiveService.stream(camera);
      }
    });
  });
  // It's very important to trigger this callback method when you are finished
  // with the bootstrap!  (otherwise your server will never lift, since it's waiting on the bootstrap)
  cb();
};


text:
package org.jkiss.dbeaver.core;

/**
 * Core module commands (some).
 */
public interface CoreCommands
{

    String CMD_LINK_EDITOR = "org.jkiss.dbeaver.core.navigator.linkeditor";

}


text:
Phine\Test\Exception

PropertyException
=================

Exception thrown for class property related errors.

Signature
---------

- It is a(n) **class**.
- It is a subclass of `Phine\Exception\Exception`.

Methods
-------

The class defines the following methods:

- [`notExist()`](#notExist) — Creates a new exception for a property that does not exist.

### `notExist()`

Creates a new exception for a property that does not exist.

#### Signature

- It is a **public static** method.
- It accepts the following parameter(s):
    - `$class` (`object`|`string`) — The class instance or name.
    - `$name` (`string`) — The name of the property.
- _Returns:_ A new exception.
    - [`PropertyException`](../../../Phine/Test/Exception/PropertyException.md)


text:
<?php

declare(strict_types=1);

namespace Sylius\Bundle\UiBundle\Twig;

use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;

/**
 * @internal
 * @experimental
 */
final class LegacySonataBlockExtension extends AbstractExtension
{
    /** @var array */
    private $whitelistedVariables;

    public function __construct(array $whitelistedVariables)
    {
        $this->whitelistedVariables = $whitelistedVariables;
    }

    public function getFunctions(): array
    {
        return [
            new TwigFunction('sonata_block_whitelisted_variables', [$this, 'getWhitelistedVariables']),
        ];
    }

    public function getWhitelistedVariables(): array
    {
        return $this->whitelistedVariables;
    }
}


text:
@interface ScannerViewController (SSSService) <SSSServiceDelegate>

- (void) sendCode :(NSString*) code;

@end


text:
package org.apache.geronimo.openwebbeans.deployment;

import java.io.InputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Member;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.jar.JarFile;
import java.util.zip.ZipEntry;

import javax.annotation.Resource;
import javax.ejb.EJB;
import javax.enterprise.inject.Produces;
import javax.persistence.PersistenceContext;
import javax.persistence.PersistenceUnit;

import org.apache.geronimo.common.DeploymentException;
import org.apache.geronimo.deployment.ModuleIDBuilder;
import org.apache.geronimo.deployment.service.EnvironmentBuilder;
import org.apache.geronimo.gbean.AbstractName;
import org.apache.geronimo.gbean.GBeanData;
import org.apache.geronimo.gbean.annotation.GBean;
import org.apache.geronimo.gbean.annotation.ParamAttribute;
import org.apache.geronimo.gbean.annotation.ParamReference;
import org.apache.geronimo.j2ee.annotation.Holder;
import org.apache.geronimo.j2ee.deployment.EARContext;
import org.apache.geronimo.j2ee.deployment.Module;
import org.apache.geronimo.j2ee.deployment.ModuleBuilderExtension;
import org.apache.geronimo.j2ee.deployment.NamingBuilder;
import org.apache.geronimo.j2ee.deployment.WebModule;
import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
import org.apache.geronimo.kernel.Naming;
import org.apache.geronimo.kernel.config.ConfigurationStore;
import org.apache.geronimo.kernel.repository.Environment;
import org.apache.geronimo.openwebbeans.OpenWebBeansWebAppContext;
import org.apache.geronimo.openwebbeans.OpenWebBeansWebModuleListener;
import org.apache.geronimo.openwebbeans.WebBeansConfigurationListener;
import org.apache.geronimo.web.WebApplicationConstants;
import org.apache.geronimo.web.info.WebAppInfo;
import org.apache.openejb.jee.WebApp;
import org.apache.xbean.finder.AbstractFinder;
import org.apache.xbean.finder.BundleAnnotationFinder;
import org.apache.xbean.finder.ClassFinder;
import org.apache.xbean.osgi.bundle.util.BundleResourceFinder;
import org.apache.xbean.osgi.bundle.util.BundleResourceFinder.ResourceFinderCallback;
import org.apache.xbean.osgi.bundle.util.DiscoveryRange;
import org.apache.xbean.osgi.bundle.util.ResourceDiscoveryFilter;
import org.apache.xmlbeans.XmlObject;
import org.osgi.framework.Bundle;
import org.osgi.framework.ServiceReference;
import org.osgi.service.packageadmin.PackageAdmin;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @version $Rev $Date
 */
@GBean(j2eeType = NameFactory.MODULE_BUILDER)
public class OpenWebBeansModuleBuilderExtension implements ModuleBuilderExtension {

    private static final Logger log = LoggerFactory.getLogger(OpenWebBeansModuleBuilderExtension.class);

    private final Environment defaultEnvironment;
    private final Environment jsfPluginEnvironment;
    //only plausible naming builder is ours that adds BeanManager entry
    private final NamingBuilder namingBuilders;

    //this is the geronimo copy
    private static final String CONTEXT_LISTENER_NAME = WebBeansConfigurationListener.class.getName();

    private static final String WEB_MODULE_LISTENER_NAME = OpenWebBeansWebModuleListener.class.getName();

    public OpenWebBeansModuleBuilderExtension(
            @ParamAttribute(name = "defaultEnvironment") Environment defaultEnvironment,
            @ParamAttribute(name = "jsfPluginEnvironment") Environment jsfPluginEnvironment,
            @ParamReference(name = "NamingBuilders", namingType = NameFactory.MODULE_BUILDER) NamingBuilder namingBuilders) {
        this.defaultEnvironment = defaultEnvironment;
        this.jsfPluginEnvironment = jsfPluginEnvironment;
        this.namingBuilders = namingBuilders;
    }

    public void createModule(Module module, Bundle bundle, Naming naming, ModuleIDBuilder idBuilder)
            throws DeploymentException {
        if (!(module instanceof WebModule)) {
            // not a web module, nothing to do
            return;
        }
        if(hasBeanXml(module)){
            EnvironmentBuilder.mergeEnvironments(module.getEnvironment(), defaultEnvironment);
            EnvironmentBuilder.mergeEnvironments(module.getEnvironment(), jsfPluginEnvironment);
        }
    }

    public void createModule(Module module, Object plan, JarFile moduleFile, String targetPath, URL specDDUrl,
            Environment environment, Object moduleContextInfo, AbstractName earName, Naming naming,
            ModuleIDBuilder idBuilder) throws DeploymentException {
        if (!(module instanceof WebModule)) {
            // not a web module, nothing to do
            return;
        }
        if(hasBeanXml(module)){
            EnvironmentBuilder.mergeEnvironments(module.getEnvironment(), defaultEnvironment);
            EnvironmentBuilder.mergeEnvironments(module.getEnvironment(), jsfPluginEnvironment);
        }
    }

    public void installModule(JarFile earFile, EARContext earContext, Module module, Collection configurationStores,
            ConfigurationStore targetConfigurationStore, Collection repository) throws DeploymentException {
    }

    public void initContext(EARContext earContext, Module module, Bundle bundle) throws DeploymentException {
    }

    public void addGBeans(EARContext earContext, Module module, Bundle bundle, Collection repository)
            throws DeploymentException {
        if (!(module instanceof WebModule)) {
            // not a web module, nothing to do
            return;
        }
        if (!hasBeansXml(bundle)) {
            return;
        }

        WebModule webModule = (WebModule) module;
        EARContext moduleContext = module.getEarContext();
        Map sharedContext = module.getSharedContext();

        GBeanData webAppData = (GBeanData) sharedContext.get(WebModule.WEB_APP_DATA);
        Map<String, Object> deploymentAttributes = (Map<String, Object>)webAppData.getAttribute("deploymentAttributes");
        List<String> webModuleListenerClassNames = (List<String>) deploymentAttributes.get(WebApplicationConstants.WEB_MODULE_LISTENERS);
        if (webModuleListenerClassNames == null) {
            webModuleListenerClassNames = new ArrayList<String>();
            deploymentAttributes.put(WebApplicationConstants.WEB_MODULE_LISTENERS, webModuleListenerClassNames);
        }
        webModuleListenerClassNames.add(WEB_MODULE_LISTENER_NAME);

        // add OpenWebBeans Lifcycle listener
        WebAppInfo webAppInfo = (WebAppInfo) webAppData.getAttribute("webAppInfo");
        if (webAppInfo != null && !webAppInfo.listeners.contains(CONTEXT_LISTENER_NAME)) {
            webAppInfo.listeners.add(0, CONTEXT_LISTENER_NAME);
        }
        AbstractName moduleName = module.getModuleName();
        Map<EARContext.Key, Object> buildingContext = new HashMap<EARContext.Key, Object>();
        buildingContext.put(NamingBuilder.GBEAN_NAME_KEY, moduleName);

        //use the same holder object as the web app.
        Holder holder = NamingBuilder.INJECTION_KEY.get(sharedContext);
        buildingContext.put(NamingBuilder.INJECTION_KEY, holder);

        WebApp webApp = webModule.getSpecDD();
        XmlObject geronimoWebApp = webModule.getVendorDD();

        AbstractFinder originalFinder = webModule.getClassFinder();
        ClassFinder classFinder = createOpenWebBeansClassFinder(webApp, webModule);
        webModule.setClassFinder(classFinder);
        namingBuilders.buildNaming(webApp, geronimoWebApp, webModule, buildingContext);
        webModule.setClassFinder(originalFinder);

        AbstractName openWebBeansWebAppContextGBeanName = moduleContext.getNaming().createChildName(moduleName, "OpenWebBeansWebAppContext", "OpenWebBeansWebAppContext");
        GBeanData openWebBeansWebAppContextGBean = new GBeanData(openWebBeansWebAppContextGBeanName, OpenWebBeansWebAppContext.class);
        try {
            openWebBeansWebAppContextGBean.setAttribute("holder", holder);
            AbstractName sharedOwbContextName = EARContext.APPINFO_GBEAN_NAME_KEY.get(earContext.getGeneralData());
            if (sharedOwbContextName != null) {
                openWebBeansWebAppContextGBean.setReferencePattern("SharedOwbContext", sharedOwbContextName);
            }
            moduleContext.addGBean(openWebBeansWebAppContextGBean);
            webAppData.addDependency(openWebBeansWebAppContextGBeanName);
        } catch (GBeanAlreadyExistsException e) {
            throw new DeploymentException("Duplicate webbean config gbean in web module", e);
        }
    }

    private boolean hasBeansXml(Bundle bundle) {
        return bundle.getEntry("WEB-INF/beans.xml") != null || bundle.getResource("META-INF/beans.xml") != null;
    }

    private boolean hasBeanXml(Module webModule) {
        return webModule.getDeployable().getResource("WEB-INF/beans.xml") != null || webModule.getDeployable().getResource("META-INF/beans.xml") != null;
    }

    protected ClassFinder createOpenWebBeansClassFinder(WebApp webApp, WebModule webModule)
        throws DeploymentException {
        List<Class<?>> classes = getManagedClasses(webApp, webModule);
        return new ClassFinder(classes);
    }

    private List<Class<?>> getManagedClasses(WebApp webApp, WebModule webModule) throws DeploymentException {

        // Technically a CDI jar can never be meta-data complete
        // But without this check we fail some EE TCK tests

        // It would seem we are scanning too much of the classpath in this method
        // we should only be scanning the jars that contain beans.xml files
        // Obviously, this conflicts with the Bundle concept somewhat

       /* if (webApp.isMetadataComplete()) return Collections.EMPTY_LIST;*/

        Bundle bundle = webModule.getEarContext().getDeploymentBundle();
        ServiceReference reference = bundle.getBundleContext().getServiceReference(PackageAdmin.class.getName());
        try {
            PackageAdmin packageAdmin = (PackageAdmin) bundle.getBundleContext().getService(reference);

            //1. Generated the jar file list, which contains META-INF/beans.xml file
            final Set<String> annotationScanRequiredJarFiles = new HashSet<String>();
            String moduleNamePrefix = webModule.isStandAlone() ? "" : webModule.getTargetPath() + "/";
            BundleResourceFinder resourceFinder = new BundleResourceFinder(packageAdmin, bundle, "META-INF/", "beans.xml", new ResourceDiscoveryFilter() {

                @Override
                public boolean directoryDiscoveryRequired(String directoryName) {
                    return false;
                }

                @Override
                public boolean rangeDiscoveryRequired(DiscoveryRange discoveryRange) {
                    return discoveryRange == DiscoveryRange.BUNDLE_CLASSPATH;
                }

                @Override
                public boolean zipFileDiscoveryRequired(String zipFileName) {
                    return zipFileName.endsWith(".jar");
                }

            });
            resourceFinder.find(new ResourceFinderCallback() {

                @Override
                public boolean foundInDirectory(Bundle arg0, String arg1, URL arg2) throws Exception {
                    return false;
                }

                @Override
                public boolean foundInJar(Bundle bundle, String zipFileName, ZipEntry zipEntry, InputStream in) throws Exception {
                    String zipEntryName = zipEntry.getName();
                    if (zipEntryName.equals("META-INF/beans.xml")) {
                        annotationScanRequiredJarFiles.add(zipFileName);
                    }
                    return true;
                }
            });

            final String webInfClassesFolder = moduleNamePrefix + "WEB-INF/classes/";
            final boolean webInfClassesScanRequired = bundle.getEntry(moduleNamePrefix + "WEB-INF/beans.xml") != null;

            //2. Scan annotations
            BundleAnnotationFinder bundleAnnotationFinder = new BundleAnnotationFinder(packageAdmin, bundle, new ResourceDiscoveryFilter() {

                @Override
                public boolean directoryDiscoveryRequired(String directory) {
                    return directory.equals(webInfClassesFolder) && webInfClassesScanRequired;
                }

                @Override
                public boolean rangeDiscoveryRequired(DiscoveryRange discoveryRange) {
                    return discoveryRange.equals(DiscoveryRange.BUNDLE_CLASSPATH);
                }

                @Override
                public boolean zipFileDiscoveryRequired(String jarFile) {
                    return annotationScanRequiredJarFiles.contains(jarFile);
                }
            });

            final List<Member> members = new ArrayList<Member>();

            final Class<? extends Annotation>[] annotation = new Class[]{
                    Produces.class,
                    EJB.class,
                    PersistenceContext.class,
                    PersistenceUnit.class,
                    Resource.class,
            };

            for (Class<? extends Annotation> annotationClass : annotation) {
                members.addAll(bundleAnnotationFinder.findAnnotatedMethods(annotationClass));
                members.addAll(bundleAnnotationFinder.findAnnotatedFields(annotationClass));

            }

            final Set<Class<?>> classes = new HashSet<Class<?>>();
            for (Member member : members) {
                classes.add(member.getDeclaringClass());
            }

            return new ArrayList<Class<?>>(classes);
        } catch (Exception e) {
            throw new DeploymentException("Fail to scan jsr299 annotations", e);
        } finally {
            bundle.getBundleContext().ungetService(reference);
        }
    }

}


text:
/**
 * Autogenerated by Avro
 *
 * DO NOT EDIT DIRECTLY
 */
package avro.gen;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class User extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"User\",\"namespace\":\"avro.gen\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"favorite_number\",\"type\":[\"int\",\"null\"]},{\"name\":\"favorite_color\",\"type\":[{\"type\":\"string\",\"avro.java.string\":\"String\"},\"null\"]}]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
  @Deprecated public java.lang.String name;
  @Deprecated public java.lang.Integer favorite_number;
  @Deprecated public java.lang.String favorite_color;

  /**
   * Default constructor.  Note that this does not initialize fields
   * to their default values from the schema.  If that is desired then
   * one should use newBuilder().
   */
  public User() {}

  /**
   * All-args constructor.
   */
  public User(java.lang.String name, java.lang.Integer favorite_number, java.lang.String favorite_color) {
    this.name = name;
    this.favorite_number = favorite_number;
    this.favorite_color = favorite_color;
  }

  public org.apache.avro.Schema getSchema() { return SCHEMA$; }
  // Used by DatumWriter.  Applications should not call.
  public java.lang.Object get(int field$) {
    switch (field$) {
    case 0: return name;
    case 1: return favorite_number;
    case 2: return favorite_color;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }
  // Used by DatumReader.  Applications should not call.
  @SuppressWarnings(value="unchecked")
  public void put(int field$, java.lang.Object value$) {
    switch (field$) {
    case 0: name = (java.lang.String)value$; break;
    case 1: favorite_number = (java.lang.Integer)value$; break;
    case 2: favorite_color = (java.lang.String)value$; break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  /**
   * Gets the value of the 'name' field.
   */
  public java.lang.String getName() {
    return name;
  }

  /**
   * Sets the value of the 'name' field.
   * @param value the value to set.
   */
  public void setName(java.lang.String value) {
    this.name = value;
  }

  /**
   * Gets the value of the 'favorite_number' field.
   */
  public java.lang.Integer getFavoriteNumber() {
    return favorite_number;
  }

  /**
   * Sets the value of the 'favorite_number' field.
   * @param value the value to set.
   */
  public void setFavoriteNumber(java.lang.Integer value) {
    this.favorite_number = value;
  }

  /**
   * Gets the value of the 'favorite_color' field.
   */
  public java.lang.String getFavoriteColor() {
    return favorite_color;
  }

  /**
   * Sets the value of the 'favorite_color' field.
   * @param value the value to set.
   */
  public void setFavoriteColor(java.lang.String value) {
    this.favorite_color = value;
  }

  /** Creates a new User RecordBuilder */
  public static avro.gen.User.Builder newBuilder() {
    return new avro.gen.User.Builder();
  }

  /** Creates a new User RecordBuilder by copying an existing Builder */
  public static avro.gen.User.Builder newBuilder(avro.gen.User.Builder other) {
    return new avro.gen.User.Builder(other);
  }

  /** Creates a new User RecordBuilder by copying an existing User instance */
  public static avro.gen.User.Builder newBuilder(avro.gen.User other) {
    return new avro.gen.User.Builder(other);
  }

  /**
   * RecordBuilder for User instances.
   */
  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<User>
    implements org.apache.avro.data.RecordBuilder<User> {

    private java.lang.String name;
    private java.lang.Integer favorite_number;
    private java.lang.String favorite_color;

    /** Creates a new Builder */
    private Builder() {
      super(avro.gen.User.SCHEMA$);
    }

    /** Creates a Builder by copying an existing Builder */
    private Builder(avro.gen.User.Builder other) {
      super(other);
      if (isValidValue(fields()[0], other.name)) {
        this.name = data().deepCopy(fields()[0].schema(), other.name);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.favorite_number)) {
        this.favorite_number = data().deepCopy(fields()[1].schema(), other.favorite_number);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.favorite_color)) {
        this.favorite_color = data().deepCopy(fields()[2].schema(), other.favorite_color);
        fieldSetFlags()[2] = true;
      }
    }

    /** Creates a Builder by copying an existing User instance */
    private Builder(avro.gen.User other) {
            super(avro.gen.User.SCHEMA$);
      if (isValidValue(fields()[0], other.name)) {
        this.name = data().deepCopy(fields()[0].schema(), other.name);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.favorite_number)) {
        this.favorite_number = data().deepCopy(fields()[1].schema(), other.favorite_number);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.favorite_color)) {
        this.favorite_color = data().deepCopy(fields()[2].schema(), other.favorite_color);
        fieldSetFlags()[2] = true;
      }
    }

    /** Gets the value of the 'name' field */
    public java.lang.String getName() {
      return name;
    }

    /** Sets the value of the 'name' field */
    public avro.gen.User.Builder setName(java.lang.String value) {
      validate(fields()[0], value);
      this.name = value;
      fieldSetFlags()[0] = true;
      return this;
    }

    /** Checks whether the 'name' field has been set */
    public boolean hasName() {
      return fieldSetFlags()[0];
    }

    /** Clears the value of the 'name' field */
    public avro.gen.User.Builder clearName() {
      name = null;
      fieldSetFlags()[0] = false;
      return this;
    }

    /** Gets the value of the 'favorite_number' field */
    public java.lang.Integer getFavoriteNumber() {
      return favorite_number;
    }

    /** Sets the value of the 'favorite_number' field */
    public avro.gen.User.Builder setFavoriteNumber(java.lang.Integer value) {
      validate(fields()[1], value);
      this.favorite_number = value;
      fieldSetFlags()[1] = true;
      return this;
    }

    /** Checks whether the 'favorite_number' field has been set */
    public boolean hasFavoriteNumber() {
      return fieldSetFlags()[1];
    }

    /** Clears the value of the 'favorite_number' field */
    public avro.gen.User.Builder clearFavoriteNumber() {
      favorite_number = null;
      fieldSetFlags()[1] = false;
      return this;
    }

    /** Gets the value of the 'favorite_color' field */
    public java.lang.String getFavoriteColor() {
      return favorite_color;
    }

    /** Sets the value of the 'favorite_color' field */
    public avro.gen.User.Builder setFavoriteColor(java.lang.String value) {
      validate(fields()[2], value);
      this.favorite_color = value;
      fieldSetFlags()[2] = true;
      return this;
    }

    /** Checks whether the 'favorite_color' field has been set */
    public boolean hasFavoriteColor() {
      return fieldSetFlags()[2];
    }

    /** Clears the value of the 'favorite_color' field */
    public avro.gen.User.Builder clearFavoriteColor() {
      favorite_color = null;
      fieldSetFlags()[2] = false;
      return this;
    }

    //@Override
    public User build() {
      try {
        User record = new User();
        record.name = fieldSetFlags()[0] ? this.name : (java.lang.String) defaultValue(fields()[0]);
        record.favorite_number = fieldSetFlags()[1] ? this.favorite_number : (java.lang.Integer) defaultValue(fields()[1]);
        record.favorite_color = fieldSetFlags()[2] ? this.favorite_color : (java.lang.String) defaultValue(fields()[2]);
        return record;
      } catch (Exception e) {
        throw new org.apache.avro.AvroRuntimeException(e);
      }
    }
  }
}


text:
<?php

namespace Gitsplit\EngineBundle\DependencyInjection;

use Elcodi\Bundle\CoreBundle\DependencyInjection\Abstracts\AbstractConfiguration;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\Config\Definition\ConfigurationInterface;

/**
 * Class Configuration
 *
 * @author Berny Cantos <be@rny.cc>
 */
class Configuration extends AbstractConfiguration implements ConfigurationInterface
{
    /**
     * Configure the root node
     *
     * @param ArrayNodeDefinition $rootNode
     */
    protected function setupTree(ArrayNodeDefinition $rootNode)
    {
        $rootNode
            ->children()
                ->arrayNode('mapping')
                    ->addDefaultsIfNotSet()
                    ->children()
                        ->append($this->addMappingNode(
                            'suite',
                            'Gitsplit\EngineBundle\Entity\Suite',
                            '@GitsplitEngineBundle/Resources/config/doctrine/Suite.orm.yml',
                            'default',
                            true
                        ))
                        ->append($this->addMappingNode(
                            'work',
                            'Gitsplit\EngineBundle\Entity\Work',
                            '@GitsplitEngineBundle/Resources/config/doctrine/Work.orm.yml',
                            'default',
                            true
                        ))
                    ->end()
                ->end()
            ->end()
        ;
    }
}


text:
package org.apache.druid.data.input;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

import javax.annotation.Nullable;
import java.util.Objects;

/**
 * {@link SplitHintSpec} for IngestSegmentFirehoseFactory.
 */
public class SegmentsSplitHintSpec implements SplitHintSpec
{
  public static final String TYPE = "segments";

  private static final long DEFAULT_MAX_INPUT_SEGMENT_BYTES_PER_TASK = 500 * 1024 * 1024;

  /**
   * Maximum number of bytes of input segments to process in a single task.
   * If a single segment is larger than this number, it will be processed by itself in a single task.
   */
  private final long maxInputSegmentBytesPerTask;

  @JsonCreator
  public SegmentsSplitHintSpec(
      @JsonProperty("maxInputSegmentBytesPerTask") @Nullable Long maxInputSegmentBytesPerTask
  )
  {
    this.maxInputSegmentBytesPerTask = maxInputSegmentBytesPerTask == null
                                       ? DEFAULT_MAX_INPUT_SEGMENT_BYTES_PER_TASK
                                       : maxInputSegmentBytesPerTask;
  }

  @JsonProperty
  public long getMaxInputSegmentBytesPerTask()
  {
    return maxInputSegmentBytesPerTask;
  }

  @Override
  public boolean equals(Object o)
  {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    SegmentsSplitHintSpec that = (SegmentsSplitHintSpec) o;
    return maxInputSegmentBytesPerTask == that.maxInputSegmentBytesPerTask;
  }

  @Override
  public int hashCode()
  {
    return Objects.hash(maxInputSegmentBytesPerTask);
  }

  @Override
  public String toString()
  {
    return "SegmentsSplitHintSpec{" +
           "maxInputSegmentBytesPerTask=" + maxInputSegmentBytesPerTask +
           '}';
  }
}


text:
package de.tapestry.productline;

import de.tapestry.productline.services.ProductIndicator;
import org.apache.tapestry5.ioc.services.ThreadLocale;
import org.apache.tapestry5.services.pageload.ComponentRequestSelectorAnalyzer;
import org.apache.tapestry5.services.pageload.ComponentResourceSelector;

import java.util.Locale;

/**
 * Determines the {@link org.apache.tapestry5.services.pageload.ComponentResourceSelector} by means
 * of the currently set product. The selected product (from a product line) is added as an
 * axis of the resource selector.
 */
public class ProductComponentRequestSelectorAnalyzer implements ComponentRequestSelectorAnalyzer {

	private final ThreadLocale threadLocale;

	private ProductIndicator productIndicator;

	public ProductComponentRequestSelectorAnalyzer(
            ThreadLocale threadLocale, ProductIndicator productIndicator) {

		this.threadLocale = threadLocale;
		this.productIndicator = productIndicator;
	}

	public ComponentResourceSelector buildSelectorForRequest() {

		Locale locale = threadLocale.getLocale();
		Product product = productIndicator.getProduct();

		return new ComponentResourceSelector(locale).withAxis(Product.class, product);
	}
}


text:
require 'spec_helper'

describe 'nova::network::flatdhcp' do

  describe 'with only required parameters' do
    let :params do
      {
        :flat_interface => 'eth1',
        :fixed_range    => '10.0.0.0/32'
      }
    end

    it { should contain_nova_config('DEFAULT/network_manager').with_value('nova.network.manager.FlatDHCPManager') }
    it { should_not contain_nova_config('DEFAULT/public_interface') }
    it { should contain_nova_config('DEFAULT/fixed_range').with_value('10.0.0.0/32') }
    it { should contain_nova_config('DEFAULT/flat_interface').with_value('eth1') }
    it { should contain_nova_config('DEFAULT/flat_interface').with_value('eth1') }
    it { should contain_nova_config('DEFAULT/flat_network_bridge').with_value('br100') }
    it { should contain_nova_config('DEFAULT/force_dhcp_release').with_value(true) }
    it { should contain_nova_config('DEFAULT/flat_injected').with_value(false) }
    it { should contain_nova_config('DEFAULT/dhcpbridge').with_value('/usr/bin/nova-dhcpbridge') }
    it { should contain_nova_config('DEFAULT/dhcpbridge_flagfile').with_value('/etc/nova/nova.conf') }
  end

  describe 'when overriding class parameters' do

    let :params do
      {
        :flat_interface => 'eth1',
        :fixed_range    => '10.0.0.0/32',
        :public_interface    => 'eth0',
        :flat_network_bridge => 'br1001',
        :force_dhcp_release  => false,
        :flat_injected       => true,
        :dhcpbridge          => '/usr/bin/dhcpbridge',
        :dhcpbridge_flagfile => '/etc/nova/nova-dhcp.conf'
      }
    end

    it { should contain_nova_config('DEFAULT/public_interface').with_value('eth0') }
    it { should contain_nova_config('DEFAULT/flat_network_bridge').with_value('br1001') }
    it { should contain_nova_config('DEFAULT/force_dhcp_release').with_value(false) }
    it { should contain_nova_config('DEFAULT/flat_injected').with_value(true) }
    it { should contain_nova_config('DEFAULT/dhcpbridge').with_value('/usr/bin/dhcpbridge') }
    it { should contain_nova_config('DEFAULT/dhcpbridge_flagfile').with_value('/etc/nova/nova-dhcp.conf') }

  end

end


text:
* Nmap or 'Network Mapper' is an open source tool for network exploration, port scanning and security auditing.
* Usage of nmap
    - Host Discovery: Detect the live host on a network.
    - Port Discovery or Enumeration: Detect the open ports on a host.
    - Service Discovery: Detect the software and the version to the respective port.
    - Information Gathering: Detect the operating system, hardware address, and the software version.
    - Nmap Scripts: Detect the vulnerability and security holes.
* The scanme.nmap.org is a service provided by the Nmap Security Scanner Project and Insecure.Org for testing.

### Common Examples
```shell
# Check Below
```

### Examples With Details
#### Target Specification
```shell

nmap <host-or-ip-address>                               # Scan a single host
nmap <host-or-ip-address> <host-or-ip-address> ...      # Scan a mutiple targets
nmap -v scanme.nmap.org                                 # Use -v or -vv for verbose output.
nmap -v 192.168.10-90                                   # Scan a range of IP addresses from 192.168.10 to 192.168.90
nmap -v 192.168.1.1/24                                  # Scan the entire subnet
nmap -v -iL /absolute/or/relative/path/to/target.txt    # Use -iL to take input from a list of hosts/network in a file.
nmap -v -iR 0 scanme.nmap.org                           # Use -iR <num hosts> to choose random targets. 0 for unlimited.
```

#### Host Discovery
```shell
nmap -Pn -v scanme.nmap.org                             # Use -Pn to treat all hosts as online and skip host discovery.
nmap -sn -v scanme.nmap.org                             # Use -sn to perform ping scan and disable port scan.
```

#### Scan Techniques
```shell
nmap -sS -v scanme.nmap.org                             # Use -sS/sT/sA/sW/sM for TCP SYN/Connect()/ACK/Window/Maimon
                                                        # scans.
nmap -sU -v scanme.nmap.org                             # Use -sU for UDP Scan.
```

#### Port Specification and Scan Order
```shell
nmap -p 22 -v scanme.nmap.org                           # Use -p to scan specified ports only. Scans port 22.
nmap -p 1-65535 -v scanme.nmap.org                      # Scans all ports from 1-65535
nmap -p U:53,111,T:21-25,80,8080,S:9 -v scanme.nmap.org # Scans UDP Ports 53 and 111, TCP Ports 21 to 25, 80 and 8080.
                                                        # TODO: S:9 for ?????
nmap -F -v scanme.nmap.org                              # Use -F for fast mode. This scans fewer ports than the default.
```

#### Service/Version Detection
```shell
```

#### Script Scan
```shell
```

#### OS Detection
```shell
nmap -A scanme.nmap.org                                 # Use -A to enable OS and version detection, script scanning,
                                                        # and traceroute.
```

#### Timing and Performance
```shell
nmap -A -T4 scanme.nmap.org                             # Use -T4 for faster execution
```

#### Firewall/IDS Evasion and Spoofing
```shell
```

#### Output
```shell
nmap -A -T4 -v scanme.nmap.org                          # Use -v or -vv to increase verbosity level.
nmap -A -T4 -v scanme.nmap.org -oA scan.output          # Use -oA to output in the three major formats at once, namely,
                                                        # 1. scan.output.nmap
                                                        # 2. scan.output.gnmap
                                                        # 3. scan.output.xml
```

#### Miscellanous
```shell
```

### Cool Tricks
* None

### TODO
* [Read More](https://hackertarget.com/nmap-tutorial/)


text:
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**start_time** | **Float** | The start time in seconds of the fragment from the input audio | [optional]
**variants** | [**Array<FragmentVariant>**](FragmentVariant.md) | An array of FragmentVariants | [optional]
**end_time** | **Float** | The end time in seconds of the fragment from the input audio | [optional]


text:
package org.apache.geode.internal.cache.tier.sockets;

import static org.junit.Assert.*;

import java.util.Iterator;

import org.apache.geode.test.junit.categories.ClientSubscriptionTest;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import org.apache.geode.cache.Region;
import org.apache.geode.cache.client.Pool;
import org.apache.geode.cache.client.PoolFactory;
import org.apache.geode.cache.client.PoolManager;
import org.apache.geode.cache.client.internal.PoolImpl;
import org.apache.geode.cache.server.CacheServer;
import org.apache.geode.internal.cache.PoolFactoryImpl;
import org.apache.geode.test.dunit.Assert;
import org.apache.geode.test.dunit.Host;
import org.apache.geode.test.dunit.NetworkUtils;
import org.apache.geode.test.dunit.VM;
import org.apache.geode.test.dunit.Wait;
import org.apache.geode.test.dunit.WaitCriterion;
import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
import org.apache.geode.test.junit.categories.DistributedTest;

/**
 * Test Scenario :
 *
 * one server two clients create Entries in all vms c1 : register (k1,k2,k3,k4,k5) c2 : put (k1 ->
 * vm2-key-1) and (k6 -> vm2-key-6) c1 : validate (r.getEntry("key-1").getValue() == "vm2-key-1")
 * (r.getEntry("key-6").getValue() == "key-6") // as it is not registered s1 : stop server c2 : put
 * (k1 -> vm2-key-1) and (k6 -> vm2-key-6) c1 : validate (r.getEntry("key-1").getValue() ==
 * "vm2-key-1") (r.getEntry("key-6").getValue() == "key-6") // as it is not registered *
 */
@Category({DistributedTest.class, ClientSubscriptionTest.class})
public class InterestListFailoverDUnitTest extends JUnit4DistributedTestCase {

  private static final String REGION_NAME =
      InterestListFailoverDUnitTest.class.getSimpleName() + "_region";

  VM vm0 = null;

  VM vm1 = null;

  VM vm2 = null;

  VM vm3 = null;

  private int PORT1;
  private int PORT2;

  @Override
  public final void postSetUp() throws Exception {
    disconnectAllFromDS();
    final Host host = Host.getHost(0);
    vm0 = host.getVM(0);
    vm1 = host.getVM(1);
    vm2 = host.getVM(2);
    vm3 = host.getVM(3);

  }

  public void createServersAndClients(int redundancyLevel) {
    final Host host = Host.getHost(0);
    // start servers first
    PORT1 = ((Integer) vm0
        .invoke(() -> CacheServerTestUtil.createCacheServer(REGION_NAME, new Boolean(true))))
            .intValue();

    PORT2 = ((Integer) vm3
        .invoke(() -> CacheServerTestUtil.createCacheServer(REGION_NAME, new Boolean(true))))
            .intValue();

    vm1.invoke(() -> CacheServerTestUtil.disableShufflingOfEndpoints());
    vm2.invoke(() -> CacheServerTestUtil.disableShufflingOfEndpoints());
    vm1.invoke(() -> CacheServerTestUtil.createCacheClient(
        getClientPool(NetworkUtils.getServerHostName(host), redundancyLevel), REGION_NAME));
    vm2.invoke(() -> CacheServerTestUtil
        .createCacheClient(getClientPool(NetworkUtils.getServerHostName(host), 0), REGION_NAME));
  }

  /**
   * one server two clients create Entries in all vms c1 : register (k1,k2,k3,k4,k5) c2 : put (k1 ->
   * vm2-key-1) and (k6 -> vm2-key-6) c1 : validate (r.getEntry("key-1").getValue() == "vm2-key-1")
   * (r.getEntry("key-6").getValue() == "key-6") // as it is not registered s1 : stop server s1 :
   * start server c2 : put (k1 -> vm2-key-1) and (k6 -> vm2-key-6) c1 : validate
   * (r.getEntry("key-1").getValue() == "vm2-key-1") (r.getEntry("key-6").getValue() == "key-6") //
   * as it is not registered
   *
   */

  @Test
  public void testInterestListRecoveryHA() {
    doTestInterestListRecovery(-1);
  }

  @Test
  public void testInterestListRecoveryNonHA() {
    doTestInterestListRecovery(0);
  }

  public void doTestInterestListRecovery(int redundancyLevel) {
    createServersAndClients(redundancyLevel);
    vm1.invoke(() -> InterestListFailoverDUnitTest.createEntries());
    vm2.invoke(() -> InterestListFailoverDUnitTest.createEntries());
    vm0.invoke(() -> InterestListFailoverDUnitTest.createEntries());
    Integer primaryPort =
        (Integer) vm1.invoke(() -> InterestListFailoverDUnitTest.registerInterestList());
    VM primaryVM;
    if (primaryPort.intValue() == PORT1) {
      primaryVM = vm0;
    } else {
      primaryVM = vm3;
    }
    vm2.invoke(() -> InterestListFailoverDUnitTest.putA());
    // pause(10000);
    vm1.invoke(() -> InterestListFailoverDUnitTest.validateEntriesA());
    primaryVM.invoke(() -> InterestListFailoverDUnitTest.stopServer());
    // pause(10000);
    vm2.invoke(() -> InterestListFailoverDUnitTest.putB());
    // (10000);
    vm1.invoke(() -> InterestListFailoverDUnitTest.validateEntriesB());
  }

  public static void createEntries() {
    try {
      Region r = CacheServerTestUtil.getCache().getRegion("/" + REGION_NAME);
      assertNotNull(r);

      if (!r.containsKey("key-1")) {
        r.create("key-1", "key-1");
      }
      if (!r.containsKey("key-6")) {
        r.create("key-6", "key-6");
      }
      // Verify that no invalidates occurred to this region
      assertEquals(r.getEntry("key-1").getValue(), "key-1");
      assertEquals(r.getEntry("key-6").getValue(), "key-6");
    } catch (Exception ex) {
      Assert.fail("failed while createEntries()", ex);
    }
  }

  public static void verifyEntries() {
    try {
      Region r = CacheServerTestUtil.getCache().getRegion("/" + REGION_NAME);
      assertNotNull(r);
      if (r.getEntry("key-1") != null) {
        assertEquals(r.getEntry("key-1").getValue(), "key-1");
      }
      if (r.getEntry("key-6") != null) {
        assertEquals(r.getEntry("key-6").getValue(), "key-6");
      }
    } catch (Exception ex) {
      Assert.fail("failed while createEntries()", ex);
    }
  }

  public static Integer registerInterestList() {
    try {
      Region r = CacheServerTestUtil.getCache().getRegion("/" + REGION_NAME);
      assertNotNull(r);
      r.registerInterest("key-1");
      r.registerInterest("key-2");
      r.registerInterest("key-3");
      r.registerInterest("key-4");
      r.registerInterest("key-5");
      // now return the port of the primary.
      PoolImpl p = (PoolImpl) PoolManager.find(r.getAttributes().getPoolName());
      return new Integer(p.getPrimaryPort());
    } catch (Exception ex) {
      Assert.fail("failed while registering keys k1 to k5", ex);
      return null;
    }
  }

  public static void stopServer() {
    try {
      Iterator iter = CacheServerTestUtil.getCache().getCacheServers().iterator();
      if (iter.hasNext()) {
        CacheServer server = (CacheServer) iter.next();
        server.stop();
      }
    } catch (Exception e) {
      fail("failed while stopServer()" + e);
    }
  }

  private Pool getClientPool(String host, int redundancyLevel) {
    PoolFactory pf = PoolManager.createFactory();
    pf.addServer(host, PORT1).addServer(host, PORT2).setSubscriptionEnabled(true)
        // round robin?
        .setReadTimeout(500).setSocketBufferSize(32768)
        // retryAttempts 5
        // retryInterval 1000
        .setMinConnections(4).setSubscriptionRedundancy(redundancyLevel);
    return ((PoolFactoryImpl) pf).getPoolAttributes();
  }

  public static void _put(String v) {
    try {
      Region r = CacheServerTestUtil.getCache().getRegion("/" + REGION_NAME);
      assertNotNull(r);
      r.put("key-1", "vm2-key-1" + v);
      r.put("key-6", "vm2-key-6" + v);
      // Verify that no invalidates occurred to this region
      assertEquals(r.getEntry("key-1").getValue(), "vm2-key-1" + v);
      assertEquals(r.getEntry("key-6").getValue(), "vm2-key-6" + v);
    } catch (Exception ex) {
      Assert.fail("failed while r.put()", ex);
    }
  }

  public static void putA() {
    _put("A");
  }

  public static void putB() {
    _put("B");
  }

  public static void validateEntriesA() {
    _validateEntries("A");
  }

  public static void validateEntriesB() {
    _validateEntries("B");
  }

  public static void _validateEntries(final String v) {
    try {
      final Region r = CacheServerTestUtil.getCache().getRegion("/" + REGION_NAME);
      final String key1 = "key-1";
      assertNotNull(r);
      // Verify that 'key-1' was updated
      // assertIndexDetailsEquals("vm2-key-1", r.getEntry("key-1").getValue());
      WaitCriterion wc = new WaitCriterion() {
        String excuse;

        public boolean done() {
          Object val = r.get(key1);
          if (val == null) {
            return false;
          }
          if (!val.equals("vm2-key-1" + v)) {
            return false;
          }
          return true;
        }

        public String description() {
          return excuse;
        }
      };
      Wait.waitForCriterion(wc, 40 * 1000, 1000, true);

      // Verify that 'key-6' was not invalidated
      assertEquals("key-6", r.getEntry("key-6").getValue());
    } catch (Exception ex) {
      Assert.fail("failed while r.put()", ex);
    }
  }

  @Override
  public final void preTearDown() throws Exception {
    closeAll();
  }

  public void closeAll() {
    // close the clients first
    vm1.invoke(() -> CacheServerTestUtil.closeCache());
    vm2.invoke(() -> CacheServerTestUtil.closeCache());
    // then close the servers
    vm0.invoke(() -> CacheServerTestUtil.closeCache());
    vm3.invoke(() -> CacheServerTestUtil.closeCache());
    CacheServerTestUtil.closeCache();
  }

}


text:
<?php echo \core\error::display($error); ?>
<form action="" method="POST" role="form">
<input type="text" name="username" value="" placeholder="Username">
<input type="password" name="password" value="" placeholder="Password">
<input type="submit" name="submit" value="Login">
</form>


text:
    Consumer Key *
    <input required="true" type="text" name="consumerKey" class="raml-console-sidebar-input raml-console-sidebar-security-field" ng-model="credentials.consumerKey" ng-change="onChange()"/>

    Consumer Secret *
    <input required="true" type="password" name="consumerSecret" class="raml-console-sidebar-input raml-console-sidebar-security-field" ng-model="credentials.consumerSecret" ng-change="onChange()"/>


text:
<?php
namespace App\Controllers\Gxadmin;

use Area,City,College,School,Province,Grade,User,UserProfile,ProfileField,Teacher,Student,Sclass,Ktest;
use Input, Notification, Redirect, Sentry, Str,DB;

use App\Services\Validators\GradeValidator;
use App\Services\Ktest\Cryptographer;
use App\Services\Ktest\HesClient;

class GradesController extends \BaseController {

	/**
	 * Show the form for creating a new resource.
	 * GET /gxadmin/gxadmin/create
	 *
	 * @return Response
	 */
	public function create()
	{
		//

	}
    /**
	 * Show the form for creating a new resource.
	 * GET /gxadmin/gxadmin/create
	 *
	 * @return Response
	 */
	public function index()
	{
		//
		$loggeduser=\App::make('authenticator')->getLoggedUser();
		$authentication = \App::make('authenticator');
		  if($loggeduser)
      {

		if (array_key_exists('_mschool',$loggeduser->permissions)){

		$teacher=Teacher::whereRaw("user_id = '$loggeduser->id'")->first();
		$grades=Grade::where('tid', '=',$teacher->id)->get();
		$niandu=Grade::distinct()->lists('niandu');
		$banji=Sclass::distinct()->lists('classname');
		$teachers=Teacher::where('mschoolid','=',$teacher->mschoolid)->get();
		return \View::make('gxadmin.grades.index')->with('grades',$grades)
		                                          ->with('niandu',$niandu);

		}
		else {
			return "您没有权限,请询问管理员";
		}
		}
		  else {
		  		$logged='not login';
		   	return \View::make('users.login');
		  }
	}
	/**
	 * Show the form for creating a new resource.
	 * GET /gxadmin/gxadmin/create
	 *
	 * @return Response
	 */
	public function students()
	{
		//
		return "students";

	}
	/**
	 * Store a newly created resource in storage.
	 * POST /gxadmin/gxadmin
	 *
	 * @return Response
	 */
/**
	 * Store a newly created resource in storage.
	 * POST /gxadmin/gxadmin
	 *
	 * @return Response
	 */
	public function store()
	{
		//

$validation = new GradeValidator;
if ($validation->passes())
{
$loggeduser=\App::make('authenticator')->getLoggedUser();
$teacher=Teacher::whereRaw("user_id = '$loggeduser->id'")->first();
$grade =new Grade;
$grade->gradename = Input::get('gradename');
$grade->tid=$teacher->id;
$grade->stucount = Input::get('stucount');
$grade->niandu = Input::get('niandu');
$grade->save();

//var_dump(Input::get('classname'));
Notification::success('新增年级成功!');
return Redirect::route('gxadmin.grades.index');
}
return Redirect::back()->withInput()->withErrors($validation->errors);
}
	/**
	 * Display the specified resource.
	 * GET /gxadmin/gxadmin/{id}
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function show($id)
	{
		//
	}

	/**
	 * Show the form for editing the specified resource.
	 * GET /gxadmin/gxadmin/{id}/edit
	 *
	 * @param  int  $id
	 * @return Response
	 */
		public function edit($id)
	{
		//
		return \View::make('gxadmin.grades.edit')->with('grades', Grade::find($id));

	}

    /**
	 * 处理excel 数据 the form for editing the specified resource.
	 *
	 *
	 * @param  int  $id
	 * @return Response
	 */
		public function excel()
	{
		//
		$file = Input::file('file'); // your file upload input field in the form should be named 'file'

$destinationPath = 'uploads/';
$filename = $file->getClientOriginalName();
//$extension =$file->getClientOriginalExtension(); //if you need extension of the file
$uploadSuccess = Input::file('file')->move($destinationPath, $filename);
$file=$destinationPath . $filename;
if( $uploadSuccess ) {
    \Excel::load($file, function($reader) {

    // Getting all results
    $results = $reader->get();

    // ->all() is a wrapper for ->get() and will work the same
    $results = $reader->all();
	$uploadstudents=$reader->select(array('stuno', 'stuname','classname','emailaddress'))->get();
	   foreach($uploadstudents as $row)
        {
            $student =new Student;
$student->stuname = $row->stuname;
$student->stuno = $row->stuno;
$student->classname = $row->classname;
$student->emailaddress = $row->emailaddress;
$student->save();   }
});
Notification::success('批量新增学生成功!');
return Redirect::route('gxadmin.students.index');
} else {
   return Response::json('error', 400);
}

	}
	/**
	 * Update the specified resource in storage.
	 * PUT /gxadmin/gxadmin/{id}
	 *
	 * @param  int  $id
	 * @return Response
	 */
public function update($id)
{
		//
$validation = new GradeValidator;
if ($validation->passes())
{
	$loggeduser=\App::make('authenticator')->getLoggedUser();
		$loginteacher = array_search('teacher', $loggeduser->permissions);
        $authentication = \App::make('authenticator');
$grade =Grade::find($id);
$grade->niandu = Input::get('niandu');
$grade->gradename = Input::get('gradename');
$grade->stucount = Input::get('stucount');
$grade->save();
//var_dump(Input::get('classname'));
Notification::success('更新年级成功!');
return Redirect::route('gxadmin.grades.edit', $grade->id);
}
return Redirect::back()->withInput()->withErrors($validation->errors);
	}

	/**
	 * Remove the specified resource from storage.
	 * DELETE /gxadmin/gxadmin/{id}
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function destroy($id)
	{

		$grade =Grade::find($id);
$grade->delete();
Notification::success('删除成功!');
return Redirect::route('gxadmin.grades.index');
	}

}


text:
[![Build status](https://ci.appveyor.com/api/projects/status/pctn05u3iowjbkgf?svg=true)](https://ci.appveyor.com/project/NimaAra/easy-compression)

# Easy Compression
A super fast and efficient compression library.
___

## Details Coming soon...

* NuGet at: https://www.nuget.org/packages/Easy.Compression/


text:
package io.github.opencubicchunks.cubicchunks.core.asm.mixin.core.common;

import io.github.opencubicchunks.cubicchunks.api.world.ICubicWorld;
import mcp.MethodsReturnNonnullByDefault;
import net.minecraft.entity.Entity;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

import javax.annotation.ParametersAreNonnullByDefault;

@MethodsReturnNonnullByDefault
@ParametersAreNonnullByDefault
@Mixin(Entity.class)
public class MixinEntity_DeathFix {

    @Shadow public World world;

    /**
     * Replace -64 constant, to avoid killing entities below y=-64
     */
    @ModifyConstant(method = "onEntityUpdate", constant = @Constant(doubleValue = -64.0D), require = 1)
    private double getDeathY(double originalY) {
        return ((ICubicWorld) world).getMinHeight() + originalY;
    }
}


text:
<!DOCTYPE html>

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

/**
 * @class Ext.chart.series.Cartesian
 * @extends Ext.chart.series.Series
 *
 * Common base class for series implementations which plot values using x/y coordinates.
 */
Ext.define('Ext.chart.series.Cartesian', {

    /* Begin Definitions */

    extend: 'Ext.chart.series.Series',

    alternateClassName: ['Ext.chart.CartesianSeries', 'Ext.chart.CartesianChart'],

    /* End Definitions */

    /**
     * The field used to access the x axis value from the items from the data
     * source.
     *
     * @cfg xField
     * @type String
     */
    xField: null,

    /**
     * The field used to access the y-axis value from the items from the data
     * source.
     *
     * @cfg yField
     * @type String
     */
    yField: null,

    /**
     * @cfg {String} axis
     * The position of the axis to bind the values to. Possible values are 'left', 'bottom', 'top' and 'right'.
     * You must explicitly set this value to bind the values of the line series to the ones in the axis, otherwise a
     * relative scale will be used.
     */
    axis: 'left',

    getLegendLabels: function() {
        var me = this,
            labels = [],
            combinations = me.combinations;

        Ext.each([].concat(me.yField), function(yField, i) {
            var title = me.title;
            // Use the 'title' config if present, otherwise use the raw yField name
            labels.push((Ext.isArray(title) ? title[i] : title) || yField);
        });

        // Handle yFields combined via legend drag-drop
        if (combinations) {
            Ext.each(combinations, function(combo) {
                var label0 = labels[combo[0]],
                    label1 = labels[combo[1]];
                labels[combo[1]] = label0 + ' & ' + label1;
                labels.splice(combo[0], 1);
            });
        }

        return labels;
    },

    /**
     * @protected Iterates over a given record's values for each of this series's yFields,
     * executing a given function for each value. Any yFields that have been combined
     * via legend drag-drop will be treated as a single value.
     * @param {Ext.data.Model} record
     * @param {Function} fn
     * @param {Object} scope
     */
    eachYValue: function(record, fn, scope) {
        Ext.each(this.getYValueAccessors(), function(accessor, i) {
            fn.call(scope, accessor(record), i);
        });
    },

    /**
     * @protected Returns the number of yField values, taking into account fields combined
     * via legend drag-drop.
     * @return {Number}
     */
    getYValueCount: function() {
        return this.getYValueAccessors().length;
    },

    combine: function(index1, index2) {
        var me = this,
            accessors = me.getYValueAccessors(),
            accessor1 = accessors[index1],
            accessor2 = accessors[index2];

        // Combine the yValue accessors for the two indexes into a single accessor that returns their sum
        accessors[index2] = function(record) {
            return accessor1(record) + accessor2(record);
        };
        accessors.splice(index1, 1);

        me.callParent([index1, index2]);
    },

    clearCombinations: function() {
        // Clear combined accessors, they'll get regenerated on next call to getYValueAccessors
        delete this.yValueAccessors;
        this.callParent();
    },

    /**
     * @protected Returns an array of functions, each of which returns the value of the yField
     * corresponding to function's index in the array, for a given record (each function takes the
     * record as its only argument.) If yFields have been combined by the user via legend drag-drop,
     * this list of accessors will be kept in sync with those combinations.
     * @return {Array} array of accessor functions
     */
    getYValueAccessors: function() {
        var me = this,
            accessors = me.yValueAccessors;
        if (!accessors) {
            accessors = me.yValueAccessors = [];
            Ext.each([].concat(me.yField), function(yField) {
                accessors.push(function(record) {
                    return record.get(yField);
                });
            });
        }
        return accessors;
    },

    /**
     * Calculate the min and max values for this series's xField.
     * @return {Array} [min, max]
     */
    getMinMaxXValues: function() {
        var me = this,
            min, max,
            xField = me.xField;

        if (me.getRecordCount() > 0) {
            min = Infinity;
            max = -min;
            me.eachRecord(function(record) {
                var xValue = record.get(xField);
                if (xValue > max) {
                    max = xValue;
                }
                if (xValue < min) {
                    min = xValue;
                }
            });
        } else {
            min = max = 0;
        }
        return [min, max];
    },

    /**
     * Calculate the min and max values for this series's yField(s). Takes into account yField
     * combinations, exclusions, and stacking.
     * @return {Array} [min, max]
     */
    getMinMaxYValues: function() {
        var me = this,
            stacked = me.stacked,
            min, max,
            positiveTotal, negativeTotal;

        function eachYValueStacked(yValue, i) {
            if (!me.isExcluded(i)) {
                if (yValue < 0) {
                    negativeTotal += yValue;
                } else {
                    positiveTotal += yValue;
                }
            }
        }

        function eachYValue(yValue, i) {
            if (!me.isExcluded(i)) {
                if (yValue > max) {
                    max = yValue;
                }
                if (yValue < min) {
                    min = yValue;
                }
            }
        }

        if (me.getRecordCount() > 0) {
            min = Infinity;
            max = -min;
            me.eachRecord(function(record) {
                if (stacked) {
                    positiveTotal = 0;
                    negativeTotal = 0;
                    me.eachYValue(record, eachYValueStacked);
                    if (positiveTotal > max) {
                        max = positiveTotal;
                    }
                    if (negativeTotal < min) {
                        min = negativeTotal;
                    }
                } else {
                    me.eachYValue(record, eachYValue);
                }
            });
        } else {
            min = max = 0;
        }
        return [min, max];
    },

    getAxesForXAndYFields: function() {
        var me = this,
            axes = me.chart.axes,
            axis = [].concat(me.axis),
            xAxis, yAxis;

        if (Ext.Array.indexOf(axis, 'top') > -1) {
            xAxis = 'top';
        } else if (Ext.Array.indexOf(axis, 'bottom') > -1) {
            xAxis = 'bottom';
        } else {
            if (axes.get('top')) {
                xAxis = 'top';
            } else if (axes.get('bottom')) {
                xAxis = 'bottom';
            }
        }

        if (Ext.Array.indexOf(axis, 'left') > -1) {
            yAxis = 'left';
        } else if (Ext.Array.indexOf(axis, 'right') > -1) {
            yAxis = 'right';
        } else {
            if (axes.get('left')) {
                yAxis = 'left';
            } else if (axes.get('right')) {
                yAxis = 'right';
            }
        }

        return {
            xAxis: xAxis,
            yAxis: yAxis
        };
    }

});