text:
 html, body, .container, .content { height: 100%; }

.container, .content { position: relative; }

.proper-content { padding-top: 60px; /* >= navbar height */ }

.wrapper {
  height: 100%;
  height: auto !important;
  margin: 0 auto -40px; /* same as the footer */
  min-height: 100%; }

.push { height: 40px; /* same as the footer */ }

.footer-wrapper {
  background-color: #222222;
  border-color: #080808;
  color: #FFFFFF;
  height: 40px;
  position: relative; }

.matrix-header {
  *background-color: #222222;
  background-color: #363636;
  background-image: -moz-linear-gradient(top, #444444, #222222);
  background-image: -o-linear-gradient(top, #444444, #222222);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222));
  background-image: -webkit-linear-gradient(top, #444444, #222222);
  background-image: linear-gradient(to bottom, #444444, #222222);
  background-repeat: repeat-x;
  border-color: #222222 #222222 #000000;
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  color: #ffffff;
  display: block;
  filter: progid: DXImageTransform.Microsoft.gradient(enabled=false);
  filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0);
  height: 40px;
  text-align: center;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  width: 100%; }

.title-intersection {
  height: 20px;
  width: 20px; }

.column-title,
.column-title-2,
.row-title,
.title-intersection {
  background: white;
  border: solid 1px black;
  display: block;
  float: left;
  font-size: 11px;
  overflow: hidden;
  text-align: center; }

.column-title {
  height: 20px;
  width: 40px; }

.column-title-2 {
  height: 20px;
  width: 70px; }

.column-title-4 {
  height: 20px;
  width: 258px; }

.column-title h6,
.row-title h6 {
  font-family: inherit;
  font-weight: bold;
  margin: 10px 0;
  text-rendering: optimizelegibility; }

.column-title h6 { line-height: 4px; }

.row-title h6 { line-height: 15px; }

.row-title {
  height: 40px;
  width: 20px; }

.square,
.square-2 {
  background: white;
  border: solid 1px black;
  display: block;
  float: left;
  font-size: 11px;
  height: 40px;
  overflow: hidden;
  text-align: center; }

.square { width: 40px; }

.square-2 { width: 70px; }

.square-4 { width: 260px; }

.line-break { clear: both; }

.square-space,
.square-space-2,
.square-space-title,
.square-space-2-title {
  background: white;
  border: none;
  border: solid 1px transparent;
  display: block;
  float: left;
  font-size: 28px;
  font-weight: bold;
  line-height: 40px;
  overflow: hidden;
  text-align: center; }

.square-space-title,
.square-space-2-title { height: 70px; }

.square-space,
.square-space-2 { height: 40px; }

.square-space-title,
.square-space { width: 60px; }

.square-space-2-title,
.square-space-2 { width: 120px; }

.square-space h2,
.square-space-2 h2 { line-height: 20px; }

.glc-table-wrap {
  max-height: 180px;
  overflow-x: hidden;
  overflow-y: auto; }

.glc-delete-row,
.glc-edit-row { margin: 0px 0px 0px 10px; }

.glc-delete-row { margin-right: -20px; }

.glc-cardinals {  }

#gridImage { margin: 20px 20px 20px 0px; }

#robotImage {
  margin: 25px;
  z-index: 1; }

.minimum {
  *background-color: #222222;
  background-color: #363636;
  background-image: -moz-linear-gradient(top, #444444, #222222);
  background-image: -o-linear-gradient(top, #444444, #222222);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222));
  background-image: -webkit-linear-gradient(top, #444444, #222222);
  background-image: linear-gradient(to bottom, #444444, #222222);
  background-repeat: repeat-x;
  border-color: #222222 #222222 #000000;
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  color: #ffffff;
  filter: progid: DXImageTransform.Microsoft.gradient(enabled=false);
  filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0);
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); }

.maximum {
  *background-color: #0044cc;
  background-color: #006dcc;
  background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
  background-image: -o-linear-gradient(top, #0088cc, #0044cc);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
  background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
  background-image: linear-gradient(to bottom, #0088cc, #0044cc);
  background-repeat: repeat-x;
  border-color: #0044cc #0044cc #002a80;
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  color: #ffffff;
  filter: progid: DXImageTransform.Microsoft.gradient(enabled=false);
  filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); }

.glp-highlight {
  margin-right: 10px;
  position: relative;
  z-index: 1; }

.hidden { visibility: hidden; }

 Styleneat - CSS Organizer.
Return
Download style.css | Copy style.css

html, body, .container, .content { height: 100%; }

.container, .content { position: relative; }

.proper-content { padding-top: 60px; /* >= navbar height */ }

.wrapper {
  height: 100%;
  height: auto !important;
  margin: 0 auto -40px; /* same as the footer */
  min-height: 100%; }

.push { height: 40px; /* same as the footer */ }

.footer-wrapper {
  background-color: #222222;
  border-color: #080808;
  color: #FFFFFF;
  height: 40px;
  position: relative; }

.matrix-header {
  *background-color: #222222;
  background-color: #363636;
  background-image: -moz-linear-gradient(top, #444444, #222222);
  background-image: -o-linear-gradient(top, #444444, #222222);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222));
  background-image: -webkit-linear-gradient(top, #444444, #222222);
  background-image: linear-gradient(to bottom, #444444, #222222);
  background-repeat: repeat-x;
  border-color: #222222 #222222 #000000;
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  color: #ffffff;
  display: block;
  filter: progid: DXImageTransform.Microsoft.gradient(enabled=false);
  filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0);
  height: 40px;
  text-align: center;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  width: 100%; }

.title-intersection {
  height: 20px;
  width: 20px; }

.column-title,
.column-title-2,
.row-title,
.title-intersection {
  background: white;
  border: solid 1px black;
  display: block;
  float: left;
  font-size: 11px;
  overflow: hidden;
  text-align: center; }

.column-title {
  height: 20px;
  width: 40px; }

.column-title-2 {
  height: 20px;
  width: 70px; }

.column-title-4 {
  height: 20px;
  width: 258px; }

.column-title h6,
.row-title h6 {
  font-family: inherit;
  font-weight: bold;
  margin: 10px 0;
  text-rendering: optimizelegibility; }

.column-title h6 { line-height: 4px; }

.row-title h6 { line-height: 15px; }

.row-title {
  height: 40px;
  width: 20px; }

.square,
.square-2 {
  background: white;
  border: solid 1px black;
  display: block;
  float: left;
  font-size: 11px;
  height: 40px;
  overflow: hidden;
  text-align: center; }

.square { width: 40px; }

.square-2 { width: 70px; }

.square-4 { width: 260px; }

.line-break { clear: both; }

.square-space,
.square-space-2,
.square-space-title,
.square-space-2-title {
  background: white;
  border: none;
  border: solid 1px transparent;
  display: block;
  float: left;
  font-size: 28px;
  font-weight: bold;
  line-height: 40px;
  overflow: hidden;
  text-align: center; }

.square-space-title,
.square-space-2-title { height: 70px; }

.square-space,
.square-space-2 { height: 40px; }

.square-space-title,
.square-space { width: 60px; }

.square-space-2-title,
.square-space-2 { width: 120px; }

.square-space h2,
.square-space-2 h2 { line-height: 20px; }

.glc-table-wrap {
  max-height: 180px;
  overflow-x: hidden;
  overflow-y: auto; }

.glc-delete-row,
.glc-edit-row { margin: 0px 0px 0px 10px; }

.glc-delete-row { margin-right: -20px; }

.glc-cardinals {  }

#gridImage { margin: 20px 20px 20px 0px; }

#robotImage {
  margin: 25px;
  z-index: 1; }

.minimum {
  *background-color: #222222;
  background-color: #363636;
  background-image: -moz-linear-gradient(top, #444444, #222222);
  background-image: -o-linear-gradient(top, #444444, #222222);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222));
  background-image: -webkit-linear-gradient(top, #444444, #222222);
  background-image: linear-gradient(to bottom, #444444, #222222);
  background-repeat: repeat-x;
  border-color: #222222 #222222 #000000;
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  color: #ffffff;
  filter: progid: DXImageTransform.Microsoft.gradient(enabled=false);
  filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0);
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); }

.maximum {
  *background-color: #0044cc;
  background-color: #006dcc;
  background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
  background-image: -o-linear-gradient(top, #0088cc, #0044cc);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
  background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
  background-image: linear-gradient(to bottom, #0088cc, #0044cc);
  background-repeat: repeat-x;
  border-color: #0044cc #0044cc #002a80;
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  color: #ffffff;
  filter: progid: DXImageTransform.Microsoft.gradient(enabled=false);
  filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); }

.glp-highlight {
  margin-right: 10px;
  position: relative;
  z-index: 1; }

.hidden { visibility: hidden; }


text:
package com.soomla.store.events;

import com.soomla.events.SoomlaEvent;

/**
 * This event is fired when SOOMLA knows that billing IS supported on the device.
 */
public class BillingSupportedEvent extends SoomlaEvent {
    public BillingSupportedEvent() {
        super(null);
    }

    public BillingSupportedEvent(Object sender) {
        super(sender);
    }
}

redpajama_set_name: RedPajamaGithub


text:
CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
BEGIN
    DECLARE M INT;
    SET M = N - 1;
    RETURN (
        SELECT DISTINCT Salary
          FROM Employee
      ORDER BY Salary DESC
         LIMIT M, 1
    );
END


text:
module DORB
  class SSHKey

    include Resource

    self.collection_resource_name = 'ssh_keys'
    self.singular_resource_name = 'ssh_key'

    define_attribute :ssh_key_pub

  end
end


text:
This repo contains multiple projects using Angular 5 framework.

## Useful CLI commands

Install npm
- `sudo apt-get install npm`

Install Angular CLI:
- `npm install -g @angular/cli`

Create new project:
- `ng new project-name`

Run project:
- `ng serve`

Create new Component:
- `ng generate component component-name`
- `ng g c component-name`

Create new Directive:
- `ng generate directive directive-name`
- `ng g d directive-name`

Install bootstrap
- `npm install --save bootstrap`

## List of Projects

1. [First App](https://github.com/davidokun/Angular/tree/develop/first-app)

First project with basic usage of Angular 5

2. [NG4-Complete-App](https://github.com/davidokun/Angular/tree/develop/ng4-complete-app)

Full app project using all features of Angular.

3. [CMP-Databinding](https://github.com/davidokun/Angular/tree/develop/cmp-databinding)

Examples of Databinding types in Angular


text:
package olm

import (
	"testing"

	opregistry "github.com/operator-framework/operator-registry/pkg/registry"
	"github.com/stretchr/testify/require"
	"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/labels"
)

func TestLabelSetsFor(t *testing.T) {
	tests := []struct {
		name     string
		obj      interface{}
		expected []labels.Set
	}{
		{
			name:     "Nil/Nil",
			obj:      nil,
			expected: nil,
		},
		{
			name:     "NotOperatorSurfaceOrCRD/Nil",
			obj:      struct{ data string }{"some-data"},
			expected: nil,
		},
		{
			name: "CRD/ProvidedAndRequired",
			obj: &v1beta1.CustomResourceDefinition{
				TypeMeta: metav1.TypeMeta{
					Kind:       "CustomResourceDefinition",
					APIVersion: v1beta1.SchemeGroupVersion.String(),
				},
				ObjectMeta: metav1.ObjectMeta{
					Name: "Ghosts.ghouls",
				},
				Spec: v1beta1.CustomResourceDefinitionSpec{
					Group: "ghouls",
					Versions: []v1beta1.CustomResourceDefinitionVersion{
						{
							Name:    "v1alpha1",
							Storage: true,
							Served:  true,
						},
					},
					Names: v1beta1.CustomResourceDefinitionNames{
						Kind:   "Ghost",
						Plural: "Ghosts",
					},
				},
			},
			expected: []labels.Set{
				{
					APILabelKeyPrefix + "6435ab0d7c6bda64": "provided",
				},
				{
					APILabelKeyPrefix + "6435ab0d7c6bda64": "required",
				},
			},
		},
		{
			name: "OperatorSurface/Provided",
			obj: operatorSurface{
				ProvidedAPIs: map[opregistry.APIKey]struct{}{
					{Group: "ghouls", Version: "v1alpha1", Kind: "Ghost", Plural: "Ghosts"}: {},
				},
			},
			expected: []labels.Set{
				{
					APILabelKeyPrefix + "6435ab0d7c6bda64": "provided",
				},
			},
		},
		{
			name: "OperatorSurface/ProvidedAndRequired",
			obj: operatorSurface{
				ProvidedAPIs: map[opregistry.APIKey]struct{}{
					{Group: "ghouls", Version: "v1alpha1", Kind: "Ghost", Plural: "Ghosts"}: {},
				},
				RequiredAPIs: map[opregistry.APIKey]struct{}{
					{Group: "ghouls", Version: "v1alpha1", Kind: "Goblin", Plural: "Goblins"}: {},
				},
			},
			expected: []labels.Set{
				{
					APILabelKeyPrefix + "6435ab0d7c6bda64": "provided",
					APILabelKeyPrefix + "557c9f42470aa352": "required",
				},
			},
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			labelSets, err := LabelSetsFor(tt.obj)
			require.NoError(t, err)
			require.ElementsMatch(t, tt.expected, labelSets)
		})
	}
}


text:
package com.github.bingoohuang.asmvalidator.validation;

import com.github.bingoohuang.asmvalidator.AsmValidateGenerator;
import com.github.bingoohuang.asmvalidator.annotations.AsmMaxSize;
import com.github.bingoohuang.asmvalidator.asm.LocalIndices;
import com.github.bingoohuang.asmvalidator.utils.AnnotationAndRoot;
import com.github.bingoohuang.asmvalidator.utils.AsmValidators;
import com.github.bingoohuang.asmvalidator.utils.Asms;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;

import java.lang.reflect.Type;

import static com.github.bingoohuang.asmvalidator.utils.AsmValidators.addError;
import static org.objectweb.asm.Opcodes.*;

public class AsmMaxSizeValidateGenerator implements AsmValidateGenerator {
    @Override
    public void generateAsm(
            MethodVisitor mv, String fieldName, Class<?> fieldType,
            Type genericFieldType, AnnotationAndRoot annAndRoot, LocalIndices localIndices,
            String message,
            boolean checkBlank
    ) {
        mv.visitVarInsn(ILOAD, localIndices.getIsNullIndex());
        Label l1 = new Label();
        mv.visitJumpInsn(IFNE, l1);

        AsmValidators.computeSize(mv, fieldType, localIndices);

        AsmMaxSize asmMaxSize = (AsmMaxSize) annAndRoot.ann();
        Asms.visitInt(mv, asmMaxSize.value());
        mv.visitJumpInsn(IF_ICMPLE, l1);
        addError(fieldName, fieldType, mv, annAndRoot, message, localIndices, l1);
    }

}


text:
package com.shcem.mapper;

import org.dozer.DozerBeanMapper;

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

/**
 * 简单封装Dozer, 实现深度转换Bean<->Bean的Mapper.实现:
 *
 * 1. 持有Mapper的单例.
 * 2. 返回值类型转换.
 * 3. 批量转换Collection中的所有对象.
 * 4. 区分创建新的B对象与将对象A值复制到已存在的B对象两种函数.
 *
 * @author lizhihua
 * @version 1.0
 */
public class BeanMapper {

	/**
	 * 持有Dozer单例, 避免重复创建DozerMapper消耗资源.
	 */
	private static DozerBeanMapper dozer = new DozerBeanMapper();

	/**
	 * 基于Dozer转换对象的类型.
	 */
	public static <T> T map(Object source, Class<T> destinationClass) {
		return dozer.map(source, destinationClass);
	}

	/**
	 * 基于Dozer转换Collection中对象的类型.
	 */
	@SuppressWarnings("rawtypes")
	public static <T> List<T> mapList(Collection sourceList, Class<T> destinationClass) {
		List<T> destinationList = new ArrayList<>();
		for (Object sourceObject : sourceList) {
			T destinationObject = dozer.map(sourceObject, destinationClass);
			destinationList.add(destinationObject);
		}
		return destinationList;
	}

	/**
	 * 基于Dozer将对象A的值拷贝到对象B中.
	 */
	public static void copy(Object source, Object destinationObject) {
		dozer.map(source, destinationObject);
	}
}


text:
correcthorse.nodejs
=========

A role for installing nodejs.

IMPORTANT: This role will fail on a system that already has nodejs packages installed, ie the EPEL packages. Installed packages are from upstream repository and the nodejs package comes with npm.

Variables
---------

| Variable			| Default			| Notes				|
| :---				| :---				| :---				|
| nodejs_version          | 6           | only accepts major versions that upstream has repos for, ie 6, 7, 8 |
| nodejs_install_bower		| false				| global install		|
| nodejs_bower_version		| '>0'				| 	 			|
| nodejs_install_gulp		| false				| global install		|
| nodejs_gulp_version		| '>0'				| 	 			|
| nodejs_install_grunt_cli	| false				| global install		|
| nodejs_grunt_cli_version	| '>0'				| 	 			|

Example Playbook
----------------

    - hosts: servers
      roles:
         - { role: correcthorse.nodejs }

License
-------

MIT

Author Information
------------------

* [Joshua Rusch](https://correct.horse/)


text:
package org.knowm.xchange.therock.service;

import org.knowm.xchange.service.trade.params.orders.DefaultOpenOrdersParamCurrencyPair;

public class TheRockOpenOrdersParams extends DefaultOpenOrdersParamCurrencyPair {}


text:
// 32feet.NET - Personal Area Networking for .NET
//
// InTheHand.Net.Bluetooth.NodeData
//
// Copyright (c) 2003-2008 In The Hand Ltd, All rights reserved.
// This source code is licensed under the MIT License

using System;
using System.Runtime.InteropServices;

#if NETCF
namespace InTheHand.Net.Bluetooth
{
#pragma warning disable 1591

    /*[StructLayout(LayoutKind.Sequential)]
    public struct SdpString
    {
        public IntPtr val;
        public int length;
    }*/

    [StructLayout(LayoutKind.Explicit, Size=24)]
    [CLSCompliant(false)]
    internal struct NodeData
    {
        [FieldOffset(0)]
        public SDP_TYPE type;
        [FieldOffset(2)]
        public SDP_SPECIFICTYPE specificType;

        //[FieldOffset(4)]
        //public Guid int128;
        //[FieldOffset(4)]
        //public Guid uint128;
        [FieldOffset(8)]
        public Guid uuid128;
        //[FieldOffset(8)]
        //public uint uuid32;
        //[FieldOffset(8)]
        //public ushort uuid16;
        [FieldOffset(8)]
        public long int64;
        [FieldOffset(8)]
        public ulong uint64;
        [FieldOffset(8)]
        public int int32;
        [FieldOffset(8)]
        public uint uint32;
        [FieldOffset(8)]
        public short int16;
        [FieldOffset(8)]
        public ushort uint16;
        [FieldOffset(8)]
        public sbyte int8;
        [FieldOffset(8)]
        public byte uint8;

        //[FieldOffset(4)]
        //public byte booleanVal;

        //flatten the SdpString structure
        [FieldOffset(8)]
        public IntPtr str;
        [FieldOffset(12)]
        public int stringLength;

        [FieldOffset(8)]
        public IntPtr container;
    }

}
#endif


text:
require_relative "page_actions"
module Moose
  module Page
    module FullPageActions

      def self.included(klass)
        klass.include(PageActions)
        klass.extend(ClassMethods)
        klass.include(InstanceMethods)
      end

      module ClassMethods
        class NoPathGiven < Moose::Error; end
        def path=(full_path)
          @path = full_path
        end

        def path(full_path)
          self.path = path
        end

        def path
          raise NoPathGiven.new("No path provided for #{self}") unless @path
          @path
        end
      end

      module InstanceMethods
        class MissingPathParameter < Moose::Error; end

        def at_page?(opts = {})
          _full_path(opts) == browser.url
        end

        def go_there!(opts = {})
          return if at_page?(opts)
          go_to(_full_path(opts))
        end

        private

        def _path
          self.class.path
        end

        def _full_path(opts = {})
          File.join(browser.test_suite.base_url, _replaced_path(opts))
        end

        def _replaced_path(opts = {})
          current_path = _path.dup
          _matches.each do |match|
            current_path.gsub!(match, _fetch_key_from(opts, match))
          end
          _params_matches.each do |match|
            current_path.gsub!(match, _fetch_key_from(opts, match))
          end
          current_path
        end

        def _fetch_key_from(hsh, key_name)
          key_name = key_name.gsub(/^:/, "")
          hsh.fetch(key_name.to_sym) {
            hsh.fetch(key_name.to_s) { raise MissingPathParameter.new("no parameter for #{key_name}")}
          }
        end

        def _matches
          @_matches ||= begin
            regex_matches = _regex.match(_path)
            regex_matches && regex_matches.captures || []
          end
        end

        def _params_matches
          CGI::parse(_path).values.flatten
        end

        def _regex
          /^#{_path.gsub(/:([\w_]+)/, "(?<\\1>\[\^\\\/\]+)")}$/
        end
      end
    end
  end
end


text:
title: Stopping and solved
meaning: Expression which describes persistent and complex undesirable traits
---


text:
#pragma once
#ifndef __BENCH_EXECUTABLE_H__
#define __BENCH_EXECUTABLE_H__

#include <cassert>
#include <map>
#include <memory>
#include <type_traits>
#include <vector>

#ifndef __BENCH_EXPORT_H__
#include "bench/export.h"
#endif

#ifndef __BENCH_BENCHMARK_H__
#include "bench/benchmark.h"
#endif

#ifndef __BENCH_EXPERIMENT_H__
#include "bench/experiment.h"
#endif

#ifndef __BENCH_PROFILER_H__
#include "bench/profiler.h"
#endif

namespace bench
{

    /**
    * \class bench::executable_properties
    * \brief Executable properties container.
    */
    class BENCH_API executable_properties final
    {

        //////////////////////////////////////
        //				MEMBERS				//
        //////////////////////////////////////

    public:
        std::string				export_path_;

        //////////////////////////////////////
        //				METHODS				//
        //////////////////////////////////////

    public:
        executable_properties(void) noexcept
            : export_path_()
        {}
        ~executable_properties(void) noexcept = default;

        executable_properties(bench::executable_properties && p_other) noexcept = default;
        executable_properties(bench::executable_properties const & p_other) = default;

        bench::executable_properties & operator=(bench::executable_properties && p_other) noexcept = default;
        bench::executable_properties & operator=(bench::executable_properties const & p_other) &
        {
            if (this != &p_other)
            {
                bench::executable_properties tmp(p_other);
                *this = std::move(tmp);
            }
            return *this;
        }

    }; // executable_properties

    /**
    * \class bench::executable
    * \brief Executable class used to run executable.
    */
    class BENCH_API executable final
    {

        //////////////////////////////////////
        //				MEMBERS				//
        //////////////////////////////////////

    private:
        std::string														export_path_;

    private:
        std::map<std::string, std::shared_ptr<bench::benchmark>>		benchmarks_;
        std::vector<std::shared_ptr<bench::experiment>>				    experiments_;

        //////////////////////////////////////
        //				METHODS				//
        //////////////////////////////////////

    public:
        executable(void) = delete;
        executable(executable & p_arg) = delete;
        executable(executable && p_arg) = delete;
        void operator=(executable & p_arg) = delete;
        void operator=(executable && p_arg) = delete;

    public:
        /** \brief Class constructor. */
        explicit executable(bench::executable_properties const * p_props) noexcept;
        /** \brief Class destructor. */
        ~executable(void) noexcept;

    public:
        /** \brief Add experiment to run. */
        template <class TExperiment>
        void add_experiment(
            std::string const & p_group,
            std::string const & p_name,
            bench::profile_type_e p_type,
            uint64_t p_samples,
            uint64_t p_iteration,
            std::shared_ptr<TExperiment> const & p_experiment);

    private:
        /** \brief Compute and export results to CSV file. */
        bool export_to_csv(void) const;
        /** \brief Clear all experiments samples. */
        void clear(void) noexcept;

    public:
        /** \brief Clear previous samples, run all experiments, export results to CSV. */
        void run(void);

    }; // class experiment

} // namespace bench

//=================================================================================================
template <class TExperiment>
void bench::executable::add_experiment(
    std::string const & p_group,
    std::string const & p_name,
    bench::profile_type_e p_type,
    uint64_t p_samples,
    uint64_t p_iteration,
    std::shared_ptr<TExperiment> const & p_experiment)
{
    assert((std::is_base_of<bench::experiment, TExperiment>::value));

    std::shared_ptr<bench::benchmark> bmk;

    // Search for group.
    auto const & itr = benchmarks_.find(p_group);
    if (itr != benchmarks_.end())
    {
        bmk = itr->second;
    }
    // Create new executable group.
    else
    {
        bench::benchmark_properties props;
        props.name_			= p_group;
        props.export_path_	= export_path_;
        bmk = std::make_shared<bench::benchmark>(&props);
        benchmarks_.emplace(p_group, bmk);
    }

    // Store experiment.
    experiments_.push_back(p_experiment);
    bmk->add_experiment(
        p_name,
        p_type,
        p_samples,
        p_iteration,
        std::bind(&TExperiment::run, p_experiment));
}

///////////////////////////////////////////////////////////////////////////////////////////////////
//		HELPERS
///////////////////////////////////////////////////////////////////////////////////////////////////

/**
* \def EVE_BENCHMARK_BEGIN
* \brief Beginning of the executable application.
* Provides entry point, main executable, export path.
*/
#define EVE_BENCHMARK_BEGIN( EXPORT_PATH )							\
    int main(													    \
        int /*arc*/, 				            					\
        char ** /*argv*/) try										\
    {																\
        bench::executable_properties exec_props;					\
        exec_props.export_path_ = EXPORT_PATH;						\
        std::unique_ptr<bench::executable> exec =					\
            std::make_unique<bench::executable>(&exec_props)

/**
* \def EVE_BENCHMARK_END
* \brief Benchmark run and exception catch.
*/
#define EVE_BENCHMARK_END								\
        exec->run();									\
        return 0;										\
    }													\
    catch (...)											\
    {	                                                \
        assert(0);                                      \
        return 1;										\
    }

/**
* \def EVE_BENCHMARK_ADD_EXPERIMENT
* \brief Add experiment to executable execution.
*/
#define EVE_BENCHMARK_ADD_EXPERIMENT(GROUP, NAME, CLASS_NAME, TYPE, SAMPLE_NUM, ITERATION_NUM)		\
    {																								\
    auto experiment_ = bench::make_experiment<CLASS_NAME>();                   				        \
    exec->add_experiment<CLASS_NAME>(																\
        GROUP,																						\
        #NAME,																						\
        TYPE,																						\
        SAMPLE_NUM,																					\
        ITERATION_NUM,																				\
        experiment_);																				\
    }

#endif // __BENCH_EXECUTABLE_H__


text:
import os
import shutil
import unittest

from systemds.context import SystemDSContext

os.environ['SYSDS_QUIET'] = "1"

test_dir = os.path.join("tests", "lineage")
temp_dir = os.path.join(test_dir, "temp")

class TestLineageTrace(unittest.TestCase):

    sds: SystemDSContext = None

    @classmethod
    def setUpClass(cls):
        cls.sds = SystemDSContext()

    @classmethod
    def tearDownClass(cls):
        cls.sds.close()

    def tearDown(self):
        shutil.rmtree(temp_dir, ignore_errors=True)

    @unittest.skipIf("SYSTEMDS_ROOT" not in os.environ, "The test is skipped if SYSTEMDS_ROOT is not set, this is required for this tests since it use the bin/systemds file to execute a reference")
    def test_compare_trace1(self):  # test getLineageTrace() on an intermediate
        m = self.sds.full((10, 10), 1)
        m_res = m + m

        python_trace = [x.strip().split("°")
                        for x in m_res.get_lineage_trace().split("\n")]

        dml_script = (
            "x = matrix(1, rows=10, cols=10);\n"
            "y = x + x;\n"
            "print(lineage(y));\n"
        )

        sysds_trace = create_execute_and_trace_dml(dml_script, "trace1")

        # It is not garantied, that the two lists 100% align to be the same.
        # Therefore for now, we only compare if the command is the same, in same order.
        python_trace_commands = [x[:1] for x in python_trace]
        dml_script_commands = [x[:1] for x in sysds_trace]
        self.assertEqual(python_trace_commands[0], dml_script_commands[0])

# TODO add more tests cases.

def create_execute_and_trace_dml(script: str, name: str):
    script_file_name = temp_dir + "/" + name + ".dml"

    if not os.path.exists(temp_dir):
        os.makedirs(temp_dir)

    with open(script_file_name, "w") as dml_file:
        dml_file.write(script)

    # Call SYSDS!
    result_file_name = temp_dir + "/" + name + ".txt"

    command = "systemds " + script_file_name + \
        " > " + result_file_name + " 2> /dev/null"
    os.system(command)
    return parse_trace(result_file_name)

def parse_trace(path: str):
    pointer = 0
    data = []
    with open(path, "r") as log:
        for line in log:
            data.append(line.strip().split("°"))

    # Remove the last 4 lines of the System output because they are after lintrace.
    return data[:-4]

if __name__ == "__main__":
    unittest.main(exit=False)


text:
module.exports = function (grunt) {

    var path = require('path');

	// Load the package JSON file
	var pkg = grunt.file.readJSON('package.json');

	// Load information about the assembly
	var assembly = grunt.file.readJSON('src/' + pkg.name + '/Properties/AssemblyInfo.json');

	// Get the version of the package
    var version = assembly.informationalVersion ? assembly.informationalVersion : assembly.version;

	grunt.initConfig({
	    pkg: pkg,
		zip: {
		    release: {
		        router: function (filepath) {
					if (filepath.indexOf('/bin/Release/') >= 0) {
						return filepath.split('/bin/Release/')[1];
					} else {
						return path.basename(filepath);
					}
		        },
			    src: [
					'src/' + pkg.name + '/bin/Release/*/*.dll',
					'src/' + pkg.name + '/bin/Release/*/*.xml',
					'src/LICENSE.html'
				],
		        dest: 'releases/github/' + pkg.name + '.v' + version + '.zip'
			}
		}
	});

	grunt.loadNpmTasks('grunt-zip');

	grunt.registerTask('release', ['zip']);

	grunt.registerTask('default', ['release']);

};


text:
<title>Zend Framework API Documentation</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta><link rel="stylesheet" href="css/black-tie/jquery-ui-1.8.2.custom.css" type="text/css"></link><link rel="stylesheet" href="css/jquery.treeview.css" type="text/css"></link><link rel="stylesheet" href="css/theme.css" type="text/css"></link>

API Documentation

Search/Lucene/Search/Query/Empty.php

Global

                      Classes

\Zend_Search_Lucene_Search_Query_Empty

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to license@zend.com so we can send you a copy immediately.

category

Zend

copyright

Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)

license

New BSD License

package

Zend_Search_Lucene

subpackage

Search

version

$Id: Empty.php 23775 2011-03-01 17:25:24Z ralph $

\Zend_Search_Lucene_Search_Query_Empty
jump to top

Extends from

\Zend_Search_Lucene_Search_Query

category

Zend

copyright

Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)

license

New BSD License

package

Zend_Search_Lucene

subpackage

Search

Methods

__toString(

          )

        :
          string

Print a query

Returns

Type
Description

string

_highlightMatches(
          \Zend_Search_Lucene_Search_Highlighter_Interface $highlighter
          )

        :
          void

Query specific matches highlighting

Parameters

Name
Type
Description

$highlighter
\Zend_Search_Lucene_Search_Highlighter_Interface

Highlighter object (also contains doc for highlighting)

_initWeight(
          \Zend_Search_Lucene_Interface $reader
          )

        :
          void

Constructs an initializes a Weight for a _top-level_query_.

Inherited from:
                    \Zend_Search_Lucene_Search_Query::_initWeight()

Parameters

Name
Type
Description

$reader
\Zend_Search_Lucene_Interface

createWeight(
          \Zend_Search_Lucene_Interface $reader
          )

        :
          \Zend_Search_Lucene_Search_Weight

Constructs an appropriate Weight implementation for this query.

Parameters

Name
Type
Description

$reader
\Zend_Search_Lucene_Interface

Returns

Type
Description

\Zend_Search_Lucene_Search_Weight

execute(
          \Zend_Search_Lucene_Interface $reader, \Zend_Search_Lucene_Index_DocsFilter|null $docsFilter
              =
              null
          )

        :
          void

Execute query in context of index reader
It also initializes necessary internal structures

Query specific implementation

Parameters

Name
Type
Description

$reader
\Zend_Search_Lucene_Interface

$docsFilter

\Zend_Search_Lucene_Index_DocsFilter|null

getBoost(

          )

        :
          float

Gets the boost for this clause.  Documents matching
this clause will (in addition to the normal weightings) have their score
multiplied by boost.   The boost is 1.0 by default.

Inherited from:
                    \Zend_Search_Lucene_Search_Query::getBoost()

Returns

Type
Description

float

getQueryTerms(

          )

        :
          array

Return query terms

Returns

Type
Description

array

highlightMatches(
          string $inputHTML, string $defaultEncoding, \Zend_Search_Lucene_Search_Highlighter_Interface|null $highlighter
              =
              null
          )

        :
          string

Highlight matches in $inputHTML

Inherited from:
                    \Zend_Search_Lucene_Search_Query::highlightMatches()

Parameters

Name
Type
Description

$inputHTML
string

$defaultEncoding
string

HTML encoding, is used if it's not specified using Content-type HTTP-EQUIV meta tag.

$highlighter

\Zend_Search_Lucene_Search_Highlighter_Interface|null

Returns

Type
Description

string

htmlFragmentHighlightMatches(
          string $inputHtmlFragment, string $encoding
              =
              UTF-8, \Zend_Search_Lucene_Search_Highlighter_Interface|null $highlighter
              =
              null
          )

        :
          string

Highlight matches in $inputHtmlFragment and return it (without HTML header and body tag)

Inherited from:
                    \Zend_Search_Lucene_Search_Query::htmlFragmentHighlightMatches()

Parameters

Name
Type
Description

$inputHtmlFragment
string

$encoding
string
Input HTML string encoding

$highlighter

\Zend_Search_Lucene_Search_Highlighter_Interface|null

Returns

Type
Description

string

matchedDocs(

          )

        :
          array

Get document ids likely matching the query

It's an array with document ids as keys (performance considerations)

Returns

Type
Description

array

optimize(
          \Zend_Search_Lucene_Interface $index
          )

        :
          \Zend_Search_Lucene_Search_Query

Optimize query in the context of specified index

Parameters

Name
Type
Description

$index
\Zend_Search_Lucene_Interface

Returns

Type
Description

\Zend_Search_Lucene_Search_Query

reset(

          )

        :
          void

Reset query, so it can be reused within other queries or
with other indeces

Inherited from:
                    \Zend_Search_Lucene_Search_Query::reset()

rewrite(
          \Zend_Search_Lucene_Interface $index
          )

        :
          \Zend_Search_Lucene_Search_Query

Re-write query into primitive queries in the context of specified index

Parameters

Name
Type
Description

$index
\Zend_Search_Lucene_Interface

Returns

Type
Description

\Zend_Search_Lucene_Search_Query

score(
          integer $docId, \Zend_Search_Lucene_Interface $reader
          )

        :
          float

Score specified document

Parameters

Name
Type
Description

$docId
integer

$reader
\Zend_Search_Lucene_Interface

Returns

Type
Description

float

setBoost(
          float $boost
          )

        :
          void

Sets the boost for this query clause to $boost.

Inherited from:
                    \Zend_Search_Lucene_Search_Query::setBoost()

Parameters

Name
Type
Description

$boost
float

Documentation was generated by DocBlox 0.13.3.


text:
@interface REDValidationRule ()
@property (nonatomic, copy) REDValidationRuleBlock block;
@end

@implementation REDValidationRule

+ (instancetype)ruleWithBlock:(REDValidationRuleBlock)block
{
	return [[self alloc] initWithBlock:block];
}

- (instancetype)initWithBlock:(REDValidationRuleBlock)block
{
	self = [super init];
	if (self) {
		_block = [block copy];
	}
	return self;
}

- (REDValidationResult)validate:(id<REDValidatableComponent>)uiComponent allowDefault:(BOOL)allowDefault
{
	id value = uiComponent.validatedValue;

	if ([value isEqual:uiComponent.defaultValue]) {
		return allowDefault ? REDValidationResultDefaultValid : REDValidationResultUnvalidated;
	}

	return [self validateValue:value];
}

- (REDValidationResult)validateValue:(id)value
{
	if (_block) {
		return _block(value) ? REDValidationResultValid : REDValidationResultInvalid;
	} else {
		return REDValidationResultInvalid;
	}
}

- (void)cancel
{
}

@end

@interface REDNetworkValidationRule ()
@property (nonatomic, copy) REDNetworkValidationRuleBlock block;
@end

@implementation REDNetworkValidationRule {
	__weak NSURLSessionTask *_task;
}

+ (instancetype)ruleWithBlock:(REDNetworkValidationRuleBlock)block
{
	return [[self alloc] initWithBlock:block];
}

- (instancetype)initWithBlock:(REDNetworkValidationRuleBlock)block
{
	self = [super init];
	if (self) {
		_block = [block copy];
	}
	return self;
}

- (REDValidationResult)validate:(id<REDValidatableComponent>)uiComponent allowDefault:(BOOL)allowDefault
{
	[self cancel];

	id value = uiComponent.validatedValue;

	if ([value isEqual:uiComponent.defaultValue]) {
		REDValidationResult result = allowDefault ? REDValidationResultDefaultValid : REDValidationResultUnvalidated;
		[_delegate validationRule:self completedNetworkValidationOfUIComponent:uiComponent withResult:result error:nil];
		return result;
	}

	return [self validateUIComponent:uiComponent value:value];
}

- (REDValidationResult)validateValue:(id)value
{
	return [self validateUIComponent:nil value:value];
}

- (REDValidationResult)validateUIComponent:(NSObject<REDValidatableComponent> *)component value:(id)value
{
	if (_block) {
		__weak typeof(self) weakSelf = self;
		_task = _block(value, ^void(BOOL result, NSError *error) {
			dispatch_async(dispatch_get_main_queue(), ^{
				__strong typeof(weakSelf) strongSelf = weakSelf;
				REDValidationResult validationResult = result ? REDValidationResultValid : REDValidationResultInvalid;
				[strongSelf.delegate validationRule:strongSelf completedNetworkValidationOfUIComponent:component withResult:validationResult error:error];
			});
		});

		return REDValidationResultPending;
	} else {
		return REDValidationResultInvalid;
	}
}

- (void)cancel
{
	[_task cancel];
	_task = nil;
}

@end


text:
require_relative '../test_helper'

class TestStrangerThings < Test::Unit::TestCase
  def setup
    @tester = Faker::StrangerThings
  end

  def test_characters
    assert @tester.character.match(/\w+/)
  end

  def test_quotes
    assert @tester.quote.match(/\w+/)
  end
end


text:
Cropper.TEMPLATE = (
    '
' +
      '
' +
        '

' +
      '
' +
      '

' +
      '
' +
        '' +
        '' +
        '' +
        '' +
        '' +
        '' +
        '' +
        '' +
        '' +
        '' +
        '' +
        '' +
        '' +
        '' +
        '' +
        '' +
        '' +
      '
' +
    '
'
  );


text:
Version numbers correspond to `bower.json` version

# 1.0.2 (2014-04-01)
## Features
- move `instId` from `attrs` to `scope` to allow setting/changing later/dynamically

# 1.0.1 (2014-01-25)
## Features
- `$scope.$on('jrgAreaSelectReInit',..` event listener added for re-initializing the directive (after it's already been written) - i.e. if the transcluded inner content changes
- `$scope.$on('jrgAreaSelectHide',..` event listener added for hiding the directive (i.e. the blurred sections)
- add `$attrs.inline`

## Bug Fixes
- switch from `getBoundingClientRect()` which was giving bad (negative/wrong) offset/coords
- add z-index:999 to blurred elements so they show up on top

# 1.0.0

## Features

## Bug Fixes

## Breaking Changes


text:
var assert = require("assert");
GLOBAL.window = window = require("jsdom").jsdom().createWindow();
var document = window.document;

var events = require("./support/events")(document);
require("../src/payment");

describe("payment", function() {
  describe("Validating a card number", function() {
    it("should fail if empty", function() {
      var topic = window.payment.validateCardNumber("");
      assert.equal(topic, false);
    });
    it("should fail if is a bunch of spaces", function() {
      var topic = window.payment.validateCardNumber("                 ");
      assert.equal(topic, false);
    });
    it("should success if is valid", function() {
      var topic = window.payment.validateCardNumber("4242424242424242");
      assert.equal(topic, true);
    });
    it("that has dashes in it but is valid", function() {
      var topic = window.payment.validateCardNumber("4242-4242-4242-4242");
      assert.equal(topic, true);
    });
    it("should succeed if it has spaces in it but is valid", function() {
      var topic = window.payment.validateCardNumber("4242 4242 4242 4242");
      assert.equal(topic, true);
    });
    it("that does not pass the luhn checker", function() {
      var topic = window.payment.validateCardNumber("4242424242424241");
      assert.equal(topic, false);
    });
    it("should fail if is more than 16 digits", function() {
      var topic = window.payment.validateCardNumber("42424242424242424");
      assert.equal(topic, false);
    });
    it("should fail if is less than 10 digits", function() {
      var topic = window.payment.validateCardNumber("424242424");
      assert.equal(topic, false);
    });
    it("should fail with non-digits", function() {
      var topic = window.payment.validateCardNumber("4242424e42424241");
      assert.equal(topic, false);
    });
    it("should validate for all card types", function() {
      assert(window.payment.validateCardNumber("378282246310005"), "amex");
      assert(window.payment.validateCardNumber("371449635398431"), "amex");
      assert(window.payment.validateCardNumber("378734493671000"), "amex");
      assert(window.payment.validateCardNumber("30569309025904"), "dinersclub");
      assert(window.payment.validateCardNumber("38520000023237"), "dinersclub");
      assert(window.payment.validateCardNumber("6011111111111117"), "discover");
      assert(window.payment.validateCardNumber("6011000990139424"), "discover");
      assert(window.payment.validateCardNumber("3530111333300000"), "jcb");
      assert(window.payment.validateCardNumber("3566002020360505"), "jcb");
      assert(window.payment.validateCardNumber("5555555555554444"), "mastercard");
      assert(window.payment.validateCardNumber("4111111111111111"), "visa");
      assert(window.payment.validateCardNumber("4012888888881881"), "visa");
      assert(window.payment.validateCardNumber("4222222222222"), "visa");
      assert(window.payment.validateCardNumber("6759649826438453"), "maestro");
      assert(window.payment.validateCardNumber("6271136264806203568"), "unionpay");
      assert(window.payment.validateCardNumber("6236265930072952775"), "unionpay");
      assert(window.payment.validateCardNumber("6204679475679144515"), "unionpay");
      assert(window.payment.validateCardNumber("6216657720782466507"), "unionpay");
    });
  });

  describe("Validating a CVC", function() {
    it("should fail if is empty", function() {
      var topic = window.payment.validateCardCVC("");
      assert.equal(topic, false);
    });
    it("should pass if is valid", function() {
      var topic = window.payment.validateCardCVC("123");
      assert.equal(topic, true);
    });
    it("should fail with non-digits", function() {
      var topic = window.payment.validateCardNumber("12e");
      assert.equal(topic, false);
    });
    it("should fail with less than 3 digits", function() {
      var topic = window.payment.validateCardNumber("12");
      assert.equal(topic, false);
    });
    it("should fail with more than 4 digits", function() {
      var topic = window.payment.validateCardNumber("12345");
      assert.equal(topic, false);
    });
  });

  describe("Validating an expiration date", function() {
    it("should fail expires is before the current year", function() {
      var currentTime, topic;
      currentTime = new Date();
      topic = window.payment.validateCardExpiry(currentTime.getMonth() + 1, currentTime.getFullYear() - 1);
      assert.equal(topic, false);
    });
    it("that expires in the current year but before current month", function() {
      var currentTime, topic;
      currentTime = new Date();
      topic = window.payment.validateCardExpiry(currentTime.getMonth(), currentTime.getFullYear());
      assert.equal(topic, false);
    });
    it("that has an invalid month", function() {
      var currentTime, topic;
      currentTime = new Date();
      topic = window.payment.validateCardExpiry(13, currentTime.getFullYear());
      assert.equal(topic, false);
    });
    it("that is this year and month", function() {
      var currentTime, topic;
      currentTime = new Date();
      topic = window.payment.validateCardExpiry(currentTime.getMonth() + 1, currentTime.getFullYear());
      assert.equal(topic, true);
    });
    it("that is just after this month", function() {
      var currentTime, topic;
      currentTime = new Date();
      topic = window.payment.validateCardExpiry(currentTime.getMonth() + 1, currentTime.getFullYear());
      assert.equal(topic, true);
    });
    it("that is after this year", function() {
      var currentTime, topic;
      currentTime = new Date();
      topic = window.payment.validateCardExpiry(currentTime.getMonth() + 1, currentTime.getFullYear() + 1);
      assert.equal(topic, true);
    });
    it("that has string numbers", function() {
      var currentTime, topic;
      currentTime = new Date();
      currentTime.setFullYear(currentTime.getFullYear() + 1, currentTime.getMonth() + 2);
      topic = window.payment.validateCardExpiry(currentTime.getMonth() + "", currentTime.getFullYear() + "");
      assert.equal(topic, true);
    });
    it("that has non-numbers", function() {
      var topic = window.payment.validateCardExpiry("h12", "3300");
      assert.equal(topic, false);
    });
    it("should fail if year or month is NaN", function() {
      var topic = window.payment.validateCardExpiry("12", NaN);
      assert.equal(topic, false);
    });
    it("should support year shorthand", function() {
      assert.equal(window.payment.validateCardExpiry("05", "20"), true);
    });
  });

  describe("Validating a CVC number", function() {
    it("should validate a three digit number with no card type", function() {
      var topic = window.payment.validateCardCVC("123");
      assert.equal(topic, true);
    });
    it("should validate a three digit number with card type amex", function() {
      var topic = window.payment.validateCardCVC("123", "amex");
      assert.equal(topic, true);
    });
    it("should validate a three digit number with card type other than amex", function() {
      var topic = window.payment.validateCardCVC("123", "visa");
      assert.equal(topic, true);
    });
    it("should not validate a four digit number with a card type other than amex", function() {
      var topic = window.payment.validateCardCVC("1234", "visa");
      assert.equal(topic, false);
    });
    it("should validate a four digit number with card type amex", function() {
      var topic = window.payment.validateCardCVC("1234", "amex");
      assert.equal(topic, true);
    });
    it("should not validate a number larger than 4 digits", function() {
      var topic = window.payment.validateCardCVC("12344");
      assert.equal(topic, false);
    });
  });

  describe("Parsing an expiry value", function() {
    it("should parse string expiry", function() {
      var topic = window.payment.cardExpiryVal("03 / 2025");
      assert.deepEqual(topic, {
        month: 3,
        year: 2025
      });
    });
    it("should support shorthand year", function() {
      var topic = window.payment.cardExpiryVal("05/04");
      assert.deepEqual(topic, {
        month: 5,
        year: 2004
      });
    });
    it("should return NaN when it cannot parse", function() {
      var topic = window.payment.cardExpiryVal("05/dd");
      assert(isNaN(topic.year));
    });
  });

  describe("Getting a card type", function() {
    it("should return Visa that begins with 40", function() {
      var topic = window.payment.cardType("4012121212121212");
      assert.equal(topic, "visa");
    });
    it("that begins with 5 should return MasterCard", function() {
      var topic = window.payment.cardType("5555555555554444");
      assert.equal(topic, "mastercard");
    });
    it("that begins with 34 should return American Express", function() {
      var topic = window.payment.cardType("3412121212121212");
      assert.equal(topic, "amex");
    });
    it("that is not numbers should return null", function() {
      var topic = window.payment.cardType("aoeu");
      assert.equal(topic, null);
    });
    it("that has unrecognized beginning numbers should return null", function() {
      var topic = window.payment.cardType("aoeu");
      assert.equal(topic, null);
    });
    it("should return correct type for all test numbers", function() {
      assert.equal(window.payment.cardType("378282246310005"), "amex");
      assert.equal(window.payment.cardType("371449635398431"), "amex");
      assert.equal(window.payment.cardType("378734493671000"), "amex");
      assert.equal(window.payment.cardType("30569309025904"), "dinersclub");
      assert.equal(window.payment.cardType("38520000023237"), "dinersclub");
      assert.equal(window.payment.cardType("6011111111111117"), "discover");
      assert.equal(window.payment.cardType("6011000990139424"), "discover");
      assert.equal(window.payment.cardType("3530111333300000"), "jcb");
      assert.equal(window.payment.cardType("3566002020360505"), "jcb");
      assert.equal(window.payment.cardType("5555555555554444"), "mastercard");
      assert.equal(window.payment.cardType("4111111111111111"), "visa");
      assert.equal(window.payment.cardType("4012888888881881"), "visa");
      assert.equal(window.payment.cardType("4222222222222"), "visa");
      assert.equal(window.payment.cardType("6759649826438453"), "maestro");
      assert.equal(window.payment.cardType("6271136264806203568"), "unionpay");
      assert.equal(window.payment.cardType("6236265930072952775"), "unionpay");
      assert.equal(window.payment.cardType("6204679475679144515"), "unionpay");
      assert.equal(window.payment.cardType("6216657720782466507"), "unionpay");
    });
  });

  describe("formatCardNumber", function() {
    it("should format cc number correctly", function() {
      var numberInput, e;

      numberInput = window.document.createElement("input");

      window.payment.formatCardNumber(numberInput);
      numberInput.value = "4242";
      events.triggerKey(numberInput, 52);
      assert.equal(numberInput.value, "4242 4");
    });
  });

  describe("formatCardExpiry", function() {
    it("should format month shorthand correctly", function() {
      var $expiry, e;
      $expiry = $("<input type=text>").payment("formatCardExpiry");
      e = Event("keypress");
      e.which = 52;
      $expiry.trigger(e);
      assert.equal($expiry.val(), "04 / ");
    });
    it("should format forward slash shorthand correctly", function() {
      var $expiry, e;
      $expiry = $("<input type=text>").payment("formatCardExpiry");
      $expiry.val("1");
      e = Event("keypress");
      e.which = 47;
      $expiry.trigger(e);
      assert.equal($expiry.val(), "01 / ");
    });
    it("should only allow numbers", function() {
      var $expiry, e;
      $expiry = $("<input type=text>").payment("formatCardExpiry");
      $expiry.val("1");
      e = Event("keypress");
      e.which = 100;
      $expiry.trigger(e);
      assert.equal($expiry.val(), "1");
    });
  });

  function keypress( elm, which ) {
    // var evt = document.createEvent("KeyboardEvent");
    // evt.initKeyEvent ("keypress", true, true, window,
    //                   0, 0, 0, 0,
    //                   13, 13);
    // var canceled = !body.dispatchEvent(evt);
  }
});


text:
{% extends "base.html" %}

{% block head %}

{% endblock %}

{% block content %}

Overzicht

    {% if request.user.is_superuser %}

            Ingelogd als superuser

Beheer

        Beheersysteem
        Logins aanmaken
    {% else %}
        {% if request.user.is_staff %}

                Ingelogd als organisator

        {% endif %}
    {% endif %}
    {% if open_not_voted_questions %}

Stemmen

        {% for question in open_not_voted_questions %}
            {% if request.user.is_staff %}
                {{ question.question_text }}
            {% else %}
                {{ question.question_text }}
            {% endif %}
        {% endfor %}
    {% endif %}
    {% if open_voted_questions %}

Reeds gestemd

        {% for question in open_voted_questions %}
            {{ question.question_text }}
        {% endfor %}
    {% endif %}
    {% if closed_questions %}

Gesloten stemmingen

        {% for question in closed_questions %}
            {{ question.question_text }}
        {% endfor %}
    {% endif %}
{% endblock %}


text:
/*
 * spa.chat.js
 * Chat feature module for SPA
*/

/*jslint         browser : true, continue : true,
  devel  : true, indent  : 2,    maxerr   : 50,
  newcap : true, nomen   : true, plusplus : true,
  regexp : true, sloppy  : true, vars     : false,
  white  : true
*/

/*global $, spa, getComputedStyle */

spa.chat = (function () {
  //---------------- BEGIN MODULE SCOPE VARIABLES --------------
  var
    configMap = {
      main_html : String()
        + '
'
          + '
'
            + '
+
'
            + '
'
              + 'Chat'
            + '
'
          + '
'
          + '
x
'
          + '
'
            + '

'
            + '
'
              + '<input type="text"/>'
              + '
send
'
            + '
'
          + '
'
        + '
',

      settable_map : {
        slider_open_time    : true,
        slider_close_time   : true,
        slider_opened_em    : true,
        slider_closed_em    : true,
        slider_opened_title : true,
        slider_closed_title : true,

        chat_model      : true,
        people_model    : true,
        set_chat_anchor : true
      },

      slider_open_time     : 250,
      slider_close_time    : 250,
      slider_opened_em     : 18,
      slider_closed_em     : 2,
      slider_opened_title  : 'Click to close',
      slider_closed_title  : 'Click to open',
      slider_opened_min_em : 10,
      window_height_min_em : 20,

      chat_model      : null,
      people_model    : null,
      set_chat_anchor : null
    },
    stateMap  = {
      $append_target   : null,
      position_type    : 'closed',
      px_per_em        : 0,
      slider_hidden_px : 0,
      slider_closed_px : 0,
      slider_opened_px : 0
    },
    jqueryMap = {},

    setJqueryMap, getEmSize, setPxSizes, setSliderPosition,
    onClickToggle, configModule, initModule,
    removeSlider, handleResize
    ;
  //----------------- END MODULE SCOPE VARIABLES ---------------

  //------------------- BEGIN UTILITY METHODS ------------------
  getEmSize = function ( elem ) {
    return Number(
      getComputedStyle( elem, '' ).fontSize.match(/\d*\.?\d*/)[0]
    );
  };
  //-------------------- END UTILITY METHODS -------------------

  //--------------------- BEGIN DOM METHODS --------------------
  // Begin DOM method /setJqueryMap/
  setJqueryMap = function () {
    var
      $append_target = stateMap.$append_target,
      $slider        = $append_target.find( '.spa-chat' );

    jqueryMap = {
      $slider : $slider,
      $head   : $slider.find( '.spa-chat-head' ),
      $toggle : $slider.find( '.spa-chat-head-toggle' ),
      $title  : $slider.find( '.spa-chat-head-title' ),
      $sizer  : $slider.find( '.spa-chat-sizer' ),
      $msgs   : $slider.find( '.spa-chat-msgs' ),
      $box    : $slider.find( '.spa-chat-box' ),
      $input  : $slider.find( '.spa-chat-input input[type=text]')
    };
  };
  // End DOM method /setJqueryMap/

  // Begin DOM method /setPxSizes/
  setPxSizes = function () {
    var px_per_em, window_height_em, opened_height_em;

    px_per_em = getEmSize( jqueryMap.$slider.get(0) );
    window_height_em = Math.floor(
      ( $(window).height() / px_per_em ) + 0.5
    );

    opened_height_em
      = window_height_em > configMap.window_height_min_em
      ? configMap.slider_opened_em
      : configMap.slider_opened_min_em;

    stateMap.px_per_em        = px_per_em;
    stateMap.slider_closed_px = configMap.slider_closed_em * px_per_em;
    stateMap.slider_opened_px = opened_height_em * px_per_em;
    jqueryMap.$sizer.css({
      height : ( opened_height_em - 2 ) * px_per_em
    });
  };
  // End DOM method /setPxSizes/

  // Begin public method /setSliderPosition/
  // Example   : spa.chat.setSliderPosition( 'closed' );
  // Purpose   : Move the chat slider to the requested position
  // Arguments :
  //   * position_type - enum('closed', 'opened', or 'hidden')
  //   * callback - optional callback to be run end at the end
  //     of slider animation.  The callback receives a jQuery
  //     collection representing the slider div as its single
  //     argument
  // Action    :
  //   This method moves the slider into the requested position.
  //   If the requested position is the current position, it
  //   returns true without taking further action
  // Returns   :
  //   * true  - The requested position was achieved
  //   * false - The requested position was not achieved
  // Throws    : none
  //
  setSliderPosition = function ( position_type, callback ) {
    var
      height_px, animate_time, slider_title, toggle_text;

    // return true if slider already in requested position
    if ( stateMap.position_type === position_type ){
      return true;
    }

    // prepare animate parameters
    switch ( position_type ){
      case 'opened' :
        height_px    = stateMap.slider_opened_px;
        animate_time = configMap.slider_open_time;
        slider_title = configMap.slider_opened_title;
        toggle_text  = '=';
      break;

      case 'hidden' :
        height_px    = 0;
        animate_time = configMap.slider_open_time;
        slider_title = '';
        toggle_text  = '+';
      break;

      case 'closed' :
        height_px    = stateMap.slider_closed_px;
        animate_time = configMap.slider_close_time;
        slider_title = configMap.slider_closed_title;
        toggle_text  = '+';
      break;

      // bail for unknown position_type
      default : return false;
    }

    // animate slider position change
    stateMap.position_type = '';
    jqueryMap.$slider.animate(
      { height : height_px },
      animate_time,
      function () {
        jqueryMap.$toggle.prop( 'title', slider_title );
        jqueryMap.$toggle.text( toggle_text );
        stateMap.position_type = position_type;
        if ( callback ) { callback( jqueryMap.$slider ); }
      }
    );
    return true;
  };
  // End public DOM method /setSliderPosition/
  //---------------------- END DOM METHODS ---------------------

  //------------------- BEGIN EVENT HANDLERS -------------------
  onClickToggle = function ( event ){
    var set_chat_anchor = configMap.set_chat_anchor;
    if ( stateMap.position_type === 'opened' ) {
      set_chat_anchor( 'closed' );
    }
    else if ( stateMap.position_type === 'closed' ){
      set_chat_anchor( 'opened' );
    }
    return false;
  };
  //-------------------- END EVENT HANDLERS --------------------

  //------------------- BEGIN PUBLIC METHODS -------------------
  // Begin public method /configModule/
  // Example   : spa.chat.configModule({ slider_open_em : 18 });
  // Purpose   : Configure the module prior to initialization
  // Arguments :
  //   * set_chat_anchor - a callback to modify the URI anchor to
  //     indicate opened or closed state. This callback must return
  //     false if the requested state cannot be met
  //   * chat_model - the chat model object provides methods
  //       to interact with our instant messaging
  //   * people_model - the people model object which provides
  //       methods to manage the list of people the model maintains
  //   * slider_* settings. All these are optional scalars.
  //       See mapConfig.settable_map for a full list
  //       Example: slider_open_em is the open height in em's
  // Action    :
  //   The internal configuration data structure (configMap) is
  //   updated with provided arguments. No other actions are taken.
  // Returns   : true
  // Throws    : JavaScript error object and stack trace on
  //             unacceptable or missing arguments
  //
  configModule = function ( input_map ) {
    spa.util.setConfigMap({
      input_map    : input_map,
      settable_map : configMap.settable_map,
      config_map   : configMap
    });
    return true;
  };
  // End public method /configModule/

  // Begin public method /initModule/
  // Example    : spa.chat.initModule( $('#div_id') );
  // Purpose    :
  //   Directs Chat to offer its capability to the user
  // Arguments  :
  //   * $append_target (example: $('#div_id')).
  //     A jQuery collection that should represent
  //     a single DOM container
  // Action     :
  //   Appends the chat slider to the provided container and fills
  //   it with HTML content.  It then initializes elements,
  //   events, and handlers to provide the user with a chat-room
  //   interface
  // Returns    : true on success, false on failure
  // Throws     : none
  //
  initModule = function ( $append_target ) {
    $append_target.append( configMap.main_html );
    stateMap.$append_target = $append_target;
    setJqueryMap();
    setPxSizes();

    // initialize chat slider to default title and state
    jqueryMap.$toggle.prop( 'title', configMap.slider_closed_title );
    jqueryMap.$head.click( onClickToggle );
    stateMap.position_type = 'closed';

    return true;
  };
  // End public method /initModule/

  // Begin public method /removeSlider/
  // Purpose    :
  //   * Removes chatSlider DOM element
  //   * Reverts to initial state
  //   * Removes pointers to callbacks and other data
  // Arguments  : none
  // Returns    : true
  // Throws     : none
  //
  removeSlider = function () {
    // unwind initialization and state
    // remove DOM container; this removes event bindings too
    if ( jqueryMap.$slider ) {
      jqueryMap.$slider.remove();
      jqueryMap = {};
    }
    stateMap.$append_target = null;
    stateMap.position_type  = 'closed';

    // unwind key configurations
    configMap.chat_model      = null;
    configMap.people_model    = null;
    configMap.set_chat_anchor = null;

    return true;
  };
  // End public method /removeSlider/

  // Begin public method /handleResize/
  // Purpose    :
  //   Given a window resize event, adjust the presentation
  //   provided by this module if needed
  // Actions    :
  //   If the window height or width falls below
  //   a given threshold, resize the chat slider for the
  //   reduced window size.
  // Returns    : Boolean
  //   * false - resize not considered
  //   * true  - resize considered
  // Throws     : none
  //
  handleResize = function () {
    // don't do anything if we don't have a slider container
    if ( ! jqueryMap.$slider ) { return false; }

    setPxSizes();
    if ( stateMap.position_type === 'opened' ){
      jqueryMap.$slider.css({ height : stateMap.slider_opened_px });
    }
    return true;
  };
  // End public method /handleResize/

  // return public methods
  return {
    setSliderPosition : setSliderPosition,
    configModule      : configModule,
    initModule        : initModule,
    removeSlider      : removeSlider,
    handleResize      : handleResize
  };
  //------------------- END PUBLIC METHODS ---------------------
}());


text:
'Copyright 2019 Esri

'Licensed under the Apache License, Version 2.0 (the "License");
'you may not use this file except in compliance with the License.
'You may obtain a copy of the License at

'    http://www.apache.org/licenses/LICENSE-2.0

'Unless required by applicable law or agreed to in writing, software
'distributed under the License is distributed on an "AS IS" BASIS,
'WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

'See the License for the specific language governing permissions and
'limitations under the License.
Imports ESRI.ArcGIS.Controls
Imports ESRI.ArcGIS.esriSystem
Imports ESRI.ArcGIS.SystemUI
Imports ESRI.ArcGIS

Public Class FeatureEditing
    Inherits System.Windows.Forms.Form

    Private m_toolbarMenuSketch As IToolbarMenu
    Private m_toolbarMenuVertex As IToolbarMenu
    Private m_CommandPool As ICommandPool
    Friend WithEvents TableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel
    Private m_engineEditor As IEngineEditor
    <STAThread()> _
    Shared Sub Main()

        'Load runtime
        If Not RuntimeManager.Bind(ProductCode.Engine) Then
            If Not RuntimeManager.Bind(ProductCode.Desktop) Then
                MessageBox.Show("Unable to bind to ArcGIS runtime. Application will be shut down.")
                System.Environment.Exit(1) ' Force exit or other indication in the application
            End If
        End If

        Application.Run(New FeatureEditing())
    End Sub

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        ESRI.ArcGIS.ADF.COMSupport.AOUninitialize.Shutdown()
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.
    'Do not modify it using the code editor.
    Friend WithEvents btnOptions2 As System.Windows.Forms.Button
    Friend WithEvents btnOptions1 As System.Windows.Forms.Button
    Friend WithEvents AxToolbarControl1 As ESRI.ArcGIS.Controls.AxToolbarControl
    Friend WithEvents AxToolbarControl2 As ESRI.ArcGIS.Controls.AxToolbarControl
    Friend WithEvents AxTOCControl1 As ESRI.ArcGIS.Controls.AxTOCControl
    Friend WithEvents AxMapControl1 As ESRI.ArcGIS.Controls.AxMapControl
    Friend WithEvents AxLicenseControl1 As ESRI.ArcGIS.Controls.AxLicenseControl
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FeatureEditing))
        Me.btnOptions2 = New System.Windows.Forms.Button
        Me.btnOptions1 = New System.Windows.Forms.Button
        Me.AxToolbarControl1 = New ESRI.ArcGIS.Controls.AxToolbarControl
        Me.AxToolbarControl2 = New ESRI.ArcGIS.Controls.AxToolbarControl
        Me.AxTOCControl1 = New ESRI.ArcGIS.Controls.AxTOCControl
        Me.AxMapControl1 = New ESRI.ArcGIS.Controls.AxMapControl
        Me.AxLicenseControl1 = New ESRI.ArcGIS.Controls.AxLicenseControl
        Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel
        CType(Me.AxToolbarControl1, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.AxToolbarControl2, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.AxTOCControl1, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.AxMapControl1, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.AxLicenseControl1, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.TableLayoutPanel1.SuspendLayout()
        Me.SuspendLayout()
        '
        'btnOptions2
        '
        Me.btnOptions2.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.btnOptions2.Location = New System.Drawing.Point(839, 38)
        Me.btnOptions2.Name = "btnOptions2"
        Me.btnOptions2.Size = New System.Drawing.Size(87, 24)
        Me.btnOptions2.TabIndex = 8
        Me.btnOptions2.Text = "Edit Options2"
        '
        'btnOptions1
        '
        Me.btnOptions1.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.btnOptions1.Location = New System.Drawing.Point(839, 3)
        Me.btnOptions1.Name = "btnOptions1"
        Me.btnOptions1.Size = New System.Drawing.Size(87, 23)
        Me.btnOptions1.TabIndex = 7
        Me.btnOptions1.Text = "Edit Options1"
        '
        'AxToolbarControl1
        '
        Me.AxToolbarControl1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.AxToolbarControl1.Location = New System.Drawing.Point(158, 38)
        Me.AxToolbarControl1.Name = "AxToolbarControl1"
        Me.AxToolbarControl1.OcxState = CType(resources.GetObject("AxToolbarControl1.OcxState"), System.Windows.Forms.AxHost.State)
        Me.AxToolbarControl1.Size = New System.Drawing.Size(669, 28)
        Me.AxToolbarControl1.TabIndex = 9
        '
        'AxToolbarControl2
        '
        Me.AxToolbarControl2.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.AxToolbarControl2.Location = New System.Drawing.Point(158, 3)
        Me.AxToolbarControl2.Name = "AxToolbarControl2"
        Me.AxToolbarControl2.OcxState = CType(resources.GetObject("AxToolbarControl2.OcxState"), System.Windows.Forms.AxHost.State)
        Me.AxToolbarControl2.Size = New System.Drawing.Size(669, 28)
        Me.AxToolbarControl2.TabIndex = 10
        '
        'AxTOCControl1
        '
        Me.AxTOCControl1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
        Me.AxTOCControl1.Location = New System.Drawing.Point(3, 71)
        Me.AxTOCControl1.Name = "AxTOCControl1"
        Me.AxTOCControl1.OcxState = CType(resources.GetObject("AxTOCControl1.OcxState"), System.Windows.Forms.AxHost.State)
        Me.AxTOCControl1.Size = New System.Drawing.Size(147, 476)
        Me.AxTOCControl1.TabIndex = 11
        '
        'AxMapControl1
        '
        Me.AxMapControl1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.AxMapControl1.Location = New System.Drawing.Point(158, 71)
        Me.AxMapControl1.Name = "AxMapControl1"
        Me.AxMapControl1.OcxState = CType(resources.GetObject("AxMapControl1.OcxState"), System.Windows.Forms.AxHost.State)
        Me.AxMapControl1.Size = New System.Drawing.Size(669, 476)
        Me.AxMapControl1.TabIndex = 12
        '
        'AxLicenseControl1
        '
        Me.AxLicenseControl1.Enabled = True
        Me.AxLicenseControl1.Location = New System.Drawing.Point(3, 3)
        Me.AxLicenseControl1.Name = "AxLicenseControl1"
        Me.AxLicenseControl1.OcxState = CType(resources.GetObject("AxLicenseControl1.OcxState"), System.Windows.Forms.AxHost.State)
        Me.AxLicenseControl1.Size = New System.Drawing.Size(32, 32)
        Me.AxLicenseControl1.TabIndex = 13
        '
        'TableLayoutPanel1
        '
        Me.TableLayoutPanel1.ColumnCount = 3
        Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 18.7247!))
        Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 81.27531!))
        Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 98.0!))
        Me.TableLayoutPanel1.Controls.Add(Me.AxLicenseControl1, 0, 0)
        Me.TableLayoutPanel1.Controls.Add(Me.AxMapControl1, 1, 2)
        Me.TableLayoutPanel1.Controls.Add(Me.AxTOCControl1, 0, 2)
        Me.TableLayoutPanel1.Controls.Add(Me.btnOptions2, 2, 1)
        Me.TableLayoutPanel1.Controls.Add(Me.AxToolbarControl1, 1, 1)
        Me.TableLayoutPanel1.Controls.Add(Me.btnOptions1, 2, 0)
        Me.TableLayoutPanel1.Controls.Add(Me.AxToolbarControl2, 1, 0)
        Me.TableLayoutPanel1.Location = New System.Drawing.Point(3, 2)
        Me.TableLayoutPanel1.Name = "TableLayoutPanel1"
        Me.TableLayoutPanel1.RowCount = 3
        Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 51.69492!))
        Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 48.30508!))
        Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 481.0!))
        Me.TableLayoutPanel1.Size = New System.Drawing.Size(929, 550)
        Me.TableLayoutPanel1.TabIndex = 14
        '
        'FeatureEditing
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(1130, 641)
        Me.Controls.Add(Me.TableLayoutPanel1)
        Me.KeyPreview = True
        Me.Name = "FeatureEditing"
        Me.Text = "Feature Editing"
        CType(Me.AxToolbarControl1, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.AxToolbarControl2, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.AxTOCControl1, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.AxMapControl1, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.AxLicenseControl1, System.ComponentModel.ISupportInitialize).EndInit()
        Me.TableLayoutPanel1.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        'Set buddy controls
        AxTOCControl1.SetBuddyControl(AxMapControl1)
        AxToolbarControl1.SetBuddyControl(AxMapControl1)
        AxToolbarControl2.SetBuddyControl(AxMapControl1)

        'Share command pools
        m_CommandPool = New CommandPoolClass
        AxToolbarControl1.CommandPool = m_CommandPool
        AxToolbarControl2.CommandPool = m_CommandPool

        'Add items to the ToolbarControl
        AxToolbarControl1.AddItem("esriControls.ControlsEditingEditorMenu", 0, -1, False, 0, esriCommandStyles.esriCommandStyleIconOnly)
        AxToolbarControl1.AddItem("esriControls.ControlsEditingEditTool", 0, -1, False, 0, esriCommandStyles.esriCommandStyleIconOnly)
        AxToolbarControl1.AddItem("esriControls.ControlsEditingSketchTool", 0, -1, False, 0, esriCommandStyles.esriCommandStyleIconOnly)
        AxToolbarControl1.AddItem("esriControls.ControlsUndoCommand", 0, -1, True, 0, esriCommandStyles.esriCommandStyleIconOnly)
        AxToolbarControl1.AddItem("esriControls.ControlsRedoCommand", 0, -1, False, 0, esriCommandStyles.esriCommandStyleIconOnly)
        AxToolbarControl1.AddItem("esriControls.ControlsEditingTargetToolControl", 0, -1, True, 0, esriCommandStyles.esriCommandStyleIconOnly)
        AxToolbarControl1.AddItem("esriControls.ControlsEditingTaskToolControl", 0, -1, True, 0, esriCommandStyles.esriCommandStyleIconOnly)
        AxToolbarControl1.AddItem("esriControls.ControlsEditingAttributeCommand", 0, -1, False, 0, esriCommandStyles.esriCommandStyleIconOnly)
        AxToolbarControl1.AddItem("esriControls.ControlsEditingSketchPropertiesCommand", 0, -1, False, 0, esriCommandStyles.esriCommandStyleIconOnly)
        AxToolbarControl1.AddItem("esriControls.ControlsEditingCutCommand", 0, -1, True, 0, esriCommandStyles.esriCommandStyleIconOnly)
        AxToolbarControl1.AddItem("esriControls.ControlsEditingPasteCommand", 0, -1, False, 0, esriCommandStyles.esriCommandStyleIconOnly)
        AxToolbarControl1.AddItem("esriControls.ControlsEditingCopyCommand", 0, -1, False, 0, esriCommandStyles.esriCommandStyleIconOnly)
        AxToolbarControl1.AddItem("esriControls.ControlsEditingClearCommand", 0, -1, False, 0, esriCommandStyles.esriCommandStyleIconOnly)

        AxToolbarControl2.AddItem("esriControls.ControlsOpenDocCommand", 0, -1, False, 0, esriCommandStyles.esriCommandStyleIconOnly)
        AxToolbarControl2.AddItem("esriControls.ControlsAddDataCommand", 0, -1, False, 0, esriCommandStyles.esriCommandStyleIconOnly)
        AxToolbarControl2.AddItem("esriControls.ControlsSaveAsDocCommand", 0, -1, False, 0, esriCommandStyles.esriCommandStyleIconOnly)
        AxToolbarControl2.AddItem("esriControls.ControlsMapZoomInTool", 0, -1, True, 0, esriCommandStyles.esriCommandStyleIconOnly)
        AxToolbarControl2.AddItem("esriControls.ControlsMapZoomOutTool", 0, -1, False, 0, esriCommandStyles.esriCommandStyleIconOnly)
        AxToolbarControl2.AddItem("esriControls.ControlsMapPanTool", 0, -1, False, 0, esriCommandStyles.esriCommandStyleIconOnly)
        AxToolbarControl2.AddItem("esriControls.ControlsMapFullExtentCommand", 0, -1, False, 0, esriCommandStyles.esriCommandStyleIconOnly)
        AxToolbarControl2.AddItem("esriControls.ControlsMapZoomToLastExtentBackCommand", 0, -1, False, 0, esriCommandStyles.esriCommandStyleIconOnly)
        AxToolbarControl2.AddItem("esriControls.ControlsMapZoomToLastExtentForwardCommand", 0, -1, False, 0, esriCommandStyles.esriCommandStyleIconOnly)
        AxToolbarControl2.AddItem("esriControls.ControlsFullScreenCommand", 0, -1, True, 0, esriCommandStyles.esriCommandStyleIconOnly)
        AxToolbarControl2.AddItem("esriControls.ControlsMapIdentifyTool", 0, -1, False, 0, esriCommandStyles.esriCommandStyleIconOnly)

        'Create popup menus
        m_toolbarMenuSketch = New ToolbarMenuClass
        m_toolbarMenuVertex = New ToolbarMenuClass
        m_toolbarMenuSketch.AddItem("esriControls.ControlsEditingSketchContextMenu", 0, 0, False, esriCommandStyles.esriCommandStyleTextOnly)
        m_toolbarMenuVertex.AddItem("esriControls.ControlsEditingVertexContextMenu", 0, 0, False, esriCommandStyles.esriCommandStyleTextOnly)

        'Create an operation stack for the undo and redo commands to use
        Dim operationStack As IOperationStack
        operationStack = New ControlsOperationStackClass
        AxToolbarControl1.OperationStack = operationStack
        AxToolbarControl2.OperationStack = operationStack

        'Instantiate the EngineEditor singleton
        m_engineEditor = New EngineEditor()

        'Create each command on the ToolbarMenu so that the Accelerator Keys are recognized. Alternatively
        'the user must popup the menu before using the Accelerator Keys
        Dim itemCount As Integer
        itemCount = m_toolbarMenuSketch.CommandPool.Count
        Dim i As Integer
        For i = 0 To itemCount - 1
            Dim pCommand As ICommand
            pCommand = CType(m_toolbarMenuSketch.CommandPool.Command(i), ICommand)
            pCommand.OnCreate(AxMapControl1.Object)
        Next

        'Share CommandPool with the ToolbarMenu
        m_toolbarMenuSketch.CommandPool = m_CommandPool
        m_toolbarMenuVertex.CommandPool = m_CommandPool

    End Sub

    Private Sub AxMapControl1_OnMouseDown(ByVal sender As System.Object, ByVal e As ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseDownEvent) Handles AxMapControl1.OnMouseDown
        If (e.button = 2) Then

            'Logic to determine which popup menu to show based on the current task and current tool
            Dim currentTask As IEngineEditTask = m_engineEditor.CurrentTask

            Select Case currentTask.UniqueName

                Case "ControlToolsEditing_CreateNewFeatureTask"

                    If (CType(AxToolbarControl1.CurrentTool, ICommand)).Name = "ControlToolsEditing_Sketch" Then

                        m_toolbarMenuSketch.PopupMenu(e.x, e.y, AxMapControl1.hWnd)

                    ElseIf (CType(AxToolbarControl1.CurrentTool, ICommand)).Name = "ControlToolsEditing_Edit" Then

                        'SetEditLocation method must be called to enable commands
                        CType(m_engineEditor, IEngineEditSketch).SetEditLocation(e.x, e.y)
                        m_toolbarMenuVertex.PopupMenu(e.x, e.y, AxMapControl1.hWnd)

                    End If

                Case "ControlToolsEditing_ModifyFeatureTask"

                    'SetEditLocation method must be called to enable commands
                    CType(m_engineEditor, IEngineEditSketch).SetEditLocation(e.x, e.y)
                    m_toolbarMenuVertex.PopupMenu(e.x, e.y, AxMapControl1.hWnd)

            End Select

        End If
    End Sub

    Private Sub btnOptions1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOptions1.Click
        'Disable this window
        Me.Enabled = False
        Dim editOptions1 As New EditProperties

        'Show the options1 dialog
        editOptions1.ShowDialog()

        'Enable this window
        Me.Enabled = True
    End Sub

    Private Sub btnOptions2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOptions2.Click
        'Disable this window
        Me.Enabled = False

        Dim editOptions2 As New EditProperties2

        'Show the options2 dialog
        editOptions2.ShowDialog()

        'Enable this window
        Me.Enabled = True
    End Sub

    Private Sub FeatureEditing_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown

        Dim pPool2 As ICommandPool2
        pPool2 = CType(m_toolbarMenuSketch.CommandPool, ICommandPool2)
        Try
            pPool2.TranslateAcceleratorKey(e.KeyCode)
        Catch
        End Try

    End Sub

End Class


text:
package com.bluemountain;

import com.aphyr.riemann.Proto;
import com.aphyr.riemann.Proto.Event;
import com.aphyr.riemann.Proto.Event.Builder;
import com.aphyr.riemann.client.RiemannClient;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.lang.management.MemoryUsage;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.util.*;
import java.util.Map.Entry;
import org.apache.cassandra.concurrent.JMXEnabledThreadPoolExecutorMBean;
import org.apache.cassandra.db.ColumnFamilyStoreMBean;
import org.apache.cassandra.db.compaction.CompactionManagerMBean;
import org.apache.cassandra.net.MessagingServiceMBean;
import org.apache.cassandra.tools.NodeProbe;
import org.apache.cassandra.utils.FBUtilities;
import org.apache.commons.cli.BasicParser;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;

/**
 * Monitoring client that polls Cassandra MBeans for metrics and streams them to
 * riemann as events
 *
 * @author jluciani
 *
 */
public class RiemannCassandraClient
{
    private static Options options = null;
    final RiemannClient riemannClient;

    static
    {
        options = new Options();

        options.addOption("riemann_host", true, "hostname for riemann server");
        options.addOption("riemann_port", true, "port number for riemann server");
        options.addOption("cassandra_host", true, "hostname for cassandra node");
        options.addOption("jmx_port", true, "port number for jmx on cassandra node");
        options.addOption("jmx_username", true, "username for cassandra jmx agent");
        options.addOption("jmx_password", true, "password cassandra jmx agent");
        options.addOption("interval_seconds", true, "number of seconds between updates");
    }

    volatile NodeProbe jmxClient = null;
    final String cassandraHost;
    final Integer cassandraJmxPort;
    final String jmxUsername;
    final String jmxPassword;
    final Proto.Event protoEvent;

    public RiemannCassandraClient(String riemannHost, Integer riemannPort, String cassandraHost, Integer cassandraJmxPort, String jmxUsername, String jmxPassword)
    {
        this.cassandraHost = cassandraHost;
        this.cassandraJmxPort = cassandraJmxPort;
        this.jmxUsername = jmxUsername;
        this.jmxPassword = jmxPassword;

        this.protoEvent = Proto.Event.newBuilder().setHost(pickBestHostname(cassandraHost)).addTags("cassandra").setState("ok").setTtl(5.0F).build();

        this.riemannClient = new RiemannClient(new InetSocketAddress(riemannHost, riemannPort.intValue()));
        if (!reconnectJMX()) {
            System.err.println(String.format("Unable to connect to Cassandra JMX (%s:%d) will continue to try silently....", new Object[] { cassandraHost, cassandraJmxPort }));
        }
    }

    private String pickBestHostname(String cassandraHost)
    {
        try
        {
            InetAddress cassandraAddr = InetAddress.getByName(cassandraHost);
            if (!cassandraAddr.isLoopbackAddress()) {
                return cassandraAddr.getCanonicalHostName();
            }
            //Pick first non local ip with a hostname
            Enumeration<NetworkInterface> nets = NetworkInterface.getNetworkInterfaces();
            for (NetworkInterface netint : Collections.list(nets))
            {
                Enumeration<InetAddress> inetAddresses = netint.getInetAddresses();
                for (InetAddress inetAddress : Collections.list(inetAddresses)) {
                    if ((!inetAddress.isLoopbackAddress()) && ((inetAddress instanceof Inet4Address))) {
                        return inetAddress.getCanonicalHostName();
                    }
                }
            }
        }
        catch (UnknownHostException e)
        {
            throw new RuntimeException("Unknown host", e);
        }
        catch (SocketException e)
        {
            throw new RuntimeException("Error getting network info", e);
        }
        return cassandraHost;
    }

    private synchronized boolean reconnectJMX()
    {
        try
        {
            if (this.jmxUsername == null) {
                this.jmxClient = new NodeProbe(this.cassandraHost, this.cassandraJmxPort.intValue());
            } else {
                this.jmxClient = new NodeProbe(this.cassandraHost, this.cassandraJmxPort.intValue(), this.jmxUsername, this.jmxPassword);
            }
            return true;
        }
        catch (Exception e)
        {
            // We silently continue
            this.jmxClient = null;
        }
        return false;
    }

    private void add(List<Proto.Event> events, String name, float val)
    {
        events.add(Proto.Event.newBuilder(this.protoEvent).setService(name).setMetricF(val).build());
    }

    private void add(List<Proto.Event> events, String name, float val, String desc)
    {
        events.add(Proto.Event.newBuilder(this.protoEvent).setService(name).setMetricF(val).setDescription(desc).build());
    }

    private long emitColumnFamilyMetrics()
    {
        List<Proto.Event> events = new ArrayList();

        Iterator<Map.Entry<String, ColumnFamilyStoreMBean>> it = this.jmxClient.getColumnFamilyStoreMBeanProxies();

        // CF metrics
        long totalBytes = 0L;
        while (it.hasNext())
        {
            Map.Entry<String, ColumnFamilyStoreMBean> e = (Map.Entry)it.next();

            String name = "cassandra.db." + (String)e.getKey() + "." + ((ColumnFamilyStoreMBean)e.getValue()).getColumnFamilyName();
            ColumnFamilyStoreMBean v = (ColumnFamilyStoreMBean)e.getValue();

            add(events, name + ".keys", (float)(v.estimateKeys() / 1000L));
            add(events, name + ".total_sstable_mb", (float)(v.getLiveDiskSpaceUsed() / 1048576L));
            add(events, name + ".total_bloom_mb", (float)(v.getBloomFilterDiskSpaceUsed() / 1048576L));
            add(events, name + ".bloom_fp_rate", (float)v.getRecentBloomFilterFalseRatio());
            add(events, name + ".max_row_size_kb", (float)(v.getMaxRowSize() / 1024L));
            add(events, name + ".min_row_size_kb", (float)(v.getMinRowSize() / 1024L));
            add(events, name + ".mean_row_size_kb", (float)(v.getMeanRowSize() / 1024L));
            add(events, name + ".sstable_count", v.getLiveSSTableCount());
            add(events, name + ".memtable_size_mb", (float)v.getMemtableDataSize() / 1048576.0F);

            // latencies can return NaN
            Float f = Float.valueOf((float)v.getRecentReadLatencyMicros());
            add(events, name + ".read_latency", f.equals(Float.NaN) ? 0.0F : f.floatValue());

            f = Float.valueOf((float)((ColumnFamilyStoreMBean)e.getValue()).getRecentWriteLatencyMicros());
            add(events, name + ".write_latency", f.equals(Float.NaN) ? 0.0F : f.floatValue());

            totalBytes += ((ColumnFamilyStoreMBean)e.getValue()).getLiveDiskSpaceUsed();

            this.riemannClient.sendEvents((Proto.Event[])events.toArray(new Proto.Event[0]));
            events.clear();
        }
        return totalBytes;
    }

    private void emitThreadPoolMetrics()
    {
        List<Proto.Event> events = new ArrayList();

        Iterator<Map.Entry<String, JMXEnabledThreadPoolExecutorMBean>> it = this.jmxClient.getThreadPoolMBeanProxies();
        while (it.hasNext())
        {
            Map.Entry<String, JMXEnabledThreadPoolExecutorMBean> p = (Map.Entry)it.next();

            String name = "cassandra.tp." + (String)p.getKey();
            JMXEnabledThreadPoolExecutorMBean v = (JMXEnabledThreadPoolExecutorMBean)p.getValue();

            add(events, name + ".completed", (float)v.getCompletedTasks());
            add(events, name + ".active", v.getActiveCount());
            add(events, name + ".pending", (float)v.getPendingTasks());
            add(events, name + ".blocked", v.getCurrentlyBlockedTasks());

            this.riemannClient.sendEvents((Proto.Event[])events.toArray(new Proto.Event[0]));
            events.clear();
        }
    }

    private void emitDroppedMessagesMetrics() {
        List<Event> events = new ArrayList<Event>();
        Map<String, Integer> dropped = jmxClient.getDroppedMessages();
        for (Map.Entry<String, Integer> me: dropped.entrySet()) {
            add(events, "org.apache.cassandra.metrics.dropped."+me.getKey(), (float) me.getValue());
        }
        riemannClient.sendEvents(events.toArray(new Event[] {}));
        events.clear();
    }

    private void emitMetrics()
    {
        if ((this.jmxClient == null) && (!reconnectJMX())) {
            return;
        }
        try
        {
            // TP Metrics
            emitThreadPoolMetrics();

            // CF Metrics
            long totalSSTableBytes = emitColumnFamilyMetrics();

            // Dropped messages metrics
            emitDroppedMessagesMetrics();

            // Basic metrics
            List<Proto.Event> events = new ArrayList();

            add(events, "cassandra.exception_count", this.jmxClient.getExceptionCount());
            add(events, "cassandra.heap_used_mb", (float)(this.jmxClient.getHeapMemoryUsage().getUsed() / 1048576L));
            add(events, "cassandra.heap_max_mb", (float)(this.jmxClient.getHeapMemoryUsage().getMax() / 1048576L));
            add(events, "cassandra.heap_committed_mb", (float)(this.jmxClient.getHeapMemoryUsage().getCommitted() / 1048576L));
            add(events, "cassandra.recent_timeouts", (float)this.jmxClient.msProxy.getRecentTotalTimouts(), FBUtilities.json(this.jmxClient.msProxy.getRecentTimeoutsPerHost()));
            add(events, "cassandra.pending_compactions", this.jmxClient.getCompactionManagerProxy().getPendingTasks());
            add(events, "cassandra.total_sstable_mb", (float)(totalSSTableBytes / 1048576L));

            this.riemannClient.sendEvents((Proto.Event[])events.toArray(new Proto.Event[0]));
        }
        catch (Exception t)
        {
            // Try again later
            this.jmxClient = null;
            t.printStackTrace();
        }
    }

    public static void printUsage()
    {
        PrintWriter writer = new PrintWriter(System.out);
        HelpFormatter usageFormatter = new HelpFormatter();
        usageFormatter.printUsage(writer, 80, "riemann-cassandra", options);
        writer.close();
    }

    public static void main(String[] args)
    {
        BasicParser parser = new BasicParser();
        CommandLine cl = null;
        try
        {
            cl = parser.parse(options, args);
        }
        catch (ParseException e)
        {
            printUsage();
            System.exit(1);
        }
        // Extracted options
        String cassandraHost = cl.getOptionValue("cassandra_host", "localhost");
        String riemannHost = cl.getOptionValue("riemann_host", "localhost");
        String jmxUsername = cl.getOptionValue("jmx_username");
        String jmxPassword = cl.getOptionValue("jmx_password");
        Integer jmxPort = Integer.valueOf(cl.getOptionValue("jmx_port", "7199"));
        Integer riemannPort = Integer.valueOf(cl.getOptionValue("riemann_port", "5555"));
        Integer intervalSeconds = Integer.valueOf(cl.getOptionValue("interval_seconds", "5"));

        RiemannCassandraClient cli = new RiemannCassandraClient(riemannHost, riemannPort, cassandraHost, jmxPort, jmxUsername, jmxPassword);
        for (;;)
        {
            cli.emitMetrics();
            try
            {
                Thread.sleep(intervalSeconds.intValue() * 1000);
            }
            catch (InterruptedException e) {}
        }
    }
}


text:
package net_server

import (
	"github.com/viphxin/xingo/fnet"
	"github.com/golang/protobuf/proto"
	"fmt"
	"xingo_cluster/pb"
	"github.com/viphxin/xingo/logger"
	"github.com/viphxin/xingo/clusterserver"
	"math/rand"
)

type TestNetApi2 struct {

}

func (this *TestNetApi2)Api_0(request *fnet.PkgAll){
	msg := &pb.Talk{}
	err := proto.Unmarshal(request.Pdata.Data, msg)
	if err == nil {
		logger.Debug(fmt.Sprintf("user talk: content: %s.", msg.Content))
		pid, err1 := request.Fconn.GetProperty("pid")
		if err1 == nil{
			//转发到game
			onegame := clusterserver.GlobalClusterServer.ChildsMgr.GetRandomChild("game")

			if onegame != nil{
				logger.Debug("chose root: " + onegame.GetName())
				onegame.CallChildNotForResult("Proxy2Game", pid.(int32), msg.Content)
			}
		}else{
			logger.Error(err1)
			request.Fconn.LostConnection()
		}

	} else {
		logger.Error(err)
		request.Fconn.LostConnection()
	}
}

func (this *TestNetApi2)Api_10(request *fnet.PkgAll){
	//test rpc for result
	//转发到gate
	onegame := clusterserver.GlobalClusterServer.ChildsMgr.GetRandomChild("game")

	if onegame != nil{
		logger.Debug("chose child: " + onegame.GetName())
		i := rand.Intn(10)
		ii := rand.Intn(10)
		response, err := onegame.CallChildForResult("Add", i, ii)
		if err == nil{
			pid, _ := request.Fconn.GetProperty("pid")
			p := GlobalPlayerMgr.GetPlayer(pid.(int32))
			if p != nil{
				msg := &pb.BroadCast{
					Pid : pid.(int32),
					Tp: 1,
					Data: &pb.BroadCast_Content{
						Content: fmt.Sprintf("%d + %d = %d", i, ii, response.Result["sum"].(int)),
					},
				}
				p.SendMsg(10, msg)
			}
		}else{
			logger.Error(err)
		}
	}
}

func (this *TestNetApi2)Api_11(request *fnet.PkgAll){
	//test rpc for result
	//转发到gate
	onegame := clusterserver.GlobalClusterServer.ChildsMgr.GetRandomChild("game")

	if onegame != nil{
		pid, _ := request.Fconn.GetProperty("pid")
		onegame.CallChildNotForResult("GetGSTime", pid)

	}
}