text:
import logging
from typing import cast

from pants.base.specs import AddressLiteralSpec, FileLiteralSpec, RawSpecs, Specs
from pants.base.specs_parser import SpecsParser
from pants.core.util_rules.environments import determine_bootstrap_environment
from pants.core.util_rules.system_binaries import GitBinary, GitBinaryRequest
from pants.engine.addresses import AddressInput
from pants.engine.environment import EnvironmentName
from pants.engine.internals.scheduler import SchedulerSession
from pants.engine.internals.selectors import Params
from pants.engine.rules import QueryRule
from pants.option.options import Options
from pants.option.options_bootstrapper import OptionsBootstrapper
from pants.vcs.changed import ChangedAddresses, ChangedOptions, ChangedRequest
from pants.vcs.git import GitWorktreeRequest, MaybeGitWorktree

logger = logging.getLogger(__name__)

class InvalidSpecConstraint(Exception):
    """Raised when invalid constraints are given via specs and arguments like --changed*."""

def calculate_specs(
    options_bootstrapper: OptionsBootstrapper,
    options: Options,
    session: SchedulerSession,
) -> Specs:
    """Determine the specs for a given Pants run."""
    global_options = options.for_global_scope()
    unmatched_cli_globs = global_options.unmatched_cli_globs.to_glob_match_error_behavior()
    specs = SpecsParser().parse_specs(
        options.specs,
        description_of_origin="CLI arguments",
        unmatched_glob_behavior=unmatched_cli_globs,
    )

    changed_options = ChangedOptions.from_options(options.for_scope("changed"))
    logger.debug("specs are: %s", specs)
    logger.debug("changed_options are: %s", changed_options)

    if specs and changed_options.provided:
        changed_name = "--changed-since" if changed_options.since else "--changed-diffspec"
        specs_description = specs.arguments_provided_description()
        assert specs_description is not None
        raise InvalidSpecConstraint(
            f"You used `{changed_name}` at the same time as using {specs_description}. You can "
            f"only use `{changed_name}` or use normal arguments."
        )

    if not changed_options.provided:
        return specs

    bootstrap_environment = determine_bootstrap_environment(session)

    (git_binary,) = session.product_request(
        GitBinary, [Params(GitBinaryRequest(), bootstrap_environment)]
    )
    (maybe_git_worktree,) = session.product_request(
        MaybeGitWorktree, [Params(GitWorktreeRequest(), git_binary, bootstrap_environment)]
    )
    if not maybe_git_worktree.git_worktree:
        raise InvalidSpecConstraint(
            "The `--changed-*` options are only available if Git is used for the repository."
        )

    changed_files = tuple(changed_options.changed_files(maybe_git_worktree.git_worktree))
    file_literal_specs = tuple(FileLiteralSpec(f) for f in changed_files)

    changed_request = ChangedRequest(changed_files, changed_options.dependees)
    (changed_addresses,) = session.product_request(
        ChangedAddresses,
        [Params(changed_request, options_bootstrapper, bootstrap_environment)],
    )
    logger.debug("changed addresses: %s", changed_addresses)

    address_literal_specs = []
    for address in cast(ChangedAddresses, changed_addresses):
        address_input = AddressInput.parse(address.spec, description_of_origin="`--changed-since`")
        address_literal_specs.append(
            AddressLiteralSpec(
                path_component=address_input.path_component,
                target_component=address_input.target_component,
                generated_component=address_input.generated_component,
                parameters=address_input.parameters,
            )
        )

    return Specs(
        includes=RawSpecs(
            # We need both address_literals and file_literals to cover all our edge cases, including
            # target-aware vs. target-less goals, e.g. `list` vs `count-loc`.
            address_literals=tuple(address_literal_specs),
            file_literals=file_literal_specs,
            unmatched_glob_behavior=unmatched_cli_globs,
            filter_by_global_options=True,
            from_change_detection=True,
            description_of_origin="`--changed-since`",
        ),
        ignores=RawSpecs(description_of_origin="`--changed-since`"),
    )

def rules():
    return [
        QueryRule(ChangedAddresses, [ChangedRequest, EnvironmentName]),
        QueryRule(GitBinary, [GitBinaryRequest, EnvironmentName]),
        QueryRule(MaybeGitWorktree, [GitWorktreeRequest, GitBinary, EnvironmentName]),
    ]


text: This is the Bootstrap/HTML5 - CodeIgniter Boilerplate.

redpajama_set_name: RedPajamaGithub


text:
"""Handles Channel API requests.

Includes a WSGI application that serves the 'jsapi' JavaScript code and handles
channel polling HTTP requests, to connect and retrieve messages.
"""

import os

import google
import webapp2

from google.appengine.api import apiproxy_stub_map
from google.appengine.api.channel import channel_service_stub

# Regex for all requests routed through this module.
# Note: Other URLs in the _ah/channel namespace may be handled by the user.
CHANNEL_URL_PATTERN = '_ah/channel/(?:jsapi|dev)'

_JSAPI_PATH = os.path.join(os.path.dirname(os.path.dirname(__file__)),
                           'dev-channel-js.js')

# These error statuses (including the message) are explicitly mandated in the
# Channel JavaScript documentation.
INVALID_TOKEN_STATUS = '401 Invalid+token.'
TOKEN_TIMED_OUT_STATUS = '401 Token+timed+out.'

def _get_channel_stub():
  """Gets the ChannelServiceStub instance from the API proxy stub map.

  Returns:
    The ChannelServiceStub instance as registered in the API stub map.
  """
  return apiproxy_stub_map.apiproxy.GetStub('channel')

class DevHandler(webapp2.RequestHandler):
  """The request handler for the 'connect' and 'poll' requests."""

  def get(self):
    # Remove the default Content-Type. If there is any content, the correct
    # Content-Type will be set later.
    del self.response.headers['Content-Type']
    stub = _get_channel_stub()

    command = self.request.get('command', None)
    token = self.request.get('channel', None)
    if command is None or token is None:
      self.response.status = 400
      return

    if command == 'connect':
      try:
        stub.connect_channel(token)
      except channel_service_stub.InvalidTokenError:
        self.response.status = INVALID_TOKEN_STATUS
        return
      except channel_service_stub.TokenTimedOutError:
        self.response.status = TOKEN_TIMED_OUT_STATUS
        return
      self.response.headers['Content-Type'] = 'text/plain'
      self.response.out.write('1')
    elif command == 'poll':
      try:
        # TODO: Wait up to N seconds for a message to arrive before
        # returning empty (long poll).
        message = stub.connect_and_pop_first_message(token)
      except channel_service_stub.InvalidTokenError:
        self.response.status = INVALID_TOKEN_STATUS
        return
      except channel_service_stub.TokenTimedOutError:
        self.response.status = TOKEN_TIMED_OUT_STATUS
        return
      if message is not None:
        self.response.headers['Content-Type'] = 'application/json'
        self.response.out.write(message)
    else:
      self.response.status = 400

class JSAPIHandler(webapp2.RequestHandler):
  """The request handler for the jsapi static JavaScript code."""

  def get(self):
    # TODO: Reuse code in static_files_handler to do cache control.
    self.response.headers['Content-Type'] = 'text/javascript'
    self.response.out.write(open(_JSAPI_PATH).read())

application = webapp2.WSGIApplication([
    ('/_ah/channel/dev', DevHandler),
    ('/_ah/channel/jsapi', JSAPIHandler),
], debug=True)


text:
=encoding utf8

=head1 TITLE

Synopsis 5: Regexes and Rules

This document is now maintained in the pugs repository.  See L<http://perlcabal.org/syn/>.


text:
package org.butterfaces.component.html;

import org.butterfaces.component.html.feature.*;
import org.butterfaces.component.html.feature.*;

public interface HtmlInputComponent extends Style, StyleClass, Validation, Readonly, Required, Label, HideLabel, SupportedFacets {

    Object getValue();

    String getClientId();

}


text:
package com.spaceappschallenge.whereonearth;

import java.util.ArrayList;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.location.LocationManager;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class CategoriesActivity extends Activity {
	Button natural, manmade;
	Intent pageMover;
	String result, searchQuery, httpRequestUrl;
	EditText searchBox;
	Handler handler;
	ArrayList<PostObject> postObjectArray;
	PostObject postObject;
	ProgressDialog progressDialog;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.activity_categories);
		natural = (Button)findViewById(R.id.nutural_button);
		manmade = (Button)findViewById(R.id.manmade_button);
		searchBox  = (EditText)findViewById(R.id.searchBox);

	}

	public void NaturalClick(View view) {

		pageMover = new Intent (CategoriesActivity.this, Question.class);
		startActivity(pageMover);
	}

	public void ManmadeClick(View view) {
		pageMover = new Intent (CategoriesActivity.this, ManMadeCatActivity.class);
		startActivity(pageMover);
	}

	public void clickSearch(View view){

		 ConnectivityManager connMgr = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
	      NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
	      if (networkInfo != null && networkInfo.isConnected())
	      		{

			searchQuery  = searchBox.getText().toString();
			Intent intent = new Intent(CategoriesActivity.this, SearchResult.class);
			intent.putExtra("search", searchQuery);
			startActivity(intent);

	      		}
	      else {
			        // display error when Internet is not available
	    	  Toast.makeText(CategoriesActivity.this, "Internet is not available", Toast.LENGTH_LONG).show();

	}

	}

	public void clickPlaces(View view){

		 final LocationManager manager = (LocationManager) getSystemService( Context.LOCATION_SERVICE );

		    if ( !manager.isProviderEnabled( LocationManager.GPS_PROVIDER ) ) {
		        buildAlertMessageNoGps();
		    }
		    else{

		    	 Intent intent = new Intent(CategoriesActivity.this, Places.class);
        		 startActivity(intent);
		    	}

		 }

	private void buildAlertMessageNoGps() {
	    final AlertDialog.Builder builder = new AlertDialog.Builder(this);
	    builder.setMessage("Your GPS seems to be disabled, do you want to enable it?")
	           .setCancelable(false)
	           .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
	               public void onClick(@SuppressWarnings("unused") final DialogInterface dialog, @SuppressWarnings("unused") final int id) {

	            	   startActivity(new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS));

	               }
	           })
	           .setNegativeButton("No", new DialogInterface.OnClickListener() {
	               public void onClick(final DialogInterface dialog, @SuppressWarnings("unused") final int id) {
	                    dialog.cancel();

	               }
	           });
	    final AlertDialog alert = builder.create();
	    alert.show();
	}

	public void  clickTutorial(View view){
		Intent tutorialIntent = new Intent(CategoriesActivity.this, GridViewTutorial.class);
		startActivity(tutorialIntent);

	}

	public void clickRemote(View view){

		Intent remoteIntent = new Intent(CategoriesActivity.this, RemoteSensing.class);
		startActivity(remoteIntent);

	}

}


text:
#pragma once
#include <aws/iot/IoT_EXPORTS.h>
#include <aws/iot/IoTRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/iot/model/Tag.h>
#include <utility>

namespace Aws
{
namespace IoT
{
namespace Model
{

  /**
   *
The input for the CreatePolicy operation.

See Also:
   AWS
   * API Reference

   */
  class AWS_IOT_API CreatePolicyRequest : public IoTRequest
  {
  public:
    CreatePolicyRequest();

    // Service request name is the Operation name which will send this request out,
    // each operation should has unique request name, so that we can get operation's name from this request.
    // Note: this is not true for response, multiple operations may have the same response name,
    // so we can not get operation's name from response.
    inline virtual const char* GetServiceRequestName() const override { return "CreatePolicy"; }

    Aws::String SerializePayload() const override;

    /**
     *
The policy name.

     */
    inline const Aws::String& GetPolicyName() const{ return m_policyName; }

    /**
     *
The policy name.

     */
    inline bool PolicyNameHasBeenSet() const { return m_policyNameHasBeenSet; }

    /**
     *
The policy name.

     */
    inline void SetPolicyName(const Aws::String& value) { m_policyNameHasBeenSet = true; m_policyName = value; }

    /**
     *
The policy name.

     */
    inline void SetPolicyName(Aws::String&& value) { m_policyNameHasBeenSet = true; m_policyName = std::move(value); }

    /**
     *
The policy name.

     */
    inline void SetPolicyName(const char* value) { m_policyNameHasBeenSet = true; m_policyName.assign(value); }

    /**
     *
The policy name.

     */
    inline CreatePolicyRequest& WithPolicyName(const Aws::String& value) { SetPolicyName(value); return *this;}

    /**
     *
The policy name.

     */
    inline CreatePolicyRequest& WithPolicyName(Aws::String&& value) { SetPolicyName(std::move(value)); return *this;}

    /**
     *
The policy name.

     */
    inline CreatePolicyRequest& WithPolicyName(const char* value) { SetPolicyName(value); return *this;}

    /**
     *
The JSON document that describes the policy. policyDocument must have
     * a minimum length of 1, with a maximum length of 2048, excluding whitespace.

     */
    inline const Aws::String& GetPolicyDocument() const{ return m_policyDocument; }

    /**
     *
The JSON document that describes the policy. policyDocument must have
     * a minimum length of 1, with a maximum length of 2048, excluding whitespace.

     */
    inline bool PolicyDocumentHasBeenSet() const { return m_policyDocumentHasBeenSet; }

    /**
     *
The JSON document that describes the policy. policyDocument must have
     * a minimum length of 1, with a maximum length of 2048, excluding whitespace.

     */
    inline void SetPolicyDocument(const Aws::String& value) { m_policyDocumentHasBeenSet = true; m_policyDocument = value; }

    /**
     *
The JSON document that describes the policy. policyDocument must have
     * a minimum length of 1, with a maximum length of 2048, excluding whitespace.

     */
    inline void SetPolicyDocument(Aws::String&& value) { m_policyDocumentHasBeenSet = true; m_policyDocument = std::move(value); }

    /**
     *
The JSON document that describes the policy. policyDocument must have
     * a minimum length of 1, with a maximum length of 2048, excluding whitespace.

     */
    inline void SetPolicyDocument(const char* value) { m_policyDocumentHasBeenSet = true; m_policyDocument.assign(value); }

    /**
     *
The JSON document that describes the policy. policyDocument must have
     * a minimum length of 1, with a maximum length of 2048, excluding whitespace.

     */
    inline CreatePolicyRequest& WithPolicyDocument(const Aws::String& value) { SetPolicyDocument(value); return *this;}

    /**
     *
The JSON document that describes the policy. policyDocument must have
     * a minimum length of 1, with a maximum length of 2048, excluding whitespace.

     */
    inline CreatePolicyRequest& WithPolicyDocument(Aws::String&& value) { SetPolicyDocument(std::move(value)); return *this;}

    /**
     *
The JSON document that describes the policy. policyDocument must have
     * a minimum length of 1, with a maximum length of 2048, excluding whitespace.

     */
    inline CreatePolicyRequest& WithPolicyDocument(const char* value) { SetPolicyDocument(value); return *this;}

    /**
     *
Metadata which can be used to manage the policy.

For URI
     * Request parameters use format: ...key1=value1&key2=value2...

For the
     * CLI command-line parameter use format: &&tags
     * "key1=value1&key2=value2..."

For the cli-input-json file use format:
     * "tags": "key1=value1&key2=value2..."

     */
    inline const Aws::Vector<Tag>& GetTags() const{ return m_tags; }

    /**
     *
Metadata which can be used to manage the policy.

For URI
     * Request parameters use format: ...key1=value1&key2=value2...

For the
     * CLI command-line parameter use format: &&tags
     * "key1=value1&key2=value2..."

For the cli-input-json file use format:
     * "tags": "key1=value1&key2=value2..."

     */
    inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }

    /**
     *
Metadata which can be used to manage the policy.

For URI
     * Request parameters use format: ...key1=value1&key2=value2...

For the
     * CLI command-line parameter use format: &&tags
     * "key1=value1&key2=value2..."

For the cli-input-json file use format:
     * "tags": "key1=value1&key2=value2..."

     */
    inline void SetTags(const Aws::Vector<Tag>& value) { m_tagsHasBeenSet = true; m_tags = value; }

    /**
     *
Metadata which can be used to manage the policy.

For URI
     * Request parameters use format: ...key1=value1&key2=value2...

For the
     * CLI command-line parameter use format: &&tags
     * "key1=value1&key2=value2..."

For the cli-input-json file use format:
     * "tags": "key1=value1&key2=value2..."

     */
    inline void SetTags(Aws::Vector<Tag>&& value) { m_tagsHasBeenSet = true; m_tags = std::move(value); }

    /**
     *
Metadata which can be used to manage the policy.

For URI
     * Request parameters use format: ...key1=value1&key2=value2...

For the
     * CLI command-line parameter use format: &&tags
     * "key1=value1&key2=value2..."

For the cli-input-json file use format:
     * "tags": "key1=value1&key2=value2..."

     */
    inline CreatePolicyRequest& WithTags(const Aws::Vector<Tag>& value) { SetTags(value); return *this;}

    /**
     *
Metadata which can be used to manage the policy.

For URI
     * Request parameters use format: ...key1=value1&key2=value2...

For the
     * CLI command-line parameter use format: &&tags
     * "key1=value1&key2=value2..."

For the cli-input-json file use format:
     * "tags": "key1=value1&key2=value2..."

     */
    inline CreatePolicyRequest& WithTags(Aws::Vector<Tag>&& value) { SetTags(std::move(value)); return *this;}

    /**
     *
Metadata which can be used to manage the policy.

For URI
     * Request parameters use format: ...key1=value1&key2=value2...

For the
     * CLI command-line parameter use format: &&tags
     * "key1=value1&key2=value2..."

For the cli-input-json file use format:
     * "tags": "key1=value1&key2=value2..."

     */
    inline CreatePolicyRequest& AddTags(const Tag& value) { m_tagsHasBeenSet = true; m_tags.push_back(value); return *this; }

    /**
     *
Metadata which can be used to manage the policy.

For URI
     * Request parameters use format: ...key1=value1&key2=value2...

For the
     * CLI command-line parameter use format: &&tags
     * "key1=value1&key2=value2..."

For the cli-input-json file use format:
     * "tags": "key1=value1&key2=value2..."

     */
    inline CreatePolicyRequest& AddTags(Tag&& value) { m_tagsHasBeenSet = true; m_tags.push_back(std::move(value)); return *this; }

  private:

    Aws::String m_policyName;
    bool m_policyNameHasBeenSet;

    Aws::String m_policyDocument;
    bool m_policyDocumentHasBeenSet;

    Aws::Vector<Tag> m_tags;
    bool m_tagsHasBeenSet;
  };

} // namespace Model
} // namespace IoT
} // namespace Aws


text:
import { Suite } from 'benchmark';
import { benchmarkFatestStatus, benchmarkCycle } from '../../.fixtures/benchmark';
import { is } from '../index.next';

new Suite()

.add('describeType.is.a(String, "foo")', () => {
	is.a(String, 'foo');
})

.add('typeof "foo" === "string"', () => {
	typeof 'foo' === 'string';
})

.add('toString.call("foo") === "[object String]"', () => {
	Object.prototype.toString.call('foo') === '[object String]';
})

.on('cycle', benchmarkCycle())

.on('complete', benchmarkFatestStatus(/toString/))

.run({ async: false });


text:
PrimerRepository
================


text:
<?php

namespace Enqueue\AmqpExt\Tests\Spec;

use Enqueue\AmqpExt\AmqpConnectionFactory;
use Enqueue\AmqpExt\AmqpContext;
use Enqueue\AmqpTools\RabbitMqDlxDelayStrategy;
use Interop\Queue\Context;
use Interop\Queue\Spec\SendAndReceiveDelayedMessageFromQueueSpec;

/**
 * @group functional
 */
class AmqpSendAndReceiveDelayedMessageWithDlxStrategyTest extends SendAndReceiveDelayedMessageFromQueueSpec
{
    /**
     * {@inheritdoc}
     */
    protected function createContext()
    {
        $factory = new AmqpConnectionFactory(getenv('AMQP_DSN'));
        $factory->setDelayStrategy(new RabbitMqDlxDelayStrategy());

        return $factory->createContext();
    }

    /**
     * @param AmqpContext $context
     *
     * {@inheritdoc}
     */
    protected function createQueue(Context $context, $queueName)
    {
        $queue = parent::createQueue($context, $queueName);

        $context->declareQueue($queue);
        $context->purgeQueue($queue);

        return $queue;
    }
}


text:
<?php

namespace Dms\Web\Laravel\Tests\Unit\Action\ExceptionHandler;

use Dms\Core\Auth\AdminForbiddenException;
use Dms\Core\Form\InvalidFormSubmissionException;
use Dms\Core\Module\IAction;
use Dms\Web\Laravel\Action\ActionExceptionHandlerCollection;
use Dms\Web\Laravel\Action\ExceptionHandler\InvalidFormSubmissionExceptionHandler;
use Dms\Web\Laravel\Action\ExceptionHandler\AdminForbiddenExceptionHandler;
use Dms\Web\Laravel\Action\UnhandleableActionExceptionException;
use Dms\Web\Laravel\Http\ModuleContext;
use Dms\Web\Laravel\Tests\Mock\Language\MockLanguageProvider;
use Dms\Web\Laravel\Tests\Unit\UnitTest;

/**
 * @author Elliot Levin <elliotlevin@hotmail.com>
 */
class ActionExceptionHandlerCollectionTest extends UnitTest
{
    /**
     * @var ActionExceptionHandlerCollection
     */
    protected $collection;

    public function setUp(): void
    {
        $this->collection = new ActionExceptionHandlerCollection([
            new InvalidFormSubmissionExceptionHandler(new MockLanguageProvider()),
            new AdminForbiddenExceptionHandler(),
        ]);
    }

    public function testFindHandler()
    {
        $this->assertInstanceOf(
            InvalidFormSubmissionExceptionHandler::class,
            $this->collection->findHandlerFor($this->mockModuleContext(), $this->mockAction(), $this->createMock(InvalidFormSubmissionException::class))
        );

        $this->assertInstanceOf(
            AdminForbiddenExceptionHandler::class,
            $this->collection->findHandlerFor($this->mockModuleContext(), $this->mockAction(), $this->createMock(AdminForbiddenException::class))
        );
    }

    public function testUnhandleableException()
    {
        $this->expectException(UnhandleableActionExceptionException::class);

        $this->collection->findHandlerFor($this->mockModuleContext(), $this->mockAction(), new \Exception());
    }

    protected function mockModuleContext() : ModuleContext
    {
        return $this->createMock(ModuleContext::class);
    }

    protected function mockAction() : IAction
    {
        return $this->getMockForAbstractClass(IAction::class);
    }
}


text:
"use strict";
var core_1 = require('@angular/core');
var core_private_1 = require('../../../core_private');
var lang_1 = require('../../facade/lang');
var dom_adapter_1 = require('../dom_adapter');
var dom_renderer_1 = require('../dom_renderer');
var CORE_TOKENS = {
    'ApplicationRef': core_1.ApplicationRef,
    'NgZone': core_1.NgZone
};
var INSPECT_GLOBAL_NAME = 'ng.probe';
var CORE_TOKENS_GLOBAL_NAME = 'ng.coreTokens';
/**
 * Returns a {@link DebugElement} for the given native DOM element, or
 * null if the given native element does not have an Angular view associated
 * with it.
 */
function inspectNativeElement(element /** TODO #9100 */) {
    return core_1.getDebugNode(element);
}
exports.inspectNativeElement = inspectNativeElement;
function _createConditionalRootRenderer(rootRenderer /** TODO #9100 */) {
    if (lang_1.assertionsEnabled()) {
        return _createRootRenderer(rootRenderer);
    }
    return rootRenderer;
}
function _createRootRenderer(rootRenderer /** TODO #9100 */) {
    dom_adapter_1.getDOM().setGlobalVar(INSPECT_GLOBAL_NAME, inspectNativeElement);
    dom_adapter_1.getDOM().setGlobalVar(CORE_TOKENS_GLOBAL_NAME, CORE_TOKENS);
    return new core_private_1.DebugDomRootRenderer(rootRenderer);
}
/**
 * Providers which support debugging Angular applications (e.g. via `ng.probe`).
 */
exports.ELEMENT_PROBE_PROVIDERS = [{ provide: core_1.RootRenderer, useFactory: _createConditionalRootRenderer, deps: [dom_renderer_1.DomRootRenderer] }];
exports.ELEMENT_PROBE_PROVIDERS_PROD_MODE = [{ provide: core_1.RootRenderer, useFactory: _createRootRenderer, deps: [dom_renderer_1.DomRootRenderer] }];
//# sourceMappingURL=ng_probe.js.map


text:
package org.unitils.mock.core;

import org.unitils.core.util.ObjectToInjectHolder;
import org.unitils.mock.Mock;
import org.unitils.mock.annotation.MatchStatement;
import org.unitils.mock.argumentmatcher.ArgumentMatcherRepository;
import org.unitils.mock.core.matching.MatchingInvocationBuilder;
import org.unitils.mock.core.matching.MatchingInvocationHandler;
import org.unitils.mock.core.matching.impl.AssertInvokedInSequenceVerifyingMatchingInvocationHandler;
import org.unitils.mock.core.matching.impl.AssertInvokedVerifyingMatchingInvocationHandler;
import org.unitils.mock.core.matching.impl.AssertNotInvokedVerifyingMatchingInvocationHandler;
import org.unitils.mock.core.matching.impl.BehaviorDefiningMatchingInvocationHandler;
import org.unitils.mock.mockbehavior.MockBehavior;
import org.unitils.mock.mockbehavior.impl.ExceptionThrowingMockBehavior;
import org.unitils.mock.mockbehavior.impl.ValueReturningMockBehavior;

import java.lang.reflect.Field;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Map;

import static org.apache.commons.lang.StringUtils.isBlank;
import static org.apache.commons.lang.StringUtils.uncapitalize;
import static org.unitils.mock.core.proxy.ProxyFactory.createInitializedOrUninitializedInstanceOfType;
import static org.unitils.util.ReflectionUtils.getGenericType;

/**
 * Implementation of a Mock.
 *
 * @author Filip Neven
 * @author Tim Ducheyne
 * @author Kenny Claes
 */
public class MockObject<T> implements Mock<T>, MockFactory, ObjectToInjectHolder<T> {

    /* The name of the mock (e.g. the name of the field) */
    protected String name;
    /* The class type that is mocked */
    protected Class<T> mockedType;
    protected MockProxy<T> mockProxy;

    /* Mock behaviors that are removed once they have been matched */
    protected BehaviorDefiningInvocations oneTimeMatchingBehaviorDefiningInvocations;
    /* Mock behaviors that can be matched and re-used for several invocation */
    protected BehaviorDefiningInvocations alwaysMatchingBehaviorDefiningInvocations;
    /* Created chained mocks per mock name */
    protected Map<String, Mock<?>> chainedMocksPerName;

    /* The scenario that will record all observed invocations */
    protected static ThreadLocal<Scenario> scenarioThreadLocal = new ThreadLocal<Scenario>();

    protected static ThreadLocal<MatchingInvocationBuilder> matchingInvocationBuilderThreadLocal = new ThreadLocal<MatchingInvocationBuilder>();

    public static Scenario getCurrentScenario() {
        return scenarioThreadLocal.get();
    }

    /**
     * Creates a mock of the given type with un-capitalized type name + Mock as name, e.g. myServiceMock.
     *
     * There is no .class literal for generic types. Therefore you need to pass the raw type when mocking generic types.
     * E.g. Mock<List<String>> myMock = new MockObject("myMock", List.class, this);
     *
     * If the mocked type does not correspond to the declared type, a ClassCastException will occur when the mock
     * is used.
     *
     * @param mockedType The mock type that will be proxied, use the raw type when mocking generic types, not null
     * @param testObject The test object, not null
     */
    public MockObject(Class<?> mockedType, Object testObject) {
        this(null, mockedType, testObject);
    }

    /**
     * Creates a mock of the given type.
     *
     * There is no .class literal for generic types. Therefore you need to pass the raw type when mocking generic types.
     * E.g. Mock<List<String>> myMock = new MockObject("myMock", List.class, this);
     *
     * If the mocked type does not correspond to the declared type, a ClassCastException will occur when the mock
     * is used.
     *
     * If no name is given the un-capitalized type name + Mock is used, e.g. myServiceMock
     *
     * @param name       The name of the mock, e.g. the field-name, null for the default
     * @param mockedType The mock type that will be proxied, use the raw type when mocking generic types, not null
     * @param testObject The test object, not null
     */
    @SuppressWarnings({"unchecked"})
    public MockObject(String name, Class<?> mockedType, Object testObject) {
        if (isBlank(name)) {
            this.name = uncapitalize(mockedType.getSimpleName()) + "Mock";
        } else {
            this.name = name;
        }
        this.mockedType = (Class<T>) mockedType;
        this.oneTimeMatchingBehaviorDefiningInvocations = createOneTimeMatchingBehaviorDefiningInvocations();
        this.alwaysMatchingBehaviorDefiningInvocations = createAlwaysMatchingBehaviorDefiningInvocations();
        this.chainedMocksPerName = new HashMap<String, Mock<?>>();

        Scenario scenario = getScenario(testObject);
        if (scenario.getTestObject() != testObject) {
            scenario.reset();
            getMatchingInvocationBuilder().reset();
            scenario.setTestObject(testObject);
        }
        this.mockProxy = createMockProxy();
    }

    //
    // Implementation of the ObjectToInjectHolder interface. Implementing this interface makes sure that the
    // proxy instance is injected instead of this object (which doesn't directly implement the mocked interface)
    //

    /**
     * Returns the mock proxy instance. This is the object that must be injected if the field that it holds is
     * annotated with @InjectInto or one of it's equivalents.
     *
     * @return The mock proxy instance, not null
     */
    public T getObjectToInject() {
        return getMock();
    }

    /**
     * @param field The field that declared this mock object, null if there is no field (or not known)
     * @return The type of the object to inject (i.e. the mocked type), not null.
     */
    public Type getObjectToInjectType(Field field) {
        if (field == null) {
            return mockedType;
        }
        return getGenericType(field);
    }

    //
    // Implementation of the Mock interfaces
    //

    /**
     * Returns the mock proxy instance. This is the instance that can be used to perform the test.
     * You could for example inject it in the tested object. It will then perform the defined behavior and record
     * all observed method invocations so that assertions can be performed afterwards.
     *
     * @return The proxy instance, not null
     */
    public T getMock() {
        return mockProxy.getProxy();
    }

    /**
     * @return the type of the mock, not null
     */
    public Class<?> getMockedType() {
        return mockedType;
    }

    /**
     * Defines behavior for this mock so that it will return the given value when the invocation following
     * this call matches the observed behavior. E.g.
     *

     * mock.returns("aValue").method1();
     *

     * will return "aValue" when method1 is called.
     *

     * Note that this behavior is executed each time a match is found. So "aValue" will be returned
     * each time method1() is called. If you only want to return the value once, use the {@link #onceReturns} method.
     *
     * @param returnValue The value to return
     * @return The proxy instance that will record the method call, not null
     */
    @MatchStatement
    public T returns(Object returnValue) {
        MatchingInvocationHandler matchingInvocationHandler = createAlwaysMatchingBehaviorDefiningMatchingInvocationHandler(new ValueReturningMockBehavior(returnValue));
        return startMatchingInvocation(matchingInvocationHandler);
    }

    /**
     * Defines behavior for this mock so that it raises the given exception when the invocation following
     * this call matches the observed behavior. E.g.
     *

     * mock.raises(new MyException()).method1();
     *

     * will throw the given exception when method1 is called.
     *

     * Note that this behavior is executed each time a match is found. So the exception will be raised
     * each time method1() is called. If you only want to raise the exception once, use the {@link #onceRaises} method.
     *
     * @param exception The exception to raise, not null
     * @return The proxy instance that will record the method call, not null
     */
    @MatchStatement
    public T raises(Throwable exception) {
        MatchingInvocationHandler matchingInvocationHandler = createAlwaysMatchingBehaviorDefiningMatchingInvocationHandler(new ExceptionThrowingMockBehavior(exception));
        return startMatchingInvocation(matchingInvocationHandler);
    }

    /**
     * Defines behavior for this mock so that it raises the given exception when the invocation following
     * this call matches the observed behavior. E.g.
     *

     * mock.raises(MyException.class).method1();
     *

     * will throw an instance of the given exception class when method1 is called.
     *

     * Note that this behavior is executed each time a match is found. So the exception will be raised
     * each time method1() is called. If you only want to raise the exception once, use the {@link #onceRaises} method.
     *
     * @param exceptionClass The type of exception to raise, not null
     * @return The proxy instance that will record the method call, not null
     */
    @MatchStatement
    public T raises(Class<? extends Throwable> exceptionClass) {
        Throwable exception = createInitializedOrUninitializedInstanceOfType(exceptionClass);
        exception.fillInStackTrace();
        MatchingInvocationHandler matchingInvocationHandler = createAlwaysMatchingBehaviorDefiningMatchingInvocationHandler(new ExceptionThrowingMockBehavior(exception));
        return startMatchingInvocation(matchingInvocationHandler);
    }

    /**
     * Defines behavior for this mock so that will be performed when the invocation following
     * this call matches the observed behavior. E.g.
     *

     * mock.performs(new MyMockBehavior()).method1();
     *

     * will execute the given mock behavior when method1 is called.
     *

     * Note that this behavior is executed each time a match is found. So the behavior will be executed
     * each time method1() is called. If you only want to execute the behavior once, use the {@link #oncePerforms} method.
     *
     * @param mockBehavior The behavior to perform, not null
     * @return The proxy instance that will record the method call, not null
     */
    @MatchStatement
    public T performs(MockBehavior mockBehavior) {
        MatchingInvocationHandler matchingInvocationHandler = createAlwaysMatchingBehaviorDefiningMatchingInvocationHandler(mockBehavior);
        return startMatchingInvocation(matchingInvocationHandler);
    }

    /**
     * Defines behavior for this mock so that it will return the given value when the invocation following
     * this call matches the observed behavior. E.g.
     *

     * mock.returns("aValue").method1();
     *

     * will return "aValue" when method1 is called.
     *

     * Note that this behavior is executed only once. If method1() is invoked a second time, a different
     * behavior definition will be used (if defined) or a default value will be returned. If you want this
     * definition to be able to be matched multiple times, use the method {@link #returns} instead.
     *
     * @param returnValue The value to return
     * @return The proxy instance that will record the method call, not null
     */
    @MatchStatement
    public T onceReturns(Object returnValue) {
        MatchingInvocationHandler matchingInvocationHandler = createOneTimeMatchingBehaviorDefiningMatchingInvocationHandler(new ValueReturningMockBehavior(returnValue));
        return startMatchingInvocation(matchingInvocationHandler);
    }

    /**
     * Defines behavior for this mock so that it raises the given exception when the invocation following
     * this call matches the observed behavior. E.g.
     *

     * mock.raises(new MyException()).method1();
     *

     * will throw the given exception when method1 is called.
     *

     * Note that this behavior is executed only once. If method1() is invoked a second time, a different
     * behavior definition will be used (if defined) or a default value will be returned. If you want this
     * definition to be able to be matched multiple times, use the method {@link #raises} instead.
     *
     * @param exception The exception to raise, not null
     * @return The proxy instance that will record the method call, not null
     */
    @MatchStatement
    public T onceRaises(Throwable exception) {
        MatchingInvocationHandler matchingInvocationHandler = createOneTimeMatchingBehaviorDefiningMatchingInvocationHandler(new ExceptionThrowingMockBehavior(exception));
        return startMatchingInvocation(matchingInvocationHandler);
    }

    /**
     * Defines behavior for this mock so that it raises an instance of the given exception class when the invocation following
     * this call matches the observed behavior. E.g.
     *

     * mock.raises(new MyException()).method1();
     *

     * will throw an instance of the given exception class when method1 is called.
     *

     * Note that this behavior is executed only once. If method1() is invoked a second time, a different
     * behavior definition will be used (if defined) or a default value will be returned. If you want this
     * definition to be able to be matched multiple times, use the method {@link #raises} instead.
     *
     * @param exceptionClass The type of exception to raise, not null
     * @return The proxy instance that will record the method call, not null
     */
    @MatchStatement
    public T onceRaises(Class<? extends Throwable> exceptionClass) {
        Throwable exception = createInitializedOrUninitializedInstanceOfType(exceptionClass);
        MatchingInvocationHandler matchingInvocationHandler = createOneTimeMatchingBehaviorDefiningMatchingInvocationHandler(new ExceptionThrowingMockBehavior(exception));
        return startMatchingInvocation(matchingInvocationHandler);
    }

    /**
     * Defines behavior for this mock so that will be performed when the invocation following
     * this call matches the observed behavior. E.g.
     *

     * mock.performs(new MyMockBehavior()).method1();
     *

     * will execute the given mock behavior when method1 is called.
     *

     * Note that this behavior is executed only once. If method1() is invoked a second time, a different
     * behavior definition will be used (if defined) or a default value will be returned. If you want this
     * definition to be able to be matched multiple times, use the method {@link #performs} instead.
     *
     * @param mockBehavior The behavior to perform, not null
     * @return The proxy instance that will record the method call, not null
     */
    @MatchStatement
    public T oncePerforms(MockBehavior mockBehavior) {
        MatchingInvocationHandler matchingInvocationHandler = createOneTimeMatchingBehaviorDefiningMatchingInvocationHandler(mockBehavior);
        return startMatchingInvocation(matchingInvocationHandler);
    }

    /**
     * Asserts that an invocation that matches the invocation following this call has been observed
     * on this mock object during this test.
     *
     * @return The proxy instance that will record the method call, not null
     */
    @MatchStatement
    public T assertInvoked() {
        MatchingInvocationHandler matchingInvocationHandler = createAssertInvokedVerifyingMatchingInvocationHandler();
        return startMatchingInvocation(matchingInvocationHandler);
    }

    /**
     * Asserts that an invocation that matches the invocation following this call has been observed
     * on this mock object during this test.
     *

     * If this method is used multiple times during the current test, the sequence of the observed method
     * calls has to be the same as the sequence of the calls to this method.
     *
     * @return The proxy instance that will record the method call, not null
     */
    @MatchStatement
    public T assertInvokedInSequence() {
        MatchingInvocationHandler matchingInvocationHandler = createAssertInvokedInSequenceVerifyingMatchingInvocationHandler();
        return startMatchingInvocation(matchingInvocationHandler);
    }

    /**
     * Asserts that no invocation that matches the invocation following this call has been observed
     * on this mock object during this test.
     *
     * @return The proxy instance that will record the method call, not null
     */
    @MatchStatement
    public T assertNotInvoked() {
        MatchingInvocationHandler matchingInvocationHandler = createAssertNotInvokedVerifyingMatchingInvocationHandler();
        return startMatchingInvocation(matchingInvocationHandler);
    }

    /**
     * Removes all behavior defined for this mock.
     * This will only remove the behavior, not the observed invocations for this mock.
     */
    @MatchStatement
    public void resetBehavior() {
        oneTimeMatchingBehaviorDefiningInvocations.clear();
        alwaysMatchingBehaviorDefiningInvocations.clear();
        chainedMocksPerName.clear();
        getMatchingInvocationBuilder().reset();
        ArgumentMatcherRepository.getInstance().reset();
    }

    @SuppressWarnings({"unchecked"})
    public <M> Mock<M> createChainedMock(String name, Class<M> mockedType) {
        Mock<?> chainedMock = chainedMocksPerName.get(name);
        if (chainedMock != null) {
            return (Mock<M>) chainedMock;
        }
        try {
            if (Void.class.equals(mockedType) || mockedType.isPrimitive() || mockedType.isArray()) {
                return null;
            }
            chainedMock = new MockObject<M>(name, mockedType, getCurrentScenario().getTestObject());
            chainedMocksPerName.put(name, chainedMock);
            return (Mock<M>) chainedMock;

        } catch (Throwable t) {
            return null;
        }
    }

    public String getName() {
        return name;
    }

    protected T startMatchingInvocation(MatchingInvocationHandler matchingInvocationHandler) {
        return getMatchingInvocationBuilder().startMatchingInvocation(name, mockedType, matchingInvocationHandler);
    }

    protected synchronized MatchingInvocationBuilder getMatchingInvocationBuilder() {
        MatchingInvocationBuilder matchingInvocationBuilder = matchingInvocationBuilderThreadLocal.get();
        if (matchingInvocationBuilder == null) {
            matchingInvocationBuilder = createMatchingInvocationBuilder();
            matchingInvocationBuilderThreadLocal.set(matchingInvocationBuilder);
        }
        return matchingInvocationBuilder;
    }

    protected synchronized Scenario getScenario(Object testObject) {
        Scenario scenario = scenarioThreadLocal.get();
        if (scenario == null) {
            scenario = createScenario(testObject);
            scenarioThreadLocal.set(scenario);
        }
        return scenario;
    }

    protected MockProxy<T> createMockProxy() {
        return new MockProxy<T>(name, mockedType, oneTimeMatchingBehaviorDefiningInvocations, alwaysMatchingBehaviorDefiningInvocations, getCurrentScenario(), getMatchingInvocationBuilder());
    }

    protected MatchingInvocationHandler createOneTimeMatchingBehaviorDefiningMatchingInvocationHandler(MockBehavior mockBehavior) {
        return new BehaviorDefiningMatchingInvocationHandler(mockBehavior, oneTimeMatchingBehaviorDefiningInvocations, this);
    }

    protected MatchingInvocationHandler createAlwaysMatchingBehaviorDefiningMatchingInvocationHandler(MockBehavior mockBehavior) {
        return new BehaviorDefiningMatchingInvocationHandler(mockBehavior, alwaysMatchingBehaviorDefiningInvocations, this);
    }

    protected BehaviorDefiningInvocations createOneTimeMatchingBehaviorDefiningInvocations() {
        return new BehaviorDefiningInvocations(true);
    }

    protected BehaviorDefiningInvocations createAlwaysMatchingBehaviorDefiningInvocations() {
        return new BehaviorDefiningInvocations(false);
    }

    protected MatchingInvocationHandler createAssertInvokedVerifyingMatchingInvocationHandler() {
        return new AssertInvokedVerifyingMatchingInvocationHandler(getCurrentScenario(), this);
    }

    protected MatchingInvocationHandler createAssertInvokedInSequenceVerifyingMatchingInvocationHandler() {
        return new AssertInvokedInSequenceVerifyingMatchingInvocationHandler(getCurrentScenario(), this);
    }

    protected MatchingInvocationHandler createAssertNotInvokedVerifyingMatchingInvocationHandler() {
        return new AssertNotInvokedVerifyingMatchingInvocationHandler(getCurrentScenario(), this);
    }

    protected Scenario createScenario(Object testObject) {
        return new Scenario(testObject);
    }

    protected MatchingInvocationBuilder createMatchingInvocationBuilder() {
        return new MatchingInvocationBuilder();
    }

}


text:
// Copyright 2020 The Oppia Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the 'License');
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an 'AS-IS' BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
 * @fileoverview Unit tests for stateParamChangesEditor component.
 */

import { NO_ERRORS_SCHEMA } from '@angular/core';
import { ComponentFixture, async, TestBed } from '@angular/core/testing';
import { StateParamChangesService } from
  // eslint-disable-next-line max-len
  'components/state-editor/state-editor-properties-services/state-param-changes.service';
import { StateParamChangesEditorComponent } from
  // eslint-disable-next-line max-len
  'pages/exploration-editor-page/editor-tab/state-param-changes-editor/state-param-changes-editor.component';

let component: StateParamChangesEditorComponent;
let fixture: ComponentFixture<StateParamChangesEditorComponent>;
describe('State Param Changes Editor directive', () => {
  let stateParamChangesService: StateParamChangesService;
  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [StateParamChangesEditorComponent],
      providers: [],
      schemas: [NO_ERRORS_SCHEMA]
    }).compileComponents();
    stateParamChangesService =
      TestBed.get(StateParamChangesService);
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(StateParamChangesEditorComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should evaluate controller properties', () => {
    expect(component.spcs).toEqual(stateParamChangesService);
  });
});


text:
namespace DAFrame
{
	class CConnectionPool;

	class CPoolConnection
		:public CConnection
	{
	public:

		void close();

		bool isClosed();

		~CPoolConnection();

		std::auto_ptr<CConnection> clone();

		virtual int getErrNo() const
		{
			return 0;
		};

		virtual const char * getError() const
		{
			return NULL;
		}

		void putConnection();

	protected:
		friend class ::DAFrame::CConnectionPool;
		CPoolConnection(
			CConnectionImpl* connImpl ,
			CConnectionPool* connectionPool
			);

		CConnectionPool* _connectionPool;

		bool _isIdle;
	};
}

#endif


text:
local R = require "rigel"
local RM = require "generators.modules"
local ffi = require("ffi")
local types = require("types")
local S = require("systolic")
local harness = require "generators.harness"
local C = require "generators.examplescommon"

W = 128
H = 64

local scale = tonumber(string.sub(arg[0],string.find(arg[0],"%d+")))

------------
inp = R.input( types.rv(types.Par(types.array2d(types.uint(8),W,H))) )
b = R.apply("b", RM.upsample( types.uint(8), W,H, scale,scale) , inp)
p100 = RM.lambda( "p100", inp, b )
------------
hsfn = RM.makeHandshake(p100)

harness{ outFile="upsample_"..tostring(scale), fn=hsfn, inFile="frame_128.raw", inSize={W,H}, outSize={W*scale,H*scale} }


text:
import PdvModel from './pdv-model';
import logger from '../../utils/logger';

export default class PdvBusiness {
  constructor (model) {
    if (!model) {
      this._model = new PdvModel();
    } else {
      this._model = model;
    }
  }

  getById (id, callback) {
    var start = new Date();
    this._model.getById(id).then((pdv) => {
      var end = new Date() - start;
      logger.info('==> BUSINESS.getById ID: ' + id + ' TIME: %dms ', end);

      callback(null, pdv);
    }, (err) => { callback(err); });
  }

  createPdv (obj, callback) {
    var start = new Date();
    this._model.create(obj).then((pdv) => {
      var objPdv = {
        tradingName: pdv.tradingName,
        ownerName: pdv.ownerName,
        document: pdv.document,
        id: pdv.id
      };

      var end = new Date() - start;
      logger.info('==> BUSINESS.createPdv TIME: %dms ', end);

      callback(null, objPdv);
    }, (err) => {
      var errors = [];

      if (err.name === 'ValidationError') {
        errors = err.message.toString().split(', ');
      } else if (err.message.indexOf('duplicate key error') !== -1) {
        errors = ['document: "{DOCUMENT}" already exist'.replace('{DOCUMENT}', obj.document)];
      } else {
        errors = [err];
      }

      callback(errors);
    });
  }

  getClosestPdv (lng, lat, callback) {
    var start = new Date();
    var errors = [];

    // valid the longitude and latitude values
    if (isNaN(lng) || isNaN(lat)) {
      errors.push('Longitude or Latitude should be Number');
    } else {
      if (lng < -180 || lng > 180) { errors.push('Longitute is out of bounds (-180, +180)'); }

      if (lat < -90 || lat > 90) { errors.push('Latitude is out of bounds (-90, +90)'); }
    }

    if (errors.length > 0) { return callback(errors); }

    this._model.getClosestPdv(lng, lat).then((pdv) => {
      var end = new Date() - start;
      logger.info('==> BUSINESS.getClosestPdv TIME: %dms ', end);

      callback(null, pdv);
    }, (err) => {
      callback(err);
    });
  }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WebDaemonShared
{
	public enum ApiErrorCode
	{
		None=0,
		GeneralException,
		MissingParameter,
		UnknownMarket,
		InvalidAddress,
		InvalidAccount,
		OrderNotFound,
		UnknownCurrency,
		NetworkAlert
	}

	public class ApiError
	{
		public string message;
		public ApiErrorCode error;

		public ApiError(string e, ApiErrorCode code)
		{
			message = e;
			error = code;
		}
	}

	public class UnsupportedTransactionException : Exception
	{
		public string m_trxId;

		public UnsupportedTransactionException(string t)
		{
			m_trxId = t;
		}

		public override string ToString()
		{
			return "Unsupported transaction detected: " + m_trxId;
		}
	}

	public class RefundBitcoinException : RefundBitsharesException
	{
		public RefundBitcoinException(string memo) : base(memo) { }
	}

	public class RefundBitsharesException : Exception
	{
		string m_memo;

		public RefundBitsharesException(string memo)
		{
			m_memo = memo;
		}

		public override string Message
		{
			get { return m_memo; }
		}
	}

	public class ApiException : Exception
	{
		public ApiError m_error;

		public ApiException( ApiError error )
		{
			m_error = error;
		}

		public override string Message
		{
			get { return m_error.message; }
		}
	}

	public class ApiExceptionGeneral : ApiException
	{
		public ApiExceptionGeneral() : base(new ApiError("Ooops, a general API exception occured!", ApiErrorCode.GeneralException)) { }
	}

	public class ApiExceptionMissingParameter : ApiException
	{
		public ApiExceptionMissingParameter() : base(new ApiError("Missing parameter", ApiErrorCode.MissingParameter)){}
	}

	public class ApiExceptionUnknownMarket : ApiException
	{
		public ApiExceptionUnknownMarket(string symbolPair) : base(new ApiError(symbolPair + " is not a recognised market!", ApiErrorCode.UnknownMarket)) { }
	}

	public class ApiExceptionInvalidAddress : ApiException
	{
		public ApiExceptionInvalidAddress(string address) : base(new ApiError(address + " is not a valid bitcoin address!", ApiErrorCode.InvalidAddress)) { }
	}

	public class ApiExceptionInvalidAccount : ApiException
	{
		public ApiExceptionInvalidAccount(string account) : base(new ApiError(account + " is not an existing account! Are you sure it is registered?", ApiErrorCode.InvalidAccount)) { }
	}

	public class ApiExceptionOrderNotFound : ApiException
	{
		public ApiExceptionOrderNotFound(string txid) : base(new ApiError("Order " + txid + " not found!", ApiErrorCode.OrderNotFound)) { }
	}

	public class ApiExceptionUnknownCurrency : ApiException
	{
		public ApiExceptionUnknownCurrency(string symbol) : base(new ApiError("Unknown currency " + symbol, ApiErrorCode.UnknownCurrency)) { }
	}

	public class ApiExceptionNetworkAlert : ApiException
	{
		public ApiExceptionNetworkAlert() : base(new ApiError("Service is suspended due to bitshares network alert", ApiErrorCode.NetworkAlert)) { }
	}
}


text:
package rappsilber.ms.statistics.utils;

import java.util.HashMap;
import java.util.Map;

/**
 * calculates average and standard deviation over streaming data (e.g. seen only ones and not stored)

 Found an algorithm online, that was for awk:
 awk '{delta = $1 - avg; avg += delta / NR; mean2 += delta * ($1 - avg); } END { print sqrt(mean2 / NR); }'
 and transfered this into a class.

 source:
 http://www.commandlinefu.com/commands/view/3442/display-the-standard-deviation-of-a-column-of-numbers-with-awk

 And also calculates an estimate of the histogramMedian based on a histogram of the data
 *
 * @author Lutz Fischer <l.fischer@ed.ac.uk>
 */
public class StreamingAverageMedianThreadSafe extends StreamingMedianEstimator {

    HashMap<Thread,values> threadedValues = new HashMap<Thread, values>();

    public StreamingAverageMedianThreadSafe() {
    }

    public StreamingAverageMedianThreadSafe(double medianResolution) {
        super(medianResolution);
    }

    public StreamingAverageMedianThreadSafe(double medianResolution, int maxMedianBins) {
        super(medianResolution,maxMedianBins);
    }

    /**
     * changes the average and  mean2 value to accompany the given value.

     * Therfore taking the value into account for the average and standard deviation.
     * @param v
     */
    @Override
    public void addValue(double v) {
        super.addValue(v);
        values threadValues = threadedValues.get(Thread.currentThread());
        if (threadValues == null ) {
            threadValues = new values();
            threadedValues.put(Thread.currentThread(), threadValues);
        }
        threadValues.addValue(v);
    }

    /**
     * returns the average over all seen values
     * @return
     */
    public double average() {
        double count = 0;
        double sum = 0;
        for (values v : threadedValues.values()) {

            count+= v.m_count;
            sum  += v.m_count*v.m_avg;
        }
        return sum/count;
    }

    public double getMax() {
        double max = -Double.MAX_VALUE;
        for (values v : threadedValues.values()) {
            double m = v.getMax();
            if (m>max)
                max = m;
        }

        return max;
    }

    public double getMin() {
        double min = Double.MAX_VALUE;
        for (values v : threadedValues.values()) {
            double m = v.getMin();
            if (m<min)
                min = m;
        }

        return min;
    }

    /**
     * returns the standard deviation over all seen values
     * @return
     */
    public double stdDev() {
        double u=0;
        double l=0;
        double mean = average();
        for (values v : threadedValues.values()) {
            double s = v.stdDev();
            double c = v.m_count;
            double m = v.average();
            u+=c*s*s+c*(m-mean)*(m-mean);
            l+=c;
        }
        return Math.sqrt(u/l);
    }

    /**
     * a private class to calculate the average and stdev for each calling thread
     * separately
     */
    private class values {

        double m_avg = 0;
        int    m_count = 0;
        double m_max = Double.MIN_VALUE;
        double m_mean2 = 0;
        double m_min = Double.MAX_VALUE;

        /**
         * changes the average and  mean2 value to accompany the given value.

         * Therfore taking the value into account for the average and standard deviation.
         * @param v
         */
        public void addValue(double v) {
            m_count++;
            double delta = v - m_avg;
            m_avg += delta / m_count;
            m_mean2 += delta * (v - m_avg);
            if (m_min > v)
                m_min = v;
            else if (m_max < v)
                m_max = v;

        }

        /**
         * returns the average over all seen values
         * @return
         */
        public double average() {
            return m_avg;
        }

        public double getMax() {
            return m_max;
        }

        public double getMin() {
            return m_min;
        }

        /**
         * returns the standard deviation over all seen values
         * @return
         */
        public double stdDev() {
            return Math.sqrt(m_mean2 / m_count);
        }
    }

}


text:
package org.apache.asterix.api.java;

import java.io.PrintWriter;
import java.io.Reader;
import java.util.List;

import org.apache.asterix.api.common.APIFramework;
import org.apache.asterix.app.translator.QueryTranslator;
import org.apache.asterix.common.context.IStorageComponentProvider;
import org.apache.asterix.common.dataflow.ICcApplicationContext;
import org.apache.asterix.common.utils.Job;
import org.apache.asterix.compiler.provider.ILangCompilationProvider;
import org.apache.asterix.lang.common.base.IParser;
import org.apache.asterix.lang.common.base.IParserFactory;
import org.apache.asterix.lang.common.base.Statement;
import org.apache.asterix.metadata.MetadataManager;
import org.apache.asterix.translator.IStatementExecutor;
import org.apache.asterix.translator.IStatementExecutorFactory;
import org.apache.asterix.translator.SessionConfig;
import org.apache.asterix.translator.SessionConfig.OutputFormat;
import org.apache.asterix.translator.SessionOutput;
import org.apache.hyracks.api.client.IHyracksClientConnection;
import org.apache.hyracks.api.job.JobSpecification;

public class AsterixJavaClient {
    private IHyracksClientConnection hcc;
    private Reader queryText;
    private PrintWriter writer;

    private Job[] dmlJobs;
    private JobSpecification queryJobSpec;

    private final ILangCompilationProvider compilationProvider;
    private final IParserFactory parserFactory;
    private final APIFramework apiFramework;
    private final IStatementExecutorFactory statementExecutorFactory;
    private final IStorageComponentProvider storageComponentProvider;
    private ICcApplicationContext appCtx;

    public AsterixJavaClient(ICcApplicationContext appCtx, IHyracksClientConnection hcc, Reader queryText,
            PrintWriter writer, ILangCompilationProvider compilationProvider,
            IStatementExecutorFactory statementExecutorFactory, IStorageComponentProvider storageComponentProvider) {
        this.appCtx = appCtx;
        this.hcc = hcc;
        this.queryText = queryText;
        this.writer = writer;
        this.compilationProvider = compilationProvider;
        this.statementExecutorFactory = statementExecutorFactory;
        this.storageComponentProvider = storageComponentProvider;
        apiFramework = new APIFramework(compilationProvider);
        parserFactory = compilationProvider.getParserFactory();
    }

    public AsterixJavaClient(ICcApplicationContext appCtx, IHyracksClientConnection hcc, Reader queryText,
            ILangCompilationProvider compilationProvider, IStatementExecutorFactory statementExecutorFactory,
            IStorageComponentProvider storageComponentProvider) {
        this(appCtx, hcc, queryText,
                // This is a commandline client and so System.out is appropriate
                new PrintWriter(System.out, true), // NOSONAR
                compilationProvider, statementExecutorFactory, storageComponentProvider);
    }

    public void compile() throws Exception {
        compile(true, false, false, false, false, false, false);
    }

    public void compile(boolean optimize, boolean printRewrittenExpressions, boolean printLogicalPlan,
            boolean printOptimizedPlan, boolean printPhysicalOpsOnly, boolean generateBinaryRuntime, boolean printJob)
            throws Exception {
        queryJobSpec = null;
        dmlJobs = null;

        if (queryText == null) {
            return;
        }
        int ch;
        StringBuilder builder = new StringBuilder();
        while ((ch = queryText.read()) != -1) {
            builder.append((char) ch);
        }
        IParser parser = parserFactory.createParser(builder.toString());
        List<Statement> statements = parser.parse();
        MetadataManager.INSTANCE.init();

        SessionConfig conf = new SessionConfig(OutputFormat.ADM, optimize, true, generateBinaryRuntime);
        conf.setOOBData(false, printRewrittenExpressions, printLogicalPlan, printOptimizedPlan, printJob);
        if (printPhysicalOpsOnly) {
            conf.set(SessionConfig.FORMAT_ONLY_PHYSICAL_OPS, true);
        }
        SessionOutput output = new SessionOutput(conf, writer);

        IStatementExecutor translator = statementExecutorFactory.create(appCtx, statements, output, compilationProvider,
                storageComponentProvider);
        translator.compileAndExecute(hcc, null, QueryTranslator.ResultDelivery.IMMEDIATE,
                null, new IStatementExecutor.Stats());
        writer.flush();
    }

    public void execute() throws Exception {
        if (dmlJobs != null) {
            apiFramework.executeJobArray(hcc, dmlJobs, writer);
        }
        if (queryJobSpec != null) {
            apiFramework.executeJobArray(hcc, new JobSpecification[] { queryJobSpec }, writer);
        }
    }

}


text:
<?php namespace Konduto\Tests;

use Konduto\Models\Order;

class OrderTest extends \PHPUnit_Framework_TestCase {

    function test_orderParse() {
        $order = new Order(array(
            "id" => uniqid(),
            "total_amount" => 100.01,
            "customer" => array(
                "id" => "28372",
                "tax_id" => "12345678909",
                "email" => "jsilva@exemplo.com.br"
            ),
            "payment" => array(
                array(
                    "type" => "credit",
                    "bin" => "123456",
                    "last4" => "0987",
                    "amount" => 99.00
                ),
                array(
                    "type" => "voucher",
                    "description" => "Coupon A",
                    "amount" => 1.01
                )
            ),
            "bureaux_queries" => array(
                array(
                    "service" => "emailage",
                    "response" => array(
                        "advice" => "Lower Fraud Risk",
                        "email" => "adriano.0123456abc@gmail.com",
                        "email_country" => "US",
                        "email_domain" => "gmail.com",
                        "email_domain_age" => "1995-08-13T04:00:00Z",
                        "email_domain_category" => "Webmail",
                        "email_domain_company" => "Google",
                        "email_domain_country" => "United States",
                        "email_domain_exists" => true,
                        "email_domain_is_corporate" => false,
                        "email_domain_other_info" => "Valid Webmail Domain from United States"
                    )
                ),
                array(
                    "service" => "whitepages",
                    "response" => array(
                        "email" => "adriano.0123456abc@gmail.com",
                        "email_domain" => "gmail.com"
                    )
                )
            ),
            "triggered_rules" => array(
                array(
                    "name" => "Cartão com BIN do Canadá",
                    "decision" => "decline"
                )
            ),
            "triggered_decision_list" => array(
                array(
                    "type" => "zip",
                    "trigger" => "shipping_zip",
                    "decision" => "review"
                ),
                array(
                    "type" => "email",
                    "trigger" => "email",
                    "decision" => "decline"
                )
            ),
            "events" => array(array(
                "name" => "Cirque de La Lune",
                "date" => "2020-02-10T20:00:00Z",
                "type" => "show",
                "subtype" => "circus",
                "venue" => array(
                   "name" => "United Hall",
                   "address" => "Av. das Nações",
                   "city" => "São Paulo",
                   "state" => "SP",
                   "country" => "Brazil",
                   "capacity" => 7000
                ),
                "tickets" => array(
                    array(
                        "id" => "t1012390",
                        "category" => "student",
                        "section" => "pista premium",
                        "premium" => true,
                        "attendee" => array(
                            "name" => "Alfredo Borges",
                            "document" => "12345678900",
                            "document_type" => "cpf",
                            "dob" => "2000-02-20"
                        )
                    )
                )
            ))

        ));
        $payment = $order->getPayment();
        $bureauxQueries = $order->getBureauxQueries();
        $triggeredRules = $order->getTriggeredRules();
        $triggeredDecList = $order->getTriggeredDecisionList();
        $events = $order->getEvents();
        $this->assertInstanceOf('Konduto\Models\CreditCard', $payment[0]);
        $this->assertInstanceOf('Konduto\Models\Payment', $payment[1]);
        $this->assertInstanceOf('Konduto\Models\BureauxQuery', $bureauxQueries[0]);
        $this->assertInstanceOf('Konduto\Models\Event', $events[0]);
        $this->assertEquals(1.01, $payment[1]->getAmount());
        $this->assertEquals("Coupon A", $payment[1]->getDescription());
        $this->assertEquals(99.0, $payment[0]->getAmount());
        $this->assertEquals(2, count($bureauxQueries));
        $this->assertEquals("emailage", $bureauxQueries[0]->getService());
        $this->assertEquals(11, count($bureauxQueries[0]->getResponse()));
        $this->assertEquals("Lower Fraud Risk", $bureauxQueries[0]->getResponse()["advice"]);
        $this->assertEquals("whitepages", $bureauxQueries[1]->getService());
        $this->assertEquals(2, count($bureauxQueries[1]->getResponse()));
        $this->assertEquals("gmail.com", $bureauxQueries[1]->getResponse()["email_domain"]);
        $this->assertEquals("Cartão com BIN do Canadá", $triggeredRules[0]->getName());
        $this->assertEquals("decline", $triggeredRules[0]->getDecision());
        $this->assertEquals(2, count($triggeredDecList));
        $this->assertEquals("shipping_zip", $triggeredDecList[0]->getTrigger());
        $this->assertEquals("decline", $triggeredDecList[1]->getDecision());

        $event = $events[0];
        $this->assertEquals("Cirque de La Lune", $event->getName());
        $this->assertInstanceOf('\DateTime', $event->getDate());
        $this->assertEquals("show", $event->getType());
        $this->assertEquals("circus", $event->getSubtype());
        $this->assertEquals(1, count($event->getTickets()));

        $venue = $event->getVenue();
        $this->assertEquals("United Hall", $venue->getName());
        $this->assertEquals("Av. das Nações", $venue->getAddress());
        $this->assertEquals("São Paulo", $venue->getCity());
        $this->assertEquals("SP", $venue->getState());
        $this->assertEquals("Brazil", $venue->getCountry());
        $this->assertEquals(7000, $venue->getCapacity());

        $ticket = $event->getTickets()[0];
        $this->assertEquals("t1012390", $ticket->getId());
        $this->assertEquals("student", $ticket->getCategory());
        $this->assertEquals("pista premium", $ticket->getSection());
        $this->assertEquals(true, $ticket->getPremium());

        $attendee = $ticket->getAttendee();
        $this->assertEquals("Alfredo Borges", $attendee->getName());
        $this->assertEquals("12345678900", $attendee->getDocument());
        $this->assertEquals("cpf", $attendee->getDocumentType());
        $this->assertInstanceOf('\DateTime', $attendee->getDob());
    }
}


text:
Rails.application.routes.draw do
  resources :books, except: [:update]
  resources :finished_books
end


text:
.class public abstract Landroid/app/IActivityController$Stub;
.super Landroid/os/Binder;
.source "IActivityController.java"

# interfaces
.implements Landroid/app/IActivityController;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/app/IActivityController;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x409
    name = "Stub"
.end annotation

.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Landroid/app/IActivityController$Stub$Proxy;
    }
.end annotation

# static fields
.field private static final DESCRIPTOR:Ljava/lang/String; = "android.app.IActivityController"

.field static final TRANSACTION_activityResuming:I = 0x2

.field static final TRANSACTION_activityStarting:I = 0x1

.field static final TRANSACTION_appCrashed:I = 0x3

.field static final TRANSACTION_appEarlyNotResponding:I = 0x4

.field static final TRANSACTION_appNotResponding:I = 0x5

.field static final TRANSACTION_systemNotResponding:I = 0x6

# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 19
    invoke-direct {p0}, Landroid/os/Binder;-><init>()V

    .line 20
    const-string v0, "android.app.IActivityController"

    invoke-virtual {p0, p0, v0}, Landroid/app/IActivityController$Stub;->attachInterface(Landroid/os/IInterface;Ljava/lang/String;)V

    .line 21
    return-void
.end method

.method public static asInterface(Landroid/os/IBinder;)Landroid/app/IActivityController;
    .locals 2
    .param p0, "obj"    # Landroid/os/IBinder;

    .prologue
    .line 28
    if-nez p0, :cond_0

    .line 29
    const/4 v0, 0x0

    .line 35
    :goto_0
    return-object v0

    .line 31
    :cond_0
    const-string v1, "android.app.IActivityController"

    invoke-interface {p0, v1}, Landroid/os/IBinder;->queryLocalInterface(Ljava/lang/String;)Landroid/os/IInterface;

    move-result-object v0

    .line 32
    .local v0, "iin":Landroid/os/IInterface;
    if-eqz v0, :cond_1

    instance-of v1, v0, Landroid/app/IActivityController;

    if-eqz v1, :cond_1

    .line 33
    check-cast v0, Landroid/app/IActivityController;

    goto :goto_0

    .line 35
    :cond_1
    new-instance v0, Landroid/app/IActivityController$Stub$Proxy;

    .end local v0    # "iin":Landroid/os/IInterface;
    invoke-direct {v0, p0}, Landroid/app/IActivityController$Stub$Proxy;-><init>(Landroid/os/IBinder;)V

    goto :goto_0
.end method

# virtual methods
.method public asBinder()Landroid/os/IBinder;
    .locals 0

    .prologue
    .line 39
    return-object p0
.end method

.method public onTransact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z
    .locals 11
    .param p1, "code"    # I
    .param p2, "data"    # Landroid/os/Parcel;
    .param p3, "reply"    # Landroid/os/Parcel;
    .param p4, "flags"    # I
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    const/4 v10, 0x0

    const/4 v9, 0x1

    .line 43
    sparse-switch p1, :sswitch_data_0

    .line 136
    invoke-super {p0, p1, p2, p3, p4}, Landroid/os/Binder;->onTransact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    move-result v9

    :goto_0
    return v9

    .line 47
    :sswitch_0
    const-string v1, "android.app.IActivityController"

    invoke-virtual {p3, v1}, Landroid/os/Parcel;->writeString(Ljava/lang/String;)V

    goto :goto_0

    .line 52
    :sswitch_1
    const-string v1, "android.app.IActivityController"

    invoke-virtual {p2, v1}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 54
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v1

    if-eqz v1, :cond_0

    .line 55
    sget-object v1, Landroid/content/Intent;->CREATOR:Landroid/os/Parcelable$Creator;

    invoke-interface {v1, p2}, Landroid/os/Parcelable$Creator;->createFromParcel(Landroid/os/Parcel;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/content/Intent;

    .line 61
    .local v2, "_arg0":Landroid/content/Intent;
    :goto_1
    invoke-virtual {p2}, Landroid/os/Parcel;->readString()Ljava/lang/String;

    move-result-object v3

    .line 62
    .local v3, "_arg1":Ljava/lang/String;
    invoke-virtual {p0, v2, v3}, Landroid/app/IActivityController$Stub;->activityStarting(Landroid/content/Intent;Ljava/lang/String;)Z

    move-result v0

    .line 63
    .local v0, "_result":Z
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    .line 64
    if-eqz v0, :cond_1

    move v1, v9

    :goto_2
    invoke-virtual {p3, v1}, Landroid/os/Parcel;->writeInt(I)V

    goto :goto_0

    .line 58
    .end local v0    # "_result":Z
    .end local v2    # "_arg0":Landroid/content/Intent;
    .end local v3    # "_arg1":Ljava/lang/String;
    :cond_0
    const/4 v2, 0x0

    .restart local v2    # "_arg0":Landroid/content/Intent;
    goto :goto_1

    .restart local v0    # "_result":Z
    .restart local v3    # "_arg1":Ljava/lang/String;
    :cond_1
    move v1, v10

    .line 64
    goto :goto_2

    .line 69
    .end local v0    # "_result":Z
    .end local v2    # "_arg0":Landroid/content/Intent;
    .end local v3    # "_arg1":Ljava/lang/String;
    :sswitch_2
    const-string v1, "android.app.IActivityController"

    invoke-virtual {p2, v1}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 71
    invoke-virtual {p2}, Landroid/os/Parcel;->readString()Ljava/lang/String;

    move-result-object v2

    .line 72
    .local v2, "_arg0":Ljava/lang/String;
    invoke-virtual {p0, v2}, Landroid/app/IActivityController$Stub;->activityResuming(Ljava/lang/String;)Z

    move-result v0

    .line 73
    .restart local v0    # "_result":Z
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    .line 74
    if-eqz v0, :cond_2

    move v10, v9

    :cond_2
    invoke-virtual {p3, v10}, Landroid/os/Parcel;->writeInt(I)V

    goto :goto_0

    .line 79
    .end local v0    # "_result":Z
    .end local v2    # "_arg0":Ljava/lang/String;
    :sswitch_3
    const-string v1, "android.app.IActivityController"

    invoke-virtual {p2, v1}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 81
    invoke-virtual {p2}, Landroid/os/Parcel;->readString()Ljava/lang/String;

    move-result-object v2

    .line 83
    .restart local v2    # "_arg0":Ljava/lang/String;
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v3

    .line 85
    .local v3, "_arg1":I
    invoke-virtual {p2}, Landroid/os/Parcel;->readString()Ljava/lang/String;

    move-result-object v4

    .line 87
    .local v4, "_arg2":Ljava/lang/String;
    invoke-virtual {p2}, Landroid/os/Parcel;->readString()Ljava/lang/String;

    move-result-object v5

    .line 89
    .local v5, "_arg3":Ljava/lang/String;
    invoke-virtual {p2}, Landroid/os/Parcel;->readLong()J

    move-result-wide v6

    .line 91
    .local v6, "_arg4":J
    invoke-virtual {p2}, Landroid/os/Parcel;->readString()Ljava/lang/String;

    move-result-object v8

    .local v8, "_arg5":Ljava/lang/String;
    move-object v1, p0

    .line 92
    invoke-virtual/range {v1 .. v8}, Landroid/app/IActivityController$Stub;->appCrashed(Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;JLjava/lang/String;)Z

    move-result v0

    .line 93
    .restart local v0    # "_result":Z
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    .line 94
    if-eqz v0, :cond_3

    move v10, v9

    :cond_3
    invoke-virtual {p3, v10}, Landroid/os/Parcel;->writeInt(I)V

    goto :goto_0

    .line 99
    .end local v0    # "_result":Z
    .end local v2    # "_arg0":Ljava/lang/String;
    .end local v3    # "_arg1":I
    .end local v4    # "_arg2":Ljava/lang/String;
    .end local v5    # "_arg3":Ljava/lang/String;
    .end local v6    # "_arg4":J
    .end local v8    # "_arg5":Ljava/lang/String;
    :sswitch_4
    const-string v1, "android.app.IActivityController"

    invoke-virtual {p2, v1}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 101
    invoke-virtual {p2}, Landroid/os/Parcel;->readString()Ljava/lang/String;

    move-result-object v2

    .line 103
    .restart local v2    # "_arg0":Ljava/lang/String;
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v3

    .line 105
    .restart local v3    # "_arg1":I
    invoke-virtual {p2}, Landroid/os/Parcel;->readString()Ljava/lang/String;

    move-result-object v4

    .line 106
    .restart local v4    # "_arg2":Ljava/lang/String;
    invoke-virtual {p0, v2, v3, v4}, Landroid/app/IActivityController$Stub;->appEarlyNotResponding(Ljava/lang/String;ILjava/lang/String;)I

    move-result v0

    .line 107
    .local v0, "_result":I
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    .line 108
    invoke-virtual {p3, v0}, Landroid/os/Parcel;->writeInt(I)V

    goto/16 :goto_0

    .line 113
    .end local v0    # "_result":I
    .end local v2    # "_arg0":Ljava/lang/String;
    .end local v3    # "_arg1":I
    .end local v4    # "_arg2":Ljava/lang/String;
    :sswitch_5
    const-string v1, "android.app.IActivityController"

    invoke-virtual {p2, v1}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 115
    invoke-virtual {p2}, Landroid/os/Parcel;->readString()Ljava/lang/String;

    move-result-object v2

    .line 117
    .restart local v2    # "_arg0":Ljava/lang/String;
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v3

    .line 119
    .restart local v3    # "_arg1":I
    invoke-virtual {p2}, Landroid/os/Parcel;->readString()Ljava/lang/String;

    move-result-object v4

    .line 120
    .restart local v4    # "_arg2":Ljava/lang/String;
    invoke-virtual {p0, v2, v3, v4}, Landroid/app/IActivityController$Stub;->appNotResponding(Ljava/lang/String;ILjava/lang/String;)I

    move-result v0

    .line 121
    .restart local v0    # "_result":I
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    .line 122
    invoke-virtual {p3, v0}, Landroid/os/Parcel;->writeInt(I)V

    goto/16 :goto_0

    .line 127
    .end local v0    # "_result":I
    .end local v2    # "_arg0":Ljava/lang/String;
    .end local v3    # "_arg1":I
    .end local v4    # "_arg2":Ljava/lang/String;
    :sswitch_6
    const-string v1, "android.app.IActivityController"

    invoke-virtual {p2, v1}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 129
    invoke-virtual {p2}, Landroid/os/Parcel;->readString()Ljava/lang/String;

    move-result-object v2

    .line 130
    .restart local v2    # "_arg0":Ljava/lang/String;
    invoke-virtual {p0, v2}, Landroid/app/IActivityController$Stub;->systemNotResponding(Ljava/lang/String;)I

    move-result v0

    .line 131
    .restart local v0    # "_result":I
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    .line 132
    invoke-virtual {p3, v0}, Landroid/os/Parcel;->writeInt(I)V

    goto/16 :goto_0

    .line 43
    nop

    :sswitch_data_0
    .sparse-switch
        0x1 -> :sswitch_1
        0x2 -> :sswitch_2
        0x3 -> :sswitch_3
        0x4 -> :sswitch_4
        0x5 -> :sswitch_5
        0x6 -> :sswitch_6
        0x5f4e5446 -> :sswitch_0
    .end sparse-switch
.end method


text:
using System;

namespace ExampleCodeLibrary.Model
{
    public abstract class Vehicle
    {
        private decimal _speedInKmsHr;
        private int _topSpeed;
        protected decimal BrakeSpeedInMeterPerSecond = 10;
        protected int SpeedLimit = 80;

        private Vehicle() { }

        public Vehicle(int topSpeed)
        {
            if (topSpeed <= 0)
                throw new ArgumentOutOfRangeException(nameof(topSpeed), "Topspeed should be positive");

            _topSpeed = topSpeed;
        }

        public decimal Accelarate(decimal kmsHr)
        {
            if (kmsHr == 0)
                throw new ArgumentOutOfRangeException(nameof(kmsHr), "Zero is not an accpeted value");
            if (kmsHr < 0)
                throw new ArgumentOutOfRangeException(nameof(kmsHr), "Only positive numbers are accepted");

            var newSpeed = _speedInKmsHr + kmsHr;

            if (newSpeed > _topSpeed)
                _speedInKmsHr = _topSpeed;
            else
                _speedInKmsHr = newSpeed;

            return _speedInKmsHr;
        }

        public decimal Brake(int timeInMiliSeconds)
        {
            if (timeInMiliSeconds < 0)
                throw new ArgumentOutOfRangeException(nameof(timeInMiliSeconds), "Only positive numbers are accepted");

            var kmsBrake = BrakeSpeedInMeterPerSecond * timeInMiliSeconds / 100;

            if (kmsBrake > _speedInKmsHr)
                _speedInKmsHr = 0;
            else
                _speedInKmsHr -= kmsBrake;

            return _speedInKmsHr;
        }
    }
}


text:
require 'minitest/autorun'
require 'simple_mock'

include SimpleMock