text:
import inspect
import unittest
import os
import sys

sys.path.insert(0, '..')

from lib import MIFparser

currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))

class TestMifToDict(unittest.TestCase):
    def test_simple(self):
        data = MIFparser.to_dict(currentdir + '/mockups/mif/test.mif')
        self.assertEqual(data, [{
            'WKT': 'POLYGON ((-805746.744932638 -5717724.87367326,-836150.816258327 '
                   '-5650307.1502989,-744938.602281261 '
                   '-5576940.80427387,-635880.520352161 '
                   '-5627173.61776849,-703298.243726514 '
                   '-5732926.9093361,-805746.744932638 -5717724.87367326))',
            "id": 1,
            "test_text": "this is a test"
        }])

    # TODO: unit test for handling segmentation faults
    '''
    # The code below will generate the segfault but I have no way of handling it
    def test_segfault_mif(self):
         with self.assertRaisesRegex(ValueError, 'opuerw'):
             MIFparser.to_dict(file_path=currentdir + '/mockups/mif/segfault.mif')
    '''

    def test_no_mif(self):
        with self.assertRaisesRegex(ValueError, 'Unable to read'):
            MIFparser.to_dict('non-existent.mif')

    def test_catch_NaN_error(self):
        with self.assertRaisesRegex(ValueError, 'Unable to extract'):
            MIFparser.to_dict(currentdir + '/mockups/mif/NaN.mif')

    def test_catch_other_error(self):
        with self.assertRaises(ValueError):
            # Platform-dependent implementations do not allow specifying a specific error message!
            # The main point is that the parser should catch the error, and not crash the program
            MIFparser.to_dict(currentdir + '/mockups/mif/error.mif')

def main():
    unittest.main()

if __name__ == '__main__':
    main()


text:
.search-game-list {
    margin-bottom: 10px;
    -webkit-box-shadow: 0 1px 1px 1px rgba(212, 212, 212, 0.6);
}

.panel {

}

.panel .hd {
    height: 44px;
    position: relative;
    padding: 0 0 0 16px;
    background: #fff url(../images/title-x.png) repeat-x 0 100%;
    -webkit-background-size: 2px 2px;
    background-size: 2px 2px;
}

.panel .hd .more {
    position: absolute;
    top: 12px;
    right: 14px;
}

.panel .hd .more a {
    color: #707070;
    font-size: 12px;
}

.panel .hd h2 {
    display: -webkit-box;
    height: 44px;
    -webkit-box-align: center;
    font-weight: normal;
    color: #303030;
    font-size: 16px;
}

.item-game {
    padding: 10px;
    overflow: hidden;
    background: #fff url(../images/border-x.png) repeat-x 0 100%;
    -webkit-background-size: 2px 2px;
    background-size: 2px 2px;
    display: -webkit-box;
}

.item-game:after {
    clear: both;
    display: block;
    visibility: hidden;
    height: 0;
    content: "";
}

.item-game .pic {
    -webkit-border-radius: 10px;
    width: 60px;
    height: 60px;
    position: relative;
    background-image: url(../images/default_pic.png);
    -webkit-background-size: 60px 60px;
    background-size: 60px 60px;
}

.item-game .pic img {
    -webkit-border-radius: 10px;
}

.item-game .con {
    -webkit-box-flex: 1;
    padding: 0 10px 0 6px;
}

.item-game .con-alone {
    padding-top: 19px;
}

.item-game .con .name {
    line-height: 20px;
    overflow: hidden;
    font-size: 14px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.item-game .name .text {
    font-size: 12px;
    color: #898989;
}

.item-game .info {
    font-size: 12px;
    line-height: 20px;
    color: #959595;
    height: 20px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-game .mix-info {
    max-height: 28px;
    color: #959595;
    overflow: hidden;
    line-height: 15px;
    font-size: 12px;
    margin-bottom: 10px;
    padding: 2px 0;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.start-system span {
    display: inline-block;
    background-image: url(../images/bg_detail.png);
    -webkit-background-size: 60px auto;
}

.start-system {
    display: inline-block;
    padding-right: 5px;
}

.start-system span,
.game-good .start-system span {
    width: 18px;
    height: 15px;
    background-position: -36px 0;
}

.start-system .good,
.game-good .start-system .good {
    background-position: 0 0;
}

.start-system .soso,
.game-good .start-system .soso {
    background-position: -18px 0;
}

.btn-primary-green {
    display: inline-block;
    width: 52px;
    height: 36px;
    font-size: 12px;
    text-align: center;
    line-height: 36px;
    border:1px solid #cecece;
    border-radius:5px;
    background: #6DC86D;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    color:white;
    font-size:14px;
}

.loading {position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: 1000; display: -webkit-box; -webkit-box-align: center; -webkit-box-pack: center; }
.loading .outer {
    display: block; -webkit-background-size: 64px auto; background-size: 64px auto;
    background-repeat: no-repeat; width: 64px; height: 64px;
    background: url(../images/loading.png) no-repeat; animation: spin 800ms infinite linear;
}

@keyframes spin {
    0%   { transform: rotate(360deg); }
    100% { transform: rotate(0deg); }
}

redpajama_set_name: RedPajamaGithub


text:
module SemanticRailsViewHelpers
  VERSION = "0.0.1"
end


text:
package plugins

import (
	"fmt"
	"os/exec"

	"github.com/cilium/cilium/api/v1/models"

	log "github.com/sirupsen/logrus"
	"github.com/vishvananda/netlink"
)

const (
	// hostInterfacePrefix is the Host interface prefix.
	hostInterfacePrefix = "lxc"
	// temporaryInterfacePrefix is the temporary interface prefix while setting up libNetwork interface.
	temporaryInterfacePrefix = "tmp"
)

// Endpoint2IfName returns the host interface name for the given endpointID.
func Endpoint2IfName(endpointID string) string {
	return hostInterfacePrefix + truncateString(endpointID, 5)
}

// Endpoint2TempIfName returns the temporary interface name for the given
// endpointID.
func Endpoint2TempIfName(endpointID string) string {
	return temporaryInterfacePrefix + truncateString(endpointID, 5)
}

func truncateString(epID string, maxLen uint) string {
	if maxLen <= uint(len(epID)) {
		return epID[:maxLen]
	}
	return epID
}

// SetupVeth sets up the net interface, the temporary interface and fills up some endpoint
// fields such as LXCMAC, NodeMac, IfIndex and IfName. Returns a pointer for the created
// veth, a pointer for the temporary link, the name of the temporary link and error if
// something fails.
func SetupVeth(id string, mtu int, ep *models.EndpointChangeRequest) (*netlink.Veth, *netlink.Link, string, error) {
	if id == "" {
		return nil, nil, "", fmt.Errorf("invalid: empty ID")
	}

	lxcIfName := Endpoint2IfName(id)
	tmpIfName := Endpoint2TempIfName(id)

	veth := &netlink.Veth{
		LinkAttrs: netlink.LinkAttrs{Name: lxcIfName},
		PeerName:  tmpIfName,
	}

	if err := netlink.LinkAdd(veth); err != nil {
		return nil, nil, "", fmt.Errorf("unable to create veth pair: %s", err)
	}
	var err error
	defer func() {
		if err != nil {
			if err = netlink.LinkDel(veth); err != nil {
				log.Warningf("failed to clean up veth %q: %s", veth.Name, err)
			}
		}
	}()

	log.Debugf("Created veth pair %s <-> %s", lxcIfName, veth.PeerName)

	// Disable reverse path filter on the host side veth peer to allow
	// container addresses to be used as source address when the linux
	// stack performs routing.
	args := []string{"-w", "net.ipv4.conf." + lxcIfName + ".rp_filter=0"}
	_, err = exec.Command("sysctl", args...).CombinedOutput()
	if err != nil {
		return nil, nil, "", fmt.Errorf("unable to disable rp_filter on %s: %s",
			lxcIfName, err)
	}

	peer, err := netlink.LinkByName(tmpIfName)
	if err != nil {
		return nil, nil, "", fmt.Errorf("unable to lookup veth peer just created: %s", err)
	}

	if err = netlink.LinkSetMTU(peer, mtu); err != nil {
		return nil, nil, "", fmt.Errorf("unable to set MTU to %q: %s", tmpIfName, err)
	}

	hostVeth, err := netlink.LinkByName(lxcIfName)
	if err != nil {
		return nil, nil, "", fmt.Errorf("unable to lookup veth just created: %s", err)
	}

	if err = netlink.LinkSetMTU(hostVeth, mtu); err != nil {
		return nil, nil, "", fmt.Errorf("unable to set MTU to %q: %s", lxcIfName, err)
	}

	if err = netlink.LinkSetUp(veth); err != nil {
		return nil, nil, "", fmt.Errorf("unable to bring up veth pair: %s", err)
	}

	ep.Mac = peer.Attrs().HardwareAddr.String()
	ep.HostMac = hostVeth.Attrs().HardwareAddr.String()
	ep.InterfaceIndex = int64(hostVeth.Attrs().Index)
	ep.InterfaceName = lxcIfName

	return veth, &peer, tmpIfName, nil
}


text:
This directory contains several scripts useful in the development process of
Knative Build.

- `boilerplate/add-boilerplate.sh` Adds license boilerplate to _txt_ or _go_
  files in a directory, recursively.
- `release.sh` Creates a new [release](release.md) of Knative Build.
- `update-codegen.sh` Updates auto-generated client libraries.
- `update-deps.sh` Updates Go dependencies.
- `verify-codegen.sh` Verifies that auto-generated client libraries are
  up-to-date.


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

<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title>Óñòàíîâêà » DLE » template/{âàø øàáëîí}/fullstory.tpl » KALIOSTRO.NET</title>
<link href="../../css/style.css" rel="stylesheet" type="text/css" />

			DLE + IPB3 v1.0.5

        	Óñòàíîâêà » DLE » template/{âàø øàáëîí}/fullstory.tpl

		1. Âñòàâêà ññûëêè îáñóæäåíèÿ â ïîëíóþ íîâîñòü

		Âñòàâèòü :

		<textarea cols="auto" rows="3" class="template_add" readonly="readonly">
{link_on_forum}
</textarea>

Copyright © 2009 - 2013 kaliostro . All rights reserved.


text:
<?php
class PropertyMagicConstantLine
{
    private $foo = __LINE__;
}


text:
/**
 * @fileoverview A fuzzer that runs eslint on randomly-generated code samples to detect bugs
 * @author Teddy Katz
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const assert = require("assert");
const eslump = require("eslump");
const espree = require("espree");
const SourceCodeFixer = require("../lib/linter/source-code-fixer");
const ruleConfigs = require("../lib/init/config-rule").createCoreRuleConfigs(true);
const sampleMinimizer = require("./code-sample-minimizer");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Gets a random item from an array
 * @param {any[]} array The array to sample
 * @returns {any} The random item
 */
function sample(array) {
    return array[Math.floor(Math.random() * array.length)];
}

//------------------------------------------------------------------------------
// Public API
//------------------------------------------------------------------------------

/**
 * Generates random JS code, runs ESLint on it, and returns a list of detected crashes or autofix bugs
 * @param {Object} options Config options for fuzzing
 * @param {number} options.count The number of fuzz iterations.
 * @param {Object} options.linter The linter object to test with.
 * @param {function(Object): string} [options.codeGenerator=eslump.generateRandomJS] A function to use to generate random
 * code. Accepts an object argument with a `sourceType` key, indicating the source type of the generated code. The object
 * might also be passed other keys.
 * @param {boolean} [options.checkAutofixes=true] `true` if the fuzzer should check for autofix bugs. The fuzzer runs
 * roughly 4 times slower with autofix checking enabled.
 * @param {function(number) : void} [options.progressCallback] A function that gets called once for each code sample, with the total number of errors found so far
 * @returns {Object[]} A list of problems found. Each problem has the following properties:
 * type (string): The type of problem. This is either "crash" (a rule crashes) or "autofix" (an autofix produces a syntax error)
 * text (string): The text that ESLint should be run on to reproduce the problem
 * config (object): The config object that should be used to reproduce the problem. The fuzzer will try to return a minimal
 *     config (that only has one rule enabled), but this isn't always possible.
 * error (*) The problem that occurred. For crashes, this will be the error stack. For autofix bugs, this will be
 *     the parsing error object that was thrown when parsing the autofixed code.
 */
function fuzz(options) {
    assert.strictEqual(typeof options, "object", "An options object must be provided");
    assert.strictEqual(typeof options.count, "number", "The number of iterations (options.count) must be provided");
    assert.strictEqual(typeof options.linter, "object", "An linter object (options.linter) must be provided");

    const linter = options.linter;
    const codeGenerator = options.codeGenerator || (genOptions => eslump.generateRandomJS(Object.assign({ comments: true, whitespace: true }, genOptions)));
    const checkAutofixes = options.checkAutofixes !== false;
    const progressCallback = options.progressCallback || (() => {});

    /**
     * Tries to isolate the smallest config that reproduces a problem
     * @param {string} text The source text to lint
     * @param {Object} config A config object that causes a crash or autofix error
     * @param {("crash"|"autofix")} problemType The type of problem that occurred
     * @returns {Object} A config object with only one rule enabled that produces the same crash or autofix error, if possible.
     * Otherwise, the same as `config`
     */
    function isolateBadConfig(text, config, problemType) {
        for (const ruleId of Object.keys(config.rules)) {
            const reducedConfig = Object.assign({}, config, { rules: { [ruleId]: config.rules[ruleId] } });
            let fixResult;

            try {
                fixResult = linter.verifyAndFix(text, reducedConfig, {});
            } catch {
                return reducedConfig;
            }

            if (fixResult.messages.length === 1 && fixResult.messages[0].fatal && problemType === "autofix") {
                return reducedConfig;
            }
        }
        return config;
    }

    /**
     * Runs multipass autofix one pass at a time to find the last good source text before a fatal error occurs
     * @param {string} originalText Syntactically valid source code that results in a syntax error or crash when autofixing with `config`
     * @param {Object} config The config to lint with
     * @returns {string} A possibly-modified version of originalText that results in the same syntax error or crash after only one pass
     */
    function isolateBadAutofixPass(originalText, config) {
        let previousText = originalText;
        let currentText = originalText;

        do {
            let messages;

            try {
                messages = linter.verify(currentText, config);
            } catch {
                return currentText;
            }

            if (messages.length === 1 && messages[0].fatal) {
                return previousText;
            }

            previousText = currentText;
            currentText = SourceCodeFixer.applyFixes(currentText, messages).output;
        } while (previousText !== currentText);

        return currentText;
    }

    const problems = [];

    /**
     * Creates a version of espree that always runs with the specified options
     * @param {ConfigData} config The config used
     * @returns {Parser} a parser
     */
    function getParser({ parserOptions }) {
        return sourceText => espree.parse(sourceText, {
            ...parserOptions,
            loc: true,
            range: true,
            raw: true,
            tokens: true,
            comment: true
        });
    }

    for (let i = 0; i < options.count; progressCallback(problems.length), i++) {
        const rules = {};

        for (const [id, configs] of Object.entries(ruleConfigs)) {
            rules[id] = sample(configs);
        }

        const sourceType = sample(["script", "module"]);
        const text = codeGenerator({ sourceType });
        const config = {
            rules,
            parserOptions: {
                sourceType,
                ecmaVersion: espree.latestEcmaVersion
            }
        };

        let autofixResult;

        try {
            if (checkAutofixes) {
                autofixResult = linter.verifyAndFix(text, config, {});
            } else {
                linter.verify(text, config);
            }
        } catch (err) {
            const lastGoodText = checkAutofixes ? isolateBadAutofixPass(text, config) : text;
            const smallConfig = isolateBadConfig(lastGoodText, config, "crash");
            const smallText = sampleMinimizer({
                sourceText: lastGoodText,
                parser: { parse: getParser(smallConfig) },
                predicate(reducedText) {
                    try {
                        linter.verify(reducedText, smallConfig);
                        return false;
                    } catch {
                        return true;
                    }
                }
            });

            problems.push({ type: "crash", text: smallText, config: smallConfig, error: err.stack });

            continue;
        }

        if (checkAutofixes && autofixResult.fixed && autofixResult.messages.length === 1 && autofixResult.messages[0].fatal) {
            const lastGoodText = isolateBadAutofixPass(text, config);
            const smallConfig = isolateBadConfig(lastGoodText, config, "autofix");
            const smallText = sampleMinimizer({
                sourceText: lastGoodText,
                parser: { parse: getParser(smallConfig) },
                predicate(reducedText) {
                    try {
                        const smallFixResult = linter.verifyAndFix(reducedText, smallConfig);

                        return smallFixResult.fixed && smallFixResult.messages.length === 1 && smallFixResult.messages[0].fatal;
                    } catch {
                        return false;
                    }
                }
            });

            problems.push({
                type: "autofix",
                text: smallText,
                config: smallConfig,
                error: autofixResult.messages[0]
            });
        }
    }

    return problems;
}

module.exports = fuzz;


text:
package gntagger_test

import (
	"github.com/gnames/gnfinder"
	. "github.com/gnames/gntagger"
	"github.com/gnames/gntagger/annotation"

	"path/filepath"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("Gntagger", func() {
	Describe("Text", func() {
		Describe("NewText", func() {
			It("creates new Text object", func() {
				t := NewText(dataLong, pathLong, "abcd")
				Expect(t.Path).To(Equal(filepath.Join("testdata",
					"seashells_book.txt_gntagger")))
			})
		})

		Describe("Process", func() {
			It("cleans, wraps a text, and adds it to Processed field", func() {
				t := NewText(dataLong, pathLong, "abcd")
				t.Process(40)
				Expect(len(t.Processed)).To(Equal(1112796))
			})
		})

		Describe("Names", func() {
			Describe("NewNames", func() {
				It("creates new Names object", func() {
					gnt := NewGnTagger()
					gnt.Bayes = true
					t := NewText(dataLong, pathLong, "abcd")
					t.Process(80)
					n := NewNames(t, gnt)
					Expect(n.Path).To(Equal(filepath.Join("testdata", "seashells_book.txt_gntagger", "names.json")))
					Expect(n.Data.Meta.TotalNames).To(BeNumerically(">", 4000))
				})
			})

			Describe("GetCurrentName", func() {
				It("Returns current name", func() {
					n := makeNames()
					cn := n.GetCurrentName()
					Expect(cn.Name).To(Equal("Phaeophleophleospora epicoccoides"))
				})
			})

			Describe("IsDoubtful", func() {
				It("determines if a name was soubtful", func() {
					gnt := NewGnTagger()
					ns := makeNames()
					n := ns.GetCurrentName()
					Expect(n.Odds).To(BeNumerically(">", gnt.OddsHigh))
					Expect(IsDoubtful(n, gnt)).To(BeFalse())
					n.Odds = 10.0
					Expect(n.Odds).To(BeNumerically("<", gnt.OddsHigh))
					Expect(IsDoubtful(n, gnt)).To(BeTrue())
					n.Odds = 0.0
					Expect(n.Odds).To(BeNumerically("<", gnt.OddsHigh))
					Expect(IsDoubtful(n, gnt)).To(BeFalse())
				})
			})

			Describe("UpdateAnnotations", func() {
				/* Test name data
				    n name                  odds   annot
				    0 Gastropoda            211.35
				    1 Amphineura           9327.30
				    2 Scaphopoda          10292.20
				    3 Pelecypoda          10292.20
				    4 Cephalopoda         12336.64
				    5 Octopus                37.21 Doubtful
				    6 Miiricea muricata  462914.03
				    7 Venus                  16.35 Doubtful
				    8 Venus                  16.35 Doubtful
				    9 Venus                  16.35 Doubtful
				   10 Mollusca              340.20
				   11 Gastropoda            211.00
				   When a name close to the edge changes to NotName or Accepted all
				   same names below also change. If a NotName or Accepted changes
				   to Accepted or NotName the same names below return to NotAssigned
				   or Doubtful (depending on what they had been before)
				*/
				It("updates Doubtful Venus to NotName all the way", func() {
					names := namesForAnnotations()
					ns := names.Data.Names
					gnt := NewGnTagger()
					Expect(gnt.OddsHigh).To(Equal(100.0))
					Expect(gnt.OddsLow).To(Equal(1.0))

					edge := 7
					for i, _ := range ns[0:edge] {
						v := &ns[i]
						v.Annotation = annotation.Accepted.String()
					}

					Expect(ns[8].Annotation).To(Equal(annotation.Doubtful.String()))
					Expect(ns[9].Annotation).To(Equal(annotation.Doubtful.String()))
					Expect(ns[10].Annotation).To(Equal(annotation.NotAssigned.String()))

					names.Data.Meta.CurrentName = 7
					names.UpdateAnnotations(annotation.NotName, edge, gnt)

					Expect(ns[8].Annotation).To(Equal(annotation.NotName.String()))
					Expect(ns[9].Annotation).To(Equal(annotation.NotName.String()))
					Expect(ns[10].Annotation).To(Equal(annotation.NotAssigned.String()))

					edge = 8
					names.Data.Meta.CurrentName = 8
					names.UpdateAnnotations(annotation.Accepted, edge, gnt)

					Expect(ns[8].Annotation).To(Equal(annotation.Accepted.String()))
					Expect(ns[9].Annotation).To(Equal(annotation.Doubtful.String()))
				})

				It("updates NotAssigned Gastropoda to Accepted all the way", func() {
					names := namesForAnnotations()
					ns := names.Data.Names
					gnt := NewGnTagger()

					Expect(ns[0].Annotation).To(Equal(annotation.NotAssigned.String()))
					Expect(ns[11].Annotation).To(Equal(annotation.NotAssigned.String()))

					edge := 0
					names.Data.Meta.CurrentName = 0
					names.UpdateAnnotations(annotation.Accepted, edge, gnt)

					Expect(ns[0].Annotation).To(Equal(annotation.Accepted.String()))
					Expect(ns[10].Annotation).To(Equal(annotation.NotAssigned.String()))
					Expect(ns[11].Annotation).To(Equal(annotation.Accepted.String()))

					names.UpdateAnnotations(annotation.NotName, edge, gnt)

					Expect(ns[0].Annotation).To(Equal(annotation.NotName.String()))
					Expect(ns[11].Annotation).To(Equal(annotation.NotAssigned.String()))
				})
			})
		})
	})
})

func makeNames() *Names {
	gnt := NewGnTagger()
	gnt.Bayes = true
	t := NewText(dataShort, pathShort, "abcd")
	t.Process(80)
	n := NewNames(t, gnt)
	return n
}

func namesForAnnotations() *Names {
	var o gnfinder.Output
	o.FromJSON(dataNamesAnnot)
	return &Names{Path: pathNamesAnnot, Data: o}
}


text:
In this project, you will implement a small translator that recognizes a subset of C declarations and prints out the equivalent English meaning. For example, given input

```C
int *a[];
```

your translator must emit:

```
a is a array of pointer to int
```

You must fill in [Tool.java](https://github.com/USF-CS345-starterkits/parrt-cdecl/blob/master/src/cs345/cdecl/Tool.java) and the parse tree visitor [EnglishGenerator.java](https://github.com/USF-CS345-starterkits/parrt-cdecl/blob/master/src/cs345/cdecl/EnglishGenerator.java) in the starter kit.

Before you panic, note that my solution to the translator itself has 9 lines of Java code that I had to write myself. ANTLR and Intellij wrote the rest.  My solution for `Tool.java` has just 10 lines I had to write manually.

## Discussion

Please study [How To Read C Declarations](http://blog.parr.us/2014/12/29/how-to-read-c-declarations/) carefully. The rules for understanding C declarations are actually quite simple.

To implement this translator, we'll use ANTLR to parse a subset of C declaration syntax and then build a parse tree visitor that computes an appropriate English subphrase for each parse subtree. I have provided the grammar for you in [CDecl.g4](https://github.com/USF-CS345-starterkits/parrt-cdecl/blob/master/grammars/cs345/cdecl/CDecl.g4). The critical rule is:

```
declarator
    :	declarator '[' ']'		# Array		// right operators have highest precedence
    |	declarator '(' ')'		# Func
    |	'*' declarator			# Pointer
    |	'(' declarator ')'		# Grouping
    |	ID						# Var
    ;
```

The parse trees resulting from this rule identify the various constructs and the order in which they should be applied. For example `*a[]` indicates we should apply the square bracket array operator first and then the pointer operator. We override that precedence with grouping parentheses if we want: `(*a)[]`.

I suggest using the ANTLR 4 plug-in for Intellij to get familiar with the grammar. Tell it to test starting with rule `declaration`.  The following parse tree corresponds to `*a[]`:

and this one corresponds to `(*a)[]`:

Notice how, in the first tree, the `[]` binds tighter to the `a`. In other words, it is closest to it in the tree with respect to tree node depth. The deepest operations are done first, followed by the second deepest, up the tree to the root. That is why the second parse tree means "pointer to an array", because `*` is the deepest operator.

To implement your translator, you will create a visitor with methods for each of the `declarator` rule alternatives as well as a few others. The tree structure affects the order in which these methods are called. In other words, the parser will drive your translator according to what it finds in the input.

Your individual visitor methods must augment and return the text computed for its child(ren). For example, in the visitor method that handles `*`, you just have to visit the `declarator` child and add string `pointer to` to its return value. See the ANTLR 4 reference for more on how the visitors work.

As an exercise to learn more about ANTLR's handling of operator precedence, try moving the array and function alternatives last in rule `declarator`. The same input will give you a different tree and results in an incorrect translation to English. For example, `int *a[]` would get the following incorrect parse tree.

In this case, it shows doing the pointer operator first rather than the array operator.

## Getting started

I have provided a [starter kit](https://github.com/USF-CS345-starterkits/parrt-cdecl) that you can pull into your repository. From the command line, clone your project repo and then pull in my starter kit:

```bash
$ git clone git@github.com:USF-CS345-S16/USERID-cdecl.git
$ cd USERID-cdecl/ # jump into dir containing YOUR empty repo
$ git pull git@github.com:USF-CS345-starterkits/parrt-cdecl.git master
```

You can get any updates to the starter kit by simply `git pull`ing again from `USF-CS345-starterkits/parrt-cdecl.git`.

## Building and testing

The build assumes Java 8.

I suggest that you use Intellij, which knows how to deal with maven (`mvn`) builds. You can run the unit tests with a simple click. It should work on UNIX (including Mac) and Windows.

From the command line, you can build and store a jar with all of your software as follows on UNIX:

```bash
$ mvn install
```

That stores the jar in the following location:

```
~/.m2/repository/edu/usfca/cs345/cdecl/1.0/cdecl-1.0.jar
```

The main program is executed as follows from the Mac commandline for my `parrt` user:

```bash
$ java -cp /Users/parrt/.m2/repository/edu/usfca/cs345/cdecl/1.0/cdecl-1.0.jar:$CLASSPATH \
  cs345.cdecl.Tool "int i;"
i is a int
$ java -cp /Users/parrt/.m2/repository/edu/usfca/cs345/cdecl/1.0/cdecl-1.0.jar:$CLASSPATH \
  cs345.cdecl.Tool "int *a[];"
a is a array of pointer to int
```

Or, using maven as follows:

```bash
$ mvn test
...
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running cs345.cdecl.TestCDecl
Tests run: 15, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.154 sec

Results :

Tests run: 15, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.914 s
[INFO] Finished at: 2016-01-05T09:12:26-08:00
[INFO] Final Memory: 23M/310M
[INFO] ------------------------------------------------------------------------
```

Every time you commit to your repository, your software will automatically be downloaded and tested on the Travis continuous integration server using maven. Here is what a successful result looks like:

Check out [https://travis-ci.com/USF-CS345-S16/USERID-cdecl](https://travis-ci.com/USF-CS345-S16/USERID-cdecl) where USERID is your github user id. Mine is parrt, for example. You will not be able to see the repositories of other students.

## Deliverables

You must fill in `Tool.java` and `EnglishGenerator.java` to get a working solution that passes all [15 unit tests](https://github.com/USF-CS345-starterkits/parrt-cdecl/blob/master/test/cs345/cdecl/TestCDecl.java).

## Submission

You must submit your project via github using your account and the repository I've created for you in organization [USF-CS345-S16](https://github.com/USF-CS345-S16).

You are required to show git commits to your repository that are consistent with developing the software for this project.


text:
//Unity
using UnityEngine;

//Game
using UI.Gameplay.Events;
using UI.Framework;

namespace UI.Gameplay.Widgets
{
    /// <summary>
    /// Gameplay widget with access to HUD for UI Observer events
    /// </summary>
    public class GameplayWidget : AbstractUI
    {
        private HUD hud;
        private HUD _HUD
        {
            get { return hud ?? (hud = GetComponentInParent<HUD>()); }
        }

        protected void TriggerHUDEvent(UIEvents.Type type,string message="")
        {
            _HUD.TriggerEvent(type,message);
        }

        protected void StartListenting(UIEvents.Type type,System.Action<string> listener)
        {
            _HUD.StartListening(type, listener);
        }
    }
}


text:
#pragma once
#include <aws/kinesis/Kinesis_EXPORTS.h>
#include <aws/kinesis/model/Consumer.h>
#include <utility>

namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;

namespace Utils
{
namespace Json
{
  class JsonValue;
} // namespace Json
} // namespace Utils
namespace Kinesis
{
namespace Model
{
  class AWS_KINESIS_API RegisterStreamConsumerResult
  {
  public:
    RegisterStreamConsumerResult();
    RegisterStreamConsumerResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
    RegisterStreamConsumerResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);

    /**
     *
An object that represents the details of the consumer you registered. When
     * you register a consumer, it gets an ARN that is generated by Kinesis Data
     * Streams.

     */
    inline const Consumer& GetConsumer() const{ return m_consumer; }

    /**
     *
An object that represents the details of the consumer you registered. When
     * you register a consumer, it gets an ARN that is generated by Kinesis Data
     * Streams.

     */
    inline void SetConsumer(const Consumer& value) { m_consumer = value; }

    /**
     *
An object that represents the details of the consumer you registered. When
     * you register a consumer, it gets an ARN that is generated by Kinesis Data
     * Streams.

     */
    inline void SetConsumer(Consumer&& value) { m_consumer = std::move(value); }

    /**
     *
An object that represents the details of the consumer you registered. When
     * you register a consumer, it gets an ARN that is generated by Kinesis Data
     * Streams.

     */
    inline RegisterStreamConsumerResult& WithConsumer(const Consumer& value) { SetConsumer(value); return *this;}

    /**
     *
An object that represents the details of the consumer you registered. When
     * you register a consumer, it gets an ARN that is generated by Kinesis Data
     * Streams.

     */
    inline RegisterStreamConsumerResult& WithConsumer(Consumer&& value) { SetConsumer(std::move(value)); return *this;}

  private:

    Consumer m_consumer;
  };

} // namespace Model
} // namespace Kinesis
} // namespace Aws


text:
layout: default-post
single: true
---

  {% include article.html %}
  {% include article-footer.html %}

  {% unless page.sharing == false %}
    {% include post/sharing.html %}
  {% endunless %}
  {% if site.disqus_short_name and page.comments == true %}

{% include post/disqus_thread.html %}

  {% endif %}


text:
package stack;

import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

import net.NetworkController;

import peersim.config.Configuration;
import peersim.core.Control;
import peersim.core.Network;
import peersim.core.Node;
import peersim.edsim.EDSimulator;
import stack.App;
import stack.Transport;
/**
 *
 */
import stat.Generator;

/**
 * @author guthemberg
 *
 */
public class Initializer implements Control {

    private static final String PAR_PROT = "application";
    private static final String PAR_NET = "network";
    private static final String PAR_LOG = "logfile";
    private static final String PAR_SERVER_SET_SIZE = "server_set_size";
    private static final String PAR_BWD = "bwd";
    private static final String PAR_TS = "ts";
    private static final String PAR_TRANSPORT = "transport";
    private static final String PAR_SEED = "seed";
    private static final String PAR_UPDATE_TIME = "update_time";
    private static final String PAR_PARALLEL = "parallel_degree";
    private static final String PAR_MONITORING_CALL_DELAY = "monitoring_call_delay";
    private static final String PAR_MIN = "min";
    private static final String PAR_MAX = "max";
    private static final String PAR_EXP = "exp";
    int parallel_degree;
    double exp;
    int application;
    int server_set_size;
    int network;
    int transport;
    long bwd;
    long ts;
    long seed;
    long update_time;
    long min;
    long max;
    long monitoring_call_delay;
    String logfile;
	/**
	 *
	 */
	public Initializer(String prefix) {
        this.application = Configuration.getPid(prefix + "." + PAR_PROT);
        this.network = Configuration.getPid(prefix + "." + PAR_NET);
        this.transport = Configuration.getPid(prefix + "." + PAR_TRANSPORT);
        this.logfile = Configuration.getString(prefix + "." + PAR_LOG);
        this.exp = Configuration.getDouble(prefix + "." + PAR_EXP);
        this.min = Configuration.getLong(prefix + "." + PAR_MIN);
        this.max = Configuration.getLong(prefix + "." + PAR_MAX);
        this.server_set_size= Configuration.getInt(prefix + "." + PAR_SERVER_SET_SIZE);
        this.bwd= Configuration.getLong(prefix + "." + PAR_BWD);
        this.ts= Configuration.getLong(prefix + "." + PAR_TS);
        this.seed= Configuration.getLong(prefix + "." + PAR_SEED);
        this.update_time= Configuration.getLong(prefix + "." + PAR_UPDATE_TIME);
        this.parallel_degree = Configuration.getInt(prefix + "." + PAR_PARALLEL);
        this.monitoring_call_delay= Configuration.getLong(prefix + "." + PAR_MONITORING_CALL_DELAY);
        this.log("ts,avg_bwd,msgs,sys_time,mem_usage,mean_size",false);
	}

//	private static void deletefile(String file){
//		File f1 = new File(file);
//		f1.delete();
//	}
	public void log(String str,boolean append){
		try {
			FileWriter outFile = new FileWriter(this.logfile,append);
			PrintWriter out = new PrintWriter(outFile);
			out.println(str);
			out.close();
		} catch (IOException e){
			e.printStackTrace();
		}
	}
	/* (non-Javadoc)
	 * @see peersim.core.Control#execute()
	 */
	@Override
	public boolean execute() {
		Generator.bootstrapt(this.min, this.max, this.exp);
		Node[] servers = new Node[this.server_set_size];
		for (int i = 0; i < this.server_set_size; i++) {
            servers[i] = Network.get(i);
		}
		for (int i = 0; i < Network.size(); i++) {
            Node node = Network.get(i);
            App app= (App) node.getProtocol(this.application);
            app.bootstrap(this.bwd, this.ts, this.transport,servers);
            Transport transp= (Transport) node.getProtocol(this.transport);
            transp.bootstrap(this.bwd, this.ts, this.application, this.transport,this.network,this.update_time, node);
            NetworkController network = (NetworkController) node.getProtocol(this.network);
            network.bootstrap(node.getID(), node, this.bwd,
            		this.seed,false,0L,
            		2L,3,
            		false, 0.8f);
        	network.addLocalAddress(node.getID(), network.getBroadcastDomain(0));
//            network.bootstrap(node.getID(), node, this.bwd,
//            		this.seed,false,0L,
//            		2,3,
//            		false, .8);
		}
		for (int i = servers.length; i < Network.size(); i++) {
            Node node = Network.get(i);
            App app= (App) node.getProtocol(this.application);
        	for (int j = 0; j < this.parallel_degree; j++) {
                app.fetchData(node);
        	}
		}
		//generate update message to node 0
		EDSimulator.add(this.update_time, Message.createUpdateMessage(), Network.get(0), this.transport);
		// TODO Auto-generated method stub
		return false;
	}

}


text:
#pragma once
#include <aws/sagemaker/SageMaker_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/core/utils/DateTime.h>
#include <aws/sagemaker/model/OnlineStoreConfig.h>
#include <aws/sagemaker/model/OfflineStoreConfig.h>
#include <aws/sagemaker/model/FeatureGroupStatus.h>
#include <aws/sagemaker/model/OfflineStoreStatus.h>
#include <aws/sagemaker/model/FeatureDefinition.h>
#include <aws/sagemaker/model/Tag.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace SageMaker
{
namespace Model
{

  /**
   *
Amazon SageMaker Feature Store stores features in a collection called Feature
   * Group. A Feature Group can be visualized as a table which has rows, with a
   * unique identifier for each row where each column in the table is a feature. In
   * principle, a Feature Group is composed of features and values per
   * features.

See Also:
   AWS
   * API Reference

   */
  class AWS_SAGEMAKER_API FeatureGroup
  {
  public:
    FeatureGroup();
    FeatureGroup(Aws::Utils::Json::JsonView jsonValue);
    FeatureGroup& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     *
The Amazon Resource Name (ARN) of a FeatureGroup.

     */
    inline const Aws::String& GetFeatureGroupArn() const{ return m_featureGroupArn; }

    /**
     *
The Amazon Resource Name (ARN) of a FeatureGroup.

     */
    inline bool FeatureGroupArnHasBeenSet() const { return m_featureGroupArnHasBeenSet; }

    /**
     *
The Amazon Resource Name (ARN) of a FeatureGroup.

     */
    inline void SetFeatureGroupArn(const Aws::String& value) { m_featureGroupArnHasBeenSet = true; m_featureGroupArn = value; }

    /**
     *
The Amazon Resource Name (ARN) of a FeatureGroup.

     */
    inline void SetFeatureGroupArn(Aws::String&& value) { m_featureGroupArnHasBeenSet = true; m_featureGroupArn = std::move(value); }

    /**
     *
The Amazon Resource Name (ARN) of a FeatureGroup.

     */
    inline void SetFeatureGroupArn(const char* value) { m_featureGroupArnHasBeenSet = true; m_featureGroupArn.assign(value); }

    /**
     *
The Amazon Resource Name (ARN) of a FeatureGroup.

     */
    inline FeatureGroup& WithFeatureGroupArn(const Aws::String& value) { SetFeatureGroupArn(value); return *this;}

    /**
     *
The Amazon Resource Name (ARN) of a FeatureGroup.

     */
    inline FeatureGroup& WithFeatureGroupArn(Aws::String&& value) { SetFeatureGroupArn(std::move(value)); return *this;}

    /**
     *
The Amazon Resource Name (ARN) of a FeatureGroup.

     */
    inline FeatureGroup& WithFeatureGroupArn(const char* value) { SetFeatureGroupArn(value); return *this;}

    /**
     *
The name of the FeatureGroup.

     */
    inline const Aws::String& GetFeatureGroupName() const{ return m_featureGroupName; }

    /**
     *
The name of the FeatureGroup.

     */
    inline bool FeatureGroupNameHasBeenSet() const { return m_featureGroupNameHasBeenSet; }

    /**
     *
The name of the FeatureGroup.

     */
    inline void SetFeatureGroupName(const Aws::String& value) { m_featureGroupNameHasBeenSet = true; m_featureGroupName = value; }

    /**
     *
The name of the FeatureGroup.

     */
    inline void SetFeatureGroupName(Aws::String&& value) { m_featureGroupNameHasBeenSet = true; m_featureGroupName = std::move(value); }

    /**
     *
The name of the FeatureGroup.

     */
    inline void SetFeatureGroupName(const char* value) { m_featureGroupNameHasBeenSet = true; m_featureGroupName.assign(value); }

    /**
     *
The name of the FeatureGroup.

     */
    inline FeatureGroup& WithFeatureGroupName(const Aws::String& value) { SetFeatureGroupName(value); return *this;}

    /**
     *
The name of the FeatureGroup.

     */
    inline FeatureGroup& WithFeatureGroupName(Aws::String&& value) { SetFeatureGroupName(std::move(value)); return *this;}

    /**
     *
The name of the FeatureGroup.

     */
    inline FeatureGroup& WithFeatureGroupName(const char* value) { SetFeatureGroupName(value); return *this;}

    /**
     *
The name of the Feature whose value uniquely identifies a
     * Record defined in the FeatureGroup
     * FeatureDefinitions.

     */
    inline const Aws::String& GetRecordIdentifierFeatureName() const{ return m_recordIdentifierFeatureName; }

    /**
     *
The name of the Feature whose value uniquely identifies a
     * Record defined in the FeatureGroup
     * FeatureDefinitions.

     */
    inline bool RecordIdentifierFeatureNameHasBeenSet() const { return m_recordIdentifierFeatureNameHasBeenSet; }

    /**
     *
The name of the Feature whose value uniquely identifies a
     * Record defined in the FeatureGroup
     * FeatureDefinitions.

     */
    inline void SetRecordIdentifierFeatureName(const Aws::String& value) { m_recordIdentifierFeatureNameHasBeenSet = true; m_recordIdentifierFeatureName = value; }

    /**
     *
The name of the Feature whose value uniquely identifies a
     * Record defined in the FeatureGroup
     * FeatureDefinitions.

     */
    inline void SetRecordIdentifierFeatureName(Aws::String&& value) { m_recordIdentifierFeatureNameHasBeenSet = true; m_recordIdentifierFeatureName = std::move(value); }

    /**
     *
The name of the Feature whose value uniquely identifies a
     * Record defined in the FeatureGroup
     * FeatureDefinitions.

     */
    inline void SetRecordIdentifierFeatureName(const char* value) { m_recordIdentifierFeatureNameHasBeenSet = true; m_recordIdentifierFeatureName.assign(value); }

    /**
     *
The name of the Feature whose value uniquely identifies a
     * Record defined in the FeatureGroup
     * FeatureDefinitions.

     */
    inline FeatureGroup& WithRecordIdentifierFeatureName(const Aws::String& value) { SetRecordIdentifierFeatureName(value); return *this;}

    /**
     *
The name of the Feature whose value uniquely identifies a
     * Record defined in the FeatureGroup
     * FeatureDefinitions.

     */
    inline FeatureGroup& WithRecordIdentifierFeatureName(Aws::String&& value) { SetRecordIdentifierFeatureName(std::move(value)); return *this;}

    /**
     *
The name of the Feature whose value uniquely identifies a
     * Record defined in the FeatureGroup
     * FeatureDefinitions.

     */
    inline FeatureGroup& WithRecordIdentifierFeatureName(const char* value) { SetRecordIdentifierFeatureName(value); return *this;}

    /**
     *
The name of the feature that stores the EventTime of a Record in
     * a FeatureGroup.

A EventTime is point in time
     * when a new event occurs that corresponds to the creation or update of a
     * Record in FeatureGroup. All Records in
     * the FeatureGroup must have a corresponding
     * EventTime.

     */
    inline const Aws::String& GetEventTimeFeatureName() const{ return m_eventTimeFeatureName; }

    /**
     *
The name of the feature that stores the EventTime of a Record in
     * a FeatureGroup.

A EventTime is point in time
     * when a new event occurs that corresponds to the creation or update of a
     * Record in FeatureGroup. All Records in
     * the FeatureGroup must have a corresponding
     * EventTime.

     */
    inline bool EventTimeFeatureNameHasBeenSet() const { return m_eventTimeFeatureNameHasBeenSet; }

    /**
     *
The name of the feature that stores the EventTime of a Record in
     * a FeatureGroup.

A EventTime is point in time
     * when a new event occurs that corresponds to the creation or update of a
     * Record in FeatureGroup. All Records in
     * the FeatureGroup must have a corresponding
     * EventTime.

     */
    inline void SetEventTimeFeatureName(const Aws::String& value) { m_eventTimeFeatureNameHasBeenSet = true; m_eventTimeFeatureName = value; }

    /**
     *
The name of the feature that stores the EventTime of a Record in
     * a FeatureGroup.

A EventTime is point in time
     * when a new event occurs that corresponds to the creation or update of a
     * Record in FeatureGroup. All Records in
     * the FeatureGroup must have a corresponding
     * EventTime.

     */
    inline void SetEventTimeFeatureName(Aws::String&& value) { m_eventTimeFeatureNameHasBeenSet = true; m_eventTimeFeatureName = std::move(value); }

    /**
     *
The name of the feature that stores the EventTime of a Record in
     * a FeatureGroup.

A EventTime is point in time
     * when a new event occurs that corresponds to the creation or update of a
     * Record in FeatureGroup. All Records in
     * the FeatureGroup must have a corresponding
     * EventTime.

     */
    inline void SetEventTimeFeatureName(const char* value) { m_eventTimeFeatureNameHasBeenSet = true; m_eventTimeFeatureName.assign(value); }

    /**
     *
The name of the feature that stores the EventTime of a Record in
     * a FeatureGroup.

A EventTime is point in time
     * when a new event occurs that corresponds to the creation or update of a
     * Record in FeatureGroup. All Records in
     * the FeatureGroup must have a corresponding
     * EventTime.

     */
    inline FeatureGroup& WithEventTimeFeatureName(const Aws::String& value) { SetEventTimeFeatureName(value); return *this;}

    /**
     *
The name of the feature that stores the EventTime of a Record in
     * a FeatureGroup.

A EventTime is point in time
     * when a new event occurs that corresponds to the creation or update of a
     * Record in FeatureGroup. All Records in
     * the FeatureGroup must have a corresponding
     * EventTime.

     */
    inline FeatureGroup& WithEventTimeFeatureName(Aws::String&& value) { SetEventTimeFeatureName(std::move(value)); return *this;}

    /**
     *
The name of the feature that stores the EventTime of a Record in
     * a FeatureGroup.

A EventTime is point in time
     * when a new event occurs that corresponds to the creation or update of a
     * Record in FeatureGroup. All Records in
     * the FeatureGroup must have a corresponding
     * EventTime.

     */
    inline FeatureGroup& WithEventTimeFeatureName(const char* value) { SetEventTimeFeatureName(value); return *this;}

    /**
     *
A list of Features. Each Feature must include a
     * FeatureName and a FeatureType.

Valid
     * FeatureTypes are Integral, Fractional and
     * String.

 FeatureNames cannot be any of the
     * following: is_deleted, write_time,
     * api_invocation_time.

You can create up to 2,500
     * FeatureDefinitions per FeatureGroup.

     */
    inline const Aws::Vector<FeatureDefinition>& GetFeatureDefinitions() const{ return m_featureDefinitions; }

    /**
     *
A list of Features. Each Feature must include a
     * FeatureName and a FeatureType.

Valid
     * FeatureTypes are Integral, Fractional and
     * String.

 FeatureNames cannot be any of the
     * following: is_deleted, write_time,
     * api_invocation_time.

You can create up to 2,500
     * FeatureDefinitions per FeatureGroup.

     */
    inline bool FeatureDefinitionsHasBeenSet() const { return m_featureDefinitionsHasBeenSet; }

    /**
     *
A list of Features. Each Feature must include a
     * FeatureName and a FeatureType.

Valid
     * FeatureTypes are Integral, Fractional and
     * String.

 FeatureNames cannot be any of the
     * following: is_deleted, write_time,
     * api_invocation_time.

You can create up to 2,500
     * FeatureDefinitions per FeatureGroup.

     */
    inline void SetFeatureDefinitions(const Aws::Vector<FeatureDefinition>& value) { m_featureDefinitionsHasBeenSet = true; m_featureDefinitions = value; }

    /**
     *
A list of Features. Each Feature must include a
     * FeatureName and a FeatureType.

Valid
     * FeatureTypes are Integral, Fractional and
     * String.

 FeatureNames cannot be any of the
     * following: is_deleted, write_time,
     * api_invocation_time.

You can create up to 2,500
     * FeatureDefinitions per FeatureGroup.

     */
    inline void SetFeatureDefinitions(Aws::Vector<FeatureDefinition>&& value) { m_featureDefinitionsHasBeenSet = true; m_featureDefinitions = std::move(value); }

    /**
     *
A list of Features. Each Feature must include a
     * FeatureName and a FeatureType.

Valid
     * FeatureTypes are Integral, Fractional and
     * String.

 FeatureNames cannot be any of the
     * following: is_deleted, write_time,
     * api_invocation_time.

You can create up to 2,500
     * FeatureDefinitions per FeatureGroup.

     */
    inline FeatureGroup& WithFeatureDefinitions(const Aws::Vector<FeatureDefinition>& value) { SetFeatureDefinitions(value); return *this;}

    /**
     *
A list of Features. Each Feature must include a
     * FeatureName and a FeatureType.

Valid
     * FeatureTypes are Integral, Fractional and
     * String.

 FeatureNames cannot be any of the
     * following: is_deleted, write_time,
     * api_invocation_time.

You can create up to 2,500
     * FeatureDefinitions per FeatureGroup.

     */
    inline FeatureGroup& WithFeatureDefinitions(Aws::Vector<FeatureDefinition>&& value) { SetFeatureDefinitions(std::move(value)); return *this;}

    /**
     *
A list of Features. Each Feature must include a
     * FeatureName and a FeatureType.

Valid
     * FeatureTypes are Integral, Fractional and
     * String.

 FeatureNames cannot be any of the
     * following: is_deleted, write_time,
     * api_invocation_time.

You can create up to 2,500
     * FeatureDefinitions per FeatureGroup.

     */
    inline FeatureGroup& AddFeatureDefinitions(const FeatureDefinition& value) { m_featureDefinitionsHasBeenSet = true; m_featureDefinitions.push_back(value); return *this; }

    /**
     *
A list of Features. Each Feature must include a
     * FeatureName and a FeatureType.

Valid
     * FeatureTypes are Integral, Fractional and
     * String.

 FeatureNames cannot be any of the
     * following: is_deleted, write_time,
     * api_invocation_time.

You can create up to 2,500
     * FeatureDefinitions per FeatureGroup.

     */
    inline FeatureGroup& AddFeatureDefinitions(FeatureDefinition&& value) { m_featureDefinitionsHasBeenSet = true; m_featureDefinitions.push_back(std::move(value)); return *this; }

    /**
     *
The time a FeatureGroup was created.

     */
    inline const Aws::Utils::DateTime& GetCreationTime() const{ return m_creationTime; }

    /**
     *
The time a FeatureGroup was created.

     */
    inline bool CreationTimeHasBeenSet() const { return m_creationTimeHasBeenSet; }

    /**
     *
The time a FeatureGroup was created.

     */
    inline void SetCreationTime(const Aws::Utils::DateTime& value) { m_creationTimeHasBeenSet = true; m_creationTime = value; }

    /**
     *
The time a FeatureGroup was created.

     */
    inline void SetCreationTime(Aws::Utils::DateTime&& value) { m_creationTimeHasBeenSet = true; m_creationTime = std::move(value); }

    /**
     *
The time a FeatureGroup was created.

     */
    inline FeatureGroup& WithCreationTime(const Aws::Utils::DateTime& value) { SetCreationTime(value); return *this;}

    /**
     *
The time a FeatureGroup was created.

     */
    inline FeatureGroup& WithCreationTime(Aws::Utils::DateTime&& value) { SetCreationTime(std::move(value)); return *this;}

    inline const OnlineStoreConfig& GetOnlineStoreConfig() const{ return m_onlineStoreConfig; }

    inline bool OnlineStoreConfigHasBeenSet() const { return m_onlineStoreConfigHasBeenSet; }

    inline void SetOnlineStoreConfig(const OnlineStoreConfig& value) { m_onlineStoreConfigHasBeenSet = true; m_onlineStoreConfig = value; }

    inline void SetOnlineStoreConfig(OnlineStoreConfig&& value) { m_onlineStoreConfigHasBeenSet = true; m_onlineStoreConfig = std::move(value); }

    inline FeatureGroup& WithOnlineStoreConfig(const OnlineStoreConfig& value) { SetOnlineStoreConfig(value); return *this;}

    inline FeatureGroup& WithOnlineStoreConfig(OnlineStoreConfig&& value) { SetOnlineStoreConfig(std::move(value)); return *this;}

    inline const OfflineStoreConfig& GetOfflineStoreConfig() const{ return m_offlineStoreConfig; }

    inline bool OfflineStoreConfigHasBeenSet() const { return m_offlineStoreConfigHasBeenSet; }

    inline void SetOfflineStoreConfig(const OfflineStoreConfig& value) { m_offlineStoreConfigHasBeenSet = true; m_offlineStoreConfig = value; }

    inline void SetOfflineStoreConfig(OfflineStoreConfig&& value) { m_offlineStoreConfigHasBeenSet = true; m_offlineStoreConfig = std::move(value); }

    inline FeatureGroup& WithOfflineStoreConfig(const OfflineStoreConfig& value) { SetOfflineStoreConfig(value); return *this;}

    inline FeatureGroup& WithOfflineStoreConfig(OfflineStoreConfig&& value) { SetOfflineStoreConfig(std::move(value)); return *this;}

    /**
     *
The Amazon Resource Name (ARN) of the IAM execution role used to create the
     * feature group.

     */
    inline const Aws::String& GetRoleArn() const{ return m_roleArn; }

    /**
     *
The Amazon Resource Name (ARN) of the IAM execution role used to create the
     * feature group.

     */
    inline bool RoleArnHasBeenSet() const { return m_roleArnHasBeenSet; }

    /**
     *
The Amazon Resource Name (ARN) of the IAM execution role used to create the
     * feature group.

     */
    inline void SetRoleArn(const Aws::String& value) { m_roleArnHasBeenSet = true; m_roleArn = value; }

    /**
     *
The Amazon Resource Name (ARN) of the IAM execution role used to create the
     * feature group.

     */
    inline void SetRoleArn(Aws::String&& value) { m_roleArnHasBeenSet = true; m_roleArn = std::move(value); }

    /**
     *
The Amazon Resource Name (ARN) of the IAM execution role used to create the
     * feature group.

     */
    inline void SetRoleArn(const char* value) { m_roleArnHasBeenSet = true; m_roleArn.assign(value); }

    /**
     *
The Amazon Resource Name (ARN) of the IAM execution role used to create the
     * feature group.

     */
    inline FeatureGroup& WithRoleArn(const Aws::String& value) { SetRoleArn(value); return *this;}

    /**
     *
The Amazon Resource Name (ARN) of the IAM execution role used to create the
     * feature group.

     */
    inline FeatureGroup& WithRoleArn(Aws::String&& value) { SetRoleArn(std::move(value)); return *this;}

    /**
     *
The Amazon Resource Name (ARN) of the IAM execution role used to create the
     * feature group.

     */
    inline FeatureGroup& WithRoleArn(const char* value) { SetRoleArn(value); return *this;}

    /**
     *
A FeatureGroup status.

     */
    inline const FeatureGroupStatus& GetFeatureGroupStatus() const{ return m_featureGroupStatus; }

    /**
     *
A FeatureGroup status.

     */
    inline bool FeatureGroupStatusHasBeenSet() const { return m_featureGroupStatusHasBeenSet; }

    /**
     *
A FeatureGroup status.

     */
    inline void SetFeatureGroupStatus(const FeatureGroupStatus& value) { m_featureGroupStatusHasBeenSet = true; m_featureGroupStatus = value; }

    /**
     *
A FeatureGroup status.

     */
    inline void SetFeatureGroupStatus(FeatureGroupStatus&& value) { m_featureGroupStatusHasBeenSet = true; m_featureGroupStatus = std::move(value); }

    /**
     *
A FeatureGroup status.

     */
    inline FeatureGroup& WithFeatureGroupStatus(const FeatureGroupStatus& value) { SetFeatureGroupStatus(value); return *this;}

    /**
     *
A FeatureGroup status.

     */
    inline FeatureGroup& WithFeatureGroupStatus(FeatureGroupStatus&& value) { SetFeatureGroupStatus(std::move(value)); return *this;}

    inline const OfflineStoreStatus& GetOfflineStoreStatus() const{ return m_offlineStoreStatus; }

    inline bool OfflineStoreStatusHasBeenSet() const { return m_offlineStoreStatusHasBeenSet; }

    inline void SetOfflineStoreStatus(const OfflineStoreStatus& value) { m_offlineStoreStatusHasBeenSet = true; m_offlineStoreStatus = value; }

    inline void SetOfflineStoreStatus(OfflineStoreStatus&& value) { m_offlineStoreStatusHasBeenSet = true; m_offlineStoreStatus = std::move(value); }

    inline FeatureGroup& WithOfflineStoreStatus(const OfflineStoreStatus& value) { SetOfflineStoreStatus(value); return *this;}

    inline FeatureGroup& WithOfflineStoreStatus(OfflineStoreStatus&& value) { SetOfflineStoreStatus(std::move(value)); return *this;}

    /**
     *
The reason that the FeatureGroup failed to be replicated in the
     * OfflineStore. This is failure may be due to a failure to create a
     * FeatureGroup in or delete a FeatureGroup from the
     * OfflineStore.

     */
    inline const Aws::String& GetFailureReason() const{ return m_failureReason; }

    /**
     *
The reason that the FeatureGroup failed to be replicated in the
     * OfflineStore. This is failure may be due to a failure to create a
     * FeatureGroup in or delete a FeatureGroup from the
     * OfflineStore.

     */
    inline bool FailureReasonHasBeenSet() const { return m_failureReasonHasBeenSet; }

    /**
     *
The reason that the FeatureGroup failed to be replicated in the
     * OfflineStore. This is failure may be due to a failure to create a
     * FeatureGroup in or delete a FeatureGroup from the
     * OfflineStore.

     */
    inline void SetFailureReason(const Aws::String& value) { m_failureReasonHasBeenSet = true; m_failureReason = value; }

    /**
     *
The reason that the FeatureGroup failed to be replicated in the
     * OfflineStore. This is failure may be due to a failure to create a
     * FeatureGroup in or delete a FeatureGroup from the
     * OfflineStore.

     */
    inline void SetFailureReason(Aws::String&& value) { m_failureReasonHasBeenSet = true; m_failureReason = std::move(value); }

    /**
     *
The reason that the FeatureGroup failed to be replicated in the
     * OfflineStore. This is failure may be due to a failure to create a
     * FeatureGroup in or delete a FeatureGroup from the
     * OfflineStore.

     */
    inline void SetFailureReason(const char* value) { m_failureReasonHasBeenSet = true; m_failureReason.assign(value); }

    /**
     *
The reason that the FeatureGroup failed to be replicated in the
     * OfflineStore. This is failure may be due to a failure to create a
     * FeatureGroup in or delete a FeatureGroup from the
     * OfflineStore.

     */
    inline FeatureGroup& WithFailureReason(const Aws::String& value) { SetFailureReason(value); return *this;}

    /**
     *
The reason that the FeatureGroup failed to be replicated in the
     * OfflineStore. This is failure may be due to a failure to create a
     * FeatureGroup in or delete a FeatureGroup from the
     * OfflineStore.

     */
    inline FeatureGroup& WithFailureReason(Aws::String&& value) { SetFailureReason(std::move(value)); return *this;}

    /**
     *
The reason that the FeatureGroup failed to be replicated in the
     * OfflineStore. This is failure may be due to a failure to create a
     * FeatureGroup in or delete a FeatureGroup from the
     * OfflineStore.

     */
    inline FeatureGroup& WithFailureReason(const char* value) { SetFailureReason(value); return *this;}

    /**
     *
A free form description of a FeatureGroup.

     */
    inline const Aws::String& GetDescription() const{ return m_description; }

    /**
     *
A free form description of a FeatureGroup.

     */
    inline bool DescriptionHasBeenSet() const { return m_descriptionHasBeenSet; }

    /**
     *
A free form description of a FeatureGroup.

     */
    inline void SetDescription(const Aws::String& value) { m_descriptionHasBeenSet = true; m_description = value; }

    /**
     *
A free form description of a FeatureGroup.

     */
    inline void SetDescription(Aws::String&& value) { m_descriptionHasBeenSet = true; m_description = std::move(value); }

    /**
     *
A free form description of a FeatureGroup.

     */
    inline void SetDescription(const char* value) { m_descriptionHasBeenSet = true; m_description.assign(value); }

    /**
     *
A free form description of a FeatureGroup.

     */
    inline FeatureGroup& WithDescription(const Aws::String& value) { SetDescription(value); return *this;}

    /**
     *
A free form description of a FeatureGroup.

     */
    inline FeatureGroup& WithDescription(Aws::String&& value) { SetDescription(std::move(value)); return *this;}

    /**
     *
A free form description of a FeatureGroup.

     */
    inline FeatureGroup& WithDescription(const char* value) { SetDescription(value); return *this;}

    /**
     *
Tags used to define a FeatureGroup.

     */
    inline const Aws::Vector<Tag>& GetTags() const{ return m_tags; }

    /**
     *
Tags used to define a FeatureGroup.

     */
    inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }

    /**
     *
Tags used to define a FeatureGroup.

     */
    inline void SetTags(const Aws::Vector<Tag>& value) { m_tagsHasBeenSet = true; m_tags = value; }

    /**
     *
Tags used to define a FeatureGroup.

     */
    inline void SetTags(Aws::Vector<Tag>&& value) { m_tagsHasBeenSet = true; m_tags = std::move(value); }

    /**
     *
Tags used to define a FeatureGroup.

     */
    inline FeatureGroup& WithTags(const Aws::Vector<Tag>& value) { SetTags(value); return *this;}

    /**
     *
Tags used to define a FeatureGroup.

     */
    inline FeatureGroup& WithTags(Aws::Vector<Tag>&& value) { SetTags(std::move(value)); return *this;}

    /**
     *
Tags used to define a FeatureGroup.

     */
    inline FeatureGroup& AddTags(const Tag& value) { m_tagsHasBeenSet = true; m_tags.push_back(value); return *this; }

    /**
     *
Tags used to define a FeatureGroup.

     */
    inline FeatureGroup& AddTags(Tag&& value) { m_tagsHasBeenSet = true; m_tags.push_back(std::move(value)); return *this; }

  private:

    Aws::String m_featureGroupArn;
    bool m_featureGroupArnHasBeenSet;

    Aws::String m_featureGroupName;
    bool m_featureGroupNameHasBeenSet;

    Aws::String m_recordIdentifierFeatureName;
    bool m_recordIdentifierFeatureNameHasBeenSet;

    Aws::String m_eventTimeFeatureName;
    bool m_eventTimeFeatureNameHasBeenSet;

    Aws::Vector<FeatureDefinition> m_featureDefinitions;
    bool m_featureDefinitionsHasBeenSet;

    Aws::Utils::DateTime m_creationTime;
    bool m_creationTimeHasBeenSet;

    OnlineStoreConfig m_onlineStoreConfig;
    bool m_onlineStoreConfigHasBeenSet;

    OfflineStoreConfig m_offlineStoreConfig;
    bool m_offlineStoreConfigHasBeenSet;

    Aws::String m_roleArn;
    bool m_roleArnHasBeenSet;

    FeatureGroupStatus m_featureGroupStatus;
    bool m_featureGroupStatusHasBeenSet;

    OfflineStoreStatus m_offlineStoreStatus;
    bool m_offlineStoreStatusHasBeenSet;

    Aws::String m_failureReason;
    bool m_failureReasonHasBeenSet;

    Aws::String m_description;
    bool m_descriptionHasBeenSet;

    Aws::Vector<Tag> m_tags;
    bool m_tagsHasBeenSet;
  };

} // namespace Model
} // namespace SageMaker
} // namespace Aws


text:
/**
 * Created by 쩐율 on 2014-06-07.
 */
define([
    'backbone',
    'templates',
	'bootstrap-window'
], function(Backbone, JST, BootstrapWindow) {
    'use strict';

	var WindowManagerSingle = Backbone.View.extend({
        template: JST['app/scripts/templates/WindowManager.ejs'],
		defaultOptions: {
			title: "윈도우",
			bodyContent: "
표시할 내용이 없습니다.
",
			footerContent: '<button type="button" class="btn btn-default" data-dismiss="window">닫기</button>'
		},

		open: function(options) {
			var self = this;
			var newOptions = _.defaults(options, self.defaultOptions);

			if(!windowManager) {
				self._initWidget();
			}

			self.resize(windowManager.createWindow(newOptions), options);
		},

		getWindow: function(id) {
			var self = this,
				windowManager = self.windowManager;

			if(!windowManager) {
				self._initWidget();
			}

			return windowManager.findWindowByID(id);
		},

		close: function(id) {
			var self = this,
				windowManager = self.windowManager,
				getWindow = self.getWindow(id);

			if(getWindow) {
				getWindow.getElement().find('.close').click();
			}
		},

		resize: function(win, options) {
			var self = this;

			if(!win) {
				return;
			}

			if(options.width) { win.resize({ width: options.width });}
			if(options.height) { win.resize({ height: options.height });}
			if(options.left) { win.resize({ left: options.left });}
			if(options.top) { win.resize({ top: options.top });}
			win.centerWindow();
		},

		_initWidget: function() {
			var self = this;
			var windowManager = new BootstrapWindow({
				container: "#windowPane",
				windowTemplate: $('#windowTemplate').html()
			});
			window.windowManager = windowManager;
			self.windowManager = windowManager;
		},

		events: function() {
			return MOBILE ?
			{
			} :
			{
			};
		},

        initialize: function() {
			var self = this,
				$el = this.$el;

			$el.html(this.template());
			self._initWidget();
		},

		render: function() {
		// 화면 구성
		}
    });

	// 싱글톤 처리
	var instance;
	return function() {
		if(!instance) {
			instance = new WindowManagerSingle({
				el: $('#windowManager')
			});
		}
		return instance;
	};

});


text:
extern crate ispc_compile;
extern crate ispc_rt;

#[cfg(feature = "ispc")]
fn link_ispc() {
    use ispc_compile::TargetISA;
    // For a portable program we can explicitly compile for each target ISA
    // we want. Then ISPC will pick the correct ISA at runtime to call
    // for the target CPU.
    ispc_compile::Config::new()
        .file("src/simple.ispc")
        .target_isas(vec![
            TargetISA::SSE2i32x4,
            TargetISA::SSE4i32x4,
            TargetISA::AVX1i32x8,
            TargetISA::AVX2i32x8,
            TargetISA::AVX512KNLi32x16,
            TargetISA::AVX512SKXi32x8,
        ])
        .out_dir("src/")
        .compile("simple");
}

#[cfg(not(feature = "ispc"))]
fn link_ispc() {
    ispc_rt::PackagedModule::new("simple")
        .lib_path("src/")
        .link();
}

fn main() {
    link_ispc();
}


text:
<?php require('../common/body_header.inc.php'); $lm = '$LastChangedDate: 2006-06-29 11:25:07 -0400 (Thu, 29 Jun 2006) $'; ?>

Creating and Editing Content

Using the Tabs in the Content Manager, content can be created, its location, keywords, and date properties set, and glossary terms defined.  It can also be previewed and have its accessibility checked. While creating content, save often. Unsaved information is indicated by a red bullet in the corresponding Content Manager tab. When content editing is complete, choose the Close after saving option, then press Save.

<?php require('../common/body_footer.inc.php'); ?>


text:
/*
 * Jacs -- Java augmented cipher streams.
 * See README.txt for more info.
 */

package net.openvpn.jacs;

public class Util {
    final private static char[] hexArray = "0123456789ABCDEF".toCharArray();

    public static String bytesToHex(byte[] bytes) {
		char[] hexChars = new char[bytes.length * 2];
		int v;
		for (int j = 0; j < bytes.length; j++) {
			v = bytes[j] & 0xFF;
			hexChars[j * 2] = hexArray[v >>> 4];
			hexChars[j * 2 + 1] = hexArray[v & 0x0F];
		}
		return new String(hexChars);
    }
}


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.prestosql.operator.exchange;

import com.google.common.collect.ImmutableList;
import com.google.common.util.concurrent.ListenableFuture;
import io.prestosql.operator.DriverContext;
import io.prestosql.operator.Operator;
import io.prestosql.operator.OperatorContext;
import io.prestosql.operator.OperatorFactory;
import io.prestosql.operator.PageWithPositionComparator;
import io.prestosql.operator.WorkProcessor;
import io.prestosql.operator.exchange.LocalExchange.LocalExchangeFactory;
import io.prestosql.spi.Page;
import io.prestosql.spi.block.SortOrder;
import io.prestosql.spi.type.Type;
import io.prestosql.sql.gen.OrderingCompiler;
import io.prestosql.sql.planner.plan.PlanNodeId;

import java.io.IOException;
import java.util.List;
import java.util.stream.IntStream;

import static com.google.common.base.Preconditions.checkState;
import static com.google.common.collect.ImmutableList.toImmutableList;
import static io.prestosql.util.MergeSortedPages.mergeSortedPages;
import static java.util.Objects.requireNonNull;

public class LocalMergeSourceOperator
        implements Operator
{
    public static class LocalMergeSourceOperatorFactory
            implements OperatorFactory
    {
        private final int operatorId;
        private final PlanNodeId planNodeId;
        private final LocalExchangeFactory localExchangeFactory;
        private final List<Type> types;
        private final OrderingCompiler orderingCompiler;
        private final List<Integer> sortChannels;
        private final List<SortOrder> orderings;
        private boolean closed;

        public LocalMergeSourceOperatorFactory(
                int operatorId,
                PlanNodeId planNodeId,
                LocalExchangeFactory localExchangeFactory,
                List<Type> types,
                OrderingCompiler orderingCompiler,
                List<Integer> sortChannels,
                List<SortOrder> orderings)
        {
            this.operatorId = operatorId;
            this.planNodeId = requireNonNull(planNodeId, "planNodeId is null");
            this.localExchangeFactory = requireNonNull(localExchangeFactory, "exchange is null");
            this.types = ImmutableList.copyOf(requireNonNull(types, "types is null"));
            this.orderingCompiler = requireNonNull(orderingCompiler, "orderingCompiler is null");
            this.sortChannels = ImmutableList.copyOf(requireNonNull(sortChannels, "sortChannels is null"));
            this.orderings = ImmutableList.copyOf(requireNonNull(orderings, "orderings is null"));
        }

        @Override
        public Operator createOperator(DriverContext driverContext)
        {
            checkState(!closed, "Factory is already closed");

            LocalExchange localExchange = localExchangeFactory.getLocalExchange(driverContext.getLifespan());

            OperatorContext operatorContext = driverContext.addOperatorContext(operatorId, planNodeId, LocalMergeSourceOperator.class.getSimpleName());
            PageWithPositionComparator comparator = orderingCompiler.compilePageWithPositionComparator(types, sortChannels, orderings);
            List<LocalExchangeSource> sources = IntStream.range(0, localExchange.getBufferCount())
                    .boxed()
                    .map(index -> localExchange.getNextSource())
                    .collect(toImmutableList());
            return new LocalMergeSourceOperator(operatorContext, sources, types, comparator);
        }

        @Override
        public void noMoreOperators()
        {
            closed = true;
        }

        @Override
        public OperatorFactory duplicate()
        {
            throw new UnsupportedOperationException("Source operator factories can not be duplicated");
        }
    }

    private final OperatorContext operatorContext;
    private final List<LocalExchangeSource> sources;
    private final WorkProcessor<Page> mergedPages;

    public LocalMergeSourceOperator(OperatorContext operatorContext, List<LocalExchangeSource> sources, List<Type> types, PageWithPositionComparator comparator)
    {
        this.operatorContext = requireNonNull(operatorContext, "operatorContext is null");
        this.sources = requireNonNull(sources, "sources is null");
        List<WorkProcessor<Page>> pageProducers = sources.stream()
                .map(LocalExchangeSource::pages)
                .collect(toImmutableList());
        mergedPages = mergeSortedPages(
                pageProducers,
                requireNonNull(comparator, "comparator is null"),
                types,
                operatorContext.aggregateUserMemoryContext(),
                operatorContext.getDriverContext().getYieldSignal());
    }

    @Override
    public OperatorContext getOperatorContext()
    {
        return operatorContext;
    }

    @Override
    public void finish()
    {
        sources.forEach(LocalExchangeSource::finish);
    }

    @Override
    public boolean isFinished()
    {
        return mergedPages.isFinished();
    }

    @Override
    public ListenableFuture<?> isBlocked()
    {
        if (mergedPages.isBlocked()) {
            return mergedPages.getBlockedFuture();
        }

        return NOT_BLOCKED;
    }

    @Override
    public boolean needsInput()
    {
        return false;
    }

    @Override
    public void addInput(Page page)
    {
        throw new UnsupportedOperationException();
    }

    @Override
    public Page getOutput()
    {
        if (!mergedPages.process() || mergedPages.isFinished()) {
            return null;
        }

        Page page = mergedPages.getResult();
        operatorContext.recordProcessedInput(page.getSizeInBytes(), page.getPositionCount());
        return page;
    }

    @Override
    public void close()
            throws IOException
    {
        sources.forEach(LocalExchangeSource::close);
    }
}


text:
using System;
using System.Threading.Tasks;
using d60.Cirqus.Events;
using d60.Cirqus.Logging;
using d60.Cirqus.Logging.Console;
using d60.Cirqus.Testing;
using d60.Cirqus.Tests.Contracts.Views.Factories;
using d60.Cirqus.Tests.Contracts.Views.Models.GeneralViewManagerTest;
using d60.Cirqus.Views.ViewManagers;
using d60.Cirqus.Views.ViewManagers.Locators;
using NUnit.Framework;
using TestContext = d60.Cirqus.Testing.TestContext;

namespace d60.Cirqus.Tests.Contracts.Views
{
    [TestFixture(typeof(MongoDbViewManagerFactory), Category = TestCategories.MongoDb)]
    [TestFixture(typeof(PostgreSqlViewManagerFactory), Category = TestCategories.PostgreSql)]
    [TestFixture(typeof(MsSqlViewManagerFactory), Category = TestCategories.MsSql)]
    [TestFixture(typeof(EntityFrameworkViewManagerFactory), Category = TestCategories.MsSql, Ignore = true, IgnoreReason = "The contained HashSet<string> cannot be persisted by EF")]
    [TestFixture(typeof(InMemoryViewManagerFactory))]
    [TestFixture(typeof(HybridDbViewManagerFactory), Category = TestCategories.MsSql)]
    public class GeneralViewManagerTests<TFactory> : FixtureBase where TFactory : AbstractViewManagerFactory, new()
    {
        readonly TimeSpan _defaultTimeout = TimeSpan.FromSeconds(50);

        TFactory _factory;
        TestContext _context;

        protected override void DoSetUp()
        {
            CirqusLoggerFactory.Current = new ConsoleLoggerFactory(minLevel:Logger.Level.Debug);

            _factory = RegisterForDisposal(new TFactory());

            var context = TestContext.With()
                .Options(x => x.Asynchronous())
                .Create();

            _context = RegisterForDisposal(context);
        }

        [Test]
        public void WorksWithSimpleScenario()
        {
            // arrange
            Console.WriteLine("Adding view manager for GeneratedIds");
            var view = _factory.GetViewManager<GeneratedIds>();
            _context.AddViewManager(view);

            // act
            Console.WriteLine("Processing 2 commands");
            _context.ProcessCommand(new GenerateNewId(IdGenerator.InstanceId) { IdBase = "bim" });
            _context.ProcessCommand(new GenerateNewId(IdGenerator.InstanceId) { IdBase = "bim" });
            var last = _context.ProcessCommand(new GenerateNewId(IdGenerator.InstanceId) { IdBase = "bom" });

            // assert
            Console.WriteLine("Waiting until dispatched: {0}", last.GetNewPosition());
            view.WaitUntilProcessed(last, _defaultTimeout).Wait();

            var idsView = _factory.Load<GeneratedIds>(InstancePerAggregateRootLocator.GetViewIdFromAggregateRootId(IdGenerator.InstanceId));

            Assert.That(idsView, Is.Not.Null, "Could not find view!");

            var storedIds = idsView.AllIds;
            Assert.That(storedIds.Count, Is.EqualTo(3));

            Assert.That(storedIds, Contains.Item("bim/0"));
            Assert.That(storedIds, Contains.Item("bim/1"));
            Assert.That(storedIds, Contains.Item("bom/0"));
        }

        [Test]
        public void AutomaticallyCatchesUpWhenInitializing()
        {
            // arrange
            Console.WriteLine("Processing 2 commands");
            _context.ProcessCommand(new GenerateNewId(IdGenerator.InstanceId) { IdBase = "bim" });
            _context.ProcessCommand(new GenerateNewId(IdGenerator.InstanceId) { IdBase = "bim" });
            var last = _context.ProcessCommand(new GenerateNewId(IdGenerator.InstanceId) { IdBase = "bom" });

            // act
            Console.WriteLine("Adding view manager for GeneratedIds");
            var view = _factory.GetViewManager<GeneratedIds>();
            _context.AddViewManager(view);

            // assert
            Console.WriteLine("Waiting until dispatched: {0}", last.GetNewPosition());
            view.WaitUntilProcessed(last, _defaultTimeout).Wait();

            var idsView = _factory.Load<GeneratedIds>(InstancePerAggregateRootLocator.GetViewIdFromAggregateRootId(IdGenerator.InstanceId));

            Assert.That(idsView, Is.Not.Null, "Could not find view!");

            var storedIds = idsView.AllIds;
            Assert.That(storedIds.Count, Is.EqualTo(3));

            Assert.That(storedIds, Contains.Item("bim/0"));
            Assert.That(storedIds, Contains.Item("bim/1"));
            Assert.That(storedIds, Contains.Item("bom/0"));
        }

        [Test]
        public async Task AutomaticallyCatchesUpAfterPurging()
        {
            // arrange
            Console.WriteLine("Adding view manager for GeneratedIds");
            var view = _factory.GetViewManager<GeneratedIds>();
            _context.AddViewManager(view);

            Console.WriteLine("Processing 2 commands");
            _context.ProcessCommand(new GenerateNewId(IdGenerator.InstanceId) { IdBase = "bim" });
            _context.ProcessCommand(new GenerateNewId(IdGenerator.InstanceId) { IdBase = "bim" });
            var last = _context.ProcessCommand(new GenerateNewId(IdGenerator.InstanceId) { IdBase = "bom" });

            view.WaitUntilProcessed(last, _defaultTimeout).Wait();

            // act
            Console.WriteLine("Purging view");
            _factory.PurgeView<GeneratedIds>();

            // assert
            await view.WaitUntilProcessed(last, _defaultTimeout);

            var idsView = _factory
                .Load<GeneratedIds>(InstancePerAggregateRootLocator.GetViewIdFromAggregateRootId(IdGenerator.InstanceId));

            var storedIds = idsView.AllIds;

            Assert.That(storedIds.Count, Is.EqualTo(3));

            Assert.That(storedIds, Contains.Item("bim/0"));
            Assert.That(storedIds, Contains.Item("bim/1"));
            Assert.That(storedIds, Contains.Item("bom/0"));
        }

        [Test]
        public void CanManageViewWithLocatorWithMultipleIds()
        {
            // arrange
            const string customHeaderKey = "custom-header";
            var view = _factory.GetViewManager<HeaderCounter>();
            _context.AddViewManager(view);

            // act
            _context.ProcessCommand(new EmitEvent("id1") {Meta = {{customHeaderKey, "w00t!"}}});
            _context.ProcessCommand(new EmitEvent("id2"));
            _context.ProcessCommand(new EmitEvent("id3"));
            var last = _context.ProcessCommand(new EmitEvent("id4"));

            // assert
            view.WaitUntilProcessed(last, _defaultTimeout).Wait();

            var batchIdView = LoadCheckForNull(view, DomainEvent.MetadataKeys.BatchId);
            var aggregateRootIdView = LoadCheckForNull(view, DomainEvent.MetadataKeys.AggregateRootId);
            var globalSequenceNumberView = LoadCheckForNull(view, DomainEvent.MetadataKeys.GlobalSequenceNumber);
            var sequenceNumberView = LoadCheckForNull(view, DomainEvent.MetadataKeys.SequenceNumber);
            var customHeaderView = LoadCheckForNull(view, customHeaderKey);

            Assert.That(batchIdView.HeaderValues.Count, Is.EqualTo(4));
            Assert.That(aggregateRootIdView.HeaderValues.Count, Is.EqualTo(4));
            Assert.That(globalSequenceNumberView.HeaderValues.Count, Is.EqualTo(4));
            Assert.That(sequenceNumberView.HeaderValues.Count, Is.EqualTo(1));
            Assert.That(customHeaderView.HeaderValues.Count, Is.EqualTo(1));
        }

        static HeaderCounter LoadCheckForNull(IViewManager<HeaderCounter> view, string metadataKey)
        {
            var loadedView = view.Load(metadataKey);

            if (loadedView == null)
            {
                throw new AssertionException(string.Format("Could not find view with ID '{0}'", metadataKey));
            }

            return loadedView;
        }
    }
}


text:
import numpy as np
import pandas as pd
import pytest

ROWID_ZERO_INDEXED_BACKENDS = ('omniscidb',)

@pytest.mark.parametrize(
    'column',
    [
        'string_col',
        'double_col',
        'date_string_col',
        pytest.param('timestamp_col', marks=pytest.mark.skip(reason='hangs')),
    ],
)
@pytest.mark.xfail_unsupported
def test_distinct_column(backend, alltypes, df, column):
    expr = alltypes[column].distinct()
    result = expr.execute()
    expected = df[column].unique()
    assert set(result) == set(expected)

@pytest.mark.xfail_unsupported
def test_rowid(con, backend):
    t = con.table('functional_alltypes')
    result = t[t.rowid()].execute()
    first_value = 0 if backend.name() in ROWID_ZERO_INDEXED_BACKENDS else 1
    expected = pd.Series(
        range(first_value, first_value + len(result)),
        dtype=np.int64,
        name='rowid',
    )
    pd.testing.assert_series_equal(result.iloc[:, 0], expected)

@pytest.mark.xfail_unsupported
def test_named_rowid(con, backend):
    t = con.table('functional_alltypes')
    result = t[t.rowid().name('number')].execute()
    first_value = 0 if backend.name() in ROWID_ZERO_INDEXED_BACKENDS else 1
    expected = pd.Series(
        range(first_value, first_value + len(result)),
        dtype=np.int64,
        name='number',
    )
    pd.testing.assert_series_equal(result.iloc[:, 0], expected)


text:
#ifndef TORRENT_BENCODE_HPP_INCLUDED
#define TORRENT_BENCODE_HPP_INCLUDED

/*
 * This file declares the following functions:
 *
 *----------------------------------
 * template<class OutIt>
 * void libtorrent::bencode(OutIt out, const libtorrent::entry& e);
 *
 * Encodes a message entry with bencoding into the output
 * iterator given. The bencoding is described in the BitTorrent
 * protocol description document OutIt must be an OutputIterator
 * of type char. This may throw libtorrent::invalid_encoding if
 * the entry contains invalid nodes (undefined_t for example).
 *
 *----------------------------------
 * template<class InIt>
 * libtorrent::entry libtorrent::bdecode(InIt start, InIt end);
 *
 * Decodes the buffer given by the start and end iterators
 * and returns the decoded entry. InIt must be an InputIterator
 * of type char. May throw libtorrent::invalid_encoding if
 * the string is not correctly bencoded.
 *
 */

#include <cstdlib>

#ifdef _MSC_VER
#pragma warning(push, 1)
#endif

#include <boost/lexical_cast.hpp>
#include <boost/static_assert.hpp>

#ifdef _MSC_VER
#pragma warning(pop)
#endif

#include "libtorrent/entry.hpp"
#include "libtorrent/config.hpp"

#include "libtorrent/assert.hpp"

#if defined(_MSC_VER)
namespace std
{
	using ::isdigit;
	using ::atoi;
};

#define for if (false) {}  else for
#endif

namespace libtorrent
{

	struct TORRENT_EXPORT invalid_encoding: std::exception
	{
		virtual const char* what() const throw() { return "invalid bencoding"; }
	};

	namespace detail
	{
		template <class OutIt>
		int write_string(OutIt& out, const std::string& val)
		{
			for (std::string::const_iterator i = val.begin()
				, end(val.end()); i != end; ++i)
				*out++ = *i;
			return val.length();
		}

		TORRENT_EXPORT char const* integer_to_str(char* buf, int size, entry::integer_type val);

		template <class OutIt>
		int write_integer(OutIt& out, entry::integer_type val)
		{
			// the stack allocated buffer for keeping the
			// decimal representation of the number can
			// not hold number bigger than this:
			BOOST_STATIC_ASSERT(sizeof(entry::integer_type) <= 8);
			char buf[21];
			int ret = 0;
			for (char const* str = integer_to_str(buf, 21, val);
				*str != 0; ++str)
			{
				*out = *str;
				++out;
				++ret;
			}
			return ret;
		}

		template <class OutIt>
		void write_char(OutIt& out, char c)
		{
			*out = c;
			++out;
		}

		template <class InIt>
		std::string read_until(InIt& in, InIt end, char end_token, bool& err)
		{
			std::string ret;
			if (in == end)
			{
				err = true;
				return ret;
			}
			while (*in != end_token)
			{
				ret += *in;
				++in;
				if (in == end)
				{
					err = true;
					return ret;
				}
			}
			return ret;
		}

		template<class InIt>
		void read_string(InIt& in, InIt end, int len, std::string& str, bool& err)
		{
			TORRENT_ASSERT(len >= 0);
			for (int i = 0; i < len; ++i)
			{
				if (in == end)
				{
					err = true;
					return;
				}
				str += *in;
				++in;
			}
		}

		// returns the number of bytes written
		template<class OutIt>
		int bencode_recursive(OutIt& out, const entry& e)
		{
			int ret = 0;
			switch(e.type())
			{
			case entry::int_t:
				write_char(out, 'i');
				ret += write_integer(out, e.integer());
				write_char(out, 'e');
				ret += 2;
				break;
			case entry::string_t:
				ret += write_integer(out, e.string().length());
				write_char(out, ':');
				ret += write_string(out, e.string());
				ret += 1;
				break;
			case entry::list_t:
				write_char(out, 'l');
				for (entry::list_type::const_iterator i = e.list().begin(); i != e.list().end(); ++i)
					ret += bencode_recursive(out, *i);
				write_char(out, 'e');
				ret += 2;
				break;
			case entry::dictionary_t:
				write_char(out, 'd');
				for (entry::dictionary_type::const_iterator i = e.dict().begin();
					i != e.dict().end(); ++i)
				{
					// write key
					ret += write_integer(out, i->first.length());
					write_char(out, ':');
					ret += write_string(out, i->first);
					// write value
					ret += bencode_recursive(out, i->second);
					ret += 1;
				}
				write_char(out, 'e');
				ret += 2;
				break;
			default:
				// do nothing
				break;
			}
			return ret;
		}

		template<class InIt>
		void bdecode_recursive(InIt& in, InIt end, entry& ret, bool& err, int depth)
		{
			if (depth >= 100)
			{
				err = true;
				return;
			}

			if (in == end)
			{
				err = true;
#ifndef NDEBUG
				ret.m_type_queried = false;
#endif
				return;
			}
			switch (*in)
			{

			// ----------------------------------------------
			// integer
			case 'i':
				{
				++in; // 'i'
				std::string val = read_until(in, end, 'e', err);
				if (err) return;
				TORRENT_ASSERT(*in == 'e');
				++in; // 'e'
				ret = entry(entry::int_t);
				ret.integer() = boost::lexical_cast<entry::integer_type>(val);
#ifndef NDEBUG
				ret.m_type_queried = false;
#endif
				} break;

			// ----------------------------------------------
			// list
			case 'l':
				{
				ret = entry(entry::list_t);
				++in; // 'l'
				while (*in != 'e')
				{
					ret.list().push_back(entry());
					entry& e = ret.list().back();
					bdecode_recursive(in, end, e, err, depth + 1);
					if (err)
					{
#ifndef NDEBUG
						ret.m_type_queried = false;
#endif
						return;
					}
					if (in == end)
					{
						err = true;
#ifndef NDEBUG
						ret.m_type_queried = false;
#endif
						return;
					}
				}
#ifndef NDEBUG
				ret.m_type_queried = false;
#endif
				TORRENT_ASSERT(*in == 'e');
				++in; // 'e'
				} break;

			// ----------------------------------------------
			// dictionary
			case 'd':
				{
				ret = entry(entry::dictionary_t);
				++in; // 'd'
				while (*in != 'e')
				{
					entry key;
					bdecode_recursive(in, end, key, err, depth + 1);
					if (err || key.type() != entry::string_t)
					{
#ifndef NDEBUG
						ret.m_type_queried = false;
#endif
						return;
					}
					entry& e = ret[key.string()];
					bdecode_recursive(in, end, e, err, depth + 1);
					if (err)
					{
#ifndef NDEBUG
						ret.m_type_queried = false;
#endif
						return;
					}
					if (in == end)
					{
						err = true;
#ifndef NDEBUG
						ret.m_type_queried = false;
#endif
						return;
					}
				}
#ifndef NDEBUG
				ret.m_type_queried = false;
#endif
				TORRENT_ASSERT(*in == 'e');
				++in; // 'e'
				} break;

			// ----------------------------------------------
			// string
			default:
				if (isdigit((unsigned char)*in))
				{
					std::string len_s = read_until(in, end, ':', err);
					if (err)
					{
#ifndef NDEBUG
						ret.m_type_queried = false;
#endif
						return;
					}
					TORRENT_ASSERT(*in == ':');
					++in; // ':'
					int len = std::atoi(len_s.c_str());
					ret = entry(entry::string_t);
					read_string(in, end, len, ret.string(), err);
					if (err)
					{
#ifndef NDEBUG
						ret.m_type_queried = false;
#endif
						return;
					}
				}
				else
				{
					err = true;
#ifndef NDEBUG
					ret.m_type_queried = false;
#endif
					return;
				}
#ifndef NDEBUG
				ret.m_type_queried = false;
#endif
			}
		}
	}

	template<class OutIt>
	int bencode(OutIt out, const entry& e)
	{
		return detail::bencode_recursive(out, e);
	}

	template<class InIt>
	entry bdecode(InIt start, InIt end)
	{
		entry e;
		bool err = false;
		detail::bdecode_recursive(start, end, e, err, 0);
		TORRENT_ASSERT(e.m_type_queried == false);
		if (err) return entry();
		return e;
	}

	template<class InIt>
	entry bdecode(InIt start, InIt end, int& len)
	{
		entry e;
		bool err = false;
		InIt s = start;
		detail::bdecode_recursive(start, end, e, err, 0);
		len = std::distance(s, start);
		TORRENT_ASSERT(len >= 0);
		if (err) return entry();
		return e;
	}
}

#endif // TORRENT_BENCODE_HPP_INCLUDED


text:
using System.IO;
using AliaSQL.Console;
using AliaSQL.Core;
using AliaSQL.Core.Model;
using AliaSQL.Core.Services.Impl;
using NUnit.Framework;
using Should;

namespace AliaSQL.IntegrationTests
{
    [TestFixture]
    public class ChangedEverytimeScriptShouldRunTester
    {
        [Test]
        public void Update_Database_Runs_Changed_Everytime_Script()
        {

            //arrange
            string scriptsDirectory = Path.Combine("Scripts", GetType().Name.Replace("Tester", ""));

            var settings = new ConnectionSettings(".\\sqlexpress", "aliasqltest", true, null, null);
            new ConsoleAliaSQL().UpdateDatabase(settings, scriptsDirectory, RequestedDatabaseAction.Drop);

            //act
            //run once
            new ConsoleAliaSQL().UpdateDatabase(settings, scriptsDirectory, RequestedDatabaseAction.Update).ShouldBeTrue();
            new QueryExecutor().ExecuteScalarInteger(settings, "select 1 from dbo.sysobjects where name = 'TestTable' and type='U'").ShouldEqual(1);

            //change contents of script
            File.WriteAllText(Path.Combine(scriptsDirectory, "Everytime", "TestScript.sql"), "CREATE TABLE [dbo].[TestTable2]([Id] [int] IDENTITY(1,1) NOT NULL, [FullName] [nvarchar](50) NULL)");

            new ConsoleAliaSQL().UpdateDatabase(settings, scriptsDirectory, RequestedDatabaseAction.Update).ShouldBeTrue();

            //assert
            new QueryExecutor().ExecuteScalarInteger(settings, "select 1 from dbo.sysobjects where name = 'TestTable2' and type='U'").ShouldEqual(1);

            //change contents of script back in case you run again without rebuilding
            File.WriteAllText(Path.Combine(scriptsDirectory, "Everytime", "TestScript.sql"), "CREATE TABLE [dbo].[TestTable]([Id] [int] IDENTITY(1,1) NOT NULL, [FullName] [nvarchar](50) NULL)");

        }

    }
}


text:
<?php

namespace Mmoreram\GearmanBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;

/**
 * This is the class that validates and merges configuration from your
 * app/config files
 *
 * @since 2.3.1
 */
class Configuration implements ConfigurationInterface
{
    /**
     * Generates the configuration tree builder.
     *
     * @return TreeBuilder The tree builder
     */
    public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('gearman');

        $rootNode
            ->children()
                ->arrayNode('bundles')
                    ->prototype('array')
                        ->children()
                            ->scalarNode('name')
                                ->isRequired()
                                ->cannotBeEmpty()
                            ->end()
                            ->booleanNode('active')
                                ->defaultFalse()
                            ->end()
                            ->arrayNode('include')
                                ->prototype('scalar')->end()
                            ->end()
                            ->arrayNode('ignore')
                                ->prototype('scalar')->end()
                            ->end()
                        ->end()
                    ->end()
                ->end()
                ->arrayNode('servers')
                    ->performNoDeepMerging()
                    ->defaultValue(array(
                        'localhost' =>  array(
                            'host'  =>  '127.0.0.1',
                            'port'  =>  '4730',
                        ),
                    ))
                    ->prototype('array')
                        ->children()
                            ->scalarNode('host')
                                ->isRequired()
                                ->cannotBeEmpty()
                            ->end()
                            ->integerNode('port')
                                ->defaultValue('4730')
                            ->end()
                        ->end()
                    ->end()
                ->end()
                ->arrayNode('defaults')
                    ->addDefaultsIfNotSet()
                    ->children()
                        ->integerNode('iterations')
                            ->min(0)
                            ->defaultValue(0)
                        ->end()
                        ->scalarNode('method')
                            ->defaultValue('doNormal')
                        ->end()
                        ->booleanNode('callbacks')
                            ->defaultTrue()
                        ->end()
                        ->scalarNode('job_prefix')
                            ->defaultNull()
                        ->end()
                        ->booleanNode('generate_unique_key')
                            ->defaultTrue()
                        ->end()
                        ->booleanNode('workers_name_prepend_namespace')
                            ->defaultTrue()
                        ->end()
                        ->integerNode('minimum_execution_time')
                            ->min(0)
                            ->defaultValue(0)
                        ->end()
                        ->integerNode('timeout')
                            ->min(0)
                            ->defaultValue(0)
                        ->end()
                    ->end()
                ->end()
            ->end();

        return $treeBuilder;
    }
}


text:
package me.codeboy.common.base.task;

import me.codeboy.common.base.task.impl.ICBTask;
import me.codeboy.common.base.task.listener.CBTaskListener;

/**
 * 任务
 * Created by yuedong.li  on 1/18/16.
 */
abstract public class CBTask extends Thread implements ICBTask {
    private volatile boolean stopSign = false;
    private volatile boolean finished = false;
    private CBTaskListener listener;

    @Override
    public void startTask() {
        if (listener != null) {
            listener.onTaskStart();
        }
        this.start();
    }

    @Override
    public void stopTask() {
        stopSign = true;
        interrupt();
    }

    @Override
    public boolean isTaskFinished() {
        return finished;
    }

    @Override
    public void setTaskListener(CBTaskListener listener) {
        this.listener = listener;
    }

    @Override
    public void run() {
        task(stopSign);
        finished = true;
        if (listener != null) {
            listener.onTaskEnd();
        }
    }

    /**
     * 任务
     *
     * @param stopSign 结束标识符,任务执行流程应依赖于该标识,如果为true,代表任务需要被结束
     */
    public abstract void task(boolean stopSign);

    @Override
    public void waitForEnd() throws InterruptedException {
        if(!finished) {
            this.join();
        }
    }
}


text:
package com.swfarm.biz.chain.dao;

import com.swfarm.biz.chain.bo.CustomerServiceKpiSheet;
import com.swfarm.pub.framework.dao.GenericDao;

/**
 *
 * @author John
 *
 */
public interface CustomerServiceKpiSheetDao extends GenericDao<CustomerServiceKpiSheet, Long> {
}