text:
Written By: Brandon L. Clark

Date  : 12/28/2014

## Table Of Contents
1. [Introduction](intro.md)
  1. [About Lessons](intro.md)
    1. [Section One Lessons](intro.md)
    2. [Section Two Lessons](intro.md)
    3. [Section Three Lessons](intro.md)
    4. [Section Four Lessons](intro.md)
  2. [Who is it for?](intro.md)
  3. [What do I need to know?](intro.md)
  4. [What do I need to do?](intro.md)
  5. [JavaScript Libraries](intro.md)
2. [Section One: Secured Web Connection Template](section-one.md)
  1. [Create a Baseline Template with Express](section-one.md)
  2. [Generating an Express Application](section-one.md)
  3. [Defining Structure to Facilitate Data](section-one.md)
  4. [SSL/TLS and Simple Session Management with Express](section-one.md)
    1. [HTTPS for Implementation](section-one.md)
    2. [HTTPS for Development and Testing](section-one.md)
    3. [Session Management](section-one.md)
3. [Section Two: Creating User Interface Requirements](section-two.md)
  1. [Jade and Bootstrap](section-two.md)
  2. [Structure & Code](section-two.md)
  3. [Navbar & Footer Components](section-two.md)
  4. [Site Navigation](section-two.md)
  5. [Modal and Forms](section-two.md)
4. [Section Three: Connecting Users to Database Functions](section-three.md)
  1. [MongoDB using Mongoose](section-three.md)
  2. [Defining Structures](section-three.md)
  3. [Create & Secure User Object](section-three.md)
  4. [Read & Verify User Object](section-three.md)
  5. [Update Object](section-three.md)
  6. [Delete Object](section-three.md)
5. [Section Four: Software Quality Assurance](section-four.md)
  1. [Structure Test Environment](section-four.md)
  2. [Create Static Test Data](section-four.md)
  3. [Unit Test Cases](section-four.md)
  4. [Integration Test Cases](section-four.md)
6. [References](ref.md)


text:
package io.github.jeddict.orm.generator.compiler;

import static io.github.jeddict.jcode.JPAConstants.LOB;
import static io.github.jeddict.jcode.JPAConstants.LOB_FQN;
import java.util.Collection;
import static java.util.Collections.singleton;

public class LobSnippet extends ORMSnippet {

    @Override
    public String getSnippet() throws InvalidDataException {
        return annotate(LOB);
    }

    @Override
    public Collection<String> getImportSnippets() throws InvalidDataException {
        return singleton(LOB_FQN);
    }

}

redpajama_set_name: RedPajamaGithub


text:
 democrat.work
 democrat.codes
 democrat.download
 democrat.healthcare
 democrat.hosting
 democrat.software
 democracy.fyi
 democratic.technology

|

 liberalism.faith
 liberalism.flowers
 liberalism.run
 liberalism.win
 nation.codes
 nation.computer
 nation.land
 nation.technology
 union.democrat
 value.democrat
 weare.democrat
 workers.democrat

|

 elizabeth.democrat
 warren.democrat
 leahy.democrat
 bernie.science
 sanders.party


text: export { PanVertical as default } from "./";


text:
import React, { Component } from 'react';

class CountryRank extends Component {
	render() {
		let mmrTable = null;

		let { countriesRank } = this.props;

		if (countriesRank && countriesRank.length > 0) {
			let countryRows = [];
			countriesRank.forEach((row, index) => {
				countryRows.push(
					<tr key={`country_mmr_for_${row.loccountrycode}`}>
						{index + 1}
						{row.common}
						{row.count}
						{row.avg}

				);
			});

			mmrTable =

							Rank
							Name
							Total
							Avg MMR

						{countryRows}

		}

		return mmrTable;
	}
}

export default CountryRank


text:
BEGIN;

DROP INDEX reportgrouptestrunstats_idx_testrun_id;

ALTER TABLE reportgrouptestrunstats ADD COLUMN success_ratio VARCHAR(20);

COMMIT;


text:
package org.apache.pig.test.udf.evalfunc;

import java.io.*;
import java.text.*;
import java.util.*;
import org.apache.pig.EvalFunc;
import org.apache.pig.PigException;
import org.apache.pig.data.*;
import org.apache.pig.data.DefaultTupleFactory;
import org.apache.pig.data.BagFactory;
import org.apache.pig.backend.executionengine.ExecException;

public class BadUdf3 extends EvalFunc<DataBag>
{
    public DataBag exec(Tuple input) throws IOException
    {
        try
        {
            DataBag bag = BagFactory.getInstance().newDefaultBag();

            Tuple t = DefaultTupleFactory.getInstance().newTuple(2); // BUG BUG: Notice how there are supposed to be 2
//fields but then 3 fields are written out below.
            t.set(0,"a");
            t.set(1,"b");
            t.set(2,"c");

            Tuple s = DefaultTupleFactory.getInstance().newTuple(2);
            s.set(0,"A");
            s.set(1,"B");
            s.set(2,"C");

            bag.add(t);
            bag.add(s);

            return bag;
        }
        catch (ExecException e)
        {
            throw new PigException("Error during execution", e);
        }
    }
}


text:
namespace Xaml
{
    public partial class MainWindow
    {
        public MainWindow()
        {
      //      InitializeComponent();
        }
    }
}


text:
var TEST_FILE_URL = 'http://127.0.0.1:PORT/extensions/test_file.html'

chrome.test.getConfig((config) => {
  var createdTabId = undefined;
  chrome.test.runTests([
    function createTab() {
      // TODO(lazyboy): Use openTab() from tabs_util.js after ensuring import is
      // stable in extension Service Workers.
      var testComplete = false;
      chrome.tabs.onUpdated.addListener(function listener(tabId, changeInfo) {
        if (!createdTabId || tabId != createdTabId ||
            changeInfo.status !== 'complete') {
          return;
        }
        chrome.tabs.onUpdated.removeListener(listener);
        if (!testComplete)
          chrome.test.succeed();
      });
      var testUrl = TEST_FILE_URL.replace(/PORT/, config.testServer.port);
      chrome.tabs.create({url: testUrl}, function(tab) {
          createdTabId = tab.id;
        if (tab.status === 'complete') {
          testComplete = true;
          chrome.test.succeed();
        }
        // Otherwise tabs.onUpdated will be called.
      });
    },
    function testTabsSendMessage() {
      chrome.runtime.onMessage.addListener((msg) => {
        chrome.test.assertEq('worker->tab->worker', msg);
        chrome.test.succeed();
      });
      chrome.tabs.sendMessage(createdTabId, 'worker->tab');
    },
  ]);
});


text:
@interface AcronymTableViewDataSource()

@property (strong, nonatomic) NSArray *acronymList;

@end

@implementation AcronymTableViewDataSource

- (void) setNewAcronymList:(NSArray *)newList {
    self.acronymList = [[NSArray alloc] initWithArray:newList];
}

#pragma mark - UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.acronymList.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }

    NSString *acronymResult = [self.acronymList objectAtIndex:indexPath.row];

    cell.textLabel.text = acronymResult;

    return cell;
}

@end


text:
namespace OpenERPOutlookPlugin
{
    partial class frm_select_partner
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frm_select_partner));
            this.txt_select_partner = new System.Windows.Forms.TextBox();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.lstbox_select_partner = new System.Windows.Forms.ListBox();
            this.btn_select_partner_select = new System.Windows.Forms.Button();
            this.btn_select_partner_close = new System.Windows.Forms.Button();
            this.btn_select_partner_search = new System.Windows.Forms.Button();
            this.groupBox1.SuspendLayout();
            this.SuspendLayout();
            //
            // txt_select_partner
            //
            this.txt_select_partner.Location = new System.Drawing.Point(19, 20);
            this.txt_select_partner.Name = "txt_select_partner";
            this.txt_select_partner.Size = new System.Drawing.Size(209, 20);
            this.txt_select_partner.TabIndex = 0;
            //
            // groupBox1
            //
            this.groupBox1.Controls.Add(this.lstbox_select_partner);
            this.groupBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.groupBox1.Location = new System.Drawing.Point(13, 51);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(307, 368);
            this.groupBox1.TabIndex = 7;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Partner Name";
            //
            // lstbox_select_partner
            //
            this.lstbox_select_partner.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lstbox_select_partner.FormattingEnabled = true;
            this.lstbox_select_partner.Location = new System.Drawing.Point(6, 27);
            this.lstbox_select_partner.Name = "lstbox_select_partner";
            this.lstbox_select_partner.Size = new System.Drawing.Size(295, 329);
            this.lstbox_select_partner.TabIndex = 4;
            //
            // btn_select_partner_select
            //
            this.btn_select_partner_select.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.btn_select_partner_select.Image = global::OpenERPOutlookPlugin.Properties.Resources.Success;
            this.btn_select_partner_select.ImageAlign = System.Drawing.ContentAlignment.BottomLeft;
            this.btn_select_partner_select.Location = new System.Drawing.Point(192, 432);
            this.btn_select_partner_select.Name = "btn_select_partner_select";
            this.btn_select_partner_select.Size = new System.Drawing.Size(53, 23);
            this.btn_select_partner_select.TabIndex = 6;
            this.btn_select_partner_select.Text = "&Link";
            this.btn_select_partner_select.TextAlign = System.Drawing.ContentAlignment.TopRight;
            this.btn_select_partner_select.UseVisualStyleBackColor = true;
            this.btn_select_partner_select.Click += new System.EventHandler(this.btn_select_partner_select_Click);
            //
            // btn_select_partner_close
            //
            this.btn_select_partner_close.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.btn_select_partner_close.Image = global::OpenERPOutlookPlugin.Properties.Resources.Error;
            this.btn_select_partner_close.ImageAlign = System.Drawing.ContentAlignment.BottomLeft;
            this.btn_select_partner_close.Location = new System.Drawing.Point(251, 432);
            this.btn_select_partner_close.Name = "btn_select_partner_close";
            this.btn_select_partner_close.Size = new System.Drawing.Size(64, 23);
            this.btn_select_partner_close.TabIndex = 5;
            this.btn_select_partner_close.Text = "&Close ";
            this.btn_select_partner_close.TextAlign = System.Drawing.ContentAlignment.TopRight;
            this.btn_select_partner_close.UseVisualStyleBackColor = true;
            this.btn_select_partner_close.Click += new System.EventHandler(this.btn_select_partner_close_Click);
            //
            // btn_select_partner_search
            //
            this.btn_select_partner_search.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.btn_select_partner_search.Image = ((System.Drawing.Image)(resources.GetObject("btn_select_partner_search.Image")));
            this.btn_select_partner_search.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.btn_select_partner_search.Location = new System.Drawing.Point(245, 19);
            this.btn_select_partner_search.Name = "btn_select_partner_search";
            this.btn_select_partner_search.Size = new System.Drawing.Size(75, 23);
            this.btn_select_partner_search.TabIndex = 1;
            this.btn_select_partner_search.Text = "&Search ";
            this.btn_select_partner_search.TextAlign = System.Drawing.ContentAlignment.TopRight;
            this.btn_select_partner_search.UseVisualStyleBackColor = true;
            this.btn_select_partner_search.Click += new System.EventHandler(this.btn_select_partner_search_Click);
            //
            // frm_select_partner
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(350, 467);
            this.Controls.Add(this.groupBox1);
            this.Controls.Add(this.btn_select_partner_select);
            this.Controls.Add(this.btn_select_partner_close);
            this.Controls.Add(this.btn_select_partner_search);
            this.Controls.Add(this.txt_select_partner);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.MaximizeBox = false;
            this.Name = "frm_select_partner";
            this.Text = "Select Partner";
            this.Load += new System.EventHandler(this.frm_select_partner_Load);
            this.groupBox1.ResumeLayout(false);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.TextBox txt_select_partner;
        private System.Windows.Forms.Button btn_select_partner_search;
        private System.Windows.Forms.Button btn_select_partner_close;
        private System.Windows.Forms.Button btn_select_partner_select;
        private System.Windows.Forms.GroupBox groupBox1;
        private System.Windows.Forms.ListBox lstbox_select_partner;
    }
}


text:
<?xml version= "1.0" encoding="UTF8"?>
<Movies>
	<Movie>
		<title>Iron Man</title>
		<starActor>Robert Downey Jr.</starActor>
		<characters>
			<Character>
				<characterName>Tony Stark</characterName>
                    <characterNotes>
                        <CharacterNote>
                            <noteDescription>Billionaire playboy philanthropist.</noteDescription>
                        </CharacterNote>
                    </characterNotes>
			</Character>
			<Character>
				<characterName>Pepper Pots</characterName>
                <characterNotes>
                    <CharacterNote>
                        <noteDescription>Tony Stark's main squeeze.</noteDescription>
                    </CharacterNote>
                </characterNotes>
			</Character>
        </characters>
    </Movie>
    <Movie>
		<title>Shawshank Redemption</title>
		<starActor>Morgan Freeman</starActor>
		<characters>
			<Character>
				<characterName>Red</characterName>
                <characterNotes>
                    <CharacterNote>
                        <noteDescription>Prisoner who can get just about anything.</noteDescription>
                    </CharacterNote>
                </characterNotes>
			</Character>
			<Character>
				<characterName>Andy</characterName>
                <characterNotes>
                    <CharacterNote>
                        <noteDescription>Wrongly accused banker of killing his wife.</noteDescription>
                    </CharacterNote>
                    <CharacterNote>
                        <noteDescription>Intelligent, selfless, and innocent.</noteDescription>
                    </CharacterNote>
                </characterNotes>
			</Character>
            <Character>
				<characterName>The Warden</characterName>
                <characterNotes>
                    <CharacterNote>
                        <noteDescription>A real jerk.</noteDescription>
                    </CharacterNote>
                    <CharacterNote>
                        <noteDescription>Uses the prisoners to make money buy underbidding every contractor in town.</noteDescription>
                    </CharacterNote>
                </characterNotes>
			</Character>
        </characters>
    </Movie>
    <Movie>
		<title>Star Wars Episode 4</title>
		<starActor>Harrison Ford</starActor>
		<characters>
			<Character>
				<characterName>Luke Skywalker</characterName>
                <characterNotes>
                    <CharacterNote>
                        <noteDescription>Son of Darth Vader.  But, ssssh, don't tell him that yet.</noteDescription>
                    </CharacterNote>
                    <CharacterNote>
                        <noteDescription>The chosen one.</noteDescription>
                    </CharacterNote>
                    <CharacterNote>
                        <noteDescription>Raised by his aunt and uncle on Tatooine.</noteDescription>
                    </CharacterNote>
                </characterNotes>
			</Character>
			<Character>
				<characterName>Darth Vader</characterName>
                <characterNotes>
                    <CharacterNote>
                        <noteDescription>The best villain of all time.</noteDescription>
                    </CharacterNote>
                </characterNotes>
			</Character>
            <Character>
				<characterName>Han Solo</characterName>
                <characterNotes>
                    <CharacterNote>
                        <noteDescription>He definitely shoots first.</noteDescription>
                    </CharacterNote>
                    <CharacterNote>
                        <noteDescription>Smuggler working for Jaba the Hutt.  Owes him lots of dough.</noteDescription>
                    </CharacterNote>
                </characterNotes>
			</Character>
            <Character>
				<characterName>Princess Leia</characterName>
                <characterNotes>
                    <CharacterNote>
                        <noteDescription>Looks great in a slave outfit.</noteDescription>
                    </CharacterNote>
                    <CharacterNote>
                        <noteDescription>Luke's sister.</noteDescription>
                    </CharacterNote>
                    <CharacterNote>
                        <noteDescription>Stubbon but confident.  Likes the insult scruffy lookin' nerf herder</noteDescription>
                    </CharacterNote>
                </characterNotes>
			</Character>
        </characters>
    </Movie>
    <Movie>
		<title>Face Off</title>
		<starActor>Nicolas Cage, who else?</starActor>
		<characters>
			<Character>
				<characterName>Polyx Troy</characterName>
                <characterNotes>
                    <CharacterNote>
                        <noteDescription>Imprisoned brother of Caster.  Terrorist.</noteDescription>
                    </CharacterNote>
                </characterNotes>
			</Character>
			<Character>
				<characterName>Caster Troy</characterName>
                <characterNotes>
                    <CharacterNote>
                        <noteDescription>Terrorist.  Likes to steal people's faces.</noteDescription>
                    </CharacterNote>
                </characterNotes>
			</Character>
        </characters>
    </Movie>
    <Movie>
		<title>Braveheart</title>
		<starActor>Mel Gibson</starActor>
		<characters>
			<Character>
				<characterName>William Wallace</characterName>
                <characterNotes>
                    <CharacterNote>
                        <noteDescription>Do NOT kill his wife.  Or he will reign great vengenance upon you.</noteDescription>
                    </CharacterNote>
                    <CharacterNote>
                        <noteDescription>Leads a great revolution, and impregnates the king's daughter.</noteDescription>
                    </CharacterNote>
                    <CharacterNote>
                        <noteDescription>Talks real funny.</noteDescription>
                    </CharacterNote>
                    <CharacterNote>
                        <noteDescription>A true Scottsman with a true kilt.</noteDescription>
                    </CharacterNote>
                    <CharacterNote>
                        <noteDescription>FREEDOM!!!!!</noteDescription>
                    </CharacterNote>
                    <CharacterNote>
                        <noteDescription>Honestly, the crazy Irishman is the best character in this movie.</noteDescription>
                    </CharacterNote>
                </characterNotes>
			</Character>
            <Character>
				<characterName>Crazy Irishman</characterName>
                <characterNotes>
                    <CharacterNote>
                        <noteDescription>Best character in the movie.</noteDescription>
                    </CharacterNote>
                </characterNotes>
			</Character>
        </characters>
    </Movie>
</Movies>


text:
require 'compass-colors'

project_type = :stand_alone
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "css"
sass_dir = "scss"
images_dir = "images"
javascripts_dir = "javascript"
output_style = :compact
# To enable relative paths to assets via compass helper functions. Uncomment:
# relative_assets = true

asset_cache_buster = :none


text:
var gb = require('./function.con.js').gb;
var util = require('./function.con.js').util;

function deletefile(param,callback){
	if(!callback)callback = function(rs){return rs};
	callback(_deletefile(param.f));
}

/*
	删除给定文件

	param:
		f:路径
	rs:结果反馈
*/
function _deletefile(p){
	try{
		gb['fs'].unlinkSync(p);
	}catch(e){
		return util.rs('error','删除文件出错!->错误信息:'+e.message);
	}
	return util.rs();
}

exports.deletefile = deletefile;


text:
msquaredc
=========

.. testsetup::

    from msquaredc import *

.. automodule:: msquaredc
    :members:


text:
package org.apache.axis2.jaxws.addressing.factory;

import javax.xml.bind.JAXBException;
import javax.xml.transform.Source;
import javax.xml.ws.EndpointReference;

/**
 * This class represents factories that can be used to generate instances of the
 * {@link EndpointReference}.
 */
public interface JAXWSEndpointReferenceFactory {
    /**
     * Create an instance of a supported subclass of EndpointReference.
     *
     * @param eprInfoset the endpoint reference
     * @return an instance of EndpointReference.
     * @throws JAXBException
     */
    public EndpointReference createEndpointReference(Source eprInfoset) throws JAXBException;

    /**
     * Map the specified class to a supported WS-Addressing namespace.
     *
     * @param <T> a subclass of EndpointReference.
     * @param clazz the class.
     * @return the WS-Addressing namespace that is associated with the class.
     */
    public <T extends EndpointReference> String getAddressingNamespace(Class<T> clazz);
}


text:
layout: minimal
title: "About the Clan"
permalink: /about/index.html
description: "Information about the Clan and its leaders"
---

About the Clan

Leaders

Here is the current line-up of our leaders

Kavon80 - Leader (Second account: kav 2)

Stewdaddy - Co-Leader (Second account: Boomer-0728)

Lexy - Co-Leader

Seth - Co-Leader

You - Co-Leader

Stymie - Co-Leader

138 - Co-Leader (Second account: 138)

Stoudenmier - Co-Leader (Second account: Stoud Jr.)

Chris2fourlaw - Co-Leader (Second account: C2FLTheSecond)

Rules

Our main rules are:

Be a active donator. Try to keep the "Troops Donated" number above the "Troops Recived".

If you are new, you must at least say "Hi" before requesting.

Follow the range of bases you are given by the war lord.

Use both attacks in war except if all bases in your range are 3 starred.

Do NOT ask for Elder or Co or there will be an immediate boot.

Set your war preference before war starts.

If you fail to follow one of these rules, you will be warned. If asked a second time, you will be demoted or kicked based on your rank.


text:
"use strict";
// Karma configuration
// Generated on Wed Jul 22 2015 16:41:45 GMT-0300 (Hora estándar de Argentina)

module.exports = function(config, preConfig) {
  config.set({

    // base path that will be used to resolve all patterns (eg. files, exclude)
    basePath: '',

    // frameworks to use
    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
    frameworks: ['mocha','expect'],

    // list of files / patterns to load in the browser
    files: [
      'node_modules/require-bro/lib/polyfills-bro.js',
      'node_modules/require-bro/lib/require-bro.js',
      'node_modules/sinon/pkg/sinon.js',
      'node_modules/audit-copy/audit-copy.js',
      './best-globals.js',
      'node_modules/discrepances/lib/discrepances.js',
      'node_modules/esprima/dist/esprima.js',
      'node_modules/type-store/type-store.js',
      'test/*.js'
    ],

    // list of files to exclude
    exclude: [
    ],

    // preprocess matching files before serving them to the browser
    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
    // /* ESPERANDO QUE ARREGLEN: https://github.com/karma-runner/karma/issues/1768
    preprocessors: {
      /* 'lib/typed-controls.js': !!preConfig.singleRun?['coverage']:[] /* COMENTAR PARA VER MÁS LIMPIO EL CÓDIGO */
    },
    coverageReporter: process.env.TRAVIS||preConfig.singleRun?{
        type : 'json',
        dir : 'coverage/'
    }:{
        type: 'lcov',
        dir: 'coverage/'
    },
    // */

    // test results reporter to use
    // possible values: 'dots', 'progress'
    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
    reporters: ['progress', 'coverage', 'coverage-html-index'],

    // web server port
    port: 9876,

    // enable / disable colors in the output (reporters and logs)
    colors: true,

    // level of logging
    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
    // logLevel: config.LOG_INFO,
    logLevel: config.LOG_DEBUG,
    // logLevel: config.LOG_ERROR,

    // enable / disable watching file and executing tests whenever any file changes
    autoWatch: true,

    // start these browsers
    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
    browsers: ['Firefox'].concat((process.env.TRAVIS?[]:['Chrome'])),
    /* NO CAMBIAR MÁS BROWSERS DIRECTO DESDE ACÁ, INVOCAR DESDE LA LÍNEA DE PARÁMETROS ASÍ:
    npm run infinito -- --browsers Chrome
    npm run infinito -- --browsers Firefox,Safari,Chrome
    npm run infinito -- --browsers Firefox,Safari,Chrome,IE
    */

    // Continuous Integration mode
    // if true, Karma captures browsers, runs the tests and exits
    singleRun: !!process.env.TRAVIS || !!process.env.SINGLE_RUN || preConfig.singleRun
  });
};


text:
import BitString from '../bit_string';
import Tuple from '../tuple';
import Enum from '../enum';
import * as Patterns from '../patterns/patterns';

let SpecialForms = {

  __DIR__: function(){
    if(__dirname){
      return __dirname;
    }

    if(document.currentScript){
      return document.currentScript.src;
    }

    return null;
  },

  atom: function(_value) {
    return Symbol.for(_value);
  },

  list: function(...args){
    return Object.freeze(args);
  },

  bitstring: function(...args){
    return new BitString(...args);
  },

  bound: function(_var){
    return Patterns.bound(_var);
  },

  _case: function(condition, clauses){
    return Patterns.defmatch(...clauses)(condition);
  },

  cond: function(clauses){
    for(let clause of clauses){
      if(clause[0]){
        return clause[1]();
      }
    }

    throw new Error();
  },

  fn: function(clauses){
    return Patterns.defmatch(clauses);
  },

  map: function(obj){
    return Object.freeze(obj);
  },

  map_update: function(map, values){
    let obj = Object.assign({}, map);
    return Object.freeze(Object.assign(obj, values));
  },

  _for: function(collections, fun, filter = () => true, into = [], previousValues = []){
    let pattern = collections[0][0];
    let collection = collections[0][1];

    if(collections.length === 1){

      for(let elem of collection){
        let r = Patterns.match_no_throw(pattern, elem);
        let args = previousValues.concat(r);

        if(r && filter.apply(this, args)){
          into = Enum.into([fun.apply(this, args)], into);
        }
      }

      return into;
    }else{
      let _into = []

      for(let elem of collection){
        let r = Patterns.match_no_throw(pattern, elem);
        if(r){
          _into = Enum.into(this._for(collections.slice(1), fun, filter, _into, previousValues.concat(r)), into);
        }
      }

      return _into;
    }
  },

  receive: function(receive_fun, timeout_in_ms = null, timeout_fn = (time) => true){
    if (timeout_in_ms == null || timeout_in_ms === System.for('infinity')) {
      while(true){
        if(self.mailbox.length !== 0){
          let message = self.mailbox[0];
          self.mailbox = self.mailbox.slice(1);
          return receive_fun(message);
        }
      }
    }else if(timeout_in_ms === 0){
      if(self.mailbox.length !== 0){
        let message = self.mailbox[0];
        self.mailbox = self.mailbox.slice(1);
        return receive_fun(message);
      }else{
        return null;
      }
    }else{
      let now = Date.now();
      while(Date.now() < (now + timeout_in_ms)){
        if(self.mailbox.length !== 0){
          let message = self.mailbox[0];
          self.mailbox = self.mailbox.slice(1);
          return receive_fun(message);
        }
      }

      return timeout_fn(timeout_in_ms);
    }
  },

  tuple: function(...args){
    return new Tuple(...args);
  },

  _try: function(do_fun, rescue_function, catch_fun, else_function, after_function){
    let result = null;

    try{
      result = do_fun();
    }catch(e){
      let ex_result = null;

      if(rescue_function){
        try{
          ex_result = rescue_function(e);
          return ex_result;
        }catch(ex){
          if(ex instanceof Patterns.MatchError){
            throw ex;
          }
        }
      }

      if(catch_fun){
        try{
          ex_result = catch_fun(e);
          return ex_result;
        }catch(ex){
          if(ex instanceof Patterns.MatchError){
            throw ex;
          }
        }
      }

      throw e;

    }finally{
      if(after_function){
        after_function();
      }
    }

    if(else_function){
      try{
        return else_function(result);
      }catch(ex){
          if(ex instanceof Patterns.MatchError){
            throw new Error("No Match Found in Else");
          }

        throw ex;
      }
    }else{
      return result;
    }
  }

};

export default SpecialForms;


text:
require 'toque'
require 'fileutils'

Capistrano::Configuration.instance.load do
  set(:cookbooks_path) { File.expand_path('./cookbooks') }
  set(:user) { fetch(:deploy_user, nil) }

  namespace :toque do

    desc "Run all configured recipes"
    task :run_recipes do
      old_user = user
      # all chef stuff must use sudo
      set :user, admin_user

      begin
        upload_cookbooks
      rescue
        puts "Previous toque run did not complete, cleaning up..."
        cleanup_cookbooks
        retry
      end

      json_data = Toque::build_node_json(variables)

      Toque::chef_recipes.each do |recipe, options|
        server_json = json_data.dup

        server_json[:run_list] = [recipe]

        put server_json.to_json, '/tmp/node.json'

        sudo "chef-solo -c /tmp/solo.rb -j /tmp/node.json", options
      end

      cleanup_cookbooks

      # reset the old user value
      set :user, old_user
    end

    desc "dumps the node json file and prints it to the screen using awesome_print"
    task :dry_run do
      ap :node => Toque::build_node_json(variables, Toque::chef_recipes.keys.split(','))
    end

    # push all chef configurations to server
    desc "[internal] Upload cookbooks to all configured servers."
    task :upload_cookbooks do
      # upload cookbooks
      upload cookbooks_path, '/tmp/cookbooks', :max_hosts => 4

      # generate the solo.rb file
      put "file_cache_path '/var/chef-solo'\ncookbook_path '/tmp/cookbooks'", '/tmp/solo.rb'
    end

    task :cleanup_cookbooks do
      run 'rm -rf /tmp/cookbooks /tmp/solo.rb /tmp/node.json || true'
    end

    if ( exists?(:cookbook_repository) )
      desc "Check-out/clone the cookbook repository"
      task :prepare do
        puts "going to fetch the cookbook repository"
      end
    end

    # initialize your shit.
    namespace :init do
      task :all do
        cookbooks
      end

      desc "copy the default cookbooks"
      task :cookbooks do
        puts "Installing default cookbooks..."
        FileUtils.cp_r File.join(File.dirname(__FILE__), '../cookbooks'), "./"
      end
    end

  end
end


text:
module MagicBeans
	class SVG

		include ActionView::Helpers

		attr_reader :svg_name, :image_name, :options

		def initialize(svg_name, image_name = nil, **opts)
			@svg_name = svg_name.is_a?(Symbol) ? svg_name.to_s.dasherize : svg_name.to_s.strip
			@image_name = (image_name.blank? ? svg_name : image_name)
			@options = opts

			prepare_options

			if !exists? && MagicBeans.config.svg.is_buildable? && can_create?
				create
			elsif exists?
				MagicBeans.log("SVG", "No SVG needs processing. #{image_path} already exists.")
			elsif !MagicBeans.config.svg.is_buildable?
				MagicBeans.log("SVG", "Not processing #{svg_path}, MagicBeans SVG processor is not configured to run in the environment '#{Rails.env}'")
			end
		end

		def html_tag
			image_tag svg_asset_path, attributes
		end

		def attributes
			attrs = { data: {} }
			attrs[:size] = size unless size.blank?
			attrs[:data] = { svg: true, image: image_asset_path, size: size }.reject { |k,v| v.blank? }
			attrs[:class] = options[:class] if options.has_key?(:class)
			attrs
		end

		def exists?
			File.exists?(image_path) && File.exists?(svg_output_path)
		end

		# Image Name / Path
		def image
			name = image_name.is_a?(Symbol) ? image_name.to_s.dasherize : image_name.to_s.strip
			name.gsub! /(^("|'))|(('|")$)/, ""
			name.gsub! /\.svg$/i, ""
			name << ".#{image_extension}" unless /\.[a-z]+$/i =~ name
			name.gsub! Regexp.new("#{image_extension}$", Regexp::IGNORECASE), [color, size, image_extension].reject(&:blank?).join(".")
			name
		end

		def image_path
			File.join MagicBeans.config.svg.fallback_directory, image
		end

		def image_asset_path
			if options[:asset_lookup]
				ActionController::Base.helpers.asset_path(image)
			else
				begin
					Rails.application.assets.find_asset(image).try(:digest_path) || false
				rescue => e
					false
				end
			end
		end

		# SVG Name / Path
		def svg
			source.gsub /svg$/i, [color, "svg"].reject(&:blank?).join(".")
		end

		def svg_path
			File.join MagicBeans.config.svg.icon_directory, svg
		end

		def svg_output_path
			File.join MagicBeans.config.svg.fallback_directory, svg
		end

		def svg_asset_path
			if options[:asset_lookup]
				ActionController::Base.helpers.asset_path(svg)
			else
				begin
					Rails.application.assets.find_asset(svg).try(:digest_path) || false
				rescue => e
					false
				end
			end
		end

		# SVG Source Name / Path
		def source
			name = svg_name.dup
			name.gsub! /(^("|'))|(('|")$)/, ""
			name << ".svg" unless /\.svg$/i =~ name
			name
		end

		def source_path
			File.join MagicBeans.config.svg.icon_directory, source
		end

		def create
			begin
				prepare
				::MiniMagick::Tool::Convert.new do |convert|
					convert.merge! ["-background", "none"]
					convert.merge! ["-gravity", "center"]
					if size
						convert.merge! ["-density", 1200]
						convert.merge! ["-resize", size] unless size.blank?
						convert.merge! ["-extent", size] unless size.blank?
					end
					convert << (File.exists?(svg_output_path) ? svg_output_path : svg_path)
					convert << image_path
					convert
				end
				MagicBeans.log("SVG", "Created #{image_path} from #{svg_output_path}")
				true
			rescue => e
				MagicBeans.log("SVG", e.message, true)
				false
			end
		end

		def prepare
			if !color.blank? && !File.exists?(svg_output_path)
				# Get the svg source directory path
				filedir = File.dirname(source_path)

				# Get the svg contents
				content = File.read(source_path)

				# Set the color of any path/stroke in the svg
				content.gsub! /fill=\"[^\"]+\"/, "fill=\"#{options[:color]}\""
				content.gsub! /stroke=\"[^\"]+\"/, "stroke=\"#{options[:color]}\""

				# Write the new svg file
				File.open(svg_output_path, "w") { |f| f.puts content }

				MagicBeans.log("SVG", "Created #{svg_output_path} from #{source_path}")
			end
		end

		def image_extension
			extensions.first
		end

		def extensions
			options[:extension]
		end

		def color
			options[:color].to_s.gsub(/[^A-Z0-9]+/i, "").upcase
		end

		def size
			return options[:size].to_s.gsub(/(^("|'))|(('|")$)/, "") if /\d+x\d+/ =~ options[:size].to_s
			return "#{options[:size]}x#{options[:size]}".to_s.gsub(/(^("|'))|(('|")$)/, "") if /\d+/ =~ options[:size].to_s
			options[:size].to_s.gsub /(^("|'))|(('|")$)/, ""
		end

		def can_create?
			MagicBeans.log("SVG", "Unknown SVG: #{source_path}", true) unless File.exists?(source_path)
			File.exists?(source_path)
		end

		private

			def prepare_options
				options.deep_symbolize_keys!
				options[:asset_lookup] ||= false
				options[:extension] = nil unless options[:extension].is_a?(Array)
				options[:extension] ||= [:png, :jpg, :gif]
				options[:extension].flatten!
				options[:extension].map!(&:to_s)
				options[:size] ||= nil
			end
	end
end


text:
package docli

import (
	"bufio"
	"bytes"
	"flag"
	"fmt"
	"os"
	"os/exec"

	"github.com/Sirupsen/logrus"
	"github.com/codegangsta/cli"
	"github.com/digitalocean/godo"
	"golang.org/x/oauth2"
)

// DefaultConfig is the current configuration for the commands.
var DefaultConfig Config = &LiveConfig{}

type TokenSource struct {
	AccessToken string
}

// TestConfig is an implemenation of Config that can be inspected during tests.
type TestConfig struct {
	Client *godo.Client
	SSHFn  func(user, host string) error
}

// NewTestConfig creates a TestConfig.
func NewTestConfig(client *godo.Client) *TestConfig {
	return &TestConfig{
		Client: client,
		SSHFn: func(u, h string) error {
			logrus.WithFields(logrus.Fields{
				"user": u,
				"host": h,
			}).Info("ssh")
			return nil
		},
	}
}

// NewClient returns the specified godo.Client.
func (cs *TestConfig) NewClient(_ string) *godo.Client {
	return cs.Client
}

// SSH allows the developer to inspect the status of the ssh connection during tests.
func (cs *TestConfig) SSH(user, host string) error {
	return cs.SSHFn(user, host)
}

func (t *TokenSource) Token() (*oauth2.Token, error) {
	return &oauth2.Token{
		AccessToken: t.AccessToken,
	}, nil
}

func LoadOpts(c *cli.Context) *Opts {
	return &Opts{
		Debug: c.GlobalBool("debug"),
	}
}

// Config holds configuration values for commands. It currently contains a godo Client
// and a method for running SSH.
type Config interface {
	NewClient(token string) *godo.Client
	SSH(user, host string) error
}

// LiveConfig
type LiveConfig struct{}

// NewClient creates creates a godo.Client givent a token.
func (cs *LiveConfig) NewClient(token string) *godo.Client {
	tokenSource := &TokenSource{
		AccessToken: token,
	}

	oauthClient := oauth2.NewClient(oauth2.NoContext, tokenSource)
	return godo.NewClient(oauthClient)
}

// SSH runs the ssh binary given a user and a host. It preserves stdin, stdout, and stderr.
func (cs *LiveConfig) SSH(user, host string) error {
	logrus.WithFields(logrus.Fields{
		"user": user,
		"host": host,
	}).Info("ssh")

	sshHost := fmt.Sprintf("%s@%s", user, host)
	cmd := exec.Command("ssh", sshHost)
	cmd.Stdin = os.Stdin
	cmd.Stdout = os.Stdout
	cmd.Stderr = os.Stderr

	return cmd.Run()
}

// NewClient creates a Client.
func NewClient(c *cli.Context, cs Config) *godo.Client {
	if cs == nil {
		cs = &LiveConfig{}
	}

	pat := c.GlobalString("token")
	return cs.NewClient(pat)
}

func WithinTest(cs Config, fs *flag.FlagSet, fn func(*cli.Context)) {
	ogSource := DefaultConfig
	DefaultConfig = cs

	defer func() {
		DefaultConfig = ogSource
	}()

	var b bytes.Buffer
	app := cli.NewApp()
	app.Writer = bufio.NewWriter(&b)

	globalSet := flag.NewFlagSet("global test", 0)
	globalSet.String("token", "token", "token")

	globalCtx := cli.NewContext(app, globalSet, nil)

	if fs == nil {
		fs = flag.NewFlagSet("local test", 0)
	}

	c := cli.NewContext(app, fs, globalCtx)

	fn(c)
}

func ErrWithUsage(c *cli.Context, msg string) {
	logrus.Error(msg)
	cli.ShowCommandHelp(c, c.Command.Name)
}

func bailFatal(err error, msg string) {
	logrus.WithField("err", err).Fatal(msg)
}

func extractDropletPublicIP(droplet *godo.Droplet) string {
	for _, in := range droplet.Networks.V4 {
		if in.Type == "public" {
			return in.IPAddress
		}
	}

	return ""

}


text:
{-# OPTIONS -#include "libtcc.h" #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}

--------------------------------------------------------------------
-- |
-- Module    :  Language.TCC
-- Copyright :  (c) Vo Minh Thu 2009
-- License   :  BSD3
-- Maintainer:  Vo Minh Thu <noteed@gmail.com>
-- Stability :  experimental
-- Portability: Requires FFI
--
--------------------------------------------------------------------
--
-- Haskell bindings to the Tiny C Compiler library (libtcc).
--

module Language.TCC where

import Foreign.C        (CInt, CULong)
import Foreign.C.String (CString, withCString)
import Foreign.Ptr      (Ptr, FunPtr)
import Data.Word        (Word32)
import Foreign.Storable (peek, Storable, sizeOf)
import Foreign.Marshal.Alloc (free, mallocBytes)
import Control.Exception     (bracket)

--------------------------------------------------------------------
--
-- Bindings against TCC 0.9.24
--

-- TCCState *
newtype TCCState = TCCState (Ptr ()) deriving Storable

-- TCCState *tcc_new(void);
foreign import ccall "libtcc.h tcc_new" c_new
  :: IO TCCState

-- void tcc_delete(TCCState *s);
foreign import ccall "libtcc.h tcc_delete" c_delete
  :: TCCState -> IO ()

-- void tcc_enable_debug(TCCState *s);
-- Appears in libtcc.h but not in libtcc.a ...
--foreign import ccall "libtcc.h tcc_enable_debug" c_enable_debug
--  :: TCCState -> IO ()

-- void tcc_set_error_func(TCCState *s, void *error_opaque,
--                         void (*error_func)(void *opaque, const char *msg));
foreign import ccall "libtcc.h tcc_set_error_func" c_set_error_func
  :: TCCState -> Ptr () -> FunPtr (Ptr () -> CString -> IO ()) -> IO ()

-- int tcc_set_warning(TCCState *s, const char *warning_name, int value);
foreign import ccall "libtcc.h tcc_set_warning" c_set_warning
  :: TCCState -> CString -> CInt -> IO CInt

-- int tcc_add_include_path(TCCState *s, const char *pathname);
foreign import ccall "libtcc.h tcc_add_include_path" c_add_include_path
  :: TCCState -> CString -> IO CInt

-- int tcc_add_sysinclude_path(TCCState *s, const char *pathname);
foreign import ccall "libtcc.h tcc_add_sysinclude_path" c_add_sysinclude_path
  :: TCCState -> CString -> IO CInt

-- void tcc_define_symbol(TCCState *s, const char *sym, const char *value);
foreign import ccall "libtcc.h tcc_define_symbol" c_define_symbol
  :: TCCState -> CString -> CString -> IO ()

-- void tcc_undefine_symbol(TCCState *s, const char *sym);
foreign import ccall "libtcc.h tcc_undefine_symbol" c_undefine_symbol
  :: TCCState -> CString -> IO ()

-- int tcc_add_file(TCCState *s, const char *filename);
foreign import ccall "libtcc.h tcc_add_file" c_add_file
  :: TCCState -> CString -> IO CInt

-- int tcc_compile_string(TCCState *s, const char *buf);
foreign import ccall "libtcc.h tcc_compile_string" c_compile_string
  :: TCCState -> CString -> IO CInt

-- #define TCC_OUTPUT_MEMORY   0
-- #define TCC_OUTPUT_EXE      1
-- #define TCC_OUTPUT_DLL      2
-- #define TCC_OUTPUT_OBJ      3
-- #define TCC_OUTPUT_PREPROCESS 4
type OutputType = Word32
tcc_OUTPUT_MEMORY     :: OutputType
tcc_OUTPUT_MEMORY     = 0
tcc_OUTPUT_EXE        :: OutputType
tcc_OUTPUT_EXE        = 1
tcc_OUTPUT_DLL        :: OutputType
tcc_OUTPUT_DLL        = 2
tcc_OUTPUT_OBJ        :: OutputType
tcc_OUTPUT_OBJ        = 3
tcc_OUTPUT_PREPROCESS :: OutputType
tcc_OUTPUT_PREPROCESS = 4

-- int tcc_set_output_type(TCCState *s, int output_type);
foreign import ccall "libtcc.h tcc_set_output_type" c_set_output_type
  :: TCCState -> OutputType -> IO CInt

-- #define TCC_OUTPUT_FORMAT_ELF    0
-- #define TCC_OUTPUT_FORMAT_BINARY 1
-- #define TCC_OUTPUT_FORMAT_COFF   2
type OutputFormat = Word32
tcc_OUTPUT_FORMAT_ELF    :: OutputFormat
tcc_OUTPUT_FORMAT_ELF    = 0
tcc_OUTPUT_FORMAT_BINARY :: OutputFormat
tcc_OUTPUT_FORMAT_BINARY = 1
tcc_OUTPUT_FORMAT_COFF   :: OutputFormat
tcc_OUTPUT_FORMAT_COFF   = 2

-- int tcc_add_library_path(TCCState *s, const char *pathname);
foreign import ccall "libtcc.h tcc_add_library_path" c_add_library_path
  :: TCCState -> CString -> IO CInt

-- int tcc_add_library(TCCState *s, const char *libraryname);
foreign import ccall "libtcc.h tcc_add_library" c_add_library
  :: TCCState -> CString -> IO CInt

-- int tcc_add_symbol(TCCState *s, const char *name, unsigned long val);
foreign import ccall "libtcc.h tcc_add_symbol" c_add_symbol
  :: TCCState -> CString -> CULong -> IO CInt

-- int tcc_output_file(TCCState *s, const char *filename);
foreign import ccall "libtcc.h tcc_output_file" c_output_file
  :: TCCState -> CString -> IO CInt

-- int tcc_run(TCCState *s, int argc, char **argv);
foreign import ccall "libtcc.h tcc_run" c_run
  :: TCCState -> CInt -> Ptr CString -> IO CInt

-- int tcc_relocate(TCCState *s);
foreign import ccall "libtcc.h tcc_relocate" c_relocate
  :: TCCState -> IO CInt

-- int tcc_get_symbol(TCCState *s, unsigned long *pval, const char *name);
foreign import ccall "libtcc.h tcc_get_symbol" c_get_symbol
  :: TCCState -> Ptr CULong -> CString -> IO CInt

--------------------------------------------------------------------
--
-- Convenience functions
--

-- Similar to alloca but return both the computation result and
-- the value of the temporarily allocated block of memory.
-- See the code of allocaBytes for a GHC specific way to
-- rewrite this (with newPinedByteArray).
withAlloca :: Storable a => (Ptr a -> IO b) -> IO (a,b)
withAlloca f = bracket (doMalloc undefined) free g
  where g m = do b <- f m
                 a <- peek m
                 return (a,b)
        doMalloc :: Storable a' => a' -> IO (Ptr a')
        doMalloc dummy = mallocBytes $ sizeOf dummy

getSymbol :: TCCState -> String -> IO (Maybe CULong)
getSymbol s name = do
  (addr,ret) <- withCString name (\str ->
    withAlloca (\addr -> c_get_symbol s addr str))
  if ret == 0 then return (Just addr)
              else return Nothing

foreign import ccall "convenience.h call" c_call
  :: CULong -> IO ()

foreign import ccall "convenience.h calli" c_calli
  :: CULong -> CInt -> IO ()


text:
namespace v8 {
namespace internal {
namespace interpreter {

BytecodeArrayBuilder::BytecodeArrayBuilder(
    Isolate* isolate, Zone* zone, int parameter_count, int context_count,
    int locals_count, FunctionLiteral* literal,
    SourcePositionTableBuilder::RecordingMode source_position_mode)
    : zone_(zone),
      bytecode_generated_(false),
      constant_array_builder_(zone, isolate->factory()->the_hole_value()),
      handler_table_builder_(zone),
      return_seen_in_block_(false),
      parameter_count_(parameter_count),
      local_register_count_(locals_count),
      context_register_count_(context_count),
      register_allocator_(fixed_register_count()),
      bytecode_array_writer_(zone, &constant_array_builder_,
                             source_position_mode),
      pipeline_(&bytecode_array_writer_),
      register_optimizer_(nullptr) {
  DCHECK_GE(parameter_count_, 0);
  DCHECK_GE(context_register_count_, 0);
  DCHECK_GE(local_register_count_, 0);

  if (FLAG_ignition_deadcode) {
    pipeline_ = new (zone) BytecodeDeadCodeOptimizer(pipeline_);
  }

  if (FLAG_ignition_peephole) {
    pipeline_ = new (zone) BytecodePeepholeOptimizer(pipeline_);
  }

  if (FLAG_ignition_reo) {
    register_optimizer_ = new (zone) BytecodeRegisterOptimizer(
        zone, &register_allocator_, fixed_register_count(), parameter_count,
        pipeline_);
  }

  return_position_ = literal ? literal->return_position() : kNoSourcePosition;
}

Register BytecodeArrayBuilder::first_context_register() const {
  DCHECK_GT(context_register_count_, 0);
  return Register(local_register_count_);
}

Register BytecodeArrayBuilder::last_context_register() const {
  DCHECK_GT(context_register_count_, 0);
  return Register(local_register_count_ + context_register_count_ - 1);
}

Register BytecodeArrayBuilder::Parameter(int parameter_index) const {
  DCHECK_GE(parameter_index, 0);
  return Register::FromParameterIndex(parameter_index, parameter_count());
}

Handle<BytecodeArray> BytecodeArrayBuilder::ToBytecodeArray(Isolate* isolate) {
  DCHECK(return_seen_in_block_);
  DCHECK(!bytecode_generated_);
  bytecode_generated_ = true;

  int register_count = total_register_count();

  if (register_optimizer_) {
    register_optimizer_->Flush();
    register_count = register_optimizer_->maxiumum_register_index() + 1;
  }

  Handle<FixedArray> handler_table =
      handler_table_builder()->ToHandlerTable(isolate);
  return pipeline_->ToBytecodeArray(isolate, register_count, parameter_count(),
                                    handler_table);
}

BytecodeSourceInfo BytecodeArrayBuilder::CurrentSourcePosition(
    Bytecode bytecode) {
  BytecodeSourceInfo source_position;
  if (latest_source_info_.is_valid()) {
    // Statement positions need to be emitted immediately.  Expression
    // positions can be pushed back until a bytecode is found that can
    // throw (if expression position filtering is turned on). We only
    // invalidate the existing source position information if it is used.
    if (latest_source_info_.is_statement() ||
        !FLAG_ignition_filter_expression_positions ||
        !Bytecodes::IsWithoutExternalSideEffects(bytecode)) {
      source_position = latest_source_info_;
      latest_source_info_.set_invalid();
    }
  }
  return source_position;
}

namespace {

template <OperandTypeInfo type_info>
class UnsignedOperandHelper {
 public:
  INLINE(static uint32_t Convert(BytecodeArrayBuilder* builder, size_t value)) {
    DCHECK(IsValid(value));
    return static_cast<uint32_t>(value);
  }

  INLINE(static uint32_t Convert(BytecodeArrayBuilder* builder, int value)) {
    DCHECK_GE(value, 0);
    return Convert(builder, static_cast<size_t>(value));
  }

 private:
  static bool IsValid(size_t value) {
    switch (type_info) {
      case OperandTypeInfo::kFixedUnsignedByte:
        return value <= kMaxUInt8;
      case OperandTypeInfo::kFixedUnsignedShort:
        return value <= kMaxUInt16;
      case OperandTypeInfo::kScalableUnsignedByte:
        return value <= kMaxUInt32;
      default:
        UNREACHABLE();
        return false;
    }
  }
};

template <OperandType>
class OperandHelper {};

#define DEFINE_UNSIGNED_OPERAND_HELPER(Name, Type) \
  template <>                                      \
  class OperandHelper<OperandType::k##Name>        \
      : public UnsignedOperandHelper<Type> {};
UNSIGNED_SCALAR_OPERAND_TYPE_LIST(DEFINE_UNSIGNED_OPERAND_HELPER)
#undef DEFINE_UNSIGNED_OPERAND_HELPER

template <>
class OperandHelper<OperandType::kImm> {
 public:
  INLINE(static uint32_t Convert(BytecodeArrayBuilder* builder, int value)) {
    return static_cast<uint32_t>(value);
  }
};

template <>
class OperandHelper<OperandType::kReg> {
 public:
  INLINE(static uint32_t Convert(BytecodeArrayBuilder* builder, Register reg)) {
    return builder->GetInputRegisterOperand(reg);
  }
};

template <>
class OperandHelper<OperandType::kRegList> {
 public:
  INLINE(static uint32_t Convert(BytecodeArrayBuilder* builder,
                                 RegisterList reg_list)) {
    return builder->GetInputRegisterListOperand(reg_list);
  }
};

template <>
class OperandHelper<OperandType::kRegPair> {
 public:
  INLINE(static uint32_t Convert(BytecodeArrayBuilder* builder,
                                 RegisterList reg_list)) {
    DCHECK_EQ(reg_list.register_count(), 2);
    return builder->GetInputRegisterListOperand(reg_list);
  }
};

template <>
class OperandHelper<OperandType::kRegOut> {
 public:
  INLINE(static uint32_t Convert(BytecodeArrayBuilder* builder, Register reg)) {
    return builder->GetOutputRegisterOperand(reg);
  }
};

template <>
class OperandHelper<OperandType::kRegOutPair> {
 public:
  INLINE(static uint32_t Convert(BytecodeArrayBuilder* builder,
                                 RegisterList reg_list)) {
    DCHECK_EQ(2, reg_list.register_count());
    return builder->GetOutputRegisterListOperand(reg_list);
  }
};

template <>
class OperandHelper<OperandType::kRegOutTriple> {
 public:
  INLINE(static uint32_t Convert(BytecodeArrayBuilder* builder,
                                 RegisterList reg_list)) {
    DCHECK_EQ(3, reg_list.register_count());
    return builder->GetOutputRegisterListOperand(reg_list);
  }
};

}  // namespace

template <OperandType... operand_types>
class BytecodeNodeBuilder {
 public:
  template <typename... Operands>
  INLINE(static BytecodeNode Make(BytecodeArrayBuilder* builder,
                                  BytecodeSourceInfo source_info,
                                  Bytecode bytecode, Operands... operands)) {
    builder->PrepareToOutputBytecode(bytecode);
    // The "OperandHelper<operand_types>::Convert(builder, operands)..." will
    // expand both the OperandType... and Operands... parameter packs e.g. for:
    //   BytecodeNodeBuilder<OperandType::kReg, OperandType::kImm>::Make<
    //       Register, int>(..., Register reg, int immediate)
    // the code will expand into:
    //    OperandHelper<OperandType::kReg>::Convert(builder, reg),
    //    OperandHelper<OperandType::kImm>::Convert(builder, immediate),
    return BytecodeNode(
        bytecode, OperandHelper<operand_types>::Convert(builder, operands)...,
        source_info);
  }
};

#define DEFINE_BYTECODE_OUTPUT(name, accumulator_use, ...)                 \
  template <typename... Operands>                                          \
  void BytecodeArrayBuilder::Output##name(Operands... operands) {          \
    static_assert(sizeof...(Operands) <= Bytecodes::kMaxOperands,          \
                  "too many operands for bytecode");                       \
    BytecodeNode node(BytecodeNodeBuilder<__VA_ARGS__>::Make<Operands...>( \
        this, CurrentSourcePosition(Bytecode::k##name), Bytecode::k##name, \
        operands...));                                                     \
    pipeline()->Write(&node);                                              \
  }                                                                        \
                                                                           \
  template <typename... Operands>                                          \
  void BytecodeArrayBuilder::Output##name(BytecodeLabel* label,            \
                                          Operands... operands) {          \
    DCHECK(Bytecodes::IsJump(Bytecode::k##name));                          \
    BytecodeNode node(BytecodeNodeBuilder<__VA_ARGS__>::Make<Operands...>( \
        this, CurrentSourcePosition(Bytecode::k##name), Bytecode::k##name, \
        operands...));                                                     \
    pipeline()->WriteJump(&node, label);                                   \
    LeaveBasicBlock();                                                     \
  }
BYTECODE_LIST(DEFINE_BYTECODE_OUTPUT)
#undef DEFINE_BYTECODE_OUTPUT

BytecodeArrayBuilder& BytecodeArrayBuilder::BinaryOperation(Token::Value op,
                                                            Register reg,
                                                            int feedback_slot) {
  switch (op) {
    case Token::Value::ADD:
      OutputAdd(reg, feedback_slot);
      break;
    case Token::Value::SUB:
      OutputSub(reg, feedback_slot);
      break;
    case Token::Value::MUL:
      OutputMul(reg, feedback_slot);
      break;
    case Token::Value::DIV:
      OutputDiv(reg, feedback_slot);
      break;
    case Token::Value::MOD:
      OutputMod(reg, feedback_slot);
      break;
    case Token::Value::BIT_OR:
      OutputBitwiseOr(reg, feedback_slot);
      break;
    case Token::Value::BIT_XOR:
      OutputBitwiseXor(reg, feedback_slot);
      break;
    case Token::Value::BIT_AND:
      OutputBitwiseAnd(reg, feedback_slot);
      break;
    case Token::Value::SHL:
      OutputShiftLeft(reg, feedback_slot);
      break;
    case Token::Value::SAR:
      OutputShiftRight(reg, feedback_slot);
      break;
    case Token::Value::SHR:
      OutputShiftRightLogical(reg, feedback_slot);
      break;
    default:
      UNREACHABLE();
  }
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::CountOperation(Token::Value op,
                                                           int feedback_slot) {
  if (op == Token::Value::ADD) {
    OutputInc(feedback_slot);
  } else {
    DCHECK_EQ(op, Token::Value::SUB);
    OutputDec(feedback_slot);
  }
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::LogicalNot() {
  OutputToBooleanLogicalNot();
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::TypeOf() {
  OutputTypeOf();
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::CompareOperation(
    Token::Value op, Register reg, int feedback_slot) {
  switch (op) {
    case Token::Value::EQ:
      OutputTestEqual(reg, feedback_slot);
      break;
    case Token::Value::NE:
      OutputTestNotEqual(reg, feedback_slot);
      break;
    case Token::Value::EQ_STRICT:
      OutputTestEqualStrict(reg, feedback_slot);
      break;
    case Token::Value::LT:
      OutputTestLessThan(reg, feedback_slot);
      break;
    case Token::Value::GT:
      OutputTestGreaterThan(reg, feedback_slot);
      break;
    case Token::Value::LTE:
      OutputTestLessThanOrEqual(reg, feedback_slot);
      break;
    case Token::Value::GTE:
      OutputTestGreaterThanOrEqual(reg, feedback_slot);
      break;
    case Token::Value::INSTANCEOF:
      OutputTestInstanceOf(reg);
      break;
    case Token::Value::IN:
      OutputTestIn(reg);
      break;
    default:
      UNREACHABLE();
  }
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::LoadConstantPoolEntry(
    size_t entry) {
  OutputLdaConstant(entry);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::LoadLiteral(
    v8::internal::Smi* smi) {
  int32_t raw_smi = smi->value();
  if (raw_smi == 0) {
    OutputLdaZero();
  } else {
    OutputLdaSmi(raw_smi);
  }
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::LoadLiteral(Handle<Object> object) {
  size_t entry = GetConstantPoolEntry(object);
  OutputLdaConstant(entry);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::LoadUndefined() {
  OutputLdaUndefined();
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::LoadNull() {
  OutputLdaNull();
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::LoadTheHole() {
  OutputLdaTheHole();
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::LoadTrue() {
  OutputLdaTrue();
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::LoadFalse() {
  OutputLdaFalse();
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::LoadAccumulatorWithRegister(
    Register reg) {
  if (register_optimizer_) {
    register_optimizer_->DoLdar(reg, CurrentSourcePosition(Bytecode::kLdar));
  } else {
    OutputLdar(reg);
  }
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::StoreAccumulatorInRegister(
    Register reg) {
  if (register_optimizer_) {
    register_optimizer_->DoStar(reg, CurrentSourcePosition(Bytecode::kStar));
  } else {
    OutputStar(reg);
  }
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::MoveRegister(Register from,
                                                         Register to) {
  DCHECK(from != to);
  if (register_optimizer_) {
    register_optimizer_->DoMov(from, to, CurrentSourcePosition(Bytecode::kMov));
  } else {
    OutputMov(from, to);
  }
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::LoadGlobal(
    const Handle<String> name, int feedback_slot, TypeofMode typeof_mode) {
  size_t name_index = GetConstantPoolEntry(name);
  if (typeof_mode == INSIDE_TYPEOF) {
    OutputLdaGlobalInsideTypeof(name_index, feedback_slot);
  } else {
    DCHECK_EQ(typeof_mode, NOT_INSIDE_TYPEOF);
    OutputLdaGlobal(name_index, feedback_slot);
  }
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::StoreGlobal(
    const Handle<String> name, int feedback_slot, LanguageMode language_mode) {
  size_t name_index = GetConstantPoolEntry(name);
  if (language_mode == SLOPPY) {
    OutputStaGlobalSloppy(name_index, feedback_slot);
  } else {
    DCHECK_EQ(language_mode, STRICT);
    OutputStaGlobalStrict(name_index, feedback_slot);
  }
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::LoadContextSlot(Register context,
                                                            int slot_index,
                                                            int depth) {
  if (context.is_current_context() && depth == 0) {
    OutputLdaCurrentContextSlot(slot_index);
  } else {
    OutputLdaContextSlot(context, slot_index, depth);
  }
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::StoreContextSlot(Register context,
                                                             int slot_index,
                                                             int depth) {
  if (context.is_current_context() && depth == 0) {
    OutputStaCurrentContextSlot(slot_index);
  } else {
    OutputStaContextSlot(context, slot_index, depth);
  }
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::LoadLookupSlot(
    const Handle<String> name, TypeofMode typeof_mode) {
  size_t name_index = GetConstantPoolEntry(name);
  if (typeof_mode == INSIDE_TYPEOF) {
    OutputLdaLookupSlotInsideTypeof(name_index);
  } else {
    DCHECK_EQ(typeof_mode, NOT_INSIDE_TYPEOF);
    OutputLdaLookupSlot(name_index);
  }
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::LoadLookupContextSlot(
    const Handle<String> name, TypeofMode typeof_mode, int slot_index,
    int depth) {
  size_t name_index = GetConstantPoolEntry(name);
  if (typeof_mode == INSIDE_TYPEOF) {
    OutputLdaLookupContextSlotInsideTypeof(name_index, slot_index, depth);
  } else {
    DCHECK(typeof_mode == NOT_INSIDE_TYPEOF);
    OutputLdaLookupContextSlot(name_index, slot_index, depth);
  }
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::LoadLookupGlobalSlot(
    const Handle<String> name, TypeofMode typeof_mode, int feedback_slot,
    int depth) {
  size_t name_index = GetConstantPoolEntry(name);
  if (typeof_mode == INSIDE_TYPEOF) {
    OutputLdaLookupGlobalSlotInsideTypeof(name_index, feedback_slot, depth);
  } else {
    DCHECK(typeof_mode == NOT_INSIDE_TYPEOF);
    OutputLdaLookupGlobalSlot(name_index, feedback_slot, depth);
  }
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::StoreLookupSlot(
    const Handle<String> name, LanguageMode language_mode) {
  size_t name_index = GetConstantPoolEntry(name);
  if (language_mode == SLOPPY) {
    OutputStaLookupSlotSloppy(name_index);
  } else {
    DCHECK_EQ(language_mode, STRICT);
    OutputStaLookupSlotStrict(name_index);
  }
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::LoadNamedProperty(
    Register object, const Handle<Name> name, int feedback_slot) {
  size_t name_index = GetConstantPoolEntry(name);
  OutputLdaNamedProperty(object, name_index, feedback_slot);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::LoadKeyedProperty(
    Register object, int feedback_slot) {
  OutputLdaKeyedProperty(object, feedback_slot);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::StoreDataPropertyInLiteral(
    Register object, Register name, Register value, Register attrs) {
  OutputStaDataPropertyInLiteral(object, name, value, attrs);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::StoreNamedProperty(
    Register object, const Handle<Name> name, int feedback_slot,
    LanguageMode language_mode) {
  size_t name_index = GetConstantPoolEntry(name);
  if (language_mode == SLOPPY) {
    OutputStaNamedPropertySloppy(object, name_index, feedback_slot);
  } else {
    DCHECK_EQ(language_mode, STRICT);
    OutputStaNamedPropertyStrict(object, name_index, feedback_slot);
  }
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::StoreKeyedProperty(
    Register object, Register key, int feedback_slot,
    LanguageMode language_mode) {
  if (language_mode == SLOPPY) {
    OutputStaKeyedPropertySloppy(object, key, feedback_slot);
  } else {
    DCHECK_EQ(language_mode, STRICT);
    OutputStaKeyedPropertyStrict(object, key, feedback_slot);
  }
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::CreateClosure(size_t entry,
                                                          int flags) {
  OutputCreateClosure(entry, flags);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::CreateBlockContext(
    Handle<ScopeInfo> scope_info) {
  size_t entry = GetConstantPoolEntry(scope_info);
  OutputCreateBlockContext(entry);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::CreateCatchContext(
    Register exception, Handle<String> name, Handle<ScopeInfo> scope_info) {
  size_t name_index = GetConstantPoolEntry(name);
  size_t scope_info_index = GetConstantPoolEntry(scope_info);
  OutputCreateCatchContext(exception, name_index, scope_info_index);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::CreateFunctionContext(int slots) {
  OutputCreateFunctionContext(slots);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::CreateWithContext(
    Register object, Handle<ScopeInfo> scope_info) {
  size_t scope_info_index = GetConstantPoolEntry(scope_info);
  OutputCreateWithContext(object, scope_info_index);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::CreateArguments(
    CreateArgumentsType type) {
  switch (type) {
    case CreateArgumentsType::kMappedArguments:
      OutputCreateMappedArguments();
      break;
    case CreateArgumentsType::kUnmappedArguments:
      OutputCreateUnmappedArguments();
      break;
    case CreateArgumentsType::kRestParameter:
      OutputCreateRestParameter();
      break;
    default:
      UNREACHABLE();
  }
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::CreateRegExpLiteral(
    Handle<String> pattern, int literal_index, int flags) {
  size_t pattern_entry = GetConstantPoolEntry(pattern);
  OutputCreateRegExpLiteral(pattern_entry, literal_index, flags);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::CreateArrayLiteral(
    Handle<FixedArray> constant_elements, int literal_index, int flags) {
  size_t constant_elements_entry = GetConstantPoolEntry(constant_elements);
  OutputCreateArrayLiteral(constant_elements_entry, literal_index, flags);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::CreateObjectLiteral(
    Handle<FixedArray> constant_properties, int literal_index, int flags,
    Register output) {
  size_t constant_properties_entry = GetConstantPoolEntry(constant_properties);
  OutputCreateObjectLiteral(constant_properties_entry, literal_index, flags,
                            output);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::PushContext(Register context) {
  OutputPushContext(context);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::PopContext(Register context) {
  OutputPopContext(context);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::ConvertAccumulatorToObject(
    Register out) {
  OutputToObject(out);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::ConvertAccumulatorToName(
    Register out) {
  OutputToName(out);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::ConvertAccumulatorToNumber(
    Register out) {
  OutputToNumber(out);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::Bind(BytecodeLabel* label) {
  // Flush the register optimizer when binding a label to ensure all
  // expected registers are valid when jumping to this label.
  if (register_optimizer_) register_optimizer_->Flush();
  pipeline_->BindLabel(label);
  LeaveBasicBlock();
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::Bind(const BytecodeLabel& target,
                                                 BytecodeLabel* label) {
  pipeline_->BindLabel(target, label);
  LeaveBasicBlock();
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::Jump(BytecodeLabel* label) {
  OutputJump(label, 0);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfTrue(BytecodeLabel* label) {
  // The peephole optimizer attempts to simplify JumpIfToBooleanTrue
  // to JumpIfTrue.
  OutputJumpIfToBooleanTrue(label, 0);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfFalse(BytecodeLabel* label) {
  OutputJumpIfToBooleanFalse(label, 0);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfNull(BytecodeLabel* label) {
  OutputJumpIfNull(label, 0);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfUndefined(
    BytecodeLabel* label) {
  OutputJumpIfUndefined(label, 0);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfNotHole(
    BytecodeLabel* label) {
  OutputJumpIfNotHole(label, 0);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfJSReceiver(
    BytecodeLabel* label) {
  OutputJumpIfJSReceiver(label, 0);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::JumpLoop(BytecodeLabel* label,
                                                     int loop_depth) {
  OutputJumpLoop(label, 0, loop_depth);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::StackCheck(int position) {
  if (position != kNoSourcePosition) {
    // We need to attach a non-breakable source position to a stack
    // check, so we simply add it as expression position. There can be
    // a prior statement position from constructs like:
    //
    //    do var x;  while (false);
    //
    // A Nop could be inserted for empty statements, but since no code
    // is associated with these positions, instead we force the stack
    // check's expression position which eliminates the empty
    // statement's position.
    latest_source_info_.ForceExpressionPosition(position);
  }
  OutputStackCheck();
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::SetPendingMessage() {
  OutputSetPendingMessage();
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::Throw() {
  OutputThrow();
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::ReThrow() {
  OutputReThrow();
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::Return() {
  SetReturnPosition();
  OutputReturn();
  return_seen_in_block_ = true;
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::Debugger() {
  OutputDebugger();
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::ForInPrepare(
    Register receiver, RegisterList cache_info_triple) {
  DCHECK_EQ(3, cache_info_triple.register_count());
  OutputForInPrepare(receiver, cache_info_triple);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::ForInContinue(
    Register index, Register cache_length) {
  OutputForInContinue(index, cache_length);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::ForInNext(
    Register receiver, Register index, RegisterList cache_type_array_pair,
    int feedback_slot) {
  DCHECK_EQ(2, cache_type_array_pair.register_count());
  OutputForInNext(receiver, index, cache_type_array_pair, feedback_slot);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::ForInStep(Register index) {
  OutputForInStep(index);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::StoreModuleVariable(int cell_index,
                                                                int depth) {
  OutputStaModuleVariable(cell_index, depth);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::LoadModuleVariable(int cell_index,
                                                               int depth) {
  OutputLdaModuleVariable(cell_index, depth);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::SuspendGenerator(
    Register generator) {
  OutputSuspendGenerator(generator);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::ResumeGenerator(
    Register generator) {
  OutputResumeGenerator(generator);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::MarkHandler(
    int handler_id, HandlerTable::CatchPrediction catch_prediction) {
  BytecodeLabel handler;
  Bind(&handler);
  handler_table_builder()->SetHandlerTarget(handler_id, handler.offset());
  handler_table_builder()->SetPrediction(handler_id, catch_prediction);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::MarkTryBegin(int handler_id,
                                                         Register context) {
  BytecodeLabel try_begin;
  Bind(&try_begin);
  handler_table_builder()->SetTryRegionStart(handler_id, try_begin.offset());
  handler_table_builder()->SetContextRegister(handler_id, context);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::MarkTryEnd(int handler_id) {
  BytecodeLabel try_end;
  Bind(&try_end);
  handler_table_builder()->SetTryRegionEnd(handler_id, try_end.offset());
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::Call(Register callable,
                                                 RegisterList args,
                                                 int feedback_slot,
                                                 Call::CallType call_type,
                                                 TailCallMode tail_call_mode) {
  if (tail_call_mode == TailCallMode::kDisallow) {
    if (call_type == Call::NAMED_PROPERTY_CALL ||
        call_type == Call::KEYED_PROPERTY_CALL) {
      OutputCallProperty(callable, args, args.register_count(), feedback_slot);
    } else {
      OutputCall(callable, args, args.register_count(), feedback_slot);
    }
  } else {
    DCHECK(tail_call_mode == TailCallMode::kAllow);
    OutputTailCall(callable, args, args.register_count(), feedback_slot);
  }
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::New(Register constructor,
                                                RegisterList args,
                                                int feedback_slot_id) {
  OutputNew(constructor, args, args.register_count(), feedback_slot_id);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntime(
    Runtime::FunctionId function_id, RegisterList args) {
  DCHECK_EQ(1, Runtime::FunctionForId(function_id)->result_size);
  DCHECK(Bytecodes::SizeForUnsignedOperand(function_id) <= OperandSize::kShort);
  if (IntrinsicsHelper::IsSupported(function_id)) {
    IntrinsicsHelper::IntrinsicId intrinsic_id =
        IntrinsicsHelper::FromRuntimeId(function_id);
    OutputInvokeIntrinsic(static_cast<int>(intrinsic_id), args,
                          args.register_count());
  } else {
    OutputCallRuntime(static_cast<int>(function_id), args,
                      args.register_count());
  }
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntime(
    Runtime::FunctionId function_id, Register arg) {
  return CallRuntime(function_id, RegisterList(arg.index(), 1));
}

BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntime(
    Runtime::FunctionId function_id) {
  return CallRuntime(function_id, RegisterList());
}

BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntimeForPair(
    Runtime::FunctionId function_id, RegisterList args,
    RegisterList return_pair) {
  DCHECK_EQ(2, Runtime::FunctionForId(function_id)->result_size);
  DCHECK(Bytecodes::SizeForUnsignedOperand(function_id) <= OperandSize::kShort);
  DCHECK_EQ(2, return_pair.register_count());
  OutputCallRuntimeForPair(static_cast<uint16_t>(function_id), args,
                           args.register_count(), return_pair);
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntimeForPair(
    Runtime::FunctionId function_id, Register arg, RegisterList return_pair) {
  return CallRuntimeForPair(function_id, RegisterList(arg.index(), 1),
                            return_pair);
}

BytecodeArrayBuilder& BytecodeArrayBuilder::CallJSRuntime(int context_index,
                                                          RegisterList args) {
  OutputCallJSRuntime(context_index, args, args.register_count());
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::NewWithSpread(RegisterList args) {
  OutputNewWithSpread(args, args.register_count());
  return *this;
}

BytecodeArrayBuilder& BytecodeArrayBuilder::Delete(Register object,
                                                   LanguageMode language_mode) {
  if (language_mode == SLOPPY) {
    OutputDeletePropertySloppy(object);
  } else {
    DCHECK_EQ(language_mode, STRICT);
    OutputDeletePropertyStrict(object);
  }
  return *this;
}

size_t BytecodeArrayBuilder::GetConstantPoolEntry(Handle<Object> object) {
  return constant_array_builder()->Insert(object);
}

size_t BytecodeArrayBuilder::AllocateConstantPoolEntry() {
  return constant_array_builder()->AllocateEntry();
}

void BytecodeArrayBuilder::InsertConstantPoolEntryAt(size_t entry,
                                                     Handle<Object> object) {
  constant_array_builder()->InsertAllocatedEntry(entry, object);
}

void BytecodeArrayBuilder::SetReturnPosition() {
  if (return_position_ == kNoSourcePosition) return;
  latest_source_info_.MakeStatementPosition(return_position_);
}

bool BytecodeArrayBuilder::RegisterIsValid(Register reg) const {
  if (!reg.is_valid()) {
    return false;
  }

  if (reg.is_current_context() || reg.is_function_closure() ||
      reg.is_new_target()) {
    return true;
  } else if (reg.is_parameter()) {
    int parameter_index = reg.ToParameterIndex(parameter_count());
    return parameter_index >= 0 && parameter_index < parameter_count();
  } else if (reg.index() < fixed_register_count()) {
    return true;
  } else {
    return register_allocator()->RegisterIsLive(reg);
  }
}

bool BytecodeArrayBuilder::RegisterListIsValid(RegisterList reg_list) const {
  if (reg_list.register_count() == 0) {
    return reg_list.first_register() == Register(0);
  } else {
    int first_reg_index = reg_list.first_register().index();
    for (int i = 0; i < reg_list.register_count(); i++) {
      if (!RegisterIsValid(Register(first_reg_index + i))) {
        return false;
      }
    }
    return true;
  }
}

void BytecodeArrayBuilder::PrepareToOutputBytecode(Bytecode bytecode) {
  if (register_optimizer_) register_optimizer_->PrepareForBytecode(bytecode);
}

uint32_t BytecodeArrayBuilder::GetInputRegisterOperand(Register reg) {
  DCHECK(RegisterIsValid(reg));
  if (register_optimizer_) reg = register_optimizer_->GetInputRegister(reg);
  return static_cast<uint32_t>(reg.ToOperand());
}

uint32_t BytecodeArrayBuilder::GetOutputRegisterOperand(Register reg) {
  DCHECK(RegisterIsValid(reg));
  if (register_optimizer_) register_optimizer_->PrepareOutputRegister(reg);
  return static_cast<uint32_t>(reg.ToOperand());
}

uint32_t BytecodeArrayBuilder::GetInputRegisterListOperand(
    RegisterList reg_list) {
  DCHECK(RegisterListIsValid(reg_list));
  if (register_optimizer_)
    reg_list = register_optimizer_->GetInputRegisterList(reg_list);
  return static_cast<uint32_t>(reg_list.first_register().ToOperand());
}

uint32_t BytecodeArrayBuilder::GetOutputRegisterListOperand(
    RegisterList reg_list) {
  DCHECK(RegisterListIsValid(reg_list));
  if (register_optimizer_)
    register_optimizer_->PrepareOutputRegisterList(reg_list);
  return static_cast<uint32_t>(reg_list.first_register().ToOperand());
}

}  // namespace interpreter
}  // namespace internal
}  // namespace v8


text:
using System;
using System.IO;
using GroupDocs.Conversion.Options.Convert;

namespace GroupDocs.Conversion.Examples.CSharp.AdvancedUsage
{
    /// <summary>
    /// This example demonstrates how to convert range of pages
    /// </summary>
    internal static class ConvertNConsecutivePages
    {
        public static void Run()
        {
            string outputFolder = Constants.GetOutputDirectoryPath();
            string outputFile = Path.Combine(outputFolder, "converted.pdf");

            using (Converter converter = new Converter(Constants.SAMPLE_DOCX))
            {
                PdfConvertOptions options = new PdfConvertOptions
                {
                    PageNumber = 2,
                    PagesCount = 2
                };
                converter.Convert(outputFile, options);
            }

            Console.WriteLine("\nDocument converted successfully. \nCheck output in {0}", outputFolder);
        }
    }
}


text:
A Content-Addressable Storage layer for Go.

[![godoc](https://chronos-tachyon.net/img/godoc-badge.svg)](https://godoc.org/github.com/cloud9-tools/go-cas)
[![Build Status](https://travis-ci.org/cloud9-tools/go-cas.svg)](https://travis-ci.org/cloud9-tools/go-cas)
[![Coverage Status](https://coveralls.io/repos/cloud9-tools/go-cas/badge.svg)](https://coveralls.io/r/cloud9-tools/go-cas)

This is an *EARLY BETA*.  It mostly kinda works, but the unittests are still
fairly incomplete, there are no regression tests yet, there's no benchmarking,
there's no locality in the caching layer, and there's no Reed-Solomon.  All of
these are pretty much mandatory before I'd trust it with my own data, much
less yours.

Not familiar with the [CAS][wiki] paradigm?  The basic idea is "let's store
blobs, but instead of assigning sequential IDs or generating UUIDs, let's hash
the data to determine its primary key".  Lower-level objects contain raw data,
higher-level objects contain references to lower-level objects, and so on.
(This is the same paradigm that Git is built around.)  At the top of the
hierarchy, you need something that isn't the CAS to find the root of your data
tree, but that's just a small string that you could stick in a static file,
[etcd][etcd], [Apache ZooKeeper][zoo], or the like.

[wiki]: http://en.wikipedia.org/wiki/Content-addressable_storage "Content-addressable storage"
[zoo]: https://zookeeper.apache.org/
[etcd]: https://github.com/coreos/etcd


text:
#include "source/extensions/filters/http/aws_lambda/config.h"

#include "envoy/extensions/filters/http/aws_lambda/v3/aws_lambda.pb.validate.h"
#include "envoy/registry/registry.h"
#include "envoy/stats/scope.h"
#include "envoy/stats/stats_macros.h"

#include "source/common/common/fmt.h"
#include "source/extensions/common/aws/credentials_provider_impl.h"
#include "source/extensions/common/aws/signer_impl.h"
#include "source/extensions/common/aws/utility.h"
#include "source/extensions/filters/http/aws_lambda/aws_lambda_filter.h"

namespace Envoy {
namespace Extensions {
namespace HttpFilters {
namespace AwsLambdaFilter {
constexpr auto service_name = "lambda";
namespace {

InvocationMode
getInvocationMode(const envoy::extensions::filters::http::aws_lambda::v3::Config& proto_config) {
  using namespace envoy::extensions::filters::http::aws_lambda::v3;
  switch (proto_config.invocation_mode()) {
    PANIC_ON_PROTO_ENUM_SENTINEL_VALUES;
  case Config_InvocationMode_ASYNCHRONOUS:
    return InvocationMode::Asynchronous;
  case Config_InvocationMode_SYNCHRONOUS:
    return InvocationMode::Synchronous;
  }
  PANIC_DUE_TO_CORRUPT_ENUM;
}

} // namespace

Http::FilterFactoryCb AwsLambdaFilterFactory::createFilterFactoryFromProtoTyped(
    const envoy::extensions::filters::http::aws_lambda::v3::Config& proto_config,
    const std::string& stat_prefix, Server::Configuration::FactoryContext& context) {

  const auto arn = parseArn(proto_config.arn());
  if (!arn) {
    throw EnvoyException(fmt::format("aws_lambda_filter: Invalid ARN: {}", proto_config.arn()));
  }
  const std::string region = arn->region();

  auto credentials_provider =
      std::make_shared<Extensions::Common::Aws::DefaultCredentialsProviderChain>(
          context.api(), Extensions::Common::Aws::Utility::fetchMetadata);

  auto signer = std::make_shared<Extensions::Common::Aws::SignerImpl>(
      service_name, region, std::move(credentials_provider),
      context.mainThreadDispatcher().timeSource(),
      // TODO: extend API to allow specifying header exclusion. ref:
      // https://github.com/envoyproxy/envoy/pull/18998
      Extensions::Common::Aws::AwsSigV4HeaderExclusionVector{});

  FilterSettings filter_settings{*arn, getInvocationMode(proto_config),
                                 proto_config.payload_passthrough()};

  FilterStats stats = generateStats(stat_prefix, context.scope());
  return [stats, signer, filter_settings](Http::FilterChainFactoryCallbacks& cb) {
    auto filter = std::make_shared<Filter>(filter_settings, stats, signer);
    cb.addStreamFilter(filter);
  };
}

Router::RouteSpecificFilterConfigConstSharedPtr
AwsLambdaFilterFactory::createRouteSpecificFilterConfigTyped(
    const envoy::extensions::filters::http::aws_lambda::v3::PerRouteConfig& proto_config,
    Server::Configuration::ServerFactoryContext&, ProtobufMessage::ValidationVisitor&) {

  const auto arn = parseArn(proto_config.invoke_config().arn());
  if (!arn) {
    throw EnvoyException(
        fmt::format("aws_lambda_filter: Invalid ARN: {}", proto_config.invoke_config().arn()));
  }
  return std::make_shared<const FilterSettings>(
      FilterSettings{*arn, getInvocationMode(proto_config.invoke_config()),
                     proto_config.invoke_config().payload_passthrough()});
}

/*
 * Static registration for the AWS Lambda filter. @see RegisterFactory.
 */
REGISTER_FACTORY(AwsLambdaFilterFactory, Server::Configuration::NamedHttpFilterConfigFactory);

} // namespace AwsLambdaFilter
} // namespace HttpFilters
} // namespace Extensions
} // namespace Envoy


text:
<?php
return array(
    'core_layout' => array(
        'admin' => array(
            'layout' => 'layout/admin4',
            'modules' => array(
                'playgrounduser' => array(
                    'controllers' => array(
                        \PlaygroundUser\Controller\Admin\LoginController::class => array(
                            'layout' => 'layout/adminlogin',
                        ),
                    ),
                ),
            ),
        ),
    ),
);


text:
package org.dbflute.erflute.preference.jdbc;

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

import org.dbflute.erflute.Activator;
import org.dbflute.erflute.core.DesignResources;
import org.dbflute.erflute.core.DisplayMessages;
import org.dbflute.erflute.core.util.Format;
import org.dbflute.erflute.db.DBManager;
import org.dbflute.erflute.db.DBManagerFactory;
import org.dbflute.erflute.editor.model.settings.JDBCDriverSetting;
import org.dbflute.erflute.preference.PreferenceInitializer;
import org.eclipse.draw2d.ColorConstants;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.PlatformUI;

/**
 * @author modified by jflute (originated in ermaster)
 */
public class JDBCPreferencePage extends org.eclipse.jface.preference.PreferencePage implements IWorkbenchPreferencePage {

    private Table table;
    private Button addButton;
    private Button editButton;
    private Button deleteButton;

    @Override
    public void init(IWorkbench workbench) {
    }

    @Override
    protected Control createContents(Composite parent) {
        final Composite composite = new Composite(parent, SWT.NONE);

        final GridLayout gridLayout = new GridLayout();
        gridLayout.numColumns = 3;

        composite.setLayout(gridLayout);

        initTable(composite);
        createButton(composite);
        addListener();

        return composite;
    }

    private void initTable(Composite parent) {
        this.table = new Table(parent, SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION);

        final GridData gridData = new GridData();
        gridData.horizontalAlignment = GridData.FILL;
        gridData.grabExcessHorizontalSpace = true;
        gridData.heightHint = 200;
        gridData.horizontalSpan = 3;

        table.setLayoutData(gridData);
        table.setLinesVisible(true);
        table.setHeaderVisible(true);

        final TableColumn nameColumn = new TableColumn(table, SWT.NONE);
        nameColumn.setText(DisplayMessages.getMessage("label.database"));
        nameColumn.setWidth(200);

        final TableColumn driverClassNameColumn = new TableColumn(table, SWT.NONE);
        driverClassNameColumn.setText(DisplayMessages.getMessage("label.driver.class.name"));
        driverClassNameColumn.setWidth(200);

        final TableColumn pathColumn = new TableColumn(table, SWT.NONE);
        pathColumn.setText(DisplayMessages.getMessage("label.path"));
        pathColumn.setWidth(200);

        setData();
    }

    private void createButton(Composite parent) {
        final GridData buttonGridData = new GridData();
        buttonGridData.widthHint = DesignResources.BUTTON_WIDTH;

        this.addButton = new Button(parent, SWT.NONE);
        addButton.setLayoutData(buttonGridData);
        addButton.setText(DisplayMessages.getMessage("label.button.add"));

        this.editButton = new Button(parent, SWT.NONE);
        editButton.setLayoutData(buttonGridData);
        editButton.setText(DisplayMessages.getMessage("label.button.edit"));

        this.deleteButton = new Button(parent, SWT.NONE);
        deleteButton.setLayoutData(buttonGridData);
        deleteButton.setText(DisplayMessages.getMessage("label.button.delete"));
        deleteButton.setEnabled(false);
    }

    private void setData() {
        table.removeAll();
        for (final JDBCDriverSetting setting : PreferenceInitializer.getJDBCDriverSettingList()) {
            final TableItem tableItem = new TableItem(table, SWT.NONE);
            tableItem.setBackground(ColorConstants.white);
            tableItem.setText(0, Format.null2blank(setting.getDb()));
            tableItem.setText(1, Format.null2blank(setting.getClassName()));
            tableItem.setText(2, Format.null2blank(setting.getPath()));
        }
    }

    @Override
    protected void performDefaults() {
        PreferenceInitializer.clearJDBCDriverInfo();
        setData();
        super.performDefaults();
    }

    @Override
    public boolean performOk() {
        PreferenceInitializer.clearJDBCDriverInfo();
        for (int i = 0; i < table.getItemCount(); i++) {
            final TableItem tableItem = table.getItem(i);
            final String db = tableItem.getText(0);
            final String driverClassName = tableItem.getText(1);
            final String path = tableItem.getText(2);
            PreferenceInitializer.addJDBCDriver(db, driverClassName, path);
        }
        return super.performOk();
    }

    private void addListener() {
        table.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent selectionevent) {
                final int index = table.getSelectionIndex();
                if (index == -1) {
                    return;
                }
                final TableItem item = table.getItem(index);
                final String db = item.getText(0);
                final String driverClassName = item.getText(1);
                final DBManager dbManager = DBManagerFactory.getDBManager(db);

                if (!dbManager.getDriverClassName().equals(driverClassName)) {
                    deleteButton.setEnabled(true);
                } else {
                    deleteButton.setEnabled(false);
                }
            }
        });

        table.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseDoubleClick(MouseEvent e) {
                edit();
            }
        });

        addButton.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
                final List<JDBCDriverSetting> otherDriverSettingList = getOtherDriverSettingList(-1);
                final JDBCPathDialog dialog =
                        new JDBCPathDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), null, null, null,
                                otherDriverSettingList, true);
                if (dialog.open() == IDialogConstants.OK_ID) {
                    PreferenceInitializer.addJDBCDriver(dialog.getDatabase(), Format.null2blank(dialog.getDriverClassName()),
                            Format.null2blank(dialog.getPath()));
                    setData();
                }
            }
        });

        editButton.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
                edit();
            }
        });

        deleteButton.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent event) {
                try {
                    final int index = table.getSelectionIndex();
                    if (index == -1) {
                        return;
                    }
                    final TableItem item = table.getItem(index);
                    final String db = item.getText(0);
                    final String driverClassName = item.getText(1);
                    final DBManager dbManager = DBManagerFactory.getDBManager(db);
                    if (!dbManager.getDriverClassName().equals(driverClassName)) {
                        table.remove(index);
                    }
                } catch (final Exception e) {
                    Activator.showExceptionDialog(e);
                }
            }
        });
    }

    private List<JDBCDriverSetting> getOtherDriverSettingList(int index) {
        final List<JDBCDriverSetting> list = new ArrayList<>();
        for (int i = 0; i < table.getItemCount(); i++) {
            if (i != index) {
                final TableItem tableItem = table.getItem(i);
                final String db = tableItem.getText(0);
                final String driverClassName = tableItem.getText(1);
                final String path = tableItem.getText(2);
                final JDBCDriverSetting driverSetting = new JDBCDriverSetting(db, driverClassName, path);
                list.add(driverSetting);
            }
        }
        return list;
    }

    private void edit() {
        try {
            final int index = table.getSelectionIndex();
            if (index == -1) {
                return;
            }
            final TableItem item = table.getItem(index);
            final List<JDBCDriverSetting> otherDriverSettingList = getOtherDriverSettingList(index);
            final JDBCPathDialog dialog =
                    new JDBCPathDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), item.getText(0), item.getText(1),
                            item.getText(2), otherDriverSettingList, true);
            if (dialog.open() == IDialogConstants.OK_ID) {
                item.setText(1, dialog.getDriverClassName());
                item.setText(2, dialog.getPath());
            }
        } catch (final Exception e) {
            Activator.showExceptionDialog(e);
        }
    }
}