text:
<#
    .SYNOPSIS
        Automated integration test for MSFT_xExchImapSettings DSC Resource.
        This test module requires use of credentials.
        The first run through of the tests will prompt for credentials from the logged on user.
#>

#region HEADER
[System.String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
[System.String] $script:DSCModuleName = 'xExchange'
[System.String] $script:DSCResourceFriendlyName = 'xExchImapSettings'
[System.String] $script:DSCResourceName = "MSFT_$($script:DSCResourceFriendlyName)"

Import-Module -Name (Join-Path -Path $script:moduleRoot -ChildPath (Join-Path -Path 'Tests' -ChildPath (Join-Path -Path 'TestHelpers' -ChildPath 'xExchangeTestHelper.psm1'))) -Force
Import-Module -Name (Join-Path -Path $script:moduleRoot -ChildPath (Join-Path -Path 'Modules' -ChildPath 'xExchangeHelper.psm1')) -Force
Import-Module -Name (Join-Path -Path $script:moduleRoot -ChildPath (Join-Path -Path 'DSCResources' -ChildPath (Join-Path -Path "$($script:DSCResourceName)" -ChildPath "$($script:DSCResourceName).psm1")))

# Check if Exchange is installed on this machine. If not, we can't run tests
[System.Boolean] $exchangeInstalled = Test-ExchangeSetupComplete

#endregion HEADER

if ($exchangeInstalled)
{
    # Get required credentials to use for the test
    $shellCredentials = Get-TestCredential

    # Get the Server FQDN for using in URL's
    if ($null -eq $serverFqdn)
    {
        $serverFqdn = [System.Net.Dns]::GetHostByName($env:COMPUTERNAME).HostName
    }

    Describe 'Test Setting Properties with xExchImapSettings' {
        $testParams = @{
            Server =  $env:COMPUTERNAME
            Credential = $shellCredentials
            LoginType = 'PlainTextLogin'
            ExternalConnectionSettings = @("$($serverFqdn):143:TLS")
            X509CertificateName = "$($serverFqdn)"
        }

        $expectedGetResults = @{
            LoginType = 'PlainTextLogin'
            X509CertificateName = "$($serverFqdn)"
        }

        Test-TargetResourceFunctionality -Params $testParams `
                                         -ContextLabel 'Set standard parameters' `
                                         -ExpectedGetResults $expectedGetResults

        Test-ArrayContentsEqual -TestParams $testParams `
                                -DesiredArrayContents $testParams.ExternalConnectionSettings `
                                -GetResultParameterName 'ExternalConnectionSettings' `
                                -ContextLabel 'Verify ExternalConnectionSettings' `
                                -ItLabel 'ExternalConnectionSettings should contain a value'

        $testParams.LoginType = 'SecureLogin'
        $testParams.ExternalConnectionSettings = @()
        $testParams.X509CertificateName = ''
        $expectedGetResults.LoginType = 'SecureLogin'
        $expectedGetResults.X509CertificateName = ''

        Test-TargetResourceFunctionality -Params $testParams `
                                         -ContextLabel 'Change some parameters' `
                                         -ExpectedGetResults $expectedGetResults

        Test-ArrayContentsEqual -TestParams $testParams `
                                -DesiredArrayContents $testParams.ExternalConnectionSettings `
                                -GetResultParameterName 'ExternalConnectionSettings' `
                                -ContextLabel 'Verify ExternalConnectionSettings' `
                                -ItLabel 'ExternalConnectionSettings should be empty'
    }
}
else
{
    Write-Verbose -Message 'Tests in this file require that Exchange is installed to be run.'
}


text:
"use strict";
var core_1 = require('@angular/core');
var HomeComponent = (function () {
    function HomeComponent() {
        // Do stuff
    }
    HomeComponent.prototype.ngOnInit = function () {
        console.log('Hello Home');
    };
    HomeComponent = __decorate([
        core_1.Component({
            selector: 'my-home',
            templateUrl: './home.component.html',
            styleUrls: ['./home.component.scss']
        }),
        __metadata('design:paramtypes', [])
    ], HomeComponent);
    return HomeComponent;
}());
exports.HomeComponent = HomeComponent;
//# sourceMappingURL=home.component.js.map

redpajama_set_name: RedPajamaGithub


text:
package proguard.ant;

import org.apache.tools.ant.*;
import proguard.*;

import java.io.IOException;
import java.util.*;

/**
 * This Task allows to define a ProGuard configuration from Ant.
 *
 * @author Eric Lafortune
 */
public class ConfigurationTask extends Task
{
    protected final Configuration configuration = new Configuration();

    /**
     * Adds the contents of this configuration task to the given configuration.
     * @param configuration the configuration to be extended.
     */
    public void appendTo(Configuration configuration)
    {
        // Append all of these configuration entries to the given configuration.
        configuration.programJars               = extendClassPath(configuration.programJars,
                                                                  this.configuration.programJars);

        configuration.libraryJars               = extendClassPath(configuration.libraryJars,
                                                                  this.configuration.libraryJars);

        configuration.keep                      = extendClassSpecifications(configuration.keep,
                                                                            this.configuration.keep);

        configuration.keepDirectories           = extendList(configuration.keepDirectories,
                                                             this.configuration.keepDirectories);

        configuration.whyAreYouKeeping          = extendClassSpecifications(configuration.whyAreYouKeeping,
                                                                            this.configuration.whyAreYouKeeping);

        configuration.optimizations             = extendClassSpecifications(configuration.optimizations,
                                                                            this.configuration.optimizations);

        configuration.assumeNoSideEffects       = extendClassSpecifications(configuration.assumeNoSideEffects,
                                                                            this.configuration.assumeNoSideEffects);

        configuration.keepPackageNames          = extendList(configuration.keepPackageNames,
                                                             this.configuration.keepPackageNames);

        configuration.keepAttributes            = extendList(configuration.keepAttributes,
                                                             this.configuration.keepAttributes);

        configuration.adaptClassStrings         = extendList(configuration.adaptClassStrings,
                                                             this.configuration.adaptClassStrings);

        configuration.adaptResourceFileNames    = extendList(configuration.adaptResourceFileNames,
                                                             this.configuration.adaptResourceFileNames);

        configuration.adaptResourceFileContents = extendList(configuration.adaptResourceFileContents,
                                                             this.configuration.adaptResourceFileContents);

        configuration.note                      = extendList(configuration.note,
                                                             this.configuration.note);

        configuration.warn                      = extendList(configuration.warn,
                                                             this.configuration.warn);
    }

    // Ant task nested elements.

    public void addConfiguredInjar(ClassPathElement classPathElement)
    {
        configuration.programJars = extendClassPath(configuration.programJars,
                                                    classPathElement,
                                                    false);
    }

    public void addConfiguredOutjar(ClassPathElement classPathElement)
    {
        configuration.programJars = extendClassPath(configuration.programJars,
                                                    classPathElement,
                                                    true);
    }

    public void addConfiguredLibraryjar(ClassPathElement classPathElement)
    {
        configuration.libraryJars = extendClassPath(configuration.libraryJars,
                                                    classPathElement,
                                                    false);
    }

    public void addConfiguredKeepdirectory(FilterElement filterElement)
    {
        configuration.keepDirectories = extendFilter(configuration.keepDirectories,
                                                     filterElement);
    }

    public void addConfiguredKeepdirectories(FilterElement filterElement)
    {
        configuration.keepDirectories = extendFilter(configuration.keepDirectories,
                                                     filterElement);
    }

    public void addConfiguredKeep(KeepSpecificationElement keepSpecificationElement)
    {
        configuration.keep = extendKeepSpecifications(configuration.keep,
                                                      keepSpecificationElement,
                                                      true,
                                                      false);
    }

    public void addConfiguredKeepclassmembers(KeepSpecificationElement keepSpecificationElement)
    {
        configuration.keep = extendKeepSpecifications(configuration.keep,
                                                      keepSpecificationElement,
                                                      false,
                                                      false);
    }

    public void addConfiguredKeepclasseswithmembers(KeepSpecificationElement keepSpecificationElement)
    {
        configuration.keep = extendKeepSpecifications(configuration.keep,
                                                      keepSpecificationElement,
                                                      true,
                                                      true);
    }

    public void addConfiguredKeepnames(KeepSpecificationElement keepSpecificationElement)
    {
        // Set the shrinking flag, based on the name (backward compatibility).
        keepSpecificationElement.setAllowshrinking(true);

        configuration.keep = extendKeepSpecifications(configuration.keep,
                                                      keepSpecificationElement,
                                                      true,
                                                      false);
    }

    public void addConfiguredKeepclassmembernames(KeepSpecificationElement keepSpecificationElement)
    {
        // Set the shrinking flag, based on the name (backward compatibility).
        keepSpecificationElement.setAllowshrinking(true);

        configuration.keep = extendKeepSpecifications(configuration.keep,
                                                      keepSpecificationElement,
                                                      false,
                                                      false);
    }

    public void addConfiguredKeepclasseswithmembernames(KeepSpecificationElement keepSpecificationElement)
    {
        // Set the shrinking flag, based on the name (backward compatibility).
        keepSpecificationElement.setAllowshrinking(true);

        configuration.keep = extendKeepSpecifications(configuration.keep,
                                                      keepSpecificationElement,
                                                      true,
                                                      true);
    }

    public void addConfiguredWhyareyoukeeping(ClassSpecificationElement classSpecificationElement)
    {
        configuration.whyAreYouKeeping = extendClassSpecifications(configuration.whyAreYouKeeping,
                                                                   classSpecificationElement);
    }

    public void addConfiguredAssumenosideeffects(ClassSpecificationElement classSpecificationElement)
    {
        configuration.assumeNoSideEffects = extendClassSpecifications(configuration.assumeNoSideEffects,
                                                                      classSpecificationElement);
    }

    public void addConfiguredOptimizations(FilterElement filterElement)
    {
        addConfiguredOptimization(filterElement);
    }

    public void addConfiguredOptimization(FilterElement filterElement)
    {
        configuration.optimizations = extendFilter(configuration.optimizations,
                                                   filterElement);
    }

    public void addConfiguredKeeppackagename(FilterElement filterElement)
    {
        configuration.keepPackageNames = extendFilter(configuration.keepPackageNames,
                                                      filterElement,
                                                      true);
    }

    public void addConfiguredKeeppackagenames(FilterElement filterElement)
    {
        configuration.keepPackageNames = extendFilter(configuration.keepPackageNames,
                                                      filterElement,
                                                      true);
    }

    public void addConfiguredKeepattributes(FilterElement filterElement)
    {
        addConfiguredKeepattribute(filterElement);
    }

    public void addConfiguredKeepattribute(FilterElement filterElement)
    {
        configuration.keepAttributes = extendFilter(configuration.keepAttributes,
                                                    filterElement);
    }

    public void addConfiguredAdaptclassstrings(FilterElement filterElement)
    {
        configuration.adaptClassStrings = extendFilter(configuration.adaptClassStrings,
                                                       filterElement, true);
    }

    public void addConfiguredAdaptresourcefilenames(FilterElement filterElement)
    {
        configuration.adaptResourceFileNames = extendFilter(configuration.adaptResourceFileNames,
                                                            filterElement);
    }

    public void addConfiguredAdaptresourcefilecontents(FilterElement filterElement)
    {
        configuration.adaptResourceFileContents = extendFilter(configuration.adaptResourceFileContents,
                                                               filterElement);
    }

    public void addConfiguredDontnote(FilterElement filterElement)
    {
        configuration.note = extendFilter(configuration.note, filterElement, true);
    }

    public void addConfiguredDontwarn(FilterElement filterElement)
    {
        configuration.warn = extendFilter(configuration.warn, filterElement, true);
    }

    public void addConfiguredConfiguration(ConfigurationElement configurationElement)
    {
        configurationElement.appendTo(configuration);
    }

    // Implementations for Task.

    public void addText(String text) throws BuildException
    {
        try
        {
            String arg = getProject().replaceProperties(text);

            ConfigurationParser parser = new ConfigurationParser(new String[] { arg },
                                                                 getProject().getBaseDir());

            try
            {
                parser.parse(configuration);
            }
            catch (ParseException ex)
            {
                throw new BuildException(ex.getMessage());
            }
            finally
            {
                parser.close();
            }
        }
        catch (IOException ex)
        {
            throw new BuildException(ex.getMessage());
        }
    }

    // Small utility methods.

    private ClassPath extendClassPath(ClassPath        classPath,
                                      ClassPathElement classPathElement,
                                      boolean          output)
    {
        if (classPath == null)
        {
            classPath = new ClassPath();
        }

        classPathElement.appendClassPathEntriesTo(classPath,
                                                  output);

        return classPath;
    }

    private ClassPath extendClassPath(ClassPath classPath,
                                      ClassPath additionalClassPath)
    {
        if (additionalClassPath != null)
        {
            if (classPath == null)
            {
                classPath = new ClassPath();
            }

            classPath.addAll(additionalClassPath);
        }

        return classPath;
    }

    private List extendKeepSpecifications(List                     keepSpecifications,
                                          KeepSpecificationElement keepSpecificationElement,
                                          boolean                  markClasses,
                                          boolean                  markClassesConditionally)
    {
        if (keepSpecifications == null)
        {
            keepSpecifications = new ArrayList();
        }

        keepSpecificationElement.appendTo(keepSpecifications,
                                          markClasses,
                                          markClassesConditionally);

        return keepSpecifications;
    }

    private List extendClassSpecifications(List                      classSpecifications,
                                           ClassSpecificationElement classSpecificationElement)
    {
        if (classSpecifications == null)
        {
            classSpecifications = new ArrayList();
        }

        classSpecificationElement.appendTo(classSpecifications);

        return classSpecifications;
    }

    private List extendClassSpecifications(List classSpecifications,
                                           List additionalClassSpecifications)
    {
        if (additionalClassSpecifications != null)
        {
            if (classSpecifications == null)
            {
                classSpecifications = new ArrayList();
            }

            classSpecifications.addAll(additionalClassSpecifications);
        }

        return classSpecifications;
    }

    private List extendFilter(List          filter,
                              FilterElement filterElement)
    {
        return extendFilter(filter, filterElement, false);
    }

    private List extendFilter(List          filter,
                              FilterElement filterElement,
                              boolean       internal)
    {
        if (filter == null)
        {
            filter = new ArrayList();
        }

        filterElement.appendTo(filter, internal);

        return filter;
    }

    private List extendList(List list,
                            List additionalList)
    {
        if (additionalList != null)
        {
            if (list == null)
            {
                list = new ArrayList();
            }

            list.addAll(additionalList);
        }

        return list;
    }
}


text:
class:
background-image: url(img/s0.jpg)

---
name: about
class: left
background-image: url(img/about.jpg)

.right-column[

Open Minded

|> Science

|> Craftsman

.footnote[
 [cmg-dev](https://github.com/cmg-dev)

 [@codethonian](https://twitter.com/codethonian)
]
]

???
Coder in natural Environment

---
name: motivation
class: left
background-image: url(img/motivation.jpg)

.regular[
# Motivation
]

.footnote[
**Read the** [Paper](http://www-01.ibm.com/common/ssi/cgi-bin/ssialias?infotype=PM&subtype=XB&htmlfid=GBE03620USEN)
]
???

---
name: motivation
class: left
background-image: url(img/motivation_elixir.jpg)

.regular[
# Elixir
]

---
name: iot
class: center, middle
background-image: url(img/iot.jpg)

.heading[
# Meet the IoT
]

---
name: iot
class: left
background-image: url(img/iot_development.jpg)

.regular[
## Forecast
]
.right-column[

Device democracy will emerge,

... after rebooting the IoT
]

.footnote[
[[1](http://www-01.ibm.com/common/ssi/cgi-bin/ssialias?infotype=PM&subtype=XB&htmlfid=GBE03620USEN)]
]

???
Why the IoT already needs a reboot:

* First wave of the IoT; focused on very high-value applications

    jet engines, automated smart meters and remote healthcare management

* Demand has been slow
* Only **30 percent** of heavy industrial equipment is networked
* Only **10 percent** of smart TVs are used for Internet viewing

* consumers have failed to embrace devices from smart toothbrushes to refrigerators.

* Enterprises and entrepreneurs treating the IoT as if it were **just another** computing platform
* Applying the same set of business models, services, ecosystems, applications and analytic.

---
name: iot
class: left
background-image: url(img/iot_comparison.jpg)

.regular[
## Worlds Collide
]

.footnote[
[[2](http://www-01.ibm.com/common/ssi/cgi-bin/ssialias?infotype=PM&subtype=XB&htmlfid=GBE03620USEN)]
]

???
* The application of old world approaches to this field

* Apply "as a Service" does not increase product quality

* IOT isn't new

---
name: iot
class: left
background-image: url(img/iot_problems.jpg)

.regular[
]

???
1. High costs
2. Broken Buisiness Models
3. Trust
4. Not Future Proof
5. Function

Why the IoT already needs a reboot:

* First wave of the IoT; focused on very high-value applications

    jet engines, automated smart meters and remote healthcare management

* Demand has been slow
* Only **30 percent** of heavy industrial equipment is networked
* Only **10 percent** of smart TVs are used for Internet viewing

* consumers have failed to embrace devices from smart toothbrushes to refrigerators.

* Enterprises and entrepreneurs treating the IoT as if it were **just another** computing platform
* Applying the same set of business models, services, ecosystems, applications and analytic.

---
name: iot
class: left
background-image: url(img/mr_tomatan.jpg)

.regular[
## Use Cases

![bullshit1](img/bullshit1.jpg)
]

.footnote[
 [@Internet of Shit](https://twitter.com/internetofshit)
]
---
name: iot
class: left
background-image: url(img/iot_design_rules.jpg)

.regular[
## Design Rules
]

.footnote[
[[3](http://www-01.ibm.com/common/ssi/cgi-bin/ssialias?infotype=PM&subtype=XB&htmlfid=GBE03620USEN)]
]

---
name: iot
class: left
background-image: url(img/iot.jpg)

.right-column[

**IBM's conclusion**

``` plain
"This first report of our study shows that a low-cost,
private-by-design "democracy of devices" will emerge
that will enable new digital economies and create new
value, while offering consumers and enterprises
fundamentally better products and user experiences."
```

Well, and how?
]

.footnote[
[[4](http://www-01.ibm.com/common/ssi/cgi-bin/ssialias?infotype=PM&subtype=XB&htmlfid=GBE03620USEN)]
]

???
* End of chapter 1

---
name: nerves
class: left
background-image: url(img/electronics_1_rpi_vs_ardiuno_0.jpg)

---
name: nerves
class: left
background-image: url(img/electronics_1_rpi_vs_ardiuno_1.jpg)

---
name: nerves
class: left
background-image: url(img/electronics_1_rpi_vs_ardiuno_2.jpg)

---
name: nerves
class: left
background-image: url(img/embedded_linux_is_pain.jpg)

---
class: left
background-image: url(img/electronics_0_nerves-vs-raspbian.jpg)

.right-column[
]

---
class: left
background-image: url(img/electronics_1_partitioning.jpg)

.right-column[
]

---
name: elixir
class: left
background-image: url(img/motivation_elixir.jpg)

.regular[
## Quo vadis, Elixir?

```elixir
  Functional
  |> Concurrent
  |> Pragmatic
  |> Fun
```
]

---
name: elixir
class: left
background-image: url(img/elixir.jpg)

.regular[
## Elixir <3 Embedded

*  Fault Tolerant

*  Concurrent

*  Fast Garbage Collection

*  Constraint Hardware

*  Binary Protocols
]
---
name: nerves
class: left
background-image: url(img/nerves_intro0.jpg)

---
name: nerves
class: left
background-image: url(img/nerves_intro.jpg)

.footnote[
 [Homepage](http://nerves-project.org/)

 [@NervesProject](http://twitter.com/NervesProject)

 [Contribute!](https://github.com/nerves-project)
]

???
platform

Using a lean, custom cross-compiled linux, nerves boots directly to the battle hardened BEAM VM, starting your application in seconds.

framework

Most devices need to get on a network, get discovered, update firmware, and deal with I/O of various kinds. You're not on your own.

tooling

Cross-compliation can be a total drag. Our tools make it smooth as silk. Go from "mix new" to running code on your device in minutes.

---
name: nerves
class: left
background-image: url(img/nerves_features.jpg)

.regular[

]

---
name: nerves
class: left
background-image: url(img/nerves_targets.jpg)

.regular[

]

---
class: left
background-image: url(img/nerves_build.jpg)

.right-column[
]

---
name: inverse
class: left
background-image: url(img/bakeware_1.jpg)

.right-column[
# Bakeware

**a tool and service to build your cross compiled firmware**

Configure, compile and share systems,
toolchains and firmware

Find it [here](http://www.bakeware.io/)
]

---

name: inverse
class: left, middle
background-image: url(img/extinct.jpg)

.example_page_left[
# Bakeware's gone

**Good News!**

**Everythong is now integrated into ```mix```...**

]

---
name: inverse
class: left
background-image: url(img/extinct.jpg)

.example_page[
# Using mix

**Start a project**

```elixir
$ mix nerves.new my_project --target rpi3
```

**Does the boilerplate**

```elixir
creating my_project/config/config.exs
creating my_project/lib/my_app.ex
creating my_project/test/test_helper.exs
creating my_project/test/my_app_test.exs
creating my_project/rel/vm.args
creating my_project/rel/.gitignore
creating my_project/.gitignore
creating my_project/mix.exs
creating my_project/README.md
```
]

---
name: inverse
class: left
background-image: url(img/extinct.jpg)

.example_page[
**Compile**

```elixir
$ mix compile
Nerves Precompile Start
...
Compile Nerves toolchain
Downloading from Github Cache
Unpacking toolchain to build dir
...
Generated nerves_system_rpi3 app
[nerves_system][compile]
[nerves_system][http] Downloading system from cache
[nerves_system][http] System Downloaded
[nerves_system][http] Unpacking System
...
Nerves Env loaded
Nerves Precompile En
```
]

---
name: inverse
class: left
background-image: url(img/extinct.jpg)

.example_page[
**Create Firmware**

```elixir
$ mix firmware
Nerves Env loaded
Nerves Firmware Assembler
...
Building _images/rpi3/my_project.fw...

$ mix firmware.burn
Burn rpi3-0.0.1 to SD card at /dev/rdisk3, Proceed? [Y/n]
```
]

---
name: demo
class: left
background-image: url(img/solo_0.jpg)

.left-column[
# Livecoding Fun

**Demo time...**
]

???

* More Doing less talking

* Lots of demos on the internet

1. nerves-io-led

---
name: inverse
class: left
background-image: url(img/elixir_nerves_phonix.jpg)

.example_page[
]

---
name: video
class: left
background-image: url(img/tv1.jpg)

.regular[
 [Embedded Elixir in Action](https://www.youtube.com/watch?v=kpzQrFC55q4)

 [Getting Started with Nerves](https://www.youtube.com/watch?v=kWXrct6nnGg)

 [SumoBots!](https://www.youtube.com/watch?v=tCg1LakJF3g&index=6&list=PLA9E5Lsig6GTBPb2BRf_2ONIcnRTU5Iy0)

 [Elixir with Nerves](https://www.youtube.com/watch?v=kJYHzxIh_Yc)
]


text:
using System;
using System.Diagnostics;
using System.Threading;

namespace BTDB.KVDBLayer.Implementation;

public struct BytesPerSecondLimiter
{
    readonly ulong _bytesPerSecond;
    readonly Stopwatch _stopwatch;
    ulong _newCorrectionAfter;
    readonly ulong _delta;

    // 0 means no limit
    public BytesPerSecondLimiter(ulong bytesPerSecond)
    {
        _stopwatch = Stopwatch.StartNew();
        _bytesPerSecond = bytesPerSecond;
        _newCorrectionAfter = ulong.MaxValue;
        _delta = 0;
        if (bytesPerSecond > 0)
        {
            _delta = bytesPerSecond >> 4; // correction should be done approximately 16 times per second
            if (_delta == 0) _delta = 1;
            _newCorrectionAfter = _delta;
        }
    }

    public void Limit(ulong bytesTillNow)
    {
        if (bytesTillNow < _newCorrectionAfter)
            return;
        var msTillNow = _stopwatch.ElapsedMilliseconds;
        var shouldTakeMs = (long)(bytesTillNow * 1000.0 / _bytesPerSecond);
        if (shouldTakeMs > msTillNow)
        {
            // wait max 2 minutes to not slow it down too much (Limit function was not called often enough)
            Thread.Sleep((int)Math.Min(shouldTakeMs - msTillNow, 120000));
        }

        _newCorrectionAfter = bytesTillNow + _delta;
    }

    public ulong TotalTimeInMs => (ulong)_stopwatch.ElapsedMilliseconds;
}


text:
<?php

/**
 * @see Zend_Loader
 */
require_once 'Zend/Loader.php';

/**
 * @see Zend_Gdata
 */
Zend_Loader::loadClass('Zend_Gdata');

/**
 * @see Zend_Gdata_ClientLogin
 */
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');

/**
 * @see Zend_Gdata_Spreadsheets
 */
Zend_Loader::loadClass('Zend_Gdata_Spreadsheets');

/**
 * @see Zend_Gdata_App_AuthException
 */
Zend_Loader::loadClass('Zend_Gdata_App_AuthException');

/**
 * @see Zend_Http_Client
 */
Zend_Loader::loadClass('Zend_Http_Client');

/**
 * SimpleCRUD
 *
 * @category   Zend
 * @package    Zend_Gdata
 * @subpackage Demos
 * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class SimpleCRUD
{
    /**
     * Constructor
     *
     * @param  string $email
     * @param  string $password
     * @return void
     */
    public function __construct($email, $password)
    {
        try {
          $client = Zend_Gdata_ClientLogin::getHttpClient($email, $password,
                    Zend_Gdata_Spreadsheets::AUTH_SERVICE_NAME);
        } catch (Zend_Gdata_App_AuthException $ae) {
          exit("Error: ". $ae->getMessage() ."\nCredentials provided were email: [$email] and password [$password].\n");
        }

        $this->gdClient = new Zend_Gdata_Spreadsheets($client);
        $this->currKey = '';
        $this->currWkshtId = '';
        $this->listFeed = '';
        $this->rowCount = 0;
        $this->columnCount = 0;
    }

    /**
     * promptForSpreadsheet
     *
     * @return void
     */
    public function promptForSpreadsheet()
    {
        $feed = $this->gdClient->getSpreadsheetFeed();
        print "== Available Spreadsheets ==\n";
        $this->printFeed($feed);
        $input = getInput("\nSelection");
        $currKey = explode('/', $feed->entries[$input]->id->text);
        $this->currKey = $currKey[5];
    }

    /**
     * promptForWorksheet
     *
     * @return void
     */
    public function promptForWorksheet()
    {
        $query = new Zend_Gdata_Spreadsheets_DocumentQuery();
        $query->setSpreadsheetKey($this->currKey);
        $feed = $this->gdClient->getWorksheetFeed($query);
        print "== Available Worksheets ==\n";
        $this->printFeed($feed);
        $input = getInput("\nSelection");
        $currWkshtId = explode('/', $feed->entries[$input]->id->text);
        $this->currWkshtId = $currWkshtId[8];

    }

    /**
     * promptForCellsAction
     *
     * @return void
     */
    public function promptForCellsAction()
    {
        echo "Pick a command:\n";
        echo "\ndump -- dump cell information\nupdate {row} {col} {input_value} -- update cell information\n";
        $input = getInput('Command');
        $command = explode(' ', $input);
        if ($command[0] == 'dump') {
            $this->cellsGetAction();
        } else if (($command[0] == 'update') && (count($command) > 2)) {
              $this->getRowAndColumnCount();
                if (count($command) == 4) {
                    $this->cellsUpdateAction($command[1], $command[2], $command[3]);
                } elseif (count($command) > 4) {
                    $newValue = implode(' ', array_slice($command,3));
                    $this->cellsUpdateAction($command[1], $command[2], $newValue);
                } else {
                $this->cellsUpdateAction($command[1], $command[2], '');
                }
        } else {
            $this->invalidCommandError($input);
        }
    }

    /**
     * promptToResize
     *
     * @param  integer $newRowCount
     * @param  integer $newColumnCount
     * @return boolean
     */
    public function promptToResize($newRowCount, $newColumnCount) {
        $input = getInput('Would you like to resize the worksheet? [yes | no]');
        if ($input == 'yes') {
            return $this->resizeWorksheet($newRowCount, $newColumnCount);
        } else {
            return false;
        }
    }

    /**
     * resizeWorksheet
     *
     * @param  integer $newRowCount
     * @param  integer $newColumnCount
     * @return boolean
     */
    public function resizeWorksheet($newRowCount, $newColumnCount) {
        $query = new Zend_Gdata_Spreadsheets_DocumentQuery();
        $query->setSpreadsheetKey($this->currKey);
        $query->setWorksheetId($this->currWkshtId);
        $currentWorksheet = $this->gdClient->getWorksheetEntry($query);
        $currentWorksheet = $currentWorksheet->setRowCount(new Zend_Gdata_Spreadsheets_Extension_RowCount($newRowCount));
        $currentWorksheet = $currentWorksheet->setColumnCount(new Zend_Gdata_Spreadsheets_Extension_ColCount($newColumnCount));
        $currentWorksheet->save();
        $this->getRowAndColumnCount();
        print "Worksheet has been resized to $this->rowCount rows and $this->columnCount columns.\n";
        return true;
    }

    /**
     * promptForListAction
     *
     * @return void
     */
    public function promptForListAction()
    {
        echo  "\n== Options ==\n".
              "dump -- dump row information\n".
              "insert {row_data} -- insert data in the next available cell in a given column (example: insert column_header=content)\n".
              "update {row_index} {row_data} -- update data in the row provided (example: update row-number column-header=newdata\n".
              "delete {row_index} -- delete a row\n\n";

        $input = getInput('Command');
        $command = explode(' ', $input);
        if ($command[0] == 'dump') {
            $this->listGetAction();
        } else if ($command[0] == 'insert') {
            $this->listInsertAction(array_slice($command, 1));
        } else if ($command[0] == 'update') {
            $this->listUpdateAction($command[1], array_slice($command, 2));
        } else if ($command[0] == 'delete') {
            $this->listDeleteAction($command[1]);
        } else {
            $this->invalidCommandError($input);
        }
    }

    /**
     * cellsGetAction
     *
     * @return void
     */
    public function cellsGetAction()
    {
        $query = new Zend_Gdata_Spreadsheets_CellQuery();
        $query->setSpreadsheetKey($this->currKey);
        $query->setWorksheetId($this->currWkshtId);
        $feed = $this->gdClient->getCellFeed($query);
        $this->printFeed($feed);
    }

    /**
     * cellsUpdateAction
     *
     * @param  integer $row
     * @param  integer $col
     * @param  string  $inputValue
     * @return void
     */
    public function cellsUpdateAction($row, $col, $inputValue)
    {
        if (($row > $this->rowCount) || ($col > $this->columnCount)) {
            print "Current worksheet only has $this->rowCount rows and $this->columnCount columns.\n";
            if (!$this->promptToResize($row, $col)) {
                return;
            }
        }
        $entry = $this->gdClient->updateCell($row, $col, $inputValue,
                $this->currKey, $this->currWkshtId);
        if ($entry instanceof Zend_Gdata_Spreadsheets_CellEntry) {
            echo "Success!\n";
        }
    }

    /**
     * listGetAction
     *
     * @return void
     */
    public function listGetAction()
    {
        $query = new Zend_Gdata_Spreadsheets_ListQuery();
        $query->setSpreadsheetKey($this->currKey);
        $query->setWorksheetId($this->currWkshtId);
        $this->listFeed = $this->gdClient->getListFeed($query);
        print "entry id | row-content in column A | column-header: cell-content\n".
              "Please note: The 'dump' command on the list feed only dumps data until the first blank row is encountered.\n\n";

        $this->printFeed($this->listFeed);
        print "\n";
    }

    /**
     * listInsertAction
     *
     * @param  mixed $rowData
     * @return void
     */
    public function listInsertAction($rowData)
    {
        $rowArray = $this->stringToArray($rowData);
        $entry = $this->gdClient->insertRow($rowArray, $this->currKey, $this->currWkshtId);
        if ($entry instanceof Zend_Gdata_Spreadsheets_ListEntry) {
           foreach ($rowArray as $column_header => $value) {
                echo "Success! Inserted '$value' in column '$column_header' at row ". substr($entry->getTitle()->getText(), 5) ."\n";
            }
        }
    }

    /**
     * listUpdateAction
     *
     * @param  integer $index
     * @param  mixed   $rowData
     * @return void
     */
    public function listUpdateAction($index, $rowData)
    {
        $query = new Zend_Gdata_Spreadsheets_ListQuery();
        $query->setSpreadsheetKey($this->currKey);
        $query->setWorksheetId($this->currWkshtId);
        $this->listFeed = $this->gdClient->getListFeed($query);
        $rowArray = $this->stringToArray($rowData);
        $entry = $this->gdClient->updateRow($this->listFeed->entries[$index], $rowArray);
        if ($entry instanceof Zend_Gdata_Spreadsheets_ListEntry) {
            echo "Success!\n";        $response = $entry->save();

        }
    }

    /**
     * listDeleteAction
     *
     * @param  integer $index
     * @return void
     */
    public function listDeleteAction($index)
    {
        $query = new Zend_Gdata_Spreadsheets_ListQuery();
        $query->setSpreadsheetKey($this->currKey);
        $query->setWorksheetId($this->currWkshtId);
        $this->listFeed = $this->gdClient->getListFeed($query);
        $this->gdClient->deleteRow($this->listFeed->entries[$index]);
    }

    /**
     * stringToArray
     *
     * @param  string $rowData
     * @return array
     */
    public function stringToArray($rowData)
    {
        $arr = array();
        foreach ($rowData as $row) {
            $temp = explode('=', $row);
            $arr[$temp[0]] = $temp[1];
        }
        return $arr;
    }

    /**
     * printFeed
     *
     * @param  Zend_Gdata_Gbase_Feed $feed
     * @return void
     */
    public function printFeed($feed)
    {
        $i = 0;
        foreach($feed->entries as $entry) {
            if ($entry instanceof Zend_Gdata_Spreadsheets_CellEntry) {
                print $entry->title->text .' '. $entry->content->text . "\n";
            } else if ($entry instanceof Zend_Gdata_Spreadsheets_ListEntry) {
                print $i .' '. $entry->title->text .' | '. $entry->content->text . "\n";
            } else {
                print $i .' '. $entry->title->text . "\n";
            }
            $i++;
        }
    }

    /**
     * getRowAndColumnCount
     *
     * @return void
     */
    public function getRowAndColumnCount()
    {
        $query = new Zend_Gdata_Spreadsheets_CellQuery();
        $query->setSpreadsheetKey($this->currKey);
        $query->setWorksheetId($this->currWkshtId);
        $feed = $this->gdClient->getCellFeed($query);

        if ($feed instanceOf Zend_Gdata_Spreadsheets_CellFeed) {
            $this->rowCount = $feed->getRowCount();
            $this->columnCount = $feed->getColumnCount();
        }
    }

    /**
     * invalidCommandError
     *
     * @param  string $input
     * @return void
     */
    public function invalidCommandError($input)
    {
        echo 'Invalid input: '.$input."\n";
    }

    /**
     * promtForFeedtype
     *
     * @return void
     */
    public function promptForFeedtype() {

      $input = getInput('Select to use either the cell or the list feed [cells or list]');

      if ($input == 'cells') {
        while(1) {
          $this->promptForCellsAction();
          }
      } else if ($input == 'list') {
        while(1) {
          $this->promptForListAction();
          }
      } else {
            print "Invalid input. Please try again.\n";
            $this->promptForFeedtype();
      }
    }

    /**
     * run
     *
     * @return void
     */
    public function run()
    {
        $this->promptForSpreadsheet();
        $this->promptForWorksheet();
        $this->promptForFeedtype();
    }
}

/**
 * getInput
 *
 * @param  string $text
 * @return string
 */
function getInput($text)
{
    echo $text.': ';
    return trim(fgets(STDIN));
}

$email = null;
$pass = null;

// process command line options
foreach ($argv as $argument) {
    $argParts = explode('=', $argument);
    if ($argParts[0] == '--email') {
        $email = $argParts[1];
    } else if ($argParts[0] == '--pass') {
        $pass = $argParts[1];
    }
}

if (($email == null) || ($pass == null)) {
    $email = getInput("Please enter your email address [example: username@gmail.com]");
    $pass = getInput("Please enter your password [example: mypassword]");
}

$sample = new SimpleCRUD($email, $pass);
$sample->run();


text:
#include "header/test.h"

/*
 * O.K.
 * This function only call generate_hdr(), so no code must be tested here.
 * But defining a test allow to mark it as covered, so...
 */

Test(header, test_generate_std_hdr0)
{
	struct header_content hc = { "subsystem", "NOTICE", "function", "main.c", { 0 }, { 0 } };

	generate_std_hdr(NULL, 0, &hc);

	cr_assert(1);
}


text:
<?php

declare(strict_types=1);

namespace Sylius\Component\Core\Model;

use Sylius\Component\Promotion\Model\CatalogPromotionScopeInterface as BaseCatalogPromotionScopeInterface;

interface CatalogPromotionScopeInterface extends BaseCatalogPromotionScopeInterface
{
}


text:
package exp_test

import (
	"testing"

	"github.com/doug-martin/goqu/v9/exp"
	"github.com/stretchr/testify/suite"
)

type windowExpressionTest struct {
	suite.Suite
}

func TestWindowExpressionSuite(t *testing.T) {
	suite.Run(t, new(windowExpressionTest))
}

func (wet *windowExpressionTest) TestClone() {
	w := exp.NewWindowExpression(exp.NewIdentifierExpression("", "", "w"), nil, nil, nil)
	w2 := w.Clone()

	wet.Equal(w, w2)
}

func (wet *windowExpressionTest) TestExpression() {
	w := exp.NewWindowExpression(exp.NewIdentifierExpression("", "", "w"), nil, nil, nil)
	w2 := w.Expression()

	wet.Equal(w, w2)
}

func (wet *windowExpressionTest) TestName() {
	name := exp.NewIdentifierExpression("", "", "w")
	w := exp.NewWindowExpression(exp.NewIdentifierExpression("", "", "w"), nil, nil, nil)

	wet.Equal(name, w.Name())
}

func (wet *windowExpressionTest) TestPartitionCols() {
	cols := exp.NewColumnListExpression("a", "b")
	w := exp.NewWindowExpression(exp.NewIdentifierExpression("", "", "w"), nil, cols, nil)

	wet.Equal(cols, w.PartitionCols())
	wet.Equal(cols, w.Clone().(exp.WindowExpression).PartitionCols())
}

func (wet *windowExpressionTest) TestOrderCols() {
	cols := exp.NewColumnListExpression("a", "b")
	w := exp.NewWindowExpression(exp.NewIdentifierExpression("", "", "w"), nil, nil, cols)

	wet.Equal(cols, w.OrderCols())
	wet.Equal(cols, w.Clone().(exp.WindowExpression).OrderCols())
}

func (wet *windowExpressionTest) TestPartitionBy() {
	cols := exp.NewColumnListExpression("a", "b")
	w := exp.NewWindowExpression(exp.NewIdentifierExpression("", "", "w"), nil, nil, nil).PartitionBy("a", "b")

	wet.Equal(cols, w.PartitionCols())
}

func (wet *windowExpressionTest) TestOrderBy() {
	cols := exp.NewColumnListExpression("a", "b")
	w := exp.NewWindowExpression(exp.NewIdentifierExpression("", "", "w"), nil, nil, nil).OrderBy("a", "b")

	wet.Equal(cols, w.OrderCols())
}

func (wet *windowExpressionTest) TestParent() {
	parent := exp.NewIdentifierExpression("", "", "w1")
	w := exp.NewWindowExpression(exp.NewIdentifierExpression("", "", "w"), parent, nil, nil)

	wet.Equal(parent, w.Parent())
}

func (wet *windowExpressionTest) TestInherit() {
	parent := exp.NewIdentifierExpression("", "", "w1")
	w := exp.NewWindowExpression(exp.NewIdentifierExpression("", "", "w"), parent, nil, nil)

	wet.Equal(parent, w.Parent())

	w = w.Inherit("w2")
	wet.Equal(exp.NewIdentifierExpression("", "", "w2"), w.Parent())
}


text:
'use strict';

var assert = require('assert');
var lib = require('../../../../extensions/tools/library/game');

function reset() {
    require('../../../../lib/mocks/gameStateStart')();
}

describe("Library extensions: game", function() {
    beforeEach(reset);

    describe('isFirstTurn', function() {
        beforeEach(function() {
            lib.test.firstTurnCache = undefined;
        });

        it("Should return true if turn equals to zero", function() {
            assert.strictEqual(lib.isFirstTurn(), true);
            assert.strictEqual(Array.isArray(Memory.permanent.spawnIds), true);
            assert.strictEqual(lib.test.firstTurnCache, true);
        });

        it("Should return false if turn not equals zero or ai has state", function() {
            assert.strictEqual(lib.isFirstTurn(), true);
            assert.strictEqual(Array.isArray(Memory.permanent.spawnIds), true);
            assert.strictEqual(lib.test.firstTurnCache, true);

            // Enter a new game tick
            Game.time++;
            lib.test.firstTurnCache = undefined; // Reset turnly reset cache
            assert.strictEqual(lib.isFirstTurn(), false);
            assert.strictEqual(lib.test.firstTurnCache, false);
        });

        it("Should restart if different it can't find old spawns", function() {
            assert.strictEqual(lib.isFirstTurn(), true);
            assert.strictEqual(Array.isArray(Memory.permanent.spawnIds), true);
            assert.strictEqual(lib.test.firstTurnCache, true);

            // Enter a new game tick with a different spawn
            Game.time++;
            Game.spawns.Spawn1.id += "-changed";
            lib.test.firstTurnCache = undefined; // Reset turnly reset cache
            assert.strictEqual(lib.isFirstTurn(), true);
            assert.strictEqual(lib.test.firstTurnCache, true);

            // Enter a new game tick
            Game.time++;
            lib.test.firstTurnCache = undefined; // Reset turnly reset cache
            assert.strictEqual(lib.isFirstTurn(), false);
            assert.strictEqual(lib.test.firstTurnCache, false);
        });

        it("Should use the cache if its not set to undefined", function() {
            lib.test.firstTurnCache = false;
            assert.strictEqual(lib.isFirstTurn(), false);

            lib.test.firstTurnCache = true;
            assert.strictEqual(lib.isFirstTurn(), true);

            lib.test.firstTurnCache = false;
            assert.strictEqual(lib.isFirstTurn(), false);

            lib.test.firstTurnCache = true;
            assert.strictEqual(lib.isFirstTurn(), true);
        });

        it("Should log restarts after 10 ticks of being inactive (to prevent false positives)", function() {
            assert.strictEqual(lib.isFirstTurn(), true);
            assert.deepEqual(Memory.permanent.restarts, [{start: 1, spawns: ['id219970']}]);
            assert.deepEqual(Memory.permanent.spawnIds, ['id219970']);
            assert.strictEqual(Memory.permanent.firstTurn, 1);

            // Normal restart
            lib.test.firstTurnCache = undefined; // Reset cache
            Game.time += 10; // Game restarts some time later
            Game.spawns.Spawn1.id += "-new"; // With a new spawn

            assert.strictEqual(lib.isFirstTurn(), true);
            assert.deepEqual(Memory.permanent.restarts, [
                {start: 1, spawns: ['id219970']},
                {start: 11, spawns: ['id219970-new']}
            ]);
            assert.deepEqual(Memory.permanent.spawnIds, ['id219970-new']);
            assert.strictEqual(Memory.permanent.firstTurn, 11);
            assert.strictEqual(Memory.permanent.multipleRestartsSince, undefined);

            // Restart with false start (restarted in 10 ticks)
            lib.test.firstTurnCache = undefined; // Reset cache
            Game.time += 1; // Game restarts some time later
            Game.spawns.Spawn1.id += "-blah"; // With a new spawn

            assert.strictEqual(lib.isFirstTurn(), true);
            assert.deepEqual(Memory.permanent.restarts, [
                {start: 1, spawns: ['id219970']},
                {start: 11, spawns: ['id219970-new']},
            ]);
            assert.deepEqual(Memory.permanent.spawnIds, ['id219970-new-blah']);
            assert.strictEqual(Memory.permanent.firstTurn, 12);
            assert.strictEqual(Memory.permanent.multipleRestartsSince, 12);

            // Get out false start
            lib.test.firstTurnCache = undefined; // Reset cache
            Game.time += 10; // Game restarts some time later
            Game.spawns.Spawn1.id += "-blah"; // With a new spawn

            assert.strictEqual(lib.isFirstTurn(), true);
            assert.deepEqual(Memory.permanent.restarts, [
                {start: 1, spawns: ['id219970']},
                {start: 11, spawns: ['id219970-new']},
                {start: 22, spawns: ['id219970-new-blah-blah'], multipleRestartsSince: 12}
            ]);
            assert.deepEqual(Memory.permanent.spawnIds, ['id219970-new-blah-blah']);
            assert.strictEqual(Memory.permanent.firstTurn, 22);
            assert.strictEqual(Memory.permanent.multipleRestartsSince, undefined);
        });
    });
});


text:
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">

    <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
    <script src="../dist/mermaidAPI.js"></script>

    <script>
        mermaidAPI.initialize({
            startOnLoad:true
        });
        $(function(){
            var graphDefinition = 'graph TB\na-->b';
            var cb = function(html){
                console.log(html);
            }
            mermaidAPI.render('id1',graphDefinition,cb);
        });
    </script>
</head>
<body>

</body>
</html>


text:
#import "../AmazonServiceRequestConfig.h"

/**
 * Describe Snapshot Attribute Request
 */

@interface EC2DescribeSnapshotAttributeRequest:AmazonServiceRequestConfig

{
    NSString *snapshotId;
    NSString *attribute;
}

/**
 * The ID of the EBS snapshot whose attribute is being described.
 */
@property (nonatomic, retain) NSString *snapshotId;

/**
 * The name of the EBS attribute to describe.
 Available attribute
 * names: createVolumePermission
 *

 * Constraints:

 * Allowed Values: productCodes, createVolumePermission
 */
@property (nonatomic, retain) NSString *attribute;

/**
 * Default constructor for a new DescribeSnapshotAttributeRequest object.  Callers should use the
 * property methods to initialize this object after creating it.
 */
-(id)init;

/**
 * Constructs a new DescribeSnapshotAttributeRequest object.
 * Callers should use properties to initialize any additional object members.
 *
 * @param theSnapshotId The ID of the EBS snapshot whose attribute is
 * being described.
 * @param theAttribute The name of the EBS attribute to describe.

 * Available attribute names: createVolumePermission
 */
-(id)initWithSnapshotId:(NSString *)theSnapshotId andAttribute:(NSString *)theAttribute;

/**
 * Returns a string representation of this object; useful for testing and
 * debugging.
 *
 * @return A string representation of this object.
 */
-(NSString *)description;

@end


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/.idea/require_scratchpad.iml" filepath="$PROJECT_DIR$/.idea/require_scratchpad.iml" />
    </modules>
  </component>
</project>


text:
package com.lhg.test.designpattern.visitor;

/**
 * Created by liux on 16-3-19.
 */
public interface ComputerPart {
    void accept(ComputerPartVisitor computerPartVisitor);
}


text:
package org.jbpm.workbench.wi.client.i18n;

import com.google.gwt.core.client.GWT;
import com.google.gwt.i18n.client.Messages;

/**
 * This uses GWT to provide client side compile time resolving of locales. See:
 * http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5&s=google-web- toolkit-doc-1-5&t=DevGuideInternationalization
 * (for more information).
 *

 * Each method name matches up with a key in Constants.properties (the properties file can still be used on the server). To use
 * this, use GWT.create(Constants.class).
 */
public interface Constants extends Messages {

    Constants INSTANCE = GWT.create(Constants.class);

    String No_Deployment_Units_Available();

    String Deployment_Units();

    String Undeploy();

    String Details();

    String Deploy_Unit();

    String Deploy_A_New_Unit();

    String GroupID();

    String Artifact();

    String Version();

    String KieBaseName();

    String KieSessionName();

    String Actions();

    String Refresh();

    String Deployed_Units_Refreshed();

    String Unit();

    String Please_Wait();

    String KIE_Configurations();

    String New_Deployment_Unit();

    String Strategy();

    String Deployment();

    String Undeploy_Question();

    String DeploymentDescriptorEditor();

    String PersistenceUnit();

    String AuditPersistenceUnit();

    String PersistenceMode();

    String AuditMode();

    String RuntimeStrategy();

    String MarshalStrategy();

    String Add();

    String Remove();

    String Resolver();

    String Value();

    String Identifier();

    String Name();

    String PromptForRemoval();

    String NoDataDefined();

    String DeploymentDescriptorParameters();

    String NoParametersDefined();

    String DDParametersPopupTitle();

    String EventListeners();

    String Globals();

    String WorkItemHandlers();

    String TaskEventListeners();

    String EnvironmentEntries();

    String Configuration();

    String RequiredRoles();

    String RemoteableClasses();

    String LimitSerializationClasses();

    String NamedParams();

    String NoParamResolver();

    String Type();

    String MergeMode();

    String EnterValue();

    String EnterResolverType();

    String CaseProject();

    String ConfigureProjectSuccess(String projectName);

    String ConfigureProjectFailure(String projectName);

    String CaseAppProvisioningStarted();

    String CaseAppProvisioningCompleted();

    String CaseAppProvisioningFailed();

    String CaseAppName();

    String CMMNFileTypeDescription();

    String CMMNFileTypeShortName();

    String ServiceTaskList();

    String NoServiceTasksFound();

    String BaseSettings();

    String MavenInstallHelp();

    String InstallPomDepsHelp();

    String UseVersionRangeHelp();

    String InstallServiceTask();

    String UninstallServiceTask();

    String ServiceTaskUpload();

    String Cancel();

    String Uploading();

    String SelectFileUpload();

    String UnsupportedFileType();

    String InvalidJarNotPom();

    String InvalidPom();

    String UploadFailed();

    String InternalUploadError();

    String AddTaskSuccess();

    String Installing();

    String InstallServiceTaskParams();

    String SkippedMessage(String serviceTaskNames);

    String RemoveTaskSuccess(String serviceTask);

    String RemoveServiceTaskAction();

    String RemoveServiceTaskTitle();

    String RemoveServiceTaskConfirmMessage(String serviceTask);

    String CanNotRemoveServiceTaskMessage(String serviceTask);

    String Ok();
}


text:
package com.bmriv.android.streamify;

import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.os.Messenger;
import android.support.v4.app.DialogFragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.SeekBar;
import android.widget.TextView;

import com.squareup.picasso.Picasso;

import java.lang.ref.WeakReference;
import java.util.ArrayList;

public class PlayerFragment extends DialogFragment implements View.OnClickListener,
        SeekBar.OnSeekBarChangeListener {
    public static final String PLAYER_TAG = "PLAYER_TAG";
    public static final String EXTRA_MESSENGER = "com.bmriv.android.streamify.EXTRA_MESSENGER";
    public static final int POSITION = 1, PLAY = 2, PAUSE = 3;
    private static final String LOG_TAG = PlayerFragment.class.getSimpleName();
    private static final String SEEK_POSITION_KEY = "com.bmriv.android.streamify.SEEK_POSITION_KEY";
    private static final String PAUSED_KEY = "com.bmriv.android.streamify.PAUSED_KEY";
    private static final String DURATION_KEY = "com.bmriv.android.streamify.DURATION_KEY";
    private final Handler mUpdateHandler = new Handler();
    private final UpdateSeekBar mUpdateSeekBar = new UpdateSeekBar();
    private final IncomingHandler mIncomingHandler = new IncomingHandler(new WeakReference<>(this));
    private ArrayList<Track> mTracks;
    private boolean mPaused, mBound;
    private int mPosition, mSeekPosition, mDuration;
    private MusicService mService;
    private TextView view_artistName, view_albumName, view_trackName, view_timeEnd;
    private ImageButton button_playPause, button_prev, button_next;
    private ImageView view_albumArt;
    private SeekBar view_seekBar;
    private final ServiceConnection mConnection = new ServiceConnection() {
        @Override
        public void onServiceConnected(ComponentName name, IBinder service) {
            mService = ((MusicService.MusicBinder) service).getService();
            mBound = true;
            mUpdateSeekBar.run();
        }

        @Override
        public void onServiceDisconnected(ComponentName name) {
            mService = null;
            mBound = false;
            mUpdateSeekBar.stop();
        }
    };

    @Override
    public void onSaveInstanceState(Bundle outState) {
        outState.putParcelableArrayList(TrackFragment.TRACK, mTracks);
        outState.putInt(TrackFragment.POSITION, mPosition);
        outState.putInt(SEEK_POSITION_KEY, mSeekPosition);
        outState.putInt(DURATION_KEY, mDuration);
        outState.putBoolean(PAUSED_KEY, mPaused);
        super.onSaveInstanceState(outState);
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (savedInstanceState != null) {
            mTracks = savedInstanceState.getParcelableArrayList(TrackFragment.TRACK);
            mPosition = savedInstanceState.getInt(TrackFragment.POSITION);
            mSeekPosition = savedInstanceState.getInt(SEEK_POSITION_KEY);
            mDuration = savedInstanceState.getInt(DURATION_KEY);
            mPaused = savedInstanceState.getBoolean(PAUSED_KEY);
        } else {
            Bundle args = getArguments();
            if (args != null && args.containsKey(TrackFragment.TRACK)) {
                mTracks = args.getParcelableArrayList(TrackFragment.TRACK);
                mPosition = args.getInt(TrackFragment.POSITION, 0);
            } else {
                mTracks = getActivity().getIntent().getParcelableArrayListExtra(TrackFragment.TRACK);
                mPosition = getActivity().getIntent().getIntExtra(TrackFragment.POSITION, 0);
            }
        }
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        mUpdateSeekBar.stop();
    }

    @Override
    public void onStart() {
        super.onStart();
        Intent intent = new Intent(getActivity(), MusicService.class);
        intent.putParcelableArrayListExtra(TrackFragment.TRACK, mTracks);
        intent.putExtra(TrackFragment.POSITION, mPosition);
        intent.putExtra(EXTRA_MESSENGER, new Messenger(mIncomingHandler));
        getActivity().startService(intent);
        getActivity().bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
        updateDisplay();
    }

    @Override
    public void onStop() {
        super.onStop();
        if (mBound) {
            getActivity().unbindService(mConnection);
            mBound = false;
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.fragment_player, container, false);
        Track track = mTracks.get(mPosition);

        view_artistName = (TextView) rootView.findViewById(R.id.textView_artistName);
        view_albumName = (TextView) rootView.findViewById(R.id.textView_albumName);
        view_trackName = (TextView) rootView.findViewById(R.id.textView_songTitle);
        view_albumArt = (ImageView) rootView.findViewById(R.id.imageView_album);
        button_playPause = (ImageButton) rootView.findViewById(R.id.imageButton_play_pause);
        button_prev = (ImageButton) rootView.findViewById(R.id.imageButton_previous);
        button_next = (ImageButton) rootView.findViewById(R.id.imageButton_next);
        view_timeEnd = (TextView) rootView.findViewById(R.id.textView_timeEnd);
        view_seekBar = (SeekBar) rootView.findViewById(R.id.seekBar);

        button_playPause.setOnClickListener(this);
        button_prev.setOnClickListener(this);
        button_next.setOnClickListener(this);
        view_seekBar.setOnSeekBarChangeListener(this);
        Picasso.with(getActivity()).load(track.getLargeImage()).into(view_albumArt);

        return rootView;
    }

    /**
     * Handles all button clicks in player.
     *
     * @param view View that was clicked.
     */
    @Override
    public void onClick(View view) {
        int id = view.getId();
        if (!mBound) {
            return;
        }
        if (id == button_playPause.getId()) {
            if (mPaused) {
                mService.play();
            } else {
                mService.pause();
            }
        } else if (id == button_prev.getId()) {
            mService.prev();
        } else if (id == button_next.getId()) {
            mService.next();
        }
    }

    /*
     * Implementation of methods of SeekBar.OnSeekBarChangeListener.
     */
    @Override
    public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
    }

    @Override
    public void onStartTrackingTouch(SeekBar seekBar) {
    }

    @Override
    public void onStopTrackingTouch(SeekBar seekBar) {
        if (mBound) {
            mService.seek(seekBar.getProgress());
        }
    }

    /**
     * Updates artist name, album name, track name, and album thumbnail.
     * Also calls {@link #updateSeekBarDisplay()} and {@link #updatePlayPauseButton()}.
     */
    private void updateDisplay() {
        Track track = mTracks.get(mPosition);

        view_artistName.setText(track.getArtistName());
        view_albumName.setText(track.getAlbumName());
        view_trackName.setText(track.getTrackName());
        Picasso.with(getActivity()).load(track.getLargeImage()).into(view_albumArt);

        updateSeekBarDisplay();
        updatePlayPauseButton();
    }

    /**
     * Updates play/pause button to display correct image.
     */
    private void updatePlayPauseButton() {
        if (mPaused) {
            button_playPause.setImageResource(android.R.drawable.ic_media_play);
        } else {
            button_playPause.setImageResource(android.R.drawable.ic_media_pause);
        }
    }

    /**
     * Updates seek bar to display correct position and duration.
     */
    private void updateSeekBarDisplay() {
        if (mDuration > 0 && mSeekPosition > 0) {
            String durationText = String.format("%d:%02d", mDuration / 60000, mDuration / 1000);
            view_seekBar.setMax(mDuration);
            view_timeEnd.setText(durationText);
            view_seekBar.setProgress(mSeekPosition);
        }
    }

    /**
     * Handles incoming messages.
     */
    private static class IncomingHandler extends Handler {

        private final WeakReference<PlayerFragment> mReference;

        private IncomingHandler(WeakReference<PlayerFragment> reference) {
            mReference = reference;
        }

        @Override
        public void handleMessage(Message msg) {
            PlayerFragment fragment = mReference.get();
            if (fragment == null) {
                return;
            }
            Log.d(LOG_TAG, msg.toString());
            switch (msg.what) {
                case POSITION:
                    int position = msg.arg1;
                    if (position != fragment.mPosition) {
                        fragment.mPosition = position;
                        fragment.updateDisplay();
                    }
                    break;
                case PLAY:
                    fragment.mPaused = false;
                    fragment.updatePlayPauseButton();
                    break;
                case PAUSE:
                    fragment.mPaused = true;
                    fragment.updatePlayPauseButton();
                    break;
                default:
                    super.handleMessage(msg);
            }
        }

    }

    /**
     * Retrieves track duration and current position from {@link MusicService} once per second
     * using a corresponding {@link Handler}.
     */
    private class UpdateSeekBar implements Runnable {
        boolean mStop;

        @Override
        public void run() {
            if (!mStop) {
                int duration = mService.getSongDuration();
                if (duration > 0 && duration < 4e7) {
                    mDuration = duration;
                }
                mSeekPosition = mService.getPlayTime();
                updateSeekBarDisplay();

                mUpdateHandler.postDelayed(mUpdateSeekBar, 1000);
            }
        }

        public void stop() {
            this.mStop = true;
        }
    }
}


text:
#ifdef PGG_VULKAN

#ifndef PEGR_GEOMETRYRESOURCE_VULKAN_HPP
#define PEGR_GEOMETRYRESOURCE_VULKAN_HPP

#include <stdint.h>

#include "pegr/video/GraphicsApiLibrary.hpp"

#include "pegr/video/Geometry.hpp"
#include "pegr/resource/Resource.hpp"

namespace pegr {

class GeometryResourceVK : public Geometry, public Resource {
private:
    bool mHasArmature;
    bool mHasLightprobes;

    bool mUsePosition;
    bool mUseColor;
    bool mUseUV;
    bool mUseNormal;
    bool mUseTangent;
    bool mUseBitangent;
    bool mUseBoneWeights; // Also for bone indices

    uint32_t mSizeOfByteVertexArray;
    uint32_t mSizeOfFloatVertexArray;
    uint32_t mSizeOfIndexArray;

    // Either sizeof(glm::u16) or sizeof(glm::u32)
    uint8_t mIndexTypeSize;

    // Offsets in float array
    uint32_t mPositionOff;
    uint32_t mColorOff;
    uint32_t mUVOff;
    uint32_t mNormalOff;
    uint32_t mTangentOff;
    uint32_t mBitangentOff;
    uint32_t mBoneWeightOff;
    uint32_t mFloatsPerVertex;

    // Offsets in byte array
    uint32_t mBoneIndexOff;
    uint32_t mBytesPerVertex;

    uint32_t mNumVertices;
    uint32_t mNumTriangles;

    VkBuffer mVertexIndexBuffer = VK_NULL_HANDLE;
    VkDeviceMemory mVertexIndexBufferMemory = VK_NULL_HANDLE;

    // The data of these vectors are referenced during pipeline creation
    std::vector<VkVertexInputBindingDescription> mVertexInputBindingDescs;
    std::vector<VkVertexInputAttributeDescription> mVertexInputAttributeDescs;

    VkPipelineVertexInputStateCreateInfo mVertexInputState;
    VkPipelineInputAssemblyStateCreateInfo mInputAssemblyState;

    Geometry::Armature mArmature;
    std::vector<Geometry::Lightprobe> mLightprobes;

    bool mLoaded;

public:
    GeometryResourceVK();
    virtual ~GeometryResourceVK();

    static Geometry* gallop(Resource* resource);

    void load();
    void unload();

    const VkPipelineVertexInputStateCreateInfo* getVertexInputState();
    const VkPipelineInputAssemblyStateCreateInfo* getInputAssemblyState();

    void cmdBindBuffers(VkCommandBuffer cmdBuff);
    void cmdDrawIndexed(VkCommandBuffer cmdBuff);
};
typedef GeometryResourceVK GeometryResource;

}

#endif // PEGR_GEOMETRYRESOURCE_VULKAN_HPP

#endif // PGG_VULKAN


text:
#ifndef __JIntellitypeHandler_h__
#define __JIntellitypeHandler_h__

#include "JIntellitypeThread.h"

class JIntellitypeHandler
{
	friend DWORD WINAPI JIntellitypeThread::ThreadProc( LPVOID lpParameter );

public:

	static JIntellitypeHandler *extract( JNIEnv *env, jobject object );

	JIntellitypeHandler( JNIEnv *env, jobject object );

	void initialize( JNIEnv *env, HINSTANCE instance );
	void regHotKey( jint identifier, jint modifier, jint keycode  );
	void unregHotKey( jint identifier );
	void intellitype( jint commandId );
	void terminate();

private:

	enum
	{
		INITIALIZE_CODE = 1,
        REGISTER_HOTKEY_CODE = 2,
		UNREGISTER_HOTKEY_CODE = 3,
		TERMINATE_CODE = 4,
		INTELLITYPE_CODE = 5
	};

	~JIntellitypeHandler();

	void createHiddenWindow();
	void doInitialize();
	void doRegHotKey(LPARAM callback);
	void doUnregisterHotKey(LPARAM callback);
	void doIntellitype(LPARAM callback);
	void fireHotKey(jint hotkeyId);
	void fireIntellitype(jint commandId);

	HINSTANCE m_instance;
	HWND m_window;
	jobject m_object;
	jmethodID m_fireHotKey;
	jmethodID m_fireIntellitype;

	static LRESULT CALLBACK WndProc( HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam );
	static DWORD WINAPI ThreadProc( LPVOID lpParameter );
};

typedef struct {
	JIntellitypeHandler *handler;
	jint identifier;
	jint modifier;
	jint keycode;
	jint command;
} JIntellitypeHandlerCallback;

#ifndef WM_APPCOMMAND
#define WM_APPCOMMAND					0x319
#define FAPPCOMMAND_MASK				0x8000
#define GET_APPCOMMAND_LPARAM(lParam) ((short)(HIWORD(lParam) & ~FAPPCOMMAND_MASK))
#define HSHELL_APPCOMMAND			    12

#endif

#endif


text:
package vgrechka.phizdetsidea.phizdets.vp;

import com.google.common.base.Preconditions;
import org.jetbrains.annotations.NotNull;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;

/**
 * Entry point to package. Use {@link #linkViewWithPresenterAndLaunch(Class, Class, Creator)}
 * @author Ilya.Kazakevich
 */
public final class ViewPresenterUtils {
  private ViewPresenterUtils() {
  }

  /**
   * TODO: Write about do not call anything in constructor
   * Creates link between view and presenter and launches them using {@link Presenter#launch()}. Be sure to read package info first.
   *
   * @param presenterInterface presenter interface
   * @param viewInterface      view interface
   * @param creator            class that handles presenter and view instances actual creation
   * @param <V>                view interface
   * @param <P>                presenter interface
   */
  public static <V, P extends Presenter> void linkViewWithPresenterAndLaunch(@NotNull Class<P> presenterInterface,
                                                                             @NotNull Class<V> viewInterface,
                                                                             @NotNull Creator<V, P> creator) {
    Preconditions.checkArgument(presenterInterface.isInterface(), "Presenter is not interface");
    Preconditions.checkArgument(viewInterface.isInterface(), "View is not interface");

    //TODO: Use cglib?
    PresenterHandler<P> presenterHandler = new PresenterHandler<>();
    ViewHandler<V> viewHandler = new ViewHandler<>();
    V viewProxy = createProxy(viewInterface, viewHandler);
    P presenterProxy = createProxy(presenterInterface, presenterHandler);

    V realView = creator.createView(presenterProxy);
    viewHandler.setRealView(realView);
    P realPresenter = creator.createPresenter(viewProxy);
    presenterHandler.setRealPresenter(realPresenter);
    realPresenter.launch();
  }

  @SuppressWarnings("unchecked") //Proxy always returns correct class
  private static <C> C createProxy(Class<C> clazz, InvocationHandler handler) {
    assert clazz != null;
    assert handler != null;
    return (C)Proxy.newProxyInstance(ViewPresenterUtils.class.getClassLoader(), new Class[]{clazz}, handler);
  }
}


text: Turns VSIXes you download from galleries into Experimental automatically before installing them.


text: This is a sample paragraph that will be used for tests.


text:
package com.bgstation0.android.sample.fragmentstatepageradapter_;

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
import android.view.Menu;
import android.view.MenuItem;

public class MainActivity extends FragmentActivity{	// support.v4'ÌFragmentActivity'É'·'é•K—v'ª' 'é.

	// ¶¬Žž.
    @Override
    protected void onCreate(Bundle savedInstanceState) {

    	// Šù'è'̏ˆ—.
    	super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        // ViewPager'̏‰Šú‰».
        ViewPager viewPager = (ViewPager)findViewById(R.id.viewpager);	// viewPager'̎擾.
        CustomFragmentStatePagerAdapter cfspa = new CustomFragmentStatePagerAdapter(getSupportFragmentManager());	// cfspa'𐶐¬.
        viewPager.setAdapter(cfspa);	// viewPager'Écfspa'ðƒZƒbƒg.

    }

}


text:
package rocfox.rdf2xml.transformation.parsers;

import java.util.ArrayList;
import org.w3c.dom.Element;
import rocfox.rdf2xml.exceptions.ExceptionBuilder;
import rocfox.rdf2xml.transformation.dom.Match;
import rocfox.rdf2xml.transformation.dom.SparqlQuery;
import rocfox.rdf2xml.transformation.parsers.validation.ValidationOptions;
import rocfox.rdf2xml.utilities.xml.XmlReader;

/**
 *
 * @author Nicolas
 */
public class MatchParser extends Parser
{
	@Override
	public boolean isElement(Element source)
	{
		return super.isElement(source) && Match.ElementName.equals(source.getLocalName());
	}

	public Match parse(Element source)
	{
		if(source == null)
		{
			throw ExceptionBuilder.createNullArgumentException("source");
		}
		validate(source);
		SparqlQuery query = new SparqlQuery(XmlReader.readTextContent(source));
		ArrayList<String> undeclaredPrefixes = query.getUndeclaredPrefixes();
		for(String prefix : undeclaredPrefixes)
		{
			String namespaceUri = source.lookupNamespaceURI(prefix);
			if(namespaceUri != null)
			{
				if(!query.containsPrefix(prefix))
				{
					query.addPrefix(prefix, namespaceUri);
				}
			}
		}
		Match result = new Match();
		result.setContent(query);
		return result;
	}

	public void validate(Element source)
	{
		ValidationOptions options = new ValidationOptions();
		options.setAllowChildTextNodes(true);
		options.setAllowOtherAttributes(false);
		options.setAllowOtherChildElements(false);
		options.validate(source);
	}
}


text:
package com.lampalork.mcoptionpricing

import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._ //import the implicit conversions
import org.apache.spark.SparkConf
import org.apache.spark.serializer.{KryoSerializer, KryoRegistrator}
import com.esotericsoftware.kryo.Kryo
import org.apache.commons.math3.random.MersenneTwister
import org.apache.commons.math3.distribution.NormalDistribution
import org.apache.commons.math3.distribution.MultivariateNormalDistribution

import scala.io.Source
import java.io.PrintWriter

class MyRegistrator extends KryoRegistrator {
  override def registerClasses(kryo: Kryo) {
    kryo.register(classOf[Instrument])
  }
}

abstract class Option {
  def spot: Double
  def expiry: Double
  def sigma: Double
  def mu: Double
  def payoff(xc: Array[Double]) : Double
}

case class VanillaOption(spot: Double = 100.0, expiry: Double = 1.0, strike: Double = 100.0, sigma: Double = 0.10, mu: Double = 0.0)
  extends Option
{
  override def payoff(xc: Array[Double]) = math.max(xc.last - strike,0)
  override def toString() = "VanillaOption with spot=" + spot + " strike=" + strike
}

case class UpAndOutOption(spot: Double = 100.0, expiry: Double = 1.0, strike: Double = 100.0, barrier: Double = 120.0, sigma: Double = 0.10, mu: Double = 0.0)
  extends Option
{
  override def payoff(xc: Array[Double]) = {
    // reduceLeft is a concise/idiomatic approach
    // http://alvinalexander.com/scala/scala-reduceleft-examples
    var indicator = 1
    if (xc.reduceLeft(_ max _) > barrier) indicator = 0 // if barrier is crossed, barrier = 0

    indicator * math.max(xc.last - strike,0)
  }
  override def toString() = "UpAndOutOption with spot=" + spot + " strike=" + strike + " barrier=" + barrier
}

object MonteCarloOptionPricing {
  def main(args: Array[String]) {
    val sparkConf = new SparkConf().setAppName("Monte Carlo Option Pricing")
    sparkConf.set("spark.serializer", classOf[KryoSerializer].getName)
    sparkConf.set("spark.kryo.registrator", classOf[MyRegistrator].getName)
    val sc = new SparkContext(sparkConf)

    println("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-")
    println("Monte Carlo Option Pricing")
    println("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-")

    val numSimulations = args(0).toInt
    val parallelism = args(1).toInt

    var option1 = new VanillaOption(100,1.0,100, 0.20, 0.05)
    var option2 = new UpAndOutOption(100,1.0,100, 120, 0.20, 0.05)
    var instruments = Array(option1,option2)

    // Send all instruments to every node
    val broadcastInstruments = sc.broadcast(instruments)

    broadcastInstruments.value.foreach( option => {
      // Generate different seeds so that our simulations don't all end up with the same results
      val seed = System.currentTimeMillis()
      val seeds = (seed until seed + parallelism)
      val seedRdd = sc.parallelize(seeds, parallelism)

      // Main computation: run simulations and compute aggregate return for each
      val simulationsRdd = seedRdd.flatMap(runSimulation(_, numSimulations / parallelism, option))

      // Cache the results so that we don't recompute for both of the summarizations below
      simulationsRdd.cache()

      //val option1payoffs = trialsRdd.map((x: Array[Double]) => math.max(x.last - option1.strike,0))
      val payoffsRdd = simulationsRdd.map((x: Array[Double]) => option.payoff(x))

      // Compute option price
      val price = math.exp(- option.mu * option.expiry) * payoffsRdd.mean()
      println(option + ": " + price)
    })

  }

  def runSimulation(seed: Long, numSimulations: Int, instrument: Option): Array[Array[Double]] = {
    //val rand = new MersenneTwister(seed)
    //val normal = new NormalDistribution(rand, 0.0, 1.0)
    val numTimeSteps = math.round( instrument.expiry / (1.0/365)).toInt
    val dt = instrument.expiry / numTimeSteps

    val r = new scala.util.Random
    //val phi = Seq.fill(numSimulations * numTimeSteps)(r.nextGaussian)

    val timeSeries = new Array[Array[Double]](numSimulations)

    // perform the numSimulations simulations
    for (i <- 0 until numSimulations) {

      // generate time serie
      val timeSerie = new Array[Double](numTimeSteps + 1)
      timeSerie(0) = instrument.spot // init first stock price to spot
      for (k <- 1 until (numTimeSteps+1)) {
        //val dX = normal.sample()
        val dX = r.nextGaussian()
        //val dX = phi(numSimulations*numTimeSteps + (k-1))
        val dS = instrument.mu * dt + instrument.sigma * math.sqrt(dt) * dX
        timeSerie(k) = timeSerie(k-1) * (1.0 + dS)
      }

      // save timeserie
      timeSeries(i) = timeSerie
    }

    timeSeries
  }

}


text:
# pragma once

# include <dsn/internal/task.h>
# include <dsn/internal/network.h>
# include <dsn/internal/synchronize.h>
# include <dsn/internal/global_config.h>

namespace dsn {

class service_node;
class rpc_engine
{
public:
    rpc_engine(configuration_ptr config, service_node* node);

    //
    // management routines
    //
    ::dsn::error_code start(
        const service_app_spec& spec,
        io_modifer& ctx
        );

    //
    // rpc registrations
    //
    bool  register_rpc_handler(rpc_handler_ptr& handler);
    rpc_handler_ptr unregister_rpc_handler(dsn_task_code_t rpc_code);

    //
    // rpc routines
    //
    void call(message_ex* request, rpc_response_task* call);
    void on_recv_request(message_ex* msg, int delay_ms);
    static void reply(message_ex* response);

    //
    // information inquery
    //
    service_node* node() const { return _node; }
    const ::dsn::rpc_address& primary_address() const { return _local_primary_address; }

private:
    network* create_network(
        const network_server_config& netcs,
        bool client_only,
        io_modifer& ctx
        );

private:
    configuration_ptr                     _config;
    service_node                          *_node;
    std::vector<std::vector<network*>>    _client_nets; // <format, <CHANNEL, network*>>
    std::unordered_map<int, std::vector<network*>>  _server_nets; // <port, <CHANNEL, network*>>
    ::dsn::rpc_address                             _local_primary_address;

    typedef std::unordered_map<std::string, rpc_handler_ptr> rpc_handlers;
    rpc_handlers                  _handlers;
    utils::rw_lock_nr             _handlers_lock;

    bool                          _is_running;

    static bool                   _message_crc_required;
};

} // end namespace


text:
//  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
//
//   Copyright 2016-2018 Pascal ECHEMANN.
//
//   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.

/*!
 * This module constains utilities used by the MappedPathUtilTest test suite.
 */

// Utilities:
export const CONTEXTROOT:string = "contextroot";
export const URI_PATH:string = "my\\uri\\path";
export const GLASSCAT_URI_PATTERN:string = "${server}\\my\\uri\\path";
export const GLASSCAT_URI_PATH:string = "contextroot\\server\\com\\onsoft\\glasscat\\my\\uri\\path";
export const ROOT_URI_PATTERN:string = "${root}\\my\\uri\\path";
export const ROOT_URI_PATH:string = "contextroot\\my\\uri\\path";
export const MODULES_URI_PATTERN:string = "${modules}\\my\\uri\\path";
export const MODULES_URI_PATH:string = "contextroot\\public\\modules\\my\\uri\\path";


text:
package com.jfinal.kit;

import javax.servlet.ServletContext;

/**
 *
 * @author cokolin
 */
public class DemoKit {
	private static ServletContext ctx;

	public static ServletContext getCtx() {
		return ctx;
	}

	public static ServletContext setCtx(ServletContext context) {
		return ctx = context;
	}

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Trans. Roy. Soc. New Zealand 82: 992 (1955)

#### Original name
Albugo mesembryanthemi S.D. Baker

### Remarks
null


text:
module.exports = function(app) {
  return {
    home: function(req, res) {
      //res.sendfile('./public/views/index.html');
      res.render('index', {

      });
    }
  }
};


text:
exports.polyfills = function(env) {
  var polyfills = [
    'core-js/es6/symbol',
    'core-js/es6/object',
    'core-js/es6/function',
    'core-js/es6/parse-int',
    'core-js/es6/parse-float',
    'core-js/es6/number',
    'core-js/es6/math',
    'core-js/es6/string',
    'core-js/es6/date',
    'core-js/es6/array',
    'core-js/es6/regexp',
    'core-js/es6/map',
    'core-js/es6/set',
    'core-js/es6/weak-map',
    'core-js/es6/weak-set',
    'core-js/es6/typed',
    'core-js/es6/reflect',
    'core-js/es7/reflect',

    'core-js/es7/reflect',
    'reflect-metadata',

    'zone.js/dist/zone',
    'ts-helpers'
  ];

  if (env !== 'build') {
      polyfills.push('zone.js/dist/long-stack-trace-zone');
  }

  return polyfills;
};

exports.vendor = function(env) {
  return [
    // angular libraries
    '@angular/platform-browser',
    '@angular/platform-browser-dynamic',
    '@angular/core',
    '@angular/common',
    '@angular/http',
    '@angular/router',

    // RxJS
    'rxjs/Observable',
    'rxjs/BehaviorSubject',
    'rxjs/Subscription',

    'rxjs/add/operator/bufferCount',
    'rxjs/add/operator/cache',
    'rxjs/add/operator/combineLatest',
    'rxjs/add/operator/debounce',
    'rxjs/add/operator/delay',
    'rxjs/add/operator/do',
    'rxjs/add/operator/filter',
    'rxjs/add/operator/finally',
    'rxjs/add/operator/first',
    'rxjs/add/operator/map',
    'rxjs/add/operator/reduce',
    'rxjs/add/operator/scan',
    'rxjs/add/operator/switchMap',
    'rxjs/add/operator/take',
    'rxjs/add/operator/toPromise',

    'rxjs/add/observable/combineLatest',
    'rxjs/add/observable/from',
    'rxjs/add/observable/interval',
    'rxjs/add/observable/of',
    'rxjs/add/observable/zip',

    // other vendor libraries
    'ng2-bootstrap/ng2-bootstrap',
    'angular2-toaster/angular2-toaster',
    'angularfire2',

    // other vendor css
    'bootstrap/dist/css/bootstrap.css',
    'angular2-toaster/lib/toaster.css'
  ];
};


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.
 *  ====================================================================
 */

/*
 * Changes to the original project are Copyright 2019, Verizon Media Inc..
 */

package dev.amp.validator;

import dev.amp.validator.utils.TagSpecUtils;

import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;

/**
 * URL error in attribute adaptor.
 *
 * @author nhant01
 * @author GeorgeLuo
 */

public class UrlErrorInAttrAdapter implements UrlErrorAdapter {
    /**
     * Constructor.
     * @param attrName attribute name.
     */
    public UrlErrorInAttrAdapter(@Nonnull final String attrName) {
        this.attrName = attrName;
    }

    /**
     * Adding missing url validation error.
     *
     * @param context context.
     * @param tagSpec tag spec.
     * @param result validation result.
     */
    @Override
    public void missingUrl(@Nonnull final Context context,
                           @Nonnull final ValidatorProtos.TagSpec tagSpec,
                           @Nonnull final  ValidatorProtos.ValidationResult.Builder result) {
        final List<String> params = new ArrayList<>();
        params.add(this.attrName);
        params.add(TagSpecUtils.getTagSpecName(tagSpec));
        context.addError(
                ValidatorProtos.ValidationError.Code.MISSING_URL,
                context.getLineCol(),
                /* params */params,
                TagSpecUtils.getTagSpecUrl(tagSpec),
                result);
    }

    /**
     * Adding invalid url validation error.
     *
     * @param context context.
     * @param url the url.
     * @param tagSpec tag spec.
     * @param result validation result.
     */
    @Override
    public void invalidUrl(@Nonnull final Context context,
                           @Nonnull final String url,
                           @Nonnull final ValidatorProtos.TagSpec tagSpec,
                           @Nonnull final  ValidatorProtos.ValidationResult.Builder result) {
        final List<String> params = new ArrayList<>();
        params.add(this.attrName);
        params.add(TagSpecUtils.getTagSpecName(tagSpec));
        params.add(url);
        context.addError(
                ValidatorProtos.ValidationError.Code.INVALID_URL,
                context.getLineCol(),
                /* params */params,
                TagSpecUtils.getTagSpecUrl(tagSpec),
                result);
    }

    /**
     * Adding invalid url protocol error.
     *
     * @param context context.
     * @param protocol the protocol.
     * @param tagSpec tag spec.
     * @param result validation result.
     */
    @Override
    public void invalidUrlProtocol(@Nonnull final Context context,
                       @Nonnull final String protocol,
                       @Nonnull final ValidatorProtos.TagSpec tagSpec,
                       @Nonnull final  ValidatorProtos.ValidationResult.Builder result) {
        final List<String> params = new ArrayList<>();
        params.add(this.attrName);
        params.add(TagSpecUtils.getTagSpecName(tagSpec));
        params.add(protocol);
        context.addError(
                ValidatorProtos.ValidationError.Code.INVALID_URL_PROTOCOL,
                context.getLineCol(),
                /* params */params,
                TagSpecUtils.getTagSpecUrl(tagSpec),
                result);
    }

    /**
     * Adding disallowed relative url error.
     *
     * @param context context.
     * @param url the url.
     * @param tagSpec tag spec.
     * @param result validation result.
     */
    @Override
    public void disallowedRelativeUrl(@Nonnull final Context context,
                          @Nonnull final String url,
                          @Nonnull final ValidatorProtos.TagSpec tagSpec,
                          @Nonnull final  ValidatorProtos.ValidationResult.Builder result) {
        final List<String> params = new ArrayList<>();
        params.add(this.attrName);
        params.add(TagSpecUtils.getTagSpecName(tagSpec));
        params.add(url);
        context.addError(
                ValidatorProtos.ValidationError.Code.DISALLOWED_RELATIVE_URL,
                context.getLineCol(),
                /* params */params,
                TagSpecUtils.getTagSpecUrl(tagSpec),
                result);
    }

    /** Attribute name. */
    private final String attrName;
}


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('organization', '0003_auto_20150613_2229'),
    ]

    operations = [
        migrations.AlterField(
            model_name='section',
            name='default_card',
            field=models.ImageField(help_text="Default card for stories in this section that don't specify their own card.", upload_to='organization/section/default_card'),
        ),
        migrations.AlterField(
            model_name='section',
            name='default_card_focus',
            field=models.CharField(choices=[('cc', 'center center'), ('cl', 'center left'), ('cr', 'center right'), ('tl', 'top left'), ('tc', 'top center'), ('tr', 'top right'), ('bl', 'bottom left'), ('bc', 'bottom center'), ('br', 'bottom right')], default='cc', help_text="Location of the focal point for this section's card image.", max_length=2),
        ),
        migrations.AlterField(
            model_name='section',
            name='description',
            field=models.TextField(blank=True, help_text='Short description of what this section covers/is about.'),
        ),
        migrations.AlterField(
            model_name='section',
            name='facebook',
            field=models.CharField(blank=True, help_text='Facebook username for this section. Can be found in the URL.', max_length=32),
        ),
        migrations.AlterField(
            model_name='section',
            name='position',
            field=models.PositiveIntegerField(help_text='Ordering of this section relative to other sections.'),
        ),
        migrations.AlterField(
            model_name='section',
            name='profile_image',
            field=models.ImageField(blank=True, help_text='Social media profile image for this section.', upload_to='organization/section/profile_image'),
        ),
        migrations.AlterField(
            model_name='section',
            name='slug',
            field=models.SlugField(help_text='Used as part of the URL for this section.', max_length=32),
        ),
        migrations.AlterField(
            model_name='section',
            name='twitter',
            field=models.CharField(blank=True, help_text='Twitter handle for this section, without an "@" symbol.', max_length=15),
        ),
        migrations.AlterField(
            model_name='tag',
            name='description',
            field=models.TextField(blank=True, help_text='Short description of what this tag is about.'),
        ),
        migrations.AlterField(
            model_name='tag',
            name='series',
            field=models.BooleanField(default=False, help_text='Whether or not this tag is forms a series.'),
        ),
        migrations.AlterField(
            model_name='tag',
            name='slug',
            field=models.SlugField(help_text='Used as part of the URL for this tag.', max_length=32, unique=True),
        ),
    ]