text:
#include "testApp.h"

//--------------------------------------------------------------
void testApp::setup(){

    Sender.setup(HOST, PORT);

    ofSetFrameRate(30);
    ofSetVerticalSync(true);

    setupFailed = false;

    ofSetVerticalSync(true);
	ofSetCircleResolution(80);
	ofBackground(54, 54, 54);

    ofSoundStreamListDevices();

//	cout<< "devices: " <<  ofSoundStreamListDevices() << endl;

	//AudioIn.setDeviceID(2); // !!! watch print for list of devices !!!
    if (NCHAN > 3){
        if ( ! AudioIn.setup(this, 2, 4, 44100, BUFFER_SIZE, 4)){
            setupFailed = true;
        }
    }
    else {
        AudioIn.setup(this, 2, 2, 44100, BUFFER_SIZE, 2);
    }
    AudioIn.start();

	peakTime =15; // hold longer
    decayRate = 0.95f; // decay slower
    HiGain = 0.9f; // reduced gain at lowest frequency
    LowGain = 0.01f; // increasing gain at higher frequencies

    avg_power  = 0.0f;

	Channel01_Analyzer.setup(44100, BUFFER_SIZE/2, 2);
    Channel02_Analyzer.setup(44100, BUFFER_SIZE/2, 2);
    Channel03_Analyzer.setup(44100, BUFFER_SIZE/2, 2);
    Channel04_Analyzer.setup(44100, BUFFER_SIZE/2, 2);

	Channel01_Analyzer.peakHoldTime = peakTime;
	Channel01_Analyzer.peakDecayRate = decayRate;
	Channel01_Analyzer.linearEQIntercept = HiGain;
	Channel01_Analyzer.linearEQSlope = LowGain;

    Channel02_Analyzer.peakHoldTime = peakTime;
	Channel02_Analyzer.peakDecayRate = decayRate;
	Channel02_Analyzer.linearEQIntercept = HiGain;
	Channel02_Analyzer.linearEQSlope = LowGain;

    Channel03_Analyzer.peakHoldTime = peakTime;
	Channel03_Analyzer.peakDecayRate = decayRate;
	Channel03_Analyzer.linearEQIntercept = HiGain;
	Channel03_Analyzer.linearEQSlope = LowGain;

    Channel04_Analyzer.peakHoldTime = peakTime;
	Channel04_Analyzer.peakDecayRate = decayRate;
	Channel04_Analyzer.linearEQIntercept = HiGain;
	Channel04_Analyzer.linearEQSlope = LowGain;

    Channel01_Aubio.setup();
    Channel02_Aubio.setup();
    Channel03_Aubio.setup();
    Channel04_Aubio.setup();

	ofSetVerticalSync(true);

    for (int i = 0; i < Channel01_Analyzer.nAverages; i++){
        float tmp;
        Channel01_holdFreq.push_back(tmp);
        Channel01_deltaFreq.push_back(tmp);
	}

    for (int i = 0; i < Channel02_Analyzer.nAverages; i++){
        float tmp;
        Channel02_holdFreq.push_back(tmp);
        Channel02_deltaFreq.push_back(tmp);
	}

    for (int i = 0; i < Channel03_Analyzer.nAverages; i++){
        float tmp;
        Channel03_holdFreq.push_back(tmp);
        Channel03_deltaFreq.push_back(tmp);
	}

    for (int i = 0; i < Channel04_Analyzer.nAverages; i++){
        float tmp;
        Channel04_holdFreq.push_back(tmp);
        Channel04_deltaFreq.push_back(tmp);
	}

}

//--------------------------------------------------------------
void testApp::update(){
    if(!setupFailed){
        audioAnalisys();
        SentMessages();

        Channel01_FFT_size = Channel01_Analyzer.nAverages;
        Channel02_FFT_size = Channel02_Analyzer.nAverages;
        Channel03_FFT_size = Channel03_Analyzer.nAverages;
        Channel04_FFT_size = Channel04_Analyzer.nAverages;

        Channel01_Pitch = Channel01_UsefulPitch;
        Channel01_Attack = Channel01_att;
        Channel01_Amplitude = Channel01_Aubio.amplitude;

        Channel02_Pitch= Channel02_UsefulPitch;
        Channel02_Attack= Channel02_att;
        Channel02_Amplitude= Channel02_Aubio.amplitude;

        Channel03_Pitch= Channel03_UsefulPitch;
        Channel03_Attack= Channel03_att;
        Channel03_Amplitude= Channel03_Aubio.amplitude;

        Channel04_Pitch= Channel04_UsefulPitch;
        Channel04_Attack= Channel04_att;
        Channel04_Amplitude= Channel04_Aubio.amplitude;

        Channel01_LinearPitch = 69 + 12*log2f(Channel01_Pitch/440);
        Channel02_LinearPitch = 69 + 12*log2f(Channel02_Pitch/440);
        Channel03_LinearPitch = 69 + 12*log2f(Channel03_Pitch/440);
        Channel04_LinearPitch = 69 + 12*log2f(Channel04_Pitch/440);
    }

}
//--------------------------------------------------------------
void testApp::draw(){
    if(!setupFailed){
        //debug view
        ofPushStyle();
            ofPushMatrix();
                ofTranslate(0, ofGetWindowHeight()-130);

                //-----  channel 01 -----
                ofPushMatrix();
                    ofTranslate(100, 0);
                    ofFill();
                    ofDrawBitmapString("Channel01", -90,0);
                    ofSetColor(255,40);
                    ofDrawBitmapString("FFT: "+ ofToString(Channel01_FFT_size) + " freq", 0,15);

                    ofDrawBitmapString("Frequency: " + ofToString(Channel01_Pitch,0), 0,30);
                    ofDrawBitmapString("Linear Pitch: " + ofToString(Channel01_LinearPitch,0), 0,45);
                    ofDrawBitmapString("Amplitude: " + ofToString(Channel01_Amplitude,4), 0,60);
                    ofDrawBitmapString("Attack: " + ofToString(Channel01_Attack,4), 0,75);
                    for (int i = 0; i < Channel01_FFT_size; i++){
                        ofSetColor(255,20);
                        ofRect((i*6),0,5,-Channel01_Analyzer.averages[i] * 3);
                        ofSetColor(255);
                        ofLine((i*6), -Channel01_Analyzer.averages[i] * 3, ((i+1)*6), -Channel01_Analyzer.averages[i+1] * 3);
                    }
                    ofSetColor(255, 255*Channel01_Amplitude);
                    ofCircle(-50,50, Channel01_Attack*3);
                    ofSetColor(255);
                    ofNoFill();
                    ofCircle(-50, 50, Channel01_Attack*3);

                ofPopMatrix();

                //-----  channel 02 -----
                ofPushMatrix();
                    ofTranslate(350, 0);
                    ofFill();
                    ofDrawBitmapString("Channel02", -90,0);
                    ofSetColor(255,40);
                    ofDrawBitmapString("FFT: "+ ofToString(Channel02_FFT_size) + " freq", 0,15);
                    ofDrawBitmapString("Frequency: " + ofToString(Channel02_Pitch,0), 0,30);
                    ofDrawBitmapString("Linear Pitch: " + ofToString(Channel02_LinearPitch,0), 0,45);
                    ofDrawBitmapString("Amplitude: " + ofToString(Channel02_Amplitude,4), 0,60);
                    ofDrawBitmapString("Attack: " + ofToString(Channel02_Attack,4), 0,75);
                    for (int i = 0; i < Channel02_FFT_size; i++){
                        ofSetColor(255,20);
                        ofRect((i*6),0,5,-Channel02_Analyzer.averages[i] * 3);
                        ofSetColor(255);
                        ofLine((i*6), -Channel02_Analyzer.averages[i] * 3, ((i+1)*6), -Channel02_Analyzer.averages[i+1] * 3);
                    }
                    ofSetColor(255, 255*Channel02_Amplitude);
                    ofCircle(-50,50, Channel02_Attack*3);
                    ofSetColor(255);
                    ofNoFill();
                    ofCircle(-50, 50, Channel02_Attack*3);
                ofPopMatrix();

                //-----  channel 03 -----
                ofPushMatrix();
                    ofTranslate(600, 0);
                    ofFill();
                    ofDrawBitmapString("Channel03", -90,0);
                    ofSetColor(255,40);
                    ofDrawBitmapString("FFT: "+ ofToString(Channel03_FFT_size) + " freq", 0,15);
                    ofDrawBitmapString("Frequency: " + ofToString(Channel03_Pitch,0), 0,30);
                    ofDrawBitmapString("Linear Pitch: " + ofToString(Channel03_LinearPitch,0), 0,45);
                    ofDrawBitmapString("Amplitude: " + ofToString(Channel03_Amplitude,4), 0,60);
                    ofDrawBitmapString("Attack: " + ofToString(Channel03_Attack,4), 0,75);
                    for (int i = 0; i < Channel03_FFT_size; i++){
                        ofSetColor(255,20);
                        ofRect((i*6),0,5,-Channel03_Analyzer.averages[i] * 3);
                        ofSetColor(255);
                        ofLine((i*6), -Channel03_Analyzer.averages[i] * 3, ((i+1)*6), -Channel03_Analyzer.averages[i+1] * 3);
                    }
                    ofSetColor(255, 255*Channel03_Amplitude);
                    ofCircle(-50,50, Channel03_Attack*3);
                    ofSetColor(255);
                    ofNoFill();
                    ofCircle(-50, 50, Channel03_Attack*3);
                ofPopMatrix();

                //-----  channel 04 -----
                ofPushMatrix();
                    ofTranslate(850, 0);
                    ofFill();
                    ofDrawBitmapString("Channel04", -90,0);
                    ofSetColor(255,40);
                    ofDrawBitmapString("FFT: "+ ofToString(Channel04_FFT_size) + " freq", 0,15);
                    ofDrawBitmapString("Frequency: " + ofToString(Channel04_Pitch,0), 0,30);
                    ofDrawBitmapString("Linear Pitch: " + ofToString(Channel04_LinearPitch,0), 0,45);
                    ofDrawBitmapString("Amplitude: " + ofToString(Channel04_Amplitude,4), 0,60);
                    ofDrawBitmapString("Attack: " + ofToString(Channel04_Attack,4), 0,75);
                    for (int i = 0; i < Channel04_FFT_size; i++){
                        ofSetColor(255,20);
                        ofRect((i*6),0,5,-Channel04_Analyzer.averages[i] * 3);
                        ofSetColor(255);
                        ofLine((i*6), -Channel04_Analyzer.averages[i] * 3, ((i+1)*6), -Channel04_Analyzer.averages[i+1] * 3);
                    }
                    ofSetColor(255, 255*Channel04_Amplitude);
                    ofCircle(-50,50, Channel04_Attack*3);
                    ofSetColor(255);
                    ofNoFill();
                    ofCircle(-50, 50, Channel04_Attack*3);
                ofPopMatrix();

            ofPopMatrix();
        ofPopStyle();
    } else { //setup failed!

        ofBackground(255, 20, 0);
        ofSetColor(255);
        ofDrawBitmapString(" WRONG DEVICE SELECTED ", ofGetWidth()/2-90, ofGetHeight()/2 - 50);
        ofDrawBitmapString(" CHANGE SYSTEM SETTINGS ", ofGetWidth()/2-90, ofGetHeight()/2);
        ofDrawBitmapString(" TO 4-CHANNEL INTERFACE ", ofGetWidth()/2-90, ofGetHeight()/2+50);
    }
}
//--------------------------------------------------------------
void testApp::audioReceived 	(float * input, int bufferSize, int nChannels){
	// samples are "interleaved"
	for (int i = 0; i < bufferSize; i++){
		Channel01[i] = input[i * nChannels];
		Channel02[i] = input[i * nChannels + 1];
        Channel03[i] = input[i * nChannels + 2];
        Channel04[i] = input[i * nChannels + 3];
	}

    Channel01_Aubio.processAudio(Channel01, BUFFER_SIZE);
    Channel02_Aubio.processAudio(Channel02, BUFFER_SIZE);
    Channel03_Aubio.processAudio(Channel03, BUFFER_SIZE);
    Channel04_Aubio.processAudio(Channel04, BUFFER_SIZE);
}
//--------------------------------------------------------------
void testApp::keyPressed(int key){

}

//--------------------------------------------------------------
void testApp::keyReleased(int key){

}

//--------------------------------------------------------------
void testApp::mouseMoved(int x, int y ){

}

//--------------------------------------------------------------
void testApp::mouseDragged(int x, int y, int button){

}

//--------------------------------------------------------------
void testApp::mousePressed(int x, int y, int button){

}

//--------------------------------------------------------------
void testApp::mouseReleased(int x, int y, int button){

}

//--------------------------------------------------------------
void testApp::windowResized(int w, int h){

}

//--------------------------------------------------------------
void testApp::gotMessage(ofMessage msg){

}

//--------------------------------------------------------------
void testApp::dragEvent(ofDragInfo dragInfo){

}
//--------------------------------------------------------------

void testApp::audioAnalisys(){

    /* do the FFT on Channel 1  */
    Channel01_fft.powerSpectrum(2, (int) BUFFER_SIZE / 2, Channel01, BUFFER_SIZE, & Channel01_magnitude[0], & Channel01_phase[0], & Channel01_power[0], & avg_power);
    for (int i = 0; i < (int)(BUFFER_SIZE / 2); i++) {
        Channel01_freq[i] = Channel01_magnitude[i];
    }
    Channel01_Analyzer.calculate(Channel01_freq);

    /* do the FFT on Channel 2  */
    Channel02_fft.powerSpectrum(0, (int) BUFFER_SIZE / 2, Channel02, BUFFER_SIZE, & Channel02_magnitude[0], & Channel02_phase[0], & Channel02_power[0], & avg_power);
    for (int i = 0; i < (int)(BUFFER_SIZE / 2); i++) {
        Channel02_freq[i] = Channel02_magnitude[i];
    }
    Channel02_Analyzer.calculate(Channel02_freq);

    /* do the FFT on Channel 3  */
    Channel03_fft.powerSpectrum(0, (int) BUFFER_SIZE / 2, Channel03, BUFFER_SIZE, & Channel03_magnitude[0], & Channel03_phase[0], & Channel03_power[0], & avg_power);
    for (int i = 0; i < (int)(BUFFER_SIZE / 2); i++) {
        Channel03_freq[i] = Channel03_magnitude[i];
    }
    Channel03_Analyzer.calculate(Channel03_freq);

    /* do the FFT on Channel 4  */
    Channel04_fft.powerSpectrum(0, (int) BUFFER_SIZE / 2, Channel04, BUFFER_SIZE, & Channel04_magnitude[0], & Channel04_phase[0], & Channel04_power[0], & avg_power);
    for (int i = 0; i < (int)(BUFFER_SIZE / 2); i++) {
        Channel04_freq[i] = Channel04_magnitude[i];
    }
    Channel04_Analyzer.calculate(Channel04_freq);

    /* init attack detection on Channel 01*/
    float tmp01 = 0;
    for (int i = 0; i < Channel01_Analyzer.nAverages; i++) {
        if (Channel01_Analyzer.averages[i] > Channel01_holdFreq[i]) {
            Channel01_deltaFreq[i] = Channel01_Analyzer.averages[i] - Channel01_holdFreq[i];
        }
        Channel01_holdFreq[i] = Channel01_Analyzer.averages[i];
        tmp01 = tmp01 + Channel01_deltaFreq[i];
    }
    tmp01 = tmp01 / Channel01_Analyzer.nAverages;
    Channel01_att = tmp01 * 0.5 + Channel01_att * 0.5;
    if (Channel01_peakPitch < Channel01_Aubio.pitch && Channel01_Aubio.confidence > 0.5) {
        Channel01_peakPitch = Channel01_Aubio.pitch;
    }
    Channel01_UsefulPitch = Channel01_Aubio.pitch * Channel01_Aubio.confidence + Channel01_UsefulPitch * (1 - Channel01_Aubio.confidence);

    /* init attack detection on Channel 02*/
    float tmp02 = 0;
    for (int i = 0; i < Channel02_Analyzer.nAverages; i++) {
        if (Channel02_Analyzer.averages[i] > Channel02_holdFreq[i]) {
            Channel02_deltaFreq[i] = Channel02_Analyzer.averages[i] - Channel02_holdFreq[i];
        }
        Channel02_holdFreq[i] = Channel02_Analyzer.averages[i];
        tmp02 = tmp02 + Channel02_deltaFreq[i];
    }
    tmp02 = tmp02 / Channel02_Analyzer.nAverages;
    Channel02_att = tmp02 * 0.5 + Channel02_att * 0.5;
    if (Channel02_peakPitch < Channel02_Aubio.pitch && Channel02_Aubio.confidence > 0.5) {
        Channel02_peakPitch = Channel02_Aubio.pitch;
    }
    Channel02_UsefulPitch = Channel02_Aubio.pitch * Channel02_Aubio.confidence + Channel02_UsefulPitch * (1 - Channel02_Aubio.confidence);

    /* init attack detection on Channel 03*/
    float tmp03 = 0;
    for (int i = 0; i < Channel03_Analyzer.nAverages; i++) {
        if (Channel03_Analyzer.averages[i] > Channel03_holdFreq[i]) {
            Channel03_deltaFreq[i] = Channel03_Analyzer.averages[i] - Channel03_holdFreq[i];
        }
        Channel03_holdFreq[i] = Channel03_Analyzer.averages[i];
        tmp03 = tmp03 + Channel03_deltaFreq[i];
    }
    tmp03 = tmp03 / Channel03_Analyzer.nAverages;
    Channel03_att = tmp03 * 0.5 + Channel03_att * 0.5;
    if (Channel03_peakPitch < Channel03_Aubio.pitch && Channel03_Aubio.confidence > 0.5) {
        Channel03_peakPitch = Channel03_Aubio.pitch;
    }
    Channel03_UsefulPitch = Channel03_Aubio.pitch * Channel03_Aubio.confidence + Channel03_UsefulPitch * (1 - Channel03_Aubio.confidence);

    /* init attack detection on Channel 04*/
    float tmp04 = 0;
    for (int i = 0; i < Channel04_Analyzer.nAverages; i++) {
        if (Channel04_Analyzer.averages[i] > Channel04_holdFreq[i]) {
            Channel04_deltaFreq[i] = Channel04_Analyzer.averages[i] - Channel04_holdFreq[i];
        }
        Channel04_holdFreq[i] = Channel04_Analyzer.averages[i];
        tmp04 = tmp04 + Channel04_deltaFreq[i];
    }
    tmp04 = tmp04 / Channel04_Analyzer.nAverages;
    Channel04_att = tmp04 * 0.5 + Channel04_att * 0.5;
    if (Channel04_peakPitch < Channel04_Aubio.pitch && Channel04_Aubio.confidence > 0.5) {
        Channel04_peakPitch = Channel04_Aubio.pitch;
    }
    Channel04_UsefulPitch = Channel04_Aubio.pitch * Channel04_Aubio.confidence + Channel04_UsefulPitch * (1 - Channel04_Aubio.confidence);

}

//-------------------------------------------------------
void testApp::SentMessages(){

    ofxOscMessage Channel01;
    Channel01.setAddress("/Channel01/AudioAnalysis");
    Channel01.addFloatArg(Channel01_Aubio.amplitude);
    Channel01.addFloatArg(Channel01_UsefulPitch);
    Channel01.addFloatArg(Channel01_att);
    Sender.sendMessage(Channel01);

    ofxOscMessage Channel02;
    Channel02.setAddress("/Channel02/AudioAnalysis");
    Channel02.addFloatArg(Channel02_Aubio.amplitude);
    Channel02.addFloatArg(Channel02_UsefulPitch);
    Channel02.addFloatArg(Channel02_att);
    Sender.sendMessage(Channel02);

    ofxOscMessage Channel03;
    Channel03.setAddress("/Channel03/AudioAnalysis");
    Channel03.addFloatArg(Channel03_Aubio.amplitude);
    Channel03.addFloatArg(Channel03_UsefulPitch);
    Channel03.addFloatArg(Channel03_att);
    Sender.sendMessage(Channel03);

    ofxOscMessage Channel04;
    Channel04.setAddress("/Channel04/AudioAnalysis");
    Channel04.addFloatArg(Channel04_Aubio.amplitude);
    Channel04.addFloatArg(Channel04_UsefulPitch);
    Channel04.addFloatArg(Channel04_att);
    Sender.sendMessage(Channel04);

    ofxOscMessage FFT01;
    FFT01.setAddress("/Channel01/FFT");
    FFT01.addIntArg(Channel01_Analyzer.nAverages);
    for (int i = 0; i < Channel01_Analyzer.nAverages; i++){
        FFT01.addFloatArg(Channel01_Analyzer.averages[i]);
//        FFT01.addInt64Arg(Channel01_Analyzer.averages[i] * 10000);
      cout<< "ch01 analyzer: "<< i << " "<< Channel01_Analyzer.averages[i]<<endl;
    }
    Sender.sendMessage(FFT01);

    ofxOscMessage FFT02;
    FFT02.setAddress("/Channel02/FFT");
    FFT02.addIntArg(Channel02_Analyzer.nAverages);
    for (int i = 0; i < Channel02_Analyzer.nAverages; i++){
        FFT02.addFloatArg(Channel02_Analyzer.averages[i]);
    }
    Sender.sendMessage(FFT02);

    ofxOscMessage FFT03;
    FFT03.setAddress("/Channel03/FFT");
    FFT03.addIntArg(Channel03_Analyzer.nAverages);
    for (int i = 0; i < Channel03_Analyzer.nAverages; i++){
        FFT03.addFloatArg(Channel03_Analyzer.averages[i]);
    }
    Sender.sendMessage(FFT03);

    ofxOscMessage FFT04;
    FFT04.setAddress("/Channel04/FFT");
    FFT04.addIntArg(Channel04_Analyzer.nAverages);
    for (int i = 0; i < Channel04_Analyzer.nAverages; i++){
        FFT04.addFloatArg(Channel04_Analyzer.averages[i]);
    }
    Sender.sendMessage(FFT04);

}


text:
package org.ir.tool.core;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;

/**
 * Created by ekamolid on 10/21/2016.
 */
public class Test1 {
    FileChannel inChannel;
    ByteBuffer buffer;
    RandomAccessFile aFile;
    int byteCount = 0;
    static int limit = 20_000_000;

    public Test1(String path) throws FileNotFoundException {
        aFile = new RandomAccessFile(path, "rw");
        inChannel = aFile.getChannel();
        buffer = ByteBuffer.allocate(1024 * 1024);
    }

    public static void main(String[] args) throws IOException {
//        System.out.println(String.format("%8s", Integer.toBinaryString(aByte & 0xFF)).replace(' ', '0'));
        writeTestRegular("C:/tmp/rg.b");
        writeTest("C:/tmp/compressed.b");
    }

    static void writeTestRegular(String path) throws IOException {
        Test1 test1 = new Test1(path);
        for (int i = 0; i < limit; i++) {
            test1.writeInt(i % 100);
        }
        test1.write();
        test1.inChannel.close();
        test1.aFile.close();
        System.out.println(test1.byteCount);
    }

    static void writeTest(String path) throws IOException {
        Test1 test1 = new Test1(path);
        for (int i = 0; i < limit; i++) {
            test1.writeVInt(i % 128);
        }
        test1.write();
        test1.inChannel.close();
        test1.aFile.close();
        System.out.println(test1.byteCount);
    }

    static void readTest(String path) throws IOException {
        Test1 test1 = new Test1(path);
        test1.read();
        for (int i = 0; i < 10_000_000; i++) {
            int q = test1.readVInt();
            if (i != q) {
                System.out.println(i + q);
            }
        }
        test1.inChannel.close();
        test1.aFile.close();
    }

    void read() throws IOException {
        buffer.clear();
        inChannel.read(buffer);
        buffer.flip();
    }

    byte readByte() throws IOException {
        if (!buffer.hasRemaining()) {
            read();
        }
        return buffer.get();
    }

    void write() throws IOException {
        if (buffer.position() > 0) {
            buffer.flip();
            inChannel.write(buffer);
            buffer.clear();
        }
    }

    void writeByte(byte b) throws IOException {
        if (!buffer.hasRemaining()) {
            write();
        }
        buffer.put(b);
        byteCount++;
    }

    void writeVInt(int i) throws IOException {
        while ((i & ~0x7F) != 0) {
            writeByte((byte) ((i & 0x7F) | 0x80));
            i >>>= 7;
        }
        writeByte((byte) (i & 0x7F));
    }

    void writeInt(int i) throws IOException {
        writeByte((byte) i);

        i >>>= 8;
        writeByte((byte) i);

        i >>>= 8;
        writeByte((byte) i);

        i >>>= 8;
        writeByte((byte) i);
    }

    int readVInt() throws IOException {
        byte b = readByte();
        int i = b & 0x7F;
        for (int shift = 7; (b & 0x80) != 0; shift += 7) {
            b = readByte();
            i |= (b & 0x7F) << shift;
        }
        return i;
    }
}

redpajama_set_name: RedPajamaGithub


text:
. ./test/helper.sh

function setUp()
{
	patches=()
	configure_opts=()
	make_opts=()

	unset ruby
	unset ruby_version
	unset src_dir
	unset install_dir
}

function test_parse_options_with_no_arguments()
{
	parse_options >/dev/null 2>&1

	assertEquals "did not return 1" 1 $?
}

function test_parse_options_with_invalid_options()
{
	parse_options "--foo" "ruby" >/dev/null 2>&1

	assertEquals "did not return 1" 1 $?
}

function test_parse_options_with_one_argument()
{
	local expected="jruby"

	parse_options $expected

	assertEquals "did not set \$ruby" $expected $ruby
}

function test_parse_options_with_two_arguments()
{
	local expected_ruby="jruby"
	local expected_version="1.7.4"

	parse_options $expected_ruby $expected_version

	assertEquals "did not set \$ruby" $expected_ruby $ruby
	assertEquals "did not set \$ruby_version" $expected_version \
		     				  $ruby_version
}

function test_parse_options_with_more_than_two_arguments()
{
	parse_options "jruby" "1.7.4" "foo" >/dev/null 2>&1

	assertEquals "did not return 1" 1 $?
}

function test_parse_options_with_install_dir()
{
	local expected="/usr/local/"

	parse_options "--install-dir" $expected "ruby"

	assertEquals "did not set \$install_dir" $expected $install_dir
}

function test_parse_options_with_src_dir()
{
	local expected="~/src/"

	parse_options "--src-dir" $expected "ruby"

	assertEquals "did not set \$src_dir" $expected $src_dir
}

function test_parse_options_with_jobs()
{
	local expected="--jobs"

	parse_options $expected "ruby"

	assertEquals "did not set \$make_opts" $expected ${make_opts[0]}
}

function test_parse_options_with_jobs_and_arguments()
{
	local expected="--jobs=4"

	parse_options "$expected" "ruby"

	assertEquals "did not set \$make_opts" $expected ${make_opts[0]}
}

function test_parse_options_with_patches()
{
	local expected=(patch1.diff patch2.diff)

	parse_options "--patch" ${expected[0]} "--patch" ${expected[1]} "ruby"

	assertEquals "did not set \$patches" $expected $patches
}

function test_parse_options_with_mirror()
{
	local mirror="http://www.mirrorservice.org/sites/ftp.ruby-lang.org/pub/ruby"

	parse_options "--mirror" "$mirror" "ruby"

	assertEquals "did not set \$ruby_mirror" "$mirror" "$ruby_mirror"
}

function test_parse_options_with_url()
{
	local url="http://mirror.s3.amazonaws.com/downloads/ruby-1.2.3.tar.gz"

	parse_options "--url" "$url" "ruby"

	assertEquals "did not set \$ruby_url" "$url" "$ruby_url"
}

function test_parse_options_with_md5()
{
	local md5="5d41402abc4b2a76b9719d911017c592"

	parse_options "--md5" "$md5" "ruby"

	assertEquals "did not set \$ruby_md5" "$md5" "$ruby_md5"
}

function test_parse_options_with_no_download()
{
	parse_options "--no-download" "ruby"

 	assertEquals "did not set \$no_download" 1 $no_download
}

function test_parse_options_with_no_verify()
{
	parse_options "--no-verify" "ruby"

 	assertEquals "did not set \$no_verify" 1 $no_verify
}

function test_parse_options_with_no_install_deps()
{
	parse_options "--no-install-deps" "ruby"

 	assertEquals "did not set \$no_install_deps" 1 $no_install_deps
}

function test_parse_options_with_no_reinstall()
{
	parse_options "--no-reinstall" "ruby"

	assertEquals "did not set to \$no_reinstall" 1 $no_reinstall
}

function test_parse_options_with_additional_options()
{
	local expected=(--enable-shared CFLAGS="-03")

	parse_options "ruby" "--" $expected

	assertEquals "did not set \$configure_opts" $expected $configure_opts
}

function test_parse_options_with_additional_options_with_spaces()
{
	parse_options "ruby" "--" --enable-shared CFLAGS="-march=auto -O2"

	assertEquals "did not word-split \$configure_opts correctly" \
          'CFLAGS=-march=auto -O2' "${configure_opts[1]}"
}

SHUNIT_PARENT=$0 . $SHUNIT2


text:
<?= "<?php\n" ?>

namespace <?= $namespace; ?>;

use Symfony\Component\EventDispatcher\EventSubscriberInterface;
<?= $event_full_class_name ? "use $event_full_class_name;\n" : '' ?>

class <?= $class_name ?> implements EventSubscriberInterface
{
    public function <?= $method_name ?>(<?= $event_arg ?>)
    {
        // ...
    }

    public static function getSubscribedEvents()
    {
        return [
            <?= $event ?> => '<?= $method_name ?>',
        ];
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Report of the Department of Agriculture, Government Research Institute of Formosa 35: 109 (1928)

#### Original name
Cercospora kusanoi Sawada

### Remarks
null


text:
<Alloy>
    <Window title="NetID" platform="ios">
        <TextField id="username" hintText="Username" />
        <TextField id="password" hintText="Password" passwordMask="true" />
        <Button title="Login" onClick="loginClick" />
    </Window>

    <Window title="NetID" platform="android">
        <TextField id="username" hintText="Username" />
        <TextField id="password" hintText="Password" passwordMask="true" />
        <Button title="Login" onClick="loginAndroidClick" />
    </Window>
</Alloy>


text:
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) > [puppeteer](./puppeteer.md) > [Protocol](./puppeteer.protocol.md) > [BackgroundService](./puppeteer.protocol.backgroundservice.md) > [BackgroundServiceEventReceivedEvent](./puppeteer.protocol.backgroundservice.backgroundserviceeventreceivedevent.md) > [backgroundServiceEvent](./puppeteer.protocol.backgroundservice.backgroundserviceeventreceivedevent.backgroundserviceevent.md)

## Protocol.BackgroundService.BackgroundServiceEventReceivedEvent.backgroundServiceEvent property

<b>Signature:</b>

```typescript
backgroundServiceEvent: BackgroundServiceEvent;
```


text:
<!doctype html>

    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>Random Design Co.</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="apple-touch-icon" href="apple-touch-icon.png">

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="css/normalize.css">
    <link rel="stylesheet" href="css/main.css">

RANDOM DESIGN CO.

BE RANDOM

      OMG YES!

About Us

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eos nam non, explicabo cum inventore, molestiae fuga nulla repellendus architecto rerum nostrum at amet, officia eum quisquam earum ipsam similique ad!

Latest Work

PROJECT 1

PROJECT 2

PROJECT 3

PROJECT 4

PROJECT 5

PROJECT 6

PROJECT 7

 &copy 2016 Random Design Co.


text:
# JavaScript Standard Style
[![travis][travis-image]][travis-url]
[![npm][npm-image]][npm-url]
[![downloads][downloads-image]][downloads-url]

[travis-image]: https://img.shields.io/travis/feross/standard.svg?style=flat
[travis-url]: https://travis-ci.org/feross/standard
[npm-image]: https://img.shields.io/npm/v/standard.svg?style=flat
[npm-url]: https://npmjs.org/package/standard
[downloads-image]: https://img.shields.io/npm/dm/standard.svg?style=flat
[downloads-url]: https://npmjs.org/package/standard

### One Style to Rule Them All

No decisions to make. No `.eslintrc`, `.jshintrc`, or `.jscsrc` files to manage. It just
works.

This module saves you (and others!) time in two ways:

- **No configuration.** The easiest way to enforce consistent style in your
  module/project. Just drop it in.
- **Catch style errors before they're submitted in PRs.** Saves precious code review time
  by eliminating back-and-forth between maintainer and contributor.

Users of `standard` don't want to argue with you about your opinions about `standard`. That's the whole point of `standard` -- to avoid bikeshedding about style. Those of us who use `standard` find it helps hold our code to a high *standard of quality* and ensures that new contributors follow our module's *style standards*. The standard style laid out here is not affiliated with any official web standards groups, which is why this repo is called `feross/standard` and not `ECMA/standard`.

[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)

## Install

```bash
npm install standard
```

## Rules

- **2 spaces** – for indentation
- **Single quotes for strings** – except to avoid escaping
- **No unused variables** – this one catches *tons* of bugs!
- **No semicolons** – [It's][1] [fine.][2] [Really!][3]
- **Never start a line with `(` or `[`**
    - This is the **only** gotcha with omitting semicolons – *automatically checked for you!*
- **Space after keywords** `if (condition) { ... }`
- **Space after function name** `function name (arg) { ... }`
- Name the context variable `self` – `var self = this`
  - Accidental [`window.self`][4] usage is dissallowed (happens when `var self = this` is
    omitted)
- Always use `===` instead of `==` – but `obj == null` is allowed to check `null || undefined`.
- Always handle the node.js `err` function parameter
- Always prefix browser globals with `window` – except `document` and `navigator` are okay
  - Prevents accidental use of poorly-named browser globals like `open`, `length`,
    `event`, and `name`.
- **And more goodness** – *give `standard` a try today!*

[1]: http://blog.izs.me/post/2353458699/an-open-letter-to-javascript-leaders-regarding
[2]: http://inimino.org/~inimino/blog/javascript_semicolons
[3]: https://github.com/maxogden/messages/issues/18
[4]: https://developer.mozilla.org/en-US/docs/Web/API/Window.self

To get a better idea, take a look at
[a sample file](https://github.com/feross/bittorrent-dht/blob/master/client.js) written
in JavaScript Standard Style, or check out some of [the repositories](https://github.com/feross/standard/blob/master/test/clone.js) that use `standard`.

## Badge

Use this in one of your projects? Include one of these badges in your readme to
let people know that your code is using the standard style.

[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)

```markdown
[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)
```

[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)

```markdown
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)
```

## Usage

The easiest way to use JavaScript Standard Style to check your code is to install it
globally as a Node command line program. To do so, simply run the following command in
your terminal (flag `-g` installs `standard` globally on your system, omit it if you want
to install in the current working directory):

```bash
npm install standard -g
```

After you've done that you should be able to use the `standard` program. The simplest use
case would be checking the style of all JavaScript files in the current working directory:

```
$ standard
Error: Use JavaScript Standard Style
  lib/torrent.js:950:11: Expected '===' and instead saw '=='.
```

### Editor plugins

First, install `standard`. Then, install the appropriate plugin for your editor:

- **[Vim](https://github.com/scrooloose/syntastic)** - Install [Syntastic](https://github.com/scrooloose/syntastic) and add `let g:syntastic_javascript_checkers = ['standard']` to your `.vimrc`.
- **[Sublime Text](https://github.com/Flet/Sublimelinter-contrib-standard)** - Install [Package Control](https://packagecontrol.io/), [SublimeLinter](http://www.sublimelinter.com/en/latest/), and [SublimeLinter-contrib-standard](https://github.com/Flet/Sublimelinter-contrib-standard).
- **[Atom](https://atom.io)** - Install [Linter](https://github.com/AtomLinter/Linter) and [linter-js-standard](https://github.com/ricardofbarros/linter-js-standard).

### What you might do if you're clever

1. Add it to `package.json`

  ```json
  {
    "name": "my-cool-package",
    "devDependencies": {
      "standard": "^3.0.0"
    },
    "scripts": {
      "test": "standard && node my-tests.js"
    }
  }
  ```

2. Check style automatically when you run `npm test`

  ```
  $ npm test
  Error: Use JavaScript Standard Style
    lib/torrent.js:950:11: Expected '===' and instead saw '=='.
  ```

3. Never give style feedback on a pull request again!

## FAQ

### Why would I use JavaScript Standard Style?

The beauty of JavaScript Standard Style is that it's simple. No one wants to maintain
multiple hundred-line style configuration files for every module/project they work on.
Enough of this madness!

This module saves you time in two ways:

- **No configuration.** The easiest way to enforce consistent style in your
  module/project. Just drop it in.
- **Catch style errors before they're submitted in PRs.** Saves precious code review time
  by eliminating back-and-forth between maintainer and contributor.

### How do I ignore files?

The paths `node_modules/`, `.git/`, `*.min.js`, `bundle.js`, and `coverage/` are automatically excluded
when looking for `.js` files to style check.

Sometimes you need to ignore additional folders or specific minfied files. To do that, add
a `standard.ignore` property to `package.json`:

```json
"standard": {
  "ignore": [
    "**/out/**",
    "**/lib/select2/**",
    "**/lib/ckeditor/**"
  ]
}
```

### Is there an automatic formatter?

Yes! Just run `standard --format filename.js`. This uses
[Max Ogden](https://github.com/maxogden)'s automatic formatter
[`standard-format`](https://github.com/maxogden/standard-format), which can automatically
fix most code issues.

While most issues can be fixed, some, like not handling errors, must be fixed manually.

### How do I hide a certain warning?

In rare cases, you'll need to break a rule and hide the warning generated by `standard`.

JavaScript Standard Style uses [`eslint`](http://eslint.org/) under-the-hood and you can
hide warnings as you normally would if you used `eslint` directly.

To get verbose output (so you can find the particular rule name to ignore), run:

```bash
$ standard --verbose
Error: Use JavaScript Standard Style
  routes/error.js:20:36: 'file' was used before it was defined. (no-use-before-define)
```

Disable **all rules** on a specific line:

```js
file = 'I know what I am doing' // eslint-disable-line
```

Or, disable **only** the `"no-use-before-define"` rule:

```js
file = 'I know what I am doing' // eslint-disable-line no-use-before-define
```

Or, disable the `"no-use-before-define"` rule for **multiple lines**:

```js
/*eslint-disable no-use-before-define */
// offending code here...
// offending code here...
// offending code here...
/*eslint-enable no-use-before-define */
```

### Can you please add more config options?

No. Use `eslint` directly if you want that. Pro tip: Just use `standard` and move on.
There are actual real problems that you could spend your time solving! :P

### Why can't I pipe standard to other tools?

`standard` prints to `stderr`. This means that tools that read from `stdout` won't be
able to read its output. The solution is to make `standard` print to `stdout` instead:

```sh
standard 2>&1 | grep variable
```

### What about Web Workers?

Web workers have a magic global variable called `self`. In regular JS files, `standard`
won't let you use `self` directly, as it wants to prevent accidental use of
`window.self`. But `standard` has no way of knowing when you are in a `worker` and
therefore does not know when to allow usage of `self` directly.

Until we figure out a better solution, we recommend adding this to the top of workers:

```
/* global self */
```

This lets `standard` (as well as humans reading your code) know that `self` is a global
in web worker code.

### Is there a Git `pre-commit` hook for `standard`?

Funny you should ask!

```sh
#!/bin/sh
# Ensure all javascript files staged for commit pass standard code style
git diff --name-only --cached --relative | grep '\.js$' | xargs standard
exit $?
```

## License

MIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org).


text:
var page = require('webpage').create();

var dragRect;
var dropRect;

page.onConsoleMessage = function(message) {
  console.log(message);
}

page.open("html/dragdrop.html")
  .then(function() {
    return page.injectJs("libs/keylogger.js");
  })
  .then(function() {
    return page.evaluate(function() {
      var ret = [document.querySelector("#dragme").getBoundingClientRect(),
              document.querySelector("#dropme").getBoundingClientRect()];
      return ret;
    });
  })
  .then(function(rects) {
    dragRect = rects[0];
    dropRect = rects[1];
    return page.sendEvent('mousedown', dragRect.left + 5, dragRect.top + 5);
  })
  .then(function() {
    return page.sendEvent('mousemove', dropRect.left + 5, dropRect.top + 5);
  })
  .then(function() {
    return page.sendEvent('mouseup', dropRect.left + 5, dropRect.top + 5);
  })
  .then(function() {
    return phantom.wait(500);
  })
  .then(function() {
    return page.render("dragdrop.png");
  })
  .then(function() { console.log("success!"); },
        function(error) { console.log("error! " + error + "\n" + error.stack); })
  .then(phantom.exit)


text:
package org.elasticsearch.test.search.suggest.completion;

import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.geo.GeoPoint;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.json.JsonXContent;
import org.elasticsearch.search.suggest.completion.context.GeoQueryContext;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.equalTo;

public class GeoQueryContextTests extends QueryContextTestCase<GeoQueryContext> {

    public static GeoQueryContext randomGeoQueryContext() {
        final GeoQueryContext.Builder builder = GeoQueryContext.builder();
        builder.setGeoPoint(new GeoPoint(randomDouble(), randomDouble()));
        maybeSet(builder::setBoost, randomIntBetween(1, 10));
        maybeSet(builder::setPrecision, randomIntBetween(1, 12));
        List<Integer> neighbours = new ArrayList<>();
        for (int i = 0; i < randomIntBetween(1, 12); i++) {
            neighbours.add(randomIntBetween(1, 12));
        }
        maybeSet(builder::setNeighbours, neighbours);
        return builder.build();
    }

    @Override
    protected GeoQueryContext createTestModel() {
        return randomGeoQueryContext();
    }

    @Override
    protected GeoQueryContext fromXContent(XContentParser parser) throws IOException {
        return GeoQueryContext.fromXContent(parser);
    }

    public void testNullGeoPointIsIllegal() {
        final GeoQueryContext geoQueryContext = randomGeoQueryContext();
        final GeoQueryContext.Builder builder = GeoQueryContext.builder()
            .setNeighbours(geoQueryContext.getNeighbours())
            .setPrecision(geoQueryContext.getPrecision())
            .setBoost(geoQueryContext.getBoost());
        try {
            builder.build();
            fail("null geo point is illegal");
        } catch (NullPointerException e) {
            assertThat(e.getMessage(), equalTo("geoPoint must not be null"));
        }
    }

    public void testIllegalArguments() {
        final GeoQueryContext.Builder builder = GeoQueryContext.builder();

        try {
            builder.setGeoPoint(null);
            fail("geoPoint must not be null");
        } catch (NullPointerException e) {
            assertEquals(e.getMessage(), "geoPoint must not be null");
        }
        try {
            builder.setBoost(-randomIntBetween(1, Integer.MAX_VALUE));
            fail("boost must be positive");
        } catch (IllegalArgumentException e) {
            assertEquals(e.getMessage(), "boost must be greater than 0");
        }
        int precision = 0;
        try {
            do {
                precision = randomInt();
            } while (precision >= 1 && precision <= 12);
            builder.setPrecision(precision);
        } catch (IllegalArgumentException e) {
            assertEquals(e.getMessage(), "precision must be between 1 and 12");
        }
        try {
            List<Integer> neighbours = new ArrayList<>();
            neighbours.add(precision);
            for (int i = 1; i < randomIntBetween(1, 11); i++) {
                neighbours.add(i);
            }
            Collections.shuffle(neighbours, random());
            builder.setNeighbours(neighbours);
        } catch (IllegalArgumentException e) {
            assertEquals(e.getMessage(), "neighbour value must be between 1 and 12");
        }
    }

    public void testStringPrecision() throws IOException {
        XContentBuilder builder = jsonBuilder().startObject();
        {
            builder.startObject("context").field("lat", 23.654242).field("lon", 90.047153).endObject();
            builder.field("boost", 10);
            builder.field("precision", 12);
            builder.array("neighbours", 1, 2);
        }
        builder.endObject();
        XContentParser parser = createParser(JsonXContent.jsonXContent, BytesReference.bytes(builder));
        parser.nextToken();
        GeoQueryContext queryContext = fromXContent(parser);
        assertEquals(10, queryContext.getBoost());
        assertEquals(12, queryContext.getPrecision());
        assertEquals(Arrays.asList(1, 2), queryContext.getNeighbours());

        builder = jsonBuilder().startObject();
        {
            builder.startObject("context").field("lat", 23.654242).field("lon", 90.047153).endObject();
            builder.field("boost", 10);
            builder.field("precision", "12m");
            builder.array("neighbours", "4km", "10km");
        }
        builder.endObject();
        parser = createParser(JsonXContent.jsonXContent, BytesReference.bytes(builder));
        parser.nextToken();
        queryContext = fromXContent(parser);
        assertEquals(10, queryContext.getBoost());
        assertEquals(9, queryContext.getPrecision());
        assertEquals(Arrays.asList(6, 5), queryContext.getNeighbours());
    }
}


text:
require 'spec_helper'

describe Invitation do
  context 'validations' do
    subject { Invitation.new }

  it '#event' do
    should have(1).error_on(:event)
  end

  it '#role' do
    should have(1).error_on(:role)
  end
  end

  context '#student_spaces?' do
    it 'checks if there are any available spaces for students at the event' do
      student_invitation = Fabricate(:invitation)

      expect(student_invitation.student_spaces?).to eq(true)
    end
  end

  context '#coach_spaces?' do
    it 'checks if there are any available spaces for coaches at the event' do
      coach_invitation = Fabricate(:coach_invitation)

      expect(coach_invitation.coach_spaces?).to eq(true)
    end
  end
end


text:
/*****************************************************************************

  sc_fxnum_observer.h -

  Original Author: Martin Janssen, Synopsys, Inc.

 *****************************************************************************/

/*****************************************************************************

  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
  changes you are making here.

      Name, Affiliation, Date:
  Description of Modification:

 *****************************************************************************/

// $Log: sc_fxnum_observer.h,v $
// Revision 1.1.1.1  2006/12/15 20:20:04  acg
// SystemC 2.3
//
// Revision 1.3  2006/01/13 18:53:58  acg
// Andy Goodrich: added $Log command so that CVS comments are reproduced in
// the source.
//

#ifndef SC_FXNUM_OBSERVER_H
#define SC_FXNUM_OBSERVER_H

#include "sysc/datatypes/fx/sc_fxdefs.h"

namespace sc_dt
{

// classes defined in this module
class sc_fxnum_observer;
class sc_fxnum_fast_observer;

// forward class declarations
class sc_fxnum;
class sc_fxnum_fast;

#ifdef SC_ENABLE_OBSERVERS

#define SC_FXNUM_OBSERVER_CONSTRUCT_(object)                                  \
    SC_OBSERVER_(object,sc_fxnum_observer*,construct)
#define SC_FXNUM_OBSERVER_DESTRUCT_(object)                                   \
    SC_OBSERVER_(object,sc_fxnum_observer*,destruct)
#define SC_FXNUM_OBSERVER_READ_(object)                                       \
    SC_OBSERVER_(object,sc_fxnum_observer*,read)
#define SC_FXNUM_OBSERVER_WRITE_(object)                                      \
    SC_OBSERVER_(object,sc_fxnum_observer*,write)
#define SC_FXNUM_OBSERVER_DEFAULT_                                            \
    SC_OBSERVER_DEFAULT_(sc_fxnum_observer)

#define SC_FXNUM_FAST_OBSERVER_CONSTRUCT_(object)                             \
    SC_OBSERVER_(object,sc_fxnum_fast_observer*,construct)
#define SC_FXNUM_FAST_OBSERVER_DESTRUCT_(object)                              \
    SC_OBSERVER_(object,sc_fxnum_fast_observer*,destruct)
#define SC_FXNUM_FAST_OBSERVER_READ_(object)                                  \
    SC_OBSERVER_(object,sc_fxnum_fast_observer*,read)
#define SC_FXNUM_FAST_OBSERVER_WRITE_(object)                                 \
    SC_OBSERVER_(object,sc_fxnum_fast_observer*,write)
#define SC_FXNUM_FAST_OBSERVER_DEFAULT_                                       \
    SC_OBSERVER_DEFAULT_(sc_fxnum_fast_observer)

#else

#define SC_FXNUM_OBSERVER_CONSTRUCT_(object)
#define SC_FXNUM_OBSERVER_DESTRUCT_(object)
#define SC_FXNUM_OBSERVER_READ_(object)
#define SC_FXNUM_OBSERVER_WRITE_(object)
#define SC_FXNUM_OBSERVER_DEFAULT_

#define SC_FXNUM_FAST_OBSERVER_CONSTRUCT_(object)
#define SC_FXNUM_FAST_OBSERVER_DESTRUCT_(object)
#define SC_FXNUM_FAST_OBSERVER_READ_(object)
#define SC_FXNUM_FAST_OBSERVER_WRITE_(object)
#define SC_FXNUM_FAST_OBSERVER_DEFAULT_

#endif

// ----------------------------------------------------------------------------
//  CLASS : sc_fxnum_observer
//
//  Abstract base class for fixed-point types observers; arbitrary precision.
// ----------------------------------------------------------------------------

class sc_fxnum_observer
{

protected:

    sc_fxnum_observer() {}
    virtual ~sc_fxnum_observer() {}

public:

    virtual void construct( const sc_fxnum& );
    virtual void  destruct( const sc_fxnum& );
    virtual void      read( const sc_fxnum& );
    virtual void     write( const sc_fxnum& );

    static sc_fxnum_observer* (*default_observer) ();

};

// ----------------------------------------------------------------------------
//  CLASS : sc_fxnum_fast_observer
//
//  Abstract base class for fixed-point types observers; limited precision.
// ----------------------------------------------------------------------------

class sc_fxnum_fast_observer
{

protected:

    sc_fxnum_fast_observer() {}
    virtual ~sc_fxnum_fast_observer() {}

public:

    virtual void construct( const sc_fxnum_fast& );
    virtual void  destruct( const sc_fxnum_fast& );
    virtual void      read( const sc_fxnum_fast& );
    virtual void     write( const sc_fxnum_fast& );

    static sc_fxnum_fast_observer* (*default_observer) ();

};

// IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII

// ----------------------------------------------------------------------------
//  CLASS : sc_fxnum_observer
//
//  Abstract base class for fixed-point types observers; arbitrary precision.
// ----------------------------------------------------------------------------

inline
void
sc_fxnum_observer::construct( const sc_fxnum& )
{}

inline
void
sc_fxnum_observer::destruct( const sc_fxnum& )
{}

inline
void
sc_fxnum_observer::read( const sc_fxnum& )
{}

inline
void
sc_fxnum_observer::write( const sc_fxnum& )
{}

// ----------------------------------------------------------------------------
//  CLASS : sc_fxnum_fast_observer
//
//  Abstract base class for fixed-point types observers; limited precision.
// ----------------------------------------------------------------------------

inline
void
sc_fxnum_fast_observer::construct( const sc_fxnum_fast& )
{}

inline
void
sc_fxnum_fast_observer::destruct( const sc_fxnum_fast& )
{}

inline
void
sc_fxnum_fast_observer::read( const sc_fxnum_fast& )
{}

inline
void
sc_fxnum_fast_observer::write( const sc_fxnum_fast& )
{}

} // namespace sc_dt

#endif

// Taf!


text:
<?php
// connect
$dsn='mongodb://127.0.0.1/test';
$manager=new \mongoDB\Driver\Manager($dsn);//var_dump($manager);

// IO input
$write=new \MongoDB\Driver\BulkWrite();
$wc = new MongoDB\Driver\WriteConcern(1);//var_dump($wc->bsonSerialize());
// add
$write->insert(['_id'=>new \MongoDB\BSON\ObjectID(),'content'=>'test_content_1']);
//$write->insert(['_id'=>'new_id','content'=>'test_content_2']);
// update
//$write->update(['_id'=>'new_id'],['content'=>'test_content_3']);
// delete
//$write->delete(['_id'=>'new_id']);
// execute
$manager->executeBulkWrite('test.t2',$write,$wc);

// IO output
$query=new \MongoDB\Driver\Query(['content'=>['$exists'=>true]]);
// select
$cursors = $manager->executeQuery('test.t2',$query);
foreach($cursors as $cursor){
    echo $cursor->_id."\n";
}

// server
$servers=$manager->getServers();//var_dump($servers);
$server=$servers[0];//var_dump($server->getType());


text:
YUI.add('coverage-tests', function (Y, NAME) {

    var path = require('path'),
        http = require('http'),
        util = require('util'),
        arrowRoot =  path.join(__dirname, '../../../../'),
        coverage = require("../../../../lib/util/coverage.js"),
        path = require("path"),
        suite = new Y.Test.Suite(NAME),
        A = Y.Assert,
        self = this;

    /**
     * test addInstrumentcandidate
     */
    function testAddInstrumentCandidate() {

        console.log('<<dirname:' + __dirname);
        var file = __dirname + "/config/dummyconfig.js";
        coverage.addInstrumentCandidate(file);

    }

    /**
     * test unhookRequire
     */
    function testUnhookRequire() {
        coverage.unhookRequire();
    }

    /**
     * test hookRequire
     */
    function testHookRequire() {
        var verbose = {'a': 'b'};
        coverage.hookRequire(verbose);
    }

    /**
     * test getFinalCoverage
     */
    function testGetFinalCoverage() {
        coverage.getFinalCoverage();
    }

    /**
     * test writeReports
     */
    function testWriteReports() {
        var dir;
        coverage.writeReports(dir);
    }

    /**
     * test writeReportsFor
     */
    function testWriteReportsFor() {
        var fileList = [],
            dir = __dirname + "/config/tmp";

        fileList[0] = "a";
        fileList[1] = "b";

        //TODO - Doesnt work
       // coverage.writeReportsFor(fileList,dir);
    }

    /**
     * test instrumentCode
     */
    function testInstrumentCode() {
        var code = ' aaa', filename = "";
        coverage.instrumentCode(code, filename);
    }

    /**
     * test instrumentFile
     */
    function testInstrumentFile() {
        var file = __dirname + "/config/configoverride.js";
        coverage.instrumentFile(file);
    }

    /**
     * test addCoverage
     */
    function testAddCoverage() {
        var coverageobject;
        //TODO - Doesnt work , intialize object properly
        //coverage.addCoverage(coverageobject);
    }

    /**
     * test collector add coverage
     */
    function testCollectorAddCoverage() {
        var collector, coverageObj; // TODO - doesnt work - method not exposed
        //coverage.collectorAddCoverage(collector,coverageObj);
    }

    suite.add(new Y.Test.Case({

        'setUp': function () {
           //console.log('>>>setup Coverage tests');
        },

        'tearDown': function () {
            //console.log('>>>teardown Coverage tests');
        },

        'test coverage Add Instrument candidate': function () {
            testAddInstrumentCandidate();
        },

        'test coverage unhook require': function () {
            testUnhookRequire();
        },

        'test coverage hook require': function () {
            testHookRequire();
        },

        'test coverage get final coverage': function () {
            testGetFinalCoverage();
        },

        'test coverage instrument code': function () {
            testInstrumentCode();
        },

        'test coverage instrument file': function () {
            testInstrumentFile();
        },

        'test coverage add coverage': function () {
            testAddCoverage();
        },

        'test coverage get write reports': function () {
            testWriteReports();
        },

        'test coverage get write reports for': function () {
            testWriteReportsFor();
        },

        'test coverage collector add coverage': function () {
            testCollectorAddCoverage();
        }

    }));

    Y.Test.Runner.add(suite);
}, '0.0.1' ,{requires:['test']});


text:
<?php
/**
 * Created by PhpStorm.
 * User: Bohdan
 * Date: 30.04.2017
 * Time: 13:10
 */
use yii\bootstrap\ActiveForm;

?>
<?php $form = ActiveForm::begin([
    'method' => 'get',
    'enableAjaxValidation'   => false,
    'id' => 'work-time-search'
]); ?>
<?= $form->field($model, 'dateRange')->widget(\kartik\daterange\DateRangePicker::className(), [
    'model' => $model,
    'attribute'  => 'dateRange',
    'hideInput' => true,
    'pluginOptions' => [
        'locale' => [
            'format' => 'DD.MM.YYYY'
        ],
        'ranges' => !empty($ranges) ? $ranges : []
    ],
])?>
<?= $form->field($model, 'PersonID')->widget(\kartik\select2\Select2::className(), [
    'model' => $model,
    'attribute' => 'PersonID',
    'data' => \common\models\cf\PersonsRecord::find()
        ->leftJoin('tpersonsgroup', 'tpersons.GroupID=tpersonsgroup.ID')
        ->select(['CONCAT(tpersons.LastName, " ", tpersons.FirstName)', 'tpersons.ID'])
        ->where(['tpersonsgroup.IsStuff' => 1])
        ->indexBy('ID')->column(),
    'pluginOptions' => [
        'allowClear' => true,
        'placeholder' => 'Выберите сотрудника...',
    ],
    'pluginEvents' => [
    'change' => 'function() { $("#work-time-search").submit() }',
]
])?>
<?php ActiveForm::end(); ?>


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<command-request>
    <deployment-id>org.test:kjar:1.0</deployment-id>
    <ver>6.2.1.1</ver>
    <start-process processId="my.process.id">
        <parameter>
            <item key="variable-name">
                <value xsi:type="user" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                    <age>23</age>
                    <name>Dan</name>
                    <userId>id</userId>
                </value>
            </item>
        </parameter>
    </start-process>
</command-request>


text:
<?php

Wind::import('SRC:library.base.PwBaseDao');

class PwEmotionDao extends PwBaseDao
{
    protected $_pk = 'emotion_id';
    protected $_table = 'common_emotion';
    protected $_dataStruct = ['emotion_id', 'category_id', 'emotion_name', 'emotion_folder', 'emotion_icon', 'vieworder', 'isused'];

    public function getEmotion($emotionId)
    {
        return $this->_get($emotionId);
    }

    public function fetchEmotion($emotionIds)
    {
        return $this->_fetch($emotionIds, 'emotion_id');
    }

    public function fetchEmotionByCatid($categoryIds)
    {
        $sql = $this->_bindSql('SELECT * FROM %s WHERE isused = 1 AND category_id IN %s ORDER BY vieworder ASC ', $this->getTable(), $this->sqlImplode($categoryIds));
        $smt = $this->getConnection()->createStatement($sql);

        return $smt->queryAll([]);
    }

    public function getListByCatid($categoryId, $isUsed = null)
    {
        $where = 'WHERE category_id =?';
        $_array = [$categoryId];
        if (isset($isUsed)) {
            $where .= ' AND isused = ? ';
            $_array[] = $isUsed;
        }
        $sql = $this->_bindSql('SELECT * FROM %s %s ORDER BY vieworder ASC', $this->getTable(), $where);
        $smt = $this->getConnection()->createStatement($sql);

        return $smt->queryAll($_array, 'emotion_id');
    }

    public function getAllEmotion()
    {
        $sql = $this->_bindTable('SELECT * FROM %s');
        $smt = $this->getConnection()->createStatement($sql);

        return $smt->queryAll([], 'emotion_id');
    }

    public function addEmotion($data)
    {
        return $this->_add($data);
    }

    public function updateEmotion($emotionId, $data)
    {
        return $this->_update($emotionId, $data);
    }

    public function deleteEmotion($emotionId)
    {
        return $this->_delete($emotionId);
    }

    public function deleteEmotionByCatid($cateId)
    {
        $sql = $this->_bindTable('DELETE FROM %s WHERE category_id=?');
        $smt = $this->getConnection()->createStatement($sql);
        $smt->update([$cateId]);
        PwSimpleHook::getInstance('PwEmotionDao_deleteEmotionByCatid')->runDo($cateId);

        return true;
    }
}


text:
package org.knowm.xchange.latoken.dto.exchangeinfo;

import com.fasterxml.jackson.annotation.JsonProperty;

public class LatokenRateLimit {

  private final String endpoint;
  private final String timePeriod;
  private final long requestLimit;

  /**
   * C'tor
   *
   * @param endpoint
   * @param timePeriod
   * @param requestLimit
   */
  public LatokenRateLimit(
      @JsonProperty("endpoint") String endpoint,
      @JsonProperty("timePeriod") String timePeriod,
      @JsonProperty("requestLimit") long requestLimit) {

    this.endpoint = endpoint;
    this.timePeriod = timePeriod;
    this.requestLimit = requestLimit;
  }

  /**
   * API endpoint with method type
   *
   * @return
   */
  public String getEndpoint() {
    return endpoint;
  }

  /**
   * Time limit of requests
   *
   * @return
   */
  public String getTimePeriod() {
    return timePeriod;
  }

  /**
   * Amount of requests allowed in time period
   *
   * @return
   */
  public long getRequestLimit() {
    return requestLimit;
  }

  @Override
  public String toString() {
    return "LatokenRateLimit [endpoint = "
        + endpoint
        + ", timePeriod = "
        + timePeriod
        + ", requestLimit = "
        + requestLimit
        + "]";
  }
}


text:
const { Cyton } = require('openbci');
const {
    OBCIEmitterSample,
    OBCISimulatorPortName
} = require('openbci-utilities/dist/constants');
const { fromEvent } = require('rxjs/observable/fromEvent');
const { map } = require('rxjs/operators/map');

const { renameDataProp, onExit } = require('./utils');

class CytonObservable extends Cyton {

    constructor (...options) {
        super(...options);
        this.stream = fromEvent(this, OBCIEmitterSample)
            .pipe(map(renameDataProp));
        this.init();
        onExit(this);
    }

    async start () {
        this.on('ready', async () => {
            try {
                await this.streamStart();
            } catch (e) {}
        });
    }

    async init () {
        try {
            this._portName = await this.autoFindOpenBCIBoard();
        } catch (error) {
            this._portName = OBCISimulatorPortName;
        }
    }
}

module.exports = CytonObservable;


text:
package com.axway.ats.core.reflect;

import java.io.File;
import java.io.FileInputStream;

public class MethodFinderTester {

    public void ambiguousMethod(
                                 File arg0 ) {

    }

    public void ambiguousMethod(
                                 FileInputStream arg0 ) {

    }

    public void testMethodStringArg(
                                     String arg0 ) {

    }
}


text:
"""
Copyright 2011 Elliot Murphy

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
"""

from memo import memoized

class World2dGrid:
    def __init__(self, width=400, height=600):
        self.width = width
        self.height = height
        self.latitude_offset = 90
        self.longitude_offset = 180
        self.width_scale_factor = width / 360
        self.height_scale_factor = height / 180

    def calculate_bucket_simple(self, latitude, longitude):
        """Very simple bucket calculation."""
        assert -90.0 <= latitude <= 90.0, "impossible latitude"
        assert -180 <= longitude <= 180, "impossible longitude"
        latitude = latitude + self.latitude_offset
        longitude = longitude + self.longitude_offset
        return (int(latitude * self.height_scale_factor),
                int(longitude * self.width_scale_factor))

    def calculate_bucket_geohash(self, latitude, longitude):
        """Calculate bucket using geohash algorithm

        http://en.wikipedia.org/wiki/Geohash"""
        raise NotImplementedError

    def calculate_bucket_csquares(self, latitude, longitude):
        """Calculate bucket using C-Squares method

        http://en.wikipedia.org/wiki/C-squares"""
        raise NotImplementedError

@memoized
def _get_world_grid(horizontal_slices, vertical_slices):
    """Construct a World2dGrid Object of the correct size"""
    return World2dGrid(width=horizontal_slices, height=vertical_slices)

def grid_id(latitude, longitude, horizontal_slices, vertical_slices):
    """Given a location, calculate the grid ID."""
    grid = _get_world_grid(horizontal_slices, vertical_slices)
    return grid.calculate_bucket_simple(latitude, longitude)


text:
package org.springframework.jdbc.core;

import java.sql.SQLException;
import java.sql.Statement;

import org.springframework.dao.DataAccessException;

/**
 * Generic callback interface for code that operates on a JDBC Statement.
 * Allows to execute any number of operations on a single Statement,
 * for example a single {@code executeUpdate} call or repeated
 * {@code executeUpdate} calls with varying SQL.
 *
 *
Used internally by JdbcTemplate, but also useful for application code.
 *
 * @author Juergen Hoeller
 * @since 16.03.2004
 * @see JdbcTemplate#execute(StatementCallback)
 */
public interface StatementCallback<T> {

	/**
	 * Gets called by {@code JdbcTemplate.execute} with an active JDBC
	 * Statement. Does not need to care about closing the Statement or the
	 * Connection, or about handling transactions: this will all be handled
	 * by Spring's JdbcTemplate.
	 *
	 *
NOTE: Any ResultSets opened should be closed in finally blocks
	 * within the callback implementation. Spring will close the Statement
	 * object after the callback returned, but this does not necessarily imply
	 * that the ResultSet resources will be closed: the Statement objects might
	 * get pooled by the connection pool, with {@code close} calls only
	 * returning the object to the pool but not physically closing the resources.
	 *
	 *
If called without a thread-bound JDBC transaction (initiated by
	 * DataSourceTransactionManager), the code will simply get executed on the
	 * JDBC connection with its transactional semantics. If JdbcTemplate is
	 * configured to use a JTA-aware DataSource, the JDBC connection and thus
	 * the callback code will be transactional if a JTA transaction is active.
	 *
	 *
Allows for returning a result object created within the callback, i.e.
	 * a domain object or a collection of domain objects. Note that there's
	 * special support for single step actions: see JdbcTemplate.queryForObject etc.
	 * A thrown RuntimeException is treated as application exception, it gets
	 * propagated to the caller of the template.
	 *
	 * @param stmt active JDBC Statement
	 * @return a result object, or {@code null} if none
	 * @throws SQLException if thrown by a JDBC method, to be auto-converted
	 * to a DataAccessException by a SQLExceptionTranslator
	 * @throws DataAccessException in case of custom exceptions
	 * @see JdbcTemplate#queryForObject(String, Class)
	 * @see JdbcTemplate#queryForRowSet(String)
	 */
	T doInStatement(Statement stmt) throws SQLException, DataAccessException;

}


text:
<?php
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');

jimport('joomla.html.html');
jimport('joomla.form.formfield');
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');
//include('components/com_linkeddata/configuration.php');

class JFormFieldGroupSelect extends JFormFieldList {

	protected $type = 'Groupselect';

	public function getGroups($return_all) {
		$db = JFactory::getDBO();

		$query = 'SELECT id, title FROM #__usergroups';
		$db->setQuery($query);
		$groups = $db->loadRowList();

		if (!$return_all) {
			$query = 'SELECT gid FROM #__weblab';
                	$db->setQuery($query);
                	$weblab_groups = $db->loadResultArray();

			$return_groups = array();

			foreach($groups as $group) {
				if(!in_array($group[0], $weblab_groups)) {
					array_push($return_groups, $group);
				}
			}

			return $return_groups;
		} else {
			return $groups;
		}
	}

	private function getGroupName($gid) {
		 $db = JFactory::getDBO();

                $query = 'SELECT title FROM #__usergroups WHERE id=' . $gid;
                $db->setQuery($query);
                $group = $db->loadResult();
		return $group;

	}

	public function getInput() {
		if (array_key_exists("gid", $_GET)){
			if ($_GET["gid"] != null) {
				$groups = $this->getGroups(true);
                		$group_id = -1;
				$group_id = $_GET["gid"];
				//$result = '<select id="' . $this->id . '" name="' . $this->name . '">'; // TODO:EL disabled!
				$result = 'id  . ' " name="' . $this->name  . '">' . JText::_( 'COM_WEBLAB_WEBLAB_MODIFIYING') . ' ' . $this->getGroupName($group_id) .'';
				return $result;
			} else {
				$result = '<select id="' . $this->id . '" name="' . $this->name . '">';
				$groups = $this->getGroups(false);
                		$group_id = -1;
			}
		} else {
                	$result = '<select id="' . $this->id . '" name="' . $this->name . '">';
			$groups = $this->getGroups(false);
                	$group_id = -1;
                }

		//$result = '<select id="' . $this->id . '" name="' . $this->name . '">';
		foreach($groups as $group) {
			if ($group[0] == $group_id) {
				$result .= '<option selected="selected" value="' . $group[0]  . '">' . $group[1]  . '</option>';
			} else {
				$result .= '<option value="' . $group[0]  . '">' . $group[1]  . '</option>';
			}
		}
		$result .= '</select>';
		return $result;
	}
}


text:
var tape = require("tape")

var isSupported = require("../../lib/is-supported.js")

tape("test isSupported method", function(t) {
  t.true(isSupported(), "well, we run test on supported browser, so it should be ok here")
  t.end()
})


text:
/** @type {import("../../../../").LoaderDefinitionFunction} */
module.exports = function () {
	const callback = this.async();
	this.importModule("./module1", { baseUri: "webpack://" }, (err, exports) => {
		if (err) return callback(err);
		callback(null, `module.exports = ${JSON.stringify(exports.url)}`);
	});
};


text:
Xvfb it is virtual frame buffer, which allows you to run `[selenium]` GUI tests,
which do not prevent you from work on the computer.

Correct the xvfb file if needed and copy it to /etc/init.d/.
Make sure that it is executable.

====

And now you can start xvfb by:

> /etc/init.d/xvfb start

and stop xvfb by:

> /etc/init.d/xvfb stop

====

To start Xvfb automaticaly at boot time you can use:

> update-rc.d xvfb defaults 92

====

After this you can use --xvfb tia option.

This option enables using
DISPLAY option from `config/default-dir-config.js`

Default value is
DISPLAY=":1.5"
to be consistent with the xvfb script.

Probably some core context is here:
http://stackoverflow.com/questions/28601587/how-to-run-gui-test-via-squish-without-x-server/32857819#32857819


text:
Myriad supports multi-tenancy in the following ways:
- Myriad uses Mesos to assign ports for the Node Managers.  This means if to Node Managers run on the same host, they will both be able to
bind to a port and communicate
- Myriad provides mechanisms to distribute the hadoop binaries and configurations using [tarballs](https://github.com/apache/incubator-myriad/blob/master/docs/myriad-remote-distribution-configuration.md) or [Docker](https://github.com/apache/incubator-myriad/blob/master/docker/README.md).

This means it's entirely possible to run multiple Myriad Clusters on the same hardware. One potential issue to be aware of however is it
is often important when configuring yarn to use multiple directories.  If one needs to do this one should be careful and not use the directories
for to different Myriad frameworks.

---

Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.


text:
using Newtonsoft.Json;

namespace Loggly.Responses
{
    public abstract class EntryJsonResponseBase
    {
        [JsonProperty("total_events")]
        public int TotalEvents { get; set; }
        [JsonProperty("page")]
        public int Page { get; set; }
        [JsonProperty("timestamp")]
        public int TimeStamp { get; set; }
    }
    public class EntryJsonResponse<TMessage> : EntryJsonResponseBase
    {
        [JsonProperty("events")]
        public EventMessage<TMessage>[] Events { get; set; }
    }

    public class EntryJsonResponse : EntryJsonResponseBase
    {
        [JsonProperty("events")]
        public EventMessage[] Events { get; set; }
    }
}


text:
package org.karlsland.m3g;
import java.util.Arrays;
import java.util.List;

public class Appearance extends Object3D {

    native private void            jni_initialize         ();
    native private void            jni_finalize           ();
    native private CompositingMode jni_getCompositingMode ();
    native private Fog             jni_getFog             ();
    native private int             jni_getLayer           ();
    native private Material        jni_getMaterial        ();
    native private PolygonMode     jni_getPolygonMode     ();
    native private Texture2D       jni_getTexture         (int index);
    native private void            jni_setCompositingMode (CompositingMode compositingMode);
    native private void            jni_setFog             (Fog fog);
    native private void            jni_setLayer           (int layer);
    native private void            jni_setMaterial        (Material material);
    native private void            jni_setPolygonMode     (PolygonMode polygonMode);
    native private void            jni_setTexture         (int index, Texture2D texture);
    native private String          jni_print              ();

    private CompositingMode compositingMode;
    private Fog             fog;
    private Material        material;
    private PolygonMode     polygonMode;
    private List<Texture2D> textures;

    public Appearance () {
        this.compositingMode = null;
        this.fog             = null;
        this.material        = null;
        this.polygonMode     = null;
        this.textures        = Arrays.asList (new Texture2D[]{null,null});
        jni_initialize ();
    }

    @Override
    protected void finalize () {
        jni_finalize ();
    }

    public CompositingMode getCompositingMode () {
        return jni_getCompositingMode ();
    }

    public Fog getFog () {
        return jni_getFog ();
    }

    public int getLayer () {
        return jni_getLayer ();
    }

    public Material getMaterial () {
        return jni_getMaterial ();
    }

    public PolygonMode getPolygonMode () {
        return jni_getPolygonMode ();
    }

    public Texture2D getTexture (int index) {
        return jni_getTexture (index);
    }

    public void setCompositingMode (CompositingMode compositingMode) {
        jni_setCompositingMode (compositingMode);
        this.compositingMode = compositingMode;
    }

    public void setFog (Fog fg) {
        jni_setFog (fg);
        this.fog = fg;
    }

    public void setLayer (int layer) {
        jni_setLayer (layer);
    }

    public void setMaterial (Material mat) {
        jni_setMaterial (mat);
        this.material = mat;
    }

    public void setPolygonMode (PolygonMode polyMode) {
        jni_setPolygonMode (polyMode);
        this.polygonMode = polyMode;
    }

    public void setTexture (int index, Texture2D texture) {
        jni_setTexture (index, texture);
        this.textures.set(index, texture);
    }

    @Override
    public String toString () {
        return jni_print ();
    }

}


text:
using System;
using System.Text.RegularExpressions;
using Zone.Campaign.Templates.Model;

namespace Zone.Campaign.Templates.Services.Metadata
{
    /// <summary>
    /// Provides functions for processing JavaScript Server Pages files.
    /// </summary>
    public class JsspMetadataProcessor : IMetadataExtractor, IMetadataInserter
    {
        #region Fields

        private static readonly Regex MetadataRegex = new Regex(@"\<%--!(?<value>.*?)!--%\>\s*", RegexOptions.Compiled | RegexOptions.Singleline);

        private static readonly string MetadataFormat = string.Format("<%--!{0}{{0}}{0}!--%>{0}{{1}}", Environment.NewLine);

        private readonly IMetadataParser _metadataParser;

        private readonly IMetadataFormatter _metadataFormatter;

        #endregion

        #region Constructor

        /// <summary>
        /// Initializes a new instance of <see cref="JsspMetadataProcessor"/>
        /// </summary>
        public JsspMetadataProcessor()
        {
            _metadataParser = new MetadataProcessor();
            _metadataFormatter = new MetadataProcessor();
        }

        #endregion

        #region Methods

        /// <summary>
        /// Extract the code and metadata from raw JavaScript Server Pages file content.
        /// </summary>
        /// <param name="input">Raw JavaScript Server Pages file content</param>
        /// <returns>Class containing code content and metadata.</returns>
        public Template ExtractMetadata(string input)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }

            // Read metadata from first correctly formatted comment.
            var match = MetadataRegex.Match(input);
            var output = input;
            var metadata = new TemplateMetadata();
            if (match.Success)
            {
                for (var i = match.Groups["value"].Captures.Count - 1; i >= 0; i--)
                {
                    var fullCapture = match.Groups[0].Captures[i];
                    output = output.Remove(fullCapture.Index, fullCapture.Length);
                    metadata = _metadataParser.Parse(match.Groups["value"].Captures[i].Value);
                }
            }

            return new Template
            {
                Code = output,
                Metadata = metadata,
            };
        }

        /// <summary>
        /// Converts metadata and code into raw JavaScript Server Pages file content which can be written to disk.
        /// </summary>
        /// <param name="input">Metadata and code</param>
        /// <returns>Raw JavaScript Server Pages file content</returns>
        public string InsertMetadata(Template input)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }

            // Add comment to start of document.
            var formattedMetadata = _metadataFormatter.Format(input.Metadata);
            var code = string.Format(MetadataFormat, formattedMetadata, input.Code);
            return code;
        }

        #endregion
    }
}


text:
module Gitlab
  module Analytics
    module CycleAnalytics
      module StageEvents
        class CodeStageStart < SimpleStageEvent
          def self.name
            s_("CycleAnalyticsEvent|Issue first mentioned in a commit")
          end

          def self.identifier
            :code_stage_start
          end

          def object_type
            MergeRequest
          end

          def timestamp_projection
            issue_metrics_table[:first_mentioned_in_commit_at]
          end

          # rubocop: disable CodeReuse/ActiveRecord
          def apply_query_customization(query)
            issue_metrics_join = mr_closing_issues_table
              .join(issue_metrics_table)
              .on(mr_closing_issues_table[:issue_id].eq(issue_metrics_table[:issue_id]))
              .join_sources

            query.joins(:merge_requests_closing_issues).joins(issue_metrics_join)
          end
          # rubocop: enable CodeReuse/ActiveRecord
        end
      end
    end
  end
end


text:
class TokenConfigLoader : public ConfigLoader {
public:
  TokenConfigLoader();

  QSettings *createConfigInstance(const QString &organisation, const QString &application) override;
};

#endif //YDS_RESTAPICONFIGLOADER_H


text:
<?php

namespace GrumPHPTest\Unit\Parser\Php\Visitor;

use GrumPHP\Parser\ParseError;
use GrumPHP\Parser\Php\Visitor\ContextAwareVisitorInterface;
use GrumPHP\Parser\Php\Visitor\NoExitStatementsVisitor;

class NoExitStatementsVisitorTest extends AbstractVisitorTest
{
    /**
     * @return NoExitStatementsVisitor
     */
    protected function getVisitor(): ContextAwareVisitorInterface
    {
        return new NoExitStatementsVisitor();
    }

    /**
     * @test
     */
    function it_does_not_allow_exit_statements()
    {
        $code = <<<EOC
<?php
exit;
die('ok');
EOC;

        $errors = $this->visit($code);
        $this->assertCount(2, $errors);
        $this->assertEquals(ParseError::TYPE_ERROR, $errors[0]->getType());
        $this->assertEquals(2, $errors[0]->getLine());
        $this->assertEquals(3, $errors[1]->getLine());
    }

    /**
     * @test
     */
    function it_allows_code_with_no_exit_statements()
    {
        $code = <<<EOC
<?php
// Some valid code here...
EOC;

        $errors = $this->visit($code);
        $this->assertCount(0, $errors);
    }
}


text:
@interface JHCellConfig (DynamicHeight)

/// 简易方法
- (CGFloat)dynamicHeightCalResult;

/// 完整方法
- (CGFloat)dynamicHeightWithConfiguration:(void (^)(id cell))configuration
                               identifier:(NSString *)identifier
                               usingCache:(BOOL)usingCache;

@end


text:
package com.senla.bolkunets.autoservice.ui.menu.builder;

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

import com.senla.bolkunets.autoservice.api.exchange.IRequest;
import com.senla.bolkunets.autoservice.api.exchange.IResponse;
import com.senla.bolkunets.autoservice.response.IReceiverResponse;
import com.senla.bolkunets.autoservice.response.IReceiverResponseParams;
import com.senla.bolkunets.autoservice.ui.menu.Menu;
import com.senla.bolkunets.autoservice.ui.menu.MenuItem;
import com.senla.bolkunets.autoservice.ui.menu.actions.IAction;
import com.senla.bolkunets.autoservice.ui.menu.actions.ParametricalAction;
import com.senla.bolkunets.autoservice.ui.menu.actions.SimpleAction;
import com.senla.bolkunets.autoservice.ui.menu.actions.assemblies.additions.MasterAssembly;
import com.senla.bolkunets.autoservice.ui.menu.actions.assemblies.additions.OrderAssembly;
import com.senla.bolkunets.autoservice.ui.menu.actions.assemblies.FilePathExportAssembly;
import com.senla.bolkunets.autoservice.ui.menu.actions.assemblies.FilePathImportAssembly;
import com.senla.bolkunets.autoservice.ui.menu.actions.assemblies.additions.AdditonGarageToOrder;
import com.senla.bolkunets.autoservice.ui.menu.actions.assemblies.additions.AdditonMasterToOrder;
import com.senla.bolkunets.autoservice.ui.menu.actions.assemblies.additions.GarageAssembly;
import com.senla.bolkunets.autoservice.ui.menu.actions.assemblies.deleting.DeletingGarageFromOrder;
import com.senla.bolkunets.autoservice.ui.menu.actions.assemblies.deleting.DeletingMasterFromOrder;
import com.senla.bolkunets.autoservice.ui.menu.actions.assemblies.garage.DateFreeAssembly;
import com.senla.bolkunets.autoservice.ui.menu.actions.assemblies.order.IdMasterAssembly;
import com.senla.bolkunets.autoservice.ui.menu.actions.assemblies.order.IdOrderAssembly;
import com.senla.bolkunets.autoservice.ui.menu.actions.assemblies.order.IntervalDateAssembly;
import com.senla.bolkunets.autoservice.ui.menu.actions.assemblies.order.ShiftOrder;
import com.senla.bolkunets.autoservice.ui.menu.actions.assemblies.selection.SelectGarageAssembly;
import com.senla.bolkunets.autoservice.ui.menu.actions.assemblies.selection.SelectMasterAssembly;
import com.senla.bolkunets.autoservice.ui.menu.actions.assemblies.selection.SelectOrderAssembly;
import com.senla.bolkunets.autoservice.ui.menu.controller.MenuController;
import com.senla.bolkunets.autoservice.ui.utils.Printer;
import com.senla.bolkunets.autoservice.view.facade.FacadeAutoservice;

public class MenuBuilder {
	private Menu rootMenu;

	private Menu createOrdersMenu(Menu menu) {

		MenuItem back = new MenuItem().setTitle("Back").setNextMenu(menu);

		MenuItem itemAddOrder = new MenuItem().setTitle("Add order")
				.setAction(new ParametricalAction(new IReceiverResponseParams() {
					@Override
					public IResponse receivResponse(IRequest request) {
						return FacadeAutoservice.getInstance().addOrder(request);
					}
				}, new OrderAssembly()));

		MenuItem itemCloneOrder = new MenuItem().setTitle("Clone order")
				.setAction(new ParametricalAction(new IReceiverResponseParams() {
					@Override
					public IResponse receivResponse(IRequest request) {
						return FacadeAutoservice.getInstance().cloneOrder(request);
					}
				}, new IdOrderAssembly()));

		MenuItem removeOrder = new MenuItem().setTitle("Remove order")
				.setAction(new ParametricalAction(new IReceiverResponseParams() {
					@Override
					public IResponse receivResponse(IRequest request) {
						return FacadeAutoservice.getInstance().deleteOrder(request);
					}
				}, new SelectOrderAssembly()));

		MenuItem allOrders = new MenuItem().setTitle("Show orders")
				.setAction(new SimpleAction(new IReceiverResponse() {
					@Override
					public IResponse receivResponse() {
						return FacadeAutoservice.getInstance().getAllOrders();
					}
				}));

		MenuItem itemAddGarageToOrder = new MenuItem().setTitle("Set garage to order")
				.setAction(new ParametricalAction(new IReceiverResponseParams() {
					@Override
					public IResponse receivResponse(IRequest request) {
						return FacadeAutoservice.getInstance().addGarageToOrder(request);
					}
				}, new AdditonGarageToOrder()));

		MenuItem itemRmGarageOrder = new MenuItem().setTitle("Delete garage from order")
				.setAction(new ParametricalAction(new IReceiverResponseParams() {
					@Override
					public IResponse receivResponse(IRequest request) {
						return FacadeAutoservice.getInstance().deleteGarageFromOrder(request);
					}
				}, new DeletingGarageFromOrder()));

		MenuItem itemAddMasterToOrder = new MenuItem().setTitle("Add master to order")
				.setAction(new ParametricalAction(new IReceiverResponseParams() {
					@Override
					public IResponse receivResponse(IRequest request) {
						return FacadeAutoservice.getInstance().addMaterToOrder(request);
					}
				}, new AdditonMasterToOrder()));

		MenuItem itemRmMasterOrder = new MenuItem().setTitle("Delete master from order")
				.setAction(new ParametricalAction(new IReceiverResponseParams() {
					@Override
					public IResponse receivResponse(IRequest request) {
						return FacadeAutoservice.getInstance().removeMasterFromOrder(request);
					}
				}, new DeletingMasterFromOrder()));

		MenuItem cancelOrder = new MenuItem().setTitle("Cancel order")
				.setAction(new ParametricalAction(new IReceiverResponseParams() {

					@Override
					public IResponse receivResponse(IRequest request) {
						return FacadeAutoservice.getInstance().cancelOrder(request);
					}
				}, new IdOrderAssembly()));

		MenuItem startingOrder = new MenuItem().setTitle("Start order")
				.setAction(new ParametricalAction(new IReceiverResponseParams() {

					@Override
					public IResponse receivResponse(IRequest request) {
						return FacadeAutoservice.getInstance().startOrder(request);
					}
				}, new IdOrderAssembly()));

		MenuItem orderByMaster = new MenuItem().setTitle("Show order by master")
				.setAction(new ParametricalAction(new IReceiverResponseParams() {
					@Override
					public IResponse receivResponse(IRequest entity) {
						return FacadeAutoservice.getInstance().showOrder(entity);
					}
				}, new IdMasterAssembly()));

		MenuItem ordersByDateInterval = new MenuItem().setTitle("Show orders in interval")
				.setAction(new ParametricalAction(new IReceiverResponseParams() {
					@Override
					public IResponse receivResponse(IRequest entity) {
						return FacadeAutoservice.getInstance().getOrdersSortPrice(entity);
					}
				}, new IntervalDateAssembly()));

		MenuItem ordersByDateConsulation = new MenuItem().setTitle("Show orders sorted by date consulation")
				.setAction(new SimpleAction(new IReceiverResponse() {
					@Override
					public IResponse receivResponse() {
						return FacadeAutoservice.getInstance().getOrdersSortDateConsulation();
					}
				}));

		MenuItem ordersByDateEnd = new MenuItem().setTitle("Show progress orders sorted by date end")
				.setAction(new SimpleAction(new IReceiverResponse() {
					@Override
					public IResponse receivResponse() {
						return FacadeAutoservice.getInstance().getOrdersProgressSortDateEnd();
					}
				}));

		MenuItem ordersByPrice = new MenuItem().setTitle("Show orders sorted by price")
				.setAction(new SimpleAction(new IReceiverResponse() {
					@Override
					public IResponse receivResponse() {
						return FacadeAutoservice.getInstance().getOrdersSortPrice();
					}
				}));

		MenuItem orderShift = new MenuItem().setTitle("Shift order")
				.setAction(new ParametricalAction(new IReceiverResponseParams() {
					@Override
					public IResponse receivResponse(IRequest entity) {
						return FacadeAutoservice.getInstance().shiftTime(entity);
					}
				}, new ShiftOrder()));

		MenuItem exportOrders = new MenuItem().setTitle("export orders")
				.setAction(new ParametricalAction(new IReceiverResponseParams() {
					@Override
					public IResponse receivResponse(IRequest request) {
						return FacadeAutoservice.getInstance().exportOrdersToCSV(request);
					}
				}, new FilePathExportAssembly()));

		MenuItem importOrders = new MenuItem().setTitle("import orders")
				.setAction(new ParametricalAction(new IReceiverResponseParams() {
					@Override
					public IResponse receivResponse(IRequest request) {
						return FacadeAutoservice.getInstance().importOrdersCSV(request);
					}
				}, new FilePathImportAssembly()));

		List<MenuItem> list = new ArrayList<>();
		list.add(back);
		list.add(itemAddOrder);
		list.add(itemCloneOrder);
		list.add(removeOrder);
		list.add(itemAddGarageToOrder);
		list.add(itemRmGarageOrder);
		list.add(itemAddMasterToOrder);
		list.add(itemRmMasterOrder);
		list.add(startingOrder);
		list.add(cancelOrder);
		list.add(allOrders);
		list.add(orderByMaster);
		list.add(ordersByDateInterval);
		list.add(ordersByDateConsulation);
		list.add(ordersByDateEnd);
		list.add(ordersByPrice);
		list.add(orderShift);
		list.add(exportOrders);
		list.add(importOrders);

		Menu resultMenu = new Menu();
		resultMenu.setName("OrdersMenu");
		resultMenu.setItems(list);

		return resultMenu;
	}

	private Menu createMastersMenu(Menu prevMenu) {

		MenuItem back = new MenuItem().setTitle("Back").setNextMenu(prevMenu);
		MenuItem itemAddMaster = new MenuItem().setTitle("Add master")
				.setAction(new ParametricalAction(new IReceiverResponseParams() {
					@Override
					public IResponse receivResponse(IRequest request) {
						return FacadeAutoservice.getInstance().addMaster(request);
					}
				}, new MasterAssembly()));

		MenuItem removeMaster = new MenuItem().setTitle("Remove master")
				.setAction(new ParametricalAction(new IReceiverResponseParams() {
					@Override
					public IResponse receivResponse(IRequest request) {
						return FacadeAutoservice.getInstance().removeMaster(request);
					}
				}, new SelectMasterAssembly()));

		MenuItem allMasters = new MenuItem().setTitle("Show masters")
				.setAction(new SimpleAction(new IReceiverResponse() {
					@Override
					public IResponse receivResponse() {
						return FacadeAutoservice.getInstance().getAllMasters();
					}
				}));

		MenuItem mastersBySt = new MenuItem().setTitle("Show masters sorted by status")
				.setAction(new SimpleAction(new IReceiverResponse() {

					@Override
					public IResponse receivResponse() {
						return FacadeAutoservice.getInstance().getMasterSortStatus();
					}
				}));

		MenuItem mastersByAlph = new MenuItem().setTitle("Show masters sorted by alphabet")
				.setAction(new SimpleAction(new IReceiverResponse() {

					@Override
					public IResponse receivResponse() {
						return FacadeAutoservice.getInstance().getMastersSortAlphabet();
					}
				}));

		MenuItem mastersOrder = new MenuItem().setTitle("Show masters who are doing the order")
				.setAction(new ParametricalAction(new IReceiverResponseParams() {

					@Override
					public IResponse receivResponse(IRequest request) {
						return FacadeAutoservice.getInstance().showListMaster(request);
					}
				}, new IdOrderAssembly()));

		MenuItem exportMasters = new MenuItem().setTitle("export masters")
				.setAction(new ParametricalAction(new IReceiverResponseParams() {
					@Override
					public IResponse receivResponse(IRequest request) {
						return FacadeAutoservice.getInstance().exportMastersToCSV(request);
					}
				}, new FilePathExportAssembly()));
		MenuItem importMasters = new MenuItem().setTitle("import masters")
				.setAction(new ParametricalAction(new IReceiverResponseParams() {
					@Override
					public IResponse receivResponse(IRequest request) {
						return FacadeAutoservice.getInstance().importMastersCSV(request);
					}
				}, new FilePathImportAssembly()));

		List<MenuItem> list = new ArrayList<>();
		list.add(back);
		list.add(itemAddMaster);
		list.add(removeMaster);
		list.add(allMasters);
		list.add(mastersOrder);
		list.add(mastersBySt);
		list.add(mastersByAlph);
		list.add(exportMasters);
		list.add(importMasters);

		Menu resultMenu = new Menu();
		resultMenu.setName("MastersMenu");
		resultMenu.setItems(list);

		return resultMenu;
	}

	private Menu createGarageMenu(Menu prevMenu) {
		MenuItem back = new MenuItem().setTitle("Back").setNextMenu(prevMenu);

		MenuItem itemAddGarage = new MenuItem().setTitle("Add garage")
				.setAction(new ParametricalAction(new IReceiverResponseParams() {
					@Override
					public IResponse receivResponse(IRequest request) {
						return FacadeAutoservice.getInstance().addGarage(request);
					}
				}, new GarageAssembly()));

		MenuItem itemAddPlaceGarage = new MenuItem().setTitle("Add place in garage")
				.setAction(new ParametricalAction(new IReceiverResponseParams() {
					@Override
					public IResponse receivResponse(IRequest request) {
						return FacadeAutoservice.getInstance().addPlaceToGarage(request);
					}
				}, new SelectGarageAssembly()));

		MenuItem itemDeletePlaceGarage = new MenuItem().setTitle("Delete place in garage")
				.setAction(new ParametricalAction(new IReceiverResponseParams() {
					@Override
					public IResponse receivResponse(IRequest request) {
						return FacadeAutoservice.getInstance().deletePlaceToGarage(request);
					}
				}, new SelectGarageAssembly()));

		MenuItem removeGarage = new MenuItem().setTitle("Remove garage")
				.setAction(new ParametricalAction(new IReceiverResponseParams() {
					@Override
					public IResponse receivResponse(IRequest request) {
						return FacadeAutoservice.getInstance().deleteGarage(request);
					}
				}, new SelectGarageAssembly()));

		MenuItem allGarages = new MenuItem().setTitle("Show garages")
				.setAction(new SimpleAction(new IReceiverResponse() {
					@Override
					public IResponse receivResponse() {
						return FacadeAutoservice.getInstance().getAllGarages();
					}
				}));

		MenuItem freeGarage = new MenuItem().setTitle("List empty places")
				.setAction(new SimpleAction(new IReceiverResponse() {
					@Override
					public IResponse receivResponse() {
						return FacadeAutoservice.getInstance().reportFreePlaceRigthNow();
					}
				}));

		MenuItem exportGarages = new MenuItem().setTitle("export garages")
				.setAction(new ParametricalAction(new IReceiverResponseParams() {
					@Override
					public IResponse receivResponse(IRequest request) {
						return FacadeAutoservice.getInstance().exportGaragesToCSV(request);
					}
				}, new FilePathExportAssembly()));

		MenuItem importGarages = new MenuItem().setTitle("import garages")
				.setAction(new ParametricalAction(new IReceiverResponseParams() {
					@Override
					public IResponse receivResponse(IRequest request) {
						return FacadeAutoservice.getInstance().importGaragesCSV(request);
					}
				}, new FilePathImportAssembly()));

		List<MenuItem> list = new ArrayList<>();
		list.add(back);
		list.add(itemAddGarage);
		list.add(removeGarage);
		list.add(itemAddPlaceGarage);
		list.add(itemDeletePlaceGarage);
		list.add(allGarages);
		list.add(freeGarage);
		list.add(exportGarages);
		list.add(importGarages);

		Menu resultMenu = new Menu();
		resultMenu.setName("GaragesMenu");
		resultMenu.setItems(list);

		return resultMenu;

	}

	public Menu buildMenu() {
		MenuItem itemExit = new MenuItem().setTitle("exit").setAction(new IAction() {

			@Override
			public void execute() {
				Printer.print("Au revoir");
				MenuController.isRun = false;
			}
		});

		MenuItem itemMaster = new MenuItem().setTitle("masters");
		MenuItem itemGarage = new MenuItem().setTitle("garages");
		MenuItem itemOrder = new MenuItem().setTitle("orders");
		MenuItem countPlace = new MenuItem().setTitle("Count free place per date")
				.setAction(new ParametricalAction(new IReceiverResponseParams() {
					@Override
					public IResponse receivResponse(IRequest request) {
						return FacadeAutoservice.getInstance().showCountFreePlace(request);
					}
				}, new DateFreeAssembly()));
		MenuItem nextFreeDate = new MenuItem().setTitle("Next free date")
				.setAction(new SimpleAction(new IReceiverResponse() {
					@Override
					public IResponse receivResponse() {
						return FacadeAutoservice.getInstance().showNextFreeDate();
					}
				}));

		List<MenuItem> list = new ArrayList<>();
		list.add(itemExit);
		list.add(itemMaster);
		list.add(itemGarage);
		list.add(itemOrder);
		list.add(countPlace);
		list.add(nextFreeDate);

		rootMenu = new Menu();
		rootMenu.setItems(list);

		itemMaster.setNextMenu(createMastersMenu(rootMenu));
		itemGarage.setNextMenu(createGarageMenu(rootMenu));
		itemOrder.setNextMenu(createOrdersMenu(rootMenu));

		return rootMenu;

	}

	public Menu getRootMenu() {
		return rootMenu;
	}

}


text:
<!DOCTYPE html>

	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

Argotify

			Écriture simplifiée (SMS)

			<input type="range" id="simplify" min="0" value="5" max="10" step="1" oninput="changeInput()">
			<output for="simplify" id="simplifyValue"></output>

			Verlan

			<input type="range" id="verlanify" min="0" value="3" max="10" step="1"oninput="changeInput()">
			<output for="verlanify" id="verlanifyValue"></output>

			Argot

			<input type="range" id="weshify" min="0" value="3" max="10" step="1"oninput="changeInput()">
			<output for="weshify" id="weshifyValue"></output>

		<textarea id="textarea"></textarea>

		<button onclick="changeInput()">Argotify</button>


text:
class CreateComments < ActiveRecord::Migration
  def change
    create_table :comments do |t|
      t.integer :commenter_id, null: false
      t.string :commentable_type, null: false
      t.string :commentable_id, null: false
      t.text :body, null: false
      t.timestamps
    end
  end
end