text:
from pytest_bdd import given, scenario, then, when

@scenario('../user.feature', 'An unknown user starts Smart Containers')
def test_an_unknown_user_starts_smart_containers():
    """An unknown user starts Smart Containers."""

@given('an unknown user')
def an_unknown_user():
    """an unknown user."""

@when('it is given to smart containers on start')
def it_is_given_to_smart_containers_on_start():
    """it is given to smart containers on start."""

@then('it should create an RDF graph')
def it_should_create_an_rdf_graph():
    """it should create an RDF graph."""

@then('it should contain a blank node for the unknown user')
def it_should_contain_a_blank_node_for_the_unknown_user():
    """it should contain a blank node for the unknown user."""

@then('it should contain a has account node containing the username and hostname')
def it_should_contain_a_has_account_node_containing_the_username_and_hostname():
    """it should contain a has account node containing the username and hostname."""


text:
<?php

namespace Elcodi\Component\Shipping\Wrapper;

use Elcodi\Component\Cart\Entity\Interfaces\CartInterface;
use Elcodi\Component\Shipping\Entity\ShippingMethod;
use Elcodi\Component\Shipping\EventDispatcher\ShippingEventDispatcher;

/**
 * Class ShippingWrapper.
 */
class ShippingWrapper
{
    /**
     * @var ShippingEventDispatcher
     *
     * Shipping event dispatcher
     */
    private $shippingEventDispatcher;

    /**
     * Construct.
     *
     * @param ShippingEventDispatcher $shippingEventDispatcher Shipping event dispatcher
     */
    public function __construct(ShippingEventDispatcher $shippingEventDispatcher)
    {
        $this->shippingEventDispatcher = $shippingEventDispatcher;
    }

    /**
     * Get loaded shipping methods given a cart.
     *
     * @param CartInterface $cart Cart
     *
     * @return ShippingMethod[] Shipping methods
     */
    public function get(CartInterface $cart)
    {
        return $this
            ->shippingEventDispatcher
            ->dispatchShippingCollectionEvent($cart);
    }

    /**
     * Get loaded shipping method given its id.
     *
     * @param CartInterface $cart             Cart
     * @param string        $shippingMethodId Shipping method id
     *
     * @return ShippingMethod|null Required shipping method
     */
    public function getOneById(CartInterface $cart, $shippingMethodId)
    {
        $shippingMethods = $this->get($cart);

        return array_reduce(
            $shippingMethods,
            function (
                $foundShippingMethod,
                ShippingMethod $shippingMethod
            ) use ($shippingMethodId) {

                return ($shippingMethodId === $shippingMethod->getId())
                    ? $shippingMethod
                    : $foundShippingMethod;
            },
            null
        );
    }

    /**
     * Clean loaded object in order to reload it again.
     *
     * @return $this Self object
     */
    public function clean()
    {
        return $this;
    }
}

redpajama_set_name: RedPajamaGithub


text:
namespace DrawingApplication
{
    partial class FillProps
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.SuspendLayout();
            //
            // FillProps
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(222, 138);
            this.DockAreas = ((DigitalRune.Windows.Docking.DockAreas)((((((DigitalRune.Windows.Docking.DockAreas.Float | DigitalRune.Windows.Docking.DockAreas.Left)
            | DigitalRune.Windows.Docking.DockAreas.Right)
            | DigitalRune.Windows.Docking.DockAreas.Top)
            | DigitalRune.Windows.Docking.DockAreas.Bottom)
            | DigitalRune.Windows.Docking.DockAreas.Document)));
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
            this.Name = "FillProps";
            this.TabText = "FillProps";
            this.Text = "FillProps";
            this.ResumeLayout(false);

        }

        #endregion

    }
}


text:
package ViewLayer.Screens.MainMenuScr;

import ControlLayer.SharedResources;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;

/**
 * Acts as the main menu/first screen of the application, which offers options for the user to choose from.
 * It is an extended JPanel. Contains the options as buttons within an another JPanel.
 */
public class MainMenuScreen extends JPanel implements ActionListener
{

    /**
     * The background image for the screen.
     */
    private final Image _BackgroundImg;
    /**
     * Panel containing the menu buttons.
     */
    private JPanel _MenuOptionsContainer;
    /**
     * List of menu buttons
     */
    private ArrayList<JButton> _MenuButtons;

    /**
     * Acts as the main menu/first screen of the application, which offers options for the user to choose from.
     * It is an extended JPanel. Contains the options as buttons within an another JPanel.
     *
     * @param backGround The background image for the screen.
     */
    public MainMenuScreen(Image backGround)
    {
        _BackgroundImg = backGround;
        this.setLayout(null);

        InstantiateMenuButtons();
        AddMenuOptionsToJpanelContainer();
        this.add(_MenuOptionsContainer);

        this.setVisible(true);
    }

    /**
     * Draws the background and the components.
     * @param g The palette to be used to drawing to.
     */
    protected void  paintComponent(Graphics g)
    {
        super.paintComponent(g);
        try
        {
            g.drawImage(_BackgroundImg,0,0,this);
        } catch (Exception e)
        {
            e.printStackTrace();
        }
    }

    /**
     * Instantiating the JPanel which contains the buttons for the menu
     */
    private void AddMenuOptionsToJpanelContainer()
    {
        _MenuOptionsContainer = new JPanel();
        _MenuOptionsContainer.setBounds(GetMainMenuLocation());

        _MenuOptionsContainer.setLayout(null); //No layout manager
        _MenuButtons.stream().forEach(i -> _MenuOptionsContainer.add(i)); //Add each button to the panel
        _MenuOptionsContainer.setVisible(true);
    }

    /**
     * Returns the size and location of the menu containing the buttons. It will be centered to the screen.
     * @return A rectangle representing the size and location of the JPanel which contains the menu buttons.
     */
    private Rectangle GetMainMenuLocation()
    {
        int x = (SharedResources.MW_JFRAME_WIDTH - SharedResources.MMS_Menu_Width) / 2;
        int y = (SharedResources.MW_JFRAME_HEIGHT - SharedResources.MMS_Menu_Height) /2;

        return new Rectangle(x,y,SharedResources.MMS_Menu_Width, SharedResources.MMS_Menu_Height);
    }

    /**
     * Instantiates the buttons used in the menu.
     */
    private void InstantiateMenuButtons()
    {
        //Instantiating buttons
        _MenuButtons = new ArrayList<>();
        _MenuButtons.add(new JButton(SharedResources.MMS_Menu_SinglePlayer));
        _MenuButtons.add(new JButton(SharedResources.MMS_Menu_SideBySide));
        _MenuButtons.add(new JButton(SharedResources.MMS_Menu_Exit));

        //Setting the size of each buttons
        _MenuButtons.stream().forEach(i -> i.setSize(new Dimension(SharedResources.MMS_Menu_Width,SharedResources.MMS_Menu_Option_Height)));

        //Set the location of each buttons (vertical alignment)
        for(int i = 1; i<_MenuButtons.size(); i++)
        {
            _MenuButtons.get(i).setLocation(0,i*SharedResources.MMS_Menu_Option_Height);
        }

        //Set the style of each buttons
        _MenuButtons.stream().forEach(i ->
        {
            i.setBackground(SharedResources.MMS_Button_BackGround_Color);
            i.setFont(SharedResources.MMS_Button_Font);
        });

        //Add event listener for the buttons
        _MenuButtons.stream().forEach(i -> i.addActionListener(this));
    }

    /**
     * Listening for menu button clicks and inform the controller about user intention.
     * @param e The ActionEvent.
     */
    @Override
    public void actionPerformed(ActionEvent e)
    {
        //If the first, second, or fourth button raised the event
        if (e.getSource().equals(_MenuButtons.get(0)) || e.getSource().equals(_MenuButtons.get(1)) || e.getSource().equals(_MenuButtons.get(2)))
        {
            //Casting to button
            JButton temp = (JButton)e.getSource();

            //Select the action based on button's text
            switch (temp.getText())
            {
                case SharedResources.MMS_Menu_SinglePlayer:
                    SharedResources.MainController.UserInitiatesSinglePlayerGame();
                    break;
                case SharedResources.MMS_Menu_SideBySide:
                    SharedResources.MainController.UserInitiatesSideBySideGame();
                    break;
                case SharedResources.MMS_Menu_Exit:
                    SharedResources.MainController.UserInitiatesExit();
                    break;
            }
        }
    }
}


text:
import clr

clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import Geometry

elem, loc, margin = IN

pts = zip(elem, loc)
dist1 = Geometry.DistanceTo
Groups, Queue = [], []
while pts:
	group = []
	Queue.append(pts.pop() )
	while Queue:
		p1 = Queue.pop()
		group.append(p1)
		for i in xrange(len(pts)-1,-1,-1):
			if dist1(p1[1], pts[i][1]) <= margin:
				Queue.append(pts.pop(i) )
	Groups.append(group)

elem1 = [ [j[0] for j in i] for i in Groups]
pts1 = [ [j[1] for j in i] for i in Groups]
OUT = elem1, pts1


text:
package command_test

import (
	"bytes"
	"text/template"

	. "code.cloudfoundry.org/cli/command"
	"code.cloudfoundry.org/cli/util/ui"

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

var _ = Describe("Translatable Errors", func() {
	translateFunc := func(s string, vars ...interface{}) string {
		formattedTemplate, err := template.New("test template").Parse(s)
		Expect(err).ToNot(HaveOccurred())
		formattedTemplate.Option("missingkey=error")

		var buffer bytes.Buffer
		err = formattedTemplate.Execute(&buffer, vars[0])
		Expect(err).ToNot(HaveOccurred())

		return buffer.String()
	}

	DescribeTable("translates error",
		func(e error) {
			err, ok := e.(ui.TranslatableError)
			Expect(ok).To(BeTrue())
			err.Translate(translateFunc)
		},

		// Command prerequisite errors.
		Entry("NoAPISetError", NoAPISetError{}),
		Entry("NoTargetedOrganizationError", NoTargetedOrganizationError{}),
		Entry("NoTargetedSpaceError", NoTargetedSpaceError{}),
		Entry("NotLoggedInError", NotLoggedInError{}),

		// UAA errors.
		Entry("BadCredentialsError", BadCredentialsError{}),

		// Cloud Controller errors.
		Entry("APIRequestError", APIRequestError{}),
		Entry("InvalidSSLCertError", InvalidSSLCertError{}),
		Entry("SSLCertErrorError", SSLCertErrorError{}),
		Entry("APINotFoundError", APINotFoundError{}),

		// Actor errors.
		Entry("ApplicationNotFoundError", ApplicationNotFoundError{}),
		Entry("ServiceInstanceNotFoundError", ServiceInstanceNotFoundError{}),

		// Parse errors.
		Entry("ParseArgumentError", ParseArgumentError{}),
		Entry("RequiredArgumentError", RequiredArgumentError{}),
		Entry("ThreeRequiredArgumentsError", ThreeRequiredArgumentsError{}),

		// Version errors.
		Entry("MinimumAPIVersionNotMetError", MinimumAPIVersionNotMetError{}),
		Entry("HealthCheckTypeUnsupportedError", HealthCheckTypeUnsupportedError{
			SupportedTypes: []string{"some-type", "another-type"},
		}),

		// URL scheme errors.
		Entry("UnsupportedURLSchemeError", UnsupportedURLSchemeError{}),
	)
})


text:
package com.mobileman.moments.core.services.esb;

public interface MomentsESBConstants {

	public static final String ENTITY_CREATED_CHANNEL ="entityCreatedChannel";
	public static final String ENTITY_DELETED_CHANNEL ="entityDeletedChannel";

	public static final String QUESTION_CREATED_CHANNEL ="questionCreatedChannel";
	public static final String QUESTION_DELETED_CHANNEL ="questionDeletedChannel";

	public static final String GCM_CHANNEL ="gcmChannel";
}


text:
package net.study.config;

import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
import org.springframework.boot.context.embedded.ErrorPage;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpStatus;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
public class MvcConfig extends WebMvcConfigurerAdapter {

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        //registry.addViewController("/home").setViewName("home");
        registry.addViewController("/").setViewName("home");
        registry.addViewController("/index").setViewName("index");
    }

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        super.addResourceHandlers(registry);
        registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
    }

    @Bean
    public EmbeddedServletContainerCustomizer containerCustomizer() {

        return (container -> {
            ErrorPage error401Page = new ErrorPage(HttpStatus.UNAUTHORIZED, "/401");
            ErrorPage error404Page = new ErrorPage(HttpStatus.NOT_FOUND, "/404");
            ErrorPage error500Page = new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/500");

            container.addErrorPages(error401Page, error404Page, error500Page);
        });
    }
}


text:
using System;
using Dibware.EventDispatcher.Core.Contracts;
using Dibware.EventDispatcher.Core.Tests.Fakes.Events;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Dibware.EventDispatcher.Core.Tests.Tests
{
    [TestClass]
    public class ApplicationEventDispatcherTests
    {
        [TestMethod]
        public void GivenAnEventToDispatch_WhenAHandlerIsNotAttached_DoesNotThrowAnException()
        {
            // ARRANGE
            var dispatcher = new ApplicationEventDispatcher();

            // ACT
            dispatcher.Dispatch(new SimpleEvent1());
            dispatcher.Dispose();

            // ASSERT
        }

        [TestMethod]
        public void GivenAnEventToDispatch_WhenAHandlerIsAttached_CallsHandler()
        {
            // ARRANGE
            bool handlerCalled = false;
            ApplicationEventHandlerDelegate<SimpleEvent1> @delegate =
                delegate {
                    handlerCalled = true;
                };
            var dispatcher = new ApplicationEventDispatcher();
            dispatcher.AddListener(@delegate);

            // ACT
            dispatcher.Dispatch(new SimpleEvent1());
            dispatcher.Dispose();

            // ASSERT
            Assert.IsTrue(handlerCalled);
        }

        [TestMethod]
        public void GivenAnEventToDispatch_WhenAHandlerIsAttachedAndDetached_DoesNotCallHandler()
        {
            // ARRANGE
            bool handlerCalled = false;
            ApplicationEventHandlerDelegate<SimpleEvent1> @delegate =
                delegate {
                    handlerCalled = true;
                };
            var dispatcher = new ApplicationEventDispatcher();
            dispatcher.AddListener(@delegate);
            dispatcher.RemoveListener(@delegate);

            // ACT
            dispatcher.Dispatch(new SimpleEvent1());
            dispatcher.Dispose();

            // ASSERT
            Assert.IsFalse(handlerCalled);
        }

        [TestMethod]
        [ExpectedException(typeof(ObjectDisposedException))]
        public void GivenAnEventToDispatch_WhenDispatcherIsDisposed_ThrowsException()
        {
            // ARRANGE
            var dispatcher = new ApplicationEventDispatcher();

            // ACT
            dispatcher.Dispose();
            dispatcher.Dispatch(new SimpleEvent1());

            // ASSERT
        }
    }
}


text:
通过`JavaScriptCore`搞的js桥接,但是`WKWebView`中拿不到`JSC`, 只能废弃了。

## MXBridge

Bridge betweeen iOS and JavaScript.

## English

Bridge JavaScript and Objective-C using the `JavaScriptCore`.

Classes description:

* `MXWebviewContext` : A context for global setting.
* `MXWebviewBridge` : The bridge connected Objective-C and JavaScript. UIWebview will hold a `MXWebviewBridge` instance within the lifecycle.
* `MXWebviewPlugin` : Objective-C plugin which provide functions for JavaScript. A plugin has some functions. `js` will specify the plugin and function to call Native.
* `MXNativeInvocation` : Storing Information for one call from JavaScript to Objective-C.
* `MXNativeMethod` : Storing Native method info.
* `MXWebviewPluginConfig` : Store Native plugin info.

## Usage

Add `MXBridge` to your project by `Cocoapods`:

	pod 'MXBridge'

To use `MXBridge`, you can use `MXWebView`. Or you can use `MXWebViewBridgeWrapper`  :

	_bridge = [MXWebViewBridgeWrapper wrapperWithWebView:webview];
	_bridge.webviewDelegate = self;

Create a plugin for JavaScript:

	@interface TestPlugin : MXWebviewPlugin

	@end
	@implementation TestPlugin
	MX_EXTERN_METHOD(hello, helloworld)
	- (NSDictionary *)helloworld {
	    return @{@"data":@"Hello world , hello MXBridge!"};
	}

	MX_EXTERN_METHOD(loadPicture, loadPicture:)
	- (void)loadPicture:(MXCallNativeInvocation *)invocation {
	    NSString *url = invocation.arguments[@"url"];
	    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:url]];
	    [[[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
	        if (error) {
	            [self callBackSuccess:NO withString:nil toInvocation:invocation];
	        }else {
	            NSString *str = [data base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength];
	            [self callBackSuccess:YES withString:str toInvocation:invocation];
	        }
	    }] resume];
	}

	@end

Use `MX_EXTERN_METHOD` to export functions of plugins. First argument is the function name in `js` . The second argument is the selector of the exported function.

Register plugin before using :

	[[MXWebviewContext shareContext] registerPlugin:[TestPlugin class] name:@"test"];

Then,you can call the plugin in your JavaScript Code :

	function clickSync() {
		var retString = mxbridge.execSync("test","hello");
		if (retString.data) {
            mxbridge.log(retString.data);
			alert(retString.data);
		}
	}
	function clickAysn() {
        mxbridge.execSafely("test","loadPicture",{"url":"http://resource.luoxianming.cn/steam.gif"},function successDownload(data){
        	document.getElementById("showImg").src = "data:image/png;base64," + data ;
        });
	}

## Notice

The JSContext inits every time after the finish of website loading in the UIWebview.So the `MXBridge` is unavailable  before the loading finished. MXBridge post a notification `bridgeReady` after the initializtion.You should call the Objective-C plugins after the `bridgeReady` notification recieved.

More documents in the plan.

## License

These specifications and CocoaPods are available under the [MIT license](http://www.opensource.org/licenses/mit-license.php).


text:
// Copyright (c) 2012 Ecma International.  All rights reserved.
// Ecma International makes this code available under the terms and conditions set
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
// "Use Terms").   Any redistribution of this code must retain the above
// copyright and this notice and otherwise comply with the Use Terms.

/*---
es5id: 15.2.3.7-6-a-93
description: >
    Object.defineProperties will not throw TypeError when
    P.configurable is false, P.[[Get]] and properties.[[Get]] are
    undefined (8.12.9 step 11.a.ii)
includes: [propertyHelper.js]
---*/

var obj = {};

function set_func(value) {
    obj.setVerifyHelpProp = value;
}

Object.defineProperty(obj, "foo", {
    get: undefined,
    set: set_func,
    enumerable: false,
    configurable: false
});

Object.defineProperties(obj, {
    foo: {
        get: undefined
    }
});
verifyWritable(obj, "foo", "setVerifyHelpProp");

verifyNotEnumerable(obj, "foo");

verifyNotConfigurable(obj, "foo");


text:
require 'google/apis/core/api_command'
require 'google/apis/errors'
require 'addressable/uri'

module Google
  module Apis
    module Core
      # Streaming/resumable media download support specifically for storage API so that
      # we can respond with response headers too.
      class StorageDownloadCommand < DownloadCommand

        # Execute the upload request once. Overrides the default implementation to handle streaming/chunking
        # of file content.
        # Note: This method is overriden from DownloadCommand in order to respond back with
        # http header. All changes made to `execute_once` of DownloadCommand, should be made
        # here too.
        #
        # @private
        # @param [HTTPClient] client
        #   HTTP client
        # @yield [result, err] Result or error if block supplied
        # @return [Object]
        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
        # @raise [Google::Apis::AuthorizationError] Authorization is required
        def execute_once(client, &block)
          request_header = header.dup
          apply_request_options(request_header)
          download_offset = nil

          if @offset > 0
            logger.debug { sprintf('Resuming download from offset %d', @offset) }
            request_header[RANGE_HEADER] = sprintf('bytes=%d-', @offset)
          end

          http_res = client.get(url.to_s,
                     query: query,
                     header: request_header,
                     follow_redirect: true) do |res, chunk|
            status = res.http_header.status_code.to_i
            next unless OK_STATUS.include?(status)

            download_offset ||= (status == 206 ? @offset : 0)
            download_offset  += chunk.bytesize

            if download_offset - chunk.bytesize == @offset
              next_chunk = chunk
            else
              # Oh no! Requested a chunk, but received the entire content
              chunk_index = @offset - (download_offset - chunk.bytesize)
              next_chunk = chunk.byteslice(chunk_index..-1)
              next if next_chunk.nil?
            end

            # logger.debug { sprintf('Writing chunk (%d bytes, %d total)', chunk.length, bytes_read) }
            @download_io.write(next_chunk)

            @offset += next_chunk.bytesize
          end

         @download_io.flush if @download_io.respond_to?(:flush)

          if @close_io_on_finish
            result = nil
          else
            result = @download_io
          end
          check_status(http_res.status.to_i, http_res.header, http_res.body)
          # In case of file download in storage, we need to respond back with http
          # header along with the actual object.
          success([result, http_res], &block)
        rescue => e
          @download_io.flush if @download_io.respond_to?(:flush)
          error(e, rethrow: true, &block)
        end
      end
    end
  end
end


text:
package org.cinchapi.concourse.server.storage;

import java.util.Map;
import java.util.Set;

import org.cinchapi.concourse.thrift.Operator;
import org.cinchapi.concourse.thrift.TObject;

/**
 * A Compoundable store can perform AtomicOperations.
 *
 * @author Jeff Nelson
 */
public interface Compoundable extends PermanentStore, VersionChangeNotifier {

    /**
     * This method returns a log of revisions in {@code record} as
     * a Map WITHOUT grabbing any locks. This method is ONLY appropriate
     * to call from the methods of {@link #AtomicOperation} class
     * because in this case intermediate read {@link #Lock} is not required.
     *
     * @param record
     * @return {@code Map}
     */
    public Map<Long, String> auditUnsafe(long record);

    /**
     * Audit {@code key} in {@code record}. This method returns a log of
     * revisions in {@code record} as a Map WITHOUT grabbing any locks.
     * This method is ONLY appropriate to call from the methods of
     * {@link #AtomicOperation} class because in this case intermediate
     * read {@link #Lock} is not required.
     *
     * @param key
     * @param record
     * @return {@code Map}
     */
    public Map<Long, String> auditUnsafe(String key, long record);

    /**
     * This method returns a log of revisions in {@code record} as
     * a Map WITHOUT grabbing any locks. This method is ONLY appropriate
     * to call from the methods of {@link #AtomicOperation} class
     * because in this case intermediate read {@link #Lock} is not required.
     *
     * @param record
     * @return {@code Map}
     */
    public Map<String, Set<TObject>> browseUnsafe(long record);

    /**
     * Browse {@code key}.
     * This method returns a mapping from each of the values that is
     * currently indexed to {@code key} to a Set the records that contain
     * {@code key} as the associated value. If there are no such values, an
     * empty Map is returned. This method is ONLY appropriate to call from
     * the methods of {@link #AtomicOperation} class because in this case
     * intermediate read {@link #Lock} is not required.
     *
     * @param key
     * @return {@code Map}
     */
    public Map<TObject, Set<Long>> browseUnsafe(String key);

    /**
     * Do the work to explore {@code key} {@code operator} {@code values}
     * without worry about normalizing the {@code operator} or {@code values}.
     * This method is ONLY appropriate to call from the methods of
     * {@link #AtomicOperation} class because in this case intermediate read
     * {@link #Lock} is not required.
     *
     * @param key
     * @param operator
     * @param values
     * @return {@code Map}
     */
    public Map<Long, Set<TObject>> doExploreUnsafe(String key,
            Operator operator, TObject... values);

    /**
     * Fetch {@code key} from {@code record}.
     * This method returns the values currently mapped from {@code key} in
     * {@code record}. The returned Set is nonempty if and only if {@code key}
     * is a member of the Set returned from {@link describe(long)}.
     * This method is ONLY appropriate to call from the methods of
     * {@link #AtomicOperation} class because in this case
     * intermediate read {@link #Lock} is not required.
     *
     * @param key
     * @param record
     * @return {@code Set}
     */
    public Set<TObject> selectUnsafe(String key, long record);

    /**
     * Verify {@code key} equals {@code value} in {@code record}.
     * This method checks that there is currently a mapping from {@code key} to
     * {@code value} in {@code record}. This method has the same affect as
     * calling {@link fetch(String, long)} {@link Set.contains(Object)}.
     * This method is ONLY appropriate to call from the methods of
     * {@link #AtomicOperation} class because in this case intermediate read
     * {@link #Lock} is not required.
     *
     * @param key
     * @param value
     * @param record
     * @return {@code boolean}
     */
    public boolean verifyUnsafe(String key, TObject value, long record);

    /**
     * Return an {@link AtomicOperation} that can be used to group actions that
     * should all succeed or fail together. Use {@link AtomicOperation#commit()}
     * to apply the action to this store or use {@link AtomicOperation#abort()}
     * to cancel.
     *
     * @return the AtomicOperation handler
     */
    public AtomicOperation startAtomicOperation();

}


text:
import Gaffer
import GafferUI
import GafferArnold

Gaffer.Metadata.registerNode(

	GafferArnold.ArnoldRender,

	"description",
	"""
	Performs offline batch rendering using the
	Arnold renderer. This is done in two phases -
	first a .ass file is generated and then Arnold
	is invoked to render it. Note though that the .ass
	file is lightweight, and contains little more than
	a procedural which will use Gaffer to generate the
	scene at render time.
	""",

	plugs = {

		"mode" : [

			"description",
			"""
			When in the standard "Render" mode, an .ass
			file is generated and then renderered in Arnold.
			Alternatively, just the .ass file can be generated
			and then another method can be used to post-process
			it or launch the render - a SystemCommand node may
			be useful for this. Finally, an expanded .ass file
			may be generated - this will contain the entire
			expanded scene rather than just a procedural, and can
			be useful for debugging.
			""",

			"preset:Render", "render",
			"preset:Generate .ass only", "generate",
			"preset:Generate expanded .ass", "expand",

			"nodule:type", "",

		],

		"fileName" : [

			"description",
			"""
			The name of the .ass file to be generated.
			""",

			"nodule:type", "",

		],

		"verbosity" : [

			"description",
			"""
			Controls the verbosity of the Arnold renderer output.
			""",

			"preset:0", 0,
			"preset:1", 1,
			"preset:2", 2,
			"preset:3", 3,
			"preset:4", 4,
			"preset:5", 5,
			"preset:6", 6,

			"nodule:type", "",

		],

}

)

GafferUI.PlugValueWidget.registerCreator(
	GafferArnold.ArnoldRender,
	"mode",
	GafferUI.PresetsPlugValueWidget,
)

GafferUI.PlugValueWidget.registerCreator(
	GafferArnold.ArnoldRender,
	"fileName",
	lambda plug : GafferUI.PathPlugValueWidget( plug,
		path = Gaffer.FileSystemPath( "/", filter = Gaffer.FileSystemPath.createStandardFilter() ),
		pathChooserDialogueKeywords = {
			"bookmarks" : GafferUI.Bookmarks.acquire( plug, category = "ass" ),
			"leaf" : True,
		},
	),
)

GafferUI.PlugValueWidget.registerCreator(
	GafferArnold.ArnoldRender,
	"verbosity",
	GafferUI.PresetsPlugValueWidget,
)


text:
package nl.it.fixx.moknj.security;

import javax.servlet.http.HttpServletRequest;
import nl.it.fixx.moknj.properties.ApplicationProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;

/**
 *
 * @author Riaan Schoeman
 */
@Configuration
@EnableResourceServer
public class ResourceServerConfig extends ResourceServerConfigurerAdapter {

    @Autowired
    private ApplicationProperties properties;

    public static String getFullURL(HttpServletRequest request) {
        StringBuffer requestURL = request.getRequestURL();
        String queryString = request.getQueryString();

        if (queryString == null) {
            return requestURL.toString();
        } else {
            return requestURL.append('?').append(queryString).toString();
        }
    }

    @Bean
    public FilterRegistrationBean corsFilter() {
        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource() {
            @Override
            public CorsConfiguration getCorsConfiguration(HttpServletRequest request) {
                return super.getCorsConfiguration(request);
            }
        };

        CorsConfiguration config = new CorsConfiguration();
        config.setAllowCredentials(true);
        config.addAllowedOrigin("*");
        config.addAllowedHeader("*");
        config.addAllowedMethod("OPTIONS");
        config.addAllowedMethod("HEAD");
        config.addAllowedMethod("GET");
        config.addAllowedMethod("PUT");
        config.addAllowedMethod("POST");
        config.addAllowedMethod("DELETE");
        config.addAllowedMethod("PATCH");
        source.registerCorsConfiguration("/**", config);
        FilterRegistrationBean bean = new FilterRegistrationBean(new CorsFilter(source));
        bean.setOrder(0);

        return bean;
    }

    @Override
    public void configure(ResourceServerSecurityConfigurer resources) {
        resources.authenticationEntryPoint(new CustomAuthenticationEntryPoint())
                .resourceId(properties.getSecurity().getResourceId())
                .stateless(false);
    }

    @Override
    public void configure(HttpSecurity http) throws Exception {
        http.anonymous().disable().requestMatchers()
                .antMatchers("/asset/**", "/type/**", "/link/**",
                         "/resource/**", "/menu/**", "/graph/**")
                .and()
                .authorizeRequests()
                .antMatchers("/asset/**")
                .hasAuthority("ASSET")
                .and()
                .authorizeRequests()
                .antMatchers("/type/**")
                .hasAuthority("TYPE")
                .and()
                .authorizeRequests()
                .antMatchers("/link/**")
                .hasAuthority("LINK")
                .and()
                .authorizeRequests()
                .antMatchers("/resource/**")
                .hasAuthority("RESOURCE")
                .and()
                .authorizeRequests()
                .antMatchers("/menu/**")
                .hasAuthority("MENU")
                .and()
                .authorizeRequests()
                .antMatchers("/graph/**")
                .hasAuthority("DASH")
                .and()
                .exceptionHandling()
                .accessDeniedHandler(new CustomAccessDeniedEntryHandler());
    }

}


text:
<?php
class Controller_Admin_Clearanceform extends Controller_Admin
{

	public function action_index()
	{
		if (Auth::get('group') == 50) {

			$data['clearanceforms'] = Model_Clearanceform::find('all');

			$data['clearanceforms'] = Model_Clearanceform::find('all', array(
			    'where' => array(
			        array('firstname', Auth::get('firstname')),
			        array('middlename', Auth::get('middlename')),
			        array('lastname', Auth::get('lastname')),
			    ),
			    'order_by' => array('id' => 'desc'),
			));

			$this->template->title = "Clearance forms";
			$this->template->content = View::forge('admin/clearanceform/index', $data);

		}else{

			if (Input::method() == 'POST')
			{

				$data['searchdate'] = Model_Clearanceform::find('all', array(
			    'where' => array(
			        array('schedule', Input::post('searchdate')),
			        ),
			  		  'order_by' => array('id' => 'desc'),
				));

				$data['clearanceforms'] = Model_Clearanceform::find('all');
				$this->template->title = "Clearance forms";
				$this->template->content = View::forge('admin/clearanceform/index', $data);
			}

			 $today = date("Y-m-d");
			 $data['schednow'] = Model_Clearanceform::find('all', array(
			    'where' => array(
			        array('schedule', $today),
			        ),
			  		  'order_by' => array('id' => 'desc'),
				));

			$data['clearanceforms'] = Model_Clearanceform::find('all');
			$this->template->title = "Clearance forms";
			$this->template->content = View::forge('admin/clearanceform/index', $data);
		}

	}

	public function action_changepassowrd()
	{

		if (Input::method() == 'POST')
		{
			$oldpassword = Input::post('oldpass');
			$newonce = Input::post('newpass');
			$change = Auth::change_password($oldpassword,$newonce);
			if ($change) {
				Session::set_flash('success', e('Successfully change password!'));
			}
		}

		$this->template->title = "Clearance forms";
		$this->template->content = View::forge('admin/clearanceform/changepassword');
	}

	public function action_view($id = null)
	{
		$data['clearanceform'] = Model_Clearanceform::find($id);

		$this->template->title = "Clearanceform";
		$this->template->content = View::forge('admin/clearanceform/view', $data);

	}

	public function action_printid($id = null)
	{

		$printed  = DB::update('clearanceforms')->value('isprinted', 1)->where('id', '=', $id)->execute();
		$reserved = DB::count_last_query();
		$data['clearanceform'] = Model_Clearanceform::find($id);

		$this->template->title = "Clearanceform";
		$this->template->content = View::forge('admin/clearanceform/view', $data);
	}

	public function action_create()
	{
		if (Input::method() == 'POST')
		{
			$orexist = DB::select()->from('clearanceforms')->where('orno', '=', Input::post('orno'))->execute();

			$num_rows = count($orexist);

			if ($num_rows != 0) {
				Session::set_flash('error', e('Error Or# already exist!'));
				Response::redirect('admin/clearanceform/create');
			}

			$schedule = Input::post('schedule');
			$result   = DB::select()->from('clearanceforms')->where('schedule', '=', $schedule)->execute();
			$reserved = DB::count_last_query();

			if ($reserved >= 10) {
				Session::set_flash('error', e('Error Adding Scheduled Date is Fully Reserved!'));
				Response::redirect('admin/clearanceform/create');
			}

			$val = Model_Clearanceform::validate('create');
			if ($val->run())
			{

					    $clearanceform = Model_Clearanceform::forge(array(
							'fileno' => Input::post('fileno'),
							'orno' => Input::post('orno'),
							'firstname' => Input::post('firstname'),
							'middlename' => Input::post('middlename'),
							'lastname' => Input::post('lastname'),
							'address' => Input::post('address'),
							'sex' => Input::post('sex'),
							'civilstatus' => Input::post('civilstatus'),
							'dateofbirth' => Input::post('dateofbirth'),
							'placeofbirth' => Input::post('placeofbirth'),
							'comtaxno' => Input::post('comtaxno'),
							'issuedat' => Input::post('issuedat'),
							'issuedon' => Input::post('issuedon'),
							'schedule' => Input::post('schedule'),
							'payment' => Input::post('payment'),
							'purpose' => Input::post('purpose'),
							'contactnumber' => Input::post('contactnumber'),
						));

						if ($clearanceform and $clearanceform->save())
						{
							if (Auth::get('group') == 100) {
								Session::set_flash('success', e('Added clearance form #'.$clearanceform->id.'.'));
								Response::redirect('admin/clearanceform');
							}else if (Auth::get('group') == 50) {
								Session::set_flash('success', e('Application Successfully Submitted'));
								Response::redirect('admin/clearanceform/create');
							}

						}

						else
						{
							Session::set_flash('error', e('Could not save clearanceform.'));
						}
				}

			else
			{
				Session::set_flash('error', $val->error());
			}
		}

		  $this->template->title = "Clearance forms";
		  $this->template->content = View::forge('admin/clearanceform/create');

	}

	public function action_edit($id = null)
	{
		$clearanceform = Model_Clearanceform::find($id);
		$val = Model_Clearanceform::validate('edit');

		if ($val->run())
		{
			$clearanceform->fileno = Input::post('fileno');
			$clearanceform->orno = Input::post('orno');
			$clearanceform->firstname = Input::post('firstname');
			$clearanceform->middlename = Input::post('middlename');
			$clearanceform->lastname = Input::post('lastname');
			$clearanceform->address = Input::post('address');
			$clearanceform->sex = Input::post('sex');
			$clearanceform->civilstatus = Input::post('civilstatus');
			$clearanceform->dateofbirth = Input::post('dateofbirth');
			$clearanceform->placeofbirth = Input::post('placeofbirth');
			$clearanceform->comtaxno = Input::post('comtaxno');
			$clearanceform->issuedat = Input::post('issuedat');
			$clearanceform->issuedon = Input::post('issuedon');
			$clearanceform->purpose = Input::post('purpose');
			$clearanceform->contactnumber = Input::post('contactnumber');
			$clearanceform->schedule = Input::post('schedule');
			$clearanceform->payment = Input::post('payment');

			if ($clearanceform->save())
			{
				Session::set_flash('success', e('Updated clearance form #' . $id));

				Response::redirect('admin/clearanceform');
			}

			else
			{
				Session::set_flash('error', e('Could not update clearanceform #' . $id));
			}
		}

		else
		{
			if (Input::method() == 'POST')
			{
				$clearanceform->fileno = $val->validated('fileno');
				$clearanceform->orno = $val->validated('orno');
				$clearanceform->firstname = $val->validated('firstname');
				$clearanceform->middlename = $val->validated('middlename');
				$clearanceform->lastname = $val->validated('lastname');
				$clearanceform->address = $val->validated('address');
				$clearanceform->sex = $val->validated('sex');
				$clearanceform->civilstatus = $val->validated('civilstatus');
				$clearanceform->dateofbirth = $val->validated('dateofbirth');
				$clearanceform->placeofbirth = $val->validated('placeofbirth');
				$clearanceform->comtaxno = $val->validated('comtaxno');
				$clearanceform->issuedat = $val->validated('issuedat');
				$clearanceform->issuedon = $val->validated('issuedon');
				$clearanceform->purpose = $val->validated('purpose');
				$clearanceform->contactnumber = $val->validated('contactnumber');

				Session::set_flash('error', $val->error());
			}

			$this->template->set_global('clearanceform', $clearanceform, false);
		}

		$this->template->title = "Clearance forms";
		$this->template->content = View::forge('admin/clearanceform/edit');

	}

	public function action_delete($id = null)
	{
		if ($clearanceform = Model_Clearanceform::find($id))
		{
			$clearanceform->delete();

			Session::set_flash('success', e('Deleted clearanceform #'.$id));
		}

		else
		{
			Session::set_flash('error', e('Could not delete clearanceform #'.$id));
		}

		Response::redirect('admin/clearanceform');

	}

}


text:
/**
 * @author mrdoob / http://mrdoob.com/
 */

Sidebar.Geometry.BufferGeometry = function ( editor ) {

  var signals = editor.signals;

  var container = new UI.Row();

  function update( object ) {

    if ( object === null ) return; // objectSelected.dispatch( null )
    if ( object === undefined ) return;

    var geometry = object.geometry;

    if ( geometry instanceof THREE.BufferGeometry ) {

      container.clear();
      container.setDisplay( 'block' );

      var index = geometry.index;

      if ( index !== null ) {

        var panel = new UI.Row();
        panel.add( new UI.Text( 'index' ).setWidth( '90px' ) );
        panel.add( new UI.Text( ( index.count ).format() ).setFontSize( '12px' ) );
        container.add( panel );

      }

      var attributes = geometry.attributes;

      for ( var name in attributes ) {

        var attribute = attributes[ name ];

        var panel = new UI.Row();
        panel.add( new UI.Text( name ).setWidth( '90px' ) );
        panel.add( new UI.Text( ( attribute.count ).format() + ' (' + attribute.itemSize + ')' ).setFontSize( '12px' ) );
        container.add( panel );

      }

    } else {

      container.setDisplay( 'none' );

    }

  }

  signals.objectSelected.add( update );
  signals.geometryChanged.add( update );

  return container;

};


text:
channel.decr('visitors');

// and emit the number of visitors to the privileged channel.
var priv = domain.getChannel(2);
priv.emit(channel.get('visitors').toString());


text:
package org.ethereum.net.server;

import io.netty.channel.*;
import io.netty.channel.socket.nio.NioSocketChannel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * @author Roman Mandeleil
 * @since 01.11.2014
 */
@Component
@Scope("prototype")
public class EthereumChannelInitializer extends ChannelInitializer<NioSocketChannel> {

    private static final Logger logger = LoggerFactory.getLogger("net");

    @Autowired
    private ApplicationContext ctx;

    @Autowired
    ChannelManager channelManager;

    private String remoteId;

    private boolean peerDiscoveryMode = false;

    public EthereumChannelInitializer(String remoteId) {
        this.remoteId = remoteId;
    }

    @Override
    public void initChannel(NioSocketChannel ch) throws Exception {
        try {
            if (!peerDiscoveryMode) {
                logger.debug("Open {} connection, channel: {}", isInbound() ? "inbound" : "outbound", ch.toString());
            }

            if (isInbound() && channelManager.isRecentlyDisconnected(ch.remoteAddress().getAddress())) {
                // avoid too frequent connection attempts
                logger.debug("Drop connection - the same IP was disconnected recently, channel: {}", ch.toString());
                ch.disconnect();
                return;
            }

            final Channel channel = ctx.getBean(Channel.class);
            channel.init(ch.pipeline(), remoteId, peerDiscoveryMode, channelManager);

            if(!peerDiscoveryMode) {
                channelManager.add(channel);
            }

            // limit the size of receiving buffer to 1024
            ch.config().setRecvByteBufAllocator(new FixedRecvByteBufAllocator(256 * 1024));
            ch.config().setOption(ChannelOption.SO_RCVBUF, 256 * 1024);
            ch.config().setOption(ChannelOption.SO_BACKLOG, 1024);

            // be aware of channel closing
            ch.closeFuture().addListener(new ChannelFutureListener() {
                @Override
                public void operationComplete(ChannelFuture future) throws Exception {
                    if (!peerDiscoveryMode) {
                        channelManager.notifyDisconnect(channel);
                    }
                }
            });

        } catch (Exception e) {
            logger.error("Unexpected error: ", e);
        }
    }

    private boolean isInbound() {
        return remoteId == null || remoteId.isEmpty();
    }

    public void setPeerDiscoveryMode(boolean peerDiscoveryMode) {
        this.peerDiscoveryMode = peerDiscoveryMode;
    }
}


text:
using gax = Google.Api.Gax;
using sys = System;

namespace Google.Ads.GoogleAds.V12.Resources
{
    /// Resource name for the <c>ShoppingPerformanceView</c> resource.
    public sealed partial class ShoppingPerformanceViewName : gax::IResourceName, sys::IEquatable<ShoppingPerformanceViewName>
    {
        /// The possible contents of <see cref="ShoppingPerformanceViewName"/>.
        public enum ResourceNameType
        {
            /// An unparsed resource name.
            Unparsed = 0,

            /// A resource name with pattern <c>customers/{customer_id}/shoppingPerformanceView</c>.
            Customer = 1,
        }

        private static gax::PathTemplate s_customer = new gax::PathTemplate("customers/{customer_id}/shoppingPerformanceView");

        /// Creates a <see cref="ShoppingPerformanceViewName"/> containing an unparsed resource name.
        /// <param name="unparsedResourceName">The unparsed resource name. Must not be <c>null</c>.</param>
        /// <returns>
        /// A new instance of <see cref="ShoppingPerformanceViewName"/> containing the provided
        /// <paramref name="unparsedResourceName"/>.
        /// </returns>
        public static ShoppingPerformanceViewName FromUnparsed(gax::UnparsedResourceName unparsedResourceName) =>
            new ShoppingPerformanceViewName(ResourceNameType.Unparsed, gax::GaxPreconditions.CheckNotNull(unparsedResourceName, nameof(unparsedResourceName)));

        ///
        /// Creates a <see cref="ShoppingPerformanceViewName"/> with the pattern
        /// <c>customers/{customer_id}/shoppingPerformanceView</c>.
        ///
        /// <param name="customerId">The <c>Customer</c> ID. Must not be <c>null</c> or empty.</param>
        /// <returns>
        /// A new instance of <see cref="ShoppingPerformanceViewName"/> constructed from the provided ids.
        /// </returns>
        public static ShoppingPerformanceViewName FromCustomer(string customerId) =>
            new ShoppingPerformanceViewName(ResourceNameType.Customer, customerId: gax::GaxPreconditions.CheckNotNullOrEmpty(customerId, nameof(customerId)));

        ///
        /// Formats the IDs into the string representation of this <see cref="ShoppingPerformanceViewName"/> with
        /// pattern <c>customers/{customer_id}/shoppingPerformanceView</c>.
        ///
        /// <param name="customerId">The <c>Customer</c> ID. Must not be <c>null</c> or empty.</param>
        /// <returns>
        /// The string representation of this <see cref="ShoppingPerformanceViewName"/> with pattern
        /// <c>customers/{customer_id}/shoppingPerformanceView</c>.
        /// </returns>
        public static string Format(string customerId) => FormatCustomer(customerId);

        ///
        /// Formats the IDs into the string representation of this <see cref="ShoppingPerformanceViewName"/> with
        /// pattern <c>customers/{customer_id}/shoppingPerformanceView</c>.
        ///
        /// <param name="customerId">The <c>Customer</c> ID. Must not be <c>null</c> or empty.</param>
        /// <returns>
        /// The string representation of this <see cref="ShoppingPerformanceViewName"/> with pattern
        /// <c>customers/{customer_id}/shoppingPerformanceView</c>.
        /// </returns>
        public static string FormatCustomer(string customerId) =>
            s_customer.Expand(gax::GaxPreconditions.CheckNotNullOrEmpty(customerId, nameof(customerId)));

        ///
        /// Parses the given resource name string into a new <see cref="ShoppingPerformanceViewName"/> instance.
        ///
        /// <remarks>
        /// To parse successfully, the resource name must be formatted as one of the following:
        /// <list type="bullet">
        /// <item><description><c>customers/{customer_id}/shoppingPerformanceView</c></description></item>
        /// </list>
        /// </remarks>
        /// <param name="shoppingPerformanceViewName">The resource name in string form. Must not be <c>null</c>.</param>
        /// <returns>The parsed <see cref="ShoppingPerformanceViewName"/> if successful.</returns>
        public static ShoppingPerformanceViewName Parse(string shoppingPerformanceViewName) =>
            Parse(shoppingPerformanceViewName, false);

        ///
        /// Parses the given resource name string into a new <see cref="ShoppingPerformanceViewName"/> instance;
        /// optionally allowing an unparseable resource name.
        ///
        /// <remarks>
        /// To parse successfully, the resource name must be formatted as one of the following:
        /// <list type="bullet">
        /// <item><description><c>customers/{customer_id}/shoppingPerformanceView</c></description></item>
        /// </list>
        /// Or may be in any format if <paramref name="allowUnparsed"/> is <c>true</c>.
        /// </remarks>
        /// <param name="shoppingPerformanceViewName">The resource name in string form. Must not be <c>null</c>.</param>
        /// <param name="allowUnparsed">
        /// If <c>true</c> will successfully store an unparseable resource name into the <see cref="UnparsedResource"/>
        /// property; otherwise will throw an <see cref="sys::ArgumentException"/> if an unparseable resource name is
        /// specified.
        /// </param>
        /// <returns>The parsed <see cref="ShoppingPerformanceViewName"/> if successful.</returns>
        public static ShoppingPerformanceViewName Parse(string shoppingPerformanceViewName, bool allowUnparsed) =>
            TryParse(shoppingPerformanceViewName, allowUnparsed, out ShoppingPerformanceViewName result) ? result : throw new sys::ArgumentException("The given resource-name matches no pattern.");

        ///
        /// Tries to parse the given resource name string into a new <see cref="ShoppingPerformanceViewName"/> instance.
        ///
        /// <remarks>
        /// To parse successfully, the resource name must be formatted as one of the following:
        /// <list type="bullet">
        /// <item><description><c>customers/{customer_id}/shoppingPerformanceView</c></description></item>
        /// </list>
        /// </remarks>
        /// <param name="shoppingPerformanceViewName">The resource name in string form. Must not be <c>null</c>.</param>
        /// <param name="result">
        /// When this method returns, the parsed <see cref="ShoppingPerformanceViewName"/>, or <c>null</c> if parsing
        /// failed.
        /// </param>
        /// <returns><c>true</c> if the name was parsed successfully; <c>false</c> otherwise.</returns>
        public static bool TryParse(string shoppingPerformanceViewName, out ShoppingPerformanceViewName result) =>
            TryParse(shoppingPerformanceViewName, false, out result);

        ///
        /// Tries to parse the given resource name string into a new <see cref="ShoppingPerformanceViewName"/> instance;
        /// optionally allowing an unparseable resource name.
        ///
        /// <remarks>
        /// To parse successfully, the resource name must be formatted as one of the following:
        /// <list type="bullet">
        /// <item><description><c>customers/{customer_id}/shoppingPerformanceView</c></description></item>
        /// </list>
        /// Or may be in any format if <paramref name="allowUnparsed"/> is <c>true</c>.
        /// </remarks>
        /// <param name="shoppingPerformanceViewName">The resource name in string form. Must not be <c>null</c>.</param>
        /// <param name="allowUnparsed">
        /// If <c>true</c> will successfully store an unparseable resource name into the <see cref="UnparsedResource"/>
        /// property; otherwise will throw an <see cref="sys::ArgumentException"/> if an unparseable resource name is
        /// specified.
        /// </param>
        /// <param name="result">
        /// When this method returns, the parsed <see cref="ShoppingPerformanceViewName"/>, or <c>null</c> if parsing
        /// failed.
        /// </param>
        /// <returns><c>true</c> if the name was parsed successfully; <c>false</c> otherwise.</returns>
        public static bool TryParse(string shoppingPerformanceViewName, bool allowUnparsed, out ShoppingPerformanceViewName result)
        {
            gax::GaxPreconditions.CheckNotNull(shoppingPerformanceViewName, nameof(shoppingPerformanceViewName));
            gax::TemplatedResourceName resourceName;
            if (s_customer.TryParseName(shoppingPerformanceViewName, out resourceName))
            {
                result = FromCustomer(resourceName[0]);
                return true;
            }
            if (allowUnparsed)
            {
                if (gax::UnparsedResourceName.TryParse(shoppingPerformanceViewName, out gax::UnparsedResourceName unparsedResourceName))
                {
                    result = FromUnparsed(unparsedResourceName);
                    return true;
                }
            }
            result = null;
            return false;
        }

        private ShoppingPerformanceViewName(ResourceNameType type, gax::UnparsedResourceName unparsedResourceName = null, string customerId = null)
        {
            Type = type;
            UnparsedResource = unparsedResourceName;
            CustomerId = customerId;
        }

        ///
        /// Constructs a new instance of a <see cref="ShoppingPerformanceViewName"/> class from the component parts of
        /// pattern <c>customers/{customer_id}/shoppingPerformanceView</c>
        ///
        /// <param name="customerId">The <c>Customer</c> ID. Must not be <c>null</c> or empty.</param>
        public ShoppingPerformanceViewName(string customerId) : this(ResourceNameType.Customer, customerId: gax::GaxPreconditions.CheckNotNullOrEmpty(customerId, nameof(customerId)))
        {
        }

        /// The <see cref="ResourceNameType"/> of the contained resource name.
        public ResourceNameType Type { get; }

        ///
        /// The contained <see cref="gax::UnparsedResourceName"/>. Only non-<c>null</c> if this instance contains an
        /// unparsed resource name.
        ///
        public gax::UnparsedResourceName UnparsedResource { get; }

        ///
        /// The <c>Customer</c> ID. Will not be <c>null</c>, unless this instance contains an unparsed resource name.
        ///
        public string CustomerId { get; }

        /// Whether this instance contains a resource name with a known pattern.
        public bool IsKnownPattern => Type != ResourceNameType.Unparsed;

        /// The string representation of the resource name.
        /// <returns>The string representation of the resource name.</returns>
        public override string ToString()
        {
            switch (Type)
            {
                case ResourceNameType.Unparsed: return UnparsedResource.ToString();
                case ResourceNameType.Customer: return s_customer.Expand(CustomerId);
                default: throw new sys::InvalidOperationException("Unrecognized resource-type.");
            }
        }

        /// Returns a hash code for this resource name.
        public override int GetHashCode() => ToString().GetHashCode();

        /// <inheritdoc/>
        public override bool Equals(object obj) => Equals(obj as ShoppingPerformanceViewName);

        /// <inheritdoc/>
        public bool Equals(ShoppingPerformanceViewName other) => ToString() == other?.ToString();

        /// <inheritdoc/>
        public static bool operator ==(ShoppingPerformanceViewName a, ShoppingPerformanceViewName b) => ReferenceEquals(a, b) || (a?.Equals(b) ?? false);

        /// <inheritdoc/>
        public static bool operator !=(ShoppingPerformanceViewName a, ShoppingPerformanceViewName b) => !(a == b);
    }

    public partial class ShoppingPerformanceView
    {
        ///
        /// <see cref="ShoppingPerformanceViewName"/>-typed view over the <see cref="ResourceName"/> resource name
        /// property.
        ///
        internal ShoppingPerformanceViewName ResourceNameAsShoppingPerformanceViewName
        {
            get => string.IsNullOrEmpty(ResourceName) ? null : ShoppingPerformanceViewName.Parse(ResourceName, allowUnparsed: true);
            set => ResourceName = value?.ToString() ?? "";
        }
    }
}


text:
if (typeof define !== 'function') { var define = require('amdefine')(module); }

define(['../../shaper'], function(Shaper) {
"use strict"; "use restrict";

return Shaper("wrap_array_in_fn", function(root) {
    var templ = Shaper.parse("[$$]");
    return Shaper.traverse(root, {post: function(node, ref) {
        if (Shaper.match(templ, node)) {
            return ref.set(Shaper.replace(Shaper.parse("fn($)"), node));
        }
    }});
});

});


text:
'''
'''
#  Licensed to the Apache Software Foundation (ASF) under one
#  or more contributor license agreements.  See the NOTICE file
#  distributed with this work for additional information
#  regarding copyright ownership.  The ASF licenses this file
#  to you 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.

import os
Test.Summary = '''
Test post_error
'''

# need Curl
Test.SkipUnless(
    Condition.HasProgram("curl", "Curl need to be installed on system for this test to work")
)
Test.ContinueOnFail = True

# build post server code
tr=Test.Build(target='post_server',sources=['post_server.c'])
tr.Setup.Copy('post_server.c')

tr = Test.AddTestRun()
tr.Setup.Copy('create_post_body.py')
tr.Processes.Default.Command = "python create_post_body.py"

# Define default ATS
ts = Test.MakeATSProcess("ts", select_ports=False)

# create Process
server = Test.Processes.Process("post_server")
port = 8888
command = "./post_server {0}".format(port)

# create process
server.Command = command
server.Ready = When.PortOpen(port)
server.ReturnCode = Any(None, 0)

ts.Disk.remap_config.AddLine(
    'map / http://127.0.0.1:{0}'.format(port)
)

ts.Disk.records_config.update({
    # enable ssl port
    'proxy.config.http.server_ports': '{0}'.format(ts.Variables.port)
})

tr = Test.AddTestRun()
tr.Processes.Default.Command = 'curl -H"Expect:" -v -k -d "@postbody" http://127.0.0.1:{0}/'.format(ts.Variables.port)
tr.Processes.Default.ReturnCode = 0
tr.Processes.Default.Streams.All = "gold/post_error.gold"
tr.Processes.Default.StartBefore(Test.Processes.ts, ready=When.PortOpen(ts.Variables.port))
tr.Processes.Default.StartBefore(server)
tr.StillRunningAfter = server


text:
<BroadcastMonitor>
  <updated>2015-08-04T07:48:48</updated>
  <stationName>Radio 6</stationName>
  <Current>
    <startTime>2015-08-04T07:48:46</startTime>
    <itemId>1000080517:0</itemId>
    <titleId>216069590</titleId>
    <itemCode></itemCode>
    <itemReference></itemReference>
    <titleName>*** TUNE Morning Lou Rawls</titleName>
    <artistName></artistName>
    <albumName></albumName>
    <CategoryCode>653</CategoryCode>
    <CategoryName>Bedjes</CategoryName>
    <itemDuration>124</itemDuration>
    <MultiMedia1></MultiMedia1>
    <MultiMedia2></MultiMedia2>
    <MultiMedia3></MultiMedia3>
    <MultiMedia4></MultiMedia4>
  </Current>
  <Next>
    <startTime>2015-08-04T07:50:51</startTime>
    <itemId>1000080517:1241042</itemId>
    <titleId>216038634</titleId>
    <itemCode>FJ1374</itemCode>
    <itemReference></itemReference>
    <titleName>Do Anything</titleName>
    <artistName>New Cool Collective ft. Andrew Roachford</artistName>
    <albumName></albumName>
    <CategoryCode>737</CategoryCode>
    <CategoryName>JAZZ</CategoryName>
    <itemDuration>226</itemDuration>
    <MultiMedia1></MultiMedia1>
    <MultiMedia2></MultiMedia2>
    <MultiMedia3></MultiMedia3>
    <MultiMedia4></MultiMedia4>
  </Next>
</BroadcastMonitor>


text:
<!DOCTYPE html>

    <title>Video Test: video_currentTime_less_than_zero</title>
    <link rel="author" title="Intel" href="http://www.intel.com"/>
    <link rel="help" href="http://www.w3.org/TR/2012/WD-html5-20121025/the-video-element.html#the-video-element"/>
    <meta name="flags" content=""/>
    <meta name="assert" content="Check if user agent displays correctly when browser does not support media elements (Seeking to a value less than 'startTime' seeks to 'startTime')"/>

    <video id="m" autoplay>Your browser does not support media elements.</video>


text:
const React = require('react-native');

const { StyleSheet } = React;

export default{
  container: {
    backgroundColor: '#FBFAFA',
  },
 actionButtonIcon: {
    fontSize: 20,
    height: 22,
    color: 'white',
  },
};


text:
<?php

namespace common\models;

/**
 * This is the ActiveQuery class for [[Auto]].
 *
 * @see Auto
 */
class AutoQuery extends \yii\db\ActiveQuery
{
    /*public function active()
    {
        $this->andWhere('[[status]]=1');
        return $this;
    }*/

    /**
     * @inheritdoc
     * @return Auto[]|array
     */
    public function all($db = null)
    {
        return parent::all($db);
    }

    /**
     * @inheritdoc
     * @return Auto|array|null
     */
    public function one($db = null)
    {
        return parent::one($db);
    }
}


text:
namespace AjTalk.Tests
{
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.IO;
    using System.Text;
    using AjTalk;
    using AjTalk.Compiler;
    using AjTalk.Hosting;
    using AjTalk.Language;
    using AjTalk.Tests.Language;
    using AjTalk.Tests.NativeObjects;
    using Microsoft.VisualStudio.TestTools.UnitTesting;

    [TestClass]
    public class LoaderTests
    {
        [TestMethod]
        public void GetEmptyLine()
        {
            Loader loader = new Loader(new StringReader("\n"), new SimpleCompiler());

            Assert.IsNull(loader.GetBlockText());
        }

        [TestMethod]
        public void GetSpaceLine()
        {
            Loader loader = new Loader(new StringReader(" \n"), new SimpleCompiler());

            Assert.AreEqual(" \r\n", loader.GetBlockText());
            Assert.IsNull(loader.GetBlockText());
        }

        [TestMethod]
        public void GetTwoLinesBlock()
        {
            Loader loader = new Loader(new StringReader("line 1\r\nline 2\r\n!"), new SimpleCompiler());

            Assert.IsNotNull(loader);
            Assert.AreEqual("line 1\r\nline 2\r\n", loader.GetBlockText());
            Assert.IsNull(loader.GetBlockText());
        }

        [TestMethod]
        public void ProcessDoubleBang()
        {
            Loader loader = new Loader(new StringReader("!!new! !!new"), new SimpleCompiler());

            Assert.AreEqual("!new", loader.GetBlockText());
            Assert.AreEqual(" !new", loader.GetBlockText());
            Assert.IsNull(loader.GetBlockText());
        }

        [TestMethod]
        public void GetTwoBlocks()
        {
            Loader loader = new Loader(new StringReader("line 1\r\nline 2\r\n!\r\nline 3\r\nline 4\r\n!\r\n"), new SimpleCompiler());

            Assert.IsNotNull(loader);
            Assert.AreEqual("line 1\r\nline 2\r\n", loader.GetBlockText());
            Assert.AreEqual("line 3\r\nline 4\r\n", loader.GetBlockText());
            Assert.IsNull(loader.GetBlockText());
        }

        [TestMethod]
        public void GetBlockAndInmediate()
        {
            Loader loader = new Loader(new StringReader("line 1\nline 2\n!inmediate!\n"), new SimpleCompiler());

            Assert.IsNotNull(loader);
            Assert.AreEqual("line 1\r\nline 2\r\n", loader.GetBlockText());
            Assert.AreEqual("inmediate", loader.GetBlockText());
            Assert.IsNull(loader.GetBlockText());
        }

        [TestMethod]
        public void ExecuteBlock()
        {
            Loader loader = new Loader(new StringReader("One := 1\n!\n"), new SimpleCompiler());
            Machine machine = new Machine();

            loader.LoadAndExecute(machine);

            Assert.AreEqual(1, machine.GetGlobalObject("One"));
        }

        [TestMethod]
        public void ExecuteCommentBlock()
        {
            Loader loader = new Loader(new StringReader("\"comment\""), new SimpleCompiler());
            Machine machine = new Machine();

            loader.LoadAndExecute(machine);
        }

        [TestMethod]
        public void ExecuteBlockWithTwoCommands()
        {
            Loader loader = new Loader(new StringReader("One := 1.\nTwo := 2\n!\n"), new SimpleCompiler());
            Machine machine = new Machine();

            loader.LoadAndExecute(machine);

            Assert.AreEqual(1, machine.GetGlobalObject("One"));
            Assert.AreEqual(2, machine.GetGlobalObject("Two"));
        }

        [TestMethod]
        public void ExecuteTwoBlocks()
        {
            Loader loader = new Loader(new StringReader("One := 1.\n!\nTwo := 2\n!\n"), new SimpleCompiler());
            Machine machine = new Machine();

            loader.LoadAndExecute(machine);

            Assert.AreEqual(1, machine.GetGlobalObject("One"));
            Assert.AreEqual(2, machine.GetGlobalObject("Two"));
        }

        [TestMethod]
        [DeploymentItem(@"CodeFiles\SetObject.st")]
        public void ExecuteSetObjectFile()
        {
            Loader loader = new Loader(@"SetObject.st", new SimpleCompiler());
            Machine machine = new Machine();

            loader.LoadAndExecute(machine);

            Assert.AreEqual(1, machine.GetGlobalObject("One"));
        }

        [TestMethod]
        [DeploymentItem(@"CodeFiles\SetDotNetObject.st")]
        public void ExecuteSetDotNetObjectFile()
        {
            Loader loader = new Loader(@"SetDotNetObject.st", new SimpleCompiler());
            Machine machine = new Machine();

            loader.LoadAndExecute(machine);

            object obj = machine.GetGlobalObject("FileInfo");

            Assert.IsNotNull(obj);
            Assert.IsInstanceOfType(obj, typeof(System.IO.FileInfo));
        }

        [TestMethod]
        [DeploymentItem(@"CodeFiles\SetObjects.st")]
        public void ExecuteSetObjectsFile()
        {
            Loader loader = new Loader(@"SetObjects.st", new SimpleCompiler());
            Machine machine = new Machine();

            loader.LoadAndExecute(machine);

            Assert.AreEqual(1, machine.GetGlobalObject("One"));
            Assert.AreEqual(2, machine.GetGlobalObject("Two"));
        }

        [TestMethod]
        [DeploymentItem(@"CodeFiles\DefineSubclass.st")]
        public void ExecuteDefineSubclassFile()
        {
            Loader loader = new Loader(@"DefineSubclass.st", new SimpleCompiler());

            Machine machine = CreateMachine();

            Assert.IsNull(machine.GetGlobalObject("Object"));

            loader.LoadAndExecute(machine);

            Assert.IsNotNull(machine.GetGlobalObject("Object"));
        }

        [TestMethod]
        [DeploymentItem(@"CodeFiles\DefineSubclassWithVariables.st")]
        public void ExecuteDefineSubclassWithVariablesFile()
        {
            Loader loader = new Loader(@"DefineSubclassWithVariables.st", new SimpleCompiler());

            Machine machine = CreateMachine();

            Assert.IsNull(machine.GetGlobalObject("Rectangle"));

            loader.LoadAndExecute(machine);

            object obj = machine.GetGlobalObject("Rectangle");

            Assert.IsNotNull(obj);
            Assert.IsInstanceOfType(obj, typeof(IClass));

            IClass cls = (IClass)obj;

            Assert.AreEqual(0, cls.GetInstanceVariableOffset("x"));
            Assert.AreEqual(1, cls.GetInstanceVariableOffset("y"));
        }

        [TestMethod]
        [DeploymentItem(@"CodeFiles\DefineRectangle.st")]
        public void ExecuteDefineRectangleFile()
        {
            Loader loader = new Loader(@"DefineRectangle.st", new SimpleCompiler());

            Machine machine = CreateMachine();

            Assert.IsNull(machine.GetGlobalObject("Rectangle"));

            loader.LoadAndExecute(machine);

            object obj = machine.GetGlobalObject("Rectangle");

            Assert.IsNotNull(obj);
            Assert.IsInstanceOfType(obj, typeof(IClass));

            IClass cls = (IClass)obj;

            Assert.AreEqual(0, cls.GetInstanceVariableOffset("x"));
            Assert.AreEqual(1, cls.GetInstanceVariableOffset("y"));
            Assert.AreEqual(2, cls.GetInstanceVariableOffset("width"));
            Assert.AreEqual(3, cls.GetInstanceVariableOffset("height"));

            Assert.IsNotNull(cls.GetInstanceMethod("x"));
            Assert.IsNotNull(cls.GetInstanceMethod("x:"));
            Assert.IsNotNull(cls.GetInstanceMethod("y"));
            Assert.IsNotNull(cls.GetInstanceMethod("y:"));
        }

        [TestMethod]
        [DeploymentItem(@"CodeFiles\DefineRectangleWithNewAndInitialize.st")]
        public void ExecuteDefineRectangleWithNewAndInitializeFile()
        {
            Loader loader = new Loader(@"DefineRectangleWithNewAndInitialize.st", new SimpleCompiler());

            Machine machine = CreateMachine();

            Assert.IsNull(machine.GetGlobalObject("Rectangle"));

            loader.LoadAndExecute(machine);

            object obj = machine.GetGlobalObject("result");

            Assert.IsNotNull(obj);
            Assert.IsInstanceOfType(obj, typeof(IObject));

            IObject iobj = (IObject)obj;

            Assert.AreEqual(10, iobj[0]);
            Assert.AreEqual(20, iobj[1]);
        }

        [TestMethod]
        [DeploymentItem(@"CodeFiles\DefineClassSubclass.st")]
        public void ExecuteDefineClassSubclassFile()
        {
            Loader loader = new Loader(@"DefineClassSubclass.st", new SimpleCompiler());

            Machine machine = CreateMachine();

            Assert.IsNull(machine.GetGlobalObject("Rectangle"));

            loader.LoadAndExecute(machine);

            object obj = machine.GetGlobalObject("Rectangle");

            Assert.IsNotNull(obj);
            Assert.IsInstanceOfType(obj, typeof(IClass));

            IClass cls = (IClass)obj;

            Assert.AreEqual(0, cls.GetInstanceVariableOffset("x"));
            Assert.AreEqual(1, cls.GetInstanceVariableOffset("y"));
            Assert.AreEqual(2, cls.GetInstanceVariableOffset("width"));
            Assert.AreEqual(3, cls.GetInstanceVariableOffset("height"));

            Assert.IsNotNull(cls.GetInstanceMethod("x"));
            Assert.IsNotNull(cls.GetInstanceMethod("x:"));
            Assert.IsNotNull(cls.GetInstanceMethod("y"));
            Assert.IsNotNull(cls.GetInstanceMethod("y:"));
            Assert.IsNotNull(cls.GetInstanceMethod("width"));
            Assert.IsNotNull(cls.GetInstanceMethod("height"));
        }

        [TestMethod]
        [DeploymentItem(@"CodeFiles\Library1.st")]
        public void LoadLibrary()
        {
            Loader loader = new Loader(@"Library1.st", new SimpleCompiler());

            Machine machine = CreateMachine();

            Assert.IsNull(machine.GetGlobalObject("Object"));
            Assert.IsNull(machine.GetGlobalObject("Behavior"));
            Assert.IsNull(machine.GetGlobalObject("ClassDescription"));
            Assert.IsNull(machine.GetGlobalObject("Class"));
            Assert.IsNull(machine.GetGlobalObject("Metaclass"));

            loader.LoadAndExecute(machine);

            Assert.IsNotNull(machine.GetGlobalObject("Object"));
            Assert.IsNotNull(machine.GetGlobalObject("Behavior"));
            Assert.IsNotNull(machine.GetGlobalObject("ClassDescription"));
            Assert.IsNotNull(machine.GetGlobalObject("Class"));
            Assert.IsNotNull(machine.GetGlobalObject("Metaclass"));
        }

        [TestMethod]
        [DeploymentItem(@"CodeFiles\Library1.st")]
        public void LoadLibraryWithBootstrap()
        {
            Loader loader = new Loader(@"Library1.st", new SimpleCompiler());
            Machine machine = CreateMachine();

            loader.LoadAndExecute(machine);

            IClass objclass = (IClass)machine.GetGlobalObject("Object");
            IClass behaviorclass = (IClass)machine.GetGlobalObject("Behavior");
            IClass classdescriptionclass = (IClass)machine.GetGlobalObject("ClassDescription");
            IClass classclass = (IClass)machine.GetGlobalObject("Class");
            IClass metaclassclass = (IClass)machine.GetGlobalObject("Metaclass");

            Assert.AreEqual(objclass, behaviorclass.SuperClass);
            Assert.AreEqual(behaviorclass, classdescriptionclass.SuperClass);
            Assert.AreEqual(classdescriptionclass, classclass.SuperClass);
            Assert.AreEqual(classdescriptionclass, metaclassclass.SuperClass);

            Assert.IsNotNull(objclass.MetaClass);
            Assert.IsNotNull(behaviorclass.MetaClass);
            Assert.IsNotNull(classdescriptionclass.MetaClass);
            Assert.IsNotNull(classclass.MetaClass);
            Assert.IsNotNull(metaclassclass.MetaClass);

            Assert.AreEqual(objclass.MetaClass, behaviorclass.MetaClass.SuperClass);
            Assert.AreEqual(behaviorclass.MetaClass, classdescriptionclass.MetaClass.SuperClass);
            Assert.AreEqual(classdescriptionclass.MetaClass, classclass.MetaClass.SuperClass);
            Assert.AreEqual(classdescriptionclass.MetaClass, metaclassclass.MetaClass.SuperClass);

            Assert.AreEqual(metaclassclass, objclass.MetaClass.Behavior);
            Assert.AreEqual(metaclassclass, behaviorclass.MetaClass.Behavior);
            Assert.AreEqual(metaclassclass, classdescriptionclass.MetaClass.Behavior);
            Assert.AreEqual(metaclassclass, classclass.MetaClass.Behavior);
            Assert.AreEqual(metaclassclass, metaclassclass.MetaClass.Behavior);

            // TODO objclass super should be nil == null, now is object nil
            // Assert.IsNull(objclass.SuperClass);
            Assert.IsNotNull(objclass.MetaClass.SuperClass);
            Assert.AreEqual(classclass, objclass.MetaClass.SuperClass);
        }

        [TestMethod]
        [DeploymentItem(@"Library\Object.st")]
        [DeploymentItem(@"CodeFiles\ObjectTest.st")]
        public void LoadObject()
        {
            Machine machine = CreateMachine();
            Loader loader = new Loader(@"Object.st", new SimpleCompiler());
            loader.LoadAndExecute(machine);
            loader = new Loader(@"ObjectTest.st", new SimpleCompiler());
            loader.LoadAndExecute(machine);

            object obj = machine.GetGlobalObject("Object");

            Assert.IsNotNull(obj);
            Assert.IsInstanceOfType(obj, typeof(IClass));

            IClass cls = (IClass)obj;

            Assert.IsNotNull(cls.GetClassMethod("new"));
            Assert.IsNotNull(cls.GetClassMethod("basicNew"));

            object result = machine.GetGlobalObject("result");

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(IObject));
            Assert.AreEqual(cls, ((IObject)result).Behavior);

            object rcls = machine.GetGlobalObject("resultclass");
            Assert.AreEqual(cls, rcls);

            Assert.AreEqual(true, machine.GetGlobalObject("aresame"));
            Assert.AreEqual(false, machine.GetGlobalObject("arenotsame"));
            Assert.AreEqual(true, machine.GetGlobalObject("areequal"));
            Assert.AreEqual(false, machine.GetGlobalObject("arenotequal"));

            Assert.AreEqual(false, machine.GetGlobalObject("notaresame"));
            Assert.AreEqual(true, machine.GetGlobalObject("notarenotsame"));
            Assert.AreEqual(false, machine.GetGlobalObject("notareequal"));
            Assert.AreEqual(true, machine.GetGlobalObject("notarenotequal"));
        }

        [TestMethod]
        [DeploymentItem(@"Library\Object.st")]
        [DeploymentItem(@"Library\Behavior.st")]
        [DeploymentItem(@"CodeFiles\BehaviorTest.st")]
        public void LoadBehavior()
        {
            Machine machine = CreateMachine();

            Loader loader = new Loader(@"Object.st", new SimpleCompiler());
            loader.LoadAndExecute(machine);
            loader = new Loader(@"Behavior.st", new SimpleCompiler());
            loader.LoadAndExecute(machine);
            loader = new Loader(@"BehaviorTest.st", new SimpleCompiler());
            loader.LoadAndExecute(machine);

            object obj = machine.GetGlobalObject("NewBehavior");
            Assert.IsNotNull(obj);
            Assert.IsInstanceOfType(obj, typeof(IClass));

            IClass cls = (IClass)obj;

            Assert.AreEqual("Behavior", ((IClass)cls.SuperClass).Name);

            Assert.IsNotNull(cls.Behavior.GetInstanceMethod("compile:"));
        }

        [TestMethod]
        [DeploymentItem(@"Library\Object.st")]
        [DeploymentItem(@"Library\Behavior.st")]
        [DeploymentItem(@"Library\Class.st")]
        [DeploymentItem(@"CodeFiles\ClassTest.st")]
        public void LoadClass()
        {
            Machine machine = CreateMachine();

            Loader loader = new Loader(@"Object.st", new SimpleCompiler());
            loader.LoadAndExecute(machine);
            loader = new Loader(@"Behavior.st", new SimpleCompiler());
            loader.LoadAndExecute(machine);
            loader = new Loader(@"Class.st", new SimpleCompiler());
            loader.LoadAndExecute(machine);
            loader = new Loader(@"ClassTest.st", new SimpleCompiler());
            loader.LoadAndExecute(machine);

            object obj = machine.GetGlobalObject("MyClass");

            Assert.IsNotNull(obj);
            Assert.IsInstanceOfType(obj, typeof(IClass));

            IClass cls = (IClass)obj;

            Assert.AreEqual("MyClass", cls.Name);
            Assert.AreEqual("Object", ((IClass)cls.SuperClass).Name);

            object obj2 = machine.GetGlobalObject("Rectangle");

            Assert.IsNotNull(obj2);
            Assert.IsInstanceOfType(obj2, typeof(IClass));

            IClass cls2 = (IClass)obj2;

            Assert.AreEqual("Rectangle", cls2.Name);
            Assert.AreEqual("Object", ((IClass)cls2.SuperClass).Name);
            Assert.AreEqual(2, cls2.NoInstanceVariables);
            Assert.AreEqual(0, cls2.Behavior.NoInstanceVariables);
            Assert.AreEqual(1, cls2.NoClassVariables);
            Assert.AreEqual("width height", cls2.GetInstanceVariableNamesAsString());
            Assert.AreEqual("Number", cls2.GetClassVariableNamesAsString());

            object obj3 = machine.GetGlobalObject("rect");

            Assert.IsNotNull(obj3);
            Assert.IsInstanceOfType(obj3, typeof(IObject));

            IObject rect = (IObject)obj3;

            Assert.AreEqual(cls2, rect.Behavior);
            Assert.AreEqual(100, rect[0]);
            Assert.AreEqual(50, rect[1]);
        }

        [TestMethod]
        [DeploymentItem(@"CodeFiles\Library1.st")]
        public void ReviewClassGraph()
        {
            Loader loader = new Loader(@"Library1.st", new SimpleCompiler());

            Machine machine = CreateMachine();

            loader.LoadAndExecute(machine);

            IBehavior objclass = (IBehavior)machine.GetGlobalObject("Object");
            Assert.IsNotNull(objclass);
            Assert.IsNotNull(objclass.Behavior);
            Assert.IsNotNull(objclass.MetaClass);
            Assert.IsNull(objclass.SuperClass);

            IBehavior behclass = (IBehavior)machine.GetGlobalObject("Behavior");
            Assert.IsNotNull(behclass);
            Assert.IsNotNull(behclass.Behavior);
            Assert.IsNotNull(behclass.MetaClass);
            Assert.IsNotNull(behclass.SuperClass);

            Assert.AreEqual(objclass, behclass.SuperClass);
            Assert.AreEqual(objclass.MetaClass, behclass.MetaClass.SuperClass);

            IClassDescription classdes = (IClassDescription)machine.GetGlobalObject("ClassDescription");
            Assert.IsNotNull(classdes);
            Assert.IsNotNull(classdes.Behavior);
            Assert.IsNotNull(classdes.MetaClass);
            Assert.IsNotNull(classdes.SuperClass);

            Assert.AreEqual(behclass, classdes.SuperClass);
            Assert.AreEqual(behclass.MetaClass, classdes.MetaClass.SuperClass);

            IClass clazz = (IClass)machine.GetGlobalObject("Class");
            Assert.IsNotNull(clazz);
            Assert.IsNotNull(clazz.Behavior);
            Assert.IsNotNull(clazz.MetaClass);
            Assert.IsNotNull(clazz.SuperClass);

            Assert.AreEqual(classdes, clazz.SuperClass);
            Assert.AreEqual(classdes.MetaClass, clazz.MetaClass.SuperClass);

            Assert.AreEqual(clazz, objclass.MetaClass.SuperClass);
        }

        [TestMethod]
        [DeploymentItem(@"CodeFiles\Library2.st")]
        public void ReviewClassGraphUsingLibrary2()
        {
            Loader loader = new Loader(@"Library2.st", new SimpleCompiler());

            Machine machine = CreateMachine();

            loader.LoadAndExecute(machine);

            IBehavior objclass = (IBehavior)machine.GetGlobalObject("Object");
            Assert.IsNotNull(objclass);
            Assert.IsNotNull(objclass.Behavior);
            Assert.IsNotNull(objclass.MetaClass);
            Assert.IsNull(objclass.SuperClass);

            IBehavior behclass = (IBehavior)machine.GetGlobalObject("Behavior");
            Assert.IsNotNull(behclass);
            Assert.IsNotNull(behclass.Behavior);
            Assert.IsNotNull(behclass.MetaClass);
            Assert.IsNotNull(behclass.SuperClass);

            Assert.AreEqual(objclass, behclass.SuperClass);
            Assert.AreEqual(objclass.MetaClass, behclass.MetaClass.SuperClass);

            IClassDescription classdes = (IClassDescription)machine.GetGlobalObject("ClassDescription");
            Assert.IsNotNull(classdes);
            Assert.IsNotNull(classdes.Behavior);
            Assert.IsNotNull(classdes.MetaClass);
            Assert.IsNotNull(classdes.SuperClass);

            Assert.AreEqual(behclass, classdes.SuperClass);
            Assert.AreEqual(behclass.MetaClass, classdes.MetaClass.SuperClass);

            IClass clazz = (IClass)machine.GetGlobalObject("Class");
            Assert.IsNotNull(clazz);
            Assert.IsNotNull(clazz.Behavior);
            Assert.IsNotNull(clazz.MetaClass);
            Assert.IsNotNull(clazz.SuperClass);

            Assert.AreEqual(classdes, clazz.SuperClass);
            Assert.AreEqual(classdes.MetaClass, clazz.MetaClass.SuperClass);

            Assert.AreEqual(clazz, objclass.MetaClass.SuperClass);

            Assert.IsNotNull(objclass.GetClassMethod("new"));
        }

        [TestMethod]
        [DeploymentItem(@"CodeFiles\NativeBehavior.st")]
        public void LoadNativeBehavior()
        {
            Loader loader = new Loader(@"NativeBehavior.st", new SimpleCompiler());

            Machine machine = CreateMachine();

            loader.LoadAndExecute(machine);

            object result = machine.GetGlobalObject("myList");

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(ArrayList));

            ArrayList list = (ArrayList)result;

            Assert.AreEqual(2, list.Count);
            Assert.AreEqual(1, list[0]);
            Assert.AreEqual("foo", list[1]);
        }

        [TestMethod]
        [DeploymentItem(@"CodeFiles\NativeRectangle.st")]
        public void LoadNativeRectangle()
        {
            Loader loader = new Loader(@"NativeRectangle.st", new SimpleCompiler());

            Machine machine = CreateMachine();

            loader.LoadAndExecute(machine);

            object result1 = machine.GetGlobalObject("Rectangle");

            Assert.IsNotNull(result1);
            Assert.IsInstanceOfType(result1, typeof(NativeBehavior));

            object result2 = machine.GetGlobalObject("rect");

            Assert.IsNotNull(result2);
            Assert.IsInstanceOfType(result2, typeof(Rectangle));

            object result = machine.GetGlobalObject("result");

            Assert.AreEqual(200, result);
        }

        [TestMethod]
        [DeploymentItem(@"CodeFiles\NativeFileInfo.st")]
        public void LoadNativeFileInfo()
        {
            Loader loader = new Loader(@"NativeFileInfo.st", new SimpleCompiler());

            Machine machine = CreateMachine();

            loader.LoadAndExecute(machine);

            object result = machine.GetGlobalObject("myFileInfo");

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(FileInfo));

            Assert.IsFalse((bool)machine.GetGlobalObject("result"));
        }

        [TestMethod]
        public void ExecuteTwoCommands()
        {
            Loader loader = new Loader(new StringReader("a := 1. b := 2"), new SimpleCompiler());
            Machine machine = CreateMachine();
            loader.LoadAndExecute(machine);

            Assert.AreEqual(1, machine.GetGlobalObject("a"));
            Assert.AreEqual(2, machine.GetGlobalObject("b"));
        }

        [TestMethod]
        [DeploymentItem(@"CodeFiles\AsRemote.st")]
        public void DefineAsRemote()
        {
            Loader loader = new Loader(@"AsRemote.st", new SimpleCompiler());
            Machine machine = CreateMachine();
            loader.LoadAndExecute(machine);

            object result = machine.GetGlobalObject("Object");
            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(IClass));

            IClass cls = (IClass)result;
            IMethod mth = cls.GetInstanceMethod("asRemote");
            Assert.IsNotNull(mth);
        }

        [TestMethod]
        [DeploymentItem(@"CodeFiles\RemotingHostServer.st")]
        [DeploymentItem(@"CodeFiles\RemotingHostClient.st")]
        public void LoadRemotingHostServer()
        {
            Loader loader = new Loader(@"RemotingHostServer.st", new SimpleCompiler());
            Machine machine = CreateMachine();
            loader.LoadAndExecute(machine);

            object result = machine.GetGlobalObject("host");
            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(RemotingHostServer));

            RemotingHostServer host = (RemotingHostServer)result;

            Loader loader2 = new Loader(@"RemotingHostClient.st", new SimpleCompiler());
            Machine machine2 = CreateMachine();
            loader2.LoadAndExecute(machine2);

            Assert.IsNotNull(machine2.GetGlobalObject("Rectangle"));
            Assert.IsNotNull(host.Machine.GetGlobalObject("Rectangle"));

            object obj1 = machine2.GetGlobalObject("rect");
            object obj2 = host.Machine.GetGlobalObject("rect");

            Assert.IsNotNull(obj1);
            Assert.IsNotNull(obj2);
            Assert.IsInstanceOfType(obj1, typeof(IObject));
            Assert.IsInstanceOfType(obj2, typeof(IObject));

            IObject rect1 = (IObject)obj1;
            IObject rect2 = (IObject)obj2;

            Assert.AreEqual(200, rect1[0]);
            Assert.AreEqual(30, rect1[1]);

            Assert.AreEqual(300, rect2[0]);
            Assert.AreEqual(40, rect2[1]);

            host.Stop();
        }

        [TestMethod]
        [DeploymentItem(@"CodeFiles\FileOut01.st")]
        public void LoadFileOut01()
        {
            Loader loader = new Loader(@"FileOut01.st", new SimpleCompiler());

            Machine machine = CreateMachine();

            loader.LoadAndExecute(machine);

            object result = machine.GetGlobalObject("Object");

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(BaseClass));
        }

        [TestMethod]
        [DeploymentItem(@"CodeFiles\FileOut02.st")]
        public void LoadFileOut02()
        {
            Loader loader = new Loader(@"FileOut02.st", new SimpleCompiler());

            Machine machine = CreateMachine();

            loader.LoadAndExecute(machine);

            object result = machine.GetGlobalObject("Object");

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(BaseClass));
        }

        [TestMethod]
        [DeploymentItem(@"CodeFiles\Library2.st")]
        [DeploymentItem(@"CodeFiles\PharoCorePoint.st")]
        public void LoadPharoCorePoint()
        {
            Loader loaderlib = new Loader(@"Library2.st", new SimpleCompiler());
            Loader loader = new Loader(@"PharoCorePoint.st", new SimpleCompiler());

            Machine machine = CreateMachine();

            loaderlib.LoadAndExecute(machine);
            loader.LoadAndExecute(machine);

            object result = machine.GetGlobalObject("Point");

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(BaseClass));
        }

        [TestMethod]
        [DeploymentItem(@"CodeFiles\Library2.st")]
        [DeploymentItem(@"CodeFiles\PharoCoreRectangle.st")]
        public void LoadPharoCoreRectangle()
        {
            Loader loaderlib = new Loader(@"Library2.st", new SimpleCompiler());
            Loader loader = new Loader(@"PharoCoreRectangle.st", new SimpleCompiler());

            Machine machine = CreateMachine();

            loaderlib.LoadAndExecute(machine);
            loader.LoadAndExecute(machine);

            object result = machine.GetGlobalObject("Rectangle");

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(BaseClass));
        }

        [TestMethod]
        [DeploymentItem(@"CodeFiles\Library2.st")]
        [DeploymentItem(@"CodeFiles\PharoCoreKernelObjects.st")]
        public void LoadPharoCoreKernelObjects()
        {
            Loader loaderlib = new Loader(@"Library2.st", new SimpleCompiler());
            Loader loader = new Loader(@"PharoCoreKernelObjects.st", new SimpleCompiler());

            Machine machine = CreateMachine();

            loaderlib.LoadAndExecute(machine);
            loader.LoadAndExecute(machine);

            object result = machine.GetGlobalObject("Object");

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(BaseClass));

            result = machine.GetGlobalObject("ProtoObject");

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(BaseClass));

            result = machine.GetGlobalObject("Boolean");

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(BaseClass));

            result = machine.GetGlobalObject("UndefinedObject");

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(BaseClass));
        }

        [TestMethod]
        [DeploymentItem(@"CodeFiles\Library2.st")]
        [DeploymentItem(@"CodeFiles\PharoCoreKernelObjects.st")]
        [DeploymentItem(@"CodeFiles\PharoKernelNumbers.st")]
        public void LoadPharoKernelNumbers()
        {
            Loader loaderlib = new Loader(@"Library2.st", new SimpleCompiler());
            Loader loaderobj = new Loader(@"PharoCoreKernelObjects.st", new SimpleCompiler());
            Loader loader = new Loader(@"PharoKernelNumbers.st", new SimpleCompiler());

            Machine machine = CreateMachine();

            loaderlib.LoadAndExecute(machine);
            loaderobj.LoadAndExecute(machine);
            loader.LoadAndExecute(machine);

            object result = machine.GetGlobalObject("Object");

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(BaseClass));

            result = machine.GetGlobalObject("ProtoObject");

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(BaseClass));

            result = machine.GetGlobalObject("Boolean");

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(BaseClass));

            result = machine.GetGlobalObject("UndefinedObject");

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(BaseClass));

            result = machine.GetGlobalObject("Float");

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(BaseClass));
        }

        [TestMethod]
        [DeploymentItem(@"CodeFiles\Library2.st")]
        [DeploymentItem(@"CodeFiles\PharoCoreKernelObjects.st")]
        [DeploymentItem(@"CodeFiles\PharoKernelClasses.st")]
        public void LoadPharoKernelClassesSkippingReservedMethods()
        {
            Loader loaderlib = new Loader(@"Library2.st", new SimpleCompiler());
            Loader loaderobj = new Loader(@"PharoCoreKernelObjects.st", new SimpleCompiler());
            Loader loader = new Loader(@"PharoKernelClasses.st", new SimpleCompiler());

            Machine machine = CreateMachine();

            loaderlib.LoadAndExecute(machine);
            object result = machine.GetGlobalObject("Object");

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(BaseClass));

            result = machine.GetGlobalObject("Behavior");

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(BaseClass));
            var cls = (BaseClass)result;
            Assert.IsNotNull(cls.GetInstanceMethod("uses:instanceVariableNames:"));
            Assert.IsNotNull(cls.GetInstanceMethod("subclass:uses:instanceVariableNames:classVariableNames:poolDictionaries:category:"));

            loaderobj.LoadAndExecute(machine);
            loader.LoadAndExecute(machine);

            result = machine.GetGlobalObject("ProtoObject");

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(BaseClass));

            result = machine.GetGlobalObject("Boolean");

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(BaseClass));

            result = machine.GetGlobalObject("UndefinedObject");

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(BaseClass));
        }

        internal static Machine CreateMachine()
        {
            Machine machine = new Machine(true);

            object nil = machine.UndefinedObjectClass;

            Assert.IsNotNull(nil);
            Assert.IsInstanceOfType(nil, typeof(IClass));

            return machine;
        }
    }
}


text:
using System.ComponentModel.DataAnnotations;

namespace AspNetCore.Sample.Models
{
    public class CreateBookViewModel
    {
        public string Name { get; set; }

        public string Author { get; set; }
    }

    public class CreateBookDto
    {
        [Required]
        public string Name { get; set; }

        [Required]
        public string Author { get; set; }
    }
}