text:
package mtag

import (
	"github.com/mabetle/mgo/mcore"
	"strings"
)

// label tag format:
// label="zh='' en=''"

// GetLabelTag returns field "label" tag value.
func GetLabelTag(v interface{}, fieldName string) (string, bool) {
	return GetTag(v, fieldName, "label")
}

// parse string to KeyValue map.
func ParseKeyValueMap(value string) map[string]string {
	result := make(map[string]string)
	rows := strings.Split(value, " ")
	for _, row := range rows {
		// skip blank
		if strings.TrimSpace(row) == "" {
			continue
		}
		kv := strings.Split(row, "=")
		if len(kv) == 2 {
			k := strings.TrimSpace(kv[0])
			v := strings.TrimSpace(kv[1])
			v = strings.Trim(v, "'")
			v = strings.Trim(v, "\"")
			v = strings.TrimSpace(v)
			result[k] = v
		}
	}
	return result
}

// GetLocaleLabel returns field label by locale.
// locale format: en en_US  / zh zh_CN zh_HK etc.
func GetLocaleLabel(v interface{}, fieldName string, locale string) string {
	labelValue, e := GetLabelTag(v, fieldName)

	// not exist
	if !e {
		return mcore.ToLabel(fieldName)
	}
	locale = strings.Replace(locale, "-", "_", -1)

	lang := strings.Split(locale, "_")[0]

	m := ParseKeyValueMap(labelValue)

	// include lang_coutry locale
	if v, ok := m[locale]; ok {
		return v
	}

	// include lang
	if v, ok := m[lang]; ok {
		return v
	}

	// defult en
	if v, ok := m["en"]; ok {
		return v
	}

	// default return
	return mcore.ToLabel(fieldName)
}

// GetLabelZH
func GetLabelZH(v interface{}, fieldName string) string {
	return GetLocaleLabel(v, fieldName, "zh")
}

// GetLabelEN
func GetLabelEN(v interface{}, fieldName string) string {
	return GetLocaleLabel(v, fieldName, "en")
}


text:
export class ReplaceResult {
    fileContent: string = '';
    value: string = '';

    constructor(fileContent: string, value: string) {
        this.fileContent = fileContent;
        this.value = value;
    }
}

redpajama_set_name: RedPajamaGithub


text:
#include "config.h"
#include "modules/accessibility/AXMenuList.h"

#include "core/layout/LayoutMenuList.h"
#include "modules/accessibility/AXMenuListPopup.h"
#include "modules/accessibility/AXObjectCacheImpl.h"

namespace blink {

AXMenuList::AXMenuList(LayoutMenuList* layoutObject, AXObjectCacheImpl* axObjectCache)
    : AXLayoutObject(layoutObject, axObjectCache)
{
}

PassRefPtr<AXMenuList> AXMenuList::create(LayoutMenuList* layoutObject, AXObjectCacheImpl* axObjectCache)
{
    return adoptRef(new AXMenuList(layoutObject, axObjectCache));
}

AccessibilityRole AXMenuList::determineAccessibilityRole()
{
    if ((m_ariaRole = determineAriaRoleAttribute()) != UnknownRole)
        return m_ariaRole;

    return PopUpButtonRole;
}

bool AXMenuList::press() const
{
    if (!m_layoutObject)
        return false;

    LayoutMenuList* menuList = toLayoutMenuList(m_layoutObject);
    if (menuList->popupIsVisible())
        menuList->hidePopup();
    else
        menuList->showPopup();
    return true;
}

void AXMenuList::clearChildren()
{
    if (m_children.isEmpty())
        return;

    // There's no reason to clear our AXMenuListPopup child. If we get a
    // call to clearChildren, it's because the options might have changed,
    // so call it on our popup.
    ASSERT(m_children.size() == 1);
    m_children[0]->clearChildren();
    m_childrenDirty = false;
}

void AXMenuList::addChildren()
{
    m_haveChildren = true;

    AXObjectCacheImpl* cache = axObjectCache();

    AXObject* list = cache->getOrCreate(MenuListPopupRole);
    if (!list)
        return;

    toAXMockObject(list)->setParent(this);
    if (list->accessibilityIsIgnored()) {
        cache->remove(list->axObjectID());
        return;
    }

    m_children.append(list);

    list->addChildren();
}

bool AXMenuList::isCollapsed() const
{
    // Collapsed is the "default" state, so if the LayoutObject doesn't exist
    // this makes slightly more sense than returning false.
    if (!m_layoutObject)
        return true;

    return !toLayoutMenuList(m_layoutObject)->popupIsVisible();
}

AccessibilityExpanded AXMenuList::isExpanded() const
{
    if (isCollapsed())
        return ExpandedCollapsed;

    return ExpandedExpanded;
}

bool AXMenuList::canSetFocusAttribute() const
{
    if (!node())
        return false;

    return !toElement(node())->isDisabledFormControl();
}

void AXMenuList::didUpdateActiveOption(int optionIndex)
{
    const auto& childObjects = children();
    if (!childObjects.isEmpty()) {
        ASSERT(childObjects.size() == 1);
        ASSERT(childObjects[0]->isMenuListPopup());

        if (childObjects[0]->isMenuListPopup()) {
            if (AXMenuListPopup* popup = toAXMenuListPopup(childObjects[0].get()))
                popup->didUpdateActiveOption(optionIndex);
        }
    }

    axObjectCache()->postNotification(this, AXObjectCacheImpl::AXMenuListValueChanged);
}

void AXMenuList::didShowPopup()
{
    if (children().size() != 1)
        return;

    AXMenuListPopup* popup = toAXMenuListPopup(children()[0].get());
    popup->didShow();
}

void AXMenuList::didHidePopup()
{
    if (children().size() != 1)
        return;

    AXMenuListPopup* popup = toAXMenuListPopup(children()[0].get());
    popup->didHide();

    if (node() && node()->focused())
        axObjectCache()->postNotification(this, AXObjectCacheImpl::AXFocusedUIElementChanged);
}

} // namespace blink


text:
require "pathname"
require "emoji"
require "exceptions"
require "utils/analytics"
require "utils/curl"
require "utils/fork"
require "utils/formatter"
require "utils/git"
require "utils/github"
require "utils/hash"
require "utils/inreplace"
require "utils/link"
require "utils/popen"
require "utils/svn"
require "utils/tty"
require "time"

def ohai(title, *sput)
  title = Tty.truncate(title) if $stdout.tty? && !ARGV.verbose?
  puts Formatter.headline(title, color: :blue)
  puts sput
end

def oh1(title, options = {})
  if $stdout.tty? && !ARGV.verbose? && options.fetch(:truncate, :auto) == :auto
    title = Tty.truncate(title)
  end
  puts Formatter.headline(title, color: :green)
end

# Print a warning (do this rarely)
def opoo(message)
  $stderr.puts Formatter.warning(message, label: "Warning")
end

def onoe(message)
  $stderr.puts Formatter.error(message, label: "Error")
end

def ofail(error)
  onoe error
  Homebrew.failed = true
end

def odie(error)
  onoe error
  exit 1
end

def odeprecated(method, replacement = nil, disable: false, disable_on: nil, caller: send(:caller))
  replacement_message = if replacement
    "Use #{replacement} instead."
  else
    "There is no replacement."
  end

  unless disable_on.nil?
    if disable_on > Time.now
      will_be_disabled_message = " and will be disabled on #{disable_on.strftime("%Y-%m-%d")}"
    else
      disable = true
    end
  end

  verb = if disable
    "disabled"
  else
    "deprecated#{will_be_disabled_message}"
  end

  # Try to show the most relevant location in message, i.e. (if applicable):
  # - Location in a formula.
  # - Location outside of 'compat/'.
  # - Location of caller of deprecated method (if all else fails).
  backtrace = caller
  tap_message = nil
  caller_message = backtrace.detect do |line|
    next unless line =~ %r{^#{Regexp.escape HOMEBREW_LIBRARY}/Taps/([^/]+/[^/]+)/}
    tap = Tap.fetch $1
    tap_message = "\nPlease report this to the #{tap} tap!"
    true
  end
  caller_message ||= backtrace.detect do |line|
    !line.start_with?("#{HOMEBREW_LIBRARY_PATH}/compat/")
  end
  caller_message ||= backtrace[1]

  message = <<-EOS.undent
    Calling #{method} is #{verb}!
    #{replacement_message}
    #{caller_message}#{tap_message}
  EOS

  if ARGV.homebrew_developer? || disable ||
     Homebrew.raise_deprecation_exceptions?
    raise MethodDeprecatedError, message
  else
    opoo "#{message}\n"
  end
end

def odisabled(method, replacement = nil, options = {})
  options = { disable: true, caller: caller }.merge(options)
  odeprecated(method, replacement, options)
end

def pretty_installed(f)
  if !$stdout.tty?
    f.to_s
  elsif Emoji.enabled?
    "#{Tty.bold}#{f} #{Formatter.success("✔")}#{Tty.reset}"
  else
    Formatter.success("#{Tty.bold}#{f} (installed)#{Tty.reset}")
  end
end

def pretty_uninstalled(f)
  if !$stdout.tty?
    f.to_s
  elsif Emoji.enabled?
    "#{Tty.bold}#{f} #{Formatter.error("✘")}#{Tty.reset}"
  else
    Formatter.error("#{Tty.bold}#{f} (uninstalled)#{Tty.reset}")
  end
end

def pretty_duration(s)
  s = s.to_i
  res = ""

  if s > 59
    m = s / 60
    s %= 60
    res = Formatter.pluralize(m, "minute")
    return res if s.zero?
    res << " "
  end

  res << Formatter.pluralize(s, "second")
end

def interactive_shell(f = nil)
  unless f.nil?
    ENV["HOMEBREW_DEBUG_PREFIX"] = f.prefix
    ENV["HOMEBREW_DEBUG_INSTALL"] = f.full_name
  end

  if ENV["SHELL"].include?("zsh") && ENV["HOME"].start_with?(HOMEBREW_TEMP.resolved_path.to_s)
    FileUtils.touch "#{ENV["HOME"]}/.zshrc"
  end

  Process.wait fork { exec ENV["SHELL"] }

  return if $?.success?
  raise "Aborted due to non-zero exit status (#{$?.exitstatus})" if $?.exited?
  raise $?.inspect
end

module Homebrew
  module_function

  def _system(cmd, *args)
    pid = fork do
      yield if block_given?
      args.collect!(&:to_s)
      begin
        exec(cmd, *args)
      rescue
        nil
      end
      exit! 1 # never gets here unless exec failed
    end
    Process.wait(pid)
    $?.success?
  end

  def system(cmd, *args)
    puts "#{cmd} #{args*" "}" if ARGV.verbose?
    _system(cmd, *args)
  end

  def install_gem_setup_path!(name, version = nil, executable = name)
    # Respect user's preferences for where gems should be installed.
    ENV["GEM_HOME"] = ENV["GEM_OLD_HOME"].to_s
    ENV["GEM_HOME"] = Gem.user_dir if ENV["GEM_HOME"].empty?
    ENV["GEM_PATH"] = ENV["GEM_OLD_PATH"] unless ENV["GEM_OLD_PATH"].to_s.empty?

    # Make rubygems notice env changes.
    Gem.clear_paths
    Gem::Specification.reset

    # Add Gem binary directory and (if missing) Ruby binary directory to PATH.
    path = PATH.new(ENV["PATH"])
    path.prepend(RUBY_BIN) if which("ruby") != RUBY_PATH
    path.prepend(Gem.bindir)
    ENV["PATH"] = path

    if Gem::Specification.find_all_by_name(name, version).empty?
      ohai "Installing or updating '#{name}' gem"
      install_args = %W[--no-ri --no-rdoc #{name}]
      install_args << "--version" << version if version

      # Do `gem install [...]` without having to spawn a separate process or
      # having to find the right `gem` binary for the running Ruby interpreter.
      require "rubygems/commands/install_command"
      install_cmd = Gem::Commands::InstallCommand.new
      install_cmd.handle_options(install_args)
      exit_code = 1 # Should not matter as `install_cmd.execute` always throws.
      begin
        install_cmd.execute
      rescue Gem::SystemExitException => e
        exit_code = e.exit_code
      end
      odie "Failed to install/update the '#{name}' gem." if exit_code.nonzero?
    end

    return if which(executable)
    odie <<-EOS.undent
      The '#{name}' gem is installed but couldn't find '#{executable}' in the PATH:
      #{ENV["PATH"]}
    EOS
  end

  # Hash of Module => Set(method_names)
  @injected_dump_stat_modules = {}

  def inject_dump_stats!(the_module, pattern)
    @injected_dump_stat_modules[the_module] ||= []
    injected_methods = @injected_dump_stat_modules[the_module]
    the_module.module_eval do
      instance_methods.grep(pattern).each do |name|
        next if injected_methods.include? name
        method = instance_method(name)
        define_method(name) do |*args, &block|
          begin
            time = Time.now
            method.bind(self).call(*args, &block)
          ensure
            $times[name] ||= 0
            $times[name] += Time.now - time
          end
        end
      end
    end

    return unless $times.nil?
    $times = {}
    at_exit do
      col_width = [$times.keys.map(&:size).max + 2, 15].max
      $times.sort_by { |_k, v| v }.each do |method, time|
        puts format("%-*s %0.4f sec", col_width, "#{method}:", time)
      end
    end
  end
end

def with_system_path
  old_path = ENV["PATH"]
  ENV["PATH"] = "/usr/bin:/bin"
  ENV["PATH"] = "#{HOMEBREW_PREFIX}/bin:#{ENV["PATH"]}" unless OS.mac?
  yield
ensure
  ENV["PATH"] = old_path
end

def with_custom_locale(locale)
  old_locale = ENV["LC_ALL"]
  ENV["LC_ALL"] = locale
  yield
ensure
  ENV["LC_ALL"] = old_locale
end

def run_as_not_developer(&_block)
  old = ENV.delete "HOMEBREW_DEVELOPER"
  yield
ensure
  ENV["HOMEBREW_DEVELOPER"] = old
end

# Kernel.system but with exceptions
def safe_system(cmd, *args)
  Homebrew.system(cmd, *args) || raise(ErrorDuringExecution.new(cmd, args))
end

# prints no output
def quiet_system(cmd, *args)
  Homebrew._system(cmd, *args) do
    # Redirect output streams to `/dev/null` instead of closing as some programs
    # will fail to execute if they can't write to an open stream.
    $stdout.reopen("/dev/null")
    $stderr.reopen("/dev/null")
  end
end

def which(cmd, path = ENV["PATH"])
  PATH.new(path).each do |p|
    begin
      pcmd = File.expand_path(cmd, p)
    rescue ArgumentError
      # File.expand_path will raise an ArgumentError if the path is malformed.
      # See https://github.com/Homebrew/legacy-homebrew/issues/32789
      next
    end
    return Pathname.new(pcmd) if File.file?(pcmd) && File.executable?(pcmd)
  end
  nil
end

def which_all(cmd, path = ENV["PATH"])
  PATH.new(path).map do |p|
    begin
      pcmd = File.expand_path(cmd, p)
    rescue ArgumentError
      # File.expand_path will raise an ArgumentError if the path is malformed.
      # See https://github.com/Homebrew/legacy-homebrew/issues/32789
      next
    end
    Pathname.new(pcmd) if File.file?(pcmd) && File.executable?(pcmd)
  end.compact.uniq
end

def which_editor
  editor = ENV.values_at("HOMEBREW_EDITOR", "HOMEBREW_VISUAL").compact.reject(&:empty?).first
  if editor
    editor_name, _, editor_args = editor.partition " "
    editor_path = which(editor_name, ENV["HOMEBREW_PATH"])
    editor = if editor_args.to_s.empty?
      editor_path.to_s
    else
      "#{editor_path} #{editor_args}"
    end
    return editor
  end

  # Find Textmate
  editor = which("mate", ENV["HOMEBREW_PATH"])
  # Find BBEdit / TextWrangler
  editor ||= which("edit", ENV["HOMEBREW_PATH"])
  # Find vim
  editor ||= which("vim", ENV["HOMEBREW_PATH"])
  # Default to standard vim
  editor ||= "/usr/bin/vim"

  opoo <<-EOS.undent
    Using #{editor} because no editor was set in the environment.
    This may change in the future, so we recommend setting EDITOR,
    or HOMEBREW_EDITOR to your preferred text editor.
  EOS

  editor.to_s
end

def exec_editor(*args)
  puts "Editing #{args.join "\n"}"
  safe_exec(which_editor, *args)
end

def exec_browser(*args)
  browser = ENV["HOMEBREW_BROWSER"]
  browser ||= OS::PATH_OPEN if defined?(OS::PATH_OPEN)
  return unless browser
  safe_exec(browser, *args)
end

def safe_exec(cmd, *args)
  # This buys us proper argument quoting and evaluation
  # of environment variables in the cmd parameter.
  exec "/bin/sh", "-c", "#{cmd} \"$@\"", "--", *args
end

# GZips the given paths, and returns the gzipped paths
def gzip(*paths)
  paths.collect do |path|
    with_system_path { safe_system "gzip", path }
    Pathname.new("#{path}.gz")
  end
end

# Returns array of architectures that the given command or library is built for.
def archs_for_command(cmd)
  cmd = which(cmd) unless Pathname.new(cmd).absolute?
  Pathname.new(cmd).archs
end

def ignore_interrupts(opt = nil)
  std_trap = trap("INT") do
    puts "One sec, just cleaning up" unless opt == :quietly
  end
  yield
ensure
  trap("INT", std_trap)
end

def capture_stderr
  old = $stderr
  $stderr = StringIO.new
  yield
  $stderr.string
ensure
  $stderr = old
end

def nostdout
  if ARGV.verbose?
    yield
  else
    begin
      out = $stdout.dup
      $stdout.reopen("/dev/null")
      yield
    ensure
      $stdout.reopen(out)
      out.close
    end
  end
end

def paths(env_path = ENV["PATH"])
  @paths ||= PATH.new(env_path).collect do |p|
    begin
      File.expand_path(p).chomp("/")
    rescue ArgumentError
      onoe "The following PATH component is invalid: #{p}"
    end
  end.uniq.compact
end

def disk_usage_readable(size_in_bytes)
  if size_in_bytes >= 1_073_741_824
    size = size_in_bytes.to_f / 1_073_741_824
    unit = "GB"
  elsif size_in_bytes >= 1_048_576
    size = size_in_bytes.to_f / 1_048_576
    unit = "MB"
  elsif size_in_bytes >= 1_024
    size = size_in_bytes.to_f / 1_024
    unit = "KB"
  else
    size = size_in_bytes
    unit = "B"
  end

  # avoid trailing zero after decimal point
  if ((size * 10).to_i % 10).zero?
    "#{size.to_i}#{unit}"
  else
    "#{format("%.1f", size)}#{unit}"
  end
end

def number_readable(number)
  numstr = number.to_i.to_s
  (numstr.size - 3).step(1, -3) { |i| numstr.insert(i, ",") }
  numstr
end

# Truncates a text string to fit within a byte size constraint,
# preserving character encoding validity. The returned string will
# be not much longer than the specified max_bytes, though the exact
# shortfall or overrun may vary.
def truncate_text_to_approximate_size(s, max_bytes, options = {})
  front_weight = options.fetch(:front_weight, 0.5)
  if front_weight < 0.0 || front_weight > 1.0
    raise "opts[:front_weight] must be between 0.0 and 1.0"
  end
  return s if s.bytesize <= max_bytes

  glue = "\n[...snip...]\n"
  max_bytes_in = [max_bytes - glue.bytesize, 1].max
  bytes = s.dup.force_encoding("BINARY")
  glue_bytes = glue.encode("BINARY")
  n_front_bytes = (max_bytes_in * front_weight).floor
  n_back_bytes = max_bytes_in - n_front_bytes
  if n_front_bytes.zero?
    front = bytes[1..0]
    back = bytes[-max_bytes_in..-1]
  elsif n_back_bytes.zero?
    front = bytes[0..(max_bytes_in - 1)]
    back = bytes[1..0]
  else
    front = bytes[0..(n_front_bytes - 1)]
    back = bytes[-n_back_bytes..-1]
  end
  out = front + glue_bytes + back
  out.force_encoding("UTF-8")
  out.encode!("UTF-16", invalid: :replace)
  out.encode!("UTF-8")
  out
end

def migrate_legacy_keg_symlinks_if_necessary
  legacy_linked_kegs = HOMEBREW_LIBRARY/"LinkedKegs"
  return unless legacy_linked_kegs.directory?

  HOMEBREW_LINKED_KEGS.mkpath unless legacy_linked_kegs.children.empty?
  legacy_linked_kegs.children.each do |link|
    name = link.basename.to_s
    src = begin
      link.realpath
    rescue Errno::ENOENT
      begin
        (HOMEBREW_PREFIX/"opt/#{name}").realpath
      rescue Errno::ENOENT
        begin
          Formulary.factory(name).installed_prefix
        rescue
          next
        end
      end
    end
    dst = HOMEBREW_LINKED_KEGS/name
    dst.unlink if dst.exist?
    FileUtils.ln_sf(src.relative_path_from(dst.parent), dst)
  end
  FileUtils.rm_rf legacy_linked_kegs

  legacy_pinned_kegs = HOMEBREW_LIBRARY/"PinnedKegs"
  return unless legacy_pinned_kegs.directory?

  HOMEBREW_PINNED_KEGS.mkpath unless legacy_pinned_kegs.children.empty?
  legacy_pinned_kegs.children.each do |link|
    name = link.basename.to_s
    src = link.realpath
    dst = HOMEBREW_PINNED_KEGS/name
    FileUtils.ln_sf(src.relative_path_from(dst.parent), dst)
  end
  FileUtils.rm_rf legacy_pinned_kegs
end


text:
package org.apache.flink.runtime.blocklist;

import java.util.Collection;
import java.util.Set;

/** A tracker for blocklist. */
public interface BlocklistTracker {

    /**
     * Add new blocked node records. If a node (identified by node id) already exists, the newly
     * added one will be merged with the existing one.
     *
     * @param newNodes the new blocked node records
     * @return the addition result
     */
    BlockedNodeAdditionResult addNewBlockedNodes(Collection<BlockedNode> newNodes);

    /**
     * Returns whether the given node is blocked.
     *
     * @param nodeId ID of the node to query
     * @return true if the given node is blocked, otherwise false
     */
    boolean isBlockedNode(String nodeId);

    /**
     * Get all blocked node ids.
     *
     * @return a set containing all blocked node ids
     */
    Set<String> getAllBlockedNodeIds();

    /**
     * Get all blocked nodes.
     *
     * @return a collection containing all blocked nodes
     */
    Collection<BlockedNode> getAllBlockedNodes();

    /**
     * Remove timeout nodes.
     *
     * @param currentTimeMillis current time
     * @return the removed nodes
     */
    Collection<BlockedNode> removeTimeoutNodes(long currentTimeMillis);
}


text:
class XYZ {
    static int name;

    void method() {
        System.out.println(name);
        <selection>27</selection>
        System.out.println(name);
    }
}


text:
model in epil3.bug
data in epil-data.R
load glm
compile, nchains(2)
inits in epil-inits.R
initialize
update 1000
monitor alpha0, thin(10)
monitor alpha.Base, thin(10)
monitor alpha.Trt, thin(10)
monitor alpha.BT, thin(10)
monitor alpha.Age, thin(10)
monitor alpha.V4, thin(10)
monitor sigma.b1, thin(10)
monitor sigma.b, thin(10)
update 10000
coda *


text:
/* eslint-disable no-unused-vars */

import electron from 'electron';

const app = electron.app;
const ipc = electron.ipcMain;

const certificateErrors = new Map();

export function setupCertificateHandlers() {
  // http://electron.atom.io/docs/api/app/#event-certificate-error
  app.on('certificate-error', (event, webContents, url, error, certificate, callback) => {
    // Call false to continue to not trust the certifcate
    certificateErrors.set(url, { error, certificate });

    // Calling `false` on the callback explicitly rejects the cert, which causes
    // errorCode === -3 for the `did-fail-load` events on webviews, and if we don't do it,
    // the cert will fail with the appropriate error information, so do not explicitly
    // call `callback(false)`. If we wanted to make an exception, we could check
    // here and call the callback with `true`.
    // callback(false);
  });

  ipc.on('get-certificate-error', (event, { url, id }) => {
    const data = certificateErrors.get(url) || {};
    data.id = id;
    event.sender.send('get-certificate-error-response', data);
  });
}


text:
// ***********************************************************************
// Assembly         : ACBr.Net.NFe
// Author           : Diego Martins
// Created          : 08-30-2021
//
// ***********************************************************************
// <copyright file="ProviderBase.cs" company="ACBr.Net">
//		        		   The MIT License (MIT)
//	     		    Copyright (c) 2016 Grupo ACBr.Net
//
//	 Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//	 The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//	 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
// </copyright>
// <summary></summary>
// ***********************************************************************

using ACBr.Net.Core.Extensions;
using System;
using System.IO;
using System.Net;
using System.Xml.Linq;

namespace ACBr.Net.NFSe.Providers
{
    public class SigissWebServiceClient : NFSeRestServiceClient, IServiceClient
    {
        private TipoUrl _tipoUrl;
        public SigissWebServiceClient(ProviderBase provider, TipoUrl tipoUrl) : base(provider, tipoUrl)
        {
            _tipoUrl = tipoUrl;
        }

        #region Methods

        #region nao implementados
        public string Enviar(string cabec, string msg)
        {
            throw new NotImplementedException();
        }

        public string ConsultarSituacao(string cabec, string msg)
        {
            throw new NotImplementedException();
        }

        public string ConsultarLoteRps(string cabec, string msg)
        {
            throw new NotImplementedException();
        }

        public string ConsultarSequencialRps(string cabec, string msg)
        {
            throw new NotImplementedException();
        }

        public string ConsultarNFSe(string cabec, string msg)
        {
            throw new NotImplementedException();
        }

        public string CancelarNFSeLote(string cabec, string msg)
        {
            throw new NotImplementedException();
        }

        public string SubstituirNFSe(string cabec, string msg)
        {
            throw new NotImplementedException();
        }
        #endregion nao implementados

        public string EnviarSincrono(string cabec, string msg)
        {
            return Execute("/nfes", msg, "POST");
        }

        public string ConsultarNFSeRps(string cabec, string msg)
        {
            var xml = XDocument.Parse(msg);
            var numerorps = xml.Root?.ElementAnyNs("NumeroRPS")?.GetValue<string>();
            var serierps = xml.Root?.ElementAnyNs("SerieRPS")?.GetValue<string>();
            return Execute($"/nfes/pegaxml/{numerorps}/serierps/{serierps}");
        }

        public string CancelarNFSe(string cabec, string msg)
        {
            var xml = XDocument.Parse(msg);
            var numeronf = xml.Root?.ElementAnyNs("NumeroNFSe")?.GetValue<string>();
            var serie = xml.Root?.ElementAnyNs("SerieNFSe")?.GetValue<string>();
            var motivo = xml.Root?.ElementAnyNs("Motivo")?.GetValue<string>();
            return Execute($"/nfes/cancela/{numeronf}/serie/{serie}/motivo/{motivo}");
        }

        protected override WebRequest CreateWebRequest(string action, string method)
        {
            string autenticacao = string.Empty;
            string json = "{ \"login\": \"" + Provider.Configuracoes.WebServices.Usuario + "\"  , \"senha\":\"" + Provider.Configuracoes.WebServices.Senha + "\"}";
            var webrequest = WebRequest.Create(Provider.GetUrl(TipoUrl.Autenticacao) + "/login");
            webrequest.Method = "POST";
            webrequest.ContentType = "application/json; charset=utf-8";

            using (var streamWriter = new StreamWriter(webrequest.GetRequestStream()))
            {
                streamWriter.Write(json);
                streamWriter.Flush();
            }
            using (var response = webrequest.GetResponse())
            {
                using (StreamReader reader = new StreamReader(response.GetResponseStream()))
                {
                    autenticacao = reader.ReadToEnd();
                }
                response.Close();
            }

            var url = Provider.GetUrl(_tipoUrl);
            if (!url.EndsWith("/"))
                url += "/";

            webrequest = WebRequest.Create(url + action);
            webrequest.Headers.Add("AUTHORIZATION", autenticacao);
            webrequest.Method = method;
            webrequest.ContentType = "application/xml";

            return webrequest;
        }

        public void Dispose()
        {

        }

        #endregion Methods

    }
}


text:
package edu.neu.nutrons.reboundrumble.commands.camera;

import edu.neu.nutrons.reboundrumble.commands.CommandBase;

/**
 * Sets camera to certain position. For debugging.
 *
 * @author Ziv
 */
public class CamManualCmd extends CommandBase {

    public CamManualCmd() {
        requires(cam);
    }

    // Called just before this Command runs the first time
    protected void initialize() {
    }

    // Called repeatedly when this Command is scheduled to run
    protected void execute() {
        cam.setPos(cam.getPos() + oi.getCamDelta());
    }

    // Make this return true when this Command no longer needs to run execute()
    protected boolean isFinished() {
        return false;
    }

    // Called once after isFinished returns true
    protected void end() {
    }

    // Called when another command which requires one or more of the same
    // subsystems is scheduled to run
    protected void interrupted() {
    }
}


text:
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.mock;

import com.intellij.openapi.Disposable;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.search.GlobalSearchScope;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.nio.file.Path;
import java.nio.file.Paths;

/**
 * @author peter
 */
public class MockModule extends MockComponentManager implements Module {
  private final Project myProject;
  private String myName = "MockModule";

  public MockModule(@NotNull Disposable parentDisposable) {
    this(null, parentDisposable);
  }

  public MockModule(@Nullable final Project project, @NotNull Disposable parentDisposable) {
    super(project == null ? null : project.getPicoContainer(), parentDisposable);
    myProject = project;
  }

  @Override
  public VirtualFile getModuleFile() {
    throw new UnsupportedOperationException("Method getModuleFile is not yet implemented in " + getClass().getName());
  }

  @Override
  @NotNull
  public Path getModuleNioFile() {
    return Paths.get("");
  }

  @NotNull
  @Override
  public GlobalSearchScope getModuleRuntimeScope(final boolean includeTests) {
    return new MockGlobalSearchScope();
  }

  @Override
  public @NotNull GlobalSearchScope getModuleProductionSourceScope() {
    throw new UnsupportedOperationException("Method getModuleProductionSourceScope is not yet implemented in " + getClass().getName());
  }

  @Override
  public @NotNull GlobalSearchScope getModuleTestSourceScope() {
    throw new UnsupportedOperationException("Method getModuleTestSourceScope is not yet implemented in " + getClass().getName());
  }

  @NotNull
  @Override
  public GlobalSearchScope getModuleScope() {
    return new MockGlobalSearchScope();
  }

  @NotNull
  @Override
  public GlobalSearchScope getModuleScope(boolean includeTests) {
    return new MockGlobalSearchScope();
  }

  @NotNull
  @Override
  public GlobalSearchScope getModuleTestsWithDependentsScope() {
    return new MockGlobalSearchScope();
  }

  @NotNull
  @Override
  public GlobalSearchScope getModuleWithDependenciesAndLibrariesScope(final boolean includeTests) {
    return new MockGlobalSearchScope();

    //throw new UnsupportedOperationException( "Method getModuleWithDependenciesAndLibrariesScope is not yet implemented in " + getClass().getName());
  }

  @NotNull
  @Override
  public GlobalSearchScope getModuleWithDependenciesScope() {
    return new MockGlobalSearchScope();
  }

  @NotNull
  @Override
  public GlobalSearchScope getModuleContentWithDependenciesScope() {
    throw new UnsupportedOperationException("Method getModuleContentWithDependenciesScope is not yet implemented in " + getClass().getName());
  }

  @NotNull
  @Override
  public GlobalSearchScope getModuleContentScope() {
    throw new UnsupportedOperationException("Method getModuleContentScope is not yet implemented in " + getClass().getName());
  }

  @NotNull
  @Override
  public GlobalSearchScope getModuleWithDependentsScope() {
    throw new UnsupportedOperationException("Method getModuleWithDependentsScope is not yet implemented in " + getClass().getName());
  }

  @NotNull
  @Override
  public GlobalSearchScope getModuleWithLibrariesScope() {
    throw new UnsupportedOperationException("Method getModuleWithLibrariesScope is not yet implemented in " + getClass().getName());
  }

  @Override
  @NotNull
  public String getName() {
    return myName;
  }

  public MockModule setName(String name) {
    myName = name;
    return this;
  }

  @Override
  public boolean isLoaded() {
    return !isDisposed();
  }

  @Override
  @Nullable
  public String getOptionValue(@NotNull final String optionName) {
    throw new UnsupportedOperationException("Method getOptionValue is not yet implemented in " + getClass().getName());
  }

  @Override
  @NotNull
  public Project getProject() {
    return myProject;
  }

  @Override
  public void setOption(@NotNull final String optionName, @NotNull final String optionValue) {
    throw new UnsupportedOperationException("Method setOption is not yet implemented in " + getClass().getName());
  }
}


text:
+++
title = "HTTP Routing"
description = "Routing HTTP request in Echo"
[menu.side]
  name = "Routing"
  parent = "guide"
  weight = 4
+++

## Routing

Echo's router is [fast, optimized]({{< ref "index.md#performance">}}) and
flexible. It's based on [radix tree](http://en.wikipedia.org/wiki/Radix_tree) data
structure which makes route lookup really fast. Router leverages [sync pool](https://golang.org/pkg/sync/#Pool)
to reuse memory and achieve zero dynamic memory allocation with no GC overhead.

Routes can be registered by specifying HTTP method, path and a matching handler.
For example, code below registers a route for method `GET`, path `/hello` and a
handler which sends `Hello, World!` HTTP response.

```go
// Handler
func hello(c echo.Context) error {
  	return c.String(http.StatusOK, "Hello, World!")
}

// Route
e.GET("/hello", hello)
```

You can use `Echo.Any(path string, h Handler)` to register a handler for all HTTP methods.
If you want to register it for some methods use `Echo.Match(methods []string, path string, h Handler)`.

Echo defines handler function as `func(echo.Context) error` where `echo.Context` primarily
holds HTTP request and response interfaces.

### Match-any

Matches zero or more characters in the path. For example, pattern `/users/*` will
match:

- `/users/`
- `/users/1`
- `/users/1/files/1`
- `/users/anything...`

### Path matching order

- Static
- Param
- Match any

#### Example

```go
e.GET("/users/:id", func(c echo.Context) error {
	return c.String(http.StatusOK, "/users/:id")
})

e.GET("/users/new", func(c echo.Context) error {
	return c.String(http.StatusOK, "/users/new")
})

e.GET("/users/1/files/*", func(c echo.Context) error {
	return c.String(http.StatusOK, "/users/1/files/*")
})
```

Above routes would resolve in the following order:

- `/users/new`
- `/users/:id`
- `/users/1/files/*`

> Routes can be written in any order.

### Group

`Echo#Group(prefix string, m ...Middleware) *Group`

Routes with common prefix can be grouped to define a new sub-router with optional
middleware. In addition to specified middleware group also inherits parent middleware.
To add middleware later in the group you can use `Group.Use(m ...Middleware)`.
Groups can also be nested.

In the code below, we create an admin group which requires basic HTTP authentication
for routes `/admin/*`.

```go
g := e.Group("/admin")
g.Use(middleware.BasicAuth(func(username, password string) bool {
	if username == "joe" && password == "secret" {
		return true
	}
	return false
}))
```

### URI building

`Echo.URI` can be used to generate URI for any handler with specified path parameters.
It's helpful to centralize all your URI patterns which ease in refactoring your
application.

`e.URI(h, 1)` will generate `/users/1` for the route registered below

```go
// Handler
h := func(c echo.Context) error {
	return c.String(http.StatusOK, "OK")
}

// Route
e.GET("/users/:id", h)
```


text:
package io.hekate.test;

/** Unchecked error for tests. */
public class HekateTestError extends AssertionError {
    /** Common prefix for messages of expected errors that were produced by tests. */
    public static final String MESSAGE_PREFIX = "*** RELAX:)";

    /** Common message for expected errors that were produced by tests. */
    public static final String MESSAGE = MESSAGE_PREFIX + " This exception was created by the test case.";

    private static final long serialVersionUID = 1;

    public HekateTestError(String message) {
        super(message);
    }

    @Override
    public synchronized Throwable fillInStackTrace() {
        return this;
    }
}


text:
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __gpio_H
#define __gpio_H
#ifdef __cplusplus
 extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32f3xx_hal.h"
void MX_GPIO_Init(void);
void LED_On(void);
void LED_Off(void);
void LED_Toggle(void);

#define B1_Pin GPIO_PIN_13
#define B1_GPIO_Port GPIOC
#define USART_TX_Pin GPIO_PIN_2
#define USART_TX_GPIO_Port GPIOA
#define USART_RX_Pin GPIO_PIN_3
#define USART_RX_GPIO_Port GPIOA
#define LD2_Pin GPIO_PIN_5
#define LD2_GPIO_Port GPIOA
#define TMS_Pin GPIO_PIN_13
#define TMS_GPIO_Port GPIOA
#define TCK_Pin GPIO_PIN_14
#define TCK_GPIO_Port GPIOA
#define SWO_Pin GPIO_PIN_3
#define SWO_GPIO_Port GPIOB

#ifdef __cplusplus
}
#endif
#endif /*__ pinoutConfig_H */

/**
  * @}
  */

/**
  * @}
  */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


text:
> Contributed By: [Tyler Kellen](/tkellen) (@tkellen)

### Overview

Inside your `grunt.js` file add a section named `less`. This section specifies the files to compile and the options passed to [LESS](http://lesscss.org/#-server-side-usage).

#### Parameters

##### files ```object```

This defines what files this task will process and should contain key:value pairs.

The key (destination) should be an unique filepath (supports [grunt.template](https://github.com/cowboy/grunt/blob/master/docs/api_template.md)) and the value (source) should be a filepath or an array of filepaths (supports [minimatch](https://github.com/isaacs/minimatch)).

Note: When the value contains an array of multiple filepaths, the contents are concatenated in the order passed.

##### options ```object```

This controls how this task (and its helpers) operate and should contain key:value pairs, see options below.

#### Options

##### paths ```string|array```

This specifies directories to scan for @import directives when parsing.

#### Config Example

``` javascript
less: {
  compile: {
    options: {
      paths: ["assets/css"]
    },
    files: {
      "path/to/result.css": "path/to/source.less"
    }
  }
}
```


text:
package ikube.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;

@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class SavePoint extends Persistable {

    @Column
    private String indexable;
    @Column
    private String indexContext;
    @Column
    private Long identifier;

    public String getIndexable() {
        return indexable;
    }

    public void setIndexable(String indexable) {
        this.indexable = indexable;
    }

    public String getIndexContext() {
        return indexContext;
    }

    public void setIndexContext(String indexContext) {
        this.indexContext = indexContext;
    }

    public Long getIdentifier() {
        return identifier;
    }

    public void setIdentifier(Long identifier) {
        this.identifier = identifier;
    }
}


text:
#import "ABI10_0_0RCTTestModule.h"

#import "ABI10_0_0FBSnapshotTestController.h"
#import "ABI10_0_0RCTAssert.h"
#import "ABI10_0_0RCTEventDispatcher.h"
#import "ABI10_0_0RCTLog.h"
#import "ABI10_0_0RCTUIManager.h"

@implementation ABI10_0_0RCTTestModule {
  NSMutableDictionary<NSString *, NSNumber *> *_snapshotCounter;
}

@synthesize bridge = _bridge;

ABI10_0_0RCT_EXPORT_MODULE()

- (dispatch_queue_t)methodQueue
{
  return _bridge.uiManager.methodQueue;
}

ABI10_0_0RCT_EXPORT_METHOD(verifySnapshot:(ABI10_0_0RCTResponseSenderBlock)callback)
{
  ABI10_0_0RCTAssert(_controller != nil, @"No snapshot controller configured.");

  [_bridge.uiManager addUIBlock:^(ABI10_0_0RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
    NSString *testName = NSStringFromSelector(self->_testSelector);
    if (!self->_snapshotCounter) {
      self->_snapshotCounter = [NSMutableDictionary new];
    }

    NSNumber *counter = @([self->_snapshotCounter[testName] integerValue] + 1);
    self->_snapshotCounter[testName] = counter;

    NSError *error = nil;
    NSString *identifier = [counter stringValue];
    if (self->_testSuffix) {
      identifier = [identifier stringByAppendingString:self->_testSuffix];
    }
    BOOL success = [self->_controller compareSnapshotOfView:self->_view
                                                   selector:self->_testSelector
                                                 identifier:identifier
                                                      error:&error];
    callback(@[@(success)]);
  }];
}

ABI10_0_0RCT_EXPORT_METHOD(sendAppEvent:(NSString *)name body:(nullable id)body)
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
  [_bridge.eventDispatcher sendAppEventWithName:name body:body];
#pragma clang diagnostic pop
}

ABI10_0_0RCT_REMAP_METHOD(shouldResolve, shouldResolve_resolve:(ABI10_0_0RCTPromiseResolveBlock)resolve reject:(ABI10_0_0RCTPromiseRejectBlock)reject)
{
  resolve(@1);
}

ABI10_0_0RCT_REMAP_METHOD(shouldReject, shouldReject_resolve:(ABI10_0_0RCTPromiseResolveBlock)resolve reject:(ABI10_0_0RCTPromiseRejectBlock)reject)
{
  reject(nil, nil, nil);
}

ABI10_0_0RCT_EXPORT_METHOD(markTestCompleted)
{
  [self markTestPassed:YES];
}

ABI10_0_0RCT_EXPORT_METHOD(markTestPassed:(BOOL)success)
{
  [_bridge.uiManager addUIBlock:^(__unused ABI10_0_0RCTUIManager *uiManager, __unused NSDictionary<NSNumber *, UIView *> *viewRegistry) {
    self->_status = success ? ABI10_0_0RCTTestStatusPassed : ABI10_0_0RCTTestStatusFailed;
  }];
}

@end


text:
package relay

import "github.com/spiral/goridge/v3/pkg/frame"

// Relay provide IPC over signed payloads.
type Relay interface {
	// Send signed (prefixed) data to PHP process.
	Send(frame *frame.Frame) error

	// Receive data from the underlying process and returns associated prefix or error.
	Receive(frame *frame.Frame) error

	// Close the connection.
	Close() error
}


text:
const DrawCard = require('../../drawcard');

class Lionstar extends DrawCard {
    setupCardAbilities(ability) {
        this.action({
            title: 'Put a character into play',
            cost: ability.costs.kneelSelf(),
            target: {
                cardCondition: card => (
                    card.location === 'hand' &&
                    card.controller === this.controller &&
                    card.getType() === 'character' &&
                    card.isFaction('lannister') &&
                    this.controller.canPutIntoPlay(card) &&
                    card.getPrintedCost() <= 4
                )
            },
            message: '{player} kneels {source} to put {target} into play',
            handler: context => {
                context.player.putIntoPlay(context.target);
                this.atEndOfPhase(ability => ({
                    match: context.target,
                    effect: ability.effects.discardIfStillInPlay()
                }));
            }
        });
    }
}

Lionstar.code = '14028';

module.exports = Lionstar;


text:
<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2000/10/XMLSchema">
	<!-- XSchema deffinition for token-->
	<element name="Token" />
</schema>


text:
package com.gu.notifications.events

import java.util

import scala.util.Try

class EnvDependencies {
  private val env: util.Map[String, String] = System.getenv()

  private def getNeededKey(key: String): String =
    Try{Option(env.get(key))}.toOption.flatten.map(_.trim) match {
      case Some(value) if value.nonEmpty => value
      case _ => throw new RuntimeException(s"Missing environment key $key")
    }

  val athenaOutputLocation: String = getNeededKey("AthenaOutputLocation")
  val athenaDatabase: String = getNeededKey("AthenaDatabase")
  val stage = env.getOrDefault("Stage", "CODE")
  val ingestLocation: String = getNeededKey("IngestLocation")
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Ann. Jard. Bot. Buitenzorg 1:156. 1876 (H. Wendland & O. Drude, Linnaea 39:184. 1875, nom. inval. )

#### Original name
null

### Remarks
null


text:
<?php
session_start();
require '../config.php';

    if ($_SERVER['REQUEST_METHOD'] == 'POST'){

        $email   = $_SESSION['email']     ;

        $travel_form = $_POST['travel_form'];
        $mode = $_POST['mode'];
        $reach_in = $_POST['reach_in'];
        $date_reach_in = $_POST['date_reach_in'];
        $time_reach_in = $_POST['time_reach_in'];
        $flight_no = $_POST['flight_no'];
        $train_no = $_POST['train_no'];
        $cab = $_POST['cab'];
        $cab_type = $_POST['cab_type'];
        $no_acc = $_POST['no_acc'];
        $date_reach_out = $_POST['date_reach_out'];
        $time_reach_out = $_POST['time_reach_out'];
        $reach_out = $_POST['reach_out'];

        $sql = "UPDATE `hc` SET `travel_form`          = :travel_form,
                                 `mode`        = :mode ,
                                 `reach_in`       = :reach_in,
                                 `date_reach_in`          = :date_reach_in,
                                 `time_reach_in`        = :time_reach_in,
                                 `flight_no`        = :flight_no,
                                 `train_no`         = :train_no,
                                 `cab`            = :cab,
                                 `cab_type`          = :cab_type,
                                 `no_acc`        = :no_acc,
                                 `date_reach_out`        = :date_reach_out,
                                 `time_reach_out`         = :time_reach_out,
                                 `reach_out`            = :reach_out
                                  WHERE `email` = '$email'";

        $stmt=$GLOBALS["conn"]->prepare($sql);

        $stmt->bindparam(':travel_form',$travel_form);
      $stmt->bindparam(':mode',$mode);
      $stmt->bindparam(':reach_in',$reach_in);
      $stmt->bindparam(':date_reach_in',$date_reach_in);
      $stmt->bindparam(':time_reach_in',$time_reach_in);
      $stmt->bindparam(':flight_no',$flight_no);
      $stmt->bindparam(':train_no',$train_no);
      $stmt->bindparam(':cab',$cab);
      $stmt->bindparam(':cab_type',$cab_type);
      $stmt->bindparam(':no_acc',$no_acc);
      $stmt->bindparam(':date_reach_out',$date_reach_out);
      $stmt->bindparam(':time_reach_out',$time_reach_out);
      $stmt->bindparam(':reach_out',$reach_out);
        $result = $stmt->execute();

        if($result){
          echo '

          Success! Your entry has been submitted successfully!
          <button type="button" class="close" data-dismiss="alert" aria-label="Close">
            ×
          </button>

';

        echo '';
        header("Location: ../Utility/get_update.php");
        }
        else{
            // echo "The record was not inserted successfully because of this error ---> ". mysqli_error($conn);
            echo '

          Error! We are facing some technical issue and your entry ws not submitted successfully! We regret the inconvinience caused!
          <button type="button" class="close" data-dismiss="alert" aria-label="Close">
            ×
          </button>

';
        header("Location: ../errorpage.html");
        }
      //}
    }
?>


text:
//------------------------------------------------------------------------------
// <copyright file="SliderSample.xaml.cs" company="Microsoft">
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
//------------------------------------------------------------------------------

namespace Microsoft.Samples.Kinect.ControlsBasics
{
    using System.Windows.Controls;

    /// <summary>
    /// Interaction logic for SliderToggleSwitchSample
    /// </summary>
    public partial class SliderSample : UserControl
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="SliderSample"/> class.
        /// </summary>
        public SliderSample()
        {
            this.InitializeComponent();
        }
    }
}


text:
<?php
/**
 * Die Hauptsprachdatei ist im Verzeichnis /languages/en.php und jedes Plugin hat seine
 * Sprachdatei in einem eigenen languages-Verzeichnis. Um einen Sprach-String zu ändern, kopiere die
 * entsprechende Zeile in diese Datei.
 *
 * Um beispielsweise den Menueintrag "Blog"
 * von "Blog" zu "Schimpftiraden" zu ändern, kopiere dieses Paar:
 *                      'blog' => "Blog",
 * in das $mapping-Array und ändere es wie folgt:
 *                      'blog' => "Schimpftiraden",
 *
 * Mache das gleiche für alle anderen Strings, die Du ändern möchtest. Stelle sicher, dass das Plugin,
 * das die Sprachdatei mit Deinen Änderungen enthält in der Pluginliste tiefer angeordnet ist als
 * alle Plugins, deren Sprach-Strings Du modifizieren möchtest.
 *
 * Wenn Du andere Sprachen außer Englisch hinzufügen möchtest, benenne die Datei entsprechend dem
 * ISO 639-1 Länderkürzel: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
 *
 * (C) iionly 2012-2014
 * Dual licensed under the MIT or GPL Version 2 licenses
 *
 * https://github.com/iionly
 * Contact: iionly@gmx.de
 */

$mapping = array(
        'string:here' => 'Auf der Seite anzuzeigender String hier eingeben.'
);

add_translation('de', $mapping);


text:
//=================================================================================================

//=================================================================================================

//*************************************************************************************************
// Includes
//*************************************************************************************************

#include <cstdlib>
#include <iostream>
#include <blaze/math/DynamicMatrix.h>
#include <blaze/math/UpperMatrix.h>
#include <blazetest/mathtest/Creator.h>
#include <blazetest/mathtest/dmatdmatmult/OperationTest.h>
#include <blazetest/system/MathTest.h>

//=================================================================================================
//
//  MAIN FUNCTION
//
//=================================================================================================

//*************************************************************************************************
int main()
{
   std::cout << "   Running 'UDbMDb'..." << std::endl;

   using blazetest::mathtest::TypeB;

   try
   {
      // Matrix type definitions
      typedef blaze::UpperMatrix< blaze::DynamicMatrix<TypeB> >  UDb;
      typedef blaze::DynamicMatrix<TypeB>                        MDb;

      // Creator type definitions
      typedef blazetest::Creator<UDb>  CUDb;
      typedef blazetest::Creator<MDb>  CMDb;

      // Running tests with small matrices
      for( size_t i=0UL; i<=6UL; ++i ) {
         for( size_t j=0UL; j<=6UL; ++j ) {
            RUN_DMATDMATMULT_OPERATION_TEST( CUDb( i ), CMDb( i, j ) );
         }
      }

      // Running tests with large matrices
      RUN_DMATDMATMULT_OPERATION_TEST( CUDb( 15UL ), CMDb( 15UL, 37UL ) );
      RUN_DMATDMATMULT_OPERATION_TEST( CUDb( 37UL ), CMDb( 37UL, 37UL ) );
      RUN_DMATDMATMULT_OPERATION_TEST( CUDb( 63UL ), CMDb( 63UL, 37UL ) );
      RUN_DMATDMATMULT_OPERATION_TEST( CUDb( 16UL ), CMDb( 16UL, 32UL ) );
      RUN_DMATDMATMULT_OPERATION_TEST( CUDb( 32UL ), CMDb( 32UL, 32UL ) );
      RUN_DMATDMATMULT_OPERATION_TEST( CUDb( 64UL ), CMDb( 64UL, 32UL ) );
   }
   catch( std::exception& ex ) {
      std::cerr << "\n\n ERROR DETECTED during dense matrix/dense matrix multiplication:\n"
                << ex.what() << "\n";
      return EXIT_FAILURE;
   }

   return EXIT_SUCCESS;
}
//*************************************************************************************************


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
All Classes (Hadoop 0.20.2 API)
</TITLE>

<META NAME="date" CONTENT="2010-02-19">

<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

All Classes

AbstractMapWritable

AbstractMetricsContext

AccessControlException

AccessControlException

AggregateWordCount

AggregateWordCount.WordCountPlugInClass

AggregateWordHistogram

AggregateWordHistogram.AggregateWordHistogramPlugin

Anonymizer

ArrayFile

ArrayFile.Reader

ArrayFile.Writer

ArrayListBackedIterator

ArrayListBackedIterator

ArrayWritable

AuthorizationException

BinaryComparable

BinaryRecordInput

BinaryRecordOutput

Block

BlockCompressorStream

BlockDecompressorStream

BlockLocation

BloomFilter

BloomMapFile

BloomMapFile.Reader

BloomMapFile.Writer

BooleanWritable

BooleanWritable.Comparator

Buffer

BufferedFSInputStream

BuiltInZlibDeflater

BuiltInZlibInflater

ByteArray

BytesWritable

BytesWritable.Comparator

ByteWritable

ByteWritable.Comparator

BZip2Codec

BZip2Constants

BZip2DummyCompressor

BZip2DummyDecompressor

CachedDNSToSwitchMapping

CBZip2InputStream

CBZip2OutputStream

ChainMapper

ChainReducer

ChecksumException

ChecksumFileSystem

Client

Closeable

ClusterStatus

CodeBuffer

CodecPool

CombineFileInputFormat

CombineFileRecordReader

CombineFileSplit

Command

CommandFormat

ComposableInputFormat

ComposableRecordReader

CompositeContext

CompositeInputFormat

CompositeInputSplit

CompositeRecordReader

CompressedWritable

CompressionCodec

CompressionCodecFactory

CompressionInputStream

CompressionOutputStream

Compressor

CompressorStream

Configurable

Configuration

Configuration.IntegerRanges

Configured

ConfiguredPolicy

ConnectionPermission

Consts

ContentSummary

ContextFactory

Continuous

Count

Counter

CounterGroup

Counters

Counters

Counters.Counter

Counters.Group

CountingBloomFilter

CPUParser

CsvRecordInput

CsvRecordOutput

CyclicIteration

Daemon

DancingLinks

DancingLinks.SolutionAcceptor

DataChecksum

DataInputBuffer

DataJoinJob

DataJoinMapperBase

DataJoinReducerBase

DataOutputBuffer

DBConfiguration

DBCountPageView

DBInputFormat

DBInputFormat.DBInputSplit

DBInputFormat.NullDBWritable

DBOutputFormat

DBWritable

Decompressor

DecompressorStream

DefaultCodec

DefaultJobHistoryParser

DefaultStringifier

DelegatingInputFormat

DelegatingMapper

Deserializer

DeserializerComparator

DF

DiskChecker

DiskChecker.DiskErrorException

DiskChecker.DiskOutOfSpaceException

DistributedCache

DistributedPentomino

DistributedPentomino.PentMap

DNS

DNSToSwitchMapping

DocumentAndOp

DocumentAndOp.Op

DocumentID

DoubleValueSum

DoubleWritable

DoubleWritable.Comparator

DU

DynamicBloomFilter

Environment

Environment

EventCounter

EventRecord

ExampleDriver

Executor

FieldSelectionMapReduce

FieldTypeInfo

FileAlreadyExistsException

FileChecksum

FileContext

FileInputFormat

FileInputFormat

FileOutputCommitter

FileOutputCommitter

FileOutputFormat

FileOutputFormat

FileSplit

FileSplit

FileStatus

FileSystem

FileSystem.Statistics

FileSystemDirectory

FileSystemStore

FileUtil

FileUtil.HardLink

Filter

FilterContainer

FilterFileSystem

FilterInitializer

FloatWritable

FloatWritable.Comparator

FsAction

FSDataInputStream

FSDataOutputStream

FSError

FSInputChecker

FSInputStream

FSOutputSummer

FsPermission

FsShell

FsUrlStreamHandlerFactory

FTPException

FTPFileSystem

FTPInputStream

GangliaContext

GenericOptionsParser

GenericsUtil

GenericWritable

Grep

Group

GzipCodec

GzipCodec.GzipInputStream

GzipCodec.GzipOutputStream

HadoopLogParser

HadoopStreaming

HadoopVersionAnnotation

HarFileSystem

Hash

HashFunction

HashingDistributionPolicy

HashPartitioner

HashPartitioner

HDFSMerger

HeapSort

HostsFileReader

HttpServer

HttpServer.StackServlet

ID

ID

IdentityLocalAnalysis

IdentityMapper

IdentityReducer

IDistributionPolicy

IIndexUpdater

ILocalAnalysis

Index

IndexedSortable

IndexedSorter

IndexUpdateCombiner

IndexUpdateConfiguration

IndexUpdateMapper

IndexUpdateOutputFormat

IndexUpdatePartitioner

IndexUpdater

IndexUpdateReducer

InMemoryFileSystem

InnerJoinRecordReader

INode

InputBuffer

InputFormat

InputFormat

InputSampler

InputSampler.IntervalSampler

InputSampler.RandomSampler

InputSampler.Sampler

InputSampler.SplitSampler

InputSplit

InputSplit

IntermediateForm

IntSumReducer

IntWritable

IntWritable.Comparator

InvalidFileTypeException

InvalidInputException

InvalidInputException

InvalidJobConfException

InverseMapper

InverseMapper

IOUtils

IOUtils.NullOutputStream

IsolationRunner

JarBuilder

JavaSerialization

JavaSerializationComparator

JBoolean

JBuffer

JByte

JDouble

JenkinsHash

JField

JFile

JFloat

JInt

JLong

JMap

Job

Job

Job.JobState

JobBase

JobClient

JobClient.TaskStatusFilter

JobConf

JobConfigurable

JobContext

JobContext

JobControl

JobEndNotifier

JobHistory

JobHistory.HistoryCleaner

JobHistory.JobInfo

JobHistory.Keys

JobHistory.Listener

JobHistory.MapAttempt

JobHistory.RecordTypes

JobHistory.ReduceAttempt

JobHistory.Task

JobHistory.TaskAttempt

JobHistory.Values

JobID

JobID

JobPriority

JobProfile

JobQueueInfo

JobStatus

JobTracker

JobTracker.IllegalStateException

JobTracker.State

Join

JoinRecordReader

JRecord

JString

JType

JVector

JvmMetrics

Key

KeyFieldBasedComparator

KeyFieldBasedPartitioner

KeyValueLineRecordReader

KeyValueTextInputFormat

KosmosFileSystem

LineDocInputFormat

LineDocLocalAnalysis

LineDocRecordReader

LineDocTextAndOp

LineReader

LineRecordReader

LineRecordReader

LineRecordReader.LineReader

LinuxMemoryCalculatorPlugin

LocalDirAllocator

LocalFileSystem

LocalStore

LogLevel

LogLevel.Servlet

LogParser

LongSumReducer

LongSumReducer

LongValueMax

LongValueMin

LongValueSum

LongWritable

LongWritable.Comparator

LongWritable.DecreasingComparator

LuceneUtil

MapContext

MapFile

MapFile.Reader

MapFile.Writer

MapFileOutputFormat

Mapper

Mapper

MapReduceBase

MapReducePolicyProvider

MapRunnable

MapRunner

MapTypeID

MapWritable

MBeanUtil

MD5Hash

MD5Hash.Comparator

MD5MD5CRC32FileChecksum

MemoryCalculatorPlugin

MergeSort

MetaBlockAlreadyExists

MetaBlockDoesNotExist

MetricsBase

MetricsContext

MetricsDynamicMBeanBase

MetricsException

MetricsIntValue

MetricsLongValue

MetricsRecord

MetricsRecordImpl

MetricsRegistry

MetricsTimeVaryingInt

MetricsTimeVaryingLong

MetricsTimeVaryingRate

MetricsUtil

MetricValue

MigrationTool

Monitored

MonitorJob

MRAdmin

MultiFileInputFormat

MultiFileSplit

MultiFileWordCount

MultiFileWordCount.MapClass

MultiFileWordCount.MultiFileLineRecordReader

MultiFileWordCount.MyInputFormat

MultiFileWordCount.WordOffset

MultiFilterRecordReader

MultipleInputs

MultipleIOException

MultipleOutputFormat

MultipleOutputs

MultipleSequenceFileOutputFormat

MultipleTextOutputFormat

MultithreadedMapper

MultithreadedMapRunner

MurmurHash

NativeCodeLoader

NativeS3FileSystem

NetUtils

NetworkTopology

NICParser

NLineInputFormat

Node

NodeBase

NullContext

NullContextWithUpdateThread

NullOutputFormat

NullOutputFormat

NullWritable

NullWritable.Comparator

ObjectWritable

OfflineAnonymizer

OfflineAnonymizer.LogType

OneSidedPentomino

OuterJoinRecordReader

OutputBuffer

OutputCollector

OutputCommitter

OutputCommitter

OutputFormat

OutputFormat

OutputLogFilter

OutputRecord

OverrideRecordReader

ParseException

Parser

Parser.Node

Parser.NodeToken

Parser.NumToken

Parser.StrToken

Parser.Token

Parser.TType

Partitioner

Partitioner

Path

PathFilter

PathFinder

Pentomino

Pentomino.ColumnName

Pentomino.Piece

Pentomino.SolutionCategory

PermissionStatus

PersistentState

PiEstimator

PiEstimator.PiMapper

PiEstimator.PiReducer

PipeMapper

PipeMapRed

PipeMapRunner

PipeReducer

PlatformName

PolicyProvider

PositionedReadable

PrintJarMainClass

PriorityQueue

ProcfsBasedProcessTree

ProgramDriver

Progress

Progressable

QuickSort

RAMDirectoryUtil

RandomTextWriter

RandomWriter

RawComparable

RawComparator

RawKeyValueIterator

RawLocalFileSystem

Rcc

RccConstants

RccTask

RccTokenManager

Record

RecordComparator

RecordInput

RecordOutput

RecordReader

RecordReader

RecordTypeInfo

RecordWriter

RecordWriter

ReduceContext

Reducer

Reducer

ReflectionUtils

RefreshAuthorizationPolicyProtocol

RegexMapper

RemoteException

RemoveScheme

Reporter

ResetableIterator

ResetableIterator

ResetableIterator.EMPTY

RetouchedBloomFilter

RetryPolicies

RetryPolicy

RetryProxy

RoundRobinDistributionPolicy

RPC

RPC.Server

RPC.VersionMismatch

RpcActivityMBean

RpcMetrics

RpcMgtMBean

RunJar

RunningJob

RunOnce

S3Credentials

S3Exception

S3FileSystem

S3FileSystemException

ScriptBasedMapping

SecondarySort

SecondarySort.FirstGroupingComparator

SecondarySort.FirstPartitioner

SecondarySort.IntPair

SecondarySort.IntPair.Comparator

SecondarySort.MapClass

SecondarySort.Reduce

SecurityUtil

SecurityUtil.AccessControlList

Seekable

SensorsParser

SequenceFile

SequenceFile.CompressionType

SequenceFile.Metadata

SequenceFile.Reader

SequenceFile.Sorter

SequenceFile.Sorter.RawKeyValueIterator

SequenceFile.ValueBytes

SequenceFile.Writer

SequenceFileAsBinaryInputFormat

SequenceFileAsBinaryInputFormat.SequenceFileAsBinaryRecordReader

SequenceFileAsBinaryOutputFormat

SequenceFileAsBinaryOutputFormat.WritableValueBytes

SequenceFileAsTextInputFormat

SequenceFileAsTextRecordReader

SequenceFileInputFilter

SequenceFileInputFilter.Filter

SequenceFileInputFilter.FilterBase

SequenceFileInputFilter.MD5Filter

SequenceFileInputFilter.PercentFilter

SequenceFileInputFilter.RegexFilter

SequenceFileInputFormat

SequenceFileInputFormat

SequenceFileOutputFormat

SequenceFileOutputFormat

SequenceFileRecordReader

SequenceFileRecordReader

Serialization

SerializationFactory

SerializedRecord

Serializer

Server

Service

ServiceAuthorizationManager

ServletUtil

SetFile

SetFile.Reader

SetFile.Writer

Shard

ShardWriter

Shell

Shell.ExitCodeException

Shell.ShellCommandExecutor

ShellParser

SimpleCharStream

SkipBadRecords

SleepJob

SleepJob.EmptySplit

SleepJob.SleepInputFormat

SMARTParser

SocketInputStream

SocketOutputStream

SocksSocketFactory

Sort

SortedMapWritable

StandardSocketFactory

StatusReporter

StreamBackedIterator

StreamBaseRecordReader

StreamInputFormat

StreamJob

StreamKeyValUtil

StreamUtil

StreamXmlRecordReader

Stringifier

StringUtils

StringUtils.TraditionalBinaryPrefix

StringValueMax

StringValueMin

StructTypeID

Submitter

Sudoku

Sudoku.ColumnName

Syncable

SystemLogParser

TaggedMapOutput

TaskAttemptContext

TaskAttemptContext

TaskAttemptID

TaskAttemptID

TaskCompletionEvent

TaskCompletionEvent.Status

TaskGraphServlet

TaskID

TaskID

TaskInputOutputContext

TaskLog

TaskLog.LogName

TaskLogAppender

TaskLogServlet

TaskReport

TaskTracker

TaskTracker.MapOutputServlet

TeraGen

TeraGen.SortGenMapper

TeraInputFormat

TeraOutputFormat

TeraSort

TeraValidate

Text

Text.Comparator

TextInputFormat

TextInputFormat

TextOutputFormat

TextOutputFormat

TextOutputFormat.LineRecordWriter

TextOutputFormat.LineRecordWriter

TFile

TFile.Reader

TFile.Reader.Scanner

TFile.Writer

TIPStatus

Token

TokenCounterMapper

TokenCountMapper

TokenMgrError

Tool

ToolRunner

TotalOrderPartitioner

Trash

TupleWritable

TwoDArrayWritable

TypeID

TypeID.RIOType

UniqValueCount

UnixUserGroupInformation

UpdateIndex

Updater

User

UserDefinedValueAggregatorDescriptor

UserGroupInformation

UTF8

UTF8.Comparator

UTF8ByteArrayUtils

UTF8ByteArrayUtils

Util

Utils

Utils

Utils

Utils.Version

ValueAggregator

ValueAggregatorBaseDescriptor

ValueAggregatorCombiner

ValueAggregatorDescriptor

ValueAggregatorJob

ValueAggregatorJobBase

ValueAggregatorMapper

ValueAggregatorReducer

ValueHistogram

VectorTypeID

VersionedProtocol

VersionedWritable

VersionInfo

VersionMismatchException

VersionMismatchException

VIntWritable

VLongWritable

WordCount

WordCount.IntSumReducer

WordCount.TokenizerMapper

WrappedRecordReader

Writable

WritableComparable

WritableComparator

WritableFactories

WritableFactory

WritableName

WritableSerialization

WritableUtils

XmlRecordInput

XmlRecordOutput

XMLUtils

ZlibCompressor

ZlibCompressor.CompressionHeader

ZlibCompressor.CompressionLevel

ZlibCompressor.CompressionStrategy

ZlibDecompressor

ZlibDecompressor.CompressionHeader

ZlibFactory


text:
package org.dataalgorithms.chapB01.wordcount.mapreduce;

import org.apache.log4j.Logger;
//
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;
import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.mapreduce.lib.input.TextInputFormat;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;

/**
 * Description:
 *
 *    WordCountDriver: submits the job to Hadoop
 *    Counting the words if their size is greater
 *    than or equal N, where N > 1.
 *
 * @author Mahmoud Parsian
 *
 */
public class WordCountDriver  extends Configured implements Tool {

    private static Logger THE_LOGGER = Logger.getLogger(WordCountDriver.class);

    /**
     *      Arguments are:
     *        args[0] = N (as integer)
     *        args[1] = input path
     *        args[2] = output path
     */
    public int run(String[] args) throws Exception {

       Job job = new Job(getConf());
       job.setJarByClass(WordCountDriver.class);
       job.setJobName("WordCountDriver");

       // if a word length is leass than N,
       // then that word will be ignored.
       int N = Integer.parseInt(args[0]);
       // brodcast N, which may be used in map() and reduce()
       job.getConfiguration().setInt("word.count.ignored.length", N);

       job.setInputFormatClass(TextInputFormat.class);
       job.setOutputFormatClass(TextOutputFormat.class);

       job.setOutputKeyClass(Text.class);
       job.setOutputValueClass(IntWritable.class);

       job.setMapperClass(WordCountMapper.class);
       // since addition is amonoid, we can have a combiner function
       job.setCombinerClass(WordCountCombiner.class);
       job.setReducerClass(WordCountReducer.class);

       // args[1] = input directory
       // args[2] = output directory
       FileInputFormat.setInputPaths(job, new Path(args[1]));
       FileOutputFormat.setOutputPath(job, new Path(args[2]));

       boolean status = job.waitForCompletion(true);
       THE_LOGGER.info("run(): status="+status);
       return status ? 0 : 1;
    }

    /**
     * The main driver for word count map/reduce program.
     * Invoke this method to submit the map/reduce job.
     * @throws Exception When there is communication problems with the job tracker.
     */
    public static void main(String[] args) throws Exception {
       // Make sure there are exactly 3 parameters
       if (args.length != 3) {
          throw new IllegalArgumentException("usage: <N> <input> <output>");
       }

       //int N = args[0];
       THE_LOGGER.info("N="+args[0]);

       //String inputDir = args[1];
       THE_LOGGER.info("inputDir="+args[1]);

       //String outputDir = args[2];
       THE_LOGGER.info("outputDir="+args[2]);

       int returnStatus = submitJob(args);
       THE_LOGGER.info("returnStatus="+returnStatus);

       System.exit(returnStatus);
    }

    /**
     * The main driver for word count map/reduce program.
     * Invoke this method to submit the map/reduce job.
     * @throws Exception When there is communication problems with the job tracker.
     */
    public static int submitJob(String[] args) throws Exception {
       //     args[0] = N (as integer)
       //     args[1] = input path
       //     args[2] = output path
       int returnStatus = ToolRunner.run(new WordCountDriver(), args);
       return returnStatus;
    }
}


text:
<!DOCTYPE html>

    <meta http-equiv="refresh" content="0;URL=../../../libc/fn.WTERMSIG.html">

Redirecting to ../../../libc/fn.WTERMSIG.html...


text:
import Config from 'src/config'
import Axios from 'axios'

export default Axios.create({
  baseURL: Config.apiUrl,
})


text:
#include "pybind11/pybind11.h"
#include "tensorflow/python/util/kernel_registry.h"

namespace py = pybind11;

PYBIND11_MODULE(_pywrap_kernel_registry, m) {
  m.def("TryFindKernelClass", [](const std::string& serialized_node_def) {
    return py::bytes(tensorflow::swig::TryFindKernelClass(serialized_node_def));
  });
}


text:
layout: product.hbs

title: "LED Dancing Floor, JC330-3, force sensing, LED Stage Dance Floor Lighting, LED Dance Stage, LED Dance Light China Manufacturer & Supplier"

description: "LED Dancing Floor, JC330-3, force sensing, LED Stage Dance Floor Lighting, LED Dance Stage, LED Dance Light China Manufacturer Supplier"

keywords:
  - LED Dancing Floor
  - "JC330-3"
  - force sensing
  - LED Stage Dance Floor Lighting
  - LED Dance Stage
  - LED Dance Light China Manufacturer Supplier

---
{{{include_this_or_the_first_html_file "LED_DANCING_FLOOR-Slim.html"}}}


text:
#pragma once

#include <mrpt/core/safe_pointers.h>
#include <mrpt/gui/gui_frwds.h>
#include <mrpt/gui/keycodes.h>
#include <mrpt/img/TPixelCoord.h>
#include <mrpt/serialization/CSerializable.h>
#include <mrpt/system/CObservable.h>
#include <mrpt/system/mrptEvent.h>

#include <atomic>
#include <future>
#include <mutex>

namespace mrpt::gui
{
/** The base class for GUI window classes based on wxWidgets.
 *
 * This class can be observed (see mrpt::system::CObserver) for the following
 * events (see mrpt::system::mrptEvent):
 * - mrpt::gui::mrptEventWindowChar
 * - mrpt::gui::mrptEventWindowResize
 * - mrpt::gui::mrptEventMouseDown
 * - mrpt::gui::mrptEventWindowClosed
 *
 * See derived classes to check if they emit other additional events.
 *
 * IMPORTANTE NOTICE: Event handlers in your observer class will be invoked
 * from the wxWidgets internal MRPT thread, so all your code in the handler
 * must be thread safe.
 * \ingroup mrpt_gui_grp
 */
class CBaseGUIWindow : public mrpt::system::CObservable
{
	friend class CWindowDialog;
	friend class C3DWindowDialog;
	friend class CWindowDialogPlots;

   private:
	/** can be 200,300,400... See WxSubsystem */
	const int m_CMD_CREATE_WIN;
	/** can be 299,399,499... See WxSubsystem */
	const int m_CMD_DESTROY_WIN;
	void* m_winobj_voidptr;

   protected:
	/** This semaphore will be signaled when the wx window is built and ready.
	 */
	mutable std::promise<void> m_threadReady;
	/** This semaphore will be signaled when the wx window is destroyed. */
	mutable std::promise<void> m_windowDestroyed;
	/** The caption of the window */
	std::string m_caption;
	/** The window handle */
	mrpt::void_ptr_noncopy m_hwnd;

	/* Auxiliary */
	std::atomic_bool m_keyPushed = false;
	std::atomic_int m_keyPushedCode = 0;
	std::atomic<mrptKeyModifier> m_keyPushedModifier;

	/** Must be called by child classes just within the constructor. */
	void createWxWindow(unsigned int initialWidth, unsigned int initialHeight);
	/** Must be called by child classes in their destructors. The code cannot be
	 * put into this class' destructor. */
	void destroyWxWindow();

   public:
	/** Read-only access to the wxDialog object. */
	void* getWxObject() { return m_hwnd.get(); }
	/** Called by wx main thread to set m_hwnd to NULL. */
	void notifyChildWindowDestruction();
	/** Called by wx main thread to signal the semaphore that the wx window is
	 * built and ready. */
	void notifySemThreadReady();

   public:
	/** CMD_DESTROY_WIN can be 299,399,499... See WxSubsystem */

	CBaseGUIWindow(
		void* winobj_voidptr, int CMD_CREATE_WIN, int CMD_DESTROY_WIN,
		const std::string& initial_caption = std::string());
	~CBaseGUIWindow() override;

	/** Returns false if the user has already closed the window.
	 */
	bool isOpen();

	/** Resizes the window, stretching the image to fit into the display area.
	 */
	virtual void resize(unsigned int width, unsigned int height) = 0;

	/** Changes the position of the window on the screen.
	 */
	virtual void setPos(int x, int y) = 0;

	/** Changes the window title text.
	 */
	virtual void setWindowTitle(const std::string& str) = 0;

	/** Gets the last x,y pixel coordinates of the mouse. \return False if the
	 * window is closed. */
	virtual bool getLastMousePosition(int& x, int& y) const = 0;

	/** Set cursor style to default (cursorIsCross=false) or to a cross
	 * (cursorIsCross=true) */
	virtual void setCursorCross(bool cursorIsCross) = 0;

	/** Waits for any key to be pushed on the image or the console, and returns
	 * the key code.
	 *  This method remove key strokes previous to its call, so it will always
	 * wait. To get
	 *   the latest pushed key, see
	 *
	 * \param ignoreControlKeys If set to false, any push of shift, cmd,
	 * control, etc... will make this method to return.
	 * \param out_pushModifier If set to !=nullptr, the modifiers of the key
	 * stroke will be saved here.
	 * \return The virtual key code, as defined in mrptKeyCode (a replication
	 * of wxWidgets key codes).
	 *
	 * \sa getPushedKey, Key codes in the enum mrptKeyCode
	 */
	int waitForKey(
		bool ignoreControlKeys = true,
		mrptKeyModifier* out_pushModifier = nullptr);

	/** Returns true if a key has been pushed, without blocking waiting for a
	 * new key being pushed.
	 * \sa waitForKey, clearKeyHitFlag
	 */
	bool keyHit() const { return m_keyPushed; }
	/** Assure that "keyHit" will return false until the next pushed key.
	 * \sa keyHit, waitForKey
	 */
	void clearKeyHitFlag() { m_keyPushed = false; }
	/** Returns the latest pushed key, or 0 if there is no new key stroke.
	 * \param out_pushModifier If set to !=nullptr, the modifiers of the key
	 * stroke will be saved here.
	 * \return The virtual key code, as defined in <mrpt/gui/keycodes.h> (a
	 * replication of wxWidgets key codes).
	 *
	 * \sa keyHit, waitForKey
	 */
	int getPushedKey(mrptKeyModifier* out_pushModifier = nullptr);

};	// End of class def.

/** @name Events common to all GUI windows:
	@{  */

/**  An event sent by a window upon a char pressed by the user.
 *
 *  IMPORTANTE NOTICE: Event handlers in your observer class will be invoked
 * from the wxWidgets internal MRPT thread,
 *    so all your code in the handler must be thread safe.
 */
class mrptEventWindowChar : public mrpt::system::mrptEvent
{
   protected:
	/** Just to allow this class to be polymorphic */
	void do_nothing() override {}

   public:
	inline mrptEventWindowChar(
		CBaseGUIWindow* obj, int _char_code, mrptKeyModifier _key_mod)
		: source_object(obj), char_code(_char_code), key_modifiers(_key_mod)
	{
	}

	CBaseGUIWindow* source_object;
	/** The virtual key code, as defined in <mrpt/gui/keycodes.h> (a replication
	 * of wxWidgets key codes). */
	int char_code;
	/** Modifiers (Shift, Control, etc...) */
	mrptKeyModifier key_modifiers;
};	// End of class def.

/**  An event sent by a window upon resize.
 *
 *  IMPORTANTE NOTICE: Event handlers in your observer class will be invoked
 * from the wxWidgets internal MRPT thread,
 *    so all your code in the handler must be thread safe.
 */
class mrptEventWindowResize : public mrpt::system::mrptEvent
{
   protected:
	/** Just to allow this class to be polymorphic */
	void do_nothing() override {}

   public:
	inline mrptEventWindowResize(
		CBaseGUIWindow* obj, size_t _new_width, size_t _new_height)
		: source_object(obj), new_width(_new_width), new_height(_new_height)
	{
	}

	CBaseGUIWindow* source_object;
	size_t new_width, new_height;
};	// End of class def.

/**  An event sent by a window upon a mouse click, giving the (x,y) pixel
 * coordinates.
 *
 *  IMPORTANTE NOTICE: Event handlers in your observer class will be invoked
 * from the wxWidgets internal MRPT thread,
 *    so all your code in the handler must be thread safe.
 *
 * \sa mrptEventMouseMove
 */
class mrptEventMouseDown : public mrpt::system::mrptEvent
{
   protected:
	/** Just to allow this class to be polymorphic */
	void do_nothing() override {}

   public:
	inline mrptEventMouseDown(
		CBaseGUIWindow* obj, mrpt::img::TPixelCoord _coords, bool _leftButton,
		bool _rightButton)
		: source_object(obj),
		  coords(_coords),
		  leftButton(_leftButton),
		  rightButton(_rightButton)
	{
	}

	CBaseGUIWindow* source_object;
	mrpt::img::TPixelCoord coords;
	bool leftButton;
	bool rightButton;
};	// End of class def.

/**  An event sent by a window when the mouse is moved over it.
 *  IMPORTANTE NOTICE: Event handlers in your observer class will be invoked
 * from the wxWidgets internal MRPT thread,
 *    so all your code in the handler must be thread safe.
 * \sa mrptEventMouseDown
 */
class mrptEventMouseMove : public mrpt::system::mrptEvent
{
   protected:
	/** Just to allow this class to be polymorphic */
	void do_nothing() override {}

   public:
	inline mrptEventMouseMove(
		CBaseGUIWindow* obj, mrpt::img::TPixelCoord _coords, bool _leftButton,
		bool _rightButton)
		: source_object(obj),
		  coords(_coords),
		  leftButton(_leftButton),
		  rightButton(_rightButton)
	{
	}

	CBaseGUIWindow* source_object;
	mrpt::img::TPixelCoord coords;
	bool leftButton;
	bool rightButton;
};	// End of class def.

/**  An event sent by a window upon when it's about to be closed, either
 * manually by the user or programmatically.
 *   The event field member \a allow_close is default by default, but can be
 * set to false in the event callback
 *   to forbid the window to be closed by the user. If the event corresponds to
 * a programatic close, this field is ignored.
 *
 *  IMPORTANTE NOTICE: Event handlers in your observer class will be invoked
 * from the wxWidgets internal MRPT thread,
 *    so all your code in the handler must be thread safe.
 *
 * \sa CBaseGUIWindow
 */
class mrptEventWindowClosed : public mrpt::system::mrptEvent
{
   protected:
	/** Just to allow this class to be polymorphic */
	void do_nothing() override {}

   public:
	inline mrptEventWindowClosed(CBaseGUIWindow* obj, bool _allow_close = true)
		: source_object(obj), allow_close(_allow_close)
	{
	}
	CBaseGUIWindow* source_object;
	bool allow_close;
};	// End of class def.

/**  @} */

}  // namespace mrpt::gui


text:
const path = require('path');
const gulp = require('gulp');
const $ = require('gulp-load-plugins')();
const webpack = require('webpack-stream');
const runSequence = require('run-sequence');
const stylelint = require('gulp-stylelint').default;
const consoleReporter = require('gulp-stylelint-console-reporter').default;
const del = require('del');
const pngquant = require('imagemin-pngquant');
const packager = require('electron-packager');

const RELEASE_DIR = path.join(__dirname, '/release/');
const DIST_DIR = path.join(__dirname, '/dist/');
const BUILD_DIR = path.join(__dirname, '/dist/assets/');
const BUILD_IMG_DIR = path.join(__dirname, '/dist/assets/images');

gulp.task('check-transformed-code', () => {
  return gulp.src('src/**/*.{js,jsx}')
    .pipe($.babel())
    .pipe(gulp.dest('build'));
});

gulp.task('release-clean', () => {
  return del([RELEASE_DIR]);
});

gulp.task('build-clean', () => {
  return del([DIST_DIR]);
});

// electron-packger read package.json
// https://github.com/electron-userland/electron-packager/issues/264
gulp.task('copy-package', () => {
  return gulp.src('./package.json')
    .pipe(gulp.dest(DIST_DIR));
});

gulp.task('copy-index', () => {
  return gulp.src('./index.html')
    .pipe(gulp.dest(DIST_DIR));
});

gulp.task('copy-mainjs', () => {
  return gulp.src('./main.js')
    .pipe(gulp.dest(DIST_DIR));
});

gulp.task('webpack', () => {
  return gulp.src('src/**/*.{js, jsx, css}')
    .pipe($.env.set({
      NODE_ENV: 'dev',
    }))
    .pipe(webpack(require('./webpack.config')))
    .pipe(gulp.dest(BUILD_DIR));
});

gulp.task('webpack-prod', () => {
  return gulp.src('src/**/*.{js, jsx, css}')
    .pipe($.env.set({
      NODE_ENV: 'production',
    }))
    .pipe(webpack(require('./webpack.config')))
    .pipe(gulp.dest(BUILD_DIR));
});

gulp.task('eslint', () => {
  return gulp.src(['src/**/*.js'])
    .pipe($.eslint())
    .pipe($.eslint.format())
    .pipe($.eslint.failAfterError());
});

gulp.task('stylelint', () => {
  return gulp.src(['src/**/*.css'])
    .pipe(stylelint({
      reporters: [
        consoleReporter(),
      ],
    }));
});

gulp.task('lint', ['eslint', 'stylelint']);

gulp.task('imgmin', () => {
  return gulp.src(['src/images/*'])
    .pipe($.imagemin({
      progressive: true,
      svgoPlugins: [
        { removeViewBox: false },
        { cleanupIDs: false },
      ],
      use: [pngquant()],
    }))
    .pipe(gulp.dest(BUILD_IMG_DIR));
});

gulp.task('package-win', (done) => {
  packager({
    dir: 'dist',
    out: 'release/win',
    name: 'ElectronApp',
    arch: 'x64',
    platform: 'win32',
    version: '0.37.2',
  }, (err, pt) => {
    done();
  });
});

gulp.task('release', () => {
  runSequence(
    'release-clean',
    'build-prod',
    'package-win'
  );
});

gulp.task('build', () => {
  runSequence(
    'build-clean',
    ['lint', 'copy-package', 'copy-index', 'copy-mainjs',
     'imgmin', 'webpack']
  );
});

gulp.task('build-prod', () => {
  runSequence(
    'build-clean',
    ['lint', 'copy-package', 'copy-index', 'copy-mainjs',
     'imgmin', 'webpack-prod']
  );
});

gulp.task('default', ['build']);


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#2196F3</color>
    <color name="colorPrimaryDark">#1976D2</color>
    <color name="colorAccent">#03A9F4</color>
    <color name="textColor">#000000</color>
    <color name="whiteText">#FFFFFF</color>
    <color name="background">#ECEDF0</color>
    <color name="cardViewbg">#FFFFFF</color>
    <color name="denied">#F44336</color>
    <color name="granted">#4CAF50</color>
</resources>


text:
Bosh has the capability to deploy trusted SSL/TLS certs to all bosh deployed VMs.  Furthermore, Cloud Foundry will then take the bosh deployed trusted certs and import them into application containers.  Often this works just fine, but in some cases there are problems.

For example:
 - maybe certs don't get deployed to the VM
 - maybe certs don't get deployed to the app container
 - maybe the certs are invalid for some reason
 - maybe there's user error and an expected cert was not included in the list

This folder contains an application that can be deployed to CF that returns information about the Bosh deployed certs.  It can also be used to test connectivity to endpoints that should be trusted by sending HTTPS or TCP/TLS requests.  These requests will indicate if the remote endpoint is trusted based on the trusted certs in the container.

## Usage

To use:

```
$ git clone https://github.com/dmikusa-pivotal/cf-debug-tools
$ cd bosh-cert-tester/
```

Edit the `https-endpoints.json` and `tcp-endpoints.json` files to include a list of HTTPS and TCP endpoints that the app should connect to.  These would be the resources to which your applications will connect and that depend on the Bosh deployed trusted certs.

For example, if you have a web service at `https://my-service.com/` and it presents a TLS cert that is signed by your internal CA then you could include that URL to confirm that the internal CA has been bosh deployed to the VM and included in the app container.  You'll know the trusted cert is included if the connection is successful.  If it fails with a cert error, then it's not include or there is some other problem with the certs.

Once you've edited these lists run `cf push` to deploy the application.

To retrieve the output from the script you can either run `cf logs bosh-cert-tester` in a separate terminal or you can run `scp -P 2222 -oUser=cf:$(cf app bosh-cert-tester --guid)/0 "$(cf curl /v2/info | jq -r .app_ssh_endpoint | cut -d ':' -f 1)":./app/output.txt ./` to download the text file from the app container (run `cf ssh-code` and enter the token when prompted by `scp` for a password).

## Output

Included in the output are the following items:

 - a list of the bosh deployed certs and a detailed print out of each cert
 - a list of all the certs in the CA cert bundle
 - output from `curl` for each service listed in `https-endpoints.json`
 - output from `openssl s_client` for each service listed in `tcp-endpoints.json`


text:
- directory test should return success in `update_ruby_build`
  task (@maxstepanov)

### v1.2.0, 2014-11-19
- update ruby-build before every ruby installation (@jimmynguyc)

### v1.1.0, 2014-11-17
- extract paths and urls to a separate module
- update gem homepage
- fix a bug where bundler gem installation fails because `bundler:map_bins` task
  is executed earlier.

### v1.0.0, 2014-03-29
- @bruno- all the v1.0.0 features


text:
import { Injectable, Inject, PLATFORM_ID } from '@angular/core';
import { isPlatformBrowser } from '@angular/common';

import { CoolStorageBase } from './cool-storage-base';
import { CoolServerStorage } from './cool-server-storage';

@Injectable()
export class CoolSessionStorage extends CoolStorageBase {
  constructor(@Inject(PLATFORM_ID) platformId: Object) {
    if (isPlatformBrowser(platformId)) {
      super(window.sessionStorage, 'SessionStorage');
    } else {
      super(new CoolServerStorage(), 'SessionStorage');
    }
  }
}


text:
<?php include 'main-template.php'; ?>

<?php template("Marine Cadastre - Vessel Route Page", content(), -1); ?>

<?php function content() { ob_start(); ?>

 &nbsp&nbsp-&nbsp&nbsp Vessel Routes

<?php return ob_get_clean(); }?>


text:
'''
Created on October 27, 2020

This file is subject to the terms and conditions defined in the
file 'LICENSE.txt', which is part of this source code package.

@author: David Moss
'''

from devices.vibration.vibration import VibrationDevice

class LinkHighVibrationDevice(VibrationDevice):
    """
    LinkHigh Touch Sensor
    """

    # List of Device Types this class is compatible with
    DEVICE_TYPES = [10019]

    # Low battery tag
    LOW_BATTERY_TAG = "lowbattery_cr2032"

    # Type of battery
    BATTERY_TYPE = "CR2032"

    # ===========================================================================
    # Sensor-specific Methods
    # ===========================================================================
    def set_sensitivity_percent(self, botengine, percent):
        """
        Set the sensitivity based on percentage
        :param percent: 0-100%
        """
        return None

    def get_sensitivity_percent(self, botengine):
        """
        Retrieve the current sensitivity percentage
        :param botengine:
        :return: Sensitivity percent
        """
        return None

    def set_sensitivity_value(self, botengine, value):
        """
        Set the sensitivity value directly.
        Use the VibrationSensor.SENSITIVITY_MINIMUM and VibrationSensor.SENSITIVITY_MAXIMUM for reference
        :param value: Value to set for sensitivity
        """
        return None

    def get_sensitivity_value(self, botengine):
        """
        Retrieve the current sensitivity value
        :param botengine:
        :return: Sensitivity value
        """
        return None

    def did_get_touched(self, botengine):
        """
        Is the sensor touched, even momentarily?
        :param botengine:
        :return: True if the sensor is touched
        """
        return self.did_start_moving(botengine)

    def is_moving(self, botengine):
        """
        Is the sensor currently moving
        :param botengine: BotEngine
        :return: True if the sensor is currently moving
        """
        if self.MEASUREMENT_NAME_VIBRATION_STATUS in self.measurements:
            return self.measurements[self.MEASUREMENT_NAME_VIBRATION_STATUS][0][0]

        return False

    def did_start_moving(self, botengine):
        """
        Did the sensor start continually moving, based on the current sensitivity value?
        :param botengine:
        :return: True if the sensor started moving
        """
        if self.MEASUREMENT_NAME_VIBRATION_STATUS in self.measurements:
            if self.MEASUREMENT_NAME_VIBRATION_STATUS in self.last_updated_params:
                return self.measurements[self.MEASUREMENT_NAME_VIBRATION_STATUS][0][0]

        return False

    def did_stop_moving(self, botengine):
        """
        Did the sensor stop continually moving?
        :param botengine:
        :return: True if the sensor stopped moving
        """
        if self.MEASUREMENT_NAME_VIBRATION_STATUS in self.measurements:
            if self.MEASUREMENT_NAME_VIBRATION_STATUS in self.last_updated_params:
                return self.measurements[self.MEASUREMENT_NAME_VIBRATION_STATUS][0][0] == False

        return False


text:
package de.tu_berlin.dima.oligos.stat.distribution.histogram;

import java.sql.SQLException;
import java.util.Map;
import java.util.Map.Entry;
import java.util.SortedSet;

import com.google.common.collect.Maps;
import com.google.common.collect.Sets;

import de.tu_berlin.dima.oligos.type.util.operator.Operator;

public abstract class Histograms {

  public static <T> Histogram<T> combineHistograms(Histogram<T> hist, Map<T, Long> mostFrequent, Operator<T> operator) throws SQLException {
    Histogram<T> histogram = new CustomHistogram<T>(operator);
    // Make a deep copy to keep function side effect free
    mostFrequent = Maps.newHashMap(mostFrequent);
    // generate histogram with one sized buckets
    if (hist.isEmpty()) {
      for (Entry<T, Long> e : mostFrequent.entrySet()) {
        T value = e.getKey();
        long count = e.getValue();
        histogram.add(value, value, count);
      }
    }
    for (Bucket<T> bucket : hist) {
      SortedSet<T> elemsInRange = collectElementsInRange(bucket, mostFrequent, operator);
      // sum the most frequent elements in range
      long sumInRange = 0l;
      for (T e : elemsInRange) {
        sumInRange += mostFrequent.get(e);
      }
      // adapt the frequency count of the current bucket
      // i.e. subtract the number of most frequent elements
      bucket = new Bucket<T>(bucket.getLowerBound(), bucket.getUpperBound(), bucket.getFrequency() - sumInRange);

      // adapt the bucket
      // i.e. change the boundaries, introduce new buckets, ...
      for (T elem : elemsInRange) {
        T lBound = bucket.getLowerBound();
        T uBound = bucket.getUpperBound();
        long elemCnt = mostFrequent.get(elem);
        // bucket has exact one element and this is the most frequent
        if (lBound.equals(uBound) && lBound.equals(elem)) {
          histogram.add(lBound, uBound, elemCnt);
          mostFrequent.remove(elem);
        }
        // the most frequent element is the lower bound of the current bucket
        else if (lBound.equals(elem)) {
          histogram.add(lBound, elem, elemCnt);
          bucket = new Bucket<T>(operator.increment(lBound), uBound, bucket.getFrequency());
          mostFrequent.remove(elem);
        }
        // the most frequent element is the upper bound of the current bucket
        else if (uBound.equals(elem)) {
          histogram.add(lBound, operator.decrement(uBound), bucket.getFrequency());
          histogram.add(elem, elem, elemCnt);
          mostFrequent.remove(elem);
        }
        // common case, that the most frequent value is within the current bucket
        else {
          // shrink the current bucket and add shrunk bucket and most frequent element to histogram
          long range = operator.range(lBound, uBound);
          long lowerSize = operator.range(lBound, elem);
          long lowerFreq = lowerSize * bucket.getFrequency() / range;
          histogram.add(lBound, operator.decrement(elem), lowerFreq);
          histogram.add(elem, elem, elemCnt);
          long upperSize = operator.range(operator.increment(elem), uBound);
          long upperFreq = upperSize * bucket.getFrequency() / range;
          bucket = new Bucket<T>(operator.increment(elem), uBound, upperFreq);
          mostFrequent.remove(elem);
        }
      }
      histogram.add(bucket.getLowerBound(), bucket.getUpperBound(), bucket.getFrequency());
    }
    return histogram;
  }

  public static <T> SortedSet<T> collectElementsInRange(Bucket<T> bucket, Map<T, Long> mostFrequent, Operator<T> operator) {
    SortedSet<T> elemsInRange = Sets.newTreeSet(operator);
    for (T elem : mostFrequent.keySet()) {
      if (isInBucket(bucket, elem, operator)) {
        elemsInRange.add(elem);
      }
    }
    return elemsInRange;
  }

  public static <T> boolean isInBucket(Bucket<T> bucket, T value, Operator<T> operator) {
    return isInBucket(bucket.getLowerBound(), bucket.getUpperBound(), value, operator);
  }

  public static <T> boolean isInBucket(T lowerBound, T upperBound, T value,
      Operator<T> operator) {
    return operator.compare(lowerBound, value) <= 0
        && operator.compare(value, upperBound) <= 0;
  }

  public static <T> Map<T, Long> getMostFrequent(Histogram<T> histogram) {
    Map<T, Long> mostFrequent = Maps.newLinkedHashMap();
    for (Bucket<T> buck : histogram) {
      if (buck.getLowerBound().equals(buck.getUpperBound())) {
        mostFrequent.put(buck.getLowerBound(), buck.getFrequency());
      }
    }
    return mostFrequent;
  }

}


text:
<?php

namespace Doctrine\DBAL\Types;

use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Platforms\AbstractPlatform;

/**
 * Type that maps an SQL INT to a PHP integer.
 *
 * @author Roman Borschel <roman@code-factory.org>
 * @since 2.0
 */
class IntegerType extends Type implements PhpIntegerMappingType
{
    /**
     * {@inheritdoc}
     */
    public function getName()
    {
        return Type::INTEGER;
    }

    /**
     * {@inheritdoc}
     */
    public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
    {
        return $platform->getIntegerTypeDeclarationSQL($fieldDeclaration);
    }

    /**
     * {@inheritdoc}
     */
    public function convertToPHPValue($value, AbstractPlatform $platform)
    {
        return (null === $value) ? null : (int) $value;
    }

    /**
     * {@inheritdoc}
     */
    public function getBindingType()
    {
        return ParameterType::INTEGER;
    }
}


text:
<?php

namespace XysterTest\Container\Provider;
use Xyster\Container\Provider\Delegate;
use Xyster\Container\Container;
/**
 * Test class for Xyster_Container_Provider_Delegate.
 * Generated by PHPUnit on 2009-06-14 at 19:17:26.
 */
class DelegateTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var    Delegate
     */
    protected $object;

    /**
     * Sets up the fixture
     */
    protected function setUp()
    {
        $this->object = new DelegateTest_Impl(
            new \Xyster\Container\Injector\Standard(
                Container::definition('\Xyster\Collection\Collection', 'colly')));
    }

    public function testGetName()
    {
        self::assertEquals('colly', $this->object->getName());
    }

    public function testGetType()
    {
        self::assertEquals(new \Xyster\Type\Type('\Xyster\Collection\Collection'), $this->object->getType());
    }

    public function testValidate()
    {
        $this->object->validate(new Container);
    }

    public function test__toString()
    {
        self::assertEquals('Impl:Injector:colly', $this->object->__toString());
    }
}

class DelegateTest_Impl extends Delegate
{
    public function get(\Xyster\Container\IContainer $container, \Xyster\Type\Type $into = null)
    {
        return null;
    }

    public function getLabel()
    {
        return 'Impl';
    }
}