text:
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var _constants = require("./constants");

var _renderer = require("./renderer");

var _renderer2 = _interopRequireDefault(_renderer);

var _ = require("underscore");

// Lexes and pipes tokens to the inline renderer

var InlineLexer = (function () {
  function InlineLexer(links, options) {
    _classCallCheck(this, InlineLexer);

    this.options = options;
    this.links = links;
    this.rules = _constants.inline.normal;
    this.attributeSet = null;
    this.prevAttributeSet = null;
    this.renderer = new _renderer2["default"]();

    if (!this.links) throw new Error("Tokens array requires a `links` property.");
  }

  _createClass(InlineLexer, [{
    key: "output",

    // lex and send tokens to the renderer
    value: function output(src) {
      var cap = undefined,
          link = undefined,
          text = undefined,
          href = undefined,
          out = "";

      while (src) {
        // Clear the attributes unless the last thing was an attribute
        if (!this.prevAttributeSet) this.attributeSet = null;
        this.prevAttributeSet = null;

        // escape
        if (cap = this.rules.escape.exec(src)) {
          src = src.substring(cap[0].length);
          out += cap[1];
          continue;
        }

        // autolink
        if (cap = this.rules.autolink.exec(src)) {
          src = src.substring(cap[0].length);
          if (cap[2] === "@") {
            text = cap[1].charAt(6) === ":" ? cap[1].substring(7) : cap[1];
            href = "mailto:" + text;
          } else {
            text = (0, _constants.escape)(cap[1]);
            href = text;
          }
          out += this.renderer.link(href, null, text, this.attributeSet && this.attributeSet.length && this.attributeSet.shift().attributes);
          continue;
        }

        // attributes
        if (this.rules.attribute.inlineGroup.exec(src)) {
          this.attributeSet = [];
          while (cap = this.rules.attribute.inlineGroup.exec(src)) {
            // Since there could be text before the match (middle of a paragraph)
            // we need to cut the attributes out.
            var index = src.search(this.rules.attribute.inlineGroup);
            var _length = cap[0].length;

            // Cut out the attributes
            src = _.string.splice(src, index, cap[0].length);

            // Go through the k/v pairs in between the {} and push them into an
            // attributeSet
            var attributes = [];
            var pair = undefined;
            while ((pair = _.compact(this.rules.attribute.value.exec(cap[0]))).length) {
              attributes.push({ key: pair[1], value: pair[2] });
            }
            this.attributeSet.push({ attributes: attributes, index: index });
            this.prevAttributeSet = true;
          }
          continue;
        }

        // url (gfm)
        if (!this.inLink && (cap = this.rules.url.exec(src))) {
          src = src.substring(cap[0].length);
          text = (0, _constants.escape)(cap[1]);
          href = text;
          out += this.renderer.link(href, null, text, this.attributeSet && this.attributeSet.length && this.attributeSet.shift().attributes);
          continue;
        }

        // link
        if (cap = this.rules.link.exec(src)) {
          src = src.substring(cap[0].length);
          this.inLink = true;
          out += this.outputLink(cap, {
            href: cap[2],
            title: cap[3]
          });
          this.inLink = false;
          continue;
        }

        // reflink, nolink
        if ((cap = this.rules.reflink.exec(src)) || (cap = this.rules.nolink.exec(src))) {
          src = src.substring(cap[0].length);
          link = (cap[2] || cap[1]).replace(/\s+/g, " ");
          link = this.links[link.toLowerCase()];
          if (!link || !link.href) {
            out += cap[0].charAt(0);
            src = cap[0].substring(1) + src;
            continue;
          }
          this.inLink = true;
          out += this.outputLink(cap, link);
          this.inLink = false;
          continue;
        }

        // strong
        if (cap = this.rules.strong.exec(src)) {
          src = src.substring(cap[0].length);
          out += this.renderer.strong(this.output(cap[2] || cap[1]), this.attributeSet && this.attributeSet.length && this.attributeSet.shift().attributes);
          continue;
        }

        // em
        if (cap = this.rules.em.exec(src)) {
          src = src.substring(cap[0].length);
          out += this.renderer.em(this.output(cap[2] || cap[1]), this.attributeSet && this.attributeSet.length && this.attributeSet.shift().attributes);
          continue;
        }

        // code
        if (cap = this.rules.code.exec(src)) {
          src = src.substring(cap[0].length);
          out += this.renderer.codespan((0, _constants.escape)(cap[2], true), this.attributeSet && this.attributeSet.length && this.attributeSet.shift().attributes);
          continue;
        }

        // br
        if (cap = this.rules.br.exec(src)) {
          src = src.substring(cap[0].length);
          out += this.renderer.br();
          continue;
        }

        // del (gfm)
        if (cap = this.rules.del.exec(src)) {
          src = src.substring(cap[0].length);
          out += this.renderer.del(this.output(cap[1]), this.attributeSet && this.attributeSet.length && this.attributeSet.shift().attributes);
          continue;
        }

        // text
        if (cap = this.rules.text.exec(src)) {
          if (this.attributeSet && this.attributeSet.length) {
            var set = undefined,
                captureString = cap[0];
            // We have found an attribute set in the text.  This means that
            // we should create a span and attach the attributes to that span.
            //
            // Example
            // input:
            //    This is paragraph text { foo: bar } something.
            // output:
            //
This is paragraph text something.

            while (set = this.attributeSet.shift()) {
              var beforeAttrs = captureString.substr(0, set.index);
              var afterAttrs = captureString.substr(set.index);

              if (afterAttrs.length) {
                // We have things that come after the attribute
                // Wrap it in a span and add the attributes to that span.
                // get the word after the attribute
                var nextWord = afterAttrs.substr(0, afterAttrs.indexOf(" "));

                out += (0, _constants.escape)(this.smartypants(beforeAttrs));
                out += this.renderer.span((0, _constants.escape)(this.smartypants(nextWord)), set.attributes);
                src = src.substring(beforeAttrs.length + nextWord.length);
                captureString = captureString.substring(beforeAttrs.length + nextWord.length);
              } else {
                out += this.renderer.span((0, _constants.escape)(this.smartypants(beforeAttrs)), set.attributes);
                src = src.substring(beforeAttrs.length);
                captureString = captureString.substring(beforeAttrs.length);
              }
            }
          } else {
            out += (0, _constants.escape)(this.smartypants(cap[0]));
            src = src.substring(cap[0].length);
          }
          continue;
        }

        if (src) {
          throw new Error("Infinite loop on byte: " + src.charCodeAt(0));
        }
      }

      // We have attributes that we have to put on the previous element
      if (this.attributeSet && this.attributeSet.length) throw new Error("need to attach attrs to the previous element, we have left-over non-applied attributes");
      return out;
    }
  }, {
    key: "outputLink",

    // Compile a link or Image
    value: function outputLink(cap, link) {
      var href = (0, _constants.escape)(link.href),
          title = link.title ? (0, _constants.escape)(link.title) : null;

      return cap[0].charAt(0) !== "!" ? this.renderer.link(href, title, this.output(cap[1]), this.attributeSet && this.attributeSet.length && this.attributeSet.shift().attributes) : this.renderer.image(href, title, (0, _constants.escape)(cap[1]), this.attributeSet && this.attributeSet.length && this.attributeSet.shift().attributes);
    }
  }, {
    key: "smartypants",

    // Turn dashes and stuff into special characters
    // -- SmartyPants
    value: function smartypants(text) {
      return text
      // em-dashes
      .replace(/--/g, "—")
      // opening singles
      .replace(/(^|[-\u2014/(\[{"\s])'/g, "$1'")
      // closing singles & apostrophes
      .replace(/'/g, "'")
      // opening doubles
      .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1"")
      // closing doubles
      .replace(/"/g, """)
      // ellipses
      .replace(/\.{3}/g, "…");
    }
  }], [{
    key: "output",

    // Exposed output function
    value: function output(src, links, options) {
      return new InlineLexer(links, options).output(src);
    }
  }]);

  return InlineLexer;
})();

// Expose rules
InlineLexer.rules = _constants.inline;

exports["default"] = InlineLexer;
module.exports = exports["default"];


text:
<?xml version = '1.0' encoding = 'UTF-8'?>
<TableProxyOraclev11g class="oracle.dbtools.crest.model.design.storage.oracle.v11g.TableProxyOraclev11g" name="HAS_SYMPTOM" directorySegmentName="seg_0" id="12C702C7-683A-0B42-B43F-06ED7597F23B">
<createdBy>ali</createdBy>
<createdTime>2016-04-11 21:11:32 UTC</createdTime>
<ownerDesignName>CDM</ownerDesignName>
<schemaObject>1BDDDB71-E132-5384-9C40-40F410BEADCF</schemaObject>
<logging>YES</logging>
<partitionedRowMovement>DISABLE</partitionedRowMovement>
<segment>CCECCEE0-B4DE-0921-6597-E105DD13A604</segment>
<tableSpace>F5DDBBF6-5836-969A-E8FD-2176B7B3EFC9</tableSpace>
<temporaryChanged>false</temporaryChanged>
<accessDriverType>oracle_loader</accessDriverType>
<rejectLimit></rejectLimit>
<columnProxies itemClass="oracle.dbtools.crest.model.design.storage.oracle.v12c.ColumnProxyOraclev12c">
<ColumnProxy name="START_DATE" id="19002CEE-5A86-D273-7730-0793C109EF99">
<createdBy>ali</createdBy>
<createdTime>2016-04-11 21:11:32 UTC</createdTime>
<ownerDesignName>CDM</ownerDesignName>
</ColumnProxy>
<ColumnProxy name="VST_ID" id="2682349D-413E-BAB1-5E1B-C6138DB257AE">
<createdBy>ali</createdBy>
<createdTime>2016-04-11 21:11:32 UTC</createdTime>
<ownerDesignName>CDM</ownerDesignName>
</ColumnProxy>
<ColumnProxy name="SEVERITY" id="3998D524-1038-7AF9-E4A2-CB679E8E40BE">
<createdBy>ali</createdBy>
<createdTime>2016-04-11 21:11:32 UTC</createdTime>
<ownerDesignName>CDM</ownerDesignName>
</ColumnProxy>
<ColumnProxy name="SMPTM_ID" id="4289DAEA-1547-DA8C-72E1-42C715D161BB">
<createdBy>ali</createdBy>
<createdTime>2016-04-11 21:11:32 UTC</createdTime>
<ownerDesignName>CDM</ownerDesignName>
</ColumnProxy>
<ColumnProxy name="REPETATION" id="53348F66-1F1B-A2F4-4476-77C9A905BAF1">
<createdBy>ali</createdBy>
<createdTime>2016-04-11 21:11:32 UTC</createdTime>
<ownerDesignName>CDM</ownerDesignName>
</ColumnProxy>
<ColumnProxy name="NOTES" id="A85F51C8-4395-4BB9-3681-6BC0D2B96250">
<createdBy>ali</createdBy>
<createdTime>2016-04-11 21:11:32 UTC</createdTime>
<ownerDesignName>CDM</ownerDesignName>
</ColumnProxy>
</columnProxies>
<foreignKeys>
<ForeignKey class="oracle.dbtools.crest.model.design.storage.oracle.v10g.FKProxyOraclev10g" name="FK_HAS_SYMPTOM_SMPTM_ID" id="88746B89-074C-41E9-BB8A-677F6C9F7E20">
<createdBy>ali</createdBy>
<createdTime>2016-04-11 21:11:33 UTC</createdTime>
<ownerDesignName>CDM</ownerDesignName>
</ForeignKey>
<ForeignKey class="oracle.dbtools.crest.model.design.storage.oracle.v10g.FKProxyOraclev10g" name="FK_HAS_SYMPTOM_VST_ID" id="C1999210-45EA-85DB-2C01-8A94B825DDD0">
<createdBy>ali</createdBy>
<createdTime>2016-04-11 21:11:33 UTC</createdTime>
<ownerDesignName>CDM</ownerDesignName>
</ForeignKey>
</foreignKeys>
<primaryKeys>
<PrimaryKey class="oracle.dbtools.crest.model.design.storage.oracle.v10g.PKProxyOraclev10g" name="HAS_SYMPTOM_PK" id="3FC0085A-E0D9-DFB7-6D6D-15ABB8A66FBC">
<createdBy>ali</createdBy>
<createdTime>2016-04-11 21:11:33 UTC</createdTime>
<ownerDesignName>CDM</ownerDesignName>
<schemaObject>1BDDDB71-E132-5384-9C40-40F410BEADCF</schemaObject>
<segment>DEACDE3B-5A6A-E161-715E-EBBE3FEBCBF4</segment>
<tableSpace>F5DDBBF6-5836-969A-E8FD-2176B7B3EFC9</tableSpace>
<indexSegment>DEACDE3B-5A6A-E161-715E-EBBE3FEBCBF4</indexSegment>
<indexSort>SORTED</indexSort>
<usingIndex>BY INDEX NAME</usingIndex>
</PrimaryKey>
</primaryKeys>
</TableProxyOraclev11g>

redpajama_set_name: RedPajamaGithub


text:
package com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.instancegroup.template;

import java.util.HashSet;
import java.util.Set;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.InstanceTemplateV4Base;
import com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.instancegroup.template.volume.RootVolumeV4Request;
import com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.instancegroup.template.volume.VolumeV4Request;
import com.sequenceiq.cloudbreak.common.type.TemporaryStorage;

import io.swagger.annotations.ApiModel;

@ApiModel
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(Include.NON_NULL)
public class InstanceTemplateV4Request extends InstanceTemplateV4Base {

    private RootVolumeV4Request rootVolume;

    private VolumeV4Request ephemeralVolume;

    private Set<VolumeV4Request> attachedVolumes;

    private TemporaryStorage temporaryStorage;

    public RootVolumeV4Request getRootVolume() {
        return rootVolume;
    }

    public void setRootVolume(RootVolumeV4Request rootVolume) {
        this.rootVolume = rootVolume;
    }

    public VolumeV4Request getEphemeralVolume() {
        return ephemeralVolume;
    }

    public void setEphemeralVolume(VolumeV4Request ephemeralVolume) {
        this.ephemeralVolume = ephemeralVolume;
    }

    public Set<VolumeV4Request> getAttachedVolumes() {
        if (attachedVolumes == null) {
            return new HashSet<>();
        }
        return attachedVolumes;
    }

    public void setAttachedVolumes(Set<VolumeV4Request> attachedVolumes) {
        this.attachedVolumes = attachedVolumes;
    }

    public TemporaryStorage getTemporaryStorage() {
        return temporaryStorage;
    }

    public void setTemporaryStorage(TemporaryStorage temporaryStorage) {
        this.temporaryStorage = temporaryStorage;
    }
}


text:
module.exports = function(grunt) {

    grunt.initConfig({
        openui5_preload: {
            library: {
                options: {
                    resources: 'src',
                    dest: 'dist'
                },
                libraries: 'incentergy/model'
            }
        }
    });
    grunt.loadNpmTasks('grunt-openui5');
    grunt.registerTask('default', ['openui5_preload']);

};


text:
package pflag

import (
	"fmt"
	"strconv"
	"strings"
)

// -- intSlice Value
type intSliceValue struct {
	value   *[]int
	changed bool
}

func newIntSliceValue(val []int, p *[]int) *intSliceValue {
	isv := new(intSliceValue)
	isv.value = p
	*isv.value = val
	return isv
}

func (s *intSliceValue) Set(val string) error {
	ss := strings.Split(val, ",")
	out := make([]int, len(ss))
	for i, d := range ss {
		var err error
		out[i], err = strconv.Atoi(d)
		if err != nil {
			return err
		}

	}
	if !s.changed {
		*s.value = out
	} else {
		*s.value = append(*s.value, out...)
	}
	s.changed = true
	return nil
}

func (s *intSliceValue) Type() string {
	return "intSlice"
}

func (s *intSliceValue) String() string {
	out := make([]string, len(*s.value))
	for i, d := range *s.value {
		out[i] = fmt.Sprintf("%d", d)
	}
	return "[" + strings.Join(out, ",") + "]"
}

func intSliceConv(val string) (interface{}, error) {
	val = strings.Trim(val, "[]")
	// Empty string would cause a slice with one (empty) entry
	if len(val) == 0 {
		return []int{}, nil
	}
	ss := strings.Split(val, ",")
	out := make([]int, len(ss))
	for i, d := range ss {
		var err error
		out[i], err = strconv.Atoi(d)
		if err != nil {
			return nil, err
		}

	}
	return out, nil
}

// GetIntSlice return the []int value of a flag with the given name
func (f *FlagSet) GetIntSlice(name string) ([]int, error) {
	val, err := f.getFlagType(name, "intSlice", intSliceConv)
	if err != nil {
		return []int{}, err
	}
	return val.([]int), nil
}

// IntSliceVar defines a intSlice flag with specified name, default value, and usage string.
// The argument p points to a []int variable in which to store the value of the flag.
func (f *FlagSet) IntSliceVar(p *[]int, name string, value []int, usage string) {
	f.VarP(newIntSliceValue(value, p), name, "", usage)
}

// IntSliceVarP is like IntSliceVar, but accepts a shorthand letter that can be used after a single dash.
func (f *FlagSet) IntSliceVarP(p *[]int, name, shorthand string, value []int, usage string) {
	f.VarP(newIntSliceValue(value, p), name, shorthand, usage)
}

// IntSliceVar defines a int[] flag with specified name, default value, and usage string.
// The argument p points to a int[] variable in which to store the value of the flag.
func IntSliceVar(p *[]int, name string, value []int, usage string) {
	CommandLine.VarP(newIntSliceValue(value, p), name, "", usage)
}

// IntSliceVarP is like IntSliceVar, but accepts a shorthand letter that can be used after a single dash.
func IntSliceVarP(p *[]int, name, shorthand string, value []int, usage string) {
	CommandLine.VarP(newIntSliceValue(value, p), name, shorthand, usage)
}

// IntSlice defines a []int flag with specified name, default value, and usage string.
// The return value is the address of a []int variable that stores the value of the flag.
func (f *FlagSet) IntSlice(name string, value []int, usage string) *[]int {
	p := []int{}
	f.IntSliceVarP(&p, name, "", value, usage)
	return &p
}

// IntSliceP is like IntSlice, but accepts a shorthand letter that can be used after a single dash.
func (f *FlagSet) IntSliceP(name, shorthand string, value []int, usage string) *[]int {
	p := []int{}
	f.IntSliceVarP(&p, name, shorthand, value, usage)
	return &p
}

// IntSlice defines a []int flag with specified name, default value, and usage string.
// The return value is the address of a []int variable that stores the value of the flag.
func IntSlice(name string, value []int, usage string) *[]int {
	return CommandLine.IntSliceP(name, "", value, usage)
}

// IntSliceP is like IntSlice, but accepts a shorthand letter that can be used after a single dash.
func IntSliceP(name, shorthand string, value []int, usage string) *[]int {
	return CommandLine.IntSliceP(name, shorthand, value, usage)
}


text:
package nats

import (
	"encoding/json"
	"io"
	"net/http"
	"net/url"
	"path"
	"time"

	gnatsd "github.com/nats-io/nats-server/v2/server"

	"github.com/influxdata/telegraf"
	"github.com/influxdata/telegraf/config"
	"github.com/influxdata/telegraf/plugins/inputs"
)

type Nats struct {
	Server          string
	ResponseTimeout config.Duration

	client *http.Client
}

func (n *Nats) Gather(acc telegraf.Accumulator) error {
	address, err := url.Parse(n.Server)
	if err != nil {
		return err
	}
	address.Path = path.Join(address.Path, "varz")

	if n.client == nil {
		n.client = n.createHTTPClient()
	}
	resp, err := n.client.Get(address.String())
	if err != nil {
		return err
	}
	defer resp.Body.Close()

	bytes, err := io.ReadAll(resp.Body)
	if err != nil {
		return err
	}

	stats := new(gnatsd.Varz)
	err = json.Unmarshal(bytes, &stats)
	if err != nil {
		return err
	}

	acc.AddFields("nats",
		map[string]interface{}{
			"in_msgs":           stats.InMsgs,
			"out_msgs":          stats.OutMsgs,
			"in_bytes":          stats.InBytes,
			"out_bytes":         stats.OutBytes,
			"uptime":            stats.Now.Sub(stats.Start).Nanoseconds(),
			"cores":             stats.Cores,
			"cpu":               stats.CPU,
			"mem":               stats.Mem,
			"connections":       stats.Connections,
			"total_connections": stats.TotalConnections,
			"subscriptions":     stats.Subscriptions,
			"slow_consumers":    stats.SlowConsumers,
			"routes":            stats.Routes,
			"remotes":           stats.Remotes,
		},
		map[string]string{"server": n.Server},
		time.Now())

	return nil
}

func (n *Nats) createHTTPClient() *http.Client {
	transport := &http.Transport{
		Proxy: http.ProxyFromEnvironment,
	}
	timeout := time.Duration(n.ResponseTimeout)
	if timeout == time.Duration(0) {
		timeout = 5 * time.Second
	}
	return &http.Client{
		Transport: transport,
		Timeout:   timeout,
	}
}

func init() {
	inputs.Add("nats", func() telegraf.Input {
		return &Nats{
			Server: "http://localhost:8222",
		}
	})
}


text:
<?php
/**
 * Auto generated from riak_yokozuna.proto at 2016-09-24 09:49:42
 *
 * Basho\Riak\Api\Pb\Message package
 */

namespace Basho\Riak\Api\Pb\Message {
/**
 * RpbYokozunaIndexDeleteReq message
 */
class RpbYokozunaIndexDeleteReq extends \ProtobufMessage
{
    /* Field index constants */
    const NAME = 1;

    /* @var array Field descriptors */
    protected static $fields = array(
        self::NAME => array(
            'name' => 'name',
            'required' => true,
            'type' => 7,
        ),
    );

    /**
     * Constructs new message container and clears its internal state
     *
     * @return null
     */
    public function __construct()
    {
        $this->reset();
    }

    /**
     * Clears message values and sets default ones
     *
     * @return null
     */
    public function reset()
    {
        $this->values[self::NAME] = null;
    }

    /**
     * Returns field descriptors
     *
     * @return array
     */
    public function fields()
    {
        return self::$fields;
    }

    /**
     * Sets value of 'name' property
     *
     * @param string $value Property value
     *
     * @return null
     */
    public function setName($value)
    {
        return $this->set(self::NAME, $value);
    }

    /**
     * Returns value of 'name' property
     *
     * @return string
     */
    public function getName()
    {
        return $this->get(self::NAME);
    }
}
}


text:
import sys, os, commands, string, commands

# basic debugging trace support
# call D_setlevel to set the verbosity level
# and D(), D2(), D3(), D4() to add traces
#
verbose = 0

def panic(msg):
    sys.stderr.write( find_program_name() + ": error: " )
    sys.stderr.write( msg )
    sys.exit(1)

def D(msg):
    global verbose
    if verbose > 0:
        print msg

def D2(msg):
    global verbose
    if verbose >= 2:
        print msg

def D3(msg):
    global verbose
    if verbose >= 3:
        print msg

def D4(msg):
    global verbose
    if verbose >= 4:
        print msg

def D_setlevel(level):
    global verbose
    verbose = level

#  other stuff
#
#
def find_program_name():
    return os.path.basename(sys.argv[0])

def find_program_dir():
    return os.path.dirname(sys.argv[0])

class StringOutput:
    def __init__(self):
        self.line = ""

    def write(self,msg):
        self.line += msg
        D2("write '%s'" % msg)

    def get(self):
        return self.line

def create_file_path(path):
    dirs = []
    while 1:
        parent = os.path.dirname(path)
        #print "parent: %s <- %s" % (parent, path)
        if parent == "/" or parent == "":
            break
        dirs.append(parent)
        path = parent

    dirs.reverse()
    for dir in dirs:
        #print "dir %s" % dir
        if os.path.isdir(dir):
            continue
        os.mkdir(dir)

def walk_source_files(paths,callback,args,excludes=[]):
    """recursively walk a list of paths and files, only keeping the source files in directories"""
    for path in paths:
        if len(path) > 0 and path[0] == '@':
            # this is the name of another file, include it and parse it
            path = path[1:]
            if os.path.exists(path):
                for line in open(path):
                    if len(line) > 0 and line[-1] == '\n':
                        line = line[:-1]
                    walk_source_files([line],callback,args,excludes)
            continue
        if not os.path.isdir(path):
            callback(path,args)
        else:
            for root, dirs, files in os.walk(path):
                #print "w-- %s (ex: %s)" % (repr((root,dirs)), repr(excludes))
                if len(excludes):
                    for d in dirs[:]:
                        if os.path.join(root,d) in excludes:
                            dirs.remove(d)
                for f in files:
                    r, ext = os.path.splitext(f)
                    if ext in [ ".h", ".c", ".cpp", ".S" ]:
                        callback( "%s/%s" % (root,f), args )

def cleanup_dir(path):
    """create a directory if needed, and ensure that it is totally empty
       by removing any existing content in it"""
    if not os.path.exists(path):
        os.mkdir(path)
    else:
        for root, dirs, files in os.walk(path, topdown=False):
            if root.endswith("kernel_headers/"):
                # skip 'kernel_headers'
                continue
            for name in files:
                os.remove(os.path.join(root, name))
            for name in dirs:
                os.rmdir(os.path.join(root, name))

class BatchFileUpdater:
    """a class used to edit several files at once"""
    def __init__(self):
        self.old_files = set()
        self.new_files = set()
        self.new_data  = {}

    def readFile(self,path):
        #path = os.path.realpath(path)
        if os.path.exists(path):
            self.old_files.add(path)

    def readDir(self,path):
        #path = os.path.realpath(path)
        for root, dirs, files in os.walk(path):
            for f in files:
                dst = "%s/%s" % (root,f)
                self.old_files.add(dst)

    def editFile(self,dst,data):
        """edit a destination file. if the file is not mapped from a source,
           it will be added. return 0 if the file content wasn't changed,
           1 if it was edited, or 2 if the file is new"""
        #dst = os.path.realpath(dst)
        result = 1
        if os.path.exists(dst):
            f = open(dst, "r")
            olddata = f.read()
            f.close()
            if olddata == data:
                self.old_files.remove(dst)
                return 0
        else:
            result = 2

        self.new_data[dst] = data
        self.new_files.add(dst)
        return result

    def getChanges(self):
        """determine changes, returns (adds, deletes, edits)"""
        adds    = set()
        edits   = set()
        deletes = set()

        for dst in self.new_files:
            if not (dst in self.old_files):
                adds.add(dst)
            else:
                edits.add(dst)

        for dst in self.old_files:
            if not dst in self.new_files:
                deletes.add(dst)

        return (adds, deletes, edits)

    def _writeFile(self,dst):
        if not os.path.exists(os.path.dirname(dst)):
            create_file_path(dst)
        f = open(dst, "w")
        f.write(self.new_data[dst])
        f.close()

    def updateFiles(self):
        adds, deletes, edits = self.getChanges()

        for dst in sorted(adds):
            self._writeFile(dst)

        for dst in sorted(edits):
            self._writeFile(dst)

        for dst in sorted(deletes):
            os.remove(dst)

    def updateGitFiles(self):
        adds, deletes, edits = self.getChanges()

        if adds:
            for dst in sorted(adds):
                self._writeFile(dst)
            commands.getoutput("git add " + " ".join(adds))

        if deletes:
            commands.getoutput("git rm " + " ".join(deletes))

        if edits:
            for dst in sorted(edits):
                self._writeFile(dst)
            commands.getoutput("git add " + " ".join(edits))


text:
<title>OGRE: OgreRenderQueueListener.h Source File - OGRE Documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link type="text/css" rel="stylesheet" href="doxygen.css">
<link type="text/css" rel="stylesheet" href="tabs.css">

Main Page

Related Pages

Modules

Namespaces

Classes

Files

Directories

File List

File Members

OgreMain » include

OgreRenderQueueListener.h
Go to the documentation of this file.

00001
00028 #ifndef __RenderQueueListener_H__
00029 #define __RenderQueueListener_H__
00030
00031 #include "OgrePrerequisites.h"
00032 #include "OgreRenderQueue.h"
00033
00034 namespace Ogre {
00035
00056     class _OgreExport RenderQueueListener
00057     {
00058     public:
00059         virtual ~RenderQueueListener() {}
00060
00063         virtual void preRenderQueues() {}
00066         virtual void postRenderQueues() {}
00067
00080         virtual void renderQueueStarted(uint8 queueGroupId, const String& invocation,
00081             bool& skipThisInvocation)
00082         { (void)queueGroupId; (void)invocation; (void)skipThisInvocation; }
00083
00096         virtual void renderQueueEnded(uint8 queueGroupId, const String& invocation,
00097             bool& repeatThisInvocation)
00098         { (void)queueGroupId; (void)invocation; (void)repeatThisInvocation; }
00099     };
00103 }
00104
00105 #endif
00106

Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

Last modified Sun Sep 2 08:16:08 2012


text:
importAutomationScript('/pointerevents/pointerevent_common_input.js');

function inject_input() {
  return touchScrollInTarget('#target0', 'down');
}


text:
<?php

namespace PHPExiftool\Driver\Tag\MOBI;

use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;

/**
 * @ExclusionPolicy("all")
 */
class LastUpdateTime extends AbstractTag
{

    protected $Id = 502;

    protected $Name = 'LastUpdateTime';

    protected $FullName = 'Palm::EXTH';

    protected $GroupName = 'MOBI';

    protected $g0 = 'Palm';

    protected $g1 = 'MOBI';

    protected $g2 = 'Document';

    protected $Type = 'string';

    protected $Writable = false;

    protected $Description = 'Last Update Time';
}


text:
Do you want a FabLab at the UTT?

- Yes
- No

# Multiple choices

What should be the authorized beverages at the UTT?

- Water
- Orange Juice
- Red Bull
- Vodka
- Wiskey

# Multiple choices ranked

Who should be president of the UTT?

- Martin Dupont
- Oprah Something
- Yuan Han
- Louis XIV


text:
using namespace std;
using namespace IStrategizer;

DECL_SERIALIZABLE(And);

bool And::Evaluate(RtsGame& game)
{
    if(_shortCircuit)
    {
        for(vector<Expression*>::iterator itr = _expressions.begin();
            itr != _expressions.end();
            itr++)
        {
            (*itr)->Evaluate(game);
            _isEvaluated = (*itr)->IsEvaluated();
            _isSatisfied = (*itr)->IsSatisfied();

            //short circuit
            if(!_isEvaluated || !_isSatisfied)
            {
                break;
            }
        }
    }
    else
    {
        _isEvaluated = true;
        _isSatisfied = true;
        for(vector<Expression*>::iterator itr = _expressions.begin();
            itr != _expressions.end();
            itr++)
        {
            (*itr)->Evaluate(game);
            _isEvaluated    &= (*itr)->IsEvaluated();
            _isSatisfied    &= (*itr)->IsSatisfied();
        }
    }

    return _isSatisfied && _isEvaluated;
}


text:
package com.twitter.finagle.stats

import org.junit.runner.RunWith
import org.scalacheck.Gen
import org.scalatest.prop.GeneratorDrivenPropertyChecks
import org.scalatest.{Matchers, FunSuite}
import org.scalatest.junit.JUnitRunner

@RunWith(classOf[JUnitRunner])
class BucketedHistogramTest extends FunSuite with GeneratorDrivenPropertyChecks with Matchers {
  test("constructor limits cannot be empty") {
    intercept[IllegalArgumentException] { new BucketedHistogram(new Array[Int](0)) }
  }

  test("constructor limits cannot have negative values") {
    intercept[IllegalArgumentException] { new BucketedHistogram(Array[Int](-1)) }
  }

  test("constructor limits must be increasing in value") {
    intercept[IllegalArgumentException] { new BucketedHistogram(Array[Int](0, 0)) }
  }

  test("percentile when empty") {
    val h = BucketedHistogram()
    assert(h.percentile(0.0) == 0)
    assert(h.percentile(0.5) == 0)
    assert(h.percentile(1.0) == 0)
  }

  private def assertWithinError(ideal: Long, actual: Long): Unit = {
    val epsilon = Math.round(ideal * BucketedHistogram.DefaultErrorPercent)
    if (epsilon == 0) {
      assert(actual == ideal)
    } else {
      actual should be(ideal +- epsilon)
    }
  }

  test("percentile 1 to 100000") {
    val h = BucketedHistogram()
    val wantedPs = Array[Double](0.0, 0.5, 0.9, 0.99, 0.999, 0.9999, 1.0)

    def assertPercentiles(maxVal: Long): Unit = {
      val actuals = h.getQuantiles(wantedPs)
      actuals.zip(wantedPs).foreach {
        case (actual, wantedP) =>
          withClue(s"percentile=$wantedP") {
            // verify that each percentile is within the error bounds.
            val ideal = Math.round(wantedP * maxVal)
            assertWithinError(ideal, actual)

            // verify that getting each percentile 1-at-a-time
            // is the same as the bulk call
            assert(h.percentile(wantedP) == actual)
          }
      }
    }

    1L.to(100L).foreach(h.add)
    assertPercentiles(100)

    101L.to(1000L).foreach(h.add)
    assertPercentiles(1000)

    1001L.to(10000L).foreach(h.add)
    assertPercentiles(10000)

    10001L.to(100000L).foreach(h.add)
    assertPercentiles(100000)
  }

  test("percentile edge cases") {
    val max = BucketedHistogram()
    max.add(Long.MaxValue)
    assert(max.percentile(0.1) == 0)
    assert(max.percentile(1.0) == Int.MaxValue)

    val zero = BucketedHistogram()
    zero.add(0)
    assert(zero.percentile(0.0) == 0)
    assert(zero.percentile(0.1) == 0)
    assert(zero.percentile(1.0) == 0)
  }

  test("clear") {
    val h = BucketedHistogram()
    assert(h.percentile(0.0) == 0)
    assert(h.percentile(0.5) == 0)
    assert(h.percentile(1.0) == 0)

    h.add(100)
    assert(h.percentile(0.0) == 0)
    assert(h.percentile(0.5) == 100)
    assert(h.percentile(1.0) == 100)

    h.clear()
    assert(h.percentile(0.0) == 0)
    assert(h.percentile(0.5) == 0)
    assert(h.percentile(1.0) == 0)
  }

  test("sum") {
    val h = BucketedHistogram()
    assert(h.sum == 0)

    h.add(100)
    h.add(200)
    assert(h.sum == 300)

    h.clear()
    assert(h.sum == 0)
  }

  test("count") {
    val h = BucketedHistogram()
    assert(h.count == 0)

    h.add(100)
    h.add(200)
    assert(h.count == 2)

    h.clear()
    assert(h.count == 0)
  }

  test("average") {
    val h = BucketedHistogram()
    assert(h.average == 0.0)

    h.add(100)
    h.add(200)
    assert(h.average == 150.0)

    h.clear()
    assert(h.average == 0)
  }

  test("outliers are handled") {
    val h = BucketedHistogram()
    h.add(2137204091L)
    h.add(-1)
    h.add(Long.MinValue)
    h.add(Long.MaxValue)
  }

  test("exporting counts starts empty") {
    val h = BucketedHistogram()
    assert(h.bucketAndCounts == Seq.empty)
  }

  test("exporting counts tracks negative and extreme values") {
    val h = BucketedHistogram()
    h.add(-1)
    h.add(0)
    h.add(1)
    h.add(1)
    h.add(1)
    h.add(Int.MaxValue)
    h.add(Int.MaxValue)
    assert(
      h.bucketAndCounts == Seq(
        BucketAndCount(0, 1, 2),
        BucketAndCount(1, 2, 3),
        BucketAndCount(2137204091, Int.MaxValue, 2)
      )
    )
  }

  test("exporting counts responds to clear") {
    val h = BucketedHistogram()
    h.add(-1)
    h.add(0)
    h.add(1)
    h.add(5)
    h.add(Int.MaxValue)
    h.clear()
    assert(h.bucketAndCounts == Seq.empty)
  }

  test("percentile and min and max stays within error bounds") {
    forAll(BucketedHistogramTest.generator) {
      case (samples: List[Int], p: Double) =>
        // although this uses Gen.nonEmptyContainerOf I observed an empty List
        // generated. As an example, this failed with an NPE:
        //
        //      Occurred when passed generated values (
        //        arg0 = (List(),0.941512699565841) // 4 shrinks
        //
        // Also, observed negative values even with Gen.chooseNum constraint:
        //
        //      Occurred when passed generated values (
        //        arg0 = (List(-1),0.9370612091967268) // 33 shrinks
        //
        whenever(samples.nonEmpty && samples.forall(_ >= 0)) {
          val h = BucketedHistogram()
          samples.foreach { s =>
            h.add(s.toLong)
          }

          val sorted = samples.sorted.toIndexedSeq
          val index = (Math.round(sorted.size * p).toInt - 1).max(0)
          val ideal = sorted(index).toLong
          val actual = h.percentile(p)
          assertWithinError(ideal, actual)

          // check min and max too
          assertWithinError(sorted.head, h.minimum)
          assertWithinError(sorted.last, h.maximum)
        }
    }
  }

}

private object BucketedHistogramTest {

  def generator =
    for {
      samples <- Gen.nonEmptyContainerOf[List, Int](Gen.chooseNum(0, Int.MaxValue))
      percentile <- Gen.choose(0.5, 0.9999)
    } yield (samples, percentile)

}


text:
package com.google.javascript.jscomp;

import com.google.common.collect.Sets;
import com.google.javascript.jscomp.Scope.Var;

import java.util.Iterator;
import java.util.Set;

/**
 * Generates new variables names that would not collide with existing names in
 * a scope.
 *
 *
 */
class VariableNameGenerator {
  private final NameGenerator names;
  VariableNameGenerator(Scope scope) {
    Set<String> usedNames = Sets.newHashSet();
    for (Iterator<Var> i = scope.getVars(); i.hasNext();) {
      usedNames.add(i.next().getName());
    }
    names = new NameGenerator(usedNames, "", null);
  }

  String getNameNewName() {
    return names.generateNextName();
  }
}


text:
require 'recorder/config'
require 'recorder/version'

require 'recorder/changeset'
require 'recorder/store'
require 'recorder/manager'
require 'recorder/observer'

require 'recorder/rails/controller_concern'
require 'recorder/rails/railtie' if defined? ::Rails::Railtie

module Recorder
  class << self
    # Switches Recorder on or off.
    # @api public
    def enabled=(value)
      Recorder.config.enabled = value
    end

    # Returns `true` if Recorder is on, `false` otherwise.
    # Recorder is enabled by default.
    # @api public
    def enabled?
      !!Recorder.config.enabled
    end

    # Sets Recorder information from the controller.
    # @api public
    def info=(hash)
      store.params.merge!(hash)
    end

    # Sets Recorder meta information.
    # @api public
    def meta=(hash)
      store.params[:meta] = hash
    end

    # Returns a boolean indicating whether "protected attibutes" should be
    # configured, e.g. attr_accessible.
    def active_record_protected_attributes?
      @active_record_protected_attributes ||= !!defined?(ProtectedAttributes)
    end

    # Returns Recorder's configuration object.
    # @api private
    def config
      @config ||= Recorder::Config.instance
      yield @config if block_given?
      @config
    end

    # Thread-safe hash to hold Recorder's data.
    # @api private
    def store
      @store ||= Recorder::Store.new
    end

    # Returns version of Recorder as +String+
    def version
      VERSION::STRING
    end
  end
end

# if defined?(Sidekiq)
#   require 'recorder/sidekiq/revisions_worker'
# end

require 'recorder/revision'


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=UTF-8" />
    <title>demo – Project Information</title>

    <link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
    <meta name="Date-Revision-yyyymmdd" content="20151019" />
    <meta http-equiv="Content-Language" content="en" />

                demo

        Last Published: 2015-10-19
                   | Version: 0.0.1-SNAPSHOT

                    demo

Project Documentation

            Project Information

                          Dependencies

                          Dependency Information

                          Dependency Management

                          About

                          Project License

                          Plugin Management

                          Project Plugins

                          Project Team

                          Source Repository

                          Project Summary

Project Information

This document provides an overview of the various documents and links that are part of this project's general information. All of this content is automatically generated by Maven on behalf of the project.

Overview

Document
Description

Dependencies
This document lists the project's dependencies and provides information on each dependency.

Dependency Information
This document describes how to to include this project as a dependency using various dependency management tools.

Dependency Management
This document lists the dependencies that are defined through dependencyManagement.

About
Demo project for Spring Boot

Project License
This document lists the project license(s).

Plugin Management
This document lists the plugins that are defined through pluginManagement.

Project Plugins
This document lists the build plugins and the report plugins used by this project.

Project Team
This document provides information on the members of this project. These are the individuals who have contributed to the project in one form or another.

Source Repository
This document lists ways to access the online source repository.

Project Summary
This document lists other related information of this project

              Copyright ©                    2015
                        Pivotal Software, Inc..
            All rights reserved.


text:
namespace System.Web.Services.Discovery {
internal class DiscoveryDocumentSerializationWriter : System.Xml.Serialization.XmlSerializationWriter {

        public void Write10_discovery(object o) {
            WriteStartDocument();
            if (o == null) {
                WriteNullTagLiteral(@"discovery", @"http://schemas.xmlsoap.org/disco/");
                return;
            }
            TopLevelElement();
            Write9_DiscoveryDocument(@"discovery", @"http://schemas.xmlsoap.org/disco/", ((global::System.Web.Services.Discovery.DiscoveryDocument)o), true, false);
        }

        void Write9_DiscoveryDocument(string n, string ns, global::System.Web.Services.Discovery.DiscoveryDocument o, bool isNullable, bool needType) {
            if ((object)o == null) {
                if (isNullable) WriteNullTagLiteral(n, ns);
                return;
            }
            if (!needType) {
                System.Type t = o.GetType();
                if (t == typeof(global::System.Web.Services.Discovery.DiscoveryDocument)) {
                }
                else {
                    throw CreateUnknownTypeException(o);
                }
            }
            WriteStartElement(n, ns, o, false, null);
            if (needType) WriteXsiType(@"DiscoveryDocument", @"http://schemas.xmlsoap.org/disco/");
            {
                global::System.Collections.IList a = (global::System.Collections.IList)o.@References;
                if (a != null) {
                    for (int ia = 0; ia < ((System.Collections.ICollection)a).Count; ia++) {
                        global::System.Object ai = (global::System.Object)a[ia];
                        {
                            if (ai is global::System.Web.Services.Discovery.SchemaReference) {
                                Write7_SchemaReference(@"schemaRef", @"http://schemas.xmlsoap.org/disco/schema/", ((global::System.Web.Services.Discovery.SchemaReference)ai), false, false);
                            }
                            else if (ai is global::System.Web.Services.Discovery.ContractReference) {
                                Write5_ContractReference(@"contractRef", @"http://schemas.xmlsoap.org/disco/scl/", ((global::System.Web.Services.Discovery.ContractReference)ai), false, false);
                            }
                            else if (ai is global::System.Web.Services.Discovery.DiscoveryDocumentReference) {
                                Write3_DiscoveryDocumentReference(@"discoveryRef", @"http://schemas.xmlsoap.org/disco/", ((global::System.Web.Services.Discovery.DiscoveryDocumentReference)ai), false, false);
                            }
                            else if (ai is global::System.Web.Services.Discovery.SoapBinding) {
                                Write8_SoapBinding(@"soap", @"http://schemas.xmlsoap.org/disco/soap/", ((global::System.Web.Services.Discovery.SoapBinding)ai), false, false);
                            }
                            else {
                                if (ai != null) {
                                    throw CreateUnknownTypeException(ai);
                                }
                            }
                        }
                    }
                }
            }
            WriteEndElement(o);
        }

        void Write8_SoapBinding(string n, string ns, global::System.Web.Services.Discovery.SoapBinding o, bool isNullable, bool needType) {
            if ((object)o == null) {
                if (isNullable) WriteNullTagLiteral(n, ns);
                return;
            }
            if (!needType) {
                System.Type t = o.GetType();
                if (t == typeof(global::System.Web.Services.Discovery.SoapBinding)) {
                }
                else {
                    throw CreateUnknownTypeException(o);
                }
            }
            WriteStartElement(n, ns, o, false, null);
            if (needType) WriteXsiType(@"SoapBinding", @"http://schemas.xmlsoap.org/disco/soap/");
            WriteAttribute(@"address", @"", ((global::System.String)o.@Address));
            WriteAttribute(@"binding", @"", FromXmlQualifiedName(((global::System.Xml.XmlQualifiedName)o.@Binding)));
            WriteEndElement(o);
        }

        void Write3_DiscoveryDocumentReference(string n, string ns, global::System.Web.Services.Discovery.DiscoveryDocumentReference o, bool isNullable, bool needType) {
            if ((object)o == null) {
                if (isNullable) WriteNullTagLiteral(n, ns);
                return;
            }
            if (!needType) {
                System.Type t = o.GetType();
                if (t == typeof(global::System.Web.Services.Discovery.DiscoveryDocumentReference)) {
                }
                else {
                    throw CreateUnknownTypeException(o);
                }
            }
            WriteStartElement(n, ns, o, false, null);
            if (needType) WriteXsiType(@"DiscoveryDocumentReference", @"http://schemas.xmlsoap.org/disco/");
            WriteAttribute(@"ref", @"", ((global::System.String)o.@Ref));
            WriteEndElement(o);
        }

        void Write5_ContractReference(string n, string ns, global::System.Web.Services.Discovery.ContractReference o, bool isNullable, bool needType) {
            if ((object)o == null) {
                if (isNullable) WriteNullTagLiteral(n, ns);
                return;
            }
            if (!needType) {
                System.Type t = o.GetType();
                if (t == typeof(global::System.Web.Services.Discovery.ContractReference)) {
                }
                else {
                    throw CreateUnknownTypeException(o);
                }
            }
            WriteStartElement(n, ns, o, false, null);
            if (needType) WriteXsiType(@"ContractReference", @"http://schemas.xmlsoap.org/disco/scl/");
            WriteAttribute(@"ref", @"", ((global::System.String)o.@Ref));
            WriteAttribute(@"docRef", @"", ((global::System.String)o.@DocRef));
            WriteEndElement(o);
        }

        void Write7_SchemaReference(string n, string ns, global::System.Web.Services.Discovery.SchemaReference o, bool isNullable, bool needType) {
            if ((object)o == null) {
                if (isNullable) WriteNullTagLiteral(n, ns);
                return;
            }
            if (!needType) {
                System.Type t = o.GetType();
                if (t == typeof(global::System.Web.Services.Discovery.SchemaReference)) {
                }
                else {
                    throw CreateUnknownTypeException(o);
                }
            }
            WriteStartElement(n, ns, o, false, null);
            if (needType) WriteXsiType(@"SchemaReference", @"http://schemas.xmlsoap.org/disco/schema/");
            WriteAttribute(@"ref", @"", ((global::System.String)o.@Ref));
            WriteAttribute(@"targetNamespace", @"", ((global::System.String)o.@TargetNamespace));
            WriteEndElement(o);
        }

        protected override void InitCallbacks() {
        }
    }
    internal class DiscoveryDocumentSerializationReader : System.Xml.Serialization.XmlSerializationReader {

        public object Read10_discovery() {
            object o = null;
            Reader.MoveToContent();
            if (Reader.NodeType == System.Xml.XmlNodeType.Element) {
                if (((object) Reader.LocalName == (object)id1_discovery && (object) Reader.NamespaceURI == (object)id2_Item)) {
                    o = Read9_DiscoveryDocument(true, true);
                }
                else {
                    throw CreateUnknownNodeException();
                }
            }
            else {
                UnknownNode(null, @"http://schemas.xmlsoap.org/disco/:discovery");
            }
            return (object)o;
        }

        global::System.Web.Services.Discovery.DiscoveryDocument Read9_DiscoveryDocument(bool isNullable, bool checkType) {
            System.Xml.XmlQualifiedName xsiType = checkType ? GetXsiType() : null;
            bool isNull = false;
            if (isNullable) isNull = ReadNull();
            if (checkType) {
            if (xsiType == null || ((object) ((System.Xml.XmlQualifiedName)xsiType).Name == (object)id3_DiscoveryDocument && (object) ((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id2_Item)) {
            }
            else
                throw CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType);
            }
            if (isNull) return null;
            global::System.Web.Services.Discovery.DiscoveryDocument o;
            o = new global::System.Web.Services.Discovery.DiscoveryDocument();
            global::System.Collections.IList a_0 = (global::System.Collections.IList)o.@References;
            bool[] paramsRead = new bool[1];
            while (Reader.MoveToNextAttribute()) {
                if (!IsXmlnsAttribute(Reader.Name)) {
                    UnknownNode((object)o);
                }
            }
            Reader.MoveToElement();
            if (Reader.IsEmptyElement) {
                Reader.Skip();
                return o;
            }
            Reader.ReadStartElement();
            Reader.MoveToContent();
            int whileIterations0 = 0;
            int readerCount0 = ReaderCount;
            while (Reader.NodeType != System.Xml.XmlNodeType.EndElement && Reader.NodeType != System.Xml.XmlNodeType.None) {
                if (Reader.NodeType == System.Xml.XmlNodeType.Element) {
                    if (((object) Reader.LocalName == (object)id4_discoveryRef && (object) Reader.NamespaceURI == (object)id2_Item)) {
                        if ((object)(a_0) == null) Reader.Skip(); else a_0.Add(Read3_DiscoveryDocumentReference(false, true));
                    }
                    else if (((object) Reader.LocalName == (object)id5_contractRef && (object) Reader.NamespaceURI == (object)id6_Item)) {
                        if ((object)(a_0) == null) Reader.Skip(); else a_0.Add(Read5_ContractReference(false, true));
                    }
                    else if (((object) Reader.LocalName == (object)id7_schemaRef && (object) Reader.NamespaceURI == (object)id8_Item)) {
                        if ((object)(a_0) == null) Reader.Skip(); else a_0.Add(Read7_SchemaReference(false, true));
                    }
                    else if (((object) Reader.LocalName == (object)id9_soap && (object) Reader.NamespaceURI == (object)id10_Item)) {
                        if ((object)(a_0) == null) Reader.Skip(); else a_0.Add(Read8_SoapBinding(false, true));
                    }
                    else {
                        UnknownNode((object)o, @"http://schemas.xmlsoap.org/disco/:discoveryRef, http://schemas.xmlsoap.org/disco/scl/:contractRef, http://schemas.xmlsoap.org/disco/schema/:schemaRef, http://schemas.xmlsoap.org/disco/soap/:soap");
                    }
                }
                else {
                    UnknownNode((object)o, @"http://schemas.xmlsoap.org/disco/:discoveryRef, http://schemas.xmlsoap.org/disco/scl/:contractRef, http://schemas.xmlsoap.org/disco/schema/:schemaRef, http://schemas.xmlsoap.org/disco/soap/:soap");
                }
                Reader.MoveToContent();
                CheckReaderCount(ref whileIterations0, ref readerCount0);
            }
            ReadEndElement();
            return o;
        }

        global::System.Web.Services.Discovery.SoapBinding Read8_SoapBinding(bool isNullable, bool checkType) {
            System.Xml.XmlQualifiedName xsiType = checkType ? GetXsiType() : null;
            bool isNull = false;
            if (isNullable) isNull = ReadNull();
            if (checkType) {
            if (xsiType == null || ((object) ((System.Xml.XmlQualifiedName)xsiType).Name == (object)id11_SoapBinding && (object) ((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id10_Item)) {
            }
            else
                throw CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType);
            }
            if (isNull) return null;
            global::System.Web.Services.Discovery.SoapBinding o;
            o = new global::System.Web.Services.Discovery.SoapBinding();
            bool[] paramsRead = new bool[2];
            while (Reader.MoveToNextAttribute()) {
                if (!paramsRead[0] && ((object) Reader.LocalName == (object)id12_address && (object) Reader.NamespaceURI == (object)id13_Item)) {
                    o.@Address = Reader.Value;
                    paramsRead[0] = true;
                }
                else if (!paramsRead[1] && ((object) Reader.LocalName == (object)id14_binding && (object) Reader.NamespaceURI == (object)id13_Item)) {
                    o.@Binding = ToXmlQualifiedName(Reader.Value);
                    paramsRead[1] = true;
                }
                else if (!IsXmlnsAttribute(Reader.Name)) {
                    UnknownNode((object)o, @":address, :binding");
                }
            }
            Reader.MoveToElement();
            if (Reader.IsEmptyElement) {
                Reader.Skip();
                return o;
            }
            Reader.ReadStartElement();
            Reader.MoveToContent();
            int whileIterations1 = 0;
            int readerCount1 = ReaderCount;
            while (Reader.NodeType != System.Xml.XmlNodeType.EndElement && Reader.NodeType != System.Xml.XmlNodeType.None) {
                if (Reader.NodeType == System.Xml.XmlNodeType.Element) {
                    UnknownNode((object)o, @"");
                }
                else {
                    UnknownNode((object)o, @"");
                }
                Reader.MoveToContent();
                CheckReaderCount(ref whileIterations1, ref readerCount1);
            }
            ReadEndElement();
            return o;
        }

        global::System.Web.Services.Discovery.SchemaReference Read7_SchemaReference(bool isNullable, bool checkType) {
            System.Xml.XmlQualifiedName xsiType = checkType ? GetXsiType() : null;
            bool isNull = false;
            if (isNullable) isNull = ReadNull();
            if (checkType) {
            if (xsiType == null || ((object) ((System.Xml.XmlQualifiedName)xsiType).Name == (object)id15_SchemaReference && (object) ((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id8_Item)) {
            }
            else
                throw CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType);
            }
            if (isNull) return null;
            global::System.Web.Services.Discovery.SchemaReference o;
            o = new global::System.Web.Services.Discovery.SchemaReference();
            bool[] paramsRead = new bool[2];
            while (Reader.MoveToNextAttribute()) {
                if (!paramsRead[0] && ((object) Reader.LocalName == (object)id16_ref && (object) Reader.NamespaceURI == (object)id13_Item)) {
                    o.@Ref = Reader.Value;
                    paramsRead[0] = true;
                }
                else if (!paramsRead[1] && ((object) Reader.LocalName == (object)id17_targetNamespace && (object) Reader.NamespaceURI == (object)id13_Item)) {
                    o.@TargetNamespace = Reader.Value;
                    paramsRead[1] = true;
                }
                else if (!IsXmlnsAttribute(Reader.Name)) {
                    UnknownNode((object)o, @":ref, :targetNamespace");
                }
            }
            Reader.MoveToElement();
            if (Reader.IsEmptyElement) {
                Reader.Skip();
                return o;
            }
            Reader.ReadStartElement();
            Reader.MoveToContent();
            int whileIterations2 = 0;
            int readerCount2 = ReaderCount;
            while (Reader.NodeType != System.Xml.XmlNodeType.EndElement && Reader.NodeType != System.Xml.XmlNodeType.None) {
                if (Reader.NodeType == System.Xml.XmlNodeType.Element) {
                    UnknownNode((object)o, @"");
                }
                else {
                    UnknownNode((object)o, @"");
                }
                Reader.MoveToContent();
                CheckReaderCount(ref whileIterations2, ref readerCount2);
            }
            ReadEndElement();
            return o;
        }

        global::System.Web.Services.Discovery.ContractReference Read5_ContractReference(bool isNullable, bool checkType) {
            System.Xml.XmlQualifiedName xsiType = checkType ? GetXsiType() : null;
            bool isNull = false;
            if (isNullable) isNull = ReadNull();
            if (checkType) {
            if (xsiType == null || ((object) ((System.Xml.XmlQualifiedName)xsiType).Name == (object)id18_ContractReference && (object) ((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id6_Item)) {
            }
            else
                throw CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType);
            }
            if (isNull) return null;
            global::System.Web.Services.Discovery.ContractReference o;
            o = new global::System.Web.Services.Discovery.ContractReference();
            bool[] paramsRead = new bool[2];
            while (Reader.MoveToNextAttribute()) {
                if (!paramsRead[0] && ((object) Reader.LocalName == (object)id16_ref && (object) Reader.NamespaceURI == (object)id13_Item)) {
                    o.@Ref = Reader.Value;
                    paramsRead[0] = true;
                }
                else if (!paramsRead[1] && ((object) Reader.LocalName == (object)id19_docRef && (object) Reader.NamespaceURI == (object)id13_Item)) {
                    o.@DocRef = Reader.Value;
                    paramsRead[1] = true;
                }
                else if (!IsXmlnsAttribute(Reader.Name)) {
                    UnknownNode((object)o, @":ref, :docRef");
                }
            }
            Reader.MoveToElement();
            if (Reader.IsEmptyElement) {
                Reader.Skip();
                return o;
            }
            Reader.ReadStartElement();
            Reader.MoveToContent();
            int whileIterations3 = 0;
            int readerCount3 = ReaderCount;
            while (Reader.NodeType != System.Xml.XmlNodeType.EndElement && Reader.NodeType != System.Xml.XmlNodeType.None) {
                if (Reader.NodeType == System.Xml.XmlNodeType.Element) {
                    UnknownNode((object)o, @"");
                }
                else {
                    UnknownNode((object)o, @"");
                }
                Reader.MoveToContent();
                CheckReaderCount(ref whileIterations3, ref readerCount3);
            }
            ReadEndElement();
            return o;
        }

        global::System.Web.Services.Discovery.DiscoveryDocumentReference Read3_DiscoveryDocumentReference(bool isNullable, bool checkType) {
            System.Xml.XmlQualifiedName xsiType = checkType ? GetXsiType() : null;
            bool isNull = false;
            if (isNullable) isNull = ReadNull();
            if (checkType) {
            if (xsiType == null || ((object) ((System.Xml.XmlQualifiedName)xsiType).Name == (object)id20_DiscoveryDocumentReference && (object) ((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id2_Item)) {
            }
            else
                throw CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType);
            }
            if (isNull) return null;
            global::System.Web.Services.Discovery.DiscoveryDocumentReference o;
            o = new global::System.Web.Services.Discovery.DiscoveryDocumentReference();
            bool[] paramsRead = new bool[1];
            while (Reader.MoveToNextAttribute()) {
                if (!paramsRead[0] && ((object) Reader.LocalName == (object)id16_ref && (object) Reader.NamespaceURI == (object)id13_Item)) {
                    o.@Ref = Reader.Value;
                    paramsRead[0] = true;
                }
                else if (!IsXmlnsAttribute(Reader.Name)) {
                    UnknownNode((object)o, @":ref");
                }
            }
            Reader.MoveToElement();
            if (Reader.IsEmptyElement) {
                Reader.Skip();
                return o;
            }
            Reader.ReadStartElement();
            Reader.MoveToContent();
            int whileIterations4 = 0;
            int readerCount4 = ReaderCount;
            while (Reader.NodeType != System.Xml.XmlNodeType.EndElement && Reader.NodeType != System.Xml.XmlNodeType.None) {
                if (Reader.NodeType == System.Xml.XmlNodeType.Element) {
                    UnknownNode((object)o, @"");
                }
                else {
                    UnknownNode((object)o, @"");
                }
                Reader.MoveToContent();
                CheckReaderCount(ref whileIterations4, ref readerCount4);
            }
            ReadEndElement();
            return o;
        }

        protected override void InitCallbacks() {
        }

        string id1_discovery;
        string id4_discoveryRef;
        string id19_docRef;
        string id8_Item;
        string id14_binding;
        string id20_DiscoveryDocumentReference;
        string id17_targetNamespace;
        string id5_contractRef;
        string id10_Item;
        string id13_Item;
        string id7_schemaRef;
        string id3_DiscoveryDocument;
        string id9_soap;
        string id12_address;
        string id16_ref;
        string id11_SoapBinding;
        string id18_ContractReference;
        string id2_Item;
        string id15_SchemaReference;
        string id6_Item;

        protected override void InitIDs() {
            id1_discovery = Reader.NameTable.Add(@"discovery");
            id4_discoveryRef = Reader.NameTable.Add(@"discoveryRef");
            id19_docRef = Reader.NameTable.Add(@"docRef");
            id8_Item = Reader.NameTable.Add(@"http://schemas.xmlsoap.org/disco/schema/");
            id14_binding = Reader.NameTable.Add(@"binding");
            id20_DiscoveryDocumentReference = Reader.NameTable.Add(@"DiscoveryDocumentReference");
            id17_targetNamespace = Reader.NameTable.Add(@"targetNamespace");
            id5_contractRef = Reader.NameTable.Add(@"contractRef");
            id10_Item = Reader.NameTable.Add(@"http://schemas.xmlsoap.org/disco/soap/");
            id13_Item = Reader.NameTable.Add(@"");
            id7_schemaRef = Reader.NameTable.Add(@"schemaRef");
            id3_DiscoveryDocument = Reader.NameTable.Add(@"DiscoveryDocument");
            id9_soap = Reader.NameTable.Add(@"soap");
            id12_address = Reader.NameTable.Add(@"address");
            id16_ref = Reader.NameTable.Add(@"ref");
            id11_SoapBinding = Reader.NameTable.Add(@"SoapBinding");
            id18_ContractReference = Reader.NameTable.Add(@"ContractReference");
            id2_Item = Reader.NameTable.Add(@"http://schemas.xmlsoap.org/disco/");
            id15_SchemaReference = Reader.NameTable.Add(@"SchemaReference");
            id6_Item = Reader.NameTable.Add(@"http://schemas.xmlsoap.org/disco/scl/");
        }
    }
}


text:
+++
date = "2016-07-01T00:00:00Z"
lastmod = "2016-07-01T00:00:00Z"
title = "Image Tagging Best Practices"
weight = "999999"
categories = [ "Knowledgebase", "Developer Resources" ]
+++

For your Replicated YAML, we highly encourage you to push images with a specific tag & avoid the
"latest" tag. This rule can be ignored when you're in early development stages and constantly
updating your images. However, once you're becoming more production ready, we suggest tagging
images with some type of version (we generally just use the sha of the GitHub commit). This is
valuable when you have multiple release channels & want to be able to maintain a constant version
in the stable channel, but experiment with the unstable channel.


text:
import pytest
import sys
import os
import re
os.environ['SENTINEL_ENV'] = 'test'
os.environ['SENTINEL_CONFIG'] = os.path.normpath(os.path.join(os.path.dirname(__file__), '../test_sentinel.conf'))
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'lib'))
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..'))
import config

from dynamicd import DynamicDaemon
from dynamic_config import DynamicConfig

def test_dynamicd():
    config_text = DynamicConfig.slurp_config_file(config.dynamic_conf)
    network = 'mainnet'
    is_testnet = False
    genesis_hash = u'00000ffd590b1485b3caadc19b22e6379c733355108f107a430458cdf3407ab6'
    for line in config_text.split("\n"):
        if line.startswith('testnet=1'):
            network = 'testnet'
            is_testnet = True
            genesis_hash = u'00000bafbc94add76cb75e2ec92894837288a481e5c005f6563d91623bf8bc2c'

    creds = DynamicConfig.get_rpc_creds(config_text, network)
    dynamicd = DynamicDaemon(**creds)
    assert dynamicd.rpc_command is not None

    assert hasattr(dynamicd, 'rpc_connection')

    # Dynamic testnet block 0 hash == 00000bafbc94add76cb75e2ec92894837288a481e5c005f6563d91623bf8bc2c
    # test commands without arguments
    info = dynamicd.rpc_command('getinfo')
    info_keys = [
        'blocks',
        'connections',
        'difficulty',
        'errors',
        'protocolversion',
        'proxy',
        'testnet',
        'timeoffset',
        'version',
    ]
    for key in info_keys:
        assert key in info
    assert info['testnet'] is is_testnet

    # test commands with args
    assert dynamicd.rpc_command('getblockhash', 0) == genesis_hash


text:
// CELL - DOCUMENT . COMPONENT . TS

import {filter} from 'rxjs/operators';
import {Component, Inject, OnInit} from '@angular/core';

import { Configuration } from '../config/configuration.class';

import { CellDocument, CellDocumentJSON } from '../cell-document.class';
import { RemoteObjectService } from '../services/remote-object.service';

import { CellDocumentSelectionEvent } from '../events/cell-document-selection.event';
import { CellDocumentClearEvent } from '../events/cell-document-clear.event';
import { CellDocumentLoadedEvent } from '../events/cell-document-loaded.event';
import { ContentSaveEvent } from '../events/content-save.event';
import { StatusEvent } from '../events/status.event';
import { UXEvent } from '../events/ux.event';
import { EventListener } from '../events/event-listener.class';
import { EventService } from '../services/event.service';
import { RemoteEventService } from '../services/remote-event.service';

@Component({
	selector: "document",
	template: `

{{document.name}} {{document.kind}}

					{{document.desc}}
					VALID
					NON VALID

			 <button *ngIf="document.valid"
				id="document-save"
				type="button"
				class="btn btn-success btn-lg btn-block btn-sm mt-2"
				[class.disabled]="saveDisabled"
				(click)="saveDocument()"
			>SAVE</button>
			 <button type="button" *ngIf="document.valid"
				 class="btn btn-warning btn-lg btn-block btn-sm mt-2">Restore</button>

	`,
	styles: [`
			#document-info {}
			#document-name {}
			#document-desc {}
			#document-valid {}
			#document-save {}
	`]
})
// `

export class CellDocumentComponent extends EventListener implements OnInit {

document: CellDocument;
saveDisabled = true;

constructor(eventService: EventService,
			remoteEventService: RemoteEventService,
			@Inject("CellDocumentService") private documentService: RemoteObjectService<CellDocument, CellDocumentJSON>
			) {
	super(eventService, remoteEventService);
}

ngOnInit() {

	console.log("DocumentComponent::ngOnInit()");

	this.register(this.events.service.of<CellDocumentClearEvent>(CellDocumentClearEvent)
		.subscribe(() => {
			this.clear();
			this.events.ok();
		})
	);

	this.register(this.events.service.of<CellDocumentSelectionEvent>(CellDocumentSelectionEvent).subscribe(
			selected => this.loadDocument(selected.url)
	));

	// when the document is dirty we can save, this will be notified by someone elsem (content area, etc)
	this.register(this.events.service.of<UXEvent>(UXEvent)
			.pipe(filter(e => e.type===UXEvent.DOCUMENT_DIRTY))
			.subscribe(() => this.enableSave())
	);

}

loadDocument(url: string) {

	// this.events.service.publish(new DocumentSelectionEvent(null));  // we don't have a document now
	this.events.service.publish(new StatusEvent("Fetching document"));
	// notice we're using the enriched url here, as we want to display the JSON enriched data
	const documentURI = Configuration.BACKEND_PREF+'/dyn/documents/'+url;
	console.debug("DocumentComponent::loadDocument() About to fetch document from '%s'", documentURI);
	const subs = this.register(
		this.documentService.get(documentURI, CellDocument).subscribe(
				d => this.documentLoaded(d),
				error => {
					console.log("DocumentComponent::loadDocument() itself got an error");
					this.events.problem(error.message); // error is of the type HttpErrorResponse
					console.error("Could not get document '%s' (%s)", url, error.message);
					this.events.remote.publish(new CellDocumentClearEvent());	// also clear document
					this.document = null;			 // we have no document loaded at all, so no show here
				},
				() => {
					this.events.service.publish(new StatusEvent("Fetching document", StatusEvent.DONE));
					this.unsubscribe(subs);	// avoid memory leak every time we load a document
				}
		)
	);

}

display(d: CellDocument) {

	console.log("[UI] document component gets Document ("+d.name+")");
	this.document = d;
	this.disableSave();

}

clear() {

	console.log("[UI] CellDocumentComponent::clear()");
	this.document = null;
	this.disableSave();

}

disableSave() {
	this.saveDisabled = true;
}

enableSave() {
	this.saveDisabled = false;
}

saveDocument() {

	if (this.saveDisabled) {
		return;
	}

	console.log("[UI] User clicked on save document, let's go!!!");
	this.disableSave();	// avoid double submits and similar
	this.events.service.publish(new ContentSaveEvent(this.document));

}

private documentLoaded(d: CellDocument) {

	console.log("DocumentComponent::loadDocument() Got document from Morfeu ("+d.name+")");
	console.log('DocumentComponent::loadDocument() sending doc clear event');
	this.events.remote.publish(new CellDocumentClearEvent());	// clear everything: subscriptions, etc.
	if (!d.hasProblem()) {	// we only publish the load if we have no issues with the doc
		console.log('DocumentComponent::loadDocument() no issues found, sending doc loaded event');
		this.events.service.publish(new CellDocumentLoadedEvent(d));
		this.display(d);
		this.events.ok();
	} else {
		// after clearing we show the problem message and the problematic document stub
		this.events.problem(d.problem);	// document loaded but was problematic
		this.document = d;				// we still show whatever was answered back
	}

}

}


text:
"use strict";
import React from "react"
import GitHubWebView from "./GitHubWebView"
import IssueList from "./IssueList"
import RepositoryIssueList from "./RepositoryIssueList"
import RepositoryToolbelt from "./RepositoryToolbelt"
import GitHubTokenForm from "./GitHubTokenForm"
import IssueListToolbar from "./IssueListToolbar"

export default class AppComponent extends React.Component {
    constructor(...args) {
        super(...args);
        let {issueStore,issueAction} = this.props.context;
        this.issueStore = issueStore;
        this.issueAction = issueAction;
        this.state = {
            myIssues: this.issueStore.getMyIssues(),
            repoIssues: this.issueStore.getRepoIssues(),
            viewingURL: this.issueStore.getViewingURL(),
            viewingIssue: this.issueStore.getViewingIssue(),
            viewingIssueComments: this.issueStore.getViewingIssueComments()
        };
        this.onChange = this._onChange.bind(this);
    }

    componentDidMount() {
        this.issueStore.onChange(this.onChange);
    }

    componentWillUnmount() {
        this.issueAction.removeChangeListener(this.onChange);
    }

    _onChange() {
        var viewingURL = this.issueStore.getViewingURL();
        var myIssues = this.issueStore.getMyIssues();
        var repoIssues = this.issueStore.getRepoIssues();
        var viewingIssue = this.issueStore.getViewingIssue();
        var viewingIssueComments = this.issueStore.getViewingIssueComments();
        this.setState({
            myIssues,
            repoIssues,
            viewingIssue,
            viewingIssueComments,
            viewingURL
        });
    }

    onClickIssue(issue) {
        this.issueAction.viewIssue(issue);
    }

    changeViewingURL(URL) {
        this.issueAction.viewURL(URL);
    }

    isFavRepository(issue) {
        return this.issueStore.isFavIssue(issue);
    }

    testToken(token) {
        this.issueAction.validGitHubToken(token);
    }

    onRefresh() {
        this.issueAction.loadMyIssues()
    }

    render() {
        if (!this.issueStore.isValidGitHubToken()) {
            return

                    <GitHubTokenForm testToken={this.testToken.bind(this)}/>

;
        }
        return

                <IssueListToolbar onRefresh={this.onRefresh.bind(this)} />

My Issues

                <IssueList issues={this.state.myIssues} onClickIssue={this.onClickIssue.bind(this)}/>

Repo Issues

                <IssueList issues={this.state.repoIssues} onClickIssue={this.onClickIssue.bind(this)}/>

                <GitHubWebView url={this.state.viewingURL}
                               changeViewURL={this.changeViewingURL.bind(this)}/>

                <RepositoryToolbelt issue={this.state.viewingIssue}
                                    isFavRepository={this.isFavRepository.bind(this)}
                                    addFavRepository={this.issueAction.addFavRepository.bind(this.issueAction)}
                                    removeFavRepository={this.issueAction.removeFavRepository.bind(this.issueAction)}
                    />
                <RepositoryIssueList issue={this.state.viewingIssue} comments={this.state.viewingIssueComments}/>

;
    }
}


text:
package com.alipay.api.response;

import com.alipay.api.internal.mapping.ApiField;

import com.alipay.api.AlipayResponse;

/**
 * ALIPAY API: alipay.trust.user.auth.send response.
 *
 * @author auto create
 * @since 1.0, 2015-05-15 09:36:22
 */
public class AlipayTrustUserAuthSendResponse extends AlipayResponse {

	private static final long serialVersionUID = 5289611188615246391L;

	/**
	 * 当授权通知发送成功时,为T;否则用业务错误码表示
	 */
	@ApiField("result")
	private String result;

	public void setResult(String result) {
		this.result = result;
	}
	public String getResult( ) {
		return this.result;
	}

}


text:
using System;
using System.Diagnostics.Contracts;
using System.IO;
using System.Threading.Tasks;

namespace Utilities
{
    public static class TaskHelper
    {
        public static Task<int> ReadAsyncTpl(this Stream stream, byte[] buffer, int offset, int count)
        {
            Contract.Requires(stream != null);
            Contract.Requires(buffer != null);
            Contract.Requires(offset >= 0);
            Contract.Requires(count >= 0);
            Contract.Requires(count <= (buffer.Length - offset));

            var tcs = new TaskCompletionSource<int>();

            stream.BeginRead(buffer, offset, count, iasr =>
            {
                try
                {
                    tcs.SetResult(stream.EndRead(iasr));
                }
                catch (Exception e)
                {
                    tcs.SetException(e);
                }
            }, null);

            return tcs.Task;
        }
    }

    public class TplAsyncOperation<TArg, TResult>
    {
        private readonly Func<TArg, Task<TResult>> operation;

        public TplAsyncOperation(Func<TArg, Task<TResult>> operation)
        {
            Contract.Requires(operation != null);

            this.operation = operation;
        }

        public IAsyncResult BeginInvoke(TArg arg, AsyncCallback callback)
        {
            Task<TResult> task = operation(arg);
            if (task != null) task.ContinueWith(_ => callback(task));
            return task;
        }

        public TResult EndInvoke(IAsyncResult result)
        {
            Contract.Requires(result != null);

            return ((Task<TResult>) result).Result;
        }

        [ContractInvariantMethod]
        private void ObjectInvariant()
        {
            Contract.Invariant(operation != null);
        }
    }
}


text:
package com.mongodb;

import java.io.Closeable;
import java.util.Iterator;

public interface MongoCursor extends Iterator<DBObject>, Closeable {
    long getCursorId();

    ServerAddress getServerAddress();
}


text:
@implementation APLine

- (id) initWithDistance:(APDistance*) d andDuration:(APDuration*) t andSrc:(CLLocationCoordinate2D) src andDst:(CLLocationCoordinate2D)dst{

    self = [super init];

    self.distance = d;
    self.duration = t;

    self.srcPos = src;
    self.dstPos = dst;

    self.steps = [[NSMutableArray alloc]init];

    return self;
}

- (void) addStep:(APStep*) step{
    [self.steps addObject:step];
}

- (float) getVelocity{
    return (float)self.distance.distance / self.duration.duration;
}
@end


text:
<?php if ( ! defined('SZ_EXEC') ) exit('access_denied');

class BtAutoNavigationActiveRecord extends SZ_ActiveRecord
{
	protected $_table   = 'bt_auto_navigation';
	protected $_primary = 'block_id';
	protected $_schemas = array(
		'block_id' => array('type' => 'INT'),
		'sort_order' => array('type' => 'INT'),
		'based_page_id' => array('type' => 'INT'),
		'subpage_level' => array('type' => 'INT'),
		'manual_selected_pages' => array('type' => 'VARCHAR'),
		'handle_class' => array('type' => 'VARCHAR'),
		'display_mode' => array('type' => 'INT'),
		'show_base_page' => array('type' => 'INT'),
		'current_class' => array('type' => 'VARCHAR')
	);

	public function isValidBlockId($value) {
		return TRUE;
	}

	public function isValidSortOrder($value) {
		return TRUE;
	}

	public function isValidBasedPageId($value) {
		return TRUE;
	}

	public function isValidSubpageLevel($value) {
		return TRUE;
	}

	public function isValidManualSelectedPages($value) {
		return TRUE;
	}

	public function isValidHandleClass($value) {
		return TRUE;
	}

	public function isValidDisplayMode($value) {
		return TRUE;
	}

	public function isValidShowBasePage($value) {
		return TRUE;
	}

	public function isValidCurrentClass($value) {
		return TRUE;
	}

}


text:
<!doctype html>

  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>

<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

  <meta name="google-site-verification" content="xbiTmID1n2aAD90n7mafi0Hfvg1CBmIh75_D0ZaXdYo" />

  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />

    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">

<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.0" rel="stylesheet" type="text/css" />

  <meta name="keywords" content="spring-data-jpa,jpa,Hibernate," />

  <link rel="alternate" href="/atom.xml" title="Zacard's Notes" type="application/atom+xml" />

  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.0" />

<meta name="description" content="项目使用的是mybatis,相比于hibernate,更轻量更简洁。但是有点不好的地方是无法根据entity生成(修改)表。特别是项目丢给测试的时候,开发和测试不是一个数据库。测试往往还要手动根据sql创建一次表。于是考虑在单元测试状态自动生成相关表结构。
方案很显然:spring-data-jpa+hibernate搞定。">
<meta property="og:type" content="article">
<meta property="og:title" content="使用spring-data-jpa遇到的一个坑">
<meta property="og:url" content="https://zacard.net/2015/09/10/spring-data-jpa-hole1/index.html">
<meta property="og:site_name" content="Zacard's Notes">
<meta property="og:description" content="项目使用的是mybatis,相比于hibernate,更轻量更简洁。但是有点不好的地方是无法根据entity生成(修改)表。特别是项目丢给测试的时候,开发和测试不是一个数据库。测试往往还要手动根据sql创建一次表。于是考虑在单元测试状态自动生成相关表结构。
方案很显然:spring-data-jpa+hibernate搞定。">
<meta property="og:updated_time" content="2015-09-10T11:30:23.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="使用spring-data-jpa遇到的一个坑">
<meta name="twitter:description" content="项目使用的是mybatis,相比于hibernate,更轻量更简洁。但是有点不好的地方是无法根据entity生成(修改)表。特别是项目丢给测试的时候,开发和测试不是一个数据库。测试往往还要手动根据sql创建一次表。于是考虑在单元测试状态自动生成相关表结构。
方案很显然:spring-data-jpa+hibernate搞定。">

  <link rel="canonical" href="https://zacard.net/2015/09/10/spring-data-jpa-hole1/"/>

  <title> 使用spring-data-jpa遇到的一个坑 | Zacard's Notes </title>

      Zacard's Notes

  <button>

  </button>

            首页

            分类

            归档

            标签

            关于

            搜索

 <input type="text" id="local-search-input">

 close

  <link itemprop="mainEntityOfPage" href="https://zacard.net/2015/09/10/spring-data-jpa-hole1/">

    <meta itemprop="name" content="zacard">
    <meta itemprop="description" content="">
    <meta itemprop="image" content="/images/88666.jpg">

    <meta itemprop="name" content="Zacard's Notes">

                使用spring-data-jpa遇到的一个坑

              发表于
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2015-09-10T17:20:49+08:00">
                2015-09-10
              </time>

              |

              分类于

                    软件技术

                |

               |

               阅读次数

项目使用的是mybatis,相比于hibernate,更轻量更简洁。但是有点不好的地方是无法根据entity生成(修改)表。特别是项目丢给测试的时候,开发和测试不是一个数据库。测试往往还要手动根据sql创建一次表。于是考虑在单元测试状态自动生成相关表结构。

方案很显然:spring-data-jpa+hibernate搞定。

配置maven依赖

<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-jpa</artifactId>
    <version>1.8.0.RELEASE</version>
</dependency>

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-entitymanager</artifactId>
    <version>4.3.10.Final</version>
</dependency>

配置spring-data-jpa.xml

<!-- Jpa Entity Manager 配置 -->
<bean id="entityManagerFactory"
      class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
    <property name="dataSource" ref="dataSource"/>
    <property name="jpaVendorAdapter" ref="hibernateJpaVendorAdapter"/>
    <property name="packagesToScan" value="com.test.*.entities"/>
    <property name="jpaProperties">
        <props>
            <prop key="hibernate.ejb.naming_strategy">org.hibernate.cfg.ImprovedNamingStrategy</prop>
            <prop key="hibernate.hbm2ddl.auto">update</prop>
        </props>
    </property>
</bean>

<!-- 配置Spring Data的Hibernate接口 -->
<bean id="hibernateJpaVendorAdapter"
      class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
    <property name="database" value="MYSQL"/>
    <property name="showSql" value="true"/>
</bean>

测试类

package com.test.service;

import com.alibaba.fastjson.JSON;
import com.test.dao.AccountDao;
import com.test.entities.Account;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
import org.testng.annotations.Test;

/**
 * spring-test with testng
 * @author zacard
 * @since 2015-09-10 12:53
 */
@ContextConfiguration(locations = {"classpath:spring-data-jpa.xml", "classpath:spring-services.xml"})
public class NormalServiceTest extends AbstractTestNGSpringContextTests {

    @Autowired
    private AccountDao accountDao;

    //测试MBG生成的代码是否能正确运行和jap生成表
    @Test
    public void testMBG() {
        Account account = accountDao.selectByPrimaryKey(1);
        System.out.println("account json:"+ JSON.toJSONString(account));
    }

}

输出正常,查看数据库表,也生成了。搞定~

坚持原创技术分享,您的支持将鼓励我继续创作!

    <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
      赏
    </button>

微信打赏

            # spring-data-jpa

            # jpa

            # Hibernate

                 关于maven中mybatis-generator的使用

                反向代理工具ngrok使用说明

热评文章

            文章目录

            站点概览

zacard

优生笑,菜鸟哭

              65
              日志

                2
                分类

                105
                标签

              RSS

                  GitHub

                  Weibo

                  ZhiHu

              Links

                  DingDang's Notes

1. 配置maven依赖

2. 配置spring-data-jpa.xml

3. 测试类

  ©  2015 -
  2021

  zacard

  由 Hexo 强力驱动

  主题 -

    NexT.Mist


text:
if(!dojo._hasResource["dojox.analytics"]){
dojo._hasResource["dojox.analytics"]=true;
dojo.provide("dojox.analytics");
dojo.require("dojox.analytics._base");
}


text:
/**
 * @constructor
 */
var Twitter = function(){};
/**
 * Checks if the Twitter SDK is loaded
 * @param {Function} response callback on result
 * @param {Number} response.response is 1 for success, 0 for failure
 * @example
 *      window.plugins.twitter.isTwitterAvailable(function (response) {
 *          console.log("twitter available? " + response);
 *      });
 */
Twitter.prototype.isTwitterAvailable = function(response){
    cordova.exec(response, null, "TwitterPlugin", "isTwitterAvailable", []);
};
/**
 * Checks if the Twitter SDK can send a tweet
 * @param {Function} response callback on result
 * @param {Number} response.response is 1 for success, 0 for failure
 * @example
 *      window.plugins.twitter.isTwitterSetup(function (r) {
 *          console.log("twitter configured? " + r);
 *      });
 */
Twitter.prototype.isTwitterSetup = function(response){
    cordova.exec(response, null, "TwitterPlugin", "isTwitterSetup", []);
};
/**
 * Sends a Tweet to Twitter
 * @param {Function} success callback
 * @param {Function} failure callback
 * @param {String} failure.error reason for failure
 * @param {String} tweetText message to send to twitter
 * @param {Object} options (optional)
 * @param {String} options.urlAttach URL to embed in Tweet
 * @param {String} options.imageAttach Image URL to embed in Tweet
 * @param {Number} response.response - 1 on success, 0 on failure
 * @example
 *     window.plugins.twitter.composeTweet(
 *         function () { console.log("tweet success"); },
 *         function (error) { console.log("tweet failure: " + error); },
 *         "Text, Image, URL",
 *         {
 *             urlAttach:"http://m.youtube.com/#/watch?v=obx2VOtx0qU",
 *             imageAttach:"http://i.ytimg.com/vi/obx2VOtx0qU/hqdefault.jpg?w=320&h=192&sigh=QD3HYoJj9dtiytpCSXhkaq1oG8M"
 *         }
 * );
 */
Twitter.prototype.composeTweet = function(success, failure, tweetText, options){
    options = options || {};
    options.text = tweetText;
    cordova.exec(success, failure, "TwitterPlugin", "composeTweet", [options]);
};
/**
 * Gets Tweets from Twitter Timeline
 * @param {Function} success callback
 * @param {Object[]} success.response Tweet objects, see [Twitter Timeline Doc]
 * @param {Function} failure callback
 * @param {String} failure.error reason for failure
 * @example
 *     window.plugins.twitter.getPublicTimeline(
 *         function (response) { console.log("timeline success: " + JSON.stringify(response)); },
 *         function (error) { console.log("timeline failure: " + error); }
 *     );
 *
 * [Twitter Timeline Doc]: https://dev.twitter.com/docs/api/1/get/statuses/public_timeline
 */
Twitter.prototype.getPublicTimeline = function(success, failure){
    cordova.exec(success, failure, "TwitterPlugin", "getPublicTimeline", []);
};
/**
 * Gets Tweets from Twitter Mentions
 * @param {Function} success callback
 * @param {Object[]} success.result Tweet objects, see [Twitter Mentions Doc]
 * @param {Function} failure callback
 * @param {String} failure.error reason for failure
 * @example
 *     window.plugins.twitter.getMentions(
 *         function (response) { console.log("mentions success: " + JSON.stringify(response)); },
 *         function (error) { console.log("mentions failure: " + error); }
 *     );
 *
 * [Twitter Timeline Doc]: https://dev.twitter.com/docs/api/1/get/statuses/public_timeline
 */
Twitter.prototype.getMentions = function(success, failure){
    cordova.exec(success, failure, "TwitterPlugin", "getMentions", []);
};
/**
 * Gets Tweets from Twitter Mentions API
 * @param {Function} success callback
 * @param {String} success.response Twitter Username
 * @param {Object[]} success.result Tweet objects, see [Twitter Mentions Doc]
 * @param {Function} failure callback
 * @param {String} failure.error reason for failure
 *
 * [Twitter Mentions Doc]: https://dev.twitter.com/docs/api/1/get/statuses/mentions
 */
Twitter.prototype.getTwitterUsername = function(success, failure) {
    cordova.exec(success, failure, "TwitterPlugin", "getTwitterUsername", []);
};
/**
 * Gets Tweets from Twitter Mentions API
 * @param {String} url of [Twitter API Endpoint]
 * @param {Object} params key-value map, matching [Twitter API Endpoint]
 * @param {Function} success callback
 * @param {Object[]} success.response objects returned from Twitter API (Tweets, Users,...)
 * @param {Function} failure callback
 * @param {String} failure.error reason for failure
 * @param {Object} options (optional) other options for the HTTP request
 * @param {String} options.requestMethod HTTP Request type, ex: "POST"
 * @example
 *     window.plugins.twitter.getTWRequest(
 *          'users/lookup.json',
 *          {user_id: '16141659,783214,6253282'},
 *          function (response) { console.log("usersLookup success: " + JSON.stringify(response)); },
 *          function (error) { console.log("usersLookup failure: " + error); },
 *          {requestMethod: 'POST'}
 *     );
 *
 * [Twitter API Endpoints]: https://dev.twitter.com/docs/api
 */
Twitter.prototype.getTWRequest = function(url, params, success, failure, options){
    options = options || {};
    options.url = url;
    options.params = params;
    cordova.exec(success, failure, "TwitterPlugin", "getTWRequest", [options]);
};
// Plug in to Cordova
cordova.addConstructor(function() {

					   /* shim to work in 1.5 and 1.6  */
						if (!window.Cordova) {
						window.Cordova = cordova;
						};

					   if(!window.plugins) window.plugins = {};
					   window.plugins.twitter = new Twitter();
					   });


text:
workload_folder=`dirname "$0"`
workload_folder=`cd "$workload_folder"; pwd`
workload_root=${workload_folder}/../../..
. "${workload_root}/../../bin/functions/load-bench-config.sh"

enter_bench JavaSparkBayes ${workload_root} ${workload_folder}
show_bannar start

rmr-hdfs $OUTPUT_HDFS || true

SIZE=`dir_size $INPUT_HDFS`
START_TIME=`timestamp`
run-spark-job com.intel.sparkbench.bayes.JavaBayes ${INPUT_HDFS}
END_TIME=`timestamp`

gen_report ${START_TIME} ${END_TIME} ${SIZE}
show_bannar finish
leave_bench

#run-spark-job com.intel.sparkbench.bayes.JavaBayes ${INPUT_HDFS}/vectors.txt ${NUM_FEATURES} || exit 1
#$SPARK_HOME/bin/spark-submit --class com.intel.sparkbench.bayes.JavaBayes --master ${SPARK_MASTER} ${SPARKBENCH_JAR} ${INPUT_HDFS}/vectors.txt ${NUM_FEATURES}


text:
package org.cuacfm.members.model.bankremittanceservice;

import java.util.Date;
import java.util.List;

import org.cuacfm.members.model.bankremittance.BankRemittance;
import org.cuacfm.members.model.exceptions.ExistTransactionIdException;
import org.springframework.http.ResponseEntity;
import org.springframework.web.multipart.MultipartFile;

/** The Interface BankRemittanceService. */
public interface BankRemittanceService {

	/**
	 * Creates the bank remittance.
	 *
	 * @param dateCharge the date charge
	 * @param monthCharge the month charge
	 */
	public void createBankRemittance(Date dateCharge, Date monthCharge);

	/**
	 * Update.
	 *
	 * @param bankRemittance the bank remittance
	 * @return the bank remittance
	 */
	public BankRemittance update(BankRemittance bankRemittance);

	/**
	 * Pay bank remittance.
	 *
	 * @param bankRemittance the bank remittance
	 * @return the string
	 * @throws ExistTransactionIdException the exist transaction id exception
	 */
	public String payBankRemittance(BankRemittance bankRemittance) throws ExistTransactionIdException;

	/**
	 * Management bank remittance.
	 *
	 * @param bankRemittanc the bank remittanc
	 * @return the string
	 * @throws ExistTransactionIdException the exist transaction id exception
	 */
	public String managementBankRemittance(BankRemittance bankRemittanc) throws ExistTransactionIdException;

	/**
	 * Find by id.
	 *
	 * @param id the id
	 * @return the bank remittance
	 */
	public BankRemittance findById(Long id);

	/**
	 * Gets the bank remittance list.
	 *
	 * @return the bank remittance list
	 */
	public List<BankRemittance> getBankRemittanceList();

	/**
	 * generate XML Bank Remittance.
	 *
	 * @param bankRemittanceId the bank remittance id
	 * @return the response entity
	 */
	public ResponseEntity<byte[]> generateXML(Long bankRemittanceId);

	/**
	 * Process XML.
	 *
	 * @param path the path
	 * @return the string
	 */
	public String processXML(MultipartFile path);
}