text:
<?php

namespace spec\Lamudi\UseCaseBundle\Processor\Input;

use Lamudi\UseCaseBundle\Container\ContainerInterface;
use Lamudi\UseCaseBundle\Processor\Exception\EmptyCompositeProcessorException;
use Lamudi\UseCaseBundle\Processor\Input\InputProcessorInterface;
use PhpSpec\Exception\Example\MatcherException;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;

/**
 * @mixin \Lamudi\UseCaseBundle\Processor\Input\CompositeInputProcessor
 */
class CompositeInputProcessorSpec extends ObjectBehavior
{
    public function let(
        InputProcessorInterface $inputProcessor1, InputProcessorInterface $inputProcessor2,
        ContainerInterface $inputProcessorContainer
    )
    {
        $this->beConstructedWith($inputProcessorContainer);
        $inputProcessorContainer->get('processor_1')->willReturn($inputProcessor1);
        $inputProcessorContainer->get('processor_2')->willReturn($inputProcessor2);
    }

    function it_is_initializable()
    {
        $this->shouldHaveType('Lamudi\UseCaseBundle\Processor\Input\CompositeInputProcessor');
    }

    public function it_is_an_input_processor()
    {
        $this->shouldHaveType(InputProcessorInterface::class);
    }

    public function it_calls_input_processors_in_chain_resolving_them_from_options(
        InputProcessorInterface $inputProcessor1, InputProcessorInterface $inputProcessor2
    )
    {
        $request = new UseCaseRequest();
        $input = ['some' => 'input'];

        $inputProcessor1->initializeRequest($request, $input, [])->will(function($args) {
            $args[0]->initialized1 = true;
        });
        $inputProcessor2->initializeRequest(Argument::which('getInitialized1', true), $input, [])->will(function($args) {
            $args[0]->initialized2 = true;
        });

        $this->initializeRequest($request, $input, ['processor_1', 'processor_2']);

        if ($request->initialized2 !== true) {
            throw new MatcherException('"initialized2" should be "true".');
        }
    }

    public function it_calls_input_processors_in_chain_with_options(
        InputProcessorInterface $inputProcessor1, InputProcessorInterface $inputProcessor2
    )
    {
        $request = new UseCaseRequest();
        $input = ['some' => 'input'];

        $inputProcessor1->initializeRequest($request, $input, ['option1' => 'value1'])->will(function($args) {
            $args[0]->initialized1 = 20;
        });
        $inputProcessor2->initializeRequest(Argument::which('getInitialized1', 20), $input, ['foo' => 'bar'])->will(function($args) {
            $args[0]->initialized2 = true;
        });

        $this->initializeRequest($request, $input, ['processor_1' => ['option1' => 'value1'], 'processor_2' => ['foo' => 'bar']]);

        if ($request->initialized2 !== true) {
            throw new MatcherException('"initialized2" should be "true".');
        }
    }

    public function it_throws_an_exception_if_no_processors_have_been_added()
    {
        $this->shouldThrow(EmptyCompositeProcessorException::class)->duringInitializeRequest('this is', 'irrelevant here', []);
    }
}

class UseCaseRequest
{
    public $initialized1 = false;
    public $initialized2 = false;
    public $initialized3 = false;

    /**
     * @return boolean
     */
    public function getInitialized1()
    {
        return $this->initialized1;
    }

    /**
     * @return boolean
     */
    public function getInitialized2()
    {
        return $this->initialized2;
    }

    /**
     * @return boolean
     */
    public function getInitialized3()
    {
        return $this->initialized3;
    }
}


text:
#include "VTUtil.h"

#include <Windows.h>

#include <stdexcept>
#include <assert.h>

struct VT::DynLib::Impl
{
    Impl()
        : handle(NULL)
    { }

    HMODULE handle;
};

VT::DynLib::DynLib()
    : pimpl_(nullptr)
{ }

VT::DynLib::DynLib(const wchar_t* name, bool expand_name, bool prepend_exec_path)
    : pimpl_(new Impl)
{
    auto errmode = GetErrorMode();

    // Disable system error message boxes
    SetErrorMode(SEM_FAILCRITICALERRORS);

    std::wstring full_name = name;

    if (expand_name)
        full_name.append(L".dll");

    if (prepend_exec_path)
        full_name = VT::executable_path() + full_name;

    pimpl_->handle = LoadLibraryW(full_name.c_str());
    SetErrorMode(errmode);

    if (pimpl_->handle == NULL)
        throw std::runtime_error(VT::strerror(GetLastError()));
}

VT::DynLib::~DynLib()
{
    if (pimpl_)
    {
        FreeLibrary(pimpl_->handle);
        delete pimpl_;
    }
}

VT::DynLib::DynLib(DynLib&& other)
    : pimpl_(nullptr)
{
    std::swap(pimpl_, other.pimpl_);
}

VT::DynLib& VT::DynLib::operator=(DynLib&& other)
{
    std::swap(pimpl_, other.pimpl_);
    return *this;
}

namespace
{
    FARPROC get_symbol(HMODULE handle, const char* name)
    {
        assert(handle);
        FARPROC ptr = GetProcAddress(handle, name);
        if (ptr == NULL)
            throw std::runtime_error(VT::strerror(GetLastError()));
        return ptr;
    }
}

VT::DynLib::data_ptr VT::DynLib::get_data_symbol(const char* name)
{
    if (!pimpl_)
        throw std::runtime_error("No dynamic library loaded");

    FARPROC ptr = get_symbol(pimpl_->handle, name);
    return reinterpret_cast<void*>(ptr);
}

VT::DynLib::fun_ptr VT::DynLib::get_fun_symbol(const char* name)
{
    if (!pimpl_)
        throw std::runtime_error("No dynamic library loaded");

    return reinterpret_cast<fun_ptr>(get_symbol(pimpl_->handle, name));
}

VT::DynLib::operator bool()
{
    return (pimpl_ != nullptr && pimpl_->handle != NULL);
}

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Text.Json;
using Azure.Core;

namespace Azure.ResourceManager.Communication.Models
{
    public partial class OperationStatus
    {
        internal static OperationStatus DeserializeOperationStatus(JsonElement element)
        {
            Optional<string> id = default;
            Optional<Status> status = default;
            Optional<DateTimeOffset> startTime = default;
            Optional<DateTimeOffset> endTime = default;
            Optional<float> percentComplete = default;
            Optional<ErrorDetail> error = default;
            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("status"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    status = new Status(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("startTime"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    startTime = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("endTime"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    endTime = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("percentComplete"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    percentComplete = property.Value.GetSingle();
                    continue;
                }
                if (property.NameEquals("error"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("error"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            error = ErrorDetail.DeserializeErrorDetail(property0.Value);
                            continue;
                        }
                    }
                    continue;
                }
            }
            return new OperationStatus(id.Value, Optional.ToNullable(status), Optional.ToNullable(startTime), Optional.ToNullable(endTime), Optional.ToNullable(percentComplete), error.Value);
        }
    }
}


text:
layout: doc
title: Navigation
category: docs
permalink: /docs/navigation/
---

Your app can navigate from the page hosting the Cordova WebView to additional all-native pages (and back).
These pages can be constructed programmatically in JavaScript, or they can be defined in markup.
You have three markup options:

* Using Android XML. (This only works on Android.)
* Using a .xib file created from Xcode's Interface Builder. (This only works on iOS.)
* Using a XAML file. (This works everywhere.)

When using XAML, you gain the option of using elements from the [cross-platform UI framework](/ace/docs/ref)
in addition to (or instead of) raw platform-specific elements.

## Navigating with <a>
If your target page is defined in markup, you can use a hyperlink:

<a href="native://page.xaml">
  Go to an all-native page
</a>
<a href="android://page.xml">
  Go to an Android XML page
</a>
<a href="ios://page.xib">
  Go to an Interface Builder page
</a>

Clicking the hyperlink triggers a native navigation, complete with a purely-native animated transition.
(On Android, the new content opens in a child activity. On iOS, the new content opens in a new view controller hosted inside a navigation controller.)

The original page with the Cordova WebView remains intact, and the WebView's internal history remains unaffected. You can navigate back to it with the ace.goBack() API.
If you use XAML markup, this can even be attached inline:

<Button ace:On.Click="ace.goBack()">Back</Button>

## Navigating with document.location
If your target page is defined in markup, you can also change the document's location in JavaScript:

// Three options:
document.location.href = "native://page.xaml";
document.location.href = "android://page.xml";
document.location.href = "ios://page.xib";

This behaves just like following a hyperlink.

## Navigating with the navigate API

You can also use a navigate API, which enables you to navigate to markup or any UI object constructed programmatically:

Navigate to a markup file:

// Three options:
ace.navigate("native://page.xaml");
ace.navigate("android://page.xml");
ace.navigate("ios://page.xib");

Navigate to an arbitrary UI object:

// Navigate to a Page constructed dynamically:
var page = new ace.Page();
...
ace.navigate(page);

// You aren't required to use a Page object:
var button = new ace.Button();
...
ace.navigate(button);

Notice that you're not required to use a Page object. (But Page is useful if you want to show app bars or control the navigation bar.)

You don't need to use the cross-platform UI framework, either. Here's an example that navigates to a raw
iOS control, which occupies the whole screen upon navigation:

if (ace.platform == "iOS") {
    // Create a UISegmentedControl
    var uiSegmentedControl = new ace.NativeObject("UISegmentedControl");

    // Add two segments
    uiSegmentedControl.invoke("insertSegmentWithTitle:atIndex:animated:", "One", 0, false);
    uiSegmentedControl.invoke("insertSegmentWithTitle:atIndex:animated:", "Two", 1, false);

    // Select the last segment
    uiSegmentedControl.invoke("setSelectedSegmentIndex", 1);

    // Navigate to the single control
    ace.navigate(uiSegmentedControl,
        // Just so we have a way to get back:
        function () { ace.Frame.showNavigationBar(); },
        function () { ace.Frame.hideNavigationBar(); });
}

Here's a similar example, but with raw Android controls constructed entirely in JavaScript (no Android XML):

Click here to expand example

if (ace.platform == "Android") {
    // Create all the views
    var relativeLayout = new ace.NativeObject("android.widget.RelativeLayout");
    var radioGroup = new ace.NativeObject("android.widget.RadioGroup");
    var radioButton1 = new ace.NativeObject("android.widget.RadioButton");
    var radioButton2 = new ace.NativeObject("android.widget.RadioButton");
    var radioButton3 = new ace.NativeObject("android.widget.RadioButton");
    var colorWheel = new ace.NativeObject("com.larswerkman.holocolorpicker.ColorPicker");
    var seekBar = new ace.NativeObject("android.widget.SeekBar");
    var editText = new ace.NativeObject("android.widget.EditText");

    // Set ids to be used by RelativePanel
    var radioGroupId = 100;
    var colorWheelId = 200;
    var seekBarId = 300;
    radioGroup.invoke("setId", radioGroupId);
    colorWheel.invoke("setId", colorWheelId);
    seekBar.invoke("setId", seekBarId);

    // Set up the RadioGroup and its RadioButtons
    radioButton1.invoke("setText", "Choice 1");
    radioButton2.invoke("setText", "Choice 2");
    radioButton3.invoke("setText", "Choice 3");
    radioGroup.invoke("addView", radioButton1);
    radioGroup.invoke("addView", radioButton2);
    radioGroup.invoke("addView", radioButton3);
    relativeLayout.invoke("addView", radioGroup);

    // Set the background to yellow
    ace.NativeObject.getField("android.graphics.Color", "YELLOW", function (color) {
        relativeLayout.invoke("setBackgroundColor", color);
    });

    // Retrieve four constants
    ace.NativeObject.getField("android.view.ViewGroup$LayoutParams", "MATCH_PARENT", function (match_parent) {
        ace.NativeObject.getField("android.view.ViewGroup$LayoutParams", "WRAP_CONTENT", function (wrap_content) {
            ace.NativeObject.getField("android.widget.RelativeLayout", "RIGHT_OF", function (right_of) {
                ace.NativeObject.getField("android.widget.RelativeLayout", "BELOW", function (below) {

                    // Add colorWheel to the right of radioGroup
                    var p = new ace.NativeObject("android.widget.RelativeLayout$LayoutParams", match_parent, wrap_content);
                    p.invoke("addRule", right_of, radioGroupId);
                    colorWheel.invoke("setLayoutParams", p);
                    relativeLayout.invoke("addView", colorWheel);

                    // Add seekBar below colorWheel
                    p = new ace.NativeObject("android.widget.RelativeLayout$LayoutParams", match_parent, wrap_content);
                    p.invoke("addRule", below, colorWheelId);
                    seekBar.invoke("setLayoutParams", p);
                    relativeLayout.invoke("addView", seekBar);

                    // Add editText below seekBar
                    p = new ace.NativeObject("android.widget.RelativeLayout$LayoutParams", match_parent, wrap_content);
                    p.invoke("addRule", below, seekBarId);
                    editText.invoke("setLayoutParams", p);
                    relativeLayout.invoke("addView", editText);

                    // Navigate to the root instance
                    ace.navigate(relativeLayout);
                });
            });
        });
    });
}

And here's a complete example of navigating to cross-platform UI constructed entirely in JavaScript (no XAML):

Click here to expand example

// Create all the UI elements
var stackPanel = new ace.StackPanel();
var datePicker = new ace.DatePicker();
var timePicker = new ace.TimePicker();
var textBlock = new ace.TextBlock();
var toggleSwitch = new ace.ToggleSwitch();
var button1 = new ace.Button();
var button2 = new ace.Button();
var button3 = new ace.Button();
var button4 = new ace.Button();
var canvas = new ace.Canvas();
var hyperlinkButton = new ace.HyperlinkButton();

// Add elements to the root StackPanel
stackPanel.getChildren().add(datePicker);
stackPanel.getChildren().add(timePicker);
stackPanel.getChildren().add(textBlock);
stackPanel.getChildren().add(toggleSwitch);
stackPanel.getChildren().add(button1);
stackPanel.getChildren().add(canvas);

// Add elements to the Canvas
canvas.setMargin(15);
canvas.getChildren().add(button2);
canvas.getChildren().add(button3);
canvas.getChildren().add(button4);
canvas.getChildren().add(hyperlinkButton);

// Set properties on DatePicker and attach an event
datePicker.setPadding(15);
datePicker.setHeader("Choose a date");
datePicker.addEventListener("datechanged", function () { onDateChanged(datePicker); });

// Set properties on TimePicker and attach an event
timePicker.setPadding(15);
timePicker.setHeader("Choose a time");
timePicker.addEventListener("timechanged", function () { onTimeChanged(timePicker); });

// Set properties on TextBlock
textBlock.setName("textBlock");
textBlock.setFontSize(20);
textBlock.setPadding(15);
textBlock.setForeground("Green");
textBlock.setText("Text");

// Set properties on ToggleSwitch
toggleSwitch.setHeader("ToggleSwitch");
toggleSwitch.setIsOn(true);
toggleSwitch.setPadding(15);

// Set properties (and an event handler) on 4 Buttons
button1.setBackground("Red");
button1.setContent("Back");
button1.addEventListener("click", function () { ace.goBack(); });
button2.setContent("A");
button3.setContent("B");
ace.Canvas.setLeft(button3, 150);
button4.setContent("C");
button4.setWidth(100);
button4.setHeight(100);
ace.Canvas.setTop(button4, 110);

// Create a Style
var style = {
    FontSize: 60,
    FontWeight: "Bold",
    Foreground: "Violet",
    Background: "SteelBlue",
    Width: 100,
    Height: 100
};

// Apply the Style to buttons 2 and 3
button2.setStyle(style);
button3.setStyle(style);

// Set properties on HyperlinkButton
hyperlinkButton.setBackground("Lime");
hyperlinkButton.setNavigateUri("native://Native2.xaml");
hyperlinkButton.setContent("Another Page");
hyperlinkButton.setWidth(150);
hyperlinkButton.setHeight(100);
ace.Canvas.setLeft(hyperlinkButton, 150);
ace.Canvas.setTop(hyperlinkButton, 110);

// Set the background to a unique color
stackPanel.setBackground("Moccasin");

// Navigate to the root instance
ace.navigate(stackPanel);

### Interacting with the New Native Content

A key feature of the navigate API, compared to the other navigation approaches, is that it returns
the root UI object that you just navigated to. This enables you to manipulate the UI, attach event handlers,
and so on.

ace.navigate("native://page.xaml", function (root) {
    // Navigation done
    root.setBackground("Salmon");
});

ace.navigate("native://page.xaml", function (root) {
    // Attach event handler
    root.doneButton.addEventListener("click", function() { ... });
});

### Retrieving Subelements

If you're using XAML markup, you can mark elements with a Name attribute. You can then access
elements by name directly from the root element, e.g.:

ace.navigate("native://page.xaml", function (root) {
    // There is an element with Name="doneButton"
    root.doneButton.addEventListener("click", function() { ... });
});

Or, from any element in the same scope (not just the root), you can use a findName API:

ace.navigate("native://page.xaml", function (root) {
    // There is an element with Name="doneButton"
    root.findName("doneButton").addEventListener("click", function() { ... });
});

> Whether you get a cross-platform UI object from XAML or programmatically, you can retrieve sub-objects
> by name with the findName API.

If you're using Android XML, you can set ids as you normally would, and programmatically leverage
those ids in JavaScript the same way you would in Java.

## Navigating Backward

To go back from a native navigation, call ace.goBack().

## Navigation Events

If you use the navigate API, you can pass an extra callback that acts like a "navigating away from" event:

ace.navigate("native://page.xaml", function (root) {
    // Navigated to
    root.doneButton.addEventListener("click", function() { ... });
}, function (root) {
    // Navigating away
    root.doneButton.removeEventListener("click", function() { ... });
});

Global Navigation Events

You can handle global Navigating and Navigated events, which is especially useful when
navigation is done via hyperlinks rather than the navigate API:

ace.addEventListener("navigating", function (oldContent, newContent) {
  console.log("NAVIGATING: " + oldContent + " -> " + newContent);
});

ace.addEventListener("navigated", function (root, url) {
  // There's no url in the case of navigating to a live object
  console.log("NAVIGATED: " + url);
});

## Controlling the Navigation Bar

Frame has exposes showNavigationBar and hideNavigationBar APIs. A previous example demonstrated
these in conjunction with the navigate API callbacks:

ace.navigate(uiSegmentedControl,
    // Just so we have a way to get back:
    function () { ace.Frame.showNavigationBar(); },
    function () { ace.Frame.hideNavigationBar(); });
}


text:
require 'spec_helper'

describe 'strftime', :if => Puppet::Util::Package.versioncmp(Puppet.version, '4.8.0') < 0 do
  it 'exists' do
    expect(Puppet::Parser::Functions.function('strftime')).to eq('function_strftime')
  end

  it 'raises a ParseError if there is less than 1 arguments' do
    expect { scope.function_strftime([]) }.to(raise_error(Puppet::ParseError))
  end

  it 'using %s should be higher then when I wrote this test' do
    result = scope.function_strftime(['%s'])
    expect(result.to_i).to(be > 1_311_953_157)
  end

  it 'using %s should be greater than 1.5 trillion' do
    result = scope.function_strftime(['%s'])
    expect(result.to_i).to(be > 1_500_000_000)
  end

  it 'returns a date when given %Y-%m-%d' do
    result = scope.function_strftime(['%Y-%m-%d'])
    expect(result).to match(%r{^\d{4}-\d{2}-\d{2}$})
  end
end


text:
package scodec
package codecs

import scalaz.\/

import java.nio.CharBuffer
import java.nio.charset.Charset
import java.nio.charset.{MalformedInputException, UnmappableCharacterException}

import scodec.bits.BitVector

private[codecs] final class StringCodec(charset: Charset) extends Codec[String] {

  override def encode(str: String) = {
    val encoder = charset.newEncoder
    val buffer = CharBuffer.wrap(str)
    try \/.right(BitVector(encoder.encode(buffer)))
    catch {
      case (_: MalformedInputException | _: UnmappableCharacterException) =>
        \/.left(Err(s"${charset.displayName} cannot encode character '${buffer.charAt(0)}'"))
    }
  }

  override def decode(buffer: BitVector) = {
    val decoder = charset.newDecoder
    try {
      \/.right((BitVector.empty, decoder.decode(buffer.toByteBuffer).toString))
    } catch {
      case (_: MalformedInputException | _: UnmappableCharacterException) =>
        \/.left(Err(s"${charset.displayName} cannot decode string from '0x${buffer.toByteVector.toHex}'"))
    }
  }

  override def toString = charset.displayName
}


text:
Wordcount demo for Apache Spark

## Requirements

To build and run this application, you must have installed:
- Scala 2.11.X
- SBT
- Apache Spark locally or in a cluster you want to deploy the application

## How to build
Firstly, you must clone the project from GitHub in a folder. If you're using Linux and your folder is encrypted,
you must clone it into a folder in /, (prefer shorter names to this folder). In addition, you need to set

```{scala}
scalacOptions ++= Seq("-Xmax-classfile-name","100")
```
inside *~.sbt/0.13/local.sbt*.

After that, enter in the project's folder and build the project with the following command:

```{bash}
sbt clean compile assembly
```

## How to run locally

In first place, you must create an **input folder**, where you should place [the Shakespeare corpus](https://github.com/andretadeu/spark-wordcount/raw/master/src/main/resources/shakespeare.txt).
 After that, you must start the master by running *start-master.sh* script. Once the master is running, open the URL
 http://localhost:8080/ to discover the URL of the master, so you can run the slave by running the script
 *start-slave.sh [Apache Spark master URL]*.

Now you're ready to effectively run the application. To do this, just run the following script:

```{bash}
spark-submit --class WordCount --master <Master URL> <local of the fat jar>/spark-wordcount-assembly-1.0.jar <input folder> <output folder>
```


text:
const merge = require('webpack-merge')
const common = require('./webpack.common')

module.exports = merge(common, {
    mode: 'production',
    output: {
        filename: 'barenote.min.js',
    }
})


text:
package io.vertx.mysqlclient.tck;

import io.vertx.ext.unit.TestContext;
import io.vertx.ext.unit.junit.VertxUnitRunner;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;

@RunWith(VertxUnitRunner.class)

public class MySQLPreparedQueryTest extends MySQLPreparedQueryTestBase {
  @Override
  protected void initConnector() {
    options = rule.options();
    connector = ClientConfig.CONNECT.connect(vertx, options);
  }

  @Test
  @Ignore
  @Override
  public void testPreparedQueryParamCoercionTypeError(TestContext ctx) {
    // we use implicit type conversion for MySQL client
    super.testPreparedQueryParamCoercionTypeError(ctx);
  }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.google.maps.android">
    <uses-sdk android:minSdkVersion="14"/>
    <!-- https://groups.google.com/group/adt-dev/browse_thread/thread/c059c0380998092b/6720093fb40fdaf9 -->
    <application>
        <meta-data
                android:name="com.google.android.gms.version"
                android:value="@integer/google_play_services_version" />

    </application>
</manifest>


text:
import * as ko from 'knockout';

import { koSetup } from 'jest/koTestUtils';

import './ko.verticalSlide';

describe('ko.verticalSlide.js', () => {
  const setup = koSetup();

  it('should render binding', async () => {
    const wrapper = await setup.renderKo(`<div data-bind="verticalSlide: slide"></div>`, {
      slide: ko.observable(false)
    });

    expect(wrapper.innerHTML).toMatchSnapshot();
  });
});


text:
<?php

namespace Phlexible\Bundle\MediaManagerBundle;

/**
 * Media manager events
 *
 * @author Stephan Wentz <sw@brainbits.net>
 */
class MediaManagerEvents
{
    /**
     * Fired when slots are gathered
     */
    const GET_SLOTS = 'phlexible_media_manager.get_slots';

    /**
     * Fired before meta information are saved
     */
    const BEFORE_SAVE_META = 'phlexible_media_manager.before_save_meta';

    /**
     * Fired when meta information are saved
     */
    const SAVE_META = 'phlexible_media_manager.save_meta';

    /**
     * Fired before meta information are saved
     */
    const BEFORE_SAVE_FOLDER_META = 'phlexible_media_manager.before_save_folder_meta';

    /**
     * Fired when meta information are saved
     */
    const SAVE_FOLDER_META = 'phlexible_media_manager.save_folder_meta';

    const BEFORE_SET_FOLDER_METASETS = 'phlexible_media_manager.before_set_folder_metasets';
    const SET_FOLDER_METASETS = 'phlexible_media_manager.set_folder_metasets';
    const BEFORE_SET_FILE_METASETS = 'phlexible_media_manager.before_set_file_metasets';
    const SET_FILE_METASETS = 'phlexible_media_manager.set_file_metasets';
    const BEFORE_SET_FILE_MEDIA_TYPE = 'phlexible_media_manager.before_set_file_media_type';
    const SET_FILE_MEDIA_TYPE = 'phlexible_media_manager.set_file_media_type';
}


text:
package net.cpollet.sportracker.service.api;

import net.cpollet.sportracker.data.User;

import java.io.Serializable;

/**
 * @author Christophe Pollet
 */
public interface UserService {
	void create(User user);

	boolean areCredentialsValid(String username, String password);

	Serializable getIdForUsername(String username);

	User get(Serializable id);
}


text:
package com.tesseractmobile.pocketbot.robot;

import android.net.Uri;

import com.google.android.gms.auth.api.signin.GoogleSignInAccount;

import java.io.StringBufferInputStream;

/**
 * Created by josh on 5/23/16.
 */
public class AuthData {

    final private String mUid;
    final private String mDisplayName;
    final private String mProfileImageUrl;

    public AuthData(final GoogleSignInAccount googleSignInAccount) {
        mUid = googleSignInAccount.getId();
        mDisplayName = googleSignInAccount.getDisplayName();
        final Uri photoUrl = googleSignInAccount.getPhotoUrl();
        if(photoUrl != null){
            mProfileImageUrl = photoUrl.toString();
        } else {
            mProfileImageUrl = "";
        }
    }

    /**
     *
     * @return user id
     */
    public String getUid() {
        return mUid;
    }

    /**
     *
     * @return display name
     */
    public String getDisplayName() {
        return mDisplayName;
    }

    /**
     *
     * @return url to profile image
     */
    public String getProfileImageURL() {
        return mProfileImageUrl;
    }
}


text:
Combinatorics
============================

.. highlight:: matlab

Steiner Systems
---------------------------

Steiner system with block size 2::

    v = 10;
    m = spx.discrete.steiner_system.ss_2(v);

Steiner system with block size 3  (STS Steiner Triple System)::

    m = spx.discrete.steiner_system.ss_3(v);

Bose construction for STS system for v = 6n + 3 ::

    m = spx.discrete.steiner_system.ss_3_bose(v);

Verify if a given incidence matrix is a Steiner system::

    spx.discrete.steiner_system.is_ss(M, k)

Latin square construction::

    spx.discrete.steiner_system.commutative_idempotent_latin_square(n)

Verify if a table is a Latin square::

    spx.discrete.steiner_system.is_latin_square(table)


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:tools="http://schemas.android.com/tools"
                xmlns:app="http://schemas.android.com/apk/res-auto"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                tools:context=".SearchResultListActivity">

    <!--
    This layout is a two-pane layout for the SearchResults
    master/detail flow. See res/values-large/refs.xml and
    res/values-sw600dp/refs.xml for an example of layout aliases
    that replace the single-pane version of the layout with
    this two-pane version.

    For more on layout aliases, see:
    http://developer.android.com/training/multiscreen/screensizes.html#TaskUseAliasFilters
    -->

    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_height="168dp"
        android:layout_width="match_parent"
        android:gravity="center"
        android:paddingBottom="104dp"
        android:background="?attr/colorPrimary"
        android:elevation="4dp"
        android:animateLayoutChanges="true"
        android:theme="@style/ThemeOverlay.Opacapp.ActionBar"
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>

    <View
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@+id/toolbar"
        android:background="@drawable/toolbar_shadow"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@id/toolbar"
        android:baselineAligned="false"
        android:divider="?dividerHorizontal"
        android:orientation="horizontal"
        android:elevation="8dp"
        android:layout_marginTop="-96dp"
        android:layout_marginLeft="16dp"
        android:layout_marginRight="16dp"
        android:showDividers="middle"
        android:background="@drawable/popup_bg">

        <FrameLayout
            android:id="@+id/searchresult_list_container"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"/>

        <FrameLayout
            android:id="@+id/searchresult_detail_container"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="2"/>

    </LinearLayout>

</RelativeLayout>


text:
                {% if eyebrow_text %}

{{ eyebrow_text }}

                {% endif %}

{{ subheader_1 | safe }}

{{ header_1 | safe }}

{{ code_1 | safe }}

{{ subheader_2 | safe }}

{{ header_2 | safe }}

{{ code_2 | safe }}

{{ subheader_3 | safe }}

{{ header_3 | safe }}

{{ code_3 | safe }}

{{ subcopy | safe }}

                {{ call_to_action }}

        {{ offer_details }}


text:
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="definitions"
  xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
  xmlns:camunda="http://camunda.org/schema/1.0/bpmn"
  targetNamespace="Examples">

  <process id="parallelGateway" isExecutable="true">

    <startEvent id="theStart" />
    <sequenceFlow id="flow1" sourceRef="theStart" targetRef="fork" />

    <parallelGateway id="fork" />
    <sequenceFlow id="flow2" sourceRef="fork" targetRef="task1" />
    <userTask id="task1"/>
    <sequenceFlow id="flow3" sourceRef="task1" targetRef="theEnd1" />
    <endEvent id="theEnd1" />

    <sequenceFlow id="flow4" sourceRef="fork" targetRef="task2" />
    <userTask id="task2"/>
    <sequenceFlow id="flow5" sourceRef="task2" targetRef="theEnd2" />
    <endEvent id="theEnd2" />

  </process>

</definitions>


text:
var assert = require('assert');

// testing reading data from stdin, since that's a crucial feature
if (process.stdin.setRawMode) {
  process.stdin.setRawMode(true);
} else {
  tty.setRawMode(true);
}
process.stdin.resume();
process.stdin.setEncoding('utf8');

// the child script expects 1 data event, with the text "☃"
var dataCount = 0;
process.stdin.on('data', function (data) {
  dataCount++;
  assert.equal(data, '☃');

  // done!
  process.stdin.pause();
  clearTimeout(timeout);
});

var timeout = setTimeout(function () {
  console.error('TIMEOUT!');
  process.exit(7);
}, 5000);

process.on('exit', function (code) {
  if (code === 7) return; // timeout
  assert.equal(dataCount, 1);
});


text:
const tap = require('tap')
const typeioc = require('@lib')

tap.test('CallInfo has all properties', (test) => {

    test.equals(typeioc.callInfo.method, 1)
    test.equals(typeioc.callInfo.getter, 2)
    test.equals(typeioc.callInfo.setter, 3)
    test.equals(typeioc.callInfo.getterSetter, 4)
    test.equals(typeioc.callInfo.any, 5)
    test.equals(typeioc.callInfo.field, 6)

    test.done()
})

tap.test('CallInfo has all no extra properties', (test) => {

    test.plan(6)

    for(let key in typeioc.callInfo) {
        test.ok(typeioc.callInfo[key])
    }

    test.done()
})


text:
BSLS_IDENT("$Id: $")

//@PURPOSE: Provide a meta-function for determining function pointer traits.
//
//@CLASSES:
//  bslmf::FunctionPointerTraits: meta-function for detecting function pointer
//                                traits
//  bslmf::IsFunctionPointer: meta-function to determine if a type is a
//                            function pointer
//
//@SEE_ALSO: bslmf_memberfunctionpointertraits
//
//@DESCRIPTION: This component provides meta-functions for determining whether
// a type is a pointer to either a free function or a class method (but not to
// a member function, see the component 'bslmf_memberfunctionpointertraits'
// component for that), and some information about this function type.  The
// meta-function 'bslmf::IsFunctionPointer' provides an enumerated 'value'
// which can be either 1 or 0 depending on whether or not the template argument
// 'PROTOTYPE' is a pointer to a free function or class method.  In the
// affirmative, the class 'bslmf::FunctionPointerTraits' also provides
// information regarding the function type, such as its argument list type and
// its return type.
//
// Note that there is no reference-to-function traits class, since whether
// 'FUNC' is a reference to function type can be very easily obtained using the
// meta-function call 'bslmf::IsFunctionPointer<FUNC *>'.
//
///Usage
///-----
// Define the following function types:
//..
//  typedef int  (*IntFunctionIntIntPtr)(int, int);
//  typedef void (*VoidFunc0)();
//..
// The following program should compile and run without errors:
//..
//  int main()
//  {
//      assert(0 == bslmf::IsFunctionPointer<int>::value);
//      assert(0 == bslmf::IsFunctionPointer<void>::value);
//
//      assert(1 == bslmf::IsFunctionPointer<IntFunctionIntIntPtr>::value);
//      typedef bslmf::FunctionPointerTraits<IntFunctionIntIntPtr>::ResultType
//          ResultType1;
//      assert(1 == (bsl::is_same<ResultType1, int>::value));
//
//      assert(1 == bslmf::IsFunctionPointer<VoidFunc0>::value);
//      typedef bslmf::FunctionPointerTraits<VoidFunc0>::ResultType
//          ResultType0;
//      typedef bslmf::FunctionPointerTraits<VoidFunc0>::ArgumentList
//          ArgList0;
//      assert(1 == (bsl::is_same<ResultType0, void>::value));
//      assert(1 == (bsl::is_same<ArgList0, bslmf::TypeList0>::value));
//  }
//..

#include <bslscm_version.h>

#include <bslmf_integralconstant.h>
#include <bslmf_typelist.h>

#include <bsls_compilerfeatures.h>
#include <bsls_platform.h>

#if BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
// Include version that can be compiled with C++03
// Generated on Thu Oct 21 10:11:37 2021
// Command line: sim_cpp11_features.pl bslmf_functionpointertraits.h
# define COMPILING_BSLMF_FUNCTIONPOINTERTRAITS_H
# include <bslmf_functionpointertraits_cpp03.h>
# undef COMPILING_BSLMF_FUNCTIONPOINTERTRAITS_H
#else

namespace BloombergLP {
namespace bslmf {

struct FunctionPointerCPlusPlusLinkage {
    // C++ function pointer linkage tag.
};

struct FunctionPointerCLinkage {
    // C function pointer linkage tag.
};

                        // ===========================
                        // class FunctionPointerTraits
                        // ===========================

template <class PROTOTYPE>
struct FunctionPointerTraits {
    // This class gives information about the specified 'PROTOTYPE'.  The
    // general definition gives no information, but specializations for
    // function pointers types define nested types 'ResultType',
    // 'ArgumentList', and 'Linkage'.

    enum { IS_FUNCTION_POINTER = 0 };
};

                          // =======================
                          // class IsFunctionPointer
                          // =======================

template <class PROTOTYPE>
struct IsFunctionPointer
: bsl::integral_constant<bool,
                      FunctionPointerTraits<PROTOTYPE>::IS_FUNCTION_POINTER> {
    // This template determines if the specified 'PROTOTYPE' is a free (i.e.,
    // non-member) function pointer.  'value' is defined as 1 if the specified
    // 'PROTOTYPE' is a function pointer type, and a zero value otherwise.
};

// ---- Anything below this line is implementation specific.  Do not use. ----

#if defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT_TYPES) &&                  \
    !defined(BSLS_COMPILERFEATURES_SUPPORT_VARIADIC_TEMPLATES)
    // All of our compilers which identify 'noexcept' as part of the type
    // system (a C++17 piece of functionality) similarly also support variadic
    // templates, so we refrain from having the dead code to support this case.
#   error Feature not supported for compilers without variadic templates
#endif

                // ---------------------------
                // class FunctionPointerTraits
                // ---------------------------

#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES // $var-args=14

// This pragma is not supported by older versions of Apple Clang {DRQS 169716845<GO>}
#if defined(BSLS_PLATFORM_CMP_CLANG) && (!defined(BSLS_PLATFORM_OS_DARWIN) || BSLS_PLATFORM_CMP_VER_MAJOR > 130000)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-volatile"
#endif

template <class BSLMF_RETURN, class...ARGS>
struct FunctionPointerTraits<BSLMF_RETURN (*)(ARGS...)> {
    // Specialization for function pointers that return 'BSLMF_RETURN' and
    // accept a fixed number of arguments

    enum {
        IS_FUNCTION_POINTER = 1,
        IS_NOEXCEPT = 0
    };
    enum { e_IS_VARARG = 0 };
    typedef BSLMF_RETURN                     ResultType;
    typedef typename TypeList<ARGS...>::Type ArgumentList;
    typedef BSLMF_RETURN                     FuncType(ARGS...);
    typedef FunctionPointerCPlusPlusLinkage  Linkage;
};

template <class BSLMF_RETURN, class...ARGS>
struct FunctionPointerTraits<BSLMF_RETURN (*)(ARGS...,...)> {
    // Specialization for function pointers that return 'BSLMF_RETURN' and
    // accept variable (C-style varargs) number of arguments

    enum {
        IS_FUNCTION_POINTER = 1,
        IS_NOEXCEPT = 0
    };
    enum { e_IS_VARARG = 1 };
    typedef BSLMF_RETURN                     ResultType;
    typedef typename TypeList<ARGS...>::Type ArgumentList;
    typedef BSLMF_RETURN                     FuncType(ARGS...,...);
    typedef FunctionPointerCPlusPlusLinkage  Linkage;
};

#if defined(BSLS_PLATFORM_CMP_CLANG)
#pragma clang diagnostic pop
#endif

#endif

#if defined(BSLS_PLATFORM_CMP_MSVC)
// Microsoft Visual C++ has a problem matching 'T * const' pointers to the
// appropriate partial specialization, whereas it will match a 'T const'
// specialization.  We could use the Microsoft fix on all platforms, but why
// instantiate more traits than necessary when testing pointer traits of
// cv-qualified types that are not function pointers?

template <class PROTOTYPE>
struct FunctionPointerTraits<PROTOTYPE const>
     : FunctionPointerTraits<PROTOTYPE> {
    // This class gives information about the specified 'PROTOTYPE'.  The
    // general definition gives no information, but specializations for
    // function pointers types define nested types 'ResultType',
    // 'ArgumentList', and 'Linkage'.
};

template <class PROTOTYPE>
struct FunctionPointerTraits<PROTOTYPE volatile>
     : FunctionPointerTraits<PROTOTYPE> {
    // This class gives information about the specified 'PROTOTYPE'.  The
    // general definition gives no information, but specializations for
    // function pointers types define nested types 'ResultType',
    // 'ArgumentList', and 'Linkage'.
};

template <class PROTOTYPE>
struct FunctionPointerTraits<PROTOTYPE const volatile>
     : FunctionPointerTraits<PROTOTYPE> {
    // This class gives information about the specified 'PROTOTYPE'.  The
    // general definition gives no information, but specializations for
    // function pointers types define nested types 'ResultType',
    // 'ArgumentList', and 'Linkage'.
};
#else
template <class PROTOTYPE>
struct FunctionPointerTraits<PROTOTYPE * const>
     : FunctionPointerTraits<PROTOTYPE *> {
    // This class gives information about the specified 'PROTOTYPE'.  The
    // general definition gives no information, but specializations for
    // function pointers types define nested types 'ResultType',
    // 'ArgumentList', and 'Linkage'.
};

template <class PROTOTYPE>
struct FunctionPointerTraits<PROTOTYPE * volatile>
     : FunctionPointerTraits<PROTOTYPE *> {
    // This class gives information about the specified 'PROTOTYPE'.  The
    // general definition gives no information, but specializations for
    // function pointers types define nested types 'ResultType',
    // 'ArgumentList', and 'Linkage'.
};

template <class PROTOTYPE>
struct FunctionPointerTraits<PROTOTYPE * const volatile>
     : FunctionPointerTraits<PROTOTYPE *> {
    // This class gives information about the specified 'PROTOTYPE'.  The
    // general definition gives no information, but specializations for
    // function pointers types define nested types 'ResultType',
    // 'ArgumentList', and 'Linkage'.
};
// }}} END GENERATED CODE
#endif

#ifdef BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT_TYPES

#if defined(BSLS_PLATFORM_CMP_CLANG)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-volatile"
#endif

template <class BSLMF_RETURN, class...ARGS>
struct FunctionPointerTraits<BSLMF_RETURN (*)(ARGS...) noexcept> {
    // Specialization for 'noexcept' function pointers that return
    // 'BSLMF_RETURN' and accept a fixed number of arguments

    enum {
        IS_FUNCTION_POINTER = 1,
        IS_NOEXCEPT = 1
    };
    enum { e_IS_VARARG = 0 };
    typedef BSLMF_RETURN                     ResultType;
    typedef typename TypeList<ARGS...>::Type ArgumentList;
    typedef BSLMF_RETURN                     FuncType(ARGS...) noexcept;
    typedef FunctionPointerCPlusPlusLinkage  Linkage;
};

template <class BSLMF_RETURN, class...ARGS>
struct FunctionPointerTraits<BSLMF_RETURN (*)(ARGS...,...) noexcept> {
    // Specialization for 'noexcept' function pointers that return
    // 'BSLMF_RETURN' and accept variable (C-style varargs) number of arguments

    enum {
        IS_FUNCTION_POINTER = 1,
        IS_NOEXCEPT = 1
    };
    enum { e_IS_VARARG = 1 };
    typedef BSLMF_RETURN                     ResultType;
    typedef typename TypeList<ARGS...>::Type ArgumentList;
    typedef BSLMF_RETURN                     FuncType(ARGS...,...) noexcept;
    typedef FunctionPointerCPlusPlusLinkage  Linkage;
};

#if defined(BSLS_PLATFORM_CMP_CLANG)
#pragma clang diagnostic pop
#endif

#endif // BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT_TYPES

}  // close package namespace

#ifndef BDE_OPENSOURCE_PUBLICATION  // BACKWARD_COMPATIBILITY
// ============================================================================
//                           BACKWARD COMPATIBILITY
// ============================================================================

typedef bslmf::FunctionPointerCPlusPlusLinkage
                                         bslmf_FunctionPointerCPlusPlusLinkage;
    // This alias is defined for backward compatibility.

typedef bslmf::FunctionPointerCLinkage bslmf_FunctionPointerCLinkage;
    // This alias is defined for backward compatibility.

#ifdef bslmf_FunctionPointerTraits
#undef bslmf_FunctionPointerTraits
#endif
#define bslmf_FunctionPointerTraits bslmf::FunctionPointerTraits
    // This alias is defined for backward compatibility.

#ifdef bslmf_IsFunctionPointer
#undef bslmf_IsFunctionPointer
#endif
#define bslmf_IsFunctionPointer bslmf::IsFunctionPointer
    // This alias is defined for backward compatibility.
#endif  // BDE_OPENSOURCE_PUBLICATION -- BACKWARD_COMPATIBILITY

}  // close enterprise namespace

#endif // End C++11 code

#endif

// ----------------------------------------------------------------------------
// Copyright 2013 Bloomberg Finance L.P.
//
// 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.
// ----------------------------- END-OF-FILE ----------------------------------


text:
/**
 * @file
 *
 * @brief Zephyr testing suite
 */

/**
 * @brief Zephyr Tests
 * @defgroup all_tests Zephyr Tests
 * @{
 * @}
 */

#ifndef ZEPHYR_TESTSUITE_INCLUDE_ZTEST_H_
#define ZEPHYR_TESTSUITE_INCLUDE_ZTEST_H_

/**
 * @defgroup ztest Zephyr testing suite
 */

#if !defined(CONFIG_ZTEST) && !defined(ZTEST_UNITTEST)
#error "You need to add CONFIG_ZTEST to your config file."
#endif

#ifndef KERNEL
#define CONFIG_STDOUT_CONSOLE 1
#define CONFIG_ZTEST_ASSERT_VERBOSE 1
#define CONFIG_ZTEST_MOCKING
#define CONFIG_NUM_COOP_PRIORITIES 16
#define CONFIG_COOP_ENABLED 1
#define CONFIG_PREEMPT_ENABLED 1
#define CONFIG_MP_NUM_CPUS 1
#define CONFIG_SYS_CLOCK_TICKS_PER_SEC 100
#define CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC 10000000
#define ARCH_STACK_PTR_ALIGN 8
/* FIXME: Properly integrate with Zephyr's arch specific code */
#define CONFIG_X86 1
#define CONFIG_PRINTK 1
#ifdef __cplusplus
extern "C" {
#endif
struct esf;
typedef struct esf z_arch_esf_t;
#ifdef __cplusplus
}
#endif
#endif /* KERNEL */

#include <sys/printk.h>
#define PRINT printk

#include <zephyr.h>

#include <ztest_assert.h>
#include <ztest_mock.h>
#include <ztest_test.h>
#include <tc_util.h>

#ifdef __cplusplus
extern "C" {
#endif

void test_main(void);

#ifdef __cplusplus
}
#endif

#endif /* ZEPHYR_TESTSUITE_INCLUDE_ZTEST_H_ */


text:
/*
 * 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.
 */
package org.gbif.util.zookeeper;

import java.io.IOException;

import org.apache.zookeeper.KeeperException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Utility to recursively delete the contents of a node in ZooKeeper. The passed in node is not
 * deleted - only the nodes below it.
 */
public class ZookeeperCleanup {

  private static final Logger LOG = LoggerFactory.getLogger(ZookeeperCleanup.class);

  private ZookeeperCleanup() {}

  /**
   * First and only arg needs to be the node whose content should be deleted, e.g. "/dev_crawler".
   */
  public static void main(String[] args) throws IOException, KeeperException, InterruptedException {
    if (args.length != 2) {
      LOG.error(
          "Usage: ZookeeperCleanup <node name> <zk path e.g. c1n8.gbif.org:2181,c1n9.gbif.org:2181,c1n10.gbif.org:2181>");
      System.exit(1);
    }
    LOG.debug("ZookeeperCleanup starting");
    ZookeeperCleaner zkCleaner = new ZookeeperCleaner(args[1]);
    zkCleaner.clean(args[0], true);
    LOG.debug("ZookeeperCleanup finished");
  }
}


text:
#ifndef QMITKMXNMULTIWIDGETEDITORPREFERENCEPAGE_H
#define QMITKMXNMULTIWIDGETEDITORPREFERENCEPAGE_H

#include "ui_QmitkMxNMultiWidgetEditorPreferencePage.h"

#include <berryIPreferences.h>
#include <berryIQtPreferencePage.h>
#include <QProcess>
#include <QScopedPointer>
#include <QPushButton>

class QmitkMxNMultiWidgetEditorPreferencePage : public QObject, public berry::IQtPreferencePage
{
  Q_OBJECT
  Q_INTERFACES(berry::IPreferencePage)

public:

  QmitkMxNMultiWidgetEditorPreferencePage();
  ~QmitkMxNMultiWidgetEditorPreferencePage() override;

  void Init(berry::IWorkbench::Pointer) override;
  void CreateQtControl(QWidget* parent) override;
  QWidget* GetQtControl() const override;

  bool PerformOk() override;
  void PerformCancel() override;
  void Update() override;

public slots:
  /**
   * @brief ResetColors set default colors and refresh the GUI.
   */
  void ResetPreferencesAndGUI();

  void ChangeColormap(int i);

protected:
  std::string m_CurrentColormap;

  /**
   * @brief m_Preferences the berry preferences.
   */
  berry::IPreferences::Pointer m_Preferences;

private:

  Ui::QmitkMxNMultiWidgetEditorPreferencePage m_Ui;
  QWidget* m_MainControl;

};

#endif // QMITKMXNMULTIWIDGETEDITORPREFERENCEPAGE_H


text:
// Automatically generated from TypeScript type definitions provided by
// DefinitelyTyped (https://github.com/DefinitelyTyped/DefinitelyTyped),
// which is licensed under the MIT license; see file DefinitelyTyped-LICENSE
// in parent directory.
// Type definitions for Node.js 10.5.x
// Project: http://nodejs.org/
// Definitions by: Microsoft TypeScript <http://typescriptlang.org>
//                 DefinitelyTyped <https://github.com/DefinitelyTyped/DefinitelyTyped>
//                 Parambir Singh <https://github.com/parambirs>
//                 Christian Vaagland Tellnes <https://github.com/tellnes>
//                 Wilco Bakker <https://github.com/WilcoBakker>
//                 Nicolas Voigt <https://github.com/octo-sniffle>
//                 Chigozirim C. <https://github.com/smac89>
//                 Flarna <https://github.com/Flarna>
//                 Mariusz Wiktorczyk <https://github.com/mwiktorczyk>
//                 wwwy3y3 <https://github.com/wwwy3y3>
//                 Deividas Bakanas <https://github.com/DeividasBakanas>
//                 Kelvin Jin <https://github.com/kjin>
//                 Alvis HT Tang <https://github.com/alvis>
//                 Sebastian Silbermann <https://github.com/eps1lon>
//                 Hannes Magnusson <https://github.com/Hannes-Magnusson-CK>
//                 Alberto Schiabel <https://github.com/jkomyno>
//                 Klaus Meinhardt <https://github.com/ajafff>
//                 Huw <https://github.com/hoo29>
//                 Nicolas Even <https://github.com/n-e>
//                 Bruno Scheufler <https://github.com/brunoscheufler>
//                 Mohsen Azimi <https://github.com/mohsen1>
//                 Hoàng Văn Khải <https://github.com/KSXGitHub>
//                 Alexander T. <https://github.com/a-tarasyuk>
//                 Lishude <https://github.com/islishude>
//                 Andrew Makarov <https://github.com/r3nya>
//                 Zane Hannan AU <https://github.com/ZaneHannanAU>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/**
 * @externs
 * @fileoverview Definitions for module "https"
 */

var https = {};

var tls = require("tls");

var http = require("http");

/**
 * @interface
 */
https.ServerOptions = function() {};

/**
 * @type {*}
 */
https.ServerOptions.prototype.pfx;

/**
 * @type {*}
 */
https.ServerOptions.prototype.key;

/**
 * @type {string}
 */
https.ServerOptions.prototype.passphrase;

/**
 * @type {*}
 */
https.ServerOptions.prototype.cert;

/**
 * @type {*}
 */
https.ServerOptions.prototype.ca;

/**
 * @type {*}
 */
https.ServerOptions.prototype.crl;

/**
 * @type {string}
 */
https.ServerOptions.prototype.ciphers;

/**
 * @type {boolean}
 */
https.ServerOptions.prototype.honorCipherOrder;

/**
 * @type {boolean}
 */
https.ServerOptions.prototype.requestCert;

/**
 * @type {boolean}
 */
https.ServerOptions.prototype.rejectUnauthorized;

/**
 * @type {*}
 */
https.ServerOptions.prototype.NPNProtocols;

/**
 * @type {(function(string, (function(Error, tls.SecureContext): *)): *)}
 */
https.ServerOptions.prototype.SNICallback;

/**
 * @interface
 * @extends {http.RequestOptions}
 */
https.RequestOptions = function() {};

/**
 * @type {*}
 */
https.RequestOptions.prototype.pfx;

/**
 * @type {*}
 */
https.RequestOptions.prototype.key;

/**
 * @type {string}
 */
https.RequestOptions.prototype.passphrase;

/**
 * @type {*}
 */
https.RequestOptions.prototype.cert;

/**
 * @type {*}
 */
https.RequestOptions.prototype.ca;

/**
 * @type {string}
 */
https.RequestOptions.prototype.ciphers;

/**
 * @type {boolean}
 */
https.RequestOptions.prototype.rejectUnauthorized;

/**
 * @type {string}
 */
https.RequestOptions.prototype.secureProtocol;

/**
 * @interface
 * @extends {http.Agent}
 */
https.Agent = function() {};

/**
 * @interface
 * @extends {http.AgentOptions}
 */
https.AgentOptions = function() {};

/**
 * @type {*}
 */
https.AgentOptions.prototype.pfx;

/**
 * @type {*}
 */
https.AgentOptions.prototype.key;

/**
 * @type {string}
 */
https.AgentOptions.prototype.passphrase;

/**
 * @type {*}
 */
https.AgentOptions.prototype.cert;

/**
 * @type {*}
 */
https.AgentOptions.prototype.ca;

/**
 * @type {string}
 */
https.AgentOptions.prototype.ciphers;

/**
 * @type {boolean}
 */
https.AgentOptions.prototype.rejectUnauthorized;

/**
 * @type {string}
 */
https.AgentOptions.prototype.secureProtocol;

/**
 * @type {number}
 */
https.AgentOptions.prototype.maxCachedSessions;

/**
 * @type {(function(new: https.Agent, https.AgentOptions=))}
 */
https.Agent;

/**
 * @interface
 * @extends {tls.Server}
 */
https.Server = function() {};

/**
 * @param {https.ServerOptions} options
 * @param {Function=} requestListener
 * @return {https.Server}
 */
https.createServer = function(options, requestListener) {};

/**
 * @param {https.RequestOptions} options
 * @param {(function(http.IncomingMessage): void)=} callback
 * @return {http.ClientRequest}
 */
https.request = function(options, callback) {};

/**
 * @param {https.RequestOptions} options
 * @param {(function(http.IncomingMessage): void)=} callback
 * @return {http.ClientRequest}
 */
https.get = function(options, callback) {};

/**
 * @type {https.Agent}
 */
https.globalAgent;

module.exports.ServerOptions = https.ServerOptions;

module.exports.RequestOptions = https.RequestOptions;

module.exports.Agent = https.Agent;

module.exports.AgentOptions = https.AgentOptions;

module.exports.Agent = https.Agent;

module.exports.Server = https.Server;

module.exports.createServer = https.createServer;

module.exports.request = https.request;

module.exports.get = https.get;

module.exports.globalAgent = https.globalAgent;


text:
package org.bitcoinj.jni;

import org.bitcoinj.core.BlockChain;
import org.bitcoinj.base.Sha256Hash;
import org.bitcoinj.core.StoredBlock;
import org.bitcoinj.core.Transaction;
import org.bitcoinj.core.VerificationException;
import org.bitcoinj.core.listeners.NewBestBlockListener;
import org.bitcoinj.core.listeners.ReorganizeListener;
import org.bitcoinj.core.listeners.TransactionReceivedInBlockListener;

import java.util.List;

/**
 * An event listener that relays events to a native C++ object. A pointer to that object is stored in
 * this class using JNI on the native side, thus several instances of this can point to different actual
 * native implementations.
 * @deprecated See https://github.com/bitcoinj/bitcoinj/issues/2465
 */
@Deprecated
public class NativeBlockChainListener implements NewBestBlockListener, ReorganizeListener, TransactionReceivedInBlockListener {
    public long ptr;

    @Override
    public native void notifyNewBestBlock(StoredBlock block) throws VerificationException;

    @Override
    public native void reorganize(StoredBlock splitPoint, List<StoredBlock> oldBlocks, List<StoredBlock> newBlocks) throws VerificationException;

    @Override
    public native void receiveFromBlock(Transaction tx, StoredBlock block, BlockChain.NewBlockType blockType,
                                        int relativityOffset) throws VerificationException;

    @Override
    public native boolean notifyTransactionIsInBlock(Sha256Hash txHash, StoredBlock block, BlockChain.NewBlockType blockType,
                                                     int relativityOffset) throws VerificationException;
}


text:
using System.Collections.Generic;

namespace Notes.Areas.Admin.Models
{
	public class UserListContainer
	{
		public IEnumerable<UserModel> Users { get; set; }
	}
}


text:
<?php

namespace LaravelFacebookAds\Exceptions;

/**
 * Class InvalidAccountConfigurationException
 * @package LaravelFacebookAds\Exceptions
 */
class InvalidAccountConfigurationException extends Exception
{
    /**
     * Invalid account exception
     *
     * @param string $name
     * @param int $code
     * @param \Exception|null $previous
     */
    public function __construct($name, $code = 0, \Exception $previous = null)
    {
        $message = sprintf(
            'Account with name \'%s\' has an invalid configuration',
            $name
        );

        parent::__construct($message, $code, $previous);
    }
}


text:
layout: post
title: "CoreNLP"
author: Charlie Greenbacker
categories: natural-language-processing
---
CoreNLP is a suite of high-quality, Java-based natural language processing (NLP) tools, created by the Stanford NLP Group led by Chris Manning, Dan Jurafsky, and Percy Liang. Although individual components date back to at least 2002, the first release of CoreNLP as full software suite was in 2010.

[<img style="float: right" src="{{ site.url }}/img/stanford-nlp.jpg" />](http://nlp.stanford.edu/software/corenlp.shtml)

__Creator:__ [Stanford NLP Group](http://nlp.stanford.edu/)

__License:__ [GPL Version 2](http://opensource.org/licenses/GPL-2.0)

__Website:__ [nlp.stanford.edu/software/corenlp.shtml](http://nlp.stanford.edu/software/corenlp.shtml)

__Source:__ [github.com/stanfordnlp/CoreNLP](https://github.com/stanfordnlp/CoreNLP)

__Features:__

* Includes tools for part-of-speech tagging, named entity recognition (i.e., entity extraction), parsing, coreference resolution, sentiment analysis, temporal analysis, and more
* Trained language models are available for English, Chinese, Arabic, and German


text:
package com.woorea.openstack.ceilometer;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.woorea.openstack.base.client.OpenStackRequest;

public abstract class QueriableCeilometerCommand<T,R> extends OpenStackRequest<R> {

	protected List<String> fields = new ArrayList<String>();

	protected List<String> ops = new ArrayList<String>();

	protected List<Serializable> values = new ArrayList<Serializable>();

	private T filter(String field, String op, Serializable value) {
		fields.add(field);
		ops.add(op);
		values.add(value);
		return (T) this;
	}

	public T lt(String field, Serializable value) {
		return filter(field, "lt", value);
	}

	public T le(String field, Serializable value) {
		return filter(field, "le", value);
	}

	public T eq(String field, Serializable value) {
		return filter(field, "eq", value);
	}

	public T ne(String field, Serializable value) {
		return filter(field, "ne", value);
	}

	public T ge(String field, Serializable value) {
		return filter(field, "ge", value);
	}

	public T gt(String field, Serializable value) {
		return filter(field, "gt", value);
	}

	/*
	public WebTarget query(WebTarget target) {
		if(fields.size() > 0) {
			target = target.queryParam("q.field", fields.toArray());
			target = target.queryParam("q.op", ops.toArray());
			target = target.queryParam("q.value", values.toArray());
		}
		return target;
	}
	*/
}


text:
# page

На уровне переопределения `desktop.blocks` блок предоставляет шаблон, создающий дополнительный HTML-элемент `<meta>`.

## Обзор

### Специализированные поля блока

| Поле | Тип | Описание |
| ---- | --- | -------- |
| x-ua-compatible | `{String}`|`{Boolean}` | Управляет поведением создаваемого блоком HTML-элемента `<meta>` с атрибутом `http-equiv` `X-UA-Compatible`. |

### Элементы блока

| Элемент | Способы использования | Описание |
| ------- | --------------------- | -------- |
| css | `BEMJSON` | Элемент служит для подключения CSS. |
| conditional-comment | `BEMJSON` | Помогает использовать условные комментарии. |

### Специализированные поля элементов блока

| Элемент | Поле | Тип | Описание |
| ------- | ---- | --- | -------- |
| css | `ie` | `{String}`|`{Boolean}` | Используется для указания применимости стилей к Internet Explorer версий 6-9 и подключения специальных стилей для Internet Explorer.  |
| conditional-comment | `condition` | `{String}` | Позволяет указать условие, при выполнении которого содержимое поля `content` декларации элемента, будет доступно.  |
|  | `msieOnly` | `{Boolean}` | Указывает, предназначен ли данный условный комментарий для использования исключительно в Internet Explorer.  |

### Публичные технологии блока

Блок реализован в технологиях:

* `bh.js`
* `bemhtml`

## Подробности

Создает HTML-элемент `<meta>` с атрибутом `http-equiv` `X-UA-Compatible`, определяющий совместимость с юзер-агентами. По умолчанию, значением атрибута `content` элемента является `IE=edge` (совместим с последними версиями Internet Explorer).

### Специализированные поля блока

#### Поле `x-ua-compatible`

Тип: `{String}`|`{Boolean}`.

Управляет поведением создаваемого блоком HTML-элемента `<meta>` с атрибутом `http-equiv` `X-UA-Compatible`:

* со значением `false` HTML-элемент `<meta>` не будет создаваться.
*
```js
{
    block : 'page',
    title : 'Hello, World!',
    'x-ua-compatible' : false,
    content : 'Отмена создания HTML-элемента <meta>'
}
```

* строчное значение будет присвоено свойству `content` HTML-элемента `<meta>`.

```js
{
    block : 'page',
    title : 'Hello, World!',
    'x-ua-compatible' : 'IE=6',
    content : 'Совместим с Internet Explorer 6'
}
```

### Элементы блока

#### Элемент `css`

##### Специализированное поле `ie`

Тип: `{String}`|`{Boolean}`.

Используется для указания применимости стилей к Internet Explorer версий 6-9 и подключения специальных стилей Internet Explorer.

Допустимы следующие значения:

* строка вида `'lt IE 8'` – элемент `<link>` будет обернут в условные комментарии, для использования в соответствующих версиях Internet Explorer (для текущего примера `lt IE 8` – ниже восьмой версии).
* `false` – будут использоваться условные комментарии, предотвращающие использование стилей в IE 9 и ниже.
* `true` – используется в случае, если в проекте есть отдельный CSS для каждой версии Internet Explorer. Значением свойства `url`, при этом, должна быть строка с путем и именем файла без суффикса. Во время подключения создаются элементы `<link>` с отдельным суффиксом для каждой версии. Другими словами, при значении `url` равном `foo.com/index` будут подключены стили `foo.com/index.ie6.css`, `foo.com/index.ie7.css` и т.д. до `...ie9.css`. При этом каждый HTML-элемент будет обернут в условный комментарий, обеспечивающий его подключение только в соответствующей версии Internet Explorer.

```js
{
    block : 'page',
    title : 'Page title',
    head : [
        { elem : 'css', url : 'example.css', ie : false },
        { elem : 'css', url : 'example.ie.css', ie : 'lt IE 8' }
    ],
    content : 'Страница с отдельными CSS правилами для IE'
}
```

#### Элемент `conditional-comment`

Позволяет обернуть содержимое поля `content`, определенное в BEMJSON-декларации элемента, в условные комментарии. Условие, при котором содержимое поля будет доступно, определяется специализированным полем `condition`.

```js
({
    block : 'page',
    title : 'page__conditional-comments',
    styles :
        {
            elem : 'conditional-comment',
            condition : '<= IE 8',
            content : { elem : 'css', url : '_page.ie.css' }
        },
    scripts :
        {
            elem : 'conditional-comment',
            condition : 'lte IE 8',
            content : { elem : 'js', url : 'https://yastatic.net/es5-shims/0.0.1/es5-shims.min.js' }
        }
})
```

##### Специализированное поле `condition`

Тип: `{String}`.

Условие, при выполнении которого содержимое поля `content` декларации элемента, будет доступно. Например, определенная версия Internet Explorer.

Значение поля составляется из:

* квантора – `>`, `<`, `=`, `<=`, `>=`, `lt`, `gt`, `e` или `!` (логическое «не»);
* слова `IE` отделенного с обеих сторон пробелами;
* номера версии (6, 7, 8, 9). Может отсутствовать, если указан квантор `!`. Тогда, значение поля `content` будет доступно для всех браузеров, кроме Internet Explorer.

```js
({
    block : 'page',
    head :
        {
            elem : 'conditional-comment',
            condition : '! IE',
            content : 'Not for IE'
        }
})
```

##### Специализированное поле `msieOnly`

Тип: `{Boolean}`.

Указывает на то, предназначен ли данный условный комментарий для использования исключительно в Internet Explorer. Со значением `true` поле можно не указывать.

```js
({
    block : 'page',
    head :
        {
            elem : 'conditional-comment',
            condition : '> IE 8',
            msieOnly : false,
            content : 'For IE9+ and all other browsers'
        }
})
```


text:
require "kase/errors"

module Kase
  class Switcher
    def initialize(*values)
      if values.size == 1 && values.first.is_a?(Array)
        values = values.first
      end
      @values = values
      @matched = false
    end

    attr_reader :values
    attr_reader :result

    def matched?
      !!@matched
    end

    def match?(*pattern)
      values[0...pattern.size] == pattern
    end

    def on(*pattern)
      return if matched?
      return unless match?(*pattern)
      @matched = true
      @result = yield(*values[pattern.size..-1])
    end

    def validate!
      raise NoMatchError.new(values) unless matched?
      true
    end

    def switch(&block)
      DSL.call(self, &block)
      validate!
      result
    end

    module DSL
      module_function

      def call(switcher, &block)
        context = eval("self", block.binding)
        original_on_method = context.method(:on) if defined? context.on
        new_on_method = nil

        # Define a new :on method for the caller context
        context.define_singleton_method(:on) do |*pattern, &inner_block|

          new_inner_block = proc do |*args|
            # Use the original :on method inside the inner blocks
            DSL.set_on_method(context, original_on_method)
            result = inner_block.call(*args)
            DSL.set_on_method(context, new_on_method)
            result
          end

          switcher.on(*pattern, &new_inner_block)
        end
        new_on_method = context.method(:on)

        block.call
      ensure
        DSL.set_on_method(context, original_on_method)
      end

      def set_on_method(context, method)
        if method
          context.define_singleton_method(:on, method)
        else
          context.instance_eval { undef :on if defined? on }
        end
      end
    end
  end
end


text:
using System;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Windows.Web.Http;
using Windows.Web.Http.Filters;
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
using System.Runtime.InteropServices;

namespace Sannel.House.ServerSDK.Tests
{
	public partial class ServerContextTests
	{
#region Devices
		[TestMethod]
		public async Task GetDeviceAsyncTest()
		{
			Int32 _Id = 0;
			String _Name = String.Empty;
			String _Description = String.Empty;
			Int32 _DisplayOrder = 0;
			DateTimeOffset _DateCreated = DateTimeOffset.MinValue;
			Boolean _IsReadOnly = false;
			// Setup Stub
			var stub = new StubIDevice();
			stub.Id_Get(() => _Id);
			stub.Id_Set((v) => _Id = v);
			stub.Name_Get(() => _Name);
			stub.Name_Set((v) => _Name = v);
			stub.Description_Get(() => _Description);
			stub.Description_Set((v) => _Description = v);
			stub.DisplayOrder_Get(() => _DisplayOrder);
			stub.DisplayOrder_Set((v) => _DisplayOrder = v);
			stub.DateCreated_Get(() => _DateCreated);
			stub.DateCreated_Set((v) => _DateCreated = v);
			stub.IsReadOnly_Get(() => _IsReadOnly);
			stub.IsReadOnly_Set((v) => _IsReadOnly = v);
			// create helper
			var create = new StubICreateHelper();
			create.CreateDevice(() => stub);
			// settings
			var settings = new StubIServerSettings();
			settings.ServerUri_Get(() => null);
			// Http Client
			var httpClient = new StubIHttpClient();
			// Server
			var serverContext = new ServerContext(settings, create, httpClient);
			Int32 key = 179;
			// leading
			var results = await serverContext.GetDeviceAsync(key);
			Assert.AreEqual(RequestStatus.ServerUriNotSet, results.Status);
			Assert.IsNull(results.Data, "Data should not be null");
			Assert.AreEqual(0, results.Key);
			// login exception
			settings.ServerUri_Get(() => new Uri("http://test"));
			httpClient.PostAsync((uri, d) =>
			{
				return Task.Run(() =>
				{
					return new HttpClientResult{StatusCode = HttpStatusCode.Ok, Content = ""};
				}

				).AsAsyncOperation();
			}

			);
			httpClient.GetCookieValue((u, name) => "Value");
			await serverContext.LoginAsync("user", "pass");
			settings.ServerUri_Get(() => new Uri("/cheese", UriKind.Relative));
			// invalid uri
			results = await serverContext.GetDeviceAsync(key);
			Assert.AreEqual(RequestStatus.ServerUriIsNotValid, results.Status);
			Assert.IsNull(results.Data, "Data should not be null");
			Assert.AreEqual(0, results.Key);
			// Unable to connect to server
			key = 137;
			settings.ServerUri_Get(() => new Uri("http://test"));
			Exception expectedException = null;
			bool methodHit = false;
			httpClient.GetAsync((uri) =>
			{
				return Task.Run(() =>
				{
					methodHit = true;
					Assert.AreEqual(new Uri($"http://test/api/Device/{key}"), uri);
					expectedException = new COMException("Message1", -2147012867);
					throw expectedException;
					return new HttpClientResult();
				}

				).AsAsyncOperation();
			}

			);
			results = await serverContext.GetDeviceAsync(key);
			Assert.IsTrue(methodHit, "Method not called");
			Assert.AreEqual(RequestStatus.UnableToConnectToServer, results.Status);
			Assert.IsNull(results.Data, "Data should not be null");
			Assert.AreEqual(key, results.Key);
			Assert.AreEqual(expectedException, results.Exception);
			// COMException
			methodHit = false;
			httpClient.GetAsync((uri) =>
			{
				return Task.Run(() =>
				{
					methodHit = true;
					expectedException = new COMException("Message2");
					throw expectedException;
					return new HttpClientResult();
				}

				).AsAsyncOperation();
			}

			);
			results = await serverContext.GetDeviceAsync(key);
			Assert.IsTrue(methodHit, "Method not called");
			Assert.AreEqual(RequestStatus.Exception, results.Status);
			Assert.IsNull(results.Data, "Data should be null");
			Assert.AreEqual(key, results.Key);
			Assert.AreEqual(expectedException, results.Exception);
			// Exception
			methodHit = false;
			httpClient.GetAsync((uri) =>
			{
				return Task.Run(() =>
				{
					methodHit = true;
					expectedException = new Exception("Message3");
					throw expectedException;
					return new HttpClientResult();
				}

				).AsAsyncOperation();
			}

			);
			results = await serverContext.GetDeviceAsync(key);
			Assert.IsTrue(methodHit, "Method not called");
			Assert.AreEqual(RequestStatus.Exception, results.Status);
			Assert.IsNull(results.Data, "Data should be null");
			Assert.AreEqual(key, results.Key);
			Assert.AreEqual(expectedException, results.Exception);
			// Unauthorized
			methodHit = false;
			httpClient.GetAsync((uri) =>
			{
				return Task.Run(() =>
				{
					methodHit = true;
					return new HttpClientResult()
					{StatusCode = HttpStatusCode.Unauthorized, Content = "{Test: 'cheese'"};
				}

				).AsAsyncOperation();
			}

			);
			results = await serverContext.GetDeviceAsync(key);
			Assert.IsTrue(methodHit, "Method not called");
			Assert.AreEqual(RequestStatus.Error, results.Status);
			Assert.IsNull(results.Data, "Data should be null");
			Assert.AreEqual(key, results.Key);
			Assert.IsInstanceOfType(results.Exception, typeof (JsonReaderException));
			// Success Test
			var exp = new StubIDevice();
			exp.Id_Get(() => key);
			exp.Name_Get(() => "gntloguqyqftfqllcsrkqtoyosk");
			exp.Description_Get(() => "oexoalbgrnxhwvgkvhvchtgve");
			exp.DisplayOrder_Get(() => 56);
			exp.DateCreated_Get(() => new DateTimeOffset(1987, 6, 26, 20, 53, 50, TimeSpan.FromHours(-5)));
			exp.IsReadOnly_Get(() => false);
			IDevice expected = exp;
			var jobj = new JObject();
			jobj.Add(new JProperty(nameof(expected.Id), expected.Id));
			jobj.Add(new JProperty(nameof(expected.Name), expected.Name));
			jobj.Add(new JProperty(nameof(expected.Description), expected.Description));
			jobj.Add(new JProperty(nameof(expected.DisplayOrder), expected.DisplayOrder));
			jobj.Add(new JProperty(nameof(expected.DateCreated), expected.DateCreated));
			jobj.Add(new JProperty(nameof(expected.IsReadOnly), expected.IsReadOnly));
			methodHit = false;
			httpClient.GetAsync((uri) =>
			{
				return Task.Run(() =>
				{
					methodHit = true;
					return new HttpClientResult{StatusCode = HttpStatusCode.Ok, Content = jobj.ToString()};
				}

				).AsAsyncOperation();
			}

			);
			results = await serverContext.GetDeviceAsync(key);
			Assert.IsTrue(methodHit, "Method not called");
			Assert.AreEqual(RequestStatus.Success, results.Status);
			Assert.AreEqual(key, results.Key);
			Assert.IsNull(results.Exception, "Exception should be null");
			Assert.IsNotNull(results.Data, "Data should not be null");
			var actual = results.Data;
			Assert.AreEqual(expected.Id, actual.Id);
			Assert.AreEqual(expected.Name, actual.Name);
			Assert.AreEqual(expected.Description, actual.Description);
			Assert.AreEqual(expected.DisplayOrder, actual.DisplayOrder);
			Assert.AreEqual(expected.DateCreated, actual.DateCreated);
			Assert.AreEqual(expected.IsReadOnly, actual.IsReadOnly);
		}
#endregion

#region TemperatureSettings
		[TestMethod]
		public async Task GetTemperatureSettingAsyncTest()
		{
			Int64 _Id = 0;
			Int32? _DayOfWeek = 0;
			Int32? _Month = 0;
			Boolean _IsTimeOnly = false;
			DateTimeOffset? _StartTime = DateTimeOffset.MinValue;
			DateTimeOffset? _EndTime = DateTimeOffset.MinValue;
			Double _HeatTemperatureC = 0;
			Double _CoolTemperatureC = 0;
			DateTimeOffset _DateCreated = DateTimeOffset.MinValue;
			DateTimeOffset _DateModified = DateTimeOffset.MinValue;
			// Setup Stub
			var stub = new StubITemperatureSetting();
			stub.Id_Get(() => _Id);
			stub.Id_Set((v) => _Id = v);
			stub.DayOfWeek_Get(() => _DayOfWeek);
			stub.DayOfWeek_Set((v) => _DayOfWeek = v);
			stub.Month_Get(() => _Month);
			stub.Month_Set((v) => _Month = v);
			stub.IsTimeOnly_Get(() => _IsTimeOnly);
			stub.IsTimeOnly_Set((v) => _IsTimeOnly = v);
			stub.StartTime_Get(() => _StartTime);
			stub.StartTime_Set((v) => _StartTime = v);
			stub.EndTime_Get(() => _EndTime);
			stub.EndTime_Set((v) => _EndTime = v);
			stub.HeatTemperatureC_Get(() => _HeatTemperatureC);
			stub.HeatTemperatureC_Set((v) => _HeatTemperatureC = v);
			stub.CoolTemperatureC_Get(() => _CoolTemperatureC);
			stub.CoolTemperatureC_Set((v) => _CoolTemperatureC = v);
			stub.DateCreated_Get(() => _DateCreated);
			stub.DateCreated_Set((v) => _DateCreated = v);
			stub.DateModified_Get(() => _DateModified);
			stub.DateModified_Set((v) => _DateModified = v);
			// create helper
			var create = new StubICreateHelper();
			create.CreateTemperatureSetting(() => stub);
			// settings
			var settings = new StubIServerSettings();
			settings.ServerUri_Get(() => null);
			// Http Client
			var httpClient = new StubIHttpClient();
			// Server
			var serverContext = new ServerContext(settings, create, httpClient);
			Int64 key = 51;
			// leading
			var results = await serverContext.GetTemperatureSettingAsync(key);
			Assert.AreEqual(RequestStatus.ServerUriNotSet, results.Status);
			Assert.IsNull(results.Data, "Data should not be null");
			Assert.AreEqual(0, results.Key);
			// login exception
			settings.ServerUri_Get(() => new Uri("http://test"));
			httpClient.PostAsync((uri, d) =>
			{
				return Task.Run(() =>
				{
					return new HttpClientResult{StatusCode = HttpStatusCode.Ok, Content = ""};
				}

				).AsAsyncOperation();
			}

			);
			httpClient.GetCookieValue((u, name) => "Value");
			await serverContext.LoginAsync("user", "pass");
			settings.ServerUri_Get(() => new Uri("/cheese", UriKind.Relative));
			// invalid uri
			results = await serverContext.GetTemperatureSettingAsync(key);
			Assert.AreEqual(RequestStatus.ServerUriIsNotValid, results.Status);
			Assert.IsNull(results.Data, "Data should not be null");
			Assert.AreEqual(0, results.Key);
			// Unable to connect to server
			key = 76;
			settings.ServerUri_Get(() => new Uri("http://test"));
			Exception expectedException = null;
			bool methodHit = false;
			httpClient.GetAsync((uri) =>
			{
				return Task.Run(() =>
				{
					methodHit = true;
					Assert.AreEqual(new Uri($"http://test/api/TemperatureSetting/{key}"), uri);
					expectedException = new COMException("Message1", -2147012867);
					throw expectedException;
					return new HttpClientResult();
				}

				).AsAsyncOperation();
			}

			);
			results = await serverContext.GetTemperatureSettingAsync(key);
			Assert.IsTrue(methodHit, "Method not called");
			Assert.AreEqual(RequestStatus.UnableToConnectToServer, results.Status);
			Assert.IsNull(results.Data, "Data should not be null");
			Assert.AreEqual(key, results.Key);
			Assert.AreEqual(expectedException, results.Exception);
			// COMException
			methodHit = false;
			httpClient.GetAsync((uri) =>
			{
				return Task.Run(() =>
				{
					methodHit = true;
					expectedException = new COMException("Message2");
					throw expectedException;
					return new HttpClientResult();
				}

				).AsAsyncOperation();
			}

			);
			results = await serverContext.GetTemperatureSettingAsync(key);
			Assert.IsTrue(methodHit, "Method not called");
			Assert.AreEqual(RequestStatus.Exception, results.Status);
			Assert.IsNull(results.Data, "Data should be null");
			Assert.AreEqual(key, results.Key);
			Assert.AreEqual(expectedException, results.Exception);
			// Exception
			methodHit = false;
			httpClient.GetAsync((uri) =>
			{
				return Task.Run(() =>
				{
					methodHit = true;
					expectedException = new Exception("Message3");
					throw expectedException;
					return new HttpClientResult();
				}

				).AsAsyncOperation();
			}

			);
			results = await serverContext.GetTemperatureSettingAsync(key);
			Assert.IsTrue(methodHit, "Method not called");
			Assert.AreEqual(RequestStatus.Exception, results.Status);
			Assert.IsNull(results.Data, "Data should be null");
			Assert.AreEqual(key, results.Key);
			Assert.AreEqual(expectedException, results.Exception);
			// Unauthorized
			methodHit = false;
			httpClient.GetAsync((uri) =>
			{
				return Task.Run(() =>
				{
					methodHit = true;
					return new HttpClientResult()
					{StatusCode = HttpStatusCode.Unauthorized, Content = "{Test: 'cheese'"};
				}

				).AsAsyncOperation();
			}

			);
			results = await serverContext.GetTemperatureSettingAsync(key);
			Assert.IsTrue(methodHit, "Method not called");
			Assert.AreEqual(RequestStatus.Error, results.Status);
			Assert.IsNull(results.Data, "Data should be null");
			Assert.AreEqual(key, results.Key);
			Assert.IsInstanceOfType(results.Exception, typeof (JsonReaderException));
			// Success Test
			var exp = new StubITemperatureSetting();
			exp.Id_Get(() => key);
			exp.DayOfWeek_Get(() => 9);
			exp.Month_Get(() => 131);
			exp.IsTimeOnly_Get(() => true);
			exp.StartTime_Get(() => new DateTimeOffset(2007, 8, 16, 6, 43, 26, TimeSpan.FromHours(-6)));
			exp.EndTime_Get(() => new DateTimeOffset(2003, 7, 27, 5, 23, 23, TimeSpan.FromHours(-5)));
			exp.HeatTemperatureC_Get(() => 0.29844863586986842);
			exp.CoolTemperatureC_Get(() => 0.8659522150950284);
			exp.DateCreated_Get(() => new DateTimeOffset(2002, 2, 7, 8, 52, 43, TimeSpan.FromHours(-6)));
			exp.DateModified_Get(() => new DateTimeOffset(1985, 4, 19, 19, 36, 22, TimeSpan.FromHours(-7)));
			ITemperatureSetting expected = exp;
			var jobj = new JObject();
			jobj.Add(new JProperty(nameof(expected.Id), expected.Id));
			jobj.Add(new JProperty(nameof(expected.DayOfWeek), expected.DayOfWeek));
			jobj.Add(new JProperty(nameof(expected.Month), expected.Month));
			jobj.Add(new JProperty(nameof(expected.IsTimeOnly), expected.IsTimeOnly));
			jobj.Add(new JProperty(nameof(expected.StartTime), expected.StartTime));
			jobj.Add(new JProperty(nameof(expected.EndTime), expected.EndTime));
			jobj.Add(new JProperty(nameof(expected.HeatTemperatureC), expected.HeatTemperatureC));
			jobj.Add(new JProperty(nameof(expected.CoolTemperatureC), expected.CoolTemperatureC));
			jobj.Add(new JProperty(nameof(expected.DateCreated), expected.DateCreated));
			jobj.Add(new JProperty(nameof(expected.DateModified), expected.DateModified));
			methodHit = false;
			httpClient.GetAsync((uri) =>
			{
				return Task.Run(() =>
				{
					methodHit = true;
					return new HttpClientResult{StatusCode = HttpStatusCode.Ok, Content = jobj.ToString()};
				}

				).AsAsyncOperation();
			}

			);
			results = await serverContext.GetTemperatureSettingAsync(key);
			Assert.IsTrue(methodHit, "Method not called");
			Assert.AreEqual(RequestStatus.Success, results.Status);
			Assert.AreEqual(key, results.Key);
			Assert.IsNull(results.Exception, "Exception should be null");
			Assert.IsNotNull(results.Data, "Data should not be null");
			var actual = results.Data;
			Assert.AreEqual(expected.Id, actual.Id);
			Assert.AreEqual(expected.DayOfWeek, actual.DayOfWeek);
			Assert.AreEqual(expected.Month, actual.Month);
			Assert.AreEqual(expected.IsTimeOnly, actual.IsTimeOnly);
			Assert.AreEqual(expected.StartTime, actual.StartTime);
			Assert.AreEqual(expected.EndTime, actual.EndTime);
			Assert.AreEqual(expected.HeatTemperatureC, actual.HeatTemperatureC);
			Assert.AreEqual(expected.CoolTemperatureC, actual.CoolTemperatureC);
			Assert.AreEqual(expected.DateCreated, actual.DateCreated);
			Assert.AreEqual(expected.DateModified, actual.DateModified);
		}
#endregion

#region ApplicationLogEntries
		[TestMethod]
		public async Task GetApplicationLogEntryAsyncTest()
		{
			Guid _Id = Guid.Empty;
			Int32? _DeviceId = 0;
			String _ApplicationId = String.Empty;
			String _Message = String.Empty;
			String _Exception = String.Empty;
			DateTimeOffset _CreatedDate = DateTimeOffset.MinValue;
			// Setup Stub
			var stub = new StubIApplicationLogEntry();
			stub.Id_Get(() => _Id);
			stub.Id_Set((v) => _Id = v);
			stub.DeviceId_Get(() => _DeviceId);
			stub.DeviceId_Set((v) => _DeviceId = v);
			stub.ApplicationId_Get(() => _ApplicationId);
			stub.ApplicationId_Set((v) => _ApplicationId = v);
			stub.Message_Get(() => _Message);
			stub.Message_Set((v) => _Message = v);
			stub.Exception_Get(() => _Exception);
			stub.Exception_Set((v) => _Exception = v);
			stub.CreatedDate_Get(() => _CreatedDate);
			stub.CreatedDate_Set((v) => _CreatedDate = v);
			// create helper
			var create = new StubICreateHelper();
			create.CreateApplicationLogEntry(() => stub);
			// settings
			var settings = new StubIServerSettings();
			settings.ServerUri_Get(() => null);
			// Http Client
			var httpClient = new StubIHttpClient();
			// Server
			var serverContext = new ServerContext(settings, create, httpClient);
			Guid key = Guid.NewGuid();
			// leading
			var results = await serverContext.GetApplicationLogEntryAsync(key);
			Assert.AreEqual(RequestStatus.ServerUriNotSet, results.Status);
			Assert.IsNull(results.Data, "Data should not be null");
			Assert.AreEqual(Guid.Empty, results.Key);
			// login exception
			settings.ServerUri_Get(() => new Uri("http://test"));
			httpClient.PostAsync((uri, d) =>
			{
				return Task.Run(() =>
				{
					return new HttpClientResult{StatusCode = HttpStatusCode.Ok, Content = ""};
				}

				).AsAsyncOperation();
			}

			);
			httpClient.GetCookieValue((u, name) => "Value");
			await serverContext.LoginAsync("user", "pass");
			settings.ServerUri_Get(() => new Uri("/cheese", UriKind.Relative));
			// invalid uri
			results = await serverContext.GetApplicationLogEntryAsync(key);
			Assert.AreEqual(RequestStatus.ServerUriIsNotValid, results.Status);
			Assert.IsNull(results.Data, "Data should not be null");
			Assert.AreEqual(Guid.Empty, results.Key);
			// Unable to connect to server
			key = Guid.NewGuid();
			settings.ServerUri_Get(() => new Uri("http://test"));
			Exception expectedException = null;
			bool methodHit = false;
			httpClient.GetAsync((uri) =>
			{
				return Task.Run(() =>
				{
					methodHit = true;
					Assert.AreEqual(new Uri($"http://test/api/ApplicationLogEntry/{key}"), uri);
					expectedException = new COMException("Message1", -2147012867);
					throw expectedException;
					return new HttpClientResult();
				}

				).AsAsyncOperation();
			}

			);
			results = await serverContext.GetApplicationLogEntryAsync(key);
			Assert.IsTrue(methodHit, "Method not called");
			Assert.AreEqual(RequestStatus.UnableToConnectToServer, results.Status);
			Assert.IsNull(results.Data, "Data should not be null");
			Assert.AreEqual(key, results.Key);
			Assert.AreEqual(expectedException, results.Exception);
			// COMException
			methodHit = false;
			httpClient.GetAsync((uri) =>
			{
				return Task.Run(() =>
				{
					methodHit = true;
					expectedException = new COMException("Message2");
					throw expectedException;
					return new HttpClientResult();
				}

				).AsAsyncOperation();
			}

			);
			results = await serverContext.GetApplicationLogEntryAsync(key);
			Assert.IsTrue(methodHit, "Method not called");
			Assert.AreEqual(RequestStatus.Exception, results.Status);
			Assert.IsNull(results.Data, "Data should be null");
			Assert.AreEqual(key, results.Key);
			Assert.AreEqual(expectedException, results.Exception);
			// Exception
			methodHit = false;
			httpClient.GetAsync((uri) =>
			{
				return Task.Run(() =>
				{
					methodHit = true;
					expectedException = new Exception("Message3");
					throw expectedException;
					return new HttpClientResult();
				}

				).AsAsyncOperation();
			}

			);
			results = await serverContext.GetApplicationLogEntryAsync(key);
			Assert.IsTrue(methodHit, "Method not called");
			Assert.AreEqual(RequestStatus.Exception, results.Status);
			Assert.IsNull(results.Data, "Data should be null");
			Assert.AreEqual(key, results.Key);
			Assert.AreEqual(expectedException, results.Exception);
			// Unauthorized
			methodHit = false;
			httpClient.GetAsync((uri) =>
			{
				return Task.Run(() =>
				{
					methodHit = true;
					return new HttpClientResult()
					{StatusCode = HttpStatusCode.Unauthorized, Content = "{Test: 'cheese'"};
				}

				).AsAsyncOperation();
			}

			);
			results = await serverContext.GetApplicationLogEntryAsync(key);
			Assert.IsTrue(methodHit, "Method not called");
			Assert.AreEqual(RequestStatus.Error, results.Status);
			Assert.IsNull(results.Data, "Data should be null");
			Assert.AreEqual(key, results.Key);
			Assert.IsInstanceOfType(results.Exception, typeof (JsonReaderException));
			// Success Test
			var exp = new StubIApplicationLogEntry();
			exp.Id_Get(() => key);
			exp.DeviceId_Get(() => 18);
			exp.ApplicationId_Get(() => "nvnwjccgmexjlorqhcvhqlunp");
			exp.Message_Get(() => "hjfspsjidfohinbkfoyjixrgh");
			exp.Exception_Get(() => "btdbbagourasnfyckmcyt");
			exp.CreatedDate_Get(() => new DateTimeOffset(1991, 3, 7, 7, 15, 33, TimeSpan.FromHours(-7)));
			IApplicationLogEntry expected = exp;
			var jobj = new JObject();
			jobj.Add(new JProperty(nameof(expected.Id), expected.Id));
			jobj.Add(new JProperty(nameof(expected.DeviceId), expected.DeviceId));
			jobj.Add(new JProperty(nameof(expected.ApplicationId), expected.ApplicationId));
			jobj.Add(new JProperty(nameof(expected.Message), expected.Message));
			jobj.Add(new JProperty(nameof(expected.Exception), expected.Exception));
			jobj.Add(new JProperty(nameof(expected.CreatedDate), expected.CreatedDate));
			methodHit = false;
			httpClient.GetAsync((uri) =>
			{
				return Task.Run(() =>
				{
					methodHit = true;
					return new HttpClientResult{StatusCode = HttpStatusCode.Ok, Content = jobj.ToString()};
				}

				).AsAsyncOperation();
			}

			);
			results = await serverContext.GetApplicationLogEntryAsync(key);
			Assert.IsTrue(methodHit, "Method not called");
			Assert.AreEqual(RequestStatus.Success, results.Status);
			Assert.AreEqual(key, results.Key);
			Assert.IsNull(results.Exception, "Exception should be null");
			Assert.IsNotNull(results.Data, "Data should not be null");
			var actual = results.Data;
			Assert.AreEqual(expected.Id, actual.Id);
			Assert.AreEqual(expected.DeviceId, actual.DeviceId);
			Assert.AreEqual(expected.ApplicationId, actual.ApplicationId);
			Assert.AreEqual(expected.Message, actual.Message);
			Assert.AreEqual(expected.Exception, actual.Exception);
			Assert.AreEqual(expected.CreatedDate, actual.CreatedDate);
		}
#endregion

#region TemperatureEntries
		[TestMethod]
		public async Task GetTemperatureEntryAsyncTest()
		{
			Guid _Id = Guid.Empty;
			Int32 _DeviceId = 0;
			Double _TemperatureCelsius = 0;
			Double _Humidity = 0;
			Double _Pressure = 0;
			DateTimeOffset _CreatedDateTime = DateTimeOffset.MinValue;
			// Setup Stub
			var stub = new StubITemperatureEntry();
			stub.Id_Get(() => _Id);
			stub.Id_Set((v) => _Id = v);
			stub.DeviceId_Get(() => _DeviceId);
			stub.DeviceId_Set((v) => _DeviceId = v);
			stub.TemperatureCelsius_Get(() => _TemperatureCelsius);
			stub.TemperatureCelsius_Set((v) => _TemperatureCelsius = v);
			stub.Humidity_Get(() => _Humidity);
			stub.Humidity_Set((v) => _Humidity = v);
			stub.Pressure_Get(() => _Pressure);
			stub.Pressure_Set((v) => _Pressure = v);
			stub.CreatedDateTime_Get(() => _CreatedDateTime);
			stub.CreatedDateTime_Set((v) => _CreatedDateTime = v);
			// create helper
			var create = new StubICreateHelper();
			create.CreateTemperatureEntry(() => stub);
			// settings
			var settings = new StubIServerSettings();
			settings.ServerUri_Get(() => null);
			// Http Client
			var httpClient = new StubIHttpClient();
			// Server
			var serverContext = new ServerContext(settings, create, httpClient);
			Guid key = Guid.NewGuid();
			// leading
			var results = await serverContext.GetTemperatureEntryAsync(key);
			Assert.AreEqual(RequestStatus.ServerUriNotSet, results.Status);
			Assert.IsNull(results.Data, "Data should not be null");
			Assert.AreEqual(Guid.Empty, results.Key);
			// login exception
			settings.ServerUri_Get(() => new Uri("http://test"));
			httpClient.PostAsync((uri, d) =>
			{
				return Task.Run(() =>
				{
					return new HttpClientResult{StatusCode = HttpStatusCode.Ok, Content = ""};
				}

				).AsAsyncOperation();
			}

			);
			httpClient.GetCookieValue((u, name) => "Value");
			await serverContext.LoginAsync("user", "pass");
			settings.ServerUri_Get(() => new Uri("/cheese", UriKind.Relative));
			// invalid uri
			results = await serverContext.GetTemperatureEntryAsync(key);
			Assert.AreEqual(RequestStatus.ServerUriIsNotValid, results.Status);
			Assert.IsNull(results.Data, "Data should not be null");
			Assert.AreEqual(Guid.Empty, results.Key);
			// Unable to connect to server
			key = Guid.NewGuid();
			settings.ServerUri_Get(() => new Uri("http://test"));
			Exception expectedException = null;
			bool methodHit = false;
			httpClient.GetAsync((uri) =>
			{
				return Task.Run(() =>
				{
					methodHit = true;
					Assert.AreEqual(new Uri($"http://test/api/TemperatureEntry/{key}"), uri);
					expectedException = new COMException("Message1", -2147012867);
					throw expectedException;
					return new HttpClientResult();
				}

				).AsAsyncOperation();
			}

			);
			results = await serverContext.GetTemperatureEntryAsync(key);
			Assert.IsTrue(methodHit, "Method not called");
			Assert.AreEqual(RequestStatus.UnableToConnectToServer, results.Status);
			Assert.IsNull(results.Data, "Data should not be null");
			Assert.AreEqual(key, results.Key);
			Assert.AreEqual(expectedException, results.Exception);
			// COMException
			methodHit = false;
			httpClient.GetAsync((uri) =>
			{
				return Task.Run(() =>
				{
					methodHit = true;
					expectedException = new COMException("Message2");
					throw expectedException;
					return new HttpClientResult();
				}

				).AsAsyncOperation();
			}

			);
			results = await serverContext.GetTemperatureEntryAsync(key);
			Assert.IsTrue(methodHit, "Method not called");
			Assert.AreEqual(RequestStatus.Exception, results.Status);
			Assert.IsNull(results.Data, "Data should be null");
			Assert.AreEqual(key, results.Key);
			Assert.AreEqual(expectedException, results.Exception);
			// Exception
			methodHit = false;
			httpClient.GetAsync((uri) =>
			{
				return Task.Run(() =>
				{
					methodHit = true;
					expectedException = new Exception("Message3");
					throw expectedException;
					return new HttpClientResult();
				}

				).AsAsyncOperation();
			}

			);
			results = await serverContext.GetTemperatureEntryAsync(key);
			Assert.IsTrue(methodHit, "Method not called");
			Assert.AreEqual(RequestStatus.Exception, results.Status);
			Assert.IsNull(results.Data, "Data should be null");
			Assert.AreEqual(key, results.Key);
			Assert.AreEqual(expectedException, results.Exception);
			// Unauthorized
			methodHit = false;
			httpClient.GetAsync((uri) =>
			{
				return Task.Run(() =>
				{
					methodHit = true;
					return new HttpClientResult()
					{StatusCode = HttpStatusCode.Unauthorized, Content = "{Test: 'cheese'"};
				}

				).AsAsyncOperation();
			}

			);
			results = await serverContext.GetTemperatureEntryAsync(key);
			Assert.IsTrue(methodHit, "Method not called");
			Assert.AreEqual(RequestStatus.Error, results.Status);
			Assert.IsNull(results.Data, "Data should be null");
			Assert.AreEqual(key, results.Key);
			Assert.IsInstanceOfType(results.Exception, typeof (JsonReaderException));
			// Success Test
			var exp = new StubITemperatureEntry();
			exp.Id_Get(() => key);
			exp.DeviceId_Get(() => 18);
			exp.TemperatureCelsius_Get(() => 0.781149737434997);
			exp.Humidity_Get(() => 0.52534901980559756);
			exp.Pressure_Get(() => 0.857609007906918);
			exp.CreatedDateTime_Get(() => new DateTimeOffset(1999, 10, 10, 3, 7, 15, TimeSpan.FromHours(-6)));
			ITemperatureEntry expected = exp;
			var jobj = new JObject();
			jobj.Add(new JProperty(nameof(expected.Id), expected.Id));
			jobj.Add(new JProperty(nameof(expected.DeviceId), expected.DeviceId));
			jobj.Add(new JProperty(nameof(expected.TemperatureCelsius), expected.TemperatureCelsius));
			jobj.Add(new JProperty(nameof(expected.Humidity), expected.Humidity));
			jobj.Add(new JProperty(nameof(expected.Pressure), expected.Pressure));
			jobj.Add(new JProperty(nameof(expected.CreatedDateTime), expected.CreatedDateTime));
			methodHit = false;
			httpClient.GetAsync((uri) =>
			{
				return Task.Run(() =>
				{
					methodHit = true;
					return new HttpClientResult{StatusCode = HttpStatusCode.Ok, Content = jobj.ToString()};
				}

				).AsAsyncOperation();
			}

			);
			results = await serverContext.GetTemperatureEntryAsync(key);
			Assert.IsTrue(methodHit, "Method not called");
			Assert.AreEqual(RequestStatus.Success, results.Status);
			Assert.AreEqual(key, results.Key);
			Assert.IsNull(results.Exception, "Exception should be null");
			Assert.IsNotNull(results.Data, "Data should not be null");
			var actual = results.Data;
			Assert.AreEqual(expected.Id, actual.Id);
			Assert.AreEqual(expected.DeviceId, actual.DeviceId);
			Assert.AreEqual(expected.TemperatureCelsius, actual.TemperatureCelsius);
			Assert.AreEqual(expected.Humidity, actual.Humidity);
			Assert.AreEqual(expected.Pressure, actual.Pressure);
			Assert.AreEqual(expected.CreatedDateTime, actual.CreatedDateTime);
		}
#endregion
	}
}


text:
create directory called build, 5.Djikstra/build

To build, type "cmake .." in build directory

to compile type "make"

to run tests type "./test/MinHeapTest" and "./test/DjikstraTest"

to run main type "./source/dijkstra"