text:
package umich.cse.yctung.libacousticsensing.Audio;

import android.content.Context;
import android.media.AudioFormat;
import android.media.AudioManager;
import android.media.AudioRecord;
import android.media.AudioTrack;
import android.media.MediaRecorder;
import android.media.audiofx.AutomaticGainControl;
import android.media.audiofx.NoiseSuppressor;
import android.os.Handler;
import android.os.Message;
import android.os.Process;
import android.util.Log;

import umich.cse.yctung.libacousticsensing.Constant;
import umich.cse.yctung.libacousticsensing.Utils;

/**
 * Created by eddyxd on 1/22/17.
 */
public class AudioController {
    private String LOG_TAG = Constant.LOG_TAG+"_AudioController";
    final static boolean SHOW_DEBUG_INFO_TIME_MESSAGE=true;
    final static boolean SHOW_DEBUG_INFO_AUDIO_RECORDING=true;

    private static final int RECORDER_BYTE_PER_ELEMENT = 2; // 2 bytes in 16bit format
    private static final int RECORDER_BUFFER_ELEMENTS = 4800*2; // this is the size of audio buffer elements *** WARN: this number must be a multiple of  ***
    //private static final int RECORDER_BUFFER_ELEMENTS = 4800*4; // this is the size of audio buffer elements *** WARN: this number must be a multiple of  ***

    private static final int MESSAGE_TO_START_PLAY = 1;
    private static final int MESSAGE_TO_STOP_RECORD = 2;
    private static final int MESSAGE_PLAY_IS_STOPPED = 3;
    private static final int MESSAGE_RECORD_IS_STOPPED = 4;

    private static final int DELAY_TO_START_PLAY = 200; // ms, time to wait recordering thread before playing
    private static final int DELAY_TO_STOP_RECORD = 200; // ms, time to wait before actually ask recording thread to stop (so the last few signals will never lose)

    Context context;
    AudioSource audioSource;
    RecordSetting audioSetting;
    AudioControllerListener listener;

    // Android audio interfaces
    AudioRecord audioRecord;
    AudioTrack audioTrack;
    SensingTimer sensingTimer;

    // Internal status
    boolean keepSensing;
    //boolean isPlayingAndRecording;
    boolean startAndKeepRecording;
    boolean isRecording;
    boolean isPlaying;
    int delaySoundByOnce = -1;
    public long audioTotalRecordedSampleCnt = -1; // TODO: check the overflow issue

    public AudioController(Context context, AudioControllerListener listener, AudioSource audioSource, RecordSetting recordSetting) {
        this.context = context;
        this.listener = listener;
        sensingTimer = new SensingTimer();
        setAudioSource(audioSource);
        this.audioSetting = recordSetting;

        //setAudioSetting(recordSetting);
    }

    // this method is separated from constructor so the same AudioController can be used more than once
    public void setAudioSource(AudioSource audioSource) {
        this.audioSource = audioSource;
        int PLAYER_TOTAL_BUFFER_SIZE = 960*4*2; // just for debug, TODO: update to a better value

        // TODO: modify the stream type based on audioSource

        audioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, audioSource.sampleRate, AudioFormat.CHANNEL_OUT_MONO, AudioFormat.ENCODING_PCM_16BIT, PLAYER_TOTAL_BUFFER_SIZE, AudioTrack.MODE_STREAM);

        while( audioTrack.getState()==AudioTrack.STATE_UNINITIALIZED ){
            Log.e(LOG_TAG, "audioTrackState cant be initialized -> wait next try!");
            audioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, audioSource.sampleRate, AudioFormat.CHANNEL_OUT_MONO, AudioFormat.ENCODING_PCM_16BIT, PLAYER_TOTAL_BUFFER_SIZE, AudioTrack.MODE_STREAM);
        }
    }

    // this method is separated from constructor so the same AudioController can be used more than once
    /*
    public void setAudioSetting(RecordSetting audioSetting) {
        this.audioSetting = audioSetting;
        audioRecord = audioSetting.createNewAudioRecord();
    }
    */

    public boolean init(AudioSource audioSource, RecordSetting recordSetting) {
        if (keepSensing||isPlaying||isRecording) {
            Log.e(LOG_TAG, "[ERROR]: unable to init because the previous sensing is not stopped yet (forget to stop it?)");
            return false;
        }

        this.audioSetting = recordSetting; // TOOD: move it to a better way

        // *** WARN: uncomment this just for testing AGC ***
        //audioRecord = new AudioRecord(MediaRecorder.AudioSource.VOICE_RECOGNITION, recordSetting.recordFS, AudioFormat.CHANNEL_IN_STEREO, AudioFormat.ENCODING_PCM_16BIT, recordSetting.RECORDER_TOTAL_BUFFER_SIZE);
        audioRecord = new AudioRecord(recordSetting.audioSource, recordSetting.recordFS, AudioFormat.CHANNEL_IN_STEREO, AudioFormat.ENCODING_PCM_16BIT, recordSetting.RECORDER_TOTAL_BUFFER_SIZE);
        Log.w(LOG_TAG, "AudioSource = " + recordSetting.audioSource);

        // check noise supressor if need
        if (NoiseSuppressor.isAvailable()) {
            NoiseSuppressor nc = NoiseSuppressor.create(audioRecord.getAudioSessionId());
            if (nc != null) {
                //Log.d(LOG_TAG,"nc before enable = "+nc.getEnabled());
                //nc.setEnabled(true);
                //Log.d(LOG_TAG, "nc before enable = "+nc.getEnabled());
            }
        }

        if (AutomaticGainControl.isAvailable()) {
            AutomaticGainControl agc = AutomaticGainControl.create(audioRecord.getAudioSessionId());
            if (agc != null) {
            /*
            Log.d(LOG_TAG,"agc before disabled = "+agc.getEnabled());
            agc.setEnabled(false);
            Log.d(LOG_TAG, "agc before disabled = "+agc.getEnabled());
            */
            }
        }

        // *** END OF WARN: uncomment this just for testing AGC ***

        //audioRecord = new AudioRecord(MediaRecorder.AudioSource.VOICE_RECOGNITION, recordSetting.recordFS, AudioFormat.CHANNEL_IN_STEREO, AudioFormat.ENCODING_PCM_16BIT, recordSetting.RECORDER_TOTAL_BUFFER_SIZE);

        if (audioRecord.getState() != AudioRecord.STATE_INITIALIZED) {
            Log.e(LOG_TAG, "Unable to init AudioRecord class (forget to request the permission or using a wrong setting?)");
            return false;
        }

        keepSensing = false;
        startAndKeepRecording = false;
        isPlaying = false;
        isRecording = false;
        audioTotalRecordedSampleCnt = 0;
        return true;
    }

    public void startSensing() {
        keepSensing = true;
        startRecordAndThenPlayAudio();
    }

    public void stopSensing() {
        keepSensing = false; // NOTE: set this flag will enforce the play & recording thread to stop
        Log.w(LOG_TAG, "wait audio playing and recording terminate ...");
        while (isPlaying||isRecording);
        Log.w(LOG_TAG, "audio playing and recording has terminated!");
    }

    public void delaySoundBy (int delayBySamples) {
        Log.e(LOG_TAG, "Received delay samples in AC: " + delayBySamples);
        if (!isPlaying) return;
        delaySoundByOnce = delayBySamples;
    }

    /*
    public void destroy() {
        stopSensing();
        if (audioRecord!=null) {
            audioRecord.stop();
            audioRecord.release();
            audioRecord = null;
        }
        audioTrack.stop();
        audioTrack.release();
        audioTrack = null;
    }*/
//=================================================================================================
//  Internal help functions
//=================================================================================================
    private void startRecordAndThenPlayAudio() {
        // NOTE: it is necessary to ensure the audio is recording before playing the audio
        if (audioSetting.audioMode== RecordSetting.AUDIO_MODE_PLAY_AND_RECORD) {
            startRecording();
            sensingTimer.sendMessageDelayed(Message.obtain(null, MESSAGE_TO_START_PLAY), DELAY_TO_START_PLAY);
        } else if (audioSetting.audioMode== RecordSetting.AUDIO_MODE_PLAY_ONLY) {
            startPlaying();
        } else if (audioSetting.audioMode== RecordSetting.AUDIO_MODE_RECORD_ONLY) {
            startRecording();
        } else {
            Log.e(LOG_TAG, "[ERROR]: undefined audioMode="+audioSetting.audioMode);
        }
    }

    private void sensingEnd() {
        // TODO: tune the audio record/play to the begin
        // TODO: move the folder?

        keepSensing = false;
        listener.onAudioRecordAndPlayEnd();
    }
//=================================================================================================
//  Audio play related
//=================================================================================================
    private void startPlaying() {
        if(SHOW_DEBUG_INFO_TIME_MESSAGE) Log.d(LOG_TAG, "startPlaying() is called" + Utils.getTime());
        new Thread(new Runnable() {
            @Override
            public void run() {
                android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_URGENT_AUDIO);
                if(audioTrack==null){
                    Log.e(LOG_TAG, "[ERROR]: try to play a null audio track -> click the button too often?");
                    while(audioTrack==null) Log.e(LOG_TAG, "[ERROR]: wait mAudioTrack!=null");
                    Log.e(LOG_TAG, "[ERROR]: wait mAudioTrack!=null successfull, play it now");
                }
                isPlaying = true;
                audioTrack.play();
                keepAudioPlaying();
            }
        }).start();
    }
    private void keepAudioPlaying() {
        // NOTE the write is a block call, ref: http://stackoverflow.com/questions/38291469/android-audiotrack-write-blocks-for-the-whole-period-of-playback
        int writeCnt;
        writeCnt = audioTrack.write(audioSource.preamble, 0, audioSource.preamble.length);
        if (writeCnt!=audioSource.preamble.length) Log.e(LOG_TAG,"[ERROR]: wrong size of preamble is played by audioTrack, writeCnt="+writeCnt);
        // TODO: check if there will be a delay between several audioTrack write executions
        int playCnt=0;
        while (keepSensing) {
            if (audioSource.repeatCnt>0&&playCnt>=audioSource.repeatCnt) { // end of repeat audio playing
                break;
            }
            writeCnt = audioTrack.write(audioSource.signal, 0, audioSource.signal.length);
            if (delaySoundByOnce != -1) {
                Log.e(LOG_TAG, "Actually delaying sound in AC play loop: " + delaySoundByOnce);
                audioTrack.write(new short[delaySoundByOnce], 0, delaySoundByOnce);
                delaySoundByOnce = -1;
            }

            playCnt++;
        }
        isPlaying = false;
        Log.d(LOG_TAG, "Reach the end of keepAudioPlaying()");
        sensingTimer.sendMessage(Message.obtain(null, MESSAGE_PLAY_IS_STOPPED));
    }

//=================================================================================================
//  Audio record related
//=================================================================================================
    private void startRecording() {
        if(SHOW_DEBUG_INFO_TIME_MESSAGE) Log.d(LOG_TAG, "startRecording() is called at: " + Utils.getTime());
        new Thread(new Runnable() {
            @Override
            public void run() {
                android.os.Process.setThreadPriority(Process.THREAD_PRIORITY_URGENT_AUDIO);
                startAndKeepRecording = true; // it is a dummy flag now, try to design it carefully when there is something weird for the fisrt few sample recorded
                keepAudioRecording();
            }
        }).start();
    }
    private void keepAudioRecording() {
        byte[] byteBuffer = new byte[RECORDER_BUFFER_ELEMENTS * RECORDER_BYTE_PER_ELEMENT];
        audioTotalRecordedSampleCnt = 0; // init this log value to 0 for every recording
        audioRecord.startRecording();

        // start recording infinite loop (stop when playing is done)
        while(keepSensing){
            // start to record only when startAndKeepRecording is triggered
            if(startAndKeepRecording){
                int byteRead = audioRecord.read(byteBuffer, 0, RECORDER_BUFFER_ELEMENTS*RECORDER_BYTE_PER_ELEMENT);
                if(SHOW_DEBUG_INFO_AUDIO_RECORDING) Log.d(LOG_TAG, "byteRead = " + byteRead);
                if (byteRead > 4) {
                    Log.w(LOG_TAG, "First 4 bytes = (" + byteBuffer[0] + "," + byteBuffer[1] + "," + byteBuffer[2] + "," + byteBuffer[3] + ")");
                }
                if(byteRead != RECORDER_BUFFER_ELEMENTS * RECORDER_BYTE_PER_ELEMENT) Log.e(LOG_TAG, "[ERROR]: byteRead in audioRecord not matched! = "+byteRead);
                audioTotalRecordedSampleCnt += byteRead / (audioSetting.recordChCnt*RECORDER_BYTE_PER_ELEMENT); // only recorded the number of "sample" in each channel as a reference point
                listener.audioRecorded(byteBuffer.clone(), audioTotalRecordedSampleCnt);
                // TODO: save audio to file if need
                if(SHOW_DEBUG_INFO_AUDIO_RECORDING) Log.d(LOG_TAG, "end of one record");

                // check if need to stop
                if (!startAndKeepRecording || !keepSensing) {
                    Log.d(LOG_TAG, "recording need to stop");
                    if (startAndKeepRecording) {
                        startAndKeepRecording = false;
                        break;
                    }
                }
            } else {
                // do nothing, just clear the audio record buffer
                audioRecord.read(byteBuffer, 0, RECORDER_BUFFER_ELEMENTS * RECORDER_BYTE_PER_ELEMENT);
            }
        }

        // stop recording
        // *** just for debug ***
        // ref: http://stackoverflow.com/questions/5139739/android-audiorecord-wont-initialize-2nd-time
        audioRecord.stop();
        audioRecord.release();
        audioRecord = null;
        Log.w(LOG_TAG, "audioRecord is released");
    }

//=================================================================================================
//  Internal timer to help schedule (add delay) between executions
//=================================================================================================
    private class SensingTimer extends Handler {
        public void handleMessage(Message msg) {
            super.handleMessage(msg);
            if (SHOW_DEBUG_INFO_AUDIO_RECORDING) Log.d(LOG_TAG, "RecordTimer: get a message (what,arg1,arg2) = (" + msg.what + "," + msg.arg1 + "," + msg.arg2 + ")" + Utils.getTime());

            if (msg.what == MESSAGE_TO_START_PLAY) {
                startPlaying();
            } else if (msg.what == MESSAGE_PLAY_IS_STOPPED) {
                if (!isRecording) sensingEnd();
                else sensingTimer.sendMessageDelayed(Message.obtain(null, MESSAGE_TO_STOP_RECORD), DELAY_TO_STOP_RECORD);
            } else if (msg.what == MESSAGE_TO_STOP_RECORD) {
                startAndKeepRecording = false; // set it to false will force the recording thread to stop
            } else if (msg.what == MESSAGE_RECORD_IS_STOPPED) {
                if (!isPlaying) sensingEnd();
            } else {
                Log.e(LOG_TAG, "[ERROR]: undefined message type = "+msg.what);
            }
        }
    }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.meetup</groupId>
    <artifactId>spring-boot-workshop</artifactId>
    <version>1.0.3-SNAPSHOT</version>
    <name>spring-boot-workshop</name>
    <description>Spring Boot Workshop</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.3.2.RELEASE</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>
        <spring.boot.version>1.3.2.RELEASE</spring.boot.version>
        <codecentric.admin.version>1.3.2</codecentric.admin.version>
        <jackson.version>2.6.3</jackson.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-freemarker</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- These dependencies to be utilized for management console-->
        <dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-starter-client</artifactId>
            <version>${codecentric.admin.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jolokia</groupId>
            <artifactId>jolokia-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>

        <!-- ORM dependencies -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>

        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
        </dependency>

        <!-- Jackson dependencies -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-hibernate4</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jdk8</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jsr310</artifactId>
            <version>${jackson.version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <executable>true</executable>
                </configuration>
            </plugin>
            <plugin>
                <groupId>external.atlassian.jgitflow</groupId>
                <artifactId>jgitflow-maven-plugin</artifactId>
                <!-- not released yet version>1.0-m6</version -->
                <version>1.0-m5.1</version>
                <configuration>
                    <noDeploy>true</noDeploy>
                    <pushFeatures>true</pushFeatures>
                    <pushReleases>true</pushReleases>
                    <pushHotfixes>true</pushHotfixes>
                    <allowUntracked>true</allowUntracked>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>dev</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <!-- log configuration -->
                <logback.loglevel>INFO</logback.loglevel>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                    <version>${spring.boot.version}</version>
                </dependency>
            </dependencies>
        </profile>
    </profiles>
</project>

redpajama_set_name: RedPajamaGithub


text:
/**
 * ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
 * @version v13.1.1
 * @link http://www.ag-grid.com/
 * @license MIT
 */
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
var eventService_1 = require("../eventService");
var events_1 = require("../events");
var gridOptionsWrapper_1 = require("../gridOptionsWrapper");
var selectionController_1 = require("../selectionController");
var valueService_1 = require("../valueService/valueService");
var columnController_1 = require("../columnController/columnController");
var context_1 = require("../context/context");
var constants_1 = require("../constants");
var utils_1 = require("../utils");
var valueCache_1 = require("../valueService/valueCache");
var gridApi_1 = require("../gridApi");
var RowNode = (function () {
    function RowNode() {
        /** Children mapped by the pivot columns */
        this.childrenMapped = {};
        this.selected = false;
    }
    RowNode.prototype.setData = function (data) {
        var oldData = this.data;
        this.data = data;
        this.valueCache.onDataChanged();
        var event = this.createDataChangedEvent(data, oldData, false);
        this.dispatchLocalEvent(event);
    };
    RowNode.prototype.createDataChangedEvent = function (newData, oldData, update) {
        return {
            type: RowNode.EVENT_DATA_CHANGED,
            node: this,
            oldData: oldData,
            newData: newData,
            update: update
        };
    };
    RowNode.prototype.createLocalRowEvent = function (type) {
        return {
            type: type,
            node: this
        };
    };
    // similar to setRowData, however it is expected that the data is the same data item. this
    // is intended to be used with Redux type stores, where the whole data can be changed. we are
    // guaranteed that the data is the same entity (so grid doesn't need to worry about the id of the
    // underlying data changing, hence doesn't need to worry about selection). the grid, upon receiving
    // dataChanged event, will refresh the cells rather than rip them all out (so user can show transitions).
    RowNode.prototype.updateData = function (data) {
        var oldData = this.data;
        this.data = data;
        var event = this.createDataChangedEvent(data, oldData, true);
        this.dispatchLocalEvent(event);
    };
    RowNode.prototype.getRowIndexString = function () {
        if (this.rowPinned === constants_1.Constants.PINNED_TOP) {
            return 't-' + this.rowIndex;
        }
        else if (this.rowPinned === constants_1.Constants.PINNED_BOTTOM) {
            return 'b-' + this.rowIndex;
        }
        else {
            return this.rowIndex.toString();
        }
    };
    RowNode.prototype.createDaemonNode = function () {
        var oldNode = new RowNode();
        this.context.wireBean(oldNode);
        // just copy the id and data, this is enough for the node to be used
        // in the selection controller (the selection controller is the only
        // place where daemon nodes can live).
        oldNode.id = this.id;
        oldNode.data = this.data;
        oldNode.daemon = true;
        oldNode.selected = this.selected;
        oldNode.level = this.level;
        return oldNode;
    };
    RowNode.prototype.setDataAndId = function (data, id) {
        var oldNode = utils_1.Utils.exists(this.id) ? this.createDaemonNode() : null;
        var oldData = this.data;
        this.data = data;
        this.setId(id);
        this.selectionController.syncInRowNode(this, oldNode);
        var event = this.createDataChangedEvent(data, oldData, false);
        this.dispatchLocalEvent(event);
    };
    RowNode.prototype.setId = function (id) {
        // see if user is providing the id's
        var getRowNodeId = this.gridOptionsWrapper.getRowNodeIdFunc();
        if (getRowNodeId) {
            // if user is providing the id's, then we set the id only after the data has been set.
            // this is important for virtual pagination and viewport, where empty rows exist.
            if (this.data) {
                this.id = getRowNodeId(this.data);
            }
            else {
                // this can happen if user has set blank into the rowNode after the row previously
                // having data. this happens in virtual page row model, when data is delete and
                // the page is refreshed.
                this.id = undefined;
            }
        }
        else {
            this.id = id;
        }
    };
    RowNode.prototype.isPixelInRange = function (pixel) {
        return pixel >= this.rowTop && pixel < (this.rowTop + this.rowHeight);
    };
    RowNode.prototype.clearRowTop = function () {
        this.oldRowTop = this.rowTop;
        this.setRowTop(null);
    };
    RowNode.prototype.setFirstChild = function (firstChild) {
        if (this.firstChild === firstChild) {
            return;
        }
        this.firstChild = firstChild;
        if (this.eventService) {
            this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_FIRST_CHILD_CHANGED));
        }
    };
    RowNode.prototype.setLastChild = function (lastChild) {
        if (this.lastChild === lastChild) {
            return;
        }
        this.lastChild = lastChild;
        if (this.eventService) {
            this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_LAST_CHILD_CHANGED));
        }
    };
    RowNode.prototype.setChildIndex = function (childIndex) {
        if (this.childIndex === childIndex) {
            return;
        }
        this.childIndex = childIndex;
        if (this.eventService) {
            this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_CHILD_INDEX_CHANGED));
        }
    };
    RowNode.prototype.setRowTop = function (rowTop) {
        if (this.rowTop === rowTop) {
            return;
        }
        this.rowTop = rowTop;
        if (this.eventService) {
            this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_TOP_CHANGED));
        }
    };
    RowNode.prototype.setAllChildrenCount = function (allChildrenCount) {
        if (this.allChildrenCount === allChildrenCount) {
            return;
        }
        this.allChildrenCount = allChildrenCount;
        if (this.eventService) {
            this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_ALL_CHILDREN_COUNT_CELL_CHANGED));
        }
    };
    RowNode.prototype.setRowHeight = function (rowHeight) {
        this.rowHeight = rowHeight;
        if (this.eventService) {
            this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_HEIGHT_CHANGED));
        }
    };
    RowNode.prototype.setRowIndex = function (rowIndex) {
        this.rowIndex = rowIndex;
        if (this.eventService) {
            this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_ROW_INDEX_CHANGED));
        }
    };
    RowNode.prototype.setUiLevel = function (uiLevel) {
        if (this.uiLevel === uiLevel) {
            return;
        }
        this.uiLevel = uiLevel;
        if (this.eventService) {
            this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_UI_LEVEL_CHANGED));
        }
    };
    RowNode.prototype.setExpanded = function (expanded) {
        if (this.expanded === expanded) {
            return;
        }
        this.expanded = expanded;
        if (this.eventService) {
            this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_EXPANDED_CHANGED));
        }
        var event = this.createGlobalRowEvent(events_1.Events.EVENT_ROW_GROUP_OPENED);
        this.mainEventService.dispatchEvent(event);
    };
    RowNode.prototype.createGlobalRowEvent = function (type) {
        var event = {
            type: type,
            node: this,
            data: this.data,
            rowIndex: this.rowIndex,
            rowPinned: this.rowPinned,
            context: this.gridOptionsWrapper.getContext(),
            api: this.gridOptionsWrapper.getApi(),
            columnApi: this.gridOptionsWrapper.getColumnApi()
        };
        return event;
    };
    RowNode.prototype.dispatchLocalEvent = function (event) {
        if (this.eventService) {
            this.eventService.dispatchEvent(event);
        }
    };
    // we also allow editing the value via the editors. when it is done via
    // the editors, no 'cell changed' event gets fired, as it's assumed that
    // the cell knows about the change given it's in charge of the editing.
    // this method is for the client to call, so the cell listens for the change
    // event, and also flashes the cell when the change occurs.
    RowNode.prototype.setDataValue = function (colKey, newValue) {
        var column = this.columnController.getPrimaryColumn(colKey);
        this.valueService.setValue(this, column, newValue);
        this.dispatchCellChangedEvent(column, newValue);
    };
    RowNode.prototype.setGroupValue = function (colKey, newValue) {
        var column = this.columnController.getGridColumn(colKey);
        if (utils_1.Utils.missing(this.groupData)) {
            this.groupData = {};
        }
        this.groupData[column.getColId()] = newValue;
        this.dispatchCellChangedEvent(column, newValue);
    };
    // sets the data for an aggregation
    RowNode.prototype.setAggData = function (newAggData) {
        var _this = this;
        // find out all keys that could potentially change
        var colIds = utils_1.Utils.getAllKeysInObjects([this.aggData, newAggData]);
        this.aggData = newAggData;
        // if no event service, nobody has registered for events, so no need fire event
        if (this.eventService) {
            colIds.forEach(function (colId) {
                var column = _this.columnController.getGridColumn(colId);
                var value = _this.data ? _this.data[colId] : undefined;
                _this.dispatchCellChangedEvent(column, value);
            });
        }
    };
    RowNode.prototype.dispatchCellChangedEvent = function (column, newValue) {
        var cellChangedEvent = {
            type: RowNode.EVENT_CELL_CHANGED,
            node: this,
            column: column,
            newValue: newValue
        };
        this.dispatchLocalEvent(cellChangedEvent);
    };
    RowNode.prototype.resetQuickFilterAggregateText = function () {
        this.quickFilterAggregateText = null;
    };
    RowNode.prototype.isExpandable = function () {
        return this.group || this.canFlower;
    };
    RowNode.prototype.isSelected = function () {
        // for footers, we just return what our sibling selected state is, as cannot select a footer
        if (this.footer) {
            return this.sibling.isSelected();
        }
        return this.selected;
    };
    RowNode.prototype.depthFirstSearch = function (callback) {
        if (this.childrenAfterGroup) {
            this.childrenAfterGroup.forEach(function (child) { return child.depthFirstSearch(callback); });
        }
        callback(this);
    };
    // + rowController.updateGroupsInSelection()
    RowNode.prototype.calculateSelectedFromChildren = function () {
        var atLeastOneSelected = false;
        var atLeastOneDeSelected = false;
        var atLeastOneMixed = false;
        var newSelectedValue;
        if (this.childrenAfterGroup) {
            for (var i = 0; i < this.childrenAfterGroup.length; i++) {
                var childState = this.childrenAfterGroup[i].isSelected();
                switch (childState) {
                    case true:
                        atLeastOneSelected = true;
                        break;
                    case false:
                        atLeastOneDeSelected = true;
                        break;
                    default:
                        atLeastOneMixed = true;
                        break;
                }
            }
        }
        if (atLeastOneMixed) {
            newSelectedValue = undefined;
        }
        else if (atLeastOneSelected && !atLeastOneDeSelected) {
            newSelectedValue = true;
        }
        else if (!atLeastOneSelected && atLeastOneDeSelected) {
            newSelectedValue = false;
        }
        else {
            newSelectedValue = undefined;
        }
        this.selectThisNode(newSelectedValue);
    };
    RowNode.prototype.calculateSelectedFromChildrenBubbleUp = function () {
        this.calculateSelectedFromChildren();
        if (this.parent) {
            this.parent.calculateSelectedFromChildrenBubbleUp();
        }
    };
    RowNode.prototype.setSelectedInitialValue = function (selected) {
        this.selected = selected;
    };
    RowNode.prototype.setSelected = function (newValue, clearSelection, tailingNodeInSequence) {
        if (clearSelection === void 0) { clearSelection = false; }
        if (tailingNodeInSequence === void 0) { tailingNodeInSequence = false; }
        this.setSelectedParams({
            newValue: newValue,
            clearSelection: clearSelection,
            tailingNodeInSequence: tailingNodeInSequence,
            rangeSelect: false
        });
    };
    RowNode.prototype.isRowPinned = function () {
        return this.rowPinned === constants_1.Constants.PINNED_TOP || this.rowPinned === constants_1.Constants.PINNED_BOTTOM;
    };
    // to make calling code more readable, this is the same method as setSelected except it takes names parameters
    RowNode.prototype.setSelectedParams = function (params) {
        var groupSelectsChildren = this.gridOptionsWrapper.isGroupSelectsChildren();
        var newValue = params.newValue === true;
        var clearSelection = params.clearSelection === true;
        var tailingNodeInSequence = params.tailingNodeInSequence === true;
        var rangeSelect = params.rangeSelect === true;
        // groupSelectsFiltered only makes sense when group selects children
        var groupSelectsFiltered = groupSelectsChildren && (params.groupSelectsFiltered === true);
        if (this.id === undefined) {
            console.warn('ag-Grid: cannot select node until id for node is known');
            return 0;
        }
        if (this.rowPinned) {
            console.log('ag-Grid: cannot select pinned rows');
            return 0;
        }
        // if we are a footer, we don't do selection, just pass the info
        // to the sibling (the parent of the group)
        if (this.footer) {
            var count = this.sibling.setSelectedParams(params);
            return count;
        }
        if (rangeSelect) {
            var newRowClicked = this.selectionController.getLastSelectedNode() !== this;
            var allowMultiSelect = this.gridOptionsWrapper.isRowSelectionMulti();
            if (newRowClicked && allowMultiSelect) {
                return this.doRowRangeSelection();
            }
        }
        var updatedCount = 0;
        // when groupSelectsFiltered, then this node may end up intermediate despite
        // trying to set it to true / false. this group will be calculated further on
        // down when we call calculatedSelectedForAllGroupNodes(). we need to skip it
        // here, otherwise the updatedCount would include it.
        var skipThisNode = groupSelectsFiltered && this.group;
        if (!skipThisNode) {
            var thisNodeWasSelected = this.selectThisNode(newValue);
            if (thisNodeWasSelected) {
                updatedCount++;
            }
        }
        if (groupSelectsChildren && this.group) {
            updatedCount += this.selectChildNodes(newValue, groupSelectsFiltered);
        }
        // clear other nodes if not doing multi select
        var actionWasOnThisNode = !tailingNodeInSequence;
        if (actionWasOnThisNode) {
            if (newValue && (clearSelection || !this.gridOptionsWrapper.isRowSelectionMulti())) {
                updatedCount += this.selectionController.clearOtherNodes(this);
            }
            // only if we selected something, then update groups and fire events
            if (updatedCount > 0) {
                // update groups
                if (groupSelectsFiltered) {
                    // if the group was selecting filtered, then all nodes above and or below
                    // this node could have check, unchecked or intermediate, so easiest is to
                    // recalculate selected state for all group nodes
                    this.calculatedSelectedForAllGroupNodes();
                }
                else {
                    // if no selecting filtered, then everything below the group node was either
                    // selected or not selected, no intermediate, so no need to check items below
                    // this one, just the parents all the way up to the root
                    if (groupSelectsChildren && this.parent) {
                        this.parent.calculateSelectedFromChildrenBubbleUp();
                    }
                }
                // fire events
                // this is the very end of the 'action node', so we are finished all the updates,
                // include any parent / child changes that this method caused
                var event_1 = {
                    type: events_1.Events.EVENT_SELECTION_CHANGED,
                    api: this.gridApi,
                    columnApi: this.columnApi
                };
                this.mainEventService.dispatchEvent(event_1);
            }
            // so if user next does shift-select, we know where to start the selection from
            if (newValue) {
                this.selectionController.setLastSelectedNode(this);
            }
        }
        return updatedCount;
    };
    // selects all rows between this node and the last selected node (or the top if this is the first selection).
    // not to be mixed up with 'cell range selection' where you drag the mouse, this is row range selection, by
    // holding down 'shift'.
    RowNode.prototype.doRowRangeSelection = function () {
        var updatedCount = 0;
        var groupsSelectChildren = this.gridOptionsWrapper.isGroupSelectsChildren();
        var lastSelectedNode = this.selectionController.getLastSelectedNode();
        var nodesToSelect = this.rowModel.getNodesInRangeForSelection(lastSelectedNode, this);
        nodesToSelect.forEach(function (rowNode) {
            if (rowNode.group && groupsSelectChildren) {
                return;
            }
            var nodeWasSelected = rowNode.selectThisNode(true);
            if (nodeWasSelected) {
                updatedCount++;
            }
        });
        if (groupsSelectChildren) {
            this.calculatedSelectedForAllGroupNodes();
        }
        var event = {
            type: events_1.Events.EVENT_SELECTION_CHANGED,
            api: this.gridApi,
            columnApi: this.columnApi
        };
        this.mainEventService.dispatchEvent(event);
        return updatedCount;
    };
    RowNode.prototype.isParentOfNode = function (potentialParent) {
        var parentNode = this.parent;
        while (parentNode) {
            if (parentNode === potentialParent) {
                return true;
            }
            parentNode = parentNode.parent;
        }
        return false;
    };
    RowNode.prototype.calculatedSelectedForAllGroupNodes = function () {
        // we have to make sure we do this dept first, as parent nodes
        // will have dependencies on the children having correct values
        var inMemoryRowModel = this.rowModel;
        inMemoryRowModel.getTopLevelNodes().forEach(function (topLevelNode) {
            if (topLevelNode.group) {
                topLevelNode.depthFirstSearch(function (childNode) {
                    if (childNode.group) {
                        childNode.calculateSelectedFromChildren();
                    }
                });
                topLevelNode.calculateSelectedFromChildren();
            }
        });
    };
    RowNode.prototype.selectThisNode = function (newValue) {
        if (this.selected === newValue) {
            return false;
        }
        this.selected = newValue;
        if (this.eventService) {
            this.dispatchLocalEvent(this.createLocalRowEvent(RowNode.EVENT_ROW_SELECTED));
        }
        var event = this.createGlobalRowEvent(events_1.Events.EVENT_ROW_SELECTED);
        this.mainEventService.dispatchEvent(event);
        return true;
    };
    RowNode.prototype.selectChildNodes = function (newValue, groupSelectsFiltered) {
        var children = groupSelectsFiltered ? this.childrenAfterFilter : this.childrenAfterGroup;
        var updatedCount = 0;
        if (utils_1.Utils.missing(children)) {
            return;
        }
        for (var i = 0; i < children.length; i++) {
            updatedCount += children[i].setSelectedParams({
                newValue: newValue,
                clearSelection: false,
                tailingNodeInSequence: true
            });
        }
        return updatedCount;
    };
    RowNode.prototype.addEventListener = function (eventType, listener) {
        if (!this.eventService) {
            this.eventService = new eventService_1.EventService();
        }
        this.eventService.addEventListener(eventType, listener);
    };
    RowNode.prototype.removeEventListener = function (eventType, listener) {
        this.eventService.removeEventListener(eventType, listener);
    };
    RowNode.prototype.onMouseEnter = function () {
        this.dispatchLocalEvent(this.createLocalRowEvent(RowNode.EVENT_MOUSE_ENTER));
    };
    RowNode.prototype.onMouseLeave = function () {
        this.dispatchLocalEvent(this.createLocalRowEvent(RowNode.EVENT_MOUSE_LEAVE));
    };
    RowNode.prototype.getFirstChildOfFirstChild = function (rowGroupColumn) {
        var currentRowNode = this;
        // if we are hiding groups, then if we are the first child, of the first child,
        // all the way up to the column we are interested in, then we show the group cell.
        var isCandidate = true;
        var foundFirstChildPath = false;
        var nodeToSwapIn;
        while (isCandidate && !foundFirstChildPath) {
            var parentRowNode = currentRowNode.parent;
            var firstChild = utils_1.Utils.exists(parentRowNode) && currentRowNode.firstChild;
            if (firstChild) {
                if (parentRowNode.rowGroupColumn === rowGroupColumn) {
                    foundFirstChildPath = true;
                    nodeToSwapIn = parentRowNode;
                }
            }
            else {
                isCandidate = false;
            }
            currentRowNode = parentRowNode;
        }
        return foundFirstChildPath ? nodeToSwapIn : null;
    };
    RowNode.EVENT_ROW_SELECTED = 'rowSelected';
    RowNode.EVENT_DATA_CHANGED = 'dataChanged';
    RowNode.EVENT_CELL_CHANGED = 'cellChanged';
    RowNode.EVENT_ALL_CHILDREN_COUNT_CELL_CHANGED = 'allChildrenCountChanged';
    RowNode.EVENT_MOUSE_ENTER = 'mouseEnter';
    RowNode.EVENT_MOUSE_LEAVE = 'mouseLeave';
    RowNode.EVENT_HEIGHT_CHANGED = 'heightChanged';
    RowNode.EVENT_TOP_CHANGED = 'topChanged';
    RowNode.EVENT_FIRST_CHILD_CHANGED = 'firstChildChanged';
    RowNode.EVENT_LAST_CHILD_CHANGED = 'lastChildChanged';
    RowNode.EVENT_CHILD_INDEX_CHANGED = 'childIndexChanged';
    RowNode.EVENT_ROW_INDEX_CHANGED = 'rowIndexChanged';
    RowNode.EVENT_EXPANDED_CHANGED = 'expandedChanged';
    RowNode.EVENT_UI_LEVEL_CHANGED = 'uiLevelChanged';
    __decorate([
        context_1.Autowired('eventService'),
        __metadata("design:type", eventService_1.EventService)
    ], RowNode.prototype, "mainEventService", void 0);
    __decorate([
        context_1.Autowired('gridOptionsWrapper'),
        __metadata("design:type", gridOptionsWrapper_1.GridOptionsWrapper)
    ], RowNode.prototype, "gridOptionsWrapper", void 0);
    __decorate([
        context_1.Autowired('selectionController'),
        __metadata("design:type", selectionController_1.SelectionController)
    ], RowNode.prototype, "selectionController", void 0);
    __decorate([
        context_1.Autowired('columnController'),
        __metadata("design:type", columnController_1.ColumnController)
    ], RowNode.prototype, "columnController", void 0);
    __decorate([
        context_1.Autowired('valueService'),
        __metadata("design:type", valueService_1.ValueService)
    ], RowNode.prototype, "valueService", void 0);
    __decorate([
        context_1.Autowired('rowModel'),
        __metadata("design:type", Object)
    ], RowNode.prototype, "rowModel", void 0);
    __decorate([
        context_1.Autowired('context'),
        __metadata("design:type", context_1.Context)
    ], RowNode.prototype, "context", void 0);
    __decorate([
        context_1.Autowired('valueCache'),
        __metadata("design:type", valueCache_1.ValueCache)
    ], RowNode.prototype, "valueCache", void 0);
    __decorate([
        context_1.Autowired('columnApi'),
        __metadata("design:type", columnController_1.ColumnApi)
    ], RowNode.prototype, "columnApi", void 0);
    __decorate([
        context_1.Autowired('gridApi'),
        __metadata("design:type", gridApi_1.GridApi)
    ], RowNode.prototype, "gridApi", void 0);
    return RowNode;
}());
exports.RowNode = RowNode;


text:
<!DOCTYPE html>
<html ng-app="respond" dir="{{direction}}">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
    <title ng-bind="title"></title>

    <!-- set base for HTML5 mode -->
    <base href="/">

	<!-- css -->
	<link type="text/css" href="//fonts.googleapis.com/css?family=Roboto:700,300,100|Inconsolata" rel="stylesheet">
	<link type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">

	<!-- bootstrap rtl support -->
	<link type="text/css"
		ng-if="direction == 'rtl'"
		href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-rtl/3.2.0-rc2/css/bootstrap-rtl.min.css" rel="stylesheet">

	<link type="text/css" href="//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" rel="stylesheet">
	<link type="text/css" href="//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
	<link type="text/css" href="css/app.css" rel="stylesheet">
	<link type="text/css" href="css/messages.css" rel="stylesheet">
	<link type="text/css" href="css/dropzone.css" rel="stylesheet">
	<link type="text/css" href="css/list.css" rel="stylesheet">
	<link type="text/css" href="css/login.css" rel="stylesheet">
	<link type="text/css" href="css/dialog.css" rel="stylesheet">
	<link type="text/css" href="css/content.css" rel="stylesheet">
	<link type="text/css" href="css/editor.css" rel="stylesheet">
	<link type="text/css" href="css/rtl.css" rel="stylesheet">
	<link type="text/css" href="css/shepherd.css" rel="stylesheet">

	<!-- brand css -->
	<link type="text/css"
		ng-if="css != ''"
		ng-href="{{css}}" rel="stylesheet">

    <!-- angular / ui-* -->
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.4/angular.min.js"></script>
    <script src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.11/angular-ui-router.min.js"></script>
    <script src="js/libs/ui-codemirror.js"></script>

    <!-- jquery / ui -->
	<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
   	<script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
    <script src="//code.jquery.com/ui/1.10.4/jquery-ui.min.js"></script>

    <!-- libs -->
    <script src="js/utilities.js"></script>
    <script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.5.1/moment-with-langs.min.js"></script>
    <script src="js/libs/flipsnap.min.js"></script>
	<script src="js/libs/prettify.js"></script>
	<script src="js/libs/dropzone.js"></script>
	<script src="js/libs/beautify-html.js"></script>
	<script src="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.7.1/modernizr.min.js"></script>
	<script src="//cdnjs.cloudflare.com/ajax/libs/jstimezonedetect/1.0.4/jstz.min.js"></script>
	<script src="//cdnjs.cloudflare.com/ajax/libs/i18next/1.6.3/i18next-1.6.3.min.js"></script>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/shepherd/0.5.1/shepherd.min.js"></script>

    <!-- Google maps API (for geocoding) -->
    <script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>

    <!-- bootstrap -->
    <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>

    <!-- app -->
    <script src="api/setup.js.php"></script>
    <script src="js/respond.js"></script>
    <script src="js/messages.js"></script>
    <script src="js/respond.controllers.js"></script>
    <script src="js/respond.factories.js"></script>
    <script src="js/respond.directives.js"></script>
    <script src="js/respond.filters.js"></script>
    <script src="js/jm.i18next.js"></script>
    <script src="js/tour.js"></script>

    <!-- codemirror -->
    <link type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/4.3.0/codemirror.css" rel="stylesheet">
	<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/4.3.0/codemirror.js"></script>
	<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/4.3.0/mode/xml/xml.min.js"></script>
	<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/4.3.0/mode/css/css.min.js"></script>
	<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/4.3.0/mode/javascript/javascript.min.js"></script>
	<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/4.4.0/addon/search/search.js"></script>
	<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/4.4.0/addon/search/searchcursor.js"></script>
	<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/4.4.0/addon/search/match-highlighter.js"></script>

	<!-- spectrum -->
	<link type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/spectrum/1.3.0/css/spectrum.min.css" rel="stylesheet">
	<script src="//cdnjs.cloudflare.com/ajax/libs/spectrum/1.3.0/js/spectrum.min.js"></script>

    <!-- libs -->
	<script src="js/libs/jquery.paste.js"></script>
	<script src="js/libs/qrcode.js"></script>
	<script src="js/libs/qrcode_UTF8.js"></script>

	<!-- stripe -->
	<script src="https://js.stripe.com/v2/"></script>

	<!-- editor -->
	<script src="js/respond.editor.js"></script>
	<script src="plugins/text/respond.text.js"></script>

  </head>

  <body class="{{template}}">
	  <div ui-view></div>
  </body>

</html>


text:
/*	$OpenBSD: autoconf.h,v 1.7 2004/08/10 21:11:42 pefo Exp $ */

/*
 * Copyright (c) 2001-2003 Opsycon AB  (www.opsycon.se / www.opsycon.com)
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 */

/*
 * Definitions used buy autoconfiguration.
 */

#ifndef _MACHINE_AUTOCONF_H_
#define _MACHINE_AUTOCONF_H_

#include <machine/bus.h>

/*
 *  Structure holding all misc config information.
 */
#define MAX_CPUS	4

struct sys_rec {
	int	system_type;
	struct {
		u_int16_t type;
		u_int8_t  vers_maj;
		u_int8_t  vers_min;
		u_int16_t fptype;
		u_int8_t  fpvers_maj;
		u_int8_t  fpvers_min;
		u_int32_t clock;
		u_int32_t clock_bus;
		u_int32_t tlbsize;
		u_int32_t tlbwired;
		u_int32_t cfg_reg;
		u_int32_t stat_reg;
	} cpu[MAX_CPUS];
	struct mips_bus_space local;
	struct mips_bus_space isa_io;
	struct mips_bus_space isa_mem;
	struct mips_bus_space pci_io[2];
	struct mips_bus_space pci_mem[2];

	int	cons_baudclk;
	struct mips_bus_space console_io;	/* for stupid map designs */
	struct mips_bus_space *cons_iot;
	bus_addr_t cons_ioaddr[8];		/* up to eight loclbus tty's */
};

extern struct sys_rec sys_config;

/*
 *  Give com.c method to find console address and speeds
 */
#define	COM_FREQ	(sys_config.cons_baudclk)
#define	CONCOM_FREQ	(sys_config.cons_baudclk)
#define	CONADDR		(sys_config.cons_ioaddr[0])

/**/
struct confargs;

typedef int (*intr_handler_t)(void *);

struct abus {
	struct	device *ab_dv;		/* back-pointer to device */
	int	ab_type;		/* bus type (see below) */
	void	*(*ab_intr_establish)	/* bus's set-handler function */
		    (void *, u_long, int, int, int (*)(void *), void *, char *);
	void	(*ab_intr_disestablish)	/* bus's unset-handler function */
		    (void *, void *);
	caddr_t	(*ab_cvtaddr)		/* convert slot/offset to address */
		    (struct confargs *);
	int	(*ab_matchname)		/* see if name matches driver */
		    (struct confargs *, char *);
};

#define	BUS_MAIN	1		/* mainbus */
#define	BUS_LOCAL	2		/* localbus */
#define	BUS_ISABR	3		/* ISA Bridge Bus */
#define	BUS_PLCHLDR	4		/* placeholder */
#define	BUS_PCIBR	5		/* PCI bridge Bus */

#define BUS_INTR_ESTABLISH(ca, a, b, c, d, e, f, h)			\
	    (*(ca)->ca_bus->ab_intr_establish)((a),(b),(c),(d),(e),(f),(h))
#define BUS_INTR_DISESTABLISH(ca)					\
	    (*(ca)->ca_bus->ab_intr_establish)(ca)
#define BUS_MATCHNAME(ca, name)						\
	    (((ca)->ca_bus->ab_matchname) ?				\
	    (*(ca)->ca_bus->ab_matchname)((ca), (name)) :		\
	    -1)

struct confargs {
	char		*ca_name;	/* Device name. */
	struct abus	*ca_bus;	/* Bus device resides on. */
	bus_space_tag_t ca_iot;
	bus_space_tag_t ca_memt;
	bus_dma_tag_t	ca_dmat;
	u_int32_t	ca_num;		/* which system */
	u_int32_t	ca_sys;		/* which system */
	int		ca_nreg;
	u_int32_t	*ca_reg;
	int		ca_nintr;
	int32_t		ca_intr;
	bus_addr_t	ca_baseaddr;
};

int	badaddr(void *, u_int64_t);
void	enaddr_aton(const char *, u_int8_t *);

#endif /* _MACHINE_AUTOCONF_H_ */


text:
package de.codecentric.batch.simplejsr.item;

import java.util.Properties;

import javax.batch.api.partition.PartitionMapper;
import javax.batch.api.partition.PartitionPlan;
import javax.batch.api.partition.PartitionPlanImpl;

public class SimplePartitionMapper implements PartitionMapper {

	@Override
	public PartitionPlan mapPartitions() throws Exception {
		PartitionPlan partitionPlan = new PartitionPlanImpl();
		partitionPlan.setPartitions(3);
		partitionPlan.setThreads(2);
		Properties[] propertiesArray = new Properties[3];
		for (int i = 0; i < 3; i++) {
			Properties properties = new Properties();
			properties.put("datakeyPartition", "key" + (i + 1));
			propertiesArray[i] = properties;
		}
		partitionPlan.setPartitionProperties(propertiesArray);
		return partitionPlan;
	}

}


text:
class ApplicationController < ActionController::Base
  # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception

  def auth
    if session[:user]
      @user = session[:user]
    else
      @user = User.new(name: "my friend", password: "failed")
      session[:user] = @user
    end
    @users = User.all
    login = false
    @users.each do |user|
      if((user["name"] == @user["name"]) && (user["password"]== @user["password"]))
        login = true
        break
      end
    end
    redirect_to '/login' unless login
  end

end


text:
package com.intellij.cvsSupport2.ui.experts.checkout;

import com.intellij.CvsBundle;
import com.intellij.cvsSupport2.config.CvsApplicationLevelConfiguration;
import com.intellij.cvsSupport2.config.CvsRootConfiguration;
import com.intellij.cvsSupport2.connections.CvsEnvironment;
import com.intellij.cvsSupport2.cvsBrowser.CvsElement;
import com.intellij.cvsSupport2.cvsBrowser.CvsFile;
import com.intellij.cvsSupport2.cvsoperations.cvsTagOrBranch.TagsProviderOnEnvironment;
import com.intellij.cvsSupport2.cvsoperations.dateOrRevision.ui.DateOrRevisionOrTagSettings;
import com.intellij.cvsSupport2.ui.ChangeKeywordSubstitutionPanel;
import com.intellij.cvsSupport2.ui.experts.WizardStep;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.VerticalFlowLayout;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vcs.checkout.CheckoutStrategy;
import com.intellij.ui.ColoredListCellRenderer;
import com.intellij.ui.ScrollPaneFactory;
import com.intellij.ui.SimpleTextAttributes;
import com.intellij.ui.components.JBList;
import com.intellij.util.PlatformIcons;
import java.util.HashSet;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.netbeans.lib.cvsclient.command.KeywordSubstitution;

import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.*;
import java.io.File;
import java.util.*;
import java.util.List;

/**
 * author: lesya
 */
public class ChooseCheckoutMode extends WizardStep {

  private File mySelectedLocation;
  private final Collection<File> myCvsPaths = new ArrayList<>();
  private final DefaultListModel myCheckoutModeModel = new DefaultListModel();
  private final JList myCheckoutModeList = new JBList(myCheckoutModeModel);
  private final JCheckBox myMakeNewFilesReadOnly = new JCheckBox(CvsBundle.message("checkbox.make.new.files.read.only"));
  private final JCheckBox myPruneEmptyDirectories = new JCheckBox(CvsBundle.message("checkbox.prune.empty.directories"));
  private final ChangeKeywordSubstitutionPanel myChangeKeywordSubstitutionPanel;
  private final DateOrRevisionOrTagSettings myDateOrRevisionOrTagSettings;

  private final JPanel myCenterPanel = new JPanel(new CardLayout());

  @NonNls public static final String LIST = "LIST";
  @NonNls public static final String MESSAGE = "MESSSAGE";
  @NonNls private final JLabel myMessage = new JLabel("XXX");

  private CvsRootConfiguration myConfiguration = null;

  public ChooseCheckoutMode(Project project, CheckoutWizard wizard) {
    super("###", wizard);
    myCheckoutModeList.setCellRenderer(new ColoredListCellRenderer() {
      @Override
      protected void customizeCellRenderer(@NotNull JList list, Object value, int index, boolean selected, boolean hasFocus) {
        final CheckoutStrategy checkoutStrategy = (CheckoutStrategy)value;
        append(checkoutStrategy.getResult().getAbsolutePath(), new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, list.getForeground()));
        setIcon(PlatformIcons.DIRECTORY_CLOSED_ICON);
      }
    });
    myCheckoutModeList.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
      @Override
      public void valueChanged(ListSelectionEvent e) {
        getWizard().updateButtons();
      }
    });

    myCheckoutModeList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    final CvsApplicationLevelConfiguration config = CvsApplicationLevelConfiguration.getInstance();
    myMakeNewFilesReadOnly.setSelected(config.MAKE_CHECKED_OUT_FILES_READONLY);
    myPruneEmptyDirectories.setSelected(config.CHECKOUT_PRUNE_EMPTY_DIRECTORIES);
    myChangeKeywordSubstitutionPanel =
      new ChangeKeywordSubstitutionPanel(KeywordSubstitution.getValue(config.CHECKOUT_KEYWORD_SUBSTITUTION));

    myCenterPanel.add(LIST, ScrollPaneFactory.createScrollPane(myCheckoutModeList));
    final JPanel messagePanel = new JPanel(new BorderLayout(2,4));
    messagePanel.add(myMessage, BorderLayout.NORTH);
    messagePanel.setBackground(UIUtil.getTableBackground());
    myMessage.setBackground(UIUtil.getTableBackground());
    myCenterPanel.add(MESSAGE, ScrollPaneFactory.createScrollPane(messagePanel));

    myDateOrRevisionOrTagSettings = new DateOrRevisionOrTagSettings(new TagsProviderOnEnvironment() {
      @Nullable
      @Override
      protected CvsEnvironment getCvsEnvironment() {
        return getWizard().getSelectedConfiguration();
      }

      @Override
      public String getModule() {
        final CvsElement[] selectedElements = getWizard().getSelectedElements();
        String module = null;
        for (CvsElement element : selectedElements) {
          final String checkoutPath = element.getCheckoutPath();
          if (module == null) {
            module = checkoutPath;
            continue;
          }
          final String commonParentModule = findCommonParentModule(module, checkoutPath);
          if (commonParentModule == null) {
            return super.getModule();
          }
          module = commonParentModule;
        }
        return module;
      }
    }, project);

    init();
  }

  private static String findCommonParentModule(String module1, String module2) {
    int diff = indexOfFirstDifference(module1, module2);
    if (diff == 0) {
      return null;
    }
    if (diff == module1.length()) {
      return module1;
    }
    if (module1.charAt(diff - 1) == '/') {
      return module1.substring(0, diff);
    }
    else {
      int index = module1.lastIndexOf('/', diff);
      if (index < 0) {
        return null;
      }
      return module1.substring(0, index);
    }
  }

  private static int indexOfFirstDifference(@NotNull String a, @NotNull String b) {
    int max = Math.min(a.length(), b.length());
    for (int i = 0; i < max; i++) {
      final char c = a.charAt(i);
      if (c != b.charAt(i)) {
        return i;
      }
    }
    return max;
  }

  @Override
  protected CheckoutWizard getWizard() {
    return (CheckoutWizard)super.getWizard();
  }

  @Override
  public boolean nextIsEnabled() {
    if (myCvsPaths.size() == 1)
      return myCheckoutModeList.getSelectedValue() != null;
    else
      return true;
  }

  @Override
  protected JComponent createComponent() {
    final JPanel result = new JPanel(new BorderLayout(4, 2));
    result.add(myCenterPanel, BorderLayout.CENTER);
    result.add(createOptionsPanel(), BorderLayout.SOUTH);
    return result;
  }

  private JPanel createOptionsPanel() {
    final JPanel result = new JPanel(new VerticalFlowLayout());
    result.add(myMakeNewFilesReadOnly);
    result.add(myPruneEmptyDirectories);
    result.add(myChangeKeywordSubstitutionPanel.getComponent());
    result.add(myDateOrRevisionOrTagSettings.getPanel());
    return result;
  }

  @Override
  public JComponent getPreferredFocusedComponent() {
    return myCheckoutModeList;
  }

  @Override
  public void activate() {
    final File selectedLocation = getWizard().getSelectedLocation();
    final Collection<File> cvsPaths = getSelectedFiles();

    if (!FileUtil.filesEqual(selectedLocation, mySelectedLocation) || !Comparing.equal(cvsPaths, myCvsPaths)) {
      mySelectedLocation = selectedLocation;
      myCvsPaths.clear();
      myCvsPaths.addAll(cvsPaths);

      if (myCvsPaths.size() == 1) {
        show(LIST);
        rebuildList();
      }
      else {
        setStepTitle(CvsBundle.message("info.text.selected.modules.will.be.checked.out.to"));
        final StringBuilder message = composeLocationsMessage();
        myMessage.setText(message.toString());
        show(MESSAGE);
        getWizard().updateButtons();
      }
    }
    else if (selectedLocation == null) {
      getWizard().updateButtons();
    }
    final CvsRootConfiguration configuration = getWizard().getSelectedConfiguration();
    if (myConfiguration != configuration) {
      myDateOrRevisionOrTagSettings.updateFrom(configuration.DATE_OR_REVISION_SETTINGS);
      myConfiguration = configuration;
    }
  }

  private StringBuilder composeLocationsMessage() {
    @NonNls final StringBuilder message = new StringBuilder("
");
    message.append(mySelectedLocation.getAbsolutePath()).append("
");
    for (File file : myCvsPaths) {
      message.append("
        -").append(file.getPath()).append("
");
    }
    return message;
  }

  private Collection<File> getSelectedFiles() {
    final Collection<File> allFiles = new HashSet<>();
    final CvsElement[] selection = getWizard().getSelectedElements();
    if (selection == null) return allFiles;
    for (CvsElement cvsElement : selection) {
      allFiles.add(new File(cvsElement.getCheckoutPath()));
    }

    final ArrayList<File> result = new ArrayList<>();

    for (File file : allFiles) {
      if (!hasParentIn(allFiles, file)) result.add(file);
    }

    Collections.sort(result, (file, file1) -> file.getPath().compareTo(file1.getPath()));
    return result;
  }

  private static boolean hasParentIn(Collection<File> allFiles, File file) {
    final String filePath = file.getPath();
    for (File file1 : allFiles) {
      if (FileUtil.filesEqual(file1, file)) continue;
      if (filePath.startsWith(file1.getPath())) return true;
    }
    return false;
  }

  private void rebuildList() {
    final File selected = myCvsPaths.iterator().next();
    setStepTitle(CvsBundle.message("dialog.title.check.out.to", selected));
    myCheckoutModeModel.removeAllElements();

    final boolean forFile = getWizard().getSelectedElements()[0] instanceof CvsFile;
    final CheckoutStrategy[] strategies = CheckoutStrategy.createAllStrategies(mySelectedLocation, selected, forFile);
    final Collection<File> results = new HashSet();
    final List<CheckoutStrategy> resultModes = new ArrayList();
    for (CheckoutStrategy strategy : strategies) {
      final File resultFile = strategy.getResult();
      if (resultFile != null && !results.contains(resultFile)) {
        results.add(resultFile);
        resultModes.add(strategy);
      }
    }

    Collections.sort(resultModes);
    for (CheckoutStrategy resultMode : resultModes) {
      myCheckoutModeModel.addElement(resultMode);
    }
    myCheckoutModeList.setSelectedIndex(0);
  }

  private void show(String mode) {
    ((CardLayout)myCenterPanel.getLayout()).show(myCenterPanel, mode);
  }

  public boolean getMakeNewFilesReadOnly() {
    return myMakeNewFilesReadOnly.isSelected();
  }

  public boolean getPruneEmptyDirectories() {
    return myPruneEmptyDirectories.isSelected();
  }

  public boolean useAlternativeCheckoutLocation() {
    if (myCvsPaths.size() == 1) {
      final CheckoutStrategy checkoutStrategy = (CheckoutStrategy)myCheckoutModeList.getSelectedValue();
      return checkoutStrategy.useAlternativeCheckoutLocation();
    }
    else {
      return false;
    }
  }

  public File getCheckoutDirectory() {
    if (myCvsPaths.size() == 1) {
      final CheckoutStrategy checkoutStrategy = (CheckoutStrategy)myCheckoutModeList.getSelectedValue();
      return checkoutStrategy.getCheckoutDirectory();
    }
    else {
      return mySelectedLocation;
    }
  }

  public KeywordSubstitution getKeywordSubstitution() {
    return myChangeKeywordSubstitutionPanel.getKeywordSubstitution();
  }

  public void saveDateOrRevisionSettings(CvsRootConfiguration configuration) {
    myDateOrRevisionOrTagSettings.saveTo(configuration.DATE_OR_REVISION_SETTINGS);
  }
}


text:
namespace Microsoft.InfoCards
{
    using System.IdentityModel.Tokens;
    using System.Security.Cryptography;
    using System.Security.Cryptography.Xml;

    // copied from IdentityModel\CryptoHelper.cs and they need to be kept in [....].  After V1, we need to rethink how we can have
    // a single place to ask this question.  Perhaps even add it as an extensibility

    internal static class InfoCardCryptoHelper
    {

        internal static bool IsAsymmetricAlgorithm(string algorithm)
        {
            switch (algorithm)
            {
                case SecurityAlgorithms.DsaSha1Signature:
                case SecurityAlgorithms.RsaSha1Signature:
                case SecurityAlgorithms.RsaSha256Signature:
                case SecurityAlgorithms.RsaOaepKeyWrap:
                case SecurityAlgorithms.RsaV15KeyWrap:
                    return true;
                default:
                    return false;
            }
        }

        internal static bool IsSymmetricAlgorithm(string algorithm)
        {
            switch (algorithm)
            {
                case SecurityAlgorithms.HmacSha1Signature:
                case SecurityAlgorithms.HmacSha256Signature:
                case SecurityAlgorithms.Aes128Encryption:
                case SecurityAlgorithms.Aes192Encryption:
                case SecurityAlgorithms.Aes256Encryption:
                case SecurityAlgorithms.TripleDesEncryption:
                case SecurityAlgorithms.Aes128KeyWrap:
                case SecurityAlgorithms.Aes192KeyWrap:
                case SecurityAlgorithms.Aes256KeyWrap:
                case SecurityAlgorithms.TripleDesKeyWrap:
                case SecurityAlgorithms.Psha1KeyDerivation:
                case SecurityAlgorithms.Psha1KeyDerivationDec2005:
                    return true;
                default:
                    return false;
            }
        }

    }
}


text:
<?php

namespace Slick\Mvc;

use Aura\Router\Matcher;
use Aura\Router\RouterContainer;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Slick\Http\Server\AbstractMiddleware;
use Slick\Http\Server\MiddlewareInterface;
use Slick\Mvc\Router\RouteBuilder;

/**
 * HTTP Request Router
 *
 * @package Slick\Mvc
 * @author  Filipe Silva <silvam.filipe@gmail.com>
 */
class Router extends AbstractMiddleware implements MiddlewareInterface
{

    /**
     * @var RouterContainer
     */
    protected $routerContainer;

    /**
     * @var Matcher
     */
    protected $matcher;

    /**
     * @var RouteBuilder
     */
    protected $routeBuilder;

    /**
     * @var string
     */
    protected $routeFile;

    /**
     * Returns route container
     *
     * @return RouterContainer
     */
    public function getRouterContainer()
    {
        if (null === $this->routerContainer) {
            $this->setRouterContainer(new RouterContainer());
            $this->routerContainer
                ->setMapBuilder([$this->getRouteBuilder(), 'build']);
        }
        return $this->routerContainer;
    }

    /**
     * Sets router container
     *
     * @param RouterContainer $routerContainer
     *
     * @return self|$this|Router
     */
    public function setRouterContainer(RouterContainer $routerContainer)
    {
        $this->routerContainer = $routerContainer;
        return $this;
    }

    /**
     * Handles a Request and updated the response
     *
     * @param ServerRequestInterface $request
     * @param ResponseInterface $response
     *
     * @return ResponseInterface
     */
    public function handle(
        ServerRequestInterface $request, ResponseInterface $response
    )
    {
        $route = $this->getMatcher()->match($request);
        $request = $request->withAttribute('route', $route);
        return $this->executeNext($request, $response);
    }

    /**
     * Gets route matcher for this router
     *
     * @return Matcher
     */
    public function getMatcher()
    {
        if (null === $this->matcher) {
            $this->setMatcher($this->getRouterContainer()->getMatcher());
        }
        return $this->matcher;
    }

    /**
     * Sets the route matcher for current used in Router::handle()
     *
     * @param Matcher $matcher
     *
     * @return $this|self|Router
     */
    public function setMatcher(Matcher $matcher)
    {
        $this->matcher = $matcher;
        return $this;
    }

    /**
     * Get route builder
     *
     * @return RouteBuilder
     */
    public function getRouteBuilder()
    {
        if (null == $this->routeBuilder) {
            $this->setRouteBuilder(new RouteBuilder($this->getRouteFile()));
        }
        return $this->routeBuilder;
    }

    /**
     * Set route builder
     *
     * @param RouteBuilder $routeBuilder
     * @return Router
     */
    public function setRouteBuilder($routeBuilder)
    {
        $this->routeBuilder = $routeBuilder;
        return $this;
    }

    /**
     * Get route file full path
     *
     * @return string
     */
    public function getRouteFile()
    {
        return $this->routeFile;
    }

    /**
     * Set route definition file
     *
     * @param string $routeFile
     * @return Router
     */
    public function setRouteFile($routeFile)
    {
        $this->routeFile = $routeFile;
        return $this;
    }
}


text:
<assembly>
    <id>dist</id>
    <formats>
        <format>jar</format>
    </formats>
    <includeBaseDirectory>false</includeBaseDirectory>
    <dependencySets>
        <dependencySet>
            <unpack>false</unpack>
            <outputDirectory>/lib</outputDirectory>
            <includes>
                <include>com.smartbear:swagger4j</include>
                <include>org.glassfish:javax.json</include>
                <include>javax.json:javax.json-api</include>
                <include>commons-lang:commons-lang</include>
                <include>com.fasterxml.jackson.core:jackson-annotations</include>
                <include>com.fasterxml.jackson.core:jackson-core</include>
                <include>com.fasterxml.jackson.core:jackson-databind</include>
                <include>com.fasterxml.jackson.datatype:jackson-datatype-joda</include>
                <include>com.fasterxml.jackson.dataformat:jackson-dataformat-yaml</include>
            </includes>
        </dependencySet>
        <dependencySet>
            <unpack>true</unpack>
            <outputDirectory>/</outputDirectory>
            <includes>
                <include>com.smartbear:soapui-lucybot-plugin</include>
            </includes>
        </dependencySet>
    </dependencySets>
    <fileSets>
        <fileSet>
            <directory>${project.basedir}</directory>
            <outputDirectory>/META-INF</outputDirectory>
            <includes>
                <include>LICENSE*</include>
            </includes>
        </fileSet>
        <fileSet>
            <directory>${project.basedir}/src/assembly</directory>
            <outputDirectory>/META-INF</outputDirectory>
            <includes>
                <include>readme.txt</include>
            </includes>
        </fileSet>
    </fileSets>
</assembly>


text:
module.exports = function(variables) {
  var missing = [];

  variables.forEach(function(variable) {
    if (!process.env[variable]) {
      missing.push(variable);
    }
  });

  if (missing.length) {
    if (missing.length === 1) {
      throw new Error('Missing environment variable ' + missing[0]);
    }
    throw new Error('Missing environment variables ' + missing.join(', '));
  }
};


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title>jQuery UI Multiselect</title>
	<link rel="stylesheet" href="css/common.css" type="text/css" />
	<link type="text/css" rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/base/ui.all.css" />
	<link type="text/css" href="css/ui.multiselect.css" rel="stylesheet" />

jQuery UI Multiselect

		  Another attempt of a sortable, searchable multiple select widget

Blogpost

Source

Download

Bugs

      It depends on jQuery 1.4.2 and jQuery UI 1.8.
      The widget is styleable using Themeroller.
      It works in an unobtrusive fashion, by just turning html multiple select inputs into a sexier equivalent. There's no extra markup needed.

For installation instructions please have a look at the corresponding blogpost

Source code is available at Github

In case you are looking for the original version, it has been moved here

Bleeding Edge Demo is always available here (thanks to Github Pages)

    <form action="index.html">
      <select id="countries" class="multiselect" multiple="multiple" name="countries[]">
        <option value="AFG">Afghanistan</option>
        <option value="ALB">Albania</option>
        <option value="DZA">Algeria</option>
        <option value="AND">Andorra</option>
        <option value="ARG">Argentina</option>
        <option value="ARM">Armenia</option>
        <option value="ABW">Aruba</option>
        <option value="AUS">Australia</option>
        <option value="AUT" selected="selected">Austria</option>

        <option value="AZE">Azerbaijan</option>
        <option value="BGD">Bangladesh</option>
        <option value="BLR">Belarus</option>
        <option value="BEL">Belgium</option>
        <option value="BIH">Bosnia and Herzegovina</option>
        <option value="BRA">Brazil</option>
        <option value="BRN">Brunei</option>
        <option value="BGR">Bulgaria</option>
        <option value="CAN">Canada</option>

        <option value="CHN">China</option>
        <option value="COL">Colombia</option>
        <option value="HRV">Croatia</option>
        <option value="CYP">Cyprus</option>
        <option value="CZE">Czech Republic</option>
        <option value="DNK">Denmark</option>
        <option value="EGY">Egypt</option>
        <option value="EST">Estonia</option>
        <option value="FIN">Finland</option>

        <option value="FRA">France</option>
        <option value="GEO">Georgia</option>
        <option value="DEU" selected="selected">Germany</option>
        <option value="GRC">Greece</option>
        <option value="HKG">Hong Kong</option>
        <option value="HUN">Hungary</option>
        <option value="ISL">Iceland</option>
        <option value="IND">India</option>
        <option value="IDN">Indonesia</option>

        <option value="IRN">Iran</option>
        <option value="IRL">Ireland</option>
        <option value="ISR">Israel</option>
        <option value="ITA">Italy</option>
        <option value="JPN">Japan</option>
        <option value="JOR">Jordan</option>
        <option value="KAZ">Kazakhstan</option>
        <option value="KWT">Kuwait</option>
        <option value="KGZ">Kyrgyzstan</option>

        <option value="LVA">Latvia</option>
        <option value="LBN">Lebanon</option>
        <option value="LIE">Liechtenstein</option>
        <option value="LTU">Lithuania</option>
        <option value="LUX">Luxembourg</option>
        <option value="MAC">Macau</option>
        <option value="MKD">Macedonia</option>
        <option value="MYS">Malaysia</option>
        <option value="MLT">Malta</option>

        <option value="MEX">Mexico</option>
        <option value="MDA">Moldova</option>
        <option value="MNG">Mongolia</option>
        <option value="NLD" selected="selected">Netherlands</option>
        <option value="NZL">New Zealand</option>
        <option value="NGA">Nigeria</option>
        <option value="NOR">Norway</option>
        <option value="PER">Peru</option>
        <option value="PHL">Philippines</option>

        <option value="POL">Poland</option>
        <option value="PRT">Portugal</option>
        <option value="QAT">Qatar</option>
        <option value="ROU">Romania</option>
        <option value="RUS">Russia</option>
        <option value="SMR">San Marino</option>
        <option value="SAU">Saudi Arabia</option>
        <option value="CSG">Serbia and Montenegro</option>
        <option value="SGP">Singapore</option>

        <option value="SVK">Slovakia</option>
        <option value="SVN">Slovenia</option>
        <option value="ZAF">South Africa</option>
        <option value="KOR">South Korea</option>
        <option value="ESP">Spain</option>
        <option value="LKA">Sri Lanka</option>
        <option value="SWE">Sweden</option>
        <option value="CHE">Switzerland</option>
        <option value="SYR">Syria</option>

        <option value="TWN">Taiwan</option>
        <option value="TJK">Tajikistan</option>
        <option value="THA">Thailand</option>
        <option value="TUR">Turkey</option>
        <option value="TKM">Turkmenistan</option>
        <option value="UKR">Ukraine</option>
        <option value="ARE">United Arab Emirates</option>
        <option value="GBR">United Kingdom</option>
        <option value="USA" selected="selected">United States</option>

        <option value="UZB">Uzbekistan</option>
        <option value="VAT">Vatican City</option>
        <option value="VNM">Vietnam</option>
      </select>

      <input type="submit" value="Submit Form"/>
    </form>

Features

Search within available options, if there are a lots of them

Displaying counts of selected and available items

Select All / Deselect All Buttons

Dragging items from the available list to the selected list directly

Contributors

Michael Aufreiter

Yanick Rochon

Misc

    There are no limitations. Do whatever you want with this plugin.
    If you did some nice modifications, just let me know (via Github). I'd be happy to include them.

A Quasipartikel Production

Template adopted from orderedlist.com


text:
package database::postgres::mode::databasesize;

use base qw(centreon::plugins::templates::counter);

use strict;
use warnings;

sub set_counters {
    my ($self, %options) = @_;

    $self->{maps_counters_type} = [
        { name => 'databases', type => 1, cb_prefix_output => 'prefix_database_output', message_multiple => 'All databases are ok' },
    ];

    $self->{maps_counters}->{databases} = [
        { label => 'size', set => {
                key_values => [ { name => 'size' }, { name => 'display' } ],
                output_template => 'size : %s %s',
                output_change_bytes => 1,
                perfdatas => [
                    { label => 'size', value => 'size_absolute', template => '%s',
                      min => 0, unit => 'B', label_extra_instance => 1, instance_use => 'display_absolute' },
                ],
            }
        },
    ];
}

sub prefix_database_output {
    my ($self, %options) = @_;

    return "Database '" . $options{instance_value}->{display} . "' ";
}

sub new {
    my ($class, %options) = @_;
    my $self = $class->SUPER::new(package => __PACKAGE__, %options);
    bless $self, $class;

    $self->{version} = '1.0';
    $options{options}->add_options(arguments =>
                                {
                                    "filter-database:s"   => { name => 'filter_database' },
                                });
    return $self;
}

sub check_options {
    my ($self, %options) = @_;
    $self->SUPER::check_options(%options);
}

sub manage_selection {
    my ($self, %options) = @_;

    $self->{sql} = $options{sql};
    $self->{sql}->connect();
    $self->{sql}->query(query => "SELECT pg_database.datname, pg_database_size(pg_database.datname) FROM pg_database;");

    my $result = $self->{sql}->fetchall_arrayref();

    $self->{databases} = {};

    foreach my $row (@$result) {
        next if (defined($self->{option_results}->{filter_database}) && $self->{option_results}->{filter_database} ne ''
            && $$row[0] !~ /$self->{option_results}->{filter_database}/);

        $self->{databases}->{$$row[0]}->{display} = $$row[0];
        $self->{databases}->{$$row[0]}->{size} = $$row[1];
    }

    if (scalar(keys %{$self->{databases}}) <= 0) {
        $self->{output}->add_option_msg(short_msg => 'No databases found');
        $self->{output}->option_exit();
    }
}

1;

__END__

=head1 MODE

Check databases size

=over 8

=item B<--filter-database>

Filter database to checks (Can use regexp).

=item B<--warning-size>

Threshold warning in bytes, maximum size allowed.

=item B<--critical-size>

Threshold critical in bytes, maximum size allowed.

=back

=cut


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="vertical">
    <View
            android:layout_width="match_parent"
            android:layout_height="@dimen/header_height"
            android:id="@+id/pad"
            android:visibility="gone"
    />
    <LinearLayout
            android:orientation="vertical" android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingRight="10dp"
            android:paddingTop="7dp"
            android:paddingBottom="7dp"
            android:paddingLeft="10dp"
            android:background="@color/grey"
            android:clipToPadding="false"
    >

        <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:padding="15dp"
                android:orientation="horizontal"
                android:background="@color/splash_scroll_content_bg"
                android:elevation="2dp"
        >
            <View
                    android:layout_width="50dp"
                    android:layout_height="50dp"
                    android:background="@drawable/circle_grey"
                    android:layout_gravity="center_vertical"
            />

            <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:orientation="vertical"
            >

                <View
                        android:layout_width="match_parent"
                        android:layout_height="10dp"
                        android:layout_marginRight="20dp"
                        android:layout_marginLeft="15dp"
                        android:background="@color/grey_dark"/>
                <View
                        android:layout_width="match_parent"
                        android:layout_height="5dp"
                        android:layout_marginRight="60dp"
                        android:layout_marginTop="10dp"
                        android:layout_marginLeft="15dp"
                        android:background="@color/grey_dark"/>
                <View
                        android:layout_width="match_parent"
                        android:layout_height="5dp"
                        android:layout_marginRight="60dp"
                        android:layout_marginTop="8dp"
                        android:layout_marginLeft="15dp"
                        android:background="@color/grey_dark"/>

            </LinearLayout>
        </LinearLayout>

    </LinearLayout>

</LinearLayout>


text:
.. raw:: pdf

   PageBreak

.. index: How Fuel Works

.. _How-Fuel-Works:

How Fuel Works
==============

Fuel is a ready-to-install collection of the packages and scripts you need
to create a robust, configurable, vendor-independent OpenStack cloud in your
own environment. Since Fuel 3.1, Fuel Library and Fuel Web have been merged
into a single toolbox with options to use the UI or CLI for management.

A single OpenStack cloud consists of packages from many different open source
projects, each with its own requirements, installation procedures, and
configuration management. Fuel brings all of these projects together into a
single open source distribution, with components that have been tested and are
guaranteed to work together, and all wrapped up using scripts to help you work
through a single installation.

Simply put, Fuel is a way for you to easily configure and install an
OpenStack-based infrastructure in your own environment.

.. image:: /_images/FuelSimpleDiagram.jpg
  :align: center

Fuel works by using a simple approach. Rather than installing each of the
components that make up OpenStack directly, it instead uses a configuration
management system (Puppet) to compile a set of instructions that can provide a
configurable, reproducible, and sharable installation process.

In practice, Fuel works as follows:

1. First, set up Fuel Master node using the ISO. This process only needs to
   be completed once per installation.

2. Next, discover your virtual or physical nodes and configure your
   OpenStack environment using the Fuel UI.

3. Finally, deploy your OpenStack environment on discovered nodes. Fuel will
   perform all deployment steps for you by applying pre-configured and
   pre-integrated Puppet manifests via Astute orchestration engine.

Fuel is designed to enable you to maintain your environment, while giving you
the flexibility to adapt it to your own business needs and scale.

.. image:: /_images/how-it-works.*
  :width: 100%
  :align: center

Fuel comes with several pre-defined deployment configurations, plus
additional options that allow you to adapt your OpenStack deployment to your
environment.

Fuel UI integrates all of the deployments scripts into a unified, web-based
interface that walks administrators through the process of installing and
configuring a fully functional OpenStack environment.


text:
package org.elasticsearch.test.rest;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.elasticsearch.common.Strings;
import org.elasticsearch.common.logging.ESLogger;
import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.test.rest.client.RestResponse;

/**
 * Allows to cache the last obtained test response and or part of it within variables
 * that can be used as input values in following requests and assertions.
 */
public class Stash implements ToXContent {

    private static final ESLogger logger = Loggers.getLogger(Stash.class);

    public static final Stash EMPTY = new Stash();

    private final Map<String, Object> stash = new HashMap<>();
    private RestResponse response;

    /**
     * Allows to saved a specific field in the stash as key-value pair
     */
    public void stashValue(String key, Object value) {
        logger.trace("stashing [{}]=[{}]", key, value);
        Object old = stash.put(key, value);
        if (old != null && old != value) {
            logger.trace("replaced stashed value [{}] with same key [{}]", old, key);
        }
    }

    public void stashResponse(RestResponse response) throws IOException {
        // TODO we can almost certainly save time by lazily evaluating the body
        stashValue("body", response.getBody());
        this.response = response;
    }

    /**
     * Clears the previously stashed values
     */
    public void clear() {
        stash.clear();
    }

    /**
     * Tells whether a particular value needs to be looked up in the stash
     * The stash contains fields eventually extracted from previous responses that can be reused
     * as arguments for following requests (e.g. scroll_id)
     */
    public boolean isStashedValue(Object key) {
        if (key == null) {
            return false;
        }
        String stashKey = key.toString();
        return Strings.hasLength(stashKey) && stashKey.startsWith("$");
    }

    /**
     * Extracts a value from the current stash
     * The stash contains fields eventually extracted from previous responses that can be reused
     * as arguments for following requests (e.g. scroll_id)
     */
    public Object unstashValue(String value) throws IOException {
        if (value.startsWith("$body.")) {
            if (response == null) {
                return null;
            }
            return response.evaluate(value.substring("$body".length()), this);
        }
        Object stashedValue = stash.get(value.substring(1));
        if (stashedValue == null) {
            throw new IllegalArgumentException("stashed value not found for key [" + value + "]");
        }
        return stashedValue;
    }

    /**
     * Recursively unstashes map values if needed
     */
    public Map<String, Object> unstashMap(Map<String, Object> map) throws IOException {
        Map<String, Object> copy = new HashMap<>(map);
        unstashObject(copy);
        return copy;
    }

    @SuppressWarnings("unchecked")
    private void unstashObject(Object obj) throws IOException {
        if (obj instanceof List) {
            List list = (List) obj;
            for (int i = 0; i < list.size(); i++) {
                Object o = list.get(i);
                if (isStashedValue(o)) {
                    list.set(i, unstashValue(o.toString()));
                } else {
                    unstashObject(o);
                }
            }
        }
        if (obj instanceof Map) {
            Map<String, Object> map = (Map) obj;
            for (Map.Entry<String, Object> entry : map.entrySet()) {
                if (isStashedValue(entry.getValue())) {
                    entry.setValue(unstashValue(entry.getValue().toString()));
                } else {
                    unstashObject(entry.getValue());
                }
            }
        }
    }

    @Override
    public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
        builder.field("stash", stash);
        return builder;
    }
}


text:
#ifndef GCC_DSE_H
#define GCC_DSE_H

extern void dse_record_singleton_alias_set (alias_set_type, enum machine_mode);
extern void dse_invalidate_singleton_alias_set (alias_set_type);

#endif /* GCC_DSE_H */