text:
package co.gobd.tracker.service.account;

import co.gobd.tracker.callback.ConnectionCallback;

/**
 * Created by fahad on 29-Mar-16.
 */
public interface LoginCallback extends ConnectionCallback {

    void onLoginSuccess(String accessToken, String refreshToken, String bearer);

    void onLoginFailure();

}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<toolspec model="0.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="src/main/resources/toolspec.xsd">
    <id>copy</id>
    <name>Copy</name>
    <homepage>http://en.wikipedia.org/wiki/Cp_%28Unix%29</homepage>
    <version>1.0</version>
    <installation>
        <os type="linux">
            Available by default.
        </os>
        <os type="windows">
            Use "CMD.exe /C COPY" instead of "/bin/cp" in the commands defined below.
        </os>
    </installation>
    <services>
        <service sid="1" name="Extract features" type="migrate" contextpathprefix="/wscapeservices" servicepackage="eu.scape_project.pc.services">
            <description>Service for feature extraction from image files</description>
            <operations>
                <operation oid="1" name="extractFeatures">
                    <description>Extracts image file features</description>
                    <command>extractfeatures.bat ${input} ${output}</command>
                    <inputs>
                        <input name="input">
                            <Datatype>xsd:anyURI</Datatype>
                            <Required>true</Required>
                            <Default>http://localhost:8080/testbild1.jpg</Default>
                            <CliMapping>input</CliMapping>
                            <Documentation>URL reference to input file</Documentation>
                        </input>
                    </inputs>
                    <outputs>
                        <output name="output">
                            <Datatype>xsd:anyURI</Datatype>
                            <CliMapping>output</CliMapping>
                            <Required>false</Required>
                            <Default>http://localhost:8080/testbild1.xml</Default>
                            <Documentation>URL reference to output file</Documentation>
                            <PrefixFromInput>input</PrefixFromInput>
                            <Extension>xml</Extension>
                        </output>
                    </outputs>
                </operation>
                <operation oid="2" name="compare">
                    <description>Compares image file features</description>
                    <command>compare.bat ${input1} ${input2} ${output}</command>
                    <inputs>
                        <input name="input1">
                            <Datatype>xsd:anyURI</Datatype>
                            <Required>true</Required>
                            <Default>http://localhost:8080/testbild1.xml</Default>
                            <CliMapping>input1</CliMapping>
                            <Documentation>URL reference to input file</Documentation>
                        </input>
                        <input name="input2">
                            <Datatype>xsd:anyURI</Datatype>
                            <Required>true</Required>
                            <Default>http://localhost:8080/testbild1c.xml</Default>
                            <CliMapping>input2</CliMapping>
                            <Documentation>URL reference to input file</Documentation>
                        </input>
                    </inputs>
                    <outputs>
                        <output name="output">
                            <Datatype>xsd:anyURI</Datatype>
                            <CliMapping>output</CliMapping>
                            <Required>false</Required>
                            <Documentation>URL reference to output file</Documentation>
                            <PrefixFromInput>input1</PrefixFromInput>
                            <Extension>xml</Extension>
                        </output>
                    </outputs>
                </operation>
            </operations>
            <deployto>
                <deployref default="true" ref="local"/>
            </deployto>
        </service>
    </services>
    <deployments>
        <deployment id="local">
            <identifier>http://localhost:8080/scape/instances/tomcat1</identifier>
            <host>localhost</host>
            <ports>
                <port type="http">8080</port>
                <port type="https">8043</port>
            </ports>
            <manager>
                <user>tomcat</user>
                <password>tomcat</password>
		        <path>manager</path>
            </manager>
            <dataexchange>
                <accessdir>../webapps/ROOT/scape/tmp/</accessdir>
                <accessurl>http://localhost:8080/scape/tmp/</accessurl>
            </dataexchange>
        </deployment>
    </deployments>
</toolspec>


text:
var protoQuery = require('./protoQuery'),
	Condition = require('./Condition'),
	_ = require('lodash');

var QueryUpdate = function(table, colNames, row) {
	this._table = table;

	colNames = this._splitIfText(colNames);
	this._validateNames(table);
	this._validateNames(colNames);
	this._colNames = colNames;

	var rowFeatures = this._examineRows(row, colNames);
	if (!rowFeatures.singleRow)  throw new Error('Only a single row is accepted for update statement');
	this._rowAsArr = rowFeatures.rowAsArr;
	this._row = row;
};

QueryUpdate.prototype = {

	text: function(offset) {
		return this.build(offset).text;
	},

	params: function(offset) {
		return this.build(offset).params;
	},

	build: function(offset) {
		var row = this._row,
			colNames = this._colNames,
			colLen = colNames.length;
		offset = _.isUndefined(offset) ? 1 : offset + 1;

		var result = {
			text: 'UPDATE mytable SET ',
			params: this._extractRow(row, colNames)
		};

		result.text += _.map(colNames, function(colName) { return colName + ' = :' + (offset++); }).join(', ') + ' ';

		result = this._buildWhere(result);

		return result;
	},

	where: function(/*var args*/) {
		this._where = Condition.prototype.construct(arguments);
		this._activeCond = '_where';
		return this;
	},

	and: function(/*var args*/) {
		var c = this[this._activeCond];
		c.and.apply(c, arguments);
	},

	or: function(/*var args*/) {
		var c = this[this._activeCond];
		c.or.apply(c, arguments);
	},

	_buildWhere: function(result) {
		if (this._where) {
			var add = this._where.build(result.params.length);
			result.text += 'WHERE ' + add.text + ' ';
			_.each(add.params, function(par) { result.params.push(par); });
		}
		return result;
	},

	_splitIfText: protoQuery._splitIfText,

	_validateNames: protoQuery._validateNames,

	_examineRows: protoQuery._examineRows,

	_extractRow: protoQuery._extractRow

};

module.exports = QueryUpdate;


text:
/************************************************************/
/*    NAME: Mike Bogochow, Jeff Masucci, Cody Noel          */
/*    ORGN: UNH                                             */
/*    FILE: ARDUINOComm.h                                   */
/*    DATE: March 2014                                      */
/************************************************************/
/* This is an implementation of IMOOSComm for communicating */
/* with an Arduino.                                         */
/************************************************************/

#include "ArduinoComm.h"

#include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h>
#include <sstream>
#include <string.h>

#include <termios.h>

using namespace std;

ArduinoComm::ArduinoComm(const char *portName, int baudRate,
  const char *delimiter)
  : serialPortName(portName)
  , baudRate(baudRate)
  , delim(delimiter)
{
}

ArduinoComm::~ArduinoComm()
{
  close(serialFD);
}

/**
 * Open serial port with Arduino.
 * Based on arduino-serial.c by todbot
 * (https://github.com/todbot/arduino-serial)
 *
 * @return true on successful open of the serial port
 *         false if opening the serial port or getting/setting attributes failed
 */
bool ArduinoComm::openComm()
{
  struct termios options;
  speed_t baud = baudRate;

  serialFD = open(serialPortName, O_RDWR | O_NONBLOCK);
  if (serialFD < 0)
  {
    //MOOSTrace("Error opening serial (%s): %s\n", serialPortName,
    //  strerror(errno));
    return false;
  }

  if (tcgetattr(serialFD, &options) < 0)
  {
    //MOOSTrace("Failed to get terminal settings: %s\n", strerror(errno));
    return false;
  }

  switch (baudRate)
  {
    case 4800:   baud=B4800;   break;
    case 9600:   baud=B9600;   break;
#ifdef B14400
    case 14400:  baud=B14400;  break;
#endif
    case 19200:  baud=B19200;  break;
#ifdef B28800
    case 28800:  baud=B28800;  break;
#endif
    case 38400:  baud=B38400;  break;
    case 57600:  baud=B57600;  break;
    case 115200: baud=B115200; break;
  }

  cfsetispeed(&options, baud);
  cfsetospeed(&options, baud);

  // 8N1
  options.c_cflag &= ~PARENB;
  options.c_cflag &= ~CSTOPB;
  options.c_cflag &= ~CSIZE;
  options.c_cflag |= CS8;
  options.c_cflag &= ~CRTSCTS;  // no flow control
  options.c_cflag |= CREAD | CLOCAL;  // turn on READ & ignore ctrl lines
  options.c_cflag &= ~HUPCL; // disable hang-up-on-close to avoid reset (doesn't seem to work on BBB)
  options.c_iflag &= ~(IXON | IXOFF | IXANY); // turn off s/w flow ctrl
  options.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG); // make raw
  options.c_oflag &= ~OPOST; // make raw
  options.c_cc[VMIN]  = 0;
  options.c_cc[VTIME] = 0;
  //toptions.c_cc[VTIME] = 20;

  tcsetattr(serialFD, TCSANOW, &options);
  if (tcsetattr(serialFD, TCSAFLUSH, &options) < 0)
  {
    //MOOSTrace("Failed to set terminal settings: %s\n", strerror(errno));
    return false;
  }

  return true;
}

bool ArduinoComm::writeMsg(const char *name, double value)
{
  ostringstream ss;
  ss << value;
  return writeMsg(name, ss.str().c_str());
}

bool ArduinoComm::writeMsg(const char *name, const char *value)
{
  ostringstream ss;
  ss << name << '=' << value << delim;

  const char *msg = ss.str().c_str(); // Full message to sendi
  size_t msgLen = strlen(msg);        // Length of message we are sending
  ssize_t nBytes;                     // Actual number of bytes written

  // Check if we can write, return if not since we don't want to block
/*  struct pollfd mpollfd = { .fd = fd, .events = POLLOUT };
  MOOSTrace("POLL: %i\n", poll(&mpollfd, 1, 0));
  if (!(poll(&mpollfd, 1, 0) > 0))
    return MOOSFail("Stream is not ready for writing");*/

  // Write to our FIFO
  nBytes = write(serialFD, msg, msgLen);
  if (nBytes < 0)
    return false; // "Error writing to frontseat"

  return true;
}

int ArduinoComm::readMsg(char *buffer, int bufferLen)
{
  return read(serialFD, buffer, bufferLen);
}


text:
namespace Melas.Messages
{
    public abstract class ServerMessage
    {
        public abstract byte ID { get; }
        public abstract void Deserialize(ByteReader Data);
    }
}


text:
(function ($) {
    $.fn.listview = function (items) {

        var $this = $(this),
            templateID = $this.attr('data-template'),
            templateHTML = $('#' + templateID).html(),
            template = Handlebars.compile(templateHTML);

        $this.append(template(items));
    };

    var books = [
            { id: 1, title: 'JavaScript: The good parts' },
            { id: 2, title: 'Secrets of the JavaScript Ninja' },
            { id: 3, title: 'Core HTML5 Canvas: Graphics, Animation, and Game Development' },
            { id: 4, title: 'JavaScript Patterns' },
    ],
    students = [
        { name: 'Petar Petrov', mark: 5.5, number: 1 },
        { name: 'Stamat Georgiev', mark: 4.7, number: 2 },
        { name: 'Maria Todorova', mark: 6, number: 3 },
        { name: 'Georgi Geshov', mark: 3.7, number: 4 },
    ];

    $('#books-list').listview({ books: books });
    $('#students-table').listview({ students: students });
}(jQuery));


text:
.userbar-btn {
    float: right;
    clear: both;
    width: 220px;
    font-size: 12px;
    visibility: visible !important;
    position: relative;
    z-index: 2;
}
.userbar-btn .userbar-btn-item {
    float: right;
    margin-right: 1px;
    background: #00ad73;
    height: 18px;
    line-height: 20px;
    padding: 0 7px 0 2px;
    color: #fff;
    border: 1px solid #009e69;
    text-decoration: none;
    width: 9px;
    overflow: hidden;
    white-space: nowrap;
    -moz-border-radius: 2px;
    -webkit-border-radius: 2px;
    -o-border-radius: 2px;
    border-radius: 2px;
    transition: width .4s ease;
    -webkit-transition: width .4s ease;
    -moz-transition: width .4s ease;
    cursor: pointer;
}
/*.userbar-btn a#setHome {
    width: auto;
}*/
body .userbar-btn .userbar-btn_click {
    background-position: 0 -578px;
}
.userbar-btn i {
    width: 19px;
    height: 18px;
    display: inline-block;
    float: left;
}
.userbar-btn span {
    display: inline-block;
    line-height: 18px;
    overflow: hidden;
    *overflow: inherit;
}

.userbar-btn .userbar-sethome {
    background: url(../img/i-sethome-new.png?__sprite) no-repeat;
}
.userbar-btn .userbar-addfav {
    background: url(../img/i-addfav-new.png?__sprite) no-repeat;
}
.userbar-btn .userbar-down {
    background: url(../img/i-down-new.png?__sprite) no-repeat;
}
/*.userbar-btn .userbar-btn_click .userbar-sethome {
    background: url(../img/i-sethome-click.png) no-repeat;
}
.userbar-btn .userbar-btn_click .userbar-addfav {
    background: url(../img/i-addfav-click.png) no-repeat;
}
.userbar-btn .userbar-btn_click .userbar-down {
    background: url(../img/i-down-click.png) no-repeat;
}*/

body .mod-ff-sethome2 {
    z-index: 402;
    right: 4px;
    top: 24px;
    padding-top: 8px;
    width: 180px;
}
body .mod-ff-sethome2 .ui-bubble_in, body .mod-ff-sethome2 .ui-bubble_out {
    left: auto;
    right: 36px;
}
.mod-ff-sethome2 .ui-bubble_close {
    position: absolute;
    left: auto;
    right: 0;
    margin-right: 0;
    margin-left: -10px;
}


text:
SHELL := /bin/bash
PYTHON = python3

# for reproducible builds
export LC_ALL             := C
export TZ                 := UTC
ifndef ELEC_APK_USE_CURRENT_TIME
    export SOURCE_DATE_EPOCH  := $(shell git log -1 --pretty=%ct)
else
    # p4a sets "private_version" based on SOURCE_DATE_EPOCH. "private_version" gets compiled into the apk,
    # and is used at runtime to decide whether the already extracted project files in the app's datadir need updating.
    # So, "private_version" needs to be reproducible, but it would be useful during development if it changed
    # between subsequent builds (otherwise the new code won't be unpacked and used at runtime!).
    # For this reason, for development purposes, we set SOURCE_DATE_EPOCH here to the current time.
    # see https://github.com/kivy/python-for-android/blob/e8686e2104a553f05959cdaf7dd26867671fc8e6/pythonforandroid/bootstraps/common/build/build.py#L575-L587
    export SOURCE_DATE_EPOCH  := $(shell date +%s)
endif
export PYTHONHASHSEED     := $(SOURCE_DATE_EPOCH)
export BUILD_DATE         := $(shell LC_ALL=C TZ=UTC date +'%b %e %Y' -d @$(SOURCE_DATE_EPOCH))
export BUILD_TIME         := $(shell LC_ALL=C TZ=UTC date +'%H:%M:%S' -d @$(SOURCE_DATE_EPOCH))

# needs kivy installed or in PYTHONPATH

.PHONY: theming apk clean

theming:
	#bash -c 'for i in network lightning; do convert -background none theming/light/$i.{svg,png}; done'
	$(PYTHON) -m kivy.atlas ../../electrum/gui/kivy/theming/atlas/light 1024 ../../electrum/gui/kivy/theming/light/*.png
prepare:
	# running pre build setup
	# copy electrum to main.py
	@cp buildozer_$(ELEC_APK_GUI).spec ../../buildozer.spec
	@cp ../../run_electrum ../../main.py
	@-if [ ! -d "../../.buildozer" ];then \
		cd ../..; buildozer android debug;\
		cp -f blacklist.txt .buildozer/android/platform/python-for-android/src/blacklist.txt;\
		rm -rf ./.buildozer/android/platform/python-for-android/dist;\
	fi
apk:
	@make prepare
	@-cd ../..; buildozer android debug
	@make clean
release:
	@make prepare
	@-cd ../..; buildozer android release
	@make clean
clean:
	# Cleaning up
	# rename main.py to electrum
	@-rm ../../main.py
	# remove buildozer.spec
	@-rm ../../buildozer.spec


text:
function output = findFiles(root_folder_path,varargin)
%
%   sl.code.findFiles(root_folder_path,varargin)
%
%   Inputs
%   ------
%   root_folder_path :
%
%   Optional Inputs
%   ---------------
%   replace_with : string NOT YET IMPLEMENTED
%   use_regex : logical (default false) NOT YET IMPLEMENTED
%   named :
%   containing :
%   file_types : string or cellstr ( default {'*.m'} )
%       All values should start with a leading '*' character
%   include_subfolders : logical (default true)
%
%   Improvements
%   ------------
%   1) build in support for understanding code & comments
%   2) allow switching use of strfind vs regex

%{

root_folder_path = 'C:\repos\matlab_git\matlab_NEURON';
sl.code.findFiles(root_folder_path);

root_folder_path = 'C:\repos\matlab_git\matlab_NEURON';
sl.code.findFiles(root_folder_path,'named','g*');

root_folder_path = 'C:\repos\matlab_git\matlab_NEURON';
output = sl.code.findFiles(root_folder_path,'containing','sl.');

root_folder_path = 'C:\repos\matlab_git\matlab_NEURON\matlab_code\+NEURON\+sl'
output = sl.code.findFiles(root_folder_path,'containing','sl.');
output.replaceMatches('NEURON.sl.')

output = sl.code.findFiles(root_folder_path,'containing','NEURON.NEURON');
output.replaceMatches('NEURON')

output = sl.code.findFiles(root_folder_path,'containing',' handle_light');
output.replaceMatches(' NEURON.sl.obj.handle_light')

output = sl.code.findFiles(root_folder_path,'containing','= processVarargin');
output.replaceMatches(' NEURON.sl.in.processVarargin')

output = sl.code.findFiles(root_folder_path,'containing','in  NEURON.sl.in.processVarargin(in,varargin)');
output.replaceMatches('in = NEURON.sl.in.processVarargin(in,varargin)')

%}

in.replace_with = ''; %NYI
in.use_regex = false; %NYI
in.named = '';
in.containing = ''; %If in.regex, this is regex and not a simple string to match
in.file_types = {'*.m'};
in.include_subfolders = true; %DONE
in = sl.in.processVarargin(in,varargin);

all_extensions = in.file_types;
if ischar(all_extensions)
    all_extensions = {all_extensions};
end

%1) Get files to process
%-----------------------
%TODO: It would be nice if we could search for all of these at once
all_file_paths = {};
for iExtension = 1:length(all_extensions)
    current_extension = all_extensions{iExtension};
    if current_extension(1) ~= '*'
        error('All extensions should start with a leading *')
    end
    file_paths = sl.dir.getList(root_folder_path,...
        'output_type','paths', ...
        'search_type','files',...
        'recursive',in.include_subfolders,...
        'extension',current_extension(2:end),... %Remove the *
        'file_pattern',in.named);
    all_file_paths = [all_file_paths file_paths]; %#ok<AGROW>
end

%TODO: Build in support for ending early

%TODO: Build in expansion support on overflow ...
cur_index = 0;
r_file_paths = cell(1,1000); %r => result
r_context_text = cell(1,1000);
r_I = zeros(1,1000);

%2) Filter on containing (TODO: Check if this is requested)
%----------------------------------------------------------
n_chars_forward_grab = length(in.containing) + 20;
for iFile = 1:length(all_file_paths)
   cur_file_path = all_file_paths{iFile};
   text = sl.io.fileRead(cur_file_path,'*char');

   %TODO: Also support regexp here as well
   I = strfind(text,in.containing);

   for iMatch = 1:length(I)
      cur_I = I(iMatch);
      cur_index = cur_index + 1;
      r_file_paths{cur_index} = cur_file_path;
      try
          r_context_text{cur_index} = text(cur_I-10:cur_I+n_chars_forward_grab);
      catch

          r_context_text{cur_index} = in.containing;
      end
      r_I(cur_index) = cur_I;
   end
end
%find_files_result(in,file_paths,I)
output = sl.code.find_files_result(in,root_folder_path,...
    r_file_paths(1:cur_index),...
    r_I(1:cur_index),r_context_text(1:cur_index));

end


text:
module Toast

  java_import "jaci.openrio.toast.core.Environment"
  java_import "jaci.openrio.toast.core.StateTracker"
  java_import "jaci.openrio.toast.lib.state.StateListener"
  java_import "jaci.openrio.toast.core.thread.Heartbeat"
  java_import "jaci.openrio.toast.core.thread.HeartbeatListener"
  java_import "jaci.openrio.toast.core.thread.ToastThreadPool"
  java_import "jaci.openrio.toast.lib.state.LoadPhase"

  module WPI
    include_package "edu.wpi.first.wpilibj"
  end

  class Controller < WPI::Joystick
  end

  class DigitalInput < WPI::DigitalInput
  end

  class DigitalOutput < WPI::DigitalOutput
  end

  class Encoder < WPI::Encoder
  end

  def self.shutdown method=:safe
    if method == :crash
      TOAST_.shutdownCrash
    else
      TOAST_.shutdownSafely
    end
  end

  def self.station
    TOAST_.station
  end

  def self.taste
    TOAST_.getRandomTaste
  end

  def self.tick filter=:all, &block
    StateTracker.addTicker StateListener::Ticker.impl { |method, tickstate|
      state = tickstate.to_s.downcase.to_sym
      if filter == :all || filter == state
        block.call state
      end
    }
  end

  def self.transition filter=:all, &block
    StateTracker.addTransition StateListener::Transition.impl { |method, tickstate, oldstate|
      state = tickstate.to_s.downcase.to_sym
      old = oldstate.to_s.downcase.to_sym
      if filter == :all || filter == state
        block.call state, old
      end
    }
  end

  def self.loadphase &block
    LoadPhase.addCallback java.util.function.Function.impl { |method, phase|
      block.call phase.to_s.downcase.to_sym
      java.lang.Void
    }
  end

  def self.start &block
    loadphase {
      if phase == :start
        block.call
      end
    }
  end

  def self.heartbeat &block
    Heartbeat.add HeartbeatListener.impl { |method, skipped|
      block.call skipped
    }
  end

  # Ambiguity~~
  class ToastThreadPool
    java_alias :submit, :addWorker, [java.util.concurrent.Callable.java_class]
  end
  def self.go &block
    ToastThreadPool.INSTANCE.submit {
      block.call
    }
  end

  def self.FMS?
     Environment.isCompetition
  end

  def self.simulation?
    Environment.isSimulation
  end

  def self.verification?
    Environment.isVerification
  end

  def self.embedded?
    Environment.isEmbedded
  end

end


text:
package com.bentech.android.appcommons.constants.alert;

/**
 * Created by Daniel on 20/11/2015.
 */
public abstract class AlertLevel {

    public static AlertLevel INFO = new InfoAlertLevel();
    public static AlertLevel WARN = new WarnAlertLevel();
    public static AlertLevel ERROR = new ErrorAlertLevel();
    public static AlertLevel SUCCESS = new SuccessAlertLevel();

    protected int bgColor;
    protected int fgColor;

    AlertLevel(int bgColor, int fgColor) {
        this.bgColor = bgColor;
        this.fgColor = fgColor;
    }

    public int getBgColor() {
        return bgColor;
    }

    public void setBgColor(int bgColor) {
        this.bgColor = bgColor;
    }

    public int getFgColor() {
        return fgColor;
    }

    public void setFgColor(int fgColor) {
        this.fgColor = fgColor;
    }
}


text:
'use strict';
module.exports = {
  // use transforms which does not use ES5+ builtins
  plugins: [
    ['@babel/proposal-class-static-block'],
    // private instance props in IE8- only with polyfills
    ['@babel/proposal-class-properties'],
    ['@babel/proposal-private-methods'],
    ['@babel/proposal-private-property-in-object'],
    ['@babel/proposal-logical-assignment-operators'],
    ['@babel/proposal-nullish-coalescing-operator'],
    ['@babel/proposal-numeric-separator'],
    ['@babel/proposal-object-rest-spread'],
    ['@babel/proposal-optional-catch-binding'],
    ['@babel/proposal-optional-chaining'],
    ['@babel/transform-member-expression-literals'],
    ['@babel/transform-property-literals'],
    ['@babel/transform-arrow-functions'],
    ['@babel/transform-block-scoped-functions'],
    ['@babel/transform-block-scoping'],
    // it seems `setClassMethods` unlike `loose` does not work
    ['@babel/transform-classes', { loose: true }],
    ['@babel/transform-computed-properties'],
    ['@babel/transform-destructuring'],
    ['@babel/transform-exponentiation-operator'],
    ['@babel/transform-for-of'],
    ['@babel/transform-literals'],
    ['@babel/transform-new-target'],
    ['@babel/transform-object-super'],
    ['@babel/transform-parameters'],
    ['@babel/transform-reserved-words'],
    ['@babel/transform-shorthand-properties'],
    ['@babel/transform-spread'],
    ['@babel/transform-template-literals'],
    ['@babel/transform-unicode-regex'],
    // use it instead of webpack es modules for support engines without descriptors
    ['@babel/transform-modules-commonjs'],
  ],
  assumptions: {
    constantReexports: true,
    constantSuper: true,
    enumerableModuleMeta: true,
    iterableIsArray: true,
    mutableTemplateObject: true,
    noClassCalls: true,
    noDocumentAll: true,
    noIncompleteNsImportDetection: true,
    noNewArrows: true,
    objectRestNoSymbols: true,
    privateFieldsAsProperties: true,
    setClassMethods: true,
    setComputedProperties: true,
    setPublicClassFields: true,
    setSpreadProperties: true,
    skipForOfIteratorClosing: true,
    superIsCallableConstructor: true,
  },
};


text:
<?php
// #Execute Payment Sample
// This is the second step required to complete
// PayPal checkout. Once user completes the payment, paypal
// redirects the browser to "redirectUrl" provided in the request.
// This sample will show you how to execute the payment
// that has been approved by
// the buyer by logging into paypal site.
// You can optionally update transaction
// information by passing in one or more transactions.
// API used: POST '/v1/payments/payment/<payment-id>/execute'.

require __DIR__ . '/../bootstrap.php';
use PayPal\Api\Amount;
use PayPal\Api\Details;
use PayPal\Api\ExecutePayment;
use PayPal\Api\Payment;
use PayPal\Api\PaymentExecution;
use PayPal\Api\Transaction;

// ### Approval Status
// Determine if the user approved the payment or not
if (isset($_GET['success']) && $_GET['success'] == 'true') {

    // Get the payment Object by passing paymentId
    // payment id was previously stored in session in
    // CreatePaymentUsingPayPal.php
    $paymentId = $_GET['paymentId'];
    $payment = Payment::get($paymentId, $apiContext);

    // ### Payment Execute
    // PaymentExecution object includes information necessary
    // to execute a PayPal account payment.
    // The payer_id is added to the request query parameters
    // when the user is redirected from paypal back to your site
    $execution = new PaymentExecution();
    $execution->setPayerId($_GET['PayerID']);

    // ### Optional Changes to Amount
    // If you wish to update the amount that you wish to charge the customer,
    // based on the shipping address or any other reason, you could
    // do that by passing the transaction object with just `amount` field in it.
    // Here is the example on how we changed the shipping to $1 more than before.
    $transaction = new Transaction();
    $amount = new Amount();
    $details = new Details();

    $details->setShipping(2.2)
        ->setTax(1.3)
        ->setSubtotal(17.50);

    $amount->setCurrency('USD');
    $amount->setTotal(21);
    $amount->setDetails($details);
    $transaction->setAmount($amount);

    // Add the above transaction object inside our Execution object.
    $execution->addTransaction($transaction);

    try {
        // Execute the payment
        // (See bootstrap.php for more on `ApiContext`)
        $result = $payment->execute($execution, $apiContext);

        // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
        ResultPrinter::printResult("Executed Payment", "Payment", $payment->getId(), $execution, $result);

        try {
            $payment = Payment::get($paymentId, $apiContext);
        } catch (Exception $ex) {
            // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
            ResultPrinter::printError("Get Payment", "Payment", null, null, $ex);
            exit(1);
        }
    } catch (Exception $ex) {
        // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
        ResultPrinter::printError("Executed Payment", "Payment", null, null, $ex);
        exit(1);
    }

    // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
    ResultPrinter::printResult("Get Payment", "Payment", $payment->getId(), null, $payment);

    return $payment;
} else {
    // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
    ResultPrinter::printResult("User Cancelled the Approval", null);
    exit;
}


text:
module TableGo
  module Helpers

    def table_go_for(collection, model_klass, options = {}, &block)
      capture do
        if request && request.format.csv?
          TableGo.render_csv(collection, model_klass, self, options, &block).html_safe
        else
          TableGo.render_html(collection, model_klass, self, options, &block)
        end
      end
    end

    def table_rows_for(collection, model_klass, options = {}, &block)
      table_go_for(collection, model_klass, options.merge(:render_rows_only => true), &block)
    end

  end
end


text:
import App from './App';
import CreateOrEditContactPage from './CreateOrEditContactPage';
import ListContactPage from './ListContactPage';
import ContactPage from './ContactPage';

export {
  App,
  CreateOrEditContactPage,
  ListContactPage,
  ContactPage,
}


text:
Write a function which takes a retangular grid of numbers, in array form, as an input. The goal of this function is to find the length of the longest non-decreasing sequence through adjacent, non-repeating cells (including diagonals). This function should accept a rectangular grid of arbitrary width and height.

For example, in the following grid, one legal path (though not the longest) that could be traced is 0->3->7->9 and its length would be 4.

```
[[8, 2, 4]
,[0, 7, 1]
,[3, 7, 9]]
```

The path can only connect adjacent locations (you could not connect 8 -> 9). The longest possible sequence for this example would be of length 6 by tracing the path 0->2->4->7->7->9 or 1->2->4->7->7->9.

To clarify:
```javascript
function longestSequence(grid) {
  return 0;
}

// Returns 6 as the longest sequence length
longestSequence(
    [[8,2,4]
    ,[0,7,1]
    ,[3,7,9]]
);
```


text:
CoreDispatch is a simple wrapper around GCD.

## Installation

CoreDispatch is available on [CocoaPods](http://cocoapods.org). Just add the following to your project Podfile:

```ruby
pod 'CoreDispatch'
```

## Usage

Use it as follows:

```objective-c
#import <CoreDispatch/CoreDispatch.h>
 ```

## License

CoreDispatch is released under a MIT License. See LICENSE file for details.


text:
require 'ey-core/test_helpers/account_helpers'
require 'ey-core/test_helpers/alert_helpers'
require 'ey-core/test_helpers/client_helpers'
require 'ey-core/test_helpers/resource_helpers'
require 'ey-core/test_helpers/auto_scaling_helpers'

module Ey
  module Core
    module TestHelpers
      include AccountHelpers
      include AlertHelpers
      include ClientHelpers
      include ResourceHelpers
      include AutoScalingHelpers
    end
  end
end


text:
package com.vxml.tag;

import org.w3c.dom.Node;

public class AudioTag extends AbstractTag {

	public AudioTag(Node node) {
		super(node);
	}

	@Override
	public void execute() {
		String source = getAttribute("src");
		try {
		    //Not running as a thread
		    //new AePlayWave(source).run();
		    System.out.println("Audio Tag...." + source);
		}
		catch (Exception e) {
		    e.printStackTrace();
		}
	}

}


text:
date: 2016-03-15T09:00:00+00:00
title: "Jaxenter on Vamp Microservics platform"
publishdate: 2016-03-15
---
*Amsterdam, 15 March 2016*

Founder Olaf Molenveld spoke to Java-focused publication Jaxenter on Vamp as a microservices platform and why
Vamp is not strictly for microservices only.

Read the full article on [jaxenter.de](https://jaxenter.de/very-awesome-microservices-platform-36375)

<!--more-->


text:
using DXDemos.Office365.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;

namespace DXDemos.Office365.Controllers
{
    public class PowerBIController : ApiController
    {
        [HttpGet]
        public async Task<List<PowerBIDataset>> GetDatasets()
        {
            return await PowerBIModel.GetDatasets();
        }

        [HttpGet]
        public async Task<PowerBIDataset> GetDataset(Guid id)
        {
            return await PowerBIModel.GetDataset(id);
        }

        [HttpPost]
        public async Task<Guid> CreateDataset(PowerBIDataset dataset)
        {
            return await PowerBIModel.CreateDataset(dataset);
        }

        [HttpDelete]
        public async Task<bool> DeleteDataset(Guid id)
        {
            //DELETE IS UNSUPPORTED
            return await PowerBIModel.DeleteDataset(id);
        }

        [HttpPost]
        public async Task<bool> ClearTable(PowerBITableRef tableRef)
        {
            return await PowerBIModel.ClearTable(tableRef.datasetId, tableRef.tableName);
        }

        [HttpPost]
        public async Task<bool> AddTableRows(PowerBITableRows rows)
        {
            return await PowerBIModel.AddTableRows(rows.datasetId, rows.tableName, rows.rows);
        }
    }
}


text:
@interface APBAlertView () <UIAlertViewDelegate>
@property (nonatomic, copy) void (^confirmationHandler)(NSInteger otherButtonIndex);
@property (nonatomic, copy) void (^cancelHandler)(void);
@end

@implementation APBAlertView

- (instancetype)initWithTitle:(NSString *)title
                      message:(NSString *)message
            cancelButtonTitle:(NSString *)cancelButtonTitle
            otherButtonTitles:(NSArray *)otherButtonTitles
                cancelHandler:(void (^)(void))cancelHandler
          confirmationHandler:(void (^)(NSInteger otherButtonIndex))confirmationHandler {
    if (self = [super initWithTitle:title message:message delegate:self cancelButtonTitle:cancelButtonTitle otherButtonTitles:nil]) {
        for (NSString *buttonTitle in otherButtonTitles) {
            [self addButtonWithTitle:buttonTitle];
        }
        self.cancelHandler = cancelHandler;
        self.confirmationHandler = confirmationHandler;
    }
    return self;
}

#pragma mark - <UIAlertViewDelegate>

- (void)alertView:(UIAlertView *)alertView willDismissWithButtonIndex:(NSInteger)buttonIndex {
    if (buttonIndex == alertView.cancelButtonIndex) {
        if (self.cancelHandler) {
            self.cancelHandler();
        }
    } else {
        if (self.confirmationHandler) {
            NSInteger indexOffset = (alertView.cancelButtonIndex==-1) ? 0 : 1;
            self.confirmationHandler(buttonIndex - indexOffset);
        }
    }
    self.cancelHandler = nil;
    self.confirmationHandler = nil;
}

@end


text:
<?php

namespace ElkArte\Database;

/**
 * The common base for the implementation of SearchInterface
 */
abstract class AbstractSearch implements SearchInterface
{
	/**
	 * The database object
	 *
	 * @var \ElkArte\Database\QueryInterface
	 */
	protected $_db = null;

	/**
	 * The supported search methods
	 *
	 * @var string[]
	 */
	protected $_supported_types = array();

	/**
	 * The way to skip a database error
	 *
	 * @var bool
	 */
	protected $_skip_error = false;

	/**
	 * Usual constructor
	 */
	public function __construct($db)
	{
		$this->_db = $db;
	}

	/**
	 * {@inheritdoc }
	 */
	public function search_support($search_type)
	{
		return in_array($search_type, $this->_supported_types);
	}

	/**
	 * {@inheritdoc }
	 */
	public function search_query($identifier, $db_string, $db_values = array())
	{
		if ($this->_skip_error)
		{
			$this->_db->skip_next_error();
			$this->_skip_error = false;
		}

		// Simply delegate to the database adapter method.
		return $this->_db->query($identifier, $db_string, $db_values);
	}

	/**
	 * {@inheritDoc}
	 */
	public function skip_next_error()
	{
		$this->_skip_error = true;
	}

	/**
	 * {@inheritDoc}
	 */
	abstract public function membersTableInfo();

	/**
	 * {@inheritDoc}
	 */
	public function create_word_search()
	{
		$db_table = db_table();
		$db_table->create_table('{db_prefix}log_search_words',
			array(
				array(
					'name' => 'id_word',
					'type' => 'int',
					'size' => 10,
					'unsigned' => true,
					'default' => 0
				),
				array(
					'name' => 'id_msg',
					'type' => 'int',
					'size' => 10,
					'unsigned' => true,
					'default' => 0
				),
			),
			array(
				array('name' => 'id_word', 'columns' => array('id_word', 'id_msg'), 'type' => 'primary')
			)
		);
	}

	/**
	 * {@inheritDoc}
	 */
	public function createTemporaryTable($name, $columns, $indexes)
	{
		$db_table = db_table();

		return $db_table->create_table($name, $columns, $indexes, array(
			'temporary' => true,
			'if_exists' => 'force_drop'
		));
	}
}


text:
// This is core/vnl/vnl_vector.h
#ifndef vnl_vector_h_
#define vnl_vector_h_
#ifdef VCL_NEEDS_PRAGMA_INTERFACE
#pragma interface
#endif
//:
// \file
// \author Andrew W. Fitzgibbon
//
// \verbatim
// Modifications
// Comments re-written by Tim Cootes, for his sins.
//   Feb.2002 - Peter Vanroose - brief doxygen comment placed on single line
//   Mar.2004 - Peter Vanroose - deprecated fixed-size constructors now compile only when VNL_CONFIG_LEGACY_METHODS==1
//   Mar.2009 - Peter Vanroose - added arg_min() and arg_max()
//   Oct.2010 - Peter Vanroose - mutators and setters now return *this
// \endverbatim
#include <iosfwd>
# include <vnl/vnl_error.h>

#include <vcl_compiler.h>
#include <vnl/vnl_tag.h>
#include <vnl/vnl_c_vector.h>
#include <vnl/vnl_config.h>
#include <vnl/vnl_error.h>
#ifndef NDEBUG
# if VNL_CONFIG_CHECK_BOUNDS
#  include <vcl_cassert.h>
# endif
#else
# undef VNL_CONFIG_CHECK_BOUNDS
# define VNL_CONFIG_CHECK_BOUNDS 0
# undef ERROR_CHECKING
#endif
#if VNL_CONFIG_LEGACY_METHODS
# include <vcl_deprecated.h>
#endif

VCL_TEMPLATE_EXPORT template <class T> class vnl_vector;
VCL_TEMPLATE_EXPORT template <class T> class vnl_matrix;

//----------------------------------------------------------------------

#define v vnl_vector<T>
#define m vnl_matrix<T>
template <class T> T      dot_product(v const&, v const&);
template <class T> T      inner_product(v const&, v const&);
template <class T> T      bracket(v const &, m const &, v const &);
template <class T> T      cos_angle(v const&, v const& );
template <class T> double angle(v const&, v const&);
template <class T> m      outer_product(v const&, v const&);
template <class T> v      operator+(T, v const&);
template <class T> v      operator-(T, v const&);
template <class T> v      operator*(T, v const&);
// also exists as method: template <class T> v      operator*(m const&, v const&);
template <class T> v      operator*(v const&, m const&);
template <class T> v      element_product(v const&,v const&);
template <class T> v      element_quotient(v const&,v const&);
template <class T> T      vnl_vector_ssd(v const&, v const&);
template <class T> void   swap(v &, v &);
#undef v
#undef m

//----------------------------------------------------------------------

//: Mathematical vector class, templated by type of element.
// The vnl_vector<T> class implements one-dimensional arithmetic
// vectors to be used with the vnl_matrix<T> class. vnl_vector<T>
// has size fixed by constructor time or changed by assignment
// operator.
// For faster, non-mallocing vectors with size known at compile
// time, use vnl_vector_fixed* or vnl_T_n (e.g. vnl_double_3).
//
// NOTE: Vectors are indexed from zero!  Thus valid elements are [0,size()-1].
template<class T>
class vnl_vector
{
 public:
  friend class vnl_matrix<T>;

  //: Creates an empty vector. O(1).
  vnl_vector() : num_elmts(0) , data(VXL_NULLPTR) {}

  //: Creates a vector containing n uninitialized elements.
  explicit vnl_vector(unsigned int len);

  //: Creates a vector containing n elements, all set to v0.
  vnl_vector(unsigned int len, T const& v0);

  //: Creates a vector containing len elements, with the first n
  // elements taken from the array values[]. O(n).
  vnl_vector(unsigned int len, int n, T const values[]);

  //: Creates a vector containing len elements, initialized with values from
  // a data block.
  vnl_vector(T const* data_block,unsigned int n);

  //: Copy constructor.
  vnl_vector(vnl_vector<T> const&);

#if VNL_CONFIG_LEGACY_METHODS // these constructors are deprecated and should not be used
  //: Creates a vector of length 2 and initializes with the arguments, px,py.
  //  Requires that len==2.
  //  Consider using vnl_vector_fixed<T,2> instead!
  // \deprecated
  vnl_vector(unsigned len, T const& px, T const& py);

  //: Creates a vector of length 3 and initializes with the arguments, px,py,pz.
  //  Requires that len==3.
  //  Consider using vnl_vector_fixed<T,3> instead!
  // \deprecated
  vnl_vector(unsigned len, T const& px, T const& py, T const& pz);

  //: Creates a vector of length 4 and initializes with the arguments.
  //  Requires that len==4.
  //  Consider using vnl_vector_fixed<T,4> instead!
  // \deprecated
  vnl_vector(unsigned len, T const& px, T const& py, T const& pz, T const& pw);
#endif

#ifndef VXL_DOXYGEN_SHOULD_SKIP_THIS
// <internal>
  // These constructors are here so that operator* etc can take
  // advantage of the C++ return value optimization.
  vnl_vector(vnl_vector<T> const &, vnl_vector<T> const &, vnl_tag_add); // v + v
  vnl_vector(vnl_vector<T> const &, vnl_vector<T> const &, vnl_tag_sub); // v - v
  vnl_vector(vnl_vector<T> const &, T,                     vnl_tag_mul); // v * s
  vnl_vector(vnl_vector<T> const &, T,                     vnl_tag_div); // v / s
  vnl_vector(vnl_vector<T> const &, T,                     vnl_tag_add); // v + s
  vnl_vector(vnl_vector<T> const &, T,                     vnl_tag_sub); // v - s
  vnl_vector(vnl_matrix<T> const &, vnl_vector<T> const &, vnl_tag_mul); // M * v
  vnl_vector(vnl_vector<T> const &, vnl_matrix<T> const &, vnl_tag_mul); // v * M
  vnl_vector(vnl_vector<T> &that, vnl_tag_grab)
    : num_elmts(that.num_elmts), data(that.data)
  { that.num_elmts=0; that.data=0; } // "*this" now uses "that"'s data.
// </internal>
#endif

  //: Destructor
#ifdef __INTEL_COMPILER
#pragma warning disable 444 //destructor for base class "itk::Array<>" is not virtual
#endif
  /** This destructor is not virtual for performance reasons. However, this
   * means that subclasses cannot allocate memory. */
  ~vnl_vector();

  //: Return the length, number of elements, dimension of this vector.
  unsigned int size() const { return this->num_elmts; }

  //: Put value at given position in vector.
  inline void put(unsigned int i, T const& v);

  //: Get value at element i
  inline T get(unsigned int i) const;

  //: Set all values to v
  vnl_vector& fill(T const& v);

  //: Sets elements to ptr[i]
  //  Note: ptr[i] must be valid for i=0..size()-1
  vnl_vector& copy_in(T const * ptr);

  //: Copy elements to ptr[i]
  //  Note: ptr[i] must be valid for i=0..size()-1
  void copy_out(T *) const; // from vector to array[].

  //: Sets elements to ptr[i]
  //  Note: ptr[i] must be valid for i=0..size()-1
  vnl_vector& set(T const *ptr) { return copy_in(ptr); }

  //: Return reference to the element at specified index.
  // There are assert style boundary checks - #define NDEBUG to turn them off.
  T       & operator()(unsigned int i)
  {
#if VNL_CONFIG_CHECK_BOUNDS
    assert(i<size());   // Check the index is valid.
#endif
    return data[i];
  }
  //: Return reference to the element at specified index. No range checking.
  // There are assert style boundary checks - #define NDEBUG to turn them off.
  T const & operator()(unsigned int i) const
  {
#if VNL_CONFIG_CHECK_BOUNDS
    assert(i<size());   // Check the index is valid
#endif
    return data[i];
  }

  //: Return reference to the element at specified index. No range checking.
  T       & operator[](unsigned int i) { return data[i]; }
  //: Return reference to the element at specified index. No range checking.
  T const & operator[](unsigned int i) const { return data[i]; }

  //: Set all elements to value v
  vnl_vector<T>& operator=(T const&v) { fill(v); return *this; }

  //: Copy operator
  vnl_vector<T>& operator=(vnl_vector<T> const& rhs);

  //: Add scalar value to all elements
  vnl_vector<T>& operator+=(T );

  //: Subtract scalar value from all elements
  vnl_vector<T>& operator-=(T value) { return *this += T(-value); }

  //: Multiply all elements by scalar
  vnl_vector<T>& operator*=(T );

  //: Divide all elements by scalar
  vnl_vector<T>& operator/=(T );

  //: Add rhs to this and return *this
  vnl_vector<T>& operator+=(vnl_vector<T> const& rhs);

  //: Subtract rhs from this and return *this
  vnl_vector<T>& operator-=(vnl_vector<T> const& rhs);

  //: *this = M*(*this) where M is a suitable matrix.
  //  this is treated as a column vector
  vnl_vector<T>& pre_multiply(vnl_matrix<T> const& M);

  //: *this = (*this)*M where M is a suitable matrix.
  //  this is treated as a row vector
  vnl_vector<T>& post_multiply(vnl_matrix<T> const& M);

  //: *this = (*this)*M where M is a suitable matrix.
  //  this is treated as a row vector
  vnl_vector<T>& operator*=(vnl_matrix<T> const& m) { return this->post_multiply(m); }

  //: Unary plus operator
  // Return new vector = (*this)
  vnl_vector<T> operator+() const { return *this; }

  //: Unary minus operator
  // Return new vector = -1*(*this)
  vnl_vector<T> operator-() const;

  vnl_vector<T> operator+(T v) const { return vnl_vector<T>(*this, v, vnl_tag_add()); }
  vnl_vector<T> operator-(T v) const { return vnl_vector<T>(*this, v, vnl_tag_sub()); }
  vnl_vector<T> operator*(T v) const { return vnl_vector<T>(*this, v, vnl_tag_mul()); }
  vnl_vector<T> operator/(T v) const { return vnl_vector<T>(*this, v, vnl_tag_div()); }

  vnl_vector<T> operator+(vnl_vector<T> const& v) const { return vnl_vector<T>(*this, v, vnl_tag_add()); }
  vnl_vector<T> operator-(vnl_vector<T> const& v) const { return vnl_vector<T>(*this, v, vnl_tag_sub()); }
  vnl_vector<T> operator*(vnl_matrix<T> const& M) const { return vnl_vector<T>(*this, M, vnl_tag_mul()); }

  //--------------------------------------------------------------------------------

  //: Access the contiguous block storing the elements in the vector. O(1).
  //  data_block()[0] is the first element of the vector
  T const* data_block() const { return data; }

  //: Access the contiguous block storing the elements in the vector. O(1).
  //  data_block()[0] is the first element of the vector
  T      * data_block() { return data; }

  //: Type defs for iterators
  typedef T element_type;
  typedef size_t  size_type;

  //: Type defs for iterators
  typedef T       *iterator;
  //: Iterator pointing to start of data
  iterator begin() { return data; }

  //: Iterator pointing to element beyond end of data
  iterator end() { return data+num_elmts; }

  //: Const iterator type
  typedef T const *const_iterator;
  //: Iterator pointing to start of data
  const_iterator begin() const { return data; }
  //: Iterator pointing to element beyond end of data
  const_iterator end() const { return data+num_elmts; }

  //: Return a reference to this.
  // Useful in code which would prefer not to know if its argument
  // is a vector, vector_ref or a vector_fixed.  Note that it doesn't
  // return a vector_ref, so it's only useful in templates or macros.
  vnl_vector<T> const& as_ref() const { return *this; }

  //: Return a reference to this.
  vnl_vector<T>&       as_ref()       { return *this; }

  //: Applies function to elements
  vnl_vector<T> apply(T (*f)(T)) const;
  //: Applies function to elements
  vnl_vector<T> apply(T (*f)(T const&)) const;

  //: Returns a subvector specified by the start index and length. O(n).
  vnl_vector<T> extract(unsigned int len, unsigned int start=0) const;

  //: Replaces elements with index beginning at start, by values of v. O(n).
  vnl_vector<T>& update(vnl_vector<T> const&, unsigned int start=0);

  // norms etc
  typedef typename vnl_c_vector<T>::abs_t abs_t;

  //: Return sum of squares of elements
  abs_t squared_magnitude() const { return vnl_c_vector<T>::two_nrm2(begin(), size()); }

  //: Return magnitude (length) of vector
  abs_t magnitude() const { return two_norm(); }

  //: Return sum of absolute values of the elements
  abs_t one_norm() const { return vnl_c_vector<T>::one_norm(begin(), size()); }

  //: Return sqrt of sum of squares of values of elements
  abs_t two_norm() const { return vnl_c_vector<T>::two_norm(begin(), size()); }

  //: Return largest absolute element value
  abs_t inf_norm() const { return vnl_c_vector<T>::inf_norm(begin(), size()); }

  //: Normalise by dividing through by the magnitude
  vnl_vector<T>& normalize() { vnl_c_vector<T>::normalize(begin(), size()); return *this; }

  // These next 6 functions are should really be helper functions since they aren't
  // really proper functions on a vector in a philosophical sense.

  //: Root Mean Squares of values
  abs_t rms() const { return vnl_c_vector<T>::rms_norm(begin(), size()); }

  //: Smallest value
  T min_value() const { return vnl_c_vector<T>::min_value(begin(), size()); }

  //: Largest value
  T max_value() const { return vnl_c_vector<T>::max_value(begin(), size()); }

  //: Location of smallest value
  unsigned arg_min() const { return vnl_c_vector<T>::arg_min(begin(), size()); }

  //: Location of largest value
  unsigned arg_max() const { return vnl_c_vector<T>::arg_max(begin(), size()); }

  //: Mean of values in vector
  T mean() const { return vnl_c_vector<T>::mean(begin(), size()); }

  //: Sum of values in a vector
  T sum() const { return vnl_c_vector<T>::sum(begin(), size()); }

  //: Reverse the order of the elements
  //  Element i swaps with element size()-1-i
  vnl_vector<T>& flip();

  //: Reverse the order of the elements from index b to 1-e, inclusive.
  //  When b = 0 and e = size(), this is equivalent to flip();
  vnl_vector<T>& flip(const unsigned int &b, const unsigned int &e);

  //: Roll the vector forward by the specified shift.
  //  The shift is cyclical, such that the elements which
  //  are displaced from the end reappear at the beginning.
  //  Negative shifts and shifts >= the length of the array are supported.
  //  A new vector is returned; the underlying data is unchanged.
  vnl_vector<T> roll(const int &shift) const;

  //: Roll the vector forward by the specified shift.
  //  The shift is cyclical, such that the elements which
  //  are displaced from the end reappear at the beginning.
  //  Negative shifts and shifts >= the length of the array are supported.
  //
  vnl_vector& roll_inplace(const int &shift);

  //: Set this to that and that to this
  void swap(vnl_vector<T> & that);

#if VNL_CONFIG_LEGACY_METHODS // these methods are deprecated and should not be used
  //: Return first element of vector
  // \deprecated
  T& x() const { VXL_DEPRECATED("vnl_vector<T>::x()"); return data[0]; }
  //: Return second element of vector
  // \deprecated
  T& y() const { VXL_DEPRECATED("vnl_vector<T>::y()"); return data[1]; }
  //: Return third element of vector
  // \deprecated
  T& z() const { VXL_DEPRECATED("vnl_vector<T>::z()"); return data[2]; }
  //: Return fourth element of vector
  // \deprecated
  T& t() const { VXL_DEPRECATED("vnl_vector<T>::t()"); return data[3]; }
  //: Set the first element (with bound checking)
  // \deprecated
  void set_x(T const&xx) { VXL_DEPRECATED("vnl_vector<T>::set_x()"); if (size() >= 1) data[0] = xx; }
  //: Set the second element (with bound checking)
  // \deprecated
  void set_y(T const&yy) { VXL_DEPRECATED("vnl_vector<T>::set_y()"); if (size() >= 2) data[1] = yy; }
  //: Set the third element (with bound checking)
  // \deprecated
  void set_z(T const&zz) { VXL_DEPRECATED("vnl_vector<T>::set_z()"); if (size() >= 3) data[2] = zz; }
  //: Set the fourth element (with bound checking)
  // \deprecated
  void set_t(T const&tt) { VXL_DEPRECATED("vnl_vector<T>::set_t()"); if (size() >= 4) data[3] = tt; }
#endif // VNL_CONFIG_LEGACY_METHODS

  //: Check that size()==sz if not, abort();
  // This function does or tests nothing if NDEBUG is defined
  void assert_size(unsigned VXL_USED_IN_DEBUG(sz) ) const {
#ifndef NDEBUG
    assert_size_internal(sz);
#endif
  }

  //: Check that this is finite if not, abort();
  // This function does or tests nothing if NDEBUG is defined
  void assert_finite() const {
#ifndef NDEBUG
    assert_finite_internal();
#endif
  }

  //: Return true if it's finite
  bool is_finite() const;

  //: Return true iff all the entries are zero.
  bool is_zero() const;

  //: Return true iff the size is zero.
  bool empty() const { return !data || !num_elmts; }

  //:  Return true if all elements of vectors are equal, within given tolerance
  bool is_equal(vnl_vector<T> const& rhs, double tol) const;

  //: Return true if *this == v
  bool operator_eq(vnl_vector<T> const& v) const;

  //: Equality test
  bool operator==(vnl_vector<T> const &that) const { return  this->operator_eq(that); }

  //: Inequality test
  bool operator!=(vnl_vector<T> const &that) const { return !this->operator_eq(that); }

  //: Resize to n elements.
  // This is a destructive resize, in that the old data is lost if size() != \a n before the call.
  // If size() is already \a n, this is a null operation.
  bool set_size(unsigned n);

  //: Make the vector as if it had been default-constructed.
  void clear();

  //: Read from text stream
  bool read_ascii(std::istream& s);

  //: Read from text stream
  static vnl_vector<T> read(std::istream& s);

 protected:
  unsigned num_elmts;           // Number of elements (length)
  T* data;                      // Pointer to the actual data

#if VCL_HAS_SLICED_DESTRUCTOR_BUG
  // Since this bug exists, we need a flag that can be set during
  // construction to tell our destructor whether we own data.
  char vnl_vector_own_data;
#endif

  void assert_size_internal(unsigned sz) const;
  void assert_finite_internal() const;

  void destroy();

#if VCL_NEED_FRIEND_FOR_TEMPLATE_OVERLOAD
#ifndef DOXYGEN_SHOULD_SKIP_THIS
# define v vnl_vector<T>
# define m vnl_matrix<T>
#endif // DOXYGEN_SHOULD_SKIP_THIS
  friend T      dot_product      VCL_NULL_TMPL_ARGS (v const&, v const&);
  friend T      inner_product    VCL_NULL_TMPL_ARGS (v const&, v const&);
  friend T      bracket          VCL_NULL_TMPL_ARGS (v const&, m const&, v const&);
  friend T      cos_angle        VCL_NULL_TMPL_ARGS (v const&, v const&);
  friend double angle            VCL_NULL_TMPL_ARGS (v const&, v const&);
  friend m      outer_product    VCL_NULL_TMPL_ARGS (v const&, v const&);
  friend v      operator+        VCL_NULL_TMPL_ARGS (T const,  v const&);
  friend v      operator-        VCL_NULL_TMPL_ARGS (T const,  v const&);
  friend v      operator*        VCL_NULL_TMPL_ARGS (T const,  v const&);
  friend v      operator*        VCL_NULL_TMPL_ARGS (m const&, v const&);
  friend v      element_product  VCL_NULL_TMPL_ARGS (v const&, v const&);
  friend v      element_quotient VCL_NULL_TMPL_ARGS (v const&, v const&);
# undef v
# undef m
#endif

  // inline function template instantiation hack for gcc 2.97 -- fsm
  static void inline_function_tickler();
};

// Definitions of inline functions

//: Gets the element at specified index and return its value. O(1).
// Range check is performed.

template <class T>
inline T vnl_vector<T>
::get(unsigned int i) const
{
#if VNL_CONFIG_CHECK_BOUNDS
  if (i >= this->size())     // If invalid index specified
    vnl_error_vector_index("get", i);  // Raise exception
#endif
  return this->data[i];
}

//: Puts the value at specified index. O(1).
// Range check is performed.

template <class T>
inline void vnl_vector<T>
::put(unsigned int i, T const& v)
{
#if VNL_CONFIG_CHECK_BOUNDS
  if (i >= this->size())     // If invalid index specified
    vnl_error_vector_index("put", i); // Raise exception
#endif
  this->data[i] = v;    // Assign data value
}

//: multiply matrix and (column) vector. O(m*n).
// \relatesalso vnl_vector
// \relatesalso vnl_matrix
template<class T>
inline vnl_vector<T> operator*(vnl_matrix<T> const& m, vnl_vector<T> const& v)
{
  return vnl_vector<T>(m, v, vnl_tag_mul());
}

//: add scalar and vector. O(n).
// \relatesalso vnl_vector
template<class T>
inline vnl_vector<T> operator+(T s, vnl_vector<T> const& v)
{
  return vnl_vector<T>(v, s, vnl_tag_add());
}

//: subtract vector from scalar. O(n).
// \relatesalso vnl_vector
template<class T>
inline vnl_vector<T> operator-(T s, vnl_vector<T> const& v)
{
  return vnl_vector<T>(-v, s, vnl_tag_add());
}

//: multiply scalar and vector. O(n).
// \relatesalso vnl_vector
template<class T>
inline vnl_vector<T> operator*(T s, vnl_vector<T> const& v)
{
  return vnl_vector<T>(v, s, vnl_tag_mul());
}

//: Interchange the two vectors
// \relatesalso vnl_vector
template<class T>
inline void swap(vnl_vector<T> &a, vnl_vector<T> &b) { a.swap(b); }

//: Euclidean Distance between two vectors.
// Sum of Differences squared.
// \relatesalso vnl_vector
template<class T>
inline T vnl_vector_ssd(vnl_vector<T> const& v1, vnl_vector<T> const& v2)
{
#ifndef NDEBUG
  if (v1.size() != v2.size())
    vnl_error_vector_dimension("vnl_vector_ssd", v1.size(), v2.size());
#endif
  return vnl_c_vector<T>::euclid_dist_sq(v1.begin(), v2.begin(), v1.size());
}

// Non-vector functions which are nevertheless very useful.

//: Write vector to a std::ostream
// \relatesalso vnl_vector
VCL_TEMPLATE_EXPORT template <class T> std::ostream& operator<<(std::ostream &, vnl_vector<T> const&);
//: Read vector from a std::istream
// \relatesalso vnl_vector
VCL_TEMPLATE_EXPORT template <class T> std::istream& operator>>(std::istream &, vnl_vector<T>      &);

#endif // vnl_vector_h_


text:
### 1. Сделайте ["форк"](http://help.github.com/fork-a-repo/) репозитория vk, а затем клонируйте его в свою локальную среду разработки

git clone git@github.com:имя-вашего-пользователя/vk.git

### 2. Добавьте основной репозиторий vk как удаленный (remote) с названием "upstream"
Перейдите в директорию куда вы сделали клон на первом шаге и выполните следующую команду:

git remote add upstream git://github.com/vknet/vk.git

### 3. Получите последние изменения кода из основного репозитория vk

git fetch upstream

Вы должны начинать с этого шага для каждого нового патча, чтобы быть уверенными, что работаете с кодом, содержащим последние изменения.

### 4. Создайте новую ветку, основанную на текущей develop ветке vk

git checkout upstream/develop
git checkout -b 999-название-вашей-ветки

### 5. Пишем код
Убеждаемся, что он работает :)

### 6. Cделайте коммит изменений
Добавляем файлы c изменениями:

# один файл
git add путь/до/вашего/файла.cs
# все измененные файлы
git add .

Если добавить в описание коммита номер тикета #XXX, тогда GitHub автоматически свяжет его с тикетом над которым вы работаете:

git commit -m "Описание коммита для тикета #42"

### 7. Получите последние изменения кода из upstream (добавили на втором шаге)

git pull upstream develop

Опять же таким образом убеждаемся, что ваша ветка содержит последние изменения. Если возникли конфликты, исправляем и снова коммитим.

### 8. Имея код без конфликтов отправьте изменения на GitHub

git push -u origin 999-название-вашей-ветки

### 9. Пришлите [pull request](http://help.github.com/send-pull-requests/) в основной репозиторий vk
Перейдите в свой репозиторий на GitHub'e и нажмите "Pull Request", выберите свою ветку справа и добавьте описание вашего "Pull Request'a", чтобы GitHub автоматически связал его с тикетом добавьте в комментарий номер тикета '#999'.

### 10. Ожидайте рассмотрения вашего кода
Кто-то рассмотрит ваш код и может быть попросит внести изменения, если это произошло возвращайтесь к 5 шагу.

### 11. Удаление ветки
После того как ваш код приняли или отклонили, вы можете удалить ветку из локального репозитория и GitHub'a

git checkout develop
git branch -D 999-название-вашей-ветки
git push origin --delete 999-название-вашей-ветки

### Все шаги кратко

git clone git@github.com:ваше-имя-пользователя/vk.git
git remote add upstream git://github.com/vknet/vk.git

git fetch upstream
git checkout upstream/develop
git checkout -b 999-название-вашей-ветки

/* пишем код */

git add путь/до/вашего/файла.cs
git commit -m "Описание коммита для тикета #42"
git pull upstream develop
git push -u origin 999-название-вашей-ветки

1. При разработке / доработке функционала необходимо писать тесты
1. Выберите / Заведите issue и укажите в комментарии что взяли в работу: https://github.com/vknet/vk/issues

# Примечание
В *.cs файлах требуется использовать для отступов Tab

# Правила разработки:
1. Если вы ведете разработку в VS2017/2019 c использованием Resharper, либо Rider применяйте пожалуйста принятое форматирование для проекта. Правила описаны в .editorconfig и применяются Resharper/Rider при выполнении команды Code | Reformat code (Ctrl+Alt+Enter).
2. Дробите большую задачу на маленькие. Например необходимо для категории Message добавить несколько новых методов.
* 2.1. Реализуйте один метод.
* 2.2. Напишите на него тесты.
* 2.3. После проверки прохождения тестов сделайте коммит, опишите в коммите краткую суть проделанной работы: "Реализовал метод Send". Для более полного понимания прочитайте статью: https://m.habr.com/post/416887/
* 2.4. Возьмите следующий метод для реализации и вернитесь к пункту 2.1 и так пока не выполните работу до конца.
3. Сделайте Pull Request
* Проверьте что все тесты проходят, в противном случае найдите причину и локализуйте ее
* После получения ваших изменений будет проведено краткое ревью проделанной работы
* Если есть замечания устраните их


text:
from marshmallow import Schema, ValidationError, fields, validates

from bms_app import ma
from bms_app.models import Config, Label, Operation, Project, Wave
from bms_app.validators import check_if_text, validate_project_id

# ORA_VERSIONS = ['19.3.0.0.0', '18.0.0.0.0', '12.2.0.1.0', '12.1.0.2.0', '11.2.0.4.0']
# ORA_EDITIONS = ['EE', 'SE', 'SE2']
# CLUSTER_TYPES = ['RAC', 'DG']
# DISK_GROUPS = ['DATA1', 'RECO1']

class WaveSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = Wave
        include_fk = True

    @validates('project_id')
    def validated_project_id_exists(self, value):
        validate_project_id(value)

class AddWaveSchema(Schema):
    name = fields.Str(required=True)
    project_id = fields.Int(required=True)
    db_ids = fields.List(fields.Int(), required=False)

    @validates('project_id')
    def validated_project_id_exists(self, value):
        validate_project_id(value)

class ProjectSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = Project

class OperationSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = Operation
        include_fk = True

    operation_type = fields.Function(lambda obj: obj.operation_type.value)
    status = fields.Function(lambda obj: obj.status.value)

class FileSchema(Schema):
    file = fields.Raw(required=True)

class TextFileSchema(Schema):
    file = fields.Raw(required=True)

    @validates('file')
    def validate_txt_file_format(self, file_object):
        file_object.seek(0)
        if not check_if_text(file_object):
            raise ValidationError(['file format has to be txt'])

    @validates('file')
    def validate_not_empty_file(self, file_object):
        file_object.seek(0)
        if not file_object.read():
            raise ValidationError(['file can not be empty'])

class BinaryFileSchema(Schema):
    file = fields.Raw(required=True)

    @validates('file')
    def validate_binary_file_format(self, file_object):
        if check_if_text(file_object):
            raise ValidationError(['file format has to be binary'])

class DbParamsSchema(Schema):
    # ora_version = fields.Str(validate=validate.OneOf(ORA_VERSIONS))
    # ora_edition = fields.Str(validate=validate.OneOf(ORA_EDITIONS), load_default='EE')
    db_name = fields.Str(load_default='ORCL')
    # ora_role_separation = fields.Boolean()
    # cluster_type = fields.Str(validate=validate.OneOf(CLUSTER_TYPES), missing=None)
    # scan_port = fields.Integer(load_default=1521)
    # oracle_user = fields.Str(load_default='oracle')
    # oracle_group = fields.Str(load_default='oinstall')
    # grid_user = fields.Str(load_default='grid')
    # grid_group = fields.Str(load_default='asmadmin')
    # oracle_root = fields.Str(load_default='/u01/app')
    # home_name = fields.Str(load_default='db_home1')
    #
    # @validates_schema
    # def validate_ora_edit_to_ora_ver(self, data, **kwargs):
    #     if data['ora_edition'] == 'SE' and data['ora_version'] != '11.2.0.4.0':
    #         raise ValidationError(
    #             'Not appropriate ora_version. '
    #             'For ora_edition SE only 11.2.0.4.0 ora_version is appropriate'
    #         )
    #     if data['ora_edition'] == 'SE2' and data['ora_version'] == '11.2.0.4.0':
    #         raise ValidationError(
    #             'Not appropriate ora_version. '
    #             'For ora_edition SE2 only 12.1.0.2.0 and above ora_versions are appropriate'
    #         )
    #     if data['ora_role_separation'] is False:
    #         data['grid_user'] = data['oracle_user']

class DataMountSchema(Schema):
    purpose = fields.Str(load_default='software')
    blk_device = fields.Str()
    name = fields.Str(load_default='u01')
    fstype = fields.Str(load_default='xfs')
    mount_point = fields.Str(load_default='/u01')
    mount_opts = fields.Str(load_default='nofail')

class DisksSchema(Schema):
    blk_device = fields.Str()
    name = fields.Str()
    size = fields.Str()

class ASMConfigSchema(Schema):
    diskgroup = fields.Str()
    disks = fields.List(fields.Nested(DisksSchema))
    au_size = fields.Str()
    redundancy = fields.Str()

class MiscConfigSchema(Schema):
    swap_blk_device = fields.Str()
    oracle_root = fields.Str(load_default='/u01/app')
    ntp_preferred = fields.Str(load_default='/etc/ntp.conf')
    role_separation = fields.Boolean()
    compatible_asm = fields.Str()
    compatible_rdbms = fields.Str()
    asm_disk_management = fields.Str()
    is_swap_configured = fields.Boolean()

class InstallConfigSchema(Schema):
    oracle_user = fields.Str(load_default='oracle')
    oracle_group = fields.Str(load_default='oinstall')
    home_name = fields.Str(load_default='db_home19c')
    grid_user = fields.Str(load_default='grid')
    grid_group = fields.Str(load_default='asmadmin')

class RACNodeSchema(Schema):
    node_name = fields.Str()
    node_id = fields.Int()
    node_ip = fields.Str()
    vip_name = fields.Str()
    vip_ip = fields.Str()

class RACConfigSchema(Schema):
    vip_name = fields.Str()
    vip_ip = fields.Str()
    scan_name = fields.Str(load_default='SCAN')
    scan_port = fields.Int(load_default=1521)
    cluster_name = fields.Str()
    cluster_domain = fields.Str()
    public_net = fields.Str(load_default='eth0')
    private_net = fields.Str(load_default='eth1')
    scan_ip1 = fields.Str()
    scan_ip2 = fields.Str(required=False)
    scan_ip3 = fields.Str(required=False)
    dg_name = fields.Str()
    rac_nodes = fields.List(fields.Nested(RACNodeSchema))

class ConfigSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = Config
        include_fk = True

class ProjectIdSchema(Schema):
    project_id = fields.Integer(required=True)

class LabelSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = Label
        include_fk = True


text:
Inner bean is a bean define inside another bean, it can be seen as an inner class. In another word the inner bean is a bean defined within the scope of another bean. In this case the inner bean can only be use by the outer bean. No other bean in the Spring context can refer to that bean.

So if you sure that a bean is only use within a single bean it is a good idea to use an inner bean instead. Inner bean can be injected through setter injection or constructor injection.

Here is an example of Spring configuration for an inner bean injection:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

    <bean id="racer" class="org.kodejava.example.spring.innerbean.Racer">
        <property name="car">
            <bean class="org.kodejava.example.spring.innerbean.Car">
                <property name="maker" value="Ferrari"/>
                <property name="year" value="2019"/>
            </bean>
        </property>
    </bean>

</beans>
```

In this configuration we use a setter injection. So we use the `property` element. Instead of using a `ref` attribute for referring to another bean we define the bean using the `bean` element inside the `property` element. And then we create the `Car` bean and sets its properties.

If you want to you a constructor injection you can inject the `Car` bean into the `Racer` bean by defining a bean inside of the `constructor-arg` element in the `Racer` bean.

Below is our `Racer` and `Car` classes.

```java
package org.kodejava.example.spring.innerbean;

public class Racer {
    private Car car;

    public Racer() {
    }

    public Racer(Car car) {
        this.car = car;
    }

    public void setCar(Car car) {
        this.car = car;
    }

    @Override
    public String toString() {
        return "Racer{" +
            "car=" + car +
            '}';
    }
}
```

```java
package org.kodejava.example.spring.innerbean;

public class Car {
    private String maker;
    private int year;

    public void setMaker(String maker) {
        this.maker = maker;
    }

    public void setYear(int year) {
        this.year = year;
    }

    @Override
    public String toString() {
        return "Car{" +
            "maker='" + maker + "'" +
            ", year=" + year +
            '}';
    }
}
```

Let's create our `Demo` class to run the program:

```java
package org.kodejava.example.spring.innerbean;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Demo {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext(
            new String[]{"inner-bean.xml"});

        Racer racer = (Racer) context.getBean("racer");
        System.out.println("Racer = " + racer);
    }
}
```

Here is the output of our program:

```text
Racer = Racer{car=Car{maker='Ferrari', year=2019}}
```


text:
require "tap"

class Tap
  def core_formula_repository?
    odisabled "Tap#core_formula_repository?", "Tap#core_tap?"
  end
end


text:
//
//  ButtonHUD.cpp
//  JLIGameEngineTest
//
//  Created by James Folk on 2/13/15.
//  Copyright (c) 2015 James Folk. All rights reserved.
//

#include "ButtonHUD.h"
#include "JLIFactoryTypes.h"
#include "World.h"
#include "ButtonHUDBuilder.h"
#include "GraphicsPlatform.h"
#include "WorldHUD.h"
#include "Log.h"
#define TAG "ButtonHUD.cpp"
#include "SpriteFrameAtlas.h"

#define FORMATSTRING "{\"njli::ButtonHUD\":[]}"
#include "btPrint.h"
#include "JsonJLI.h"

namespace njli
{
    ButtonHUD::ButtonHUD():
    AbstractFactoryObject(this),
    m_fontSize(20*3),
    m_fontFace("sans-jp"),
    m_align(JLI_HUD_ALIGN_LEFT | JLI_HUD_ALIGN_MIDDLE),
    m_position(new btVector2(0.0f, 0)),
    m_dimensions(new btVector2(140*3, 28*3)),
    m_text("私はガラスを食べられます。それは私を傷つけません。"),
    m_fillColor(new btVector4(1.0f, 1.0f, 1.0f, 1.0f)),
    m_borderColor(new btVector4(0.0f, 0.0f, 0.0f, 1.0f)),
    m_textColor(new btVector4(1.0f, 1.0f, 1.0f, 1.0f)),
    m_textShadowColor(new btVector4(0.0f, 0.0f, 0.0f, 1.0f)),
    m_gradientStartColor(new btVector4(1.0f, 1.0f, 1.0f, 32.0/255.0)),
    m_gradientEndColor(new btVector4(0.0f, 0.0f, 0.0f, 32.0/255.0)),
    m_cornerRadius(4.0f*3)
    {

    }

    ButtonHUD::ButtonHUD(const AbstractBuilder &builder):
    AbstractFactoryObject(this),
    m_fontSize(20),
    m_fontFace("sans"),
    m_align(JLI_HUD_ALIGN_LEFT | JLI_HUD_ALIGN_MIDDLE),
    m_position(new btVector2(0.0f, 0)),
    m_dimensions(new btVector2(140, 28)),
    m_text("EMPTY"),
    m_fillColor(new btVector4(1.0f, 1.0f, 1.0f, 1.0f)),
    m_borderColor(new btVector4(0.0f, 0.0f, 0.0f, 1.0f)),
    m_textColor(new btVector4(1.0f, 1.0f, 1.0f, 1.0f)),
    m_textShadowColor(new btVector4(0.0f, 0.0f, 0.0f, 1.0f)),
    m_gradientStartColor(new btVector4(1.0f, 1.0f, 1.0f, 32.0/255.0)),
    m_gradientEndColor(new btVector4(0.0f, 0.0f, 0.0f, 32.0/255.0)),
    m_cornerRadius(4.0f)
    {

    }

    ButtonHUD::ButtonHUD(const ButtonHUD &copy):
    AbstractFactoryObject(this),
    m_fontSize(20),
    m_fontFace("sans"),
    m_align(JLI_HUD_ALIGN_LEFT | JLI_HUD_ALIGN_MIDDLE),
    m_position(new btVector2(0.0f, 0)),
    m_dimensions(new btVector2(140, 28)),
    m_text("EMPTY"),
    m_fillColor(new btVector4(1.0f, 1.0f, 1.0f, 1.0f)),
    m_borderColor(new btVector4(0.0f, 0.0f, 0.0f, 1.0f)),
    m_textColor(new btVector4(1.0f, 1.0f, 1.0f, 1.0f)),
    m_textShadowColor(new btVector4(0.0f, 0.0f, 0.0f, 1.0f)),
    m_gradientStartColor(new btVector4(1.0f, 1.0f, 1.0f, 32.0/255.0)),
    m_gradientEndColor(new btVector4(0.0f, 0.0f, 0.0f, 32.0/255.0)),
    m_cornerRadius(4.0f)
    {

    }

    ButtonHUD::~ButtonHUD()
    {
        delete m_gradientEndColor;m_gradientEndColor=NULL;
        delete m_gradientStartColor;m_gradientStartColor=NULL;
        delete m_textShadowColor;m_textShadowColor=NULL;
        delete m_textColor;m_textColor=NULL;
        delete m_borderColor;m_borderColor=NULL;
        delete m_fillColor;m_fillColor=NULL;
        delete m_dimensions;m_dimensions=NULL;
        delete m_position;m_position=NULL;
    }

    ButtonHUD &ButtonHUD::operator=(const ButtonHUD &rhs)
    {
        if(this != &rhs)
        {

        }
        return *this;
    }

    void ButtonHUD::renderFunction(Camera *camera)
    {
        nvgBeginFrame(World::getInstance()->getWorldHUD()->getContext(),
                      getWidth(),
                      getHeight(),
                      getAspectRatio());

        WorldHUD *hud = njli::World::getInstance()->getWorldHUD();

        f32 w = m_dimensions->x();
        f32 h = m_dimensions->y();
        f32 tw = 0;
        f32 iw = 0;
        f32 x = m_position->x();
        f32 y = getHeight() - m_position->y() - h;

        JLIPaint bg = hud->linearGradient(x, y, x, y+h, *m_gradientStartColor, *m_gradientEndColor);
//        JLIPaint bg = hud->radialGradient(x + (w*.5), y + (h*.5), 0, w, *m_gradientStartColor, *m_gradientEndColor);
//        JLIPaint bg = hud->boxGradient(x, y, w, h, m_cornerRadius, 100, *m_gradientStartColor, *m_gradientEndColor);
        hud->beginPath();
        hud->roundedRect(x+1, y+1, w-2, h-2, m_cornerRadius - 1);
        hud->fillColor(*m_fillColor);
        hud->fill();
        hud->fillPaint(bg);
        hud->fill();

        hud->beginPath();
        hud->roundedRect(x + 0.5f, y + 0.5f, w-1, h-1, m_cornerRadius-0.5f);
        hud->strokeColor(*m_borderColor);
        hud->stroke();

        Rect rect;
        njli::World::getInstance()->getWorldHUD()->fontSize(m_fontSize);
        njli::World::getInstance()->getWorldHUD()->fontFace(m_fontFace.c_str());
        tw = hud->textBounds(0, 0, rect, m_text.c_str());

        njli::World::getInstance()->getWorldHUD()->textAlign((njli::njliHUDAlign)m_align);
        hud->fillColor(*m_textShadowColor);
        hud->text(x+w*0.5-tw*0.5+iw*0.25, y+h*0.5-1,m_text.c_str());
        hud->fillColor(*m_textColor);
        hud->text(x+w*0.5-tw*0.5+iw*0.25, y+h*0.5, m_text.c_str());

        nvgEndFrame(World::getInstance()->getWorldHUD()->getContext());
    }

    s32	ButtonHUD::calculateSerializeBufferSize() const
    {
        //TODO: calculateSerializeBufferSize
        return 0;
    }

    void ButtonHUD::serialize(void* dataBuffer, btSerializer* serializer) const
    {
        //TODO: serialize
    }

    const char *ButtonHUD::getClassName()const
    {
        return "ButtonHUD";
    }

    s32 ButtonHUD::getType()const
    {
        return JLI_OBJECT_TYPE_ButtonHUD;
    }

    ButtonHUD::operator std::string() const
    {
        return njli::JsonJLI::parse(string_format("%s", FORMATSTRING));
    }

    ButtonHUD **ButtonHUD::createArray(const u32 size)
    {
        return (ButtonHUD**)World::getInstance()->getWorldFactory()->createArray(ButtonHUD::type(), size);
    }

    void ButtonHUD::destroyArray(ButtonHUD **array, const u32 size)
    {
        World::getInstance()->getWorldFactory()->destroyArray((AbstractFactoryObject**)array, size);
    }

    ButtonHUD *ButtonHUD::create()
    {
        return dynamic_cast<ButtonHUD*>(World::getInstance()->getWorldFactory()->create(ButtonHUD::type()));
    }

    ButtonHUD *ButtonHUD::create(const ButtonHUDBuilder &builder)
    {
        AbstractBuilder *b = (AbstractBuilder *)&builder;

        return dynamic_cast<ButtonHUD*>(World::getInstance()->getWorldFactory()->create(*b));
    }

    ButtonHUD *ButtonHUD::clone(const ButtonHUD &object)
    {
        return dynamic_cast<ButtonHUD*>(World::getInstance()->getWorldFactory()->clone(object, false));
    }

    ButtonHUD *ButtonHUD::copy(const ButtonHUD &object)
    {
        return dynamic_cast<ButtonHUD*>(World::getInstance()->getWorldFactory()->clone(object, true));
    }

    void ButtonHUD::destroy(ButtonHUD *object)
    {
        if(object)
        {
            World::getInstance()->getWorldFactory()->destroy(object);
        }
    }

    void ButtonHUD::load(ButtonHUD &object, lua_State *L, int index)
    {
        // Push another reference to the table on top of the stack (so we know
        // where it is, and this function can work for negative, positive and
        // pseudo indices
        lua_pushvalue(L, index);
        // stack now contains: -1 => table
        lua_pushnil(L);
        // stack now contains: -1 => nil; -2 => table
        while (lua_next(L, -2))
        {
            // stack now contains: -1 => value; -2 => key; -3 => table
            // copy the key so that lua_tostring does not modify the original
            lua_pushvalue(L, -2);
            // stack now contains: -1 => key; -2 => value; -3 => key; -4 => table
            const char *key = lua_tostring(L, -1);
//            const char *value = lua_tostring(L, -2);
            if(lua_istable(L, -2))
            {
                ButtonHUD::load(object, L, -2);
            }
            else
            {
                if(lua_isnumber(L, index))
                {
                    double number = lua_tonumber(L, index);
                    printf("%s => %f\n", key, number);
                }
                else if(lua_isstring(L, index))
                {
                    const char *v = lua_tostring(L, index);
                    printf("%s => %s\n", key, v);
                }
                else if(lua_isboolean(L, index))
                {
                    bool v = lua_toboolean(L, index);
                    printf("%s => %d\n", key, v);
                }
                else if(lua_isuserdata(L, index))
                {
                    //                    swig_lua_userdata *usr;
                    //                    swig_type_info *type;
                    //                    assert(lua_isuserdata(L,index));
                    //                    usr=(swig_lua_userdata*)lua_touserdata(L,index);  /* get data */
                    //                    type = usr->type;
                    //                    njli::AbstractFactoryObject *object = static_cast<njli::AbstractFactoryObject*>(usr->ptr);
                    //                    printf("%s => %d:%s\n", key, object->getType(), object->getClassName());

                }
            }
            // pop value + copy of key, leaving original key
            lua_pop(L, 2);
            // stack now contains: -1 => key; -2 => table
        }
        // stack now contains: -1 => table (when lua_next returns 0 it pops the key
        // but does not push anything.)
        // Pop table
        lua_pop(L, 1);
        // Stack is now the same as it was on entry to this function
    }

    u32 ButtonHUD::type()
    {
        return JLI_OBJECT_TYPE_ButtonHUD;
    }

    void ButtonHUD::setFontSize(f32 size)
    {
        m_fontSize = size;
    }

    void ButtonHUD::setFontFace(const char *face)
    {
        m_fontFace = face;
    }

    void ButtonHUD::setPosition(const btVector2 &pos)
    {
        *m_position = pos;
    }

    void ButtonHUD::setDimensions(const btVector2 &dim)
    {
        *m_dimensions = dim;
    }

    void ButtonHUD::setText(const char *text)
    {
        m_text = text;
    }

    void ButtonHUD::setFillColor(const btVector4 &color)
    {
        *m_fillColor = color;
    }

    void ButtonHUD::setBorderColor(const btVector4 &color)
    {
        *m_borderColor = color;
    }

    void ButtonHUD::setTextColor(const btVector4 &color)
    {
        *m_textColor = color;
    }

    void ButtonHUD::setTextShadowColor(const btVector4 &color)
    {
        *m_textShadowColor = color;
    }

    void ButtonHUD::setGradientStartColor(const btVector4 &start)
    {
        *m_gradientStartColor = start;
    }

    void ButtonHUD::setGradientEndColor(const btVector4 &end)
    {
        *m_gradientEndColor = end;
    }

    void ButtonHUD::setCornerRadius(f32 radius)
    {
        m_cornerRadius = radius;
    }

    f32 ButtonHUD::getFontSize(f32 size)
    {
        return m_fontSize;
    }

    const char *ButtonHUD::getFontFace()const
    {
        return m_fontFace.c_str();
    }

    const btVector2 &ButtonHUD::getPosition()const
    {
        return *m_position;
    }

    const btVector2 &ButtonHUD::getDimensions()const
    {
        return *m_dimensions;
    }

    const char *ButtonHUD::getText()const
    {
        return m_text.c_str();
    }

    const btVector4 &ButtonHUD::getFillColor()const
    {
        return *m_fillColor;
    }

    const btVector4 &ButtonHUD::getBorderColor()const
    {
        return *m_borderColor;
    }

    const btVector4 &ButtonHUD::getTextColor()const
    {
        return *m_textColor;
    }

    const btVector4 &ButtonHUD::getTextShadowColor()const
    {
        return *m_textShadowColor;
    }

    const btVector4 &ButtonHUD::getGradientStartColor()const
    {
        return *m_gradientStartColor;
    }

    const btVector4 &ButtonHUD::getGradientEndColor()const
    {
        return *m_gradientEndColor;
    }

    f32 ButtonHUD::getCornerRadius()const
    {
        return m_cornerRadius;
    }

}


text: <svg class="axis-container" id="example-one"></svg>


text:
package dagr.tasks.picard

import dagr.tasks.DagrDef.DirPath
import scala.collection.mutable.ListBuffer

class CheckIlluminaDirectory(basecallsDir: DirPath,
                             lanes: Seq[Int],
                             readStructure: String,
                             linkLocs: Boolean = false
                            ) extends PicardTask {

  override protected def addPicardArgs(buffer: ListBuffer[Any]): Unit = {
    buffer += "BASECALLS_DIR=" + basecallsDir
    buffer += "READ_STRUCTURE=" + readStructure
    buffer += "LINK_LOCS=" + linkLocs
    lanes.foreach(buffer += "LANES=" + _)
  }
}


text:
link: http://kissmetrics.com
image_path: /img/static-site-services/kissmetrics.png
name: Kissmetrics
category: Analytics
image_has_background: true
---


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

using System;
using System.Text;

namespace Microsoft.MixedReality.Toolkit.Core.Extensions
{
    /// <summary>
    /// <see cref="String"/> Extensions.
    /// </summary>
    public static class StringExtensions
    {
        /// <summary>
        /// Encodes the string to base 64 ASCII.
        /// </summary>
        /// <param name="toEncode">String to encode.</param>
        /// <returns>Encoded string.</returns>
        public static string EncodeTo64(this string toEncode)
        {
            byte[] toEncodeAsBytes = Encoding.ASCII.GetBytes(toEncode);
            return Convert.ToBase64String(toEncodeAsBytes);
        }

        /// <summary>
        /// Decodes string from base 64 ASCII.
        /// </summary>
        /// <param name="encodedData">String to decode.</param>
        /// <returns>Decoded string.</returns>
        public static string DecodeFrom64(this string encodedData)
        {
            byte[] encodedDataAsBytes = Convert.FromBase64String(encodedData);
            return Encoding.ASCII.GetString(encodedDataAsBytes);
        }

        /// <summary>
        /// Capitalize the first character and add a space before
        /// each capitalized letter (except the first character).
        /// </summary>
        /// <param name="value"></param>
        public static string ToProperCase(this string value)
        {
            // If there are 0 or 1 characters, just return the string.
            if (value == null) { return value; }
            if (value.Length < 2) { return value.ToUpper(); }
            // If there's already spaces in the string, return.
            if (value.Contains(" ")) { return value; }

            // Start with the first character.
            string result = value.Substring(0, 1).ToUpper();

            // Add the remaining characters.
            for (int i = 1; i < value.Length; i++)
            {
                var wasLastCharUpper = char.IsUpper(value[i - 1]);
                var nextIsLower = i + 1 < value.Length && char.IsLower(value[i + 1]);
                var isUpper = char.IsLetter(value[i]) && char.IsUpper(value[i]);

                if (isUpper && !wasLastCharUpper && nextIsLower)
                {
                    result += " ";
                }

                result += value[i];

                if (isUpper && wasLastCharUpper && !nextIsLower)
                {
                    result += " ";
                }
            }

            return result;
        }
    }
}


text:
var JsSearch;
(function (JsSearch) {
    ;
})(JsSearch || (JsSearch = {}));
;
//# sourceMappingURL=sanitizer.js.map


text:
export const interfaces = `
interface IABIFuncParamlessCall<T = void> {
  encodeArguments(): string;
  decodeArguments(str: string): any;
  decodeReturnValue(argStr: string): T;
}

interface IABIFuncCall<T, K = void> {
  encodeArguments(x: T): string;
  decodeArguments(str: string): T;
  decodeReturnValue(argStr: string): K;
}

interface IABIFuncParamlessSend {
  encodeArguments(): string;
  decodeArguments(str: string): any;
}

interface IABIFuncSend<T> {
  encodeArguments(x: T): string;
  decodeArguments(str: string): T;
}
type ABIFuncCallConnected<T, K = void> = (x: T, txObj?: ICallTxObj) => Promise<K>;
type ABIFuncParamlessCallConnected<T = void> = (txObj?: ICallTxObj) => Promise<T>;
type ABIFuncSendConnected<T> = (x: T, txObj?: ITransactionObj) => Promise<string>;
type ABIFuncParamlessSendConnected = (txObj?: ITransactionObj) => Promise<string>;

interface ITransactionObj {
  from?: string;
  to?: string;
  gas?: string;
  gasPrice?: string;
  value?: string;
  data?: string;
  nonce?: string;
}

interface ICallTxObj {
  from?: string;
  to?: string;
  gas?: string;
  gasPrice?: string;
  value?: string;
  data?: string;
}
`;


text:
package eu.radu.codingtest;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ComponentScan(basePackages = {"eu.radu.codingtest"})
public class AppConfig {

}


text:
from flask import Blueprint

from .notification import debug_notification

app = Blueprint("debug", __name__)
app.add_url_rule("/mail/notification", view_func=debug_notification)


text:
"""
Setup macro-style documentation datastructures.
"""
macro init()
    STRINGS  = esc(:__DOCILE_STRINGS__)
    METADATA = esc(:__DOCILE_METADATA__)
    quote
        if !isdefined(:__DOCILE_STRINGS__)
            const $STRINGS  = ObjectIdDict()
            const $METADATA = ObjectIdDict()
            nothing
        end
    end
end

docs()     = current_module().__DOCILE_STRINGS__
metadata() = current_module().__DOCILE_METADATA__

meta(docstring = ""; kwargs...) =
    (docstring, @compat(Dict{Symbol, Any}(kwargs)))

"""
Assign to docs to `n` and return a dictionary of keyword arguments.
"""
function data(n, docstr; kwargs...)
    dict = @compat(Dict{Symbol, Any}(kwargs))
    if isa(docstr, AbstractString)
        docs()[n] = docstr
    else
        docs()[n] = docstr[1]
        merge!(dict, docstr[2])
    end
    dict
end

"""
Get the symbolic name of an expression.
"""
function nameof(x::Expr)
    isa(x.args[1], Bool)    && return nameof(x.args[2])
    isexpr(x, :bitstype)    && return x.args[2]
    isexpr(x.args[1], :(.)) && return x.args[1]
    nameof(x.args[1])
end

nameof(s::Symbol) = s

"""
Extract the line number and documented object expression from a block.
"""
unblock(x::Expr) = isexpr(x, :block) ?
    (x.args[1].args[1], x.args[2]) :
    error("Invalid '@doc' syntax.")

"""
Extract the docstring and expression to be documented from an `->` expression.
"""
unarrow(x::Expr) = isexpr(x, :(->)) ?
    (x.args[1], x.args[2]) :
    error("Missing '->' syntax.")

"""
Return the category of an object.
"""
lateguess(::Function) = :function
lateguess(::Module)   = :module
lateguess(::Any)      = error("Unknown category for '@doc'ed object.")

"""
Main documentation generation routine.
"""
function doc(expr::Expr, generic = false)

    # Extract docstring, object, and line number from the expression.
    docs, object = unarrow(expr)
    line, object = unblock(object)

    codesource = :(($(line), @__FILE__))

    name     = nameof(object)
    category = Collector.getcategory(object)

    # Check for correct '@doc+' usage.
    (generic && category != :method) && error("'@doc+' can only be applied to methods.")

    # Easier passing of arguments to subsequent function calls.
    packed = (
        docs,
        object,
        category,
        name,
        codesource
        )

    # Branch to category-specific expression generation.
    generic                                   && return  genericdocs(packed)
    category == :symbol                       && return symbolicdocs(packed)
    category == :method                       && return   methoddocs(packed)
    category == :macro                        && return    macrodocs(packed)
    category in (:global, :typealias)         && return   globaldocs(packed)
    category in (:type, :abstract, :bitstype) && return     typedocs(packed)

    error("Cannot use '@doc' on object.")
end

function genericdocs(packed)
    docs, object, category, name, codesource = packed
    d, o, n = map(esc, (docs, object, name))
    quote
        @init
        $(o)
        metadata()[$(n)] = data($(n), $(d);
            category   = $(Expr(:quote, :function)),
            codesource = $(codesource),
            code       = $(Expr(:quote, object))
            )
        $(n)
    end
end
function symbolicdocs(packed)
    docs, object, category, name, codesource = packed
    d, n = map(esc, (docs, name))
    quote
        @init
        metadata()[$(n)] = data($(n), $(d);
            category   = lateguess($(n)),
            codesource = $(codesource)
            )
        $(n)
    end
end

defined(ex::Expr)  = :(isdefined($(ex.args[1]), $(Expr(:quote, ex.args[2].args[1]))))
defined(s::Symbol) = :(isdefined($(Expr(:quote, s))))

function methoddocs(packed)
    docs, object, category, name, codesource = packed
    d, o, n = map(esc, (docs, object, name))
    quote
        @init
        old = $(esc(defined(name))) ? Set{Method}(methods($(n))) : Set{Method}()
        $(o)
        for m in setdiff(Set{Method}(methods($(n))), old)
            metadata()[m] = data(m, $(d);
                category   = $(Expr(:quote, category)),
                codesource = $(codesource),
                code       = $(Expr(:quote, object))
                )
        end
        $(n)
    end
end
function macrodocs(packed)
    docs, object, category, name, codesource = packed
    name    = symbol(string("@", name))
    d, o, n = map(esc, (docs, object, name))
    quote
        @init
        $(o)
        metadata()[$(n)] = data($(n), $(d);
            category   = $(Expr(:quote, category)),
            codesource = $(codesource),
            code       = $(Expr(:quote, object)),
            signature  = $(Expr(:quote, object.args[1]))
            )
        $(n)
    end
end
function globaldocs(packed)
    docs, object, category, name, codesource = packed
    d, o, n = map(esc, (docs, object, name))
    quote
        @init
        $(o)
        metadata()[$(Expr(:quote, name))] = data(
            $(Expr(:quote, name)), $(d);
            category   = $(Expr(:quote, category)),
            codesource = $(codesource)
            )
        $(n)
    end
end
function typedocs(packed)
    docs, object, category, name, codesource = packed
    d, o, n = map(esc, (docs, object, name))
    quote
        @init
        $(o)
        metadata()[$(n)] = data($(n), $(d);
            category   = $(Expr(:quote, category)),
            codesource = $(codesource)
            )
        $(n)
    end
end

"""
Detect '@doc+' syntax in macro call.
"""
doc(s::Symbol, ex::Expr) = s ≡ :(+) ?
    doc(ex, true) :
    error("Invalid '@doc+' syntax.")

doc(other...) = throw(ArgumentError("Invalid '@doc' syntax."))

if VERSION < v"0.4-dev+6619"
"""
Document an object.

    @doc " ... " ->
    f(x) = x

    @doc+ " ... " ->
    g(x) = x

"""
macro doc(ex) isexpr(ex, :call) ? doc(ex.args...) : doc(ex) end
end


text:
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var core_1 = require("@angular/core");
var common_1 = require("nativescript-angular/common");
var forms_1 = require("nativescript-angular/forms");
var home_routing_module_1 = require("./home-routing.module");
var home_component_1 = require("./home.component");
var HomeModule = /** @class */ (function () {
    function HomeModule() {
    }
    HomeModule = __decorate([
        core_1.NgModule({
            imports: [
                common_1.NativeScriptCommonModule,
                home_routing_module_1.HomeRoutingModule,
                forms_1.NativeScriptFormsModule
            ],
            declarations: [
                home_component_1.HomeComponent
            ],
            schemas: [
                core_1.NO_ERRORS_SCHEMA
            ]
        })
    ], HomeModule);
    return HomeModule;
}());
exports.HomeModule = HomeModule;
//# sourceMappingURL=home.module.js.map