text:
package org.radargun.service;

import java.nio.charset.StandardCharsets;

import com.couchbase.client.java.document.ByteArrayDocument;
import org.radargun.traits.BasicOperations;

public class CouchbaseClientOperations implements BasicOperations {

   protected final CouchbaseClientService service;
   private final CouchbaseCacheAdapter adapter = new CouchbaseCacheAdapter();

   public CouchbaseClientOperations(CouchbaseClientService service) {
      this.service = service;
   }

   @Override
   public <K, V> Cache<K, V> getCache(String cacheName) {
      return adapter;
   }

   private class CouchbaseCacheAdapter<K, V> implements BasicOperations.Cache<K, V> {

      private String keyAsString(Object object) {
         if (object instanceof String) {
            return String.valueOf(object);
         } else if (object instanceof byte[]) {
            return new String((byte[]) object, StandardCharsets.UTF_8);
         }

         throw new IllegalArgumentException("I don't know hot to decode: " + object + ", class type: " + object.getClass());
      }

      private byte[] valueAsByteArray(Object object) {
         if (object instanceof String) {
            return ((String) object).getBytes();
         } else if (object instanceof byte[]) {
            return (byte[]) object;
         }

         throw new IllegalArgumentException("I don't know hot to decode: " + object + ", class type: " + object.getClass());
      }

      @Override
      public V get(K key) {
         ByteArrayDocument document = service.bucket.get(keyAsString(key), ByteArrayDocument.class);
         return (V) document.content();
      }

      @Override
      public boolean containsKey(K key) {
         return service.bucket.exists(keyAsString(key));
      }

      @Override
      public void put(K key, V value) {
         ByteArrayDocument doc = ByteArrayDocument.create(keyAsString(key), valueAsByteArray(value));
         service.bucket.upsert(doc);
      }

      @Override
      public V getAndPut(K key, V value) {
         throw new UnsupportedOperationException("Couchbase does not support get and put as single operation.");
      }

      @Override
      public boolean remove(K key) {
         try {
            service.bucket.remove(keyAsString(key));
            return true;
         } catch(Exception e) {
            return false;
         }
      }

      @Override
      public V getAndRemove(K key) {
         throw new UnsupportedOperationException("Couchbase does not support get and remove as single operation.");
      }

      @Override
      public void clear() {
         service.bucket.bucketManager().flush();
      }
   }
}


text:
{_blog_post_json.title}

#^_blog_post_json
{
	"title":"More relative than relative",
	"author":"xix",
}

#^_blog_post_body form=markdown

{_blog_post_json.title}
-------

Having attempted to use plated under https://git-for-windows.github.io/
which is currently my goto way of dealing with linuxy stuff on windows.
I hit a little problem.

It seems mingw, the thing that runs bash that makes git for windows
viable gets a little bit carried away when you pass paths starting with
/ into a command. Or set an environment variable, yeah tried that one.

http://www.mingw.org/wiki/Posix_path_conversion

It tends to replace / with wherever msys was installed to, probably a
horrible path on yout c:\\ drive somewhere.

This is a bit of a problem if you are passing in a url to a static
website builder. The current setup ended up replacing all the urls with
links to my C: drive which is a tad inconvenient.

So I over solved it, a bit of messing around and it is now setup where
if you do not provide a root for the site then we work it out as a
relative path. So for instance if you are a couple of directories down
then it would set the _root to ../../ which gets you there from the
current page. This allows us to include js files or css files from the
root using a relative path.

This works both for site that are built to the root of a domain and
github style sites that get placed inside a sub directory. This can
still be replaced with a --root=/whatever/ on the commandline but that
wont work too well on the windows, but then again, what does?

redpajama_set_name: RedPajamaGithub


text:
// SPDX-License-Identifier: Apache-2.0

#include "ODCode93Writer.h"

#include "ODWriterHelper.h"
#include "Utf.h"
#include "ZXAlgorithms.h"
#include "ZXTestSupport.h"

#include <stdexcept>

namespace ZXing::OneD {

static const char ALPHABET[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*";

/**
* These represent the encodings of characters, as patterns of wide and narrow bars.
* The 9 least-significant bits of each int correspond to the pattern of wide and narrow.
*/
static const int CHARACTER_ENCODINGS[] = {
	0x114, 0x148, 0x144, 0x142, 0x128, 0x124, 0x122, 0x150, 0x112, 0x10A, // 0-9
	0x1A8, 0x1A4, 0x1A2, 0x194, 0x192, 0x18A, 0x168, 0x164, 0x162, 0x134, // A-J
	0x11A, 0x158, 0x14C, 0x146, 0x12C, 0x116, 0x1B4, 0x1B2, 0x1AC, 0x1A6, // K-T
	0x196, 0x19A, 0x16C, 0x166, 0x136, 0x13A, // U-Z
	0x12E, 0x1D4, 0x1D2, 0x1CA, 0x16E, 0x176, 0x1AE, // - - %
	0x126, 0x1DA, 0x1D6, 0x132, 0x15E, // Control chars? $-*
};

static_assert(Size(ALPHABET) - 1 == Size(CHARACTER_ENCODINGS), "table size mismatch");

static const int ASTERISK_ENCODING = CHARACTER_ENCODINGS[47];

static int AppendPattern(std::vector<bool>& target, int pos, int a)
{
	for (int i = 0; i < 9; i++) {
		int temp = a & (1 << (8 - i));
		target[pos + i] = temp != 0;
	}
	return 9;
}

static int ComputeChecksumIndex(const std::string& contents, int maxWeight)
{
	int weight = 1;
	int total = 0;

	for (int i = Size(contents) - 1; i >= 0; i--) {
		int indexInString = IndexOf(ALPHABET, contents[i]);
		total += indexInString * weight;
		if (++weight > maxWeight) {
			weight = 1;
		}
	}
	return total % 47;
}

ZXING_EXPORT_TEST_ONLY
std::string Code93ConvertToExtended(const std::wstring& contents)
{
	size_t length = contents.length();
	std::string extendedContent;
	extendedContent.reserve(length * 2);

	for (size_t i = 0; i < length; i++) {
		int character = contents[i];
		// ($)=a, (%)=b, (/)=c, (+)=d. see Code93Reader.ALPHABET
		if (character == 0) {
			// NUL: (%)U
			extendedContent.append("bU");
		}
		else if (character <= 26) {
			// SOH - SUB: ($)A - ($)Z
			extendedContent.push_back('a');
			extendedContent.push_back((char)('A' + character - 1));
		}
		else if (character <= 31) {
			// ESC - US: (%)A - (%)E
			extendedContent.push_back('b');
			extendedContent.push_back((char)('A' + character - 27));
		}
		else if (character == ' ' || character == '$' || character == '%' || character == '+') {
			// space $ % +
			extendedContent.push_back(character);
		}
		else if (character <= ',') {
			// ! " # & ' ( ) * ,: (/)A - (/)L
			extendedContent.push_back('c');
			extendedContent.push_back((char)('A' + character - '!'));
		}
		else if (character <= '9') {
			extendedContent.push_back(character);
		}
		else if (character == ':') {
			// :: (/)Z
			extendedContent.append("cZ");
		}
		else if (character <= '?') {
			// ; - ?: (%)F - (%)J
			extendedContent.push_back('b');
			extendedContent.push_back((char)('F' + character - ';'));
		}
		else if (character == '@') {
			// @: (%)V
			extendedContent.append("bV");
		}
		else if (character <= 'Z') {
			// A - Z
			extendedContent.push_back(character);
		}
		else if (character <= '_') {
			// [ - _: (%)K - (%)O
			extendedContent.push_back('b');
			extendedContent.push_back((char)('K' + character - '['));
		}
		else if (character == '`') {
			// `: (%)W
			extendedContent.append("bW");
		}
		else if (character <= 'z') {
			// a - z: (*)A - (*)Z
			extendedContent.push_back('d');
			extendedContent.push_back((char)('A' + character - 'a'));
		}
		else if (character <= 127) {
			// { - DEL: (%)P - (%)T
			extendedContent.push_back('b');
			extendedContent.push_back((char)('P' + character - '{'));
		}
		else {
			throw std::invalid_argument(std::string("Requested content contains a non-encodable character: '") + (char)character + "'");
		}
	}
	return extendedContent;
}

BitMatrix
Code93Writer::encode(const std::wstring& contents_, int width, int height) const
{
	std::string contents = Code93ConvertToExtended(contents_);

	size_t length = contents.length();
	if (length == 0) {
		throw std::invalid_argument("Found empty contents");
	}
	if (length > 80) {
		throw std::invalid_argument("Requested contents should be less than 80 digits long after converting to extended encoding");
	}

	//length of code + 2 start/stop characters + 2 checksums, each of 9 bits, plus a termination bar
	size_t codeWidth = (contents.length() + 2 + 2) * 9 + 1;

	std::vector<bool> result(codeWidth, false);

	//start character (*)
	int pos = AppendPattern(result, 0, ASTERISK_ENCODING);

	for (size_t i = 0; i < length; i++) {
		int indexInString = IndexOf(ALPHABET, contents[i]);
		pos += AppendPattern(result, pos, CHARACTER_ENCODINGS[indexInString]);
	}

	//add two checksums
	int check1 = ComputeChecksumIndex(contents, 20);
	pos += AppendPattern(result, pos, CHARACTER_ENCODINGS[check1]);

	//append the contents to reflect the first checksum added
	contents += static_cast<wchar_t>(ALPHABET[check1]);

	int check2 = ComputeChecksumIndex(contents, 15);
	pos += AppendPattern(result, pos, CHARACTER_ENCODINGS[check2]);

	//end character (*)
	pos += AppendPattern(result, pos, ASTERISK_ENCODING);

	//termination bar (single black bar)
	result[pos] = true;

	return WriterHelper::RenderResult(result, width, height, _sidesMargin >= 0 ? _sidesMargin : 10);
}

BitMatrix Code93Writer::encode(const std::string& contents, int width, int height) const
{
	return encode(FromUtf8(contents), width, height);
}

} // namespace ZXing::OneD


text:
package com.redhat.ceylon.compiler.java.test.issues.bug15xx.bug1581;

import java.util.Properties;

public class Bug1581Java {
    private Properties p;

    public Bug1581Java(Properties props) {
        // Just doing something with Properties, doesn't matter what
        p = new Properties(props);
    }

    public Properties getProps() {
        return p;
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ SPDX-FileCopyrightText: 2020, microG Project Team
  ~ SPDX-License-Identifier: Apache-2.0
  -->

<resources>
    <string name="menu_advanced">Дополнительно</string>

    <string name="list_no_item_none">Пусто</string>
</resources>


text:
package org.araneaframework.uilib.list.structure.order;

import java.util.Comparator;
import org.araneaframework.Environment;
import org.araneaframework.backend.list.memorybased.ComparatorExpression;
import org.araneaframework.backend.list.memorybased.compexpr.VariableComparatorExpression;
import org.araneaframework.uilib.list.OrderInfo;

/**
 * @author Rein Raudjärv
 */
public class SimpleFieldOrder implements FieldOrder {

  private String fieldId;

  private Comparator<?> comparator;

  public SimpleFieldOrder(String fieldId, Comparator<?> comparator) {
    setFieldId(fieldId);
    setComparator(comparator);
  }

  public SimpleFieldOrder(String fieldId) {
    this(fieldId, null);
  }

  public String getFieldId() {
    return this.fieldId;
  }

  public void setFieldId(String id) {
    this.fieldId = id;
  }

  public Comparator<?> getComparator() {
    return this.comparator;
  }

  public void setComparator(Comparator<?> comparator) {
    this.comparator = comparator;
  }

  public void init(Environment env) {}

  public void destroy() {}

  public ComparatorExpression buildComparatorExpression(OrderInfo orderInfo) {
    if (this.fieldId == null) {
      throw new RuntimeException("Column Id must be provided");
    }
    return new VariableComparatorExpression(getFieldId(), getComparator());
  }
}


text:
package java.sql;

import java.io.Serializable;

/**
 * An exception class that holds information about Database access warnings.
 */
public class SQLWarning extends SQLException implements Serializable {

    private static final long serialVersionUID = 3917336774604784856L;

    /**
     * Creates an SQLWarning object. The Reason string is set to null, the
     * SQLState string is set to null and the Error Code is set to 0.
     */
    public SQLWarning() {
        super();
    }

    /**
     * Creates an SQLWarning object. The Reason string is set to the given
     * reason string, the SQLState string is set to null and the Error Code is
     * set to 0.
     *
     * @param theReason
     */
    public SQLWarning(String theReason) {
        super(theReason);
    }

    /**
     * Creates an SQLWarning object. The Reason string is set to the given
     * reason string, the SQLState string is set to the given SQLState string
     * and the Error Code is set to 0.
     *
     * @param theReason
     *            the string to use as the Reason string
     * @param theSQLState
     *            the string to use as the SQLState string
     */
    public SQLWarning(String theReason, String theSQLState) {
        super(theReason, theSQLState);
    }

    /**
     * Creates an SQLWarning object. The Reason string is set to the given
     * reason string, the SQLState string is set to the given SQLState string
     * and the Error Code is set to the given ErrorCode value.
     *
     * @param theReason
     * @param theSQLState
     * @param theErrorCode
     */
    public SQLWarning(String theReason, String theSQLState, int theErrorCode) {
        super(theReason, theSQLState, theErrorCode);
    }

    /**
     * Gets the SQLWarning chained to this SQLWarning object.
     *
     * @return the SQLWarning chained to this SQLWarning. null if no SQLWarning
     *         is chained to this SQLWarning.
     */
    public SQLWarning getNextWarning() { return null; }

    /**
     * Chains a supplied SQLWarning to this SQLWarning.
     *
     * @param w
     *            the SQLWarning to chain to this SQLWarning.
     */
    public void setNextWarning(SQLWarning w) {
        super.setNextException(w);
    }
}


text:
package main

import (
	"embed"
	"encoding/json"
	"errors"
	"flag"
	"fmt"
	"io/ioutil"
	"os"
	"os/exec"
	"path/filepath"
	"regexp"
	"strings"
	"text/template"

	"github.com/rs/zerolog"
	"github.com/rs/zerolog/log"
	"gopkg.in/yaml.v3"
)

type SamTemplate struct {
	TemplateFormatVersion string                  `yaml:"AWSTemplateFormatVersion"`
	Transform             string                  `yaml:"Transform"`
	Resources             map[string]*SamResource `yaml:"Resources"`
}

type SamResource struct {
	Type       string                 `yaml:"Type"`
	Properties map[string]interface{} `yaml:"Properties"`
}

type arrayFlags []string

var templateDir string = "templates/"
var generateDockerfile bool = true
var dockerfilePath string = "Dockerfile"
var generateTerraform bool = true
var terraformPath string = "./"
var projectId string = ""
var containerRegistry string = ""
var containerTag string = "latest"
var additionalVars arrayFlags
var additionalVarsJson arrayFlags
var targetDir string = "."

//go:embed templates/*.tpl
var fs embed.FS

func (i *arrayFlags) String() string {
	// change this, this is just can example to satisfy the interface
	return fmt.Sprintf("%v", *i)
}

func (i *arrayFlags) Set(value string) error {
	*i = append(*i, strings.TrimSpace(value))
	return nil
}

func (r SamResource) getStringProperty(properties map[string]interface{}, key string, mustHave bool) string {
	if _, ok := properties[key]; ok {
		return properties[key].(string)
	} else {
		if mustHave {
			log.Fatal().Str("property", key).Msg("Missing required property")
		}
	}
	return ""
}

func (r SamResource) getInt64Property(properties map[string]interface{}, key string, mustHave bool) int64 {
	if _, ok := properties[key]; ok {
		return properties[key].(int64)
	} else {
		if mustHave {
			log.Fatal().Str("property", key).Msg("Missing required property")
		}
	}
	return 0
}

func makeMap(args ...string) map[string]string {
	ret := make(map[string]string, len(args)/2)
	for i := 0; i < len(args); i++ {
		ret[args[i]] = args[i+1]
		i += 1
	}
	return ret
}

func addToMap(add map[string]string, key string, val string) map[string]string {
	add[key] = val
	return add
}

func getTemplateFunctions() *template.FuncMap {
	funcMap := template.FuncMap{
		"MakeMap":   makeMap,
		"AddToMap":  addToMap,
		"HasSuffix": strings.HasSuffix,
		"ToLower":   strings.ToLower,
	}
	return &funcMap
}

func ensureDirectory(dir string) {
	dirStat, err := os.Stat(dir)
	if os.IsNotExist(err) {
		log.Info().Str("directory", dir).Msg("Creating subdirectory")
		err = os.MkdirAll(dir, 0770)
		if err != nil {
			log.Fatal().Err(err).Str("directory", dir).Msg("Failed to create subdirectory")
		}
	} else if !dirStat.IsDir() {
		log.Fatal().Err(err).Str("directory", dir).Msg("Subdirectory existing and is not a directory")
	}
}

func (resource SamResource) getTemplateVariables(name string) *map[string]interface{} {
	handler := resource.getStringProperty(resource.Properties, "Handler", true)
	runtime := resource.getStringProperty(resource.Properties, "Runtime", true)
	codeURI := resource.getStringProperty(resource.Properties, "CodeUri", true)
	if !strings.HasSuffix(codeURI, "/") {
		codeURI = fmt.Sprintf("%s/", codeURI)
	}
	packageType := resource.getStringProperty(resource.Properties, "PackageType", false)
	if packageType == "" {
		packageType = "Zip"
	}
	templateVars := map[string]interface{}{
		"Name":        name,
		"Runtime":     runtime,
		"CodeUri":     codeURI,
		"Handler":     handler,
		"PackageType": packageType,
		"Registry":    containerRegistry,
		"ProjectId":   projectId,
		"Tag":         containerTag,
		"Environment": map[string]interface{}{
			"Variables": map[string]interface{}{},
		},
	}

	if _, ok := resource.Properties["Environment"]; ok {
		environment := resource.Properties["Environment"].(map[string]interface{})
		if _, ok = environment["Variables"]; ok {
			(templateVars["Environment"].(map[string]interface{}))["Variables"] = environment["Variables"]
		}
	}

	for _, tVar := range additionalVars {
		s := strings.SplitN(tVar, "=", 2)
		templateVars[s[0]] = s[1]
	}

	for _, tVar := range additionalVarsJson {
		var v interface{}
		s := strings.SplitN(tVar, "=", 2)
		if err := json.Unmarshal([]byte(s[1]), &v); err != nil {
			log.Fatal().Err(err).Msg("Failed to parse JSON parameter")
		}
		templateVars[s[0]] = v
	}

	return &templateVars
}

func (resource SamResource) renderDockerfile(name string, dockerfile string) error {
	templateVars := resource.getTemplateVariables(name)

	runtimeRE := regexp.MustCompile(`[0-9].*$`)
	runtimeTemplate := runtimeRE.ReplaceAllString((*templateVars)["Runtime"].(string), "")

	templateFile := fmt.Sprintf("%s%s.tpl", templateDir, runtimeTemplate)
	commonTemplateFile := fmt.Sprintf("%scommon.tpl", templateDir)
	tmpl, err := template.New(fmt.Sprintf("%s.tpl", runtimeTemplate)).
		Funcs(*getTemplateFunctions()).
		ParseFiles(commonTemplateFile, templateFile)
	if err != nil {
		return err
	}

	log.Info().Str("file", dockerfile).Str("template", filepath.Base(templateFile)).Msg("Creating Dockerfile file")
	f, err := os.OpenFile(dockerfile, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0640)
	if err != nil {
		return err
	}
	defer f.Close()

	err = tmpl.Execute(f, templateVars)
	if err != nil {
		return err
	}
	f.Close()

	return nil
}

func (resource SamResource) renderTerraform(name string, dir string) error {
	terraformTemplateGlob := fmt.Sprintf("%s/terraform_*.tpl", templateDir)
	terraformTemplates, err := filepath.Glob(terraformTemplateGlob)
	if err != nil {
		return err
	}

	for _, templateFile := range terraformTemplates {
		templateBasename := strings.ReplaceAll(filepath.Base(templateFile), "terraform_", "")
		templateBasename = strings.ReplaceAll(templateBasename, ".tpl", "")
		tmpl, err := template.New(filepath.Base(templateFile)).
			Funcs(*getTemplateFunctions()).
			ParseFiles(templateFile)
		if err != nil {
			return err
		}

		resultPath := fmt.Sprintf("%s/%s", filepath.Clean(dir), templateBasename)
		log.Info().Str("file", resultPath).Str("template", filepath.Base(templateFile)).Msg("Creating Terraform file")
		f, err := os.OpenFile(resultPath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0640)
		if err != nil {
			return err
		}
		defer f.Close()

		err = tmpl.Execute(f, resource.getTemplateVariables(name))
		if err != nil {
			return err
		}
		f.Close()
	}

	return nil
}

func main() {
	log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr})

	exe, err := os.Executable()
	if err != nil {
		log.Fatal().Err(err).Msg("unable to determine binary location")
	}
	templateDir = fmt.Sprintf("%s/templates/", filepath.Dir(exe))

	log.Info().Msg("Lambda compatibility tool for Cloud Run")

	flag.StringVar(&templateDir, "template-dir", templateDir, "location of Dockerfile and Terraform templates")
	flag.StringVar(&targetDir, "target-dir", targetDir, "directory to create Dockerfile and Terraform files in")
	flag.BoolVar(&generateDockerfile, "dockerfile", true, "generate Dockerfile")
	flag.StringVar(&dockerfilePath, "dockerfile-path", dockerfilePath, "path and filename for Dockerfile")
	flag.BoolVar(&generateTerraform, "terraform", true, "generate Terraform files")
	flag.StringVar(&terraformPath, "terraform-path", terraformPath, "path for Terraform files")
	flag.StringVar(&projectId, "project-id", projectId, "GCP project ID")
	flag.StringVar(&containerRegistry, "registry", containerRegistry, "Container registry to use (eg. docker.pkg.dev/project-id/registry)")
	flag.StringVar(&containerTag, "tag", containerTag, "Container image tag")
	flag.Var(&additionalVars, "var", "Additional template variable (key=value)")
	flag.Var(&additionalVarsJson, "var-json", "Additional template variable in JSON (key={\"foo\":\"bar\"})")
	flag.Parse()

	if !strings.HasSuffix(templateDir, "/") {
		templateDir = templateDir + "/"
	}

	if _, err := os.Stat(templateDir + "common.tpl"); errors.Is(err, os.ErrNotExist) {
		if _, err := os.Stat(templateDir + "common.tpl"); errors.Is(err, os.ErrNotExist) {
			log.Info().Str("directory", templateDir).Msg("Creating template directory")
			err = os.MkdirAll(templateDir, 0770)
			if err != nil {
				log.Fatal().Err(err).Str("directory", templateDir).Msg("Failed to create template directory")
			}
		}
		templates := []string{
			"common.tpl",
			"dotnetcore.tpl",
			"go.tpl",
			"java.tpl",
			"nodejs.tpl",
			"python.tpl",
			"ruby.tpl",
			"terraform_main.tf.tpl",
			"terraform_outputs.tf.tpl",
			"terraform_variables.tf.tpl",
			"terraform_versions.tf.tpl",
		}
		log.Info().Str("directory", templateDir).Msg("Writing embedded templates to disk")
		for _, tpl := range templates {
			contents, err := fs.ReadFile(fmt.Sprintf("templates/%s", tpl))
			if err != nil {
				log.Fatal().Err(err).Msg("Failed to retrieve embedded template")
			}
			err = ioutil.WriteFile(fmt.Sprintf("%s/%s", templateDir, tpl), contents, 0664)
			if err != nil {
				log.Fatal().Err(err).Msg("Failed to write embedded template")
			}
		}

	}

	var containerBuilders []string = []string{
		"buildah",
		"podman",
		"nerdctl",
	}
	var containerBuilder string = "docker"
	for _, bin := range containerBuilders {
		_, err := exec.LookPath(bin)
		if err == nil {
			containerBuilder = bin
			break
		}
	}

	if !strings.HasSuffix(containerRegistry, "/") {
		containerRegistry = strings.TrimSuffix(containerRegistry, "/")
	}

	if len(flag.Args()) == 0 {
		log.Fatal().Msg("Specify at least one template to process")
	}

	for _, fileName := range flag.Args() {
		var template SamTemplate
		yamlFile, err := ioutil.ReadFile(fileName)
		if err != nil {
			log.Fatal().Str("file", fileName).Err(err).Msg("Failed to load configuration file")
		}
		err = yaml.Unmarshal(yamlFile, &template)
		if err != nil {
			log.Fatal().Str("file", fileName).Err(err).Msg("Failed to decode YAML")
		}
		log.Info().Str("file", fileName).Msg("Processing SAM template file")

		for name, resource := range template.Resources {
			if resource.Type == "AWS::Serverless::Function" {
				subdir := filepath.Clean(fmt.Sprintf("%s/%s", filepath.Clean(targetDir), name)) + "/"
				if generateDockerfile {
					ensureDirectory(subdir)
					dockerfile := fmt.Sprintf("%s%s", subdir, dockerfilePath)

					err := resource.renderDockerfile(name, dockerfile)
					if err != nil {
						log.Fatal().Str("file", fileName).Str("resource", name).Err(err).Msg("Failed to render Dockerfile for resource")
					}
					if containerRegistry != "" {
						log.Info().Msg("To build container, run:")
						log.Info().Msg(fmt.Sprintf("  %s build -t %s/%s:%s -f %s/Dockerfile .", containerBuilder, containerRegistry, strings.ToLower(name), containerTag, name))
					}
				}

				if generateTerraform {
					terraformSubdir := fmt.Sprintf("%s%s", subdir, terraformPath)
					ensureDirectory(terraformSubdir)

					err := resource.renderTerraform(name, terraformSubdir)
					if err != nil {
						log.Fatal().Str("file", fileName).Str("resource", name).Err(err).Msg("Failed to render Terraform for resource")
					}
				}

			} else {
				log.Debug().Str("type", resource.Type).Msg("Unknown resource type ignored")
			}
		}

	}
}


text:
@class ABtestCase, NSMutableDictionary, NSString;

@interface ABtestMgr : MMService <MMService, IMsgExt>
{
    NSMutableDictionary *dicTestSetting;
    NSMutableDictionary *dicTestPoint;
    ABtestCase *oldTestCase;
    NSMutableDictionary *dicTestPointPeriod;
    unsigned long long autoincrement;
}

- (void).cxx_destruct;
- (void)reportActionResult:(id)arg1 actionScene:(unsigned long long)arg2;
- (void)report:(unsigned long long)arg1 actionResult:(id)arg2 actionScene:(unsigned long long)arg3;
- (void)setIgnoreForEver:(unsigned long long)arg1;
- (_Bool)isIgnorePoint:(unsigned long long)arg1;
- (_Bool)hasABtestPoint:(unsigned long long)arg1;
- (id)getValue:(unsigned long long)arg1;
- (void)setCheckID:(unsigned long long)arg1 point:(unsigned long long)arg2 obj:(id)arg3;
- (void)setActionResult:(id)arg1 actionScene:(unsigned long long)arg2 point:(unsigned long long)arg3 obj:(id)arg4;
- (void)setActionResult:(id)arg1 point:(unsigned long long)arg2 obj:(id)arg3;
- (void)setEnd:(unsigned long long)arg1 obj:(id)arg2;
- (void)setEnd:(unsigned long long)arg1 obj:(id)arg2 actionResult:(unsigned long long)arg3;
- (void)setEnd:(unsigned long long)arg1 obj:(id)arg2 actionResultString:(id)arg3;
- (void)setStart:(unsigned long long)arg1 obj:(id)arg2 checkID:(unsigned long long)arg3;
- (_Bool)isABtesting:(unsigned long long)arg1 obj:(id)arg2;
- (id)getABtestPoint:(unsigned long long)arg1 obj:(id)arg2;
- (id)getKeyFromPointID:(unsigned long long)arg1 obj:(id)arg2;
- (id)getEffectiveAbTestPoint:(unsigned long long)arg1;
- (void)OnGetNewXmlMsg:(id)arg1 Type:(id)arg2 MsgWrap:(id)arg3;
- (id)getABtestFilePath;
- (id)getABtestSettingFilePath;
- (void)initABtestPoints:(id)arg1;
- (void)initABtentCases:(struct XmlReaderNode_t *)arg1;
- (void)reportRemainTestPoint;
- (void)saveSetting;
- (void)removeSetting;
- (void)loadSetting;
- (void)dealloc;
- (id)init;
- (void)onServiceClearData;
- (void)onServiceTerminate;
- (void)onServiceReloadData;
- (void)onServiceInit;

// Remaining properties
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) unsigned long long hash;
@property(readonly) Class superclass;

@end


text:
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:omgandroid="http://schemas.android.com/apk/res-auto">

    <item
        android:id="@+id/menu_item_share"
        android:title="Share"
        omgandroid:actionProviderClass="android.support.v7.widget.ShareActionProvider"
        omgandroid:showAsAction="ifRoom"/>
</menu>
<!-- From: file:/C:/Users/CK/AndroidStudioProjects/OMGAndroid/app/src/main/res/menu/menu_main.xml -->


text:
package jeffaschenk.commons.standards.statecodes;

import jeffaschenk.commons.standards.CountryCode;

/**
 * Official ISO-3166 State/Province Codes
 * <p/>
 * Country: Guyana
 *
 * @author jeffaschenk@gmail.com
 *         Date: May 19, 2010
 *         Time: 12:12:11 PM
 */
@SuppressWarnings("unused")
public enum StateCodes_GY {
    /**
     * State Code Enumerator
     */
    GY_BA("Barima-Waini","GY-BA","Region","14605", CountryCode.GUYANA),
    GY_CU("Cuyuni-Mazaruni","GY-CU","Region","14612",CountryCode.GUYANA),
    GY_DE("Demerara-Mahaica","GY-DE","Region","14606",CountryCode.GUYANA),
    GY_EB("East Berbice-Corentyne","GY-EB","Region","14611",CountryCode.GUYANA),
    GY_ES("Essequibo Islands-West Demerara","GY-ES","Region","14607",CountryCode.GUYANA),
    GY_MA("Mahaica-Berbice","GY-MA","Region","14608",CountryCode.GUYANA),
    GY_PM("Pomeroon-Supenaam","GY-PM","Region","14604",CountryCode.GUYANA),
    GY_PT("Potaro-Siparuni","GY-PT","Region","14609",CountryCode.GUYANA),
    GY_UD("Upper Demerara-Berbice","GY-UD","Region","14603",CountryCode.GUYANA),
    GY_UT("Upper Takutu-Upper Essequibo","GY-UT","Region","14610",CountryCode.GUYANA);

    // *************************************
    // Common Enum Structure for all
    // States of the World
    private final String stateProvinceName;

    private final String stateCode;

    private final String stateProvinceType;

    private final String stateNumericCode;

    private final CountryCode countryCode;

    StateCodes_GY(String stateProvinceName, String stateCode, String stateProvinceType, String stateNumericCode, CountryCode countryCode) {
        this.stateProvinceName = stateProvinceName;
        this.stateCode = stateCode;
        this.stateProvinceType = stateProvinceType;
        this.stateNumericCode = stateNumericCode;
        this.countryCode = countryCode;
    }

    public String stateProvinceName() {
        return this.stateProvinceName;
    }

    public String stateCode() {
        return this.stateCode;
    }

    public String stateProvinceType() {
        return this.stateProvinceType;
    }

    public String stateNumericCode() {
        return this.stateNumericCode;
    }

    public CountryCode countryCode() {
        return this.countryCode;
    }

}


text:
## Hyperledger Fabric Client (HFC) SDK for Node.js

The Hyperledger Fabric Client (HFC) SDK provides a powerful and easy to use API
to interact with a Hyperledger Fabric blockchain.

This document assumes that you already have set up a Node.js development
environment. If not, go [here](https://nodejs.org/en/download/package-manager/)
to download and install Node.js for your OS. You'll also want the latest version
of `npm` installed. For that, execute `sudo npm install npm -g` to get the
latest version.

### Installing the hfc module

We publish the `hfc` node module to `npm`. To install `hfc` from npm simply
execute the following command:

```
npm install -g hfc
```

## Overview

The sections in this document are as follows:

* The [Getting Started](#getting-started) section is intended to help you
quickly get a feel for HFC, how to use it, and some of its common capabilities.
This is demonstrated by example.

* The [Getting Set Up](#getting-set-up) section shows you how to set up up your
environment and how to [run the unit tests](#running-unit-tests). Looking at the
implementation of the unit tests will also help you learn more about the APIs by
example, including asset management and confidentiality.

## Getting Started
This purpose of this section is to help you quickly get a feel for HFC and how
you may use it. It is not intended to demonstrate all of its power, but to
demonstrate common use cases by example.

### Some basic terminology
First, there is some basic terminology you should understand. In order to
transact on a hyperledger blockchain, you must first have an identity which has
been both **registered** and **enrolled**.

Think of **registration** as *issuing a user invitation* to join a blockchain.
It consists of adding a new user name (also called an *enrollment ID*) to the
membership service configuration. This can be done programatically with the
`Member.register` method, or by adding the enrollment ID directly to the
[membersrvc.yaml](https://github.com/hyperledger/fabric/blob/master/membersrvc/membersrvc.yaml)
configuration file.

Think of **enrollment** as *accepting a user invitation* to join a blockchain.
This is always done by the entity that will transact on the blockchain. This can
be done programatically via the `Member.enroll` method.

### Learn by example
The best way to quickly learn HFC is by example.

The following example demonstrates a typical web app. The web app authenticates
a user and then transacts on a blockchain on behalf of that user.

```
/**
 * This example shows how to do the following in a web app.
 * 1) At initialization time, enroll the web app with the block chain.
 *    The identity must have already been registered.
 * 2) At run time, after a user has authenticated with the web app:
 *    a) register and enroll an identity for the user;
 *    b) use this identity to deploy, query, and invoke a chaincode.
 */

// To include the package from your hyperledger fabric directory:
//    var hfc = require("myFabricDir/sdk/node");
// To include the package from npm:
//      var hfc = require('hfc');
var hfc = require('hfc');

// Create a client chain.
// The name can be anything as it is only used internally.
var chain = hfc.newChain("targetChain");

// Configure the KeyValStore which is used to store sensitive keys
// as so it is important to secure this storage.
// The FileKeyValStore is a simple file-based KeyValStore, but you
// can easily implement your own to store whereever you want.
chain.setKeyValStore( hfc.newFileKeyValStore('/tmp/keyValStore') );

// Set the URL for member services
chain.setMemberServicesUrl("grpc://localhost:7054");

// Add a peer's URL
chain.addPeer("grpc://localhost:7051");

// Enroll "WebAppAdmin" which is already registered because it is
// listed in fabric/membersrvc/membersrvc.yaml with its one time password.
// If "WebAppAdmin" has already been registered, this will still succeed
// because it stores the state in the KeyValStore
// (i.e. in '/tmp/keyValStore' in this sample).
chain.enroll("WebAppAdmin", "DJY27pEnl16d", function(err, webAppAdmin) {
   if (err) return console.log("ERROR: failed to register %s: %s",err);
   // Successfully enrolled WebAppAdmin during initialization.
   // Set this user as the chain's registrar which is authorized to register other users.
   chain.setRegistrar(webAppAdmin);
   // Now begin listening for web app requests
   listenForUserRequests();
});

// Main web app function to listen for and handle requests
function listenForUserRequests() {
   for (;;) {
      // WebApp-specific logic goes here to await the next request.
      // ...
      // Assume that we received a request from an authenticated user
      // 'userName', and determined that we need to invoke the chaincode
      // with 'chaincodeID' and function named 'fcn' with arguments 'args'.
      handleUserRequest(userName,chaincodeID,fcn,args);
   }
}

// Handle a user request
function handleUserRequest(userName, chaincodeID, fcn, args) {
   // Register and enroll this user.
   // If this user has already been registered and/or enrolled, this will
   // still succeed because the state is kept in the KeyValStore
   // (i.e. in '/tmp/keyValStore' in this sample).
   var registrationRequest = {
        enrollmentID: userName,
        // Customize account & affiliation
        account: "bank_a",
        affiliation: "00001"
   };
   chain.registerAndEnroll( registrationRequest, function(err, user) {
      if (err) return console.log("ERROR: %s",err);
      // Issue an invoke request
      var invokeRequest = {
        // Name (hash) required for invoke
        chaincodeID: chaincodeID,
        // Function to trigger
        fcn: fcn,
        // Parameters for the invoke function
        args: args
     };
     // Invoke the request from the user object.
     var tx = user.invoke(invokeRequest);
     // Listen for the 'submitted' event
     tx.on('submitted', function(results) {
        console.log("submitted invoke: %j",results);
     });
     // Listen for the 'complete' event.
     tx.on('complete', function(results) {
        console.log("completed invoke: %j",results;
     });
     // Listen for the 'error' event.
     tx.on('error', function(err) {
        console.log("error on invoke: %j",err);
     });
   });
}
```

## Getting Set Up

First, you'll want to have a running peer node and CA. You can follow the
instructions for setting up a network
[here](https://github.com/hyperledger/fabric/blob/master/docs/Setup/ca-setup.md#Operating-the-CA),
and start a single peer node and CA.

### Chaincode Deployment Directory Structure

To have the chaincode deployment succeed in network mode, you must properly set
up the chaincode project outside of your Hyperledger Fabric source tree. The
following instructions will demonstrate how to properly set up the directory
structure to deploy *chaincode_example02* in network mode.

The chaincode project must be placed under the `$GOPATH/src` directory. For
example, the
[chaincode_example02](https://github.com/hyperledger/fabric/blob/master/examples/chaincode/go/chaincode_example02/chaincode_example02.go)
project should be placed under `$GOPATH/src/` as shown below.

```
mkdir -p $GOPATH/src/github.com/chaincode_example02/
cd $GOPATH/src/github.com/chaincode_example02
curl GET https://raw.githubusercontent.com/hyperledger/fabric/master/examples/chaincode/go/chaincode_example02/chaincode_example02.go > chaincode_example02.go
```

After you have placed your chaincode project under the `$GOPATH/src`, you will need to vendor the dependencies. From the directory containing your chaincode source, run the following commands:

```
go get -u github.com/kardianos/govendor
cd $GOPATH/src/github.com/chaincode_example02
govendor init
govendor fetch github.com/hyperledger/fabric
```

Now, execute `go build` to verify that all of the chaincode dependencies are
present.

```
go build
```

Next, we will switch over to the node sdk directory in the fabric repo to run
the node sdk tests, to make sure you have everything properly set up. Verify
that the
[chain-tests.js](https://github.com/hyperledger/fabric/blob/master/sdk/node/test/unit/chain-tests.js)
unit test file points to the correct chaincode project path. The default
directory is set to `github.com/chaincode_example02/` as shown below. If you
placed the sample chaincode elsewhere, then you will need to change that.

```
// Path to the local directory containing the chaincode project under $GOPATH
var testChaincodePath = "github.com/chaincode_example02/";
```

**Note:** You will need to run `npm install` the first time you run the sdk
tests, in order to install all of the dependencies. Set the `DEPLOY_MODE`
environment variable to `net` and run the chain-tests as follows:

```
cd $GOPATH/src/github.com/hyperledger/fabric/sdk/node
npm install
export DEPLOY_MODE='net'
node test/unit/chain-tests.js | node_modules/.bin/tap-spec
```

### Enabling TLS

If you wish to configure TLS with the Membership Services server, the following
steps are required:

- Modify `$GOPATH/src/github.com/hyperledger/fabric/membersrvc/membersrvc.yaml` as follows:

```
server:
     tls:
        cert:
            file: "/var/hyperledger/production/.membersrvc/tlsca.cert"
        key:
            file: "/var/hyperledger/production/.membersrvc/tlsca.priv"
```

To specify to the Membership Services (TLS) Certificate Authority (TLSCA) what
X.509 v3 Certificate (with a corresponding Private Key) to use:

- Modify `$GOPATH/src/github.com/hyperledger/fabric/peer/core.yaml` as follows:

```
peer:
    pki:
        tls:
            enabled: true
            rootcert:
                file: "/var/hyperledger/production/.membersrvc/tlsca.cert"
```

To configure the peer to connect to the Membership Services server over TLS
(otherwise, the connection will fail).

- Bootstrap your Membership Services and the peer. This is needed in order to
have the file *tlsca.cert* generated by the member services.

- Copy `/var/hyperledger/production/.membersrvc/tlsca.cert` to
`$GOPATH/src/github.com/hyperledger/fabric/sdk/node`.

*Note:* If you cleanup the folder `/var/hyperledger/production` then don't
forget to copy again the *tlsca.cert* file as described above.

## Running Unit Tests
HFC includes a set of unit tests implemented with the
[tape framework](https://github.com/substack/tape). The
[unit test script](https://github.com/hyperledger/fabric/blob/master/sdk/node/bin/run-unit-tests.sh)
builds and runs both the membership service server and the peer node for you,
therefore you do not have to start those manually.

### Running the SDK unit tests
HFC includes a set of unit tests implemented with the
[tape framework](https://github.com/substack/tape). To run the unit tests,
execute the following commands:

    cd $GOPATH/src/github.com/hyperledger/fabric
    make node-sdk-unit-tests

The following are brief descriptions of each of the unit tests that are being
run.

#### registrar
The [registrar.js](https://github.com/hyperledger/fabric/blob/master/sdk/node/test/unit/registrar.js)
test case exercises registering users with Membership Services. It also tests
registering a designated registrar user which can then register additional users.

#### chain-tests
The [chain-tests.js](https://github.com/hyperledger/fabric/blob/master/sdk/node/test/unit/chain-tests.js)
test case exercises the [chaincode_example02.go](https://github.com/hyperledger/fabric/tree/master/examples/chaincode/go/chaincode_example02)
chaincode when it has been deployed in both development mode and network mode.

#### asset-mgmt
The [asset-mgmt.js](https://github.com/hyperledger/fabric/blob/master/sdk/node/test/unit/asset-mgmt.js)
test case exercises the [asset_management.go](https://github.com/hyperledger/fabric/tree/master/examples/chaincode/go/asset_management)
chaincode when it has been deployed in both development mode and network mode.

#### asset-mgmt-with-roles
The [asset-mgmt-with-roles.js](https://github.com/hyperledger/fabric/blob/master/sdk/node/test/unit/asset-mgmt-with-roles.js)
test case exercises the [asset_management_with_roles.go](https://github.com/hyperledger/fabric/tree/master/examples/chaincode/go/asset_management_with_roles)
chaincode when it has been deployed in both development mode and network mode.

#### Troublingshooting
If you see errors stating that the client has already been registered/enrolled,
keep in mind that you can perform the enrollment process only once, as the
enrollmentSecret is a one-time-use password. You will see these errors if you
have performed a user registration/enrollment and subsequently deleted the
cryptographic tokens stored on the client side. The next time you try to enroll,
errors similar to the ones below will be seen.

   ```
   Error: identity or token do not match
   ```
   ```
   Error: user is already registered
   ```

To address this, remove any stored cryptographic material from the CA server by
following the instructions [here](https://github.com/hyperledger/fabric/blob/master/docs/Setup/Chaincode-setup.md#removing-temporary-files-when-security-is-enabled).
You will also need to remove any of the cryptographic tokens stored on the
client side by deleting the KeyValStore directory. That directory is
configurable and is set to `/tmp/keyValStore` within the unit tests.


text:
import { Collection } from "discord.js";
import Rethinkdb from "rethinkdbdash";
import { EventEmitter } from "events";

import WebcordClient from "./WebcordClient";
import WebcordCommand from "./WebcordCommand";
import logger from "config/logger";

export default class WebcordService extends EventEmitter {
    constructor(client, { name, table, serviceOnly = false }) {
        super();
        this.debug = require("debug")(name);

        this.debug(`Setting up ${name}Service`);

        /**
         * @type {WebcordClient}
         */
        this.client = client;

        /**
         * Service name
         * @type {string}
         */
        this.name = name;

        /**
         * DB table name
         * @type {string}
         */
        this.tableName = table || name;

        /**
         * If true, will omit commandGroup creation and just initializes it as a Feathers service instead
         * @type {boolean}
         */
        this.serviceOnly = serviceOnly;

        // Feathers exposes basic crud methods to the client, so registering them directly on the service
        // will make it easy to automagically connect the client and the bot's commands together via the
        // runCommand hook (hooks/command-hook.js)
        this.commands = {
            find: {},
            get: {},
            create: {},
            update: {},
            patch: {},
            remove: {},
        };

        // the events property (should) define what events get emitted to the clients
        this.events = ["created", "updated", "patched", "removed"];

        this.on("serviceCommandRegistered", ({ name }) => {
            logger.debug(`Registered command ${name} on service ${this.name}`);
        });
    }

    get db() {
        return this.client.db;
    }

    get table() {
        return this.db.table(this.tableName);
    }

    registerCommands = (commands) => {
        for(const Command of commands) {
            const command = new Command(this.client, this.name);

            if(!this.serviceOnly)
                this.client.registry.registerCommand(command);

            if(!(command instanceof WebcordCommand))
                continue;

            if(!command.method) {
                logger.warn(`Cannot register command ${command.name} as a Feathers command; method name was not provided`);
                continue;
            }

            this.commands[command.method][command.name] = command;
            this.emit("serviceCommandRegistered", { name: command.name });
        }
        return this;
    }

    resolve(data) {
        return Promise.resolve(data);
    }

    reject(message) {
        return Promise.reject(new Error(message));
    }

    async create(data, opts = {}, runOpts = {}) {
        this.debug(`create() called with, data ${data}, opts ${opts}`);

        const finalOpts = Object.assign({
            returnChanges: true,
            conflict: "update",
        }, opts);
        const finalRunOpts = runOpts;

        this.debug(`create() final finalOpts: %O, finalRunOpts: %O`, finalOpts, finalRunOpts);

        const { changes, inserted, replaced, errors } = await this.table.insert(data, finalOpts).run(finalRunOpts);

        this.debug(`inserted ${inserted} records, updated ${replaced}, ${errors} errored`);

        this.emit("created", changes.new_val);
        return changes.new_val;
    }

    async update(id, data, opts = {}, runOpts = {}) {
        // this.debug(`.update() called with id %s, data %O, opts %O, runOpts %O`, id, data, opts, runOpts);

        const finalOpts = Object.assign({
            returnChanges: true,
        }, opts);

        const finalRunOpts = runOpts;

        this.debug(`update() final finalOpts: %O, finalRunOpts: %O`, finalOpts, finalRunOpts);

        const { changes, replaced, errors } = await this.table.get(id).update(data, finalOpts).run(finalRunOpts);

        this.debug(`updated ${replaced} records, ${errors} errored`);

        this.emit("updated", changes.new_val);
        return changes.new_val;
    }

    async replace(id, data, opts = {}, runOpts = {}) {
        this.debug(`.replace() called with id %s, data %O, opts %O, runOpts %O`, id, data, opts, runOpts);

        const finalOpts = Object.assign({
            returnChanges: true,
        }, opts);

        const finalRunOpts = runOpts;

        this.debug(`replace() final finalOpts: %O, finalRunOpts: %O`, finalOpts, finalRunOpts);

        const { changes, replaced, errors } = await this.table.get(id).replace(data, opts).run(finalRunOpts);

        this.debug(`replaced ${replaced} records, ${errors} errored`);

        this.emit("updated", changes.new_val);
        return changes.new_val;
    }

    async delete(id, opts = {}, runOpts = {}) {
        this.debug(`.replace() called with id %s, data %O, opts %O, runOpts %O`, id, opts, runOpts);

        const finalOpts = Object.assign({
            returnChanges: false,
        }, opts);

        const finalRunOpts = runOpts;

        this.debug(`delete() final finalOpts: %O, finalRunOpts: %O`, finalOpts, finalRunOpts);

        const { deleted, errors } = await this.table.get(id).delete(opts).run(finalRunOpts);

        this.debug(`deleted ${deleted} records, ${errors} errored`);

        deleted.length > 0 && this.emit("removed", id);
        return id;
    }

    onConnect() {

    }
}


text:
using System;
using System.Collections.Generic;

namespace ForumSystem.Web.Areas.Admin.Models.Users
{
    public class EditUserViewModel
    {
        public EditUserViewModel()
        {
            Roles = new List<string>();
        }

        public string FirstName { get; set; }

        public string LastName { get; set; }

        public string Signature { get; set; }

        public int BansCount { get; set; }

        public bool IsBanned { get; set; }

        public DateTime? BanExpiresOn { get; set; }

        public DateTime CreatedOn { get; set; }

        public DateTime? ModifiedOn { get; set; }

        public int VisitsCount { get; set; }

        public DateTime? LastLoginDate { get; set; }

        public string LastLoginIp { get; set; }

        public string CountryName { get; set; }

        public string CityName { get; set; }

        public string ImagePath { get; set; }

        public ICollection<string> Roles { get; set; }
        public string UserName { get; set; }

        public string Email { get; set; }
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Tarichium jaczewskii Zaprom.

### Remarks
null


text:
from thespian.actors import *

def create_actor(actor_system, plugin_class):
    return actor_system.createActor(plugin_class)

def delete_actor(actor_system, actor):
    return actor_system.ask(actor, ActorExitRequest())


text:
@interface ERNTableViewRepositoryRefreshController ()
@property (nonatomic, readonly) UITableView *tableView;
@end

@implementation ERNTableViewRepositoryRefreshController {
    id<ERNAsyncRepository> _repository;
}

#pragma mark - public - constructors

+(instancetype)createWithTableView:(UITableView *)tableView
                        repository:(id<ERNAsyncRepository>)repository
{
    return [[self alloc] initWithTableView:tableView
                                repository:repository];
}

#pragma mark - NSObject

-(void)dealloc
{
    [_repository removeObserver:self];
}

#pragma mark - private

-(void)repositoryRefreshed
{
    [[self tableView] reloadData];
}

#pragma mark - private- accessors

ERNLazyLoadGetter(id<ERNAsyncRepository>, repository, [ERNNullAsyncRepository create])

#pragma mark - private - initializers

-(id)initWithTableView:(UITableView *)tableView
            repository:(id<ERNAsyncRepository>)repository
{
    self = [super init];
    ERNCheckNil(self);
    _repository = repository;
    _tableView = tableView;
    [_repository addObserver:self
                    selector:@selector(repositoryRefreshed)];
    return self;
}

@end


text:
> This is a fork of [CliffCloud/Leaflet.Sleep](https://github.com/CliffCloud/Leaflet.Sleep).
It is a lighter version of the plugin, optimized for Mediawiki use case.

Leaflet's stock maps are event-greedy and interfere with scrolling.

`Leaflet.Sleep` is an interaction manager, helping your
map do what you want when you want.

### [demo](http://cliffcloud.github.io/Leaflet.Sleep)

## Use

Available on [npm](#npm), [bower](#bower), and straight from the single
[source](https://github.com/CliffCloud/Leaflet.Sleep/blob/master/Leaflet.Sleep.js)
file

`Leaflet.Sleep` is enabled by default, and can be disabled with the map's `sleep`
option.

### npm

[`npm install leaflet-sleep`](https://www.npmjs.com/package/leaflet-sleep)

### bower

`bower install leaflet-sleep`

## Config

These are the new options available for `L.map` and their defaults.

    {
        // false if you want an unruly map
        sleep: true,

        // time(ms) until map sleeps on mouseout
        sleepTime: 750,

        // time(ms) until map wakes on mouseover
        wakeTime: 750,

        // should the user receive wake instrurctions?
        sleepNote: true,

        // should hovering wake the map? (non-touch devices only)
        hoverToWake: true,

        // a message to inform users about waking the map
        wakeMessage: 'Click or Hover to Wake',

        // a constructor for a control button
        sleepButton: L.Control.sleepMapControl,

        // opacity for the sleeping map
        sleepOpacity: .7
    }

## MIT Licensed


text:
package monix.reactive.internal.operators

import minitest.TestSuite
import monix.execution.Ack.{Continue, Stop}
import monix.execution.schedulers.TestScheduler
import monix.execution.exceptions.DummyException
import monix.reactive.{Observable, Observer}
import scala.concurrent.{CancellationException, Future}
import scala.concurrent.duration._

object OnCancelTriggerErrorSuite extends TestSuite[TestScheduler] {
  def setup(): TestScheduler = TestScheduler()
  def tearDown(s: TestScheduler): Unit = {
    assert(s.state.tasks.isEmpty, "TestScheduler should have no pending tasks")
  }

  test("should work") { implicit s =>
    var errorThrow: Throwable = null
    var effect = 0
    val obs = Observable.now(1).delayExecution(1.second).onCancelTriggerError

    val c = obs.unsafeSubscribeFn(new Observer[Int] {
      def onNext(elem: Int) = { effect += elem; Continue }
      def onError(ex: Throwable): Unit = errorThrow = ex
      def onComplete(): Unit = fail("onComplete")
    })

    c.cancel()
    assertEquals(effect, 0)
    assert(
      errorThrow != null && errorThrow.isInstanceOf[CancellationException],
      "errorThrow should be CancellationException")
  }

  test("cannot cancel after complete") { implicit s =>
    var errorThrow: Throwable = null
    var effect = 0
    val obs = Observable.now(1).onCancelTriggerError

    val c = obs.unsafeSubscribeFn(new Observer[Int] {
      def onNext(elem: Int) = { effect += elem; Continue }
      def onError(ex: Throwable): Unit = errorThrow = ex
      def onComplete(): Unit = effect += 20
    })

    c.cancel()
    assertEquals(effect, 21)
    assertEquals(errorThrow, null)
  }

  test("cannot cancel after error") { implicit s =>
    val dummy = DummyException("dummy")
    var errorThrow: Throwable = null
    var effect = 0

    val obs: Observable[Int] = Observable.raiseError(dummy).onCancelTriggerError

    val c = obs.unsafeSubscribeFn(new Observer[Int] {
      def onNext(elem: Int) = { effect += elem; Continue }
      def onError(ex: Throwable): Unit = errorThrow = ex
      def onComplete(): Unit = fail("onComplete")
    })

    c.cancel()
    assertEquals(effect, 0)
    assertEquals(errorThrow, dummy)
  }

  test("cannot cancel after asynchronous stop") { implicit s =>
    var errorThrow: Throwable = null
    var effect = 0
    val obs = Observable.now(1).delayOnComplete(1.second).onCancelTriggerError

    val c = obs.unsafeSubscribeFn(new Observer[Int] {
      def onNext(elem: Int) = Future { effect += elem; Stop }
      def onError(ex: Throwable): Unit = errorThrow = ex
      def onComplete(): Unit = effect += 20
    })

    s.tick(); c.cancel()
    assertEquals(effect, 1)
    assertEquals(errorThrow, null)
  }
}


text:
<?php

namespace App\Modules\Core;

use App\Modules\Core\BaseClasses\Contracts\BaseFactoryInterface;
use Caffeinated\Modules\Facades\Module;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Str;
use stdClass;

class Core implements BaseFactoryInterface
{
    /**
     * Construct the repository class name based on
     * the method name called, search in the
     * given namespaces for the class and
     * return an instance.
     *
     * @param  string $name the called method name
     * @param  array  $arguments the method arguments
     * @return object
     */
    public function __call(string $name, array $arguments): object
    {
        foreach (Module::all() as $module) {
            $nameSpace = 'App\\Modules\\' . $module['basename'];
            $model = ucfirst(Str::singular($name));
            if (count($arguments) == 1 && $arguments[0]) {
                $class = $nameSpace . '\\Services\\' . $model . 'Service';
            } else {
                $class = $nameSpace . '\\Repositories\\' . $model . 'Repository';
            }

            if (class_exists($class)) {
                return App::make($class);
            }
        }

        return new stdClass;
    }
}


text:
package org.apache.camel.impl;

import org.apache.camel.ContextTestSupport;
import org.apache.camel.FailedToCreateRouteException;
import org.apache.camel.builder.RouteBuilder;

/**
 * @version
 */
public class RouteNoOutputTest extends ContextTestSupport {

    @Override
    protected void setUp() throws Exception {
        try {
            super.setUp();
            fail("Should have thrown exception");
        } catch (FailedToCreateRouteException e) {
            assertEquals("route1", e.getRouteId());
            assertIsInstanceOf(IllegalArgumentException.class, e.getCause());
            assertEquals("Route route1 has no output processors. You need to add outputs to the route such as to(\"log:foo\").", e.getCause().getMessage());
        }
    }

    public void testDummy() {
        // noop
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:start");
            }
        };
    }
}


text:
package com.orientechnologies.orient.core.storage.cache.local;

import com.orientechnologies.orient.core.storage.cache.OCacheEntry;
import com.orientechnologies.orient.core.storage.cache.local.HashLRUList;
import com.orientechnologies.orient.core.storage.cache.local.LRUList;

import java.util.Iterator;

/**
 * @author Artem Orobets (enisher-at-gmail.com)
 */
public class SynchronizedLRUList implements LRUList {
  private final LRUList underlying = new HashLRUList();

  @Override
  public synchronized OCacheEntry get(long fileId, long pageIndex) {
    return underlying.get(fileId, pageIndex);
  }

  @Override
  public synchronized OCacheEntry remove(long fileId, long pageIndex) {
    return underlying.remove(fileId, pageIndex);
  }

  @Override
  public synchronized void putToMRU(OCacheEntry cacheEntry) {
    underlying.putToMRU(cacheEntry);
  }

  @Override
  public synchronized void clear() {
    underlying.clear();
  }

  @Override
  public synchronized boolean contains(long fileId, long filePosition) {
    return underlying.contains(fileId, filePosition);
  }

  @Override
  public synchronized int size() {
    return underlying.size();
  }

  @Override
  public synchronized OCacheEntry removeLRU() {
    return underlying.removeLRU();
  }

  @Override
  public synchronized OCacheEntry getLRU() {
    return underlying.getLRU();
  }

  @Override
  public synchronized Iterator<OCacheEntry> iterator() {
    return underlying.iterator();
  }
}


text:
using System.Collections.Generic;

namespace Stripe
{
    public class StripeApplicationFeeService : StripeService
    {
        public StripeApplicationFeeService(string apiKey = null) : base(apiKey) { }

        public bool ExpandAccount { get; set; }
        public bool ExpandBalanceTransaction { get; set; }
        public bool ExpandCharge { get; set; }

        public virtual StripeApplicationFee Get(string applicationFeeId, StripeRequestOptions requestOptions = null)
        {
            requestOptions = SetupRequestOptions(requestOptions);

            var url = string.Format("{0}/{1}", Urls.ApplicationFees, applicationFeeId);
            url = this.ApplyAllParameters(null, url, false);

            var response = Requestor.GetString(url, requestOptions);

            return Mapper<StripeApplicationFee>.MapFromJson(response);
        }

        public virtual StripeApplicationFee Refund(string applicationFeeId, int? refundAmount = null, StripeRequestOptions requestOptions = null)
        {
            requestOptions = SetupRequestOptions(requestOptions);

            var url = string.Format("{0}/{1}/refund", Urls.ApplicationFees, applicationFeeId);
            url = this.ApplyAllParameters(null, url, false);

            if (refundAmount.HasValue)
                url = ParameterBuilder.ApplyParameterToUrl(url, "amount", refundAmount.Value.ToString());

            var response = Requestor.PostString(url, requestOptions);

            return Mapper<StripeApplicationFee>.MapFromJson(response);
        }

        public virtual IEnumerable<StripeApplicationFee> List(StripeApplicationFeeListOptions listOptions, StripeRequestOptions requestOptions = null)
        {
            requestOptions = SetupRequestOptions(requestOptions);

            var url = Urls.ApplicationFees;
            url = this.ApplyAllParameters(listOptions, url, true);

            var response = Requestor.GetString(url, requestOptions);

            return Mapper<StripeApplicationFee>.MapCollectionFromJson(response);
        }
    }
}


text:
=begin
= $RCSfile$ -- SSL/TLS enhancement for Net::HTTP.

= Info
  'OpenSSL for Ruby 2' project
  Copyright (C) 2003 Blaz Grilc <farmer@gmx.co.uk>
  All rights reserved.

= Licence
  This program is licenced under the same licence as Ruby.
  (See the file 'LICENCE'.)

= Requirements

= Version
  $Id$

= Notes
  Tested on FreeBSD 5-CURRENT and 4-STABLE
  - ruby 1.6.8 (2003-01-17) [i386-freebsd5]
  - OpenSSL 0.9.7a Feb 19 2003
  - ruby-openssl-0.2.0.p0
  tested on ftp server: glftpd 1.30
=end

require 'socket'
require 'openssl'
require 'net/ftp'

module Net
  class FTPTLS < FTP
    def connect(host, port=FTP_PORT)
      @hostname = host
      super
    end

    def login(user = "anonymous", passwd = nil, acct = nil)
       store = OpenSSL::X509::Store.new
       store.set_default_paths
       ctx = OpenSSL::SSL::SSLContext.new('SSLv23')
       ctx.cert_store = store
       ctx.verify_mode = OpenSSL::SSL::VERIFY_PEER
       ctx.key = nil
       ctx.cert = nil
       voidcmd("AUTH TLS")
       @sock = OpenSSL::SSL::SSLSocket.new(@sock, ctx)
       @sock.connect
       @sock.post_connection_check(@hostname)
       super(user, passwd, acct)
       voidcmd("PBSZ 0")
    end
  end
end


text:
Serial-Handshaking
==================

This example demonstrates the hardware handshaking mode (i.e. RTS/CTS) provided by the USART peripherals on AT91 microcontrollers. The practical  use of hardware handshaking is that it allows to stop transfer on the USART  without losing any data in the process. This is very useful for applications  that need to program slow memories for example.


text:
__Changes__

- templates:
  - `choco_bintray/install` to show a snippet to install the app from bintray using chocolatey
  - `linux/bintray_repo` to show a snippet to install the app from bintray `apt/dnf` repository.

__Contributors__

- mh-cbon

Released by mh-cbon, Tue 29 Aug 2017 -
[see the diff](https://github.com/mh-cbon/emd/compare/1.0.0...1.0.1#diff)
______________

### 1.0.0

__Changes__

- toc: fix link generator to remove colon
- close #26: avoid fatal error when a path is not recognized
- appveyor: close #28: fix badge urls

__Contributors__

- mh-cbon
- solvingJ

Released by mh-cbon, Thu 24 Aug 2017 -
[see the diff](https://github.com/mh-cbon/emd/compare/0.0.12...1.0.0#diff)
______________

### 0.0.12

__Changes__

- __cli__:
  - ensure data passed on the command line overwrites everthing else, fix #19.

- __dep__:
  - fixed glide lock, needed an update.

- __dev__:
  - Add provider tests

__Contributors__

- mh-cbon

Released by mh-cbon, Wed 10 May 2017 -
[see the diff](https://github.com/mh-cbon/emd/compare/0.0.11...0.0.12#diff)
______________

### 0.0.11

__Changes__

- __CLI__:
  - Fix an issue in argument handling.

- __Path detection__: #17
  - The mechanism to detect and extract information from the path,
    is improved to work with anything that matches src/[provider]/[user]/[repo]/[path...]

- __Temaplate func helpers__:
  - __pkg_doc__: won t panic anymore if the default `main.go` file is not yet created.

- __Temaplates__: #16
  - Fix templates output to avoid double `/`.

- __dev__:
  - Largely improved tests.

__Contributors__

- mh-cbon
- suntong

Released by mh-cbon, Sun 07 May 2017 -
[see the diff](https://github.com/mh-cbon/emd/compare/0.0.10...0.0.11#diff)
______________

### 0.0.10

__Changes__

- __CLI__:
  - new `init` command: Writes a basic `README.e.md` frile to get started
  - `gen`: removed useless confirmation message on successful operation.
  - `stdin`: emd can now receives the input template from STDIN.
  - verbosity: Added support for verbosity with env variable `VERBOSE=y`.

- __Predefined data__:
  - New api is introduced to better detect predefined data.
  - ProjectPath is better handled when its a symlink outside of `GOPATH` (#15 thanks suntong)

- __Prelude data__:
  - It is now possible to override predefined data within the prelude.
    This should allow the end user to recover from a buggy implementation in the pre defined variables declaration.

- __TOC__:
  - #16 Improve link generator to handle `[]|',`
  - Multiple fixes to properly render the TOC level of each header.

- __Template__: added multiple new functions to help to work with templates
  - __set__(name string, x interface{}): Save given value `x` as `name` on dot `.`.
  - __link__(url string, text ...string) string: Prints markdown link.
  - __img__(url string, alt ...string) string: Prints markdown image.
  - __concat__(x ...string) string: Concat given arguments.
  - __pathjoin__(x ...string) string: Join given arguments with `/`.

- __dev__:
  - added small test suites into `test.sh`

__Contributors__

- mh-cbon
- suntong

Released by mh-cbon, Sat 06 May 2017 -
[see the diff](https://github.com/mh-cbon/emd/compare/0.0.10-beta...0.0.10#diff)
______________

### 0.0.10-beta

__Changes__

- CLI:
  - new `init` command: Writes a basic `README.e.md` frile to get started
  - `gen`: removed useless confirmation message on successful operation.
- Predefined data:
  - New api is introduced to better detect predefined data.
- Prelude data:
  - It is now possible to override predefined data within the prelude.
    This should allow the end user to recover from a buggy implementation in the pre defined variables declaration.
- TOC:
  - #16 Improve link generator to handle `[]|',`
  - Multiple fixes to properly render the TOC level of each header.
- Template: added multiple new functions to help to work with templates
  - __set__(name string, x interface{}): Save given value `x` as `name` on dot `.`.
  - __link__(url string, text ...string) string: Prints markdown link.
  - __img__(url string, alt ...string) string: Prints markdown image.
  - __concat__(x ...string) string: Concat given arguments.
  - __pathjoin__(x ...string) string: Join given arguments with `/`.

__Contributors__

- mh-cbon

Released by mh-cbon, Mon 24 Apr 2017 -
[see the diff](https://github.com/mh-cbon/emd/compare/0.0.9...0.0.10-beta#diff)
______________

### 0.0.9

__Changes__

- feature #10: Emd file can define a prelude block of `yaml` data to inject into the template processing.
- cli fix: Before the -in argument was mandatory. It was not possible to use the default template.
- feature installer: Fixed apt/rpm repositories.
- feature #8: ensure an errored command line execution displays correctly.
- feature: added new template functions
  - __yaml__(file string, keypaths ...string): parses and build new yaml content of given file.
  - __preline__(pre , content string): prepends pre for every lines of content.
  - __echo__(s ...string): echo every string s.
  - __read__(file string): returns file content.
  - __cat__(file string): to display the file content.
  - __exec__(bin string, args ...string): to exec a program.
  - __shell__(s string): to exec a command line on the underlying shell (it is not cross compatible).
  - __color__(color string, content string): to embed content in a block code with color.
  - __gotest__(rpkg string, run string, args ...string): exec `go test <rpkg> -v -run <run> <args...>`.
  - __toc__(maximportance string, title string): display a TOC.
- feature: added new badge templates
  - __license/shields__: show a license badge
  - __badge/codeship__: show a codeship badge
- __deprecation__ #7: some template functions were deprecated to avoid pre defined formatting,
      old behavior can be reset via new options defined into the prelude data. See also the new __color__ function.
  - __file__ is dprecated for __cat__
  - __cli__ is dprecated for __exec__
- badges fix #14: removed useless whitespace
- dev: Added support for glide, it was required to handle yaml.
- dev: updated tests
- dev: godoc documentation improvements.

__Contributors__

- suntong
- mh-cbon

Released by mh-cbon, Sat 22 Apr 2017 -
[see the diff](https://github.com/mh-cbon/emd/compare/0.0.9-beta9...0.0.9#diff)
______________

### 0.0.9-beta9

__Changes__

- fix default reading of the md file

__Contributors__

- mh-cbon

Released by mh-cbon, Tue 18 Apr 2017 -
[see the diff](https://github.com/mh-cbon/emd/compare/0.0.9-beta8...0.0.9-beta9#diff)
______________

### 0.0.9-beta8

__Changes__

- fix #15: properly handle symbolic links
- fix cli: it was not possible to use the default template

__Contributors__

- mh-cbon

Released by mh-cbon, Tue 18 Apr 2017 -
[see the diff](https://github.com/mh-cbon/emd/compare/0.0.9-beta7...0.0.9-beta8#diff)
______________

### 0.0.9-beta7

__Changes__

- fix wrong import path

__Contributors__

- mh-cbon

Released by mh-cbon, Mon 17 Apr 2017 -
[see the diff](https://github.com/mh-cbon/emd/compare/0.0.9-beta6...0.0.9-beta7#diff)
______________

### 0.0.9-beta6

__Changes__

- ci: fix scripts to add glide support

__Contributors__

- mh-cbon

Released by mh-cbon, Mon 17 Apr 2017 -
[see the diff](https://github.com/mh-cbon/emd/compare/0.0.9-beta5...0.0.9-beta6#diff)
______________

### 0.0.9-beta5

__Changes__

- new functions:
  - __yaml__(file string, keypaths ...string): parses and build new yaml content of given file.
  - __preline__(pre , content string): prepends pre for every lines of content.
  - __echo__(s ...string): echo every string s.
  - __read__(file string): returns file content.
- toc: multiple fixes,
    - it properly handles duplicated title by appending an increment
    - fix handling of !; in links generator
    - fix line counting when extracting markdown titles
    - fix md title selection starting at line N
- prelude:
  - fix read of quoted values
  - prelude data is now read on all templates added, not only file
  - fix last eol handling
- codeship fix #2: proper project url
- bump script: added new utils/ tests
- glide: init versionned dependencies to handle yaml files.
- godoc: refactoring to improve documentation

__Contributors__

- mh-cbon

Released by mh-cbon, Mon 17 Apr 2017 -
[see the diff](https://github.com/mh-cbon/emd/compare/0.0.9-beta4...0.0.9-beta5#diff)
______________

### 0.0.9-beta4

__Changes__

- toc: improve toc parser, refactored, added tests

__Contributors__

- mh-cbon

Released by mh-cbon, Fri 14 Apr 2017 -
[see the diff](https://github.com/mh-cbon/emd/compare/0.0.9-beta3...0.0.9-beta4#diff)
______________

### 0.0.9-beta3

__Changes__

- fix #13: add new template to show a license badge.
- prelude: trim leading whitespaces of unquoted values.
- fix #14: improved badge output, removed useless whitespace.
- fix #2: codeship badge template, added a CsProjectID parameter.
- exec/shell/cat/gotest: avoid pre defined formatting, old behavior can be reset via new options defined into the prelude data.
- toc: fixed some corner cases while parsing/generating the TOC.

__Contributors__

- mh-cbon

Released by mh-cbon, Fri 14 Apr 2017 -
[see the diff](https://github.com/mh-cbon/emd/compare/0.0.9-beta2...0.0.9-beta3#diff)
______________

### 0.0.9-beta2

__Changes__

- fix some bugs in TOC title evaluation and generation
- fix apt repository!

__Contributors__

- mh-cbon

Released by mh-cbon, Thu 13 Apr 2017 -
[see the diff](https://github.com/mh-cbon/emd/compare/0.0.9-beta1...0.0.9-beta2#diff)
______________

### 0.0.9-beta1

__Changes__

- deprecation: improve error messages

__Contributors__

- mh-cbon

Released by mh-cbon, Wed 12 Apr 2017 -
[see the diff](https://github.com/mh-cbon/emd/compare/0.0.9-beta...0.0.9-beta1#diff)
______________

### 0.0.9-beta

__Changes__

- close #10: added feature to read, decode and registers the prelude data

  It is now possible to define a prelude block of `yaml` data in your __README__ file to
  register new data.

- added __cat/exec/shell/color/gotest/toc__ func

  - __cat__(file string): to display the file content.
  - __exec__(bin string, args ...string): to exec a program.
  - __shell__(s string): to exec a command line on the underlying shell (it is not cross compatible).
  - __color__(color string, content string): to embed content in a block code with color.
  - __gotest__(rpkg string, run string, args ...string): exec `go test <rpkg> -v -run <run> <args...>`.
  - __toc__(maximportance string, title string): display a TOC.

- close #7: deprecated __file/cli__ func

  Those two functions are deprecated in flavor of their new equivalents,
  __cat/exec__.

  The new functions does not returns a triple backquuotes block code.
  They returns the response body only.
  A new function helper __color__ is a added to create a block code.

- close #8: improved cli error output

  Before the output error was not displaying
  the command line entirely when it was too long.
  Now the error is updated to always display the command line with full length.

- close #9: add new gotest helper func
- close #12: add toc func
- close #10: ensure unquoted strings are read properly
- close #11: add shell func helper.

__Contributors__

- mh-cbon

Released by mh-cbon, Wed 12 Apr 2017 -
[see the diff](https://github.com/mh-cbon/emd/compare/0.0.8...0.0.9-beta#diff)
______________

### 0.0.8

__Changes__

- fix goreport badge template

__Contributors__

- mh-cbon

Released by mh-cbon, Sun 12 Mar 2017 -
[see the diff](https://github.com/mh-cbon/emd/compare/0.0.7...0.0.8#diff)
______________

### 0.0.7

__Changes__

- improve template documentation
- goreport: add template (fixes #4)

__Contributors__

- mh-cbon

Released by mh-cbon, Sun 12 Mar 2017 -
[see the diff](https://github.com/mh-cbon/emd/compare/0.0.6...0.0.7#diff)
______________

### 0.0.6

__Changes__

- template functions (std): add a new render template function to define additional values (fixes #2)
- template function (std): file takes a new argument to define the colorizer (fixes #1)
- emd: add new methods to access template, out and data
- release: fix missing version to the emd build
- README: multiple improvements.

__Contributors__

- mh-cbon

Released by mh-cbon, Mon 06 Mar 2017 -
[see the diff](https://github.com/mh-cbon/emd/compare/0.0.5...0.0.6#diff)
______________

### 0.0.5

__Changes__

- badges: add codeship
- Funcs cli/file: changed the MD template to add support for html anchors (before they was using bold tag, now they use a title tag)
- command gen: prints success message only if out is not stdout
- README: added a section to show HTML generation, and a recipe to bump the package.
- release: change bump script format

__Contributors__

- mh-cbon

Released by mh-cbon, Mon 06 Mar 2017 -
[see the diff](https://github.com/mh-cbon/emd/compare/0.0.4...0.0.5#diff)
______________

### 0.0.4

__Changes__

- changelog: typos
- README: add template helpers documentation

__Contributors__

- mh-cbon

Released by mh-cbon, Wed 22 Feb 2017 -
[see the diff](https://github.com/mh-cbon/emd/compare/0.0.3...0.0.4#diff)
______________

### 0.0.3

__Changes__

- travis(token): update ghtoken

__Contributors__

- mh-cbon

Released by mh-cbon, Wed 22 Feb 2017 -
[see the diff](https://github.com/mh-cbon/emd/compare/0.0.2...0.0.3#diff)
______________

### 0.0.2

__Changes__

- README: fix appveyor badge
- badge(update): fix url
- README: fix appveyor badge
- badge(fix): fix appveyor badge
- README: add appveyor badge
- badge(update): update text displayed in ci badges
- README(fix): use correct bin path
- bump(fix): emd gen command was wrong

__Contributors__

- mh-cbon

Released by mh-cbon, Wed 22 Feb 2017 -
[see the diff](https://github.com/mh-cbon/emd/compare/0.0.1...0.0.2#diff)
______________

### 0.0.1

__Changes__

- project initialization

__Contributors__

- mh-cbon

Released by mh-cbon, Wed 22 Feb 2017 -
[see the diff](https://github.com/mh-cbon/emd/compare/9b73c280847b824e4e366bcf3276d4eefecde4de...0.0.1#diff)
______________


text:
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using DataLayer;

namespace DataLayer.Migrations.Migrations
{
    [DbContext(typeof(MyContext))]
    [Migration("20161108170633_initial")]
    partial class initial
    {
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
            modelBuilder
                .HasAnnotation("ProductVersion", "1.0.1");

            modelBuilder.Entity("DataLayer.MyDataModel", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd();

                    b.HasKey("Id");

                    b.ToTable("MyDataModels");
                });
        }
    }
}


text:
package scheduler

import (
	"fmt"
	"testing"
	"time"

	"k8s.io/api/core/v1"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/util/wait"
	schedulerconfig "k8s.io/kubernetes/pkg/scheduler/apis/config"
	framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
)

// TesterPlugin is common ancestor for a test plugin that allows injection of
// failures and some other test functionalities.
type TesterPlugin struct {
	numReserveCalled    int
	numPrebindCalled    int
	numUnreserveCalled  int
	failReserve         bool
	failPrebind         bool
	rejectPrebind       bool
	numPermitCalled     int
	failPermit          bool
	rejectPermit        bool
	timeoutPermit       bool
	waitAndRejectPermit bool
	waitAndAllowPermit  bool
}

type ReservePlugin struct {
	TesterPlugin
}

type PrebindPlugin struct {
	TesterPlugin
}

type UnreservePlugin struct {
	TesterPlugin
}

type PermitPlugin struct {
	TesterPlugin
	fh framework.FrameworkHandle
}

const (
	reservePluginName   = "reserve-plugin"
	prebindPluginName   = "prebind-plugin"
	unreservePluginName = "unreserve-plugin"
	permitPluginName    = "permit-plugin"
)

var _ = framework.ReservePlugin(&ReservePlugin{})
var _ = framework.PrebindPlugin(&PrebindPlugin{})
var _ = framework.UnreservePlugin(&UnreservePlugin{})
var _ = framework.PermitPlugin(&PermitPlugin{})

// Name returns name of the plugin.
func (rp *ReservePlugin) Name() string {
	return reservePluginName
}

var resPlugin = &ReservePlugin{}

// Reserve is a test function that returns an error or nil, depending on the
// value of "failReserve".
func (rp *ReservePlugin) Reserve(pc *framework.PluginContext, pod *v1.Pod, nodeName string) *framework.Status {
	rp.numReserveCalled++
	if rp.failReserve {
		return framework.NewStatus(framework.Error, fmt.Sprintf("injecting failure for pod %v", pod.Name))
	}
	return nil
}

// NewReservePlugin is the factory for reserve plugin.
func NewReservePlugin(_ *runtime.Unknown, _ framework.FrameworkHandle) (framework.Plugin, error) {
	return resPlugin, nil
}

var pbdPlugin = &PrebindPlugin{}

// Name returns name of the plugin.
func (pp *PrebindPlugin) Name() string {
	return prebindPluginName
}

// Prebind is a test function that returns (true, nil) or errors for testing.
func (pp *PrebindPlugin) Prebind(pc *framework.PluginContext, pod *v1.Pod, nodeName string) *framework.Status {
	pp.numPrebindCalled++
	if pp.failPrebind {
		return framework.NewStatus(framework.Error, fmt.Sprintf("injecting failure for pod %v", pod.Name))
	}
	if pp.rejectPrebind {
		return framework.NewStatus(framework.Unschedulable, fmt.Sprintf("reject pod %v", pod.Name))
	}
	return nil
}

// reset used to reset numPrebindCalled.
func (pp *PrebindPlugin) reset() {
	pp.numPrebindCalled = 0
}

// NewPrebindPlugin is the factory for prebind plugin.
func NewPrebindPlugin(_ *runtime.Unknown, _ framework.FrameworkHandle) (framework.Plugin, error) {
	return pbdPlugin, nil
}

var unresPlugin = &UnreservePlugin{}

// Name returns name of the plugin.
func (up *UnreservePlugin) Name() string {
	return unreservePluginName
}

// Unreserve is a test function that returns an error or nil, depending on the
// value of "failUnreserve".
func (up *UnreservePlugin) Unreserve(pc *framework.PluginContext, pod *v1.Pod, nodeName string) {
	up.numUnreserveCalled++
}

// reset used to reset numUnreserveCalled.
func (up *UnreservePlugin) reset() {
	up.numUnreserveCalled = 0
}

// NewUnreservePlugin is the factory for unreserve plugin.
func NewUnreservePlugin(_ *runtime.Unknown, _ framework.FrameworkHandle) (framework.Plugin, error) {
	return unresPlugin, nil
}

var perPlugin = &PermitPlugin{}

// Name returns name of the plugin.
func (pp *PermitPlugin) Name() string {
	return permitPluginName
}

// Permit implements the permit test plugin.
func (pp *PermitPlugin) Permit(pc *framework.PluginContext, pod *v1.Pod, nodeName string) (*framework.Status, time.Duration) {
	pp.numPermitCalled++
	if pp.failPermit {
		return framework.NewStatus(framework.Error, fmt.Sprintf("injecting failure for pod %v", pod.Name)), 0
	}
	if pp.rejectPermit {
		return framework.NewStatus(framework.Unschedulable, fmt.Sprintf("reject pod %v", pod.Name)), 0
	}
	if pp.timeoutPermit {
		return framework.NewStatus(framework.Wait, ""), 3 * time.Second
	}
	if pp.waitAndRejectPermit || pp.waitAndAllowPermit {
		if pod.Name == "waiting-pod" {
			return framework.NewStatus(framework.Wait, ""), 30 * time.Second
		}
		// This is the signalling pod, wait until the waiting-pod is actually waiting and then either reject or allow it.
		wait.Poll(10*time.Millisecond, 30*time.Second, func() (bool, error) {
			w := false
			pp.fh.IterateOverWaitingPods(func(wp framework.WaitingPod) { w = true })
			return w, nil
		})
		if pp.waitAndRejectPermit {
			pp.fh.IterateOverWaitingPods(func(wp framework.WaitingPod) {
				wp.Reject(fmt.Sprintf("reject pod %v", wp.GetPod().Name))
			})
			return framework.NewStatus(framework.Unschedulable, fmt.Sprintf("reject pod %v", pod.Name)), 0
		}
		if pp.waitAndAllowPermit {
			pp.fh.IterateOverWaitingPods(func(wp framework.WaitingPod) { wp.Allow() })
			return nil, 0
		}
	}
	return nil, 0
}

// NewPermitPlugin is the factory for permit plugin.
func NewPermitPlugin(_ *runtime.Unknown, fh framework.FrameworkHandle) (framework.Plugin, error) {
	perPlugin.fh = fh
	return perPlugin, nil
}

// TestReservePlugin tests invocation of reserve plugins.
func TestReservePlugin(t *testing.T) {
	// Create a plugin registry for testing. Register only a reserve plugin.
	registry := framework.Registry{reservePluginName: NewReservePlugin}

	// Setup initial reserve plugin for testing.
	reservePlugin := &schedulerconfig.Plugins{
		Reserve: &schedulerconfig.PluginSet{
			Enabled: []schedulerconfig.Plugin{
				{
					Name: reservePluginName,
				},
			},
		},
	}
	// Set empty plugin config for testing
	emptyPluginConfig := []schedulerconfig.PluginConfig{}

	// Create the master and the scheduler with the test plugin set.
	context := initTestSchedulerWithOptions(t,
		initTestMaster(t, "reserve-plugin", nil),
		false, nil, registry, reservePlugin, emptyPluginConfig, false, time.Second)
	defer cleanupTest(t, context)

	cs := context.clientSet
	// Add a few nodes.
	_, err := createNodes(cs, "test-node", nil, 2)
	if err != nil {
		t.Fatalf("Cannot create nodes: %v", err)
	}

	for _, fail := range []bool{false, true} {
		resPlugin.failReserve = fail
		// Create a best effort pod.
		pod, err := createPausePod(cs,
			initPausePod(cs, &pausePodConfig{Name: "test-pod", Namespace: context.ns.Name}))
		if err != nil {
			t.Errorf("Error while creating a test pod: %v", err)
		}

		if fail {
			if err = wait.Poll(10*time.Millisecond, 30*time.Second, podSchedulingError(cs, pod.Namespace, pod.Name)); err != nil {
				t.Errorf("Didn't expected the pod to be scheduled. error: %v", err)
			}
		} else {
			if err = waitForPodToSchedule(cs, pod); err != nil {
				t.Errorf("Expected the pod to be scheduled. error: %v", err)
			}
		}

		if resPlugin.numReserveCalled == 0 {
			t.Errorf("Expected the reserve plugin to be called.")
		}

		cleanupPods(cs, t, []*v1.Pod{pod})
	}
}

// TestPrebindPlugin tests invocation of prebind plugins.
func TestPrebindPlugin(t *testing.T) {
	// Create a plugin registry for testing. Register only a prebind plugin.
	registry := framework.Registry{prebindPluginName: NewPrebindPlugin}

	// Setup initial prebind plugin for testing.
	preBindPlugin := &schedulerconfig.Plugins{
		PreBind: &schedulerconfig.PluginSet{
			Enabled: []schedulerconfig.Plugin{
				{
					Name: prebindPluginName,
				},
			},
		},
	}
	// Set reserve prebind config for testing
	preBindPluginConfig := []schedulerconfig.PluginConfig{
		{
			Name: prebindPluginName,
			Args: runtime.Unknown{},
		},
	}
	// Create the master and the scheduler with the test plugin set.
	context := initTestSchedulerWithOptions(t,
		initTestMaster(t, "prebind-plugin", nil),
		false, nil, registry, preBindPlugin, preBindPluginConfig, false, time.Second)
	defer cleanupTest(t, context)

	cs := context.clientSet
	// Add a few nodes.
	_, err := createNodes(cs, "test-node", nil, 2)
	if err != nil {
		t.Fatalf("Cannot create nodes: %v", err)
	}

	tests := []struct {
		fail   bool
		reject bool
	}{
		{
			fail:   false,
			reject: false,
		},
		{
			fail:   true,
			reject: false,
		},
		{
			fail:   false,
			reject: true,
		},
		{
			fail:   true,
			reject: true,
		},
	}

	for i, test := range tests {
		pbdPlugin.failPrebind = test.fail
		pbdPlugin.rejectPrebind = test.reject
		// Create a best effort pod.
		pod, err := createPausePod(cs,
			initPausePod(cs, &pausePodConfig{Name: "test-pod", Namespace: context.ns.Name}))
		if err != nil {
			t.Errorf("Error while creating a test pod: %v", err)
		}

		if test.fail {
			if err = wait.Poll(10*time.Millisecond, 30*time.Second, podSchedulingError(cs, pod.Namespace, pod.Name)); err != nil {
				t.Errorf("test #%v: Expected a scheduling error, but didn't get it. error: %v", i, err)
			}
		} else {
			if test.reject {
				if err = waitForPodUnschedulable(cs, pod); err != nil {
					t.Errorf("test #%v: Didn't expected the pod to be scheduled. error: %v", i, err)
				}
			} else {
				if err = waitForPodToSchedule(cs, pod); err != nil {
					t.Errorf("test #%v: Expected the pod to be scheduled. error: %v", i, err)
				}
			}
		}

		if pbdPlugin.numPrebindCalled == 0 {
			t.Errorf("Expected the prebind plugin to be called.")
		}

		cleanupPods(cs, t, []*v1.Pod{pod})
	}
}

// TestUnreservePlugin tests invocation of un-reserve plugin
func TestUnreservePlugin(t *testing.T) {
	// TODO: register more plugin which would trigger un-reserve plugin
	registry := framework.Registry{
		unreservePluginName: NewUnreservePlugin,
		prebindPluginName:   NewPrebindPlugin,
	}

	// Setup initial unreserve and prebind plugin for testing.
	plugins := &schedulerconfig.Plugins{
		Unreserve: &schedulerconfig.PluginSet{
			Enabled: []schedulerconfig.Plugin{
				{
					Name: unreservePluginName,
				},
			},
		},
		PreBind: &schedulerconfig.PluginSet{
			Enabled: []schedulerconfig.Plugin{
				{
					Name: prebindPluginName,
				},
			},
		},
	}
	// Set unreserve and prebind plugin config for testing
	pluginConfig := []schedulerconfig.PluginConfig{
		{
			Name: unreservePluginName,
			Args: runtime.Unknown{},
		},
		{
			Name: prebindPluginName,
			Args: runtime.Unknown{},
		},
	}

	// Create the master and the scheduler with the test plugin set.
	context := initTestSchedulerWithOptions(t,
		initTestMaster(t, "unreserve-plugin", nil),
		false, nil, registry, plugins, pluginConfig, false, time.Second)
	defer cleanupTest(t, context)

	cs := context.clientSet
	// Add a few nodes.
	_, err := createNodes(cs, "test-node", nil, 2)
	if err != nil {
		t.Fatalf("Cannot create nodes: %v", err)
	}

	tests := []struct {
		prebindFail   bool
		prebindReject bool
	}{
		{
			prebindFail:   false,
			prebindReject: false,
		},
		{
			prebindFail:   true,
			prebindReject: false,
		},
		{
			prebindFail:   false,
			prebindReject: true,
		},
		{
			prebindFail:   true,
			prebindReject: true,
		},
	}

	for i, test := range tests {
		pbdPlugin.failPrebind = test.prebindFail
		pbdPlugin.rejectPrebind = test.prebindReject

		// Create a best effort pod.
		pod, err := createPausePod(cs,
			initPausePod(cs, &pausePodConfig{Name: "test-pod", Namespace: context.ns.Name}))
		if err != nil {
			t.Errorf("Error while creating a test pod: %v", err)
		}

		if test.prebindFail {
			if err = wait.Poll(10*time.Millisecond, 30*time.Second, podSchedulingError(cs, pod.Namespace, pod.Name)); err != nil {
				t.Errorf("test #%v: Expected a scheduling error, but didn't get it. error: %v", i, err)
			}
			if unresPlugin.numUnreserveCalled == 0 || unresPlugin.numUnreserveCalled != pbdPlugin.numPrebindCalled {
				t.Errorf("test #%v: Expected the unreserve plugin to be called %d times, was called %d times.", i, pbdPlugin.numPrebindCalled, unresPlugin.numUnreserveCalled)
			}
		} else {
			if test.prebindReject {
				if err = waitForPodUnschedulable(cs, pod); err != nil {
					t.Errorf("test #%v: Didn't expected the pod to be scheduled. error: %v", i, err)
				}
				if unresPlugin.numUnreserveCalled == 0 || unresPlugin.numUnreserveCalled != pbdPlugin.numPrebindCalled {
					t.Errorf("test #%v: Expected the unreserve plugin to be called %d times, was called %d times.", i, pbdPlugin.numPrebindCalled, unresPlugin.numUnreserveCalled)
				}
			} else {
				if err = waitForPodToSchedule(cs, pod); err != nil {
					t.Errorf("test #%v: Expected the pod to be scheduled. error: %v", i, err)
				}
				if unresPlugin.numUnreserveCalled > 0 {
					t.Errorf("test #%v: Didn't expected the unreserve plugin to be called, was called %d times.", i, unresPlugin.numUnreserveCalled)
				}
			}
		}
		unresPlugin.reset()
		pbdPlugin.reset()
		cleanupPods(cs, t, []*v1.Pod{pod})
	}
}

// TestPermitPlugin tests invocation of permit plugins.
func TestPermitPlugin(t *testing.T) {
	// Create a plugin registry for testing. Register only a permit plugin.
	registry := framework.Registry{permitPluginName: NewPermitPlugin}

	// Setup initial permit plugin for testing.
	plugins := &schedulerconfig.Plugins{
		Permit: &schedulerconfig.PluginSet{
			Enabled: []schedulerconfig.Plugin{
				{
					Name: permitPluginName,
				},
			},
		},
	}
	// Set permit plugin config for testing
	pluginConfig := []schedulerconfig.PluginConfig{
		{
			Name: permitPluginName,
			Args: runtime.Unknown{},
		},
	}

	// Create the master and the scheduler with the test plugin set.
	context := initTestSchedulerWithOptions(t,
		initTestMaster(t, "permit-plugin", nil),
		false, nil, registry, plugins, pluginConfig, false, time.Second)
	defer cleanupTest(t, context)

	cs := context.clientSet
	// Add a few nodes.
	_, err := createNodes(cs, "test-node", nil, 2)
	if err != nil {
		t.Fatalf("Cannot create nodes: %v", err)
	}

	tests := []struct {
		fail    bool
		reject  bool
		timeout bool
	}{
		{
			fail:    false,
			reject:  false,
			timeout: false,
		},
		{
			fail:    true,
			reject:  false,
			timeout: false,
		},
		{
			fail:    false,
			reject:  true,
			timeout: false,
		},
		{
			fail:    true,
			reject:  true,
			timeout: false,
		},
		{
			fail:    false,
			reject:  false,
			timeout: true,
		},
		{
			fail:    false,
			reject:  false,
			timeout: true,
		},
	}

	for i, test := range tests {
		perPlugin.failPermit = test.fail
		perPlugin.rejectPermit = test.reject
		perPlugin.timeoutPermit = test.timeout
		perPlugin.waitAndRejectPermit = false
		perPlugin.waitAndAllowPermit = false
		// Create a best effort pod.
		pod, err := createPausePod(cs,
			initPausePod(cs, &pausePodConfig{Name: "test-pod", Namespace: context.ns.Name}))
		if err != nil {
			t.Errorf("Error while creating a test pod: %v", err)
		}
		if test.fail {
			if err = wait.Poll(10*time.Millisecond, 30*time.Second, podSchedulingError(cs, pod.Namespace, pod.Name)); err != nil {
				t.Errorf("test #%v: Expected a scheduling error, but didn't get it. error: %v", i, err)
			}
		} else {
			if test.reject || test.timeout {
				if err = waitForPodUnschedulable(cs, pod); err != nil {
					t.Errorf("test #%v: Didn't expect the pod to be scheduled. error: %v", i, err)
				}
			} else {
				if err = waitForPodToSchedule(cs, pod); err != nil {
					t.Errorf("test #%v: Expected the pod to be scheduled. error: %v", i, err)
				}
			}
		}

		if perPlugin.numPermitCalled == 0 {
			t.Errorf("Expected the permit plugin to be called.")
		}

		cleanupPods(cs, t, []*v1.Pod{pod})
	}
}

// TestCoSchedulingWithPermitPlugin tests invocation of permit plugins.
func TestCoSchedulingWithPermitPlugin(t *testing.T) {
	// Create a plugin registry for testing. Register only a permit plugin.
	registry := framework.Registry{permitPluginName: NewPermitPlugin}

	// Setup initial permit plugin for testing.
	plugins := &schedulerconfig.Plugins{
		Permit: &schedulerconfig.PluginSet{
			Enabled: []schedulerconfig.Plugin{
				{
					Name: permitPluginName,
				},
			},
		},
	}
	// Set permit plugin config for testing
	pluginConfig := []schedulerconfig.PluginConfig{
		{
			Name: permitPluginName,
			Args: runtime.Unknown{},
		},
	}

	// Create the master and the scheduler with the test plugin set.
	context := initTestSchedulerWithOptions(t,
		initTestMaster(t, "permit-plugin", nil),
		false, nil, registry, plugins, pluginConfig, false, time.Second)
	defer cleanupTest(t, context)

	cs := context.clientSet
	// Add a few nodes.
	_, err := createNodes(cs, "test-node", nil, 2)
	if err != nil {
		t.Fatalf("Cannot create nodes: %v", err)
	}

	tests := []struct {
		waitReject bool
		waitAllow  bool
	}{
		{
			waitReject: true,
			waitAllow:  false,
		},
		{
			waitReject: false,
			waitAllow:  true,
		},
	}

	for i, test := range tests {
		perPlugin.failPermit = false
		perPlugin.rejectPermit = false
		perPlugin.timeoutPermit = false
		perPlugin.waitAndRejectPermit = test.waitReject
		perPlugin.waitAndAllowPermit = test.waitAllow

		// Create two pods.
		waitingPod, err := createPausePod(cs,
			initPausePod(cs, &pausePodConfig{Name: "waiting-pod", Namespace: context.ns.Name}))
		if err != nil {
			t.Errorf("Error while creating the waiting pod: %v", err)
		}
		signallingPod, err := createPausePod(cs,
			initPausePod(cs, &pausePodConfig{Name: "signalling-pod", Namespace: context.ns.Name}))
		if err != nil {
			t.Errorf("Error while creating the signalling pod: %v", err)
		}

		if test.waitReject {
			if err = waitForPodUnschedulable(cs, waitingPod); err != nil {
				t.Errorf("test #%v: Didn't expect the waiting pod to be scheduled. error: %v", i, err)
			}
			if err = waitForPodUnschedulable(cs, signallingPod); err != nil {
				t.Errorf("test #%v: Didn't expect the signalling pod to be scheduled. error: %v", i, err)
			}
		} else {
			if err = waitForPodToSchedule(cs, waitingPod); err != nil {
				t.Errorf("test #%v: Expected the waiting pod to be scheduled. error: %v", i, err)
			}
			if err = waitForPodToSchedule(cs, signallingPod); err != nil {
				t.Errorf("test #%v: Expected the signalling pod to be scheduled. error: %v", i, err)
			}
		}

		if perPlugin.numPermitCalled == 0 {
			t.Errorf("Expected the permit plugin to be called.")
		}

		cleanupPods(cs, t, []*v1.Pod{waitingPod, signallingPod})
	}
}


text:
class CreateMissionCategories < ActiveRecord::Migration
  def change
    create_table :mission_categories do |t|
      t.string :name

      t.timestamps
    end
  end
end


text:
module Graphics.D3D11Binding.Interface.D3D11ClassLinkage where

data ID3D11ClassLinkage = ID3D11ClassLinkage


text:
package Maraton2011_3Septiembre.src;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Locale;
import java.util.StringTokenizer;

public class mysteriosX {
	static BufferedReader input;

	static StringTokenizer _stk;
	static String readln() throws IOException{
		String l=input.readLine();
		if(l!=null) _stk=new StringTokenizer(l," ");
		return l;
	}

	static String next(){return _stk.nextToken();}
	static int nextInt(){return Integer.parseInt(next());}

	public static void main(String[] args) throws IOException {
		Locale.setDefault(Locale.US);
//		input=new BufferedReader(new InputStreamReader(System.in));
		input=new BufferedReader(new FileReader("a.in"));

		while(true) {
			readln();

			int N=nextInt();

			if(N==0)
				break;

			//camaradas = new HashMap<Integer, LinkedList<Integer>>();
			m = new LinkedList[N];

			/*for(int i = 0; i < 100000; i++) {
				//LinkedList<Integer> l = new LinkedList<Integer>();
				m[i] = new LinkedList<Integer>();
				for(int j = i+1; j < 100+i; j++) {
					//System.out.println("i = "+i+" j = " + j);
					//m[i][j] = true;
					m[i].add(j);
				}
				//camaradas.put(i, l);
			}*/
			//camaradas.clear();

			for (int i = 0; i < N; i++) {
				readln();
				int C=nextInt();
				m[C] = new LinkedList<Integer>();
				//LinkedList<Integer> Nc=new LinkedList<Integer>();
				int T = nextInt();
				while (T-->0) {
					//Nc.add(nextInt());
					m[C].add(nextInt());
				}
				//camaradas.put(C, Nc);
			}
			readln();

			int C1 = nextInt(), C2 = nextInt();
			//C1 = 1; C2 = 100000;
			busqueda = new LinkedList<Nodo>();
			visitados = new boolean[N];

			Nodo inicial = new Nodo(C1, 0);
			visitados[C1] = true;
			busqueda.addLast(inicial);
			int res = 0;
			//try {
				res = cantidadCamaradas(C2);
			/*}
			catch(Exception e) {
				System.out.println(C1 + " " + C2 + " " + (res-1));
				continue;
			}*/
			//System.out.println(Arrays.toString(visitados));
			System.out.println(C1 + " " + C2 + " " + (res-1));
			busqueda.clear();
		}
	}

	// return longitud
	static int cantidadCamaradas(int fin) {
		while(!busqueda.isEmpty()) {
			Nodo n = busqueda.removeFirst();
			int inicio = n.n;

			visitados[inicio] = true;
			LinkedList<Integer> p = m[inicio];
		//	boolean[] p = m[inicio];
			if(inicio == fin) {
				return (n.p);
			}

			for(Integer v : p) {
				if(!visitados[v]) {
					if(v == fin)
						return n.p+1;
					Nodo nuevo = new Nodo(v, n.p+1);
					busqueda.addLast(nuevo);
				}
			}

			//return cantidadCamaradas(fin);
		}
		return -1;
	}

	static boolean[] visitados;
	static LinkedList<Nodo> busqueda;
	//static HashMap<Integer,LinkedList<Integer>> camaradas;
	static LinkedList<Integer>[] m;
}

class Nodo {
	public Nodo(int n, int p) {
		this.n = n;
		this.p = p;
	}

	int n, p;
}