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

tasks/ext/git/GitBranchTask.php

              Show:
              inherited

                          Classes

\GitBranchTask

              Table of Contents

\GitBranchTask
jump to top

Package: phing\tasks\ext\git
Wrapper aroung git-branch

Parent(s)

\GitBaseTask
            <
            \Task
            <
            \ProjectComponent

See

\VersionControl_Git

Author

Victor Farazdagi

Since

2.4.3

Version

$Id: GitBranchTask.php 1051 2011-03-02 19:40:51Z victor $

Properties

string
                 $branchname= ''

Branch name

Details

Type

string

array
                 $extraOptions= 'array(
        'd' => false'

-d, -D, -m, -M options to git-branch
Respective task options:
delete, forceDelete, move, forceMove

Default valuearray(
        'd' => falseDetails

Type

array

boolean
                 $force= 'false'

--force, -f key to git-branch

Default valuefalseDetails

Type

boolean

string
                 $newbranch= ''

New Branch name for git-branch -m | -M

Details

Type

string

boolean
                 $noTrack= 'false'

--no-track key to git-branch

Default valuefalseDetails

Type

boolean

boolean
                 $setUpstream= 'false'

--set-upstream key to git-branch

Default valuefalseDetails

Type

boolean

string
                 $startPoint= ''

If not HEAD, specify starting point

Details

Type

string

boolean
                 $track= 'false'

--track key to git-branch

Default valuefalseDetails

Type

boolean

Methods

getBranchname(

          )

        :
          void

getDelete(

          )

        :
          void

getDescription(

          )

        :
          void

getForce(

          )

        :
          void

getForceDelete(

          )

        :
          void

getForceMove(

          )

        :
          void

getGitClient(

          )

        :
          void

getGitPath(

          )

        :
          void

getLocation(

          )

        :
          void

getMove(

          )

        :
          void

getNewBranch(

          )

        :
          void

getNoTrack(

          )

        :
          void

getOwningTarget(

          )

        :
          void

getProject(

          )

        :
          void

getRegisterSlot(

          )

        :
          void

getRepository(

          )

        :
          void

getRuntimeConfigurableWrapper(

          )

        :
          void

getSetUpstream(

          )

        :
          void

getStartPoint(

          )

        :
          void

getTaskName(

          )

        :
          void

getTaskType(

          )

        :
          void

getTrack(

          )

        :
          void

init(

          )

        :
          void

isDelete(

          )

        :
          void

isForce(

          )

        :
          void

isForceMove(

          )

        :
          void

isMove(

          )

        :
          void

isNoTrack(

          )

        :
          void

isSetUpstream(

          )

        :
          void

isTrack(

          )

        :
          void

log(

          )

        :
          void

main(

          )

        :
          void

The main entry point for the task

maybeConfigure(

          )

        :
          void

perform(

          )

        :
          void

setBranchname(
           $branchname
          )

        :
          void

Parameters

Name
Type
Description

$branchname

setDelete(
           $flag
          )

        :
          void

Parameters

Name
Type
Description

$flag

setDescription(

          )

        :
          void

setForce(
           $flag
          )

        :
          void

Parameters

Name
Type
Description

$flag

setForceDelete(
           $flag
          )

        :
          void

Parameters

Name
Type
Description

$flag

setForceMove(
           $flag
          )

        :
          void

Parameters

Name
Type
Description

$flag

setGitPath(

          )

        :
          void

setLocation(

          )

        :
          void

setMove(
           $flag
          )

        :
          void

Parameters

Name
Type
Description

$flag

setNewBranch(
           $name
          )

        :
          void

Parameters

Name
Type
Description

$name

setNoTrack(
           $flag
          )

        :
          void

Parameters

Name
Type
Description

$flag

setOwningTarget(

          )

        :
          void

setProject(

          )

        :
          void

setRepository(

          )

        :
          void

setRuntimeConfigurableWrapper(

          )

        :
          void

setSetUpstream(
           $flag
          )

        :
          void

Parameters

Name
Type
Description

$flag

setStartPoint(
           $startPoint
          )

        :
          void

Parameters

Name
Type
Description

$startPoint

setTaskName(

          )

        :
          void

setTaskType(

          )

        :
          void

setTrack(
           $flag
          )

        :
          void

Parameters

Name
Type
Description

$flag

Documentation was generated by DocBlox 0.17.1.


text:
using ConsoleForum.Contracts;

namespace ConsoleForum.Entities.Posts
{
    class BestAnswer : Answer
    {
        public BestAnswer(int id, string body, IUser author)
            : base(id, body, author)
        {
        }
    }

}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>MagickCore: _ChannelStatistics Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

MagickCore
    7.0.0

Data Fields

_ChannelStatistics Struct Reference

#include <statistic.h>

Data Fields

size_t 	depth

double 	area

double 	minima

double 	maxima

double 	sum

double 	sum_squared

double 	sum_cubed

double 	sum_fourth_power

double 	mean

double 	variance

double 	standard_deviation

double 	kurtosis

double 	skewness

Detailed Description

Definition at line 25 of file statistic.h.

Field Documentation

          double _ChannelStatistics::area

Definition at line 31 of file statistic.h.

Referenced by GetImageStatistics().

          size_t _ChannelStatistics::depth

Definition at line 28 of file statistic.h.

Referenced by GetImageStatistics(), and IdentifyImage().

          double _ChannelStatistics::kurtosis

Definition at line 31 of file statistic.h.

Referenced by GetImageStatistics().

          double _ChannelStatistics::maxima

Definition at line 31 of file statistic.h.

Referenced by GetImageStatistics().

          double _ChannelStatistics::mean

Definition at line 31 of file statistic.h.

Referenced by GetImageMean(), GetImageStatistics(), and GetNormalizedCrossCorrelationDistortion().

          double _ChannelStatistics::minima

Definition at line 31 of file statistic.h.

Referenced by GetImageStatistics().

          double _ChannelStatistics::skewness

Definition at line 31 of file statistic.h.

Referenced by GetImageStatistics().

          double _ChannelStatistics::standard_deviation

Definition at line 31 of file statistic.h.

Referenced by GetImageMean(), GetImageStatistics(), and GetNormalizedCrossCorrelationDistortion().

          double _ChannelStatistics::sum

Definition at line 31 of file statistic.h.

Referenced by GetImageStatistics().

          double _ChannelStatistics::sum_cubed

Definition at line 31 of file statistic.h.

Referenced by GetImageStatistics().

          double _ChannelStatistics::sum_fourth_power

Definition at line 31 of file statistic.h.

Referenced by GetImageStatistics().

          double _ChannelStatistics::sum_squared

Definition at line 31 of file statistic.h.

Referenced by GetImageStatistics().

          double _ChannelStatistics::variance

Definition at line 31 of file statistic.h.

Referenced by GetImageMean(), and GetImageStatistics().

The documentation for this struct was generated from the following file:

statistic.h

_ChannelStatistics

Generated by

     1.8.3.1


text:
Make sure:
* you have access to the subscription that has publishing this extension.
* you have a subscription management certificate in `.pem` format for that.
* you installed `azure-extensions-cli` (and it `list-versions` command works)

### 1. Build and pack

Make the code changes and run `make bundle`.

This will compile and create the extension handler zip package to `bundle/` directory.

### 2. Upload the package

Extension follows the semantic versioning [MAJOR].[MINOR].[PATCH]. The MAJOR/MINOR
are stored in the `Makefile` and PATCH is the build date of the bundle in `yymmddHHMM`
format.

* **Bump `MAJOR` if**: you are introducing breaking changes in the config schema
* **Bump `MINOR` if**: you are adding new features (no need for hotfixes or minor nits)

Run `metadata/make-manifest.sh` and save the XML output to a file (will be used later
in publishing). Give it the version number.

### 3. Publish new version

Publishing takes 3 steps and you will use the `azure-extensions-cli` program.

#### 3.1. Publish to Slice 1

"Slice 1" means you publish the extension internally only to your own publisher subscription:

    export SUBSCRIPTION_ID=[...]
    export SUBSCRIPTION_CERT=[...].pem
    azure-extensions-cli --manifest [path-to-manifest]

Then check its replication status using:

    azure-extensions-cli replication-status --namespace Microsoft.Azure.Extensions \
        --name DockerExtension --version <VERSION>

or `azure-extensions-cli list-versions` command.

Based on the load on PIR it may take from 10 minutes to 10 hours to replicate.

#### 3.2. Integration Tests

After the extension is listed as replicated, you can run integration tests to deploy the extension
to some images and test it is actually working.

For that, make sure you have install `azure` xplat CLI installed and `azure login` is completed.

Then run:

    ./integration-test/test.sh

The tests will:

1. Create test VMs with various distro images in test subscription.
2. Add extension to the VMs with a config that exercises the features.
3. Verify the correct version of the extension is landed to VMs.
4. Verify connectivity to docker-engine with TLS certs.
5. Verify other configuration is taking effect (containers are created etc.)
6. Tear down the test VMs.

If the test gets stuck in a verification step and keeps printing `...`s for more than 5 minutes,
it is very likely something is going badly. You can ssh into the VM (command is printed in the test
output) and see what is going on.

(If you want to delete the buggy version, use `azure-extensions-cli delete-version` at this step.)

#### 3.3. Publish to Slice 2

"Slice 2" means you publish the extension publicly to one Azure PROD region:

    azure-extensions-cli promote-single-region --region-1 'Brazil South' --manifest <FILE>

and then you can use `azure-extensions-cli replication-status` to see it completed.

#### 3.4. Publish to Slice 3

Same as "Slice 2", but publishes to **two** Azure PROD regions.

    azure-extensions-cli promote-two-regions --region-1 'Brazil South' --region-2 'Southeast Asia' \
        --manifest <FILE>

#### 3.5. Publish to Slice 4

This step publishes the VM extension to **all Azure PROD regions** (be careful).

    azure-extensions-cli promote-all-regions --manifest <FILE>

Wait for it to be completed using `azure-extensions-cli replication-status` command and
once completed, run `azure vm extension list --json` command from a subscription that is not a publisher
subscription to verify if the new version is available (not applicable for hotfixes).

### 4. Take a code snapshot

Once the version is successful and works in Production:

1. Document the changes in README.md "Changelog" section
2. Commit the changes to your own fork
3. End a pull request to Azure repo
4. Create a tag with the version number you published e.g.:

    git tag 1.0.1506041803
    git push --tags

This will create a snapshot of the code in "releases" section of the GitHub repository.


text:
package io.digdag.cli.client;

import com.beust.jcommander.Parameter;
import com.google.common.base.Optional;
import io.digdag.cli.SystemExitException;
import io.digdag.cli.TimeUtil;
import io.digdag.client.DigdagClient;
import io.digdag.client.api.Id;
import io.digdag.client.api.RestProject;
import io.digdag.client.api.RestSchedule;
import io.digdag.client.api.RestScheduleSummary;

import java.time.Instant;

import static io.digdag.cli.SystemExitException.systemExit;
import static io.digdag.cli.TimeUtil.formatTimeWithDiff;

public class Reschedule
    extends ClientCommand
{
    @Parameter(names = {"-s", "--skip"})
    int skipCount = 0;

    @Parameter(names = {"-t", "--skip-to"})
    String toTime = null;

    @Parameter(names = {"-a", "--run-at"})
    String runAtTime = null;

    @Parameter(names = {"-d", "--dry-run"})
    boolean dryRun = false;

    @Override
    public void mainWithClientException()
        throws Exception
    {
        if (toTime != null && skipCount > 0) {
            throw systemExit("-s and -t can't be set together");
        }
        else if (toTime == null && skipCount <= 0) {
            throw usage("-s or -t is required");
        }

        // Schedule id?
        if (args.size() == 1) {
            Id schedId = parseScheduleId(args.get(0));
            rescheduleScheduleId(schedId);
        }
        else if (args.size() == 2) {
            // Single workflow
            rescheduleWorkflow(args.get(0), args.get(1));
        }
        else {
            throw usage(null);
        }
    }

    public SystemExitException usage(String error)
    {
        err.println("Usage: " + programName + " reschedule <schedule-id> | <project-name> <name>");
        err.println("  Options:");
        err.println("    -s, --skip N                     skips specified number of schedules from now");
        err.println("    -t, --skip-to 'yyyy-MM-dd HH:mm:ss Z' | 'now'");
        err.println("                                     skips schedules until the specified time (exclusive)");
        err.println("    -a, --run-at 'yyyy-MM-dd HH:mm:ss Z'");
        err.println("                                     set next run time to this time");
        err.println("    -d, --dry-run                    tries to reschedule and validates the results but does nothing");
        showCommonOptions();
        return systemExit(error);
    }

    private Id parseScheduleId(String s)
            throws SystemExitException
    {
        try {
            return Id.of(Integer.toString(Integer.parseUnsignedInt(s)));
        }
        catch (NumberFormatException ignore) {
            throw usage(null);
        }
    }

    private void rescheduleWorkflow(String projectName, String workflowName)
            throws Exception
    {
        DigdagClient client = buildClient();
        RestProject project = client.getProject(projectName);
        RestSchedule schedule = client.getSchedule(project.getId(), workflowName);
        Instant now = Instant.now();
        reschedule(schedule.getId(), client, now);
    }

    private void rescheduleScheduleId(Id schedId)
        throws Exception
    {
        DigdagClient client = buildClient();
        Instant now = Instant.now();
        reschedule(schedId, client, now);
    }

    private void reschedule(Id schedId, DigdagClient client, Instant now)
        throws Exception
    {
        Optional<Instant> runAt = runAtTime == null ? Optional.absent() : Optional.of(
                TimeUtil.parseTime(runAtTime, "-a, --run-at")
                );

        RestScheduleSummary updated;
        if (toTime != null) {
            Instant time = "now".equals(toTime) ?
                now :
                TimeUtil.parseTime(toTime, "-t, --skip-to");
            updated = client.skipSchedulesToTime(schedId,
                    time,
                    runAt,
                    dryRun);
        }
        else {
            updated = client.skipSchedulesByCount(schedId,
                    now, skipCount,
                    runAt,
                    dryRun);
        }

        ln("  id: %s", updated.getId());
        ln("  workflow: %s", updated.getWorkflow().getName());
        ln("  disabled at: " + updated.getDisabledAt().transform(ts -> formatTimeWithDiff(now, ts)).or(""));
        ln("  next session time: %s", TimeUtil.formatTime(updated.getNextScheduleTime()));
        ln("  next scheduled to run at: %s", TimeUtil.formatTimeWithDiff(now, updated.getNextRunTime()));
        ln("");

        if (dryRun) {
            err.println("Schedule is not updated.");
        }
        else {
            err.println("Use `" + programName + " schedules` to show schedules.");
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.shawn.repository.mybatis.BookStoreMapper">

    <resultMap id="bookStore" type="BookStore">
        <id property="id" column="id"/>
        <result property="name" column="name"/>
        <result property="address" column="address"/>
    </resultMap>

    <resultMap id="bookStoreWithBooks" type="bookStoreWithBooks">
        <id property="id" column="id"/>
        <result property="name" column="name"/>
        <result property="address" column="address"/>
        <collection property="books" ofType="Book" resultMap="com.shawn.repository.mybatis.BookMapper.book" columnPrefix="book_"/>
    </resultMap>

    <select id="selectBookStoreById" resultMap="bookStore">
        SELECT
          *
        FROM
          book_store
        WHERE
          id = #{id}
    </select>

    <select id="selectAllBookStores" resultMap="bookStore">
        SELECT
          *
        FROM
          book_store
    </select>

    <select id="selectBookStoreWithBooksById" resultMap="bookStoreWithBooks">
        SELECT
          book_store.*,
          book.id AS book_id,
          book.name AS book_name,
          book.author AS book_author,
          book.price AS book_price,
          book.topic AS book_topic,
          book.publish_date as book_publish_date
        FROM
          book_store
        LEFT JOIN
          book ON book_store.id = book.book_store_id
        WHERE
          id = #{id}
    </select>

</mapper>


text:
import csv
import os
from myuw.dao.gws import is_grad_student
from myuw.dao.enrollment import enrollment_history
from myuw.dao.term import get_comparison_datetime

DEGREE_TYPE_COLUMN_MAP = {"major": 2,
                          "minor": 3,
                          "gradmajor": 4}
CALENDAR_ID_COL = 5
CALENDAR_URL_COL = 6

def get_calendars_for_current_user(request):
    return _get_calendars(request, _get_major_minors(request))

def _get_major_minors(request):
    """
    Collect majors and minors of current and future quarter enrollments
    for current students.
    Return those of their last quarter's for former students.
    """
    majors = []
    minors = []
    result = {'majors': majors, 'minors': minors}
    enrollment_list = enrollment_history(request)
    now = get_comparison_datetime(request)

    for enrollment in reversed(enrollment_list):
        if enrollment.term.is_past(now):
            if len(majors) == 0:
                # no current or future enrollment
                _collect(majors, minors, enrollment)
            return result
        elif enrollment.term.is_current(now):
            _collect(majors, minors, enrollment)
            if len(majors) or len(minors):
                return result
        else:
            _collect(majors, minors, enrollment)
    return result

def _collect(majors, minors, enrollment):
    """
    Collect unique major names and minor short names
    """
    for major in enrollment.majors:
        majr = major.major_name
        if majr and majr not in majors:
            majors.append(majr)

    for minor in enrollment.minors:
        minr = minor.short_name
        if minr and minr not in minors:
            minors.append(minr)

def _get_calendars(request, enrollments):

    calendars = {}

    calendars.update(get_calendars_for_minors(enrollments['minors']))

    if is_grad_student(request):
        calendars.update(get_calendars_for_gradmajors(enrollments['majors']))
    else:
        calendars.update(get_calendars_for_majors(enrollments['majors']))
    return calendars

def get_calendars_for_majors(majors):
    return _get_calendars_by_name_and_type(majors, 'major')

def get_calendars_for_minors(minors):
    return _get_calendars_by_name_and_type(minors, 'minor')

def get_calendars_for_gradmajors(gradmajors):
    return _get_calendars_by_name_and_type(gradmajors, 'gradmajor')

def _get_calendars_by_name_and_type(major_name, major_type):
    calendars = {}
    degree_column = DEGREE_TYPE_COLUMN_MAP[major_type]

    path = os.path.join(
        os.path.dirname(__file__),
        '..', 'data', 'calendar_major_mapping.csv')
    with open(path, 'r', encoding='utf8') as csvfile:
        reader = csv.reader(csvfile, delimiter=',', quotechar='"')
        for row in reader:
            degree_name = row[degree_column].strip()
            if degree_name in major_name and \
                    len(row[CALENDAR_ID_COL]) > 0:
                base_url = None
                if len(row[CALENDAR_URL_COL]) > 0:
                    base_url = row[CALENDAR_URL_COL]
                cal_ids = _get_calendar_ids_from_text(row[CALENDAR_ID_COL])
                for cal_id in cal_ids:
                    calendars[cal_id] = base_url
    return calendars

def _get_calendar_ids_from_text(text):
    return text.split(" ")


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

namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models
{
    public partial class StatelessServiceProperties : IUtf8JsonSerializable
    {
        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
        {
            writer.WriteStartObject();
            writer.WritePropertyName("instanceCount");
            writer.WriteNumberValue(InstanceCount);
            if (Optional.IsDefined(MinInstanceCount))
            {
                writer.WritePropertyName("minInstanceCount");
                writer.WriteNumberValue(MinInstanceCount.Value);
            }
            if (Optional.IsDefined(MinInstancePercentage))
            {
                writer.WritePropertyName("minInstancePercentage");
                writer.WriteNumberValue(MinInstancePercentage.Value);
            }
            writer.WritePropertyName("serviceKind");
            writer.WriteStringValue(ServiceKind.ToString());
            writer.WritePropertyName("serviceTypeName");
            writer.WriteStringValue(ServiceTypeName);
            writer.WritePropertyName("partitionDescription");
            writer.WriteObjectValue(PartitionDescription);
            if (Optional.IsDefined(ServicePackageActivationMode))
            {
                writer.WritePropertyName("servicePackageActivationMode");
                writer.WriteStringValue(ServicePackageActivationMode.Value.ToString());
            }
            if (Optional.IsDefined(PlacementConstraints))
            {
                writer.WritePropertyName("placementConstraints");
                writer.WriteStringValue(PlacementConstraints);
            }
            if (Optional.IsCollectionDefined(CorrelationScheme))
            {
                writer.WritePropertyName("correlationScheme");
                writer.WriteStartArray();
                foreach (var item in CorrelationScheme)
                {
                    writer.WriteObjectValue(item);
                }
                writer.WriteEndArray();
            }
            if (Optional.IsCollectionDefined(ServiceLoadMetrics))
            {
                writer.WritePropertyName("serviceLoadMetrics");
                writer.WriteStartArray();
                foreach (var item in ServiceLoadMetrics)
                {
                    writer.WriteObjectValue(item);
                }
                writer.WriteEndArray();
            }
            if (Optional.IsCollectionDefined(ServicePlacementPolicies))
            {
                writer.WritePropertyName("servicePlacementPolicies");
                writer.WriteStartArray();
                foreach (var item in ServicePlacementPolicies)
                {
                    writer.WriteObjectValue(item);
                }
                writer.WriteEndArray();
            }
            if (Optional.IsDefined(DefaultMoveCost))
            {
                writer.WritePropertyName("defaultMoveCost");
                writer.WriteStringValue(DefaultMoveCost.Value.ToString());
            }
            if (Optional.IsCollectionDefined(ScalingPolicies))
            {
                writer.WritePropertyName("scalingPolicies");
                writer.WriteStartArray();
                foreach (var item in ScalingPolicies)
                {
                    writer.WriteObjectValue(item);
                }
                writer.WriteEndArray();
            }
            writer.WriteEndObject();
        }

        internal static StatelessServiceProperties DeserializeStatelessServiceProperties(JsonElement element)
        {
            int instanceCount = default;
            Optional<int> minInstanceCount = default;
            Optional<int> minInstancePercentage = default;
            Optional<string> provisioningState = default;
            ServiceKind serviceKind = default;
            string serviceTypeName = default;
            ManagedServicePartitionScheme partitionDescription = default;
            Optional<ManagedServicePackageActivationMode> servicePackageActivationMode = default;
            Optional<string> placementConstraints = default;
            Optional<IList<ManagedServiceCorrelation>> correlationScheme = default;
            Optional<IList<ManagedServiceLoadMetric>> serviceLoadMetrics = default;
            Optional<IList<ManagedServicePlacementPolicy>> servicePlacementPolicies = default;
            Optional<ServiceFabricManagedServiceMoveCost> defaultMoveCost = default;
            Optional<IList<ManagedServiceScalingPolicy>> scalingPolicies = default;
            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("instanceCount"))
                {
                    instanceCount = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("minInstanceCount"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    minInstanceCount = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("minInstancePercentage"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    minInstancePercentage = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("provisioningState"))
                {
                    provisioningState = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("serviceKind"))
                {
                    serviceKind = new ServiceKind(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("serviceTypeName"))
                {
                    serviceTypeName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("partitionDescription"))
                {
                    partitionDescription = ManagedServicePartitionScheme.DeserializeManagedServicePartitionScheme(property.Value);
                    continue;
                }
                if (property.NameEquals("servicePackageActivationMode"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    servicePackageActivationMode = new ManagedServicePackageActivationMode(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("placementConstraints"))
                {
                    placementConstraints = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("correlationScheme"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List<ManagedServiceCorrelation> array = new List<ManagedServiceCorrelation>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(ManagedServiceCorrelation.DeserializeManagedServiceCorrelation(item));
                    }
                    correlationScheme = array;
                    continue;
                }
                if (property.NameEquals("serviceLoadMetrics"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List<ManagedServiceLoadMetric> array = new List<ManagedServiceLoadMetric>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(ManagedServiceLoadMetric.DeserializeManagedServiceLoadMetric(item));
                    }
                    serviceLoadMetrics = array;
                    continue;
                }
                if (property.NameEquals("servicePlacementPolicies"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List<ManagedServicePlacementPolicy> array = new List<ManagedServicePlacementPolicy>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(ManagedServicePlacementPolicy.DeserializeManagedServicePlacementPolicy(item));
                    }
                    servicePlacementPolicies = array;
                    continue;
                }
                if (property.NameEquals("defaultMoveCost"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    defaultMoveCost = new ServiceFabricManagedServiceMoveCost(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("scalingPolicies"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List<ManagedServiceScalingPolicy> array = new List<ManagedServiceScalingPolicy>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(ManagedServiceScalingPolicy.DeserializeManagedServiceScalingPolicy(item));
                    }
                    scalingPolicies = array;
                    continue;
                }
            }
            return new StatelessServiceProperties(placementConstraints.Value, Optional.ToList(correlationScheme), Optional.ToList(serviceLoadMetrics), Optional.ToList(servicePlacementPolicies), Optional.ToNullable(defaultMoveCost), Optional.ToList(scalingPolicies), provisioningState.Value, serviceKind, serviceTypeName, partitionDescription, Optional.ToNullable(servicePackageActivationMode), instanceCount, Optional.ToNullable(minInstanceCount), Optional.ToNullable(minInstancePercentage));
        }
    }
}


text:
package org.fujion.plotly.common;

/**
 * Vertical alignment types.
 */
public enum VerticalAlignEnum {

    AUTO, TOP, MIDDLE, BOTTOM;

    @Override
    public String toString() {
        return name().toLowerCase();
    }
}


text:
package net.sf.javaml.distance.fastdtw.dtw;

/**
 *
 * @author Thomas Abeel
 * @author Stan Salvador, stansalvador@hotmail.com
 *
 */
class WindowMatrix implements CostMatrix {

    WindowMatrix(SearchWindow searchWindow) {
        try {
            windowCells = new MemoryResidentMatrix(searchWindow);
        } catch (OutOfMemoryError e) {
            System.err
                    .println("Ran out of memory initializing window matrix, all cells in the window cannot fit into main memory.  Will use a swap file instead (will run ~50% slower)");
            System.gc();
            windowCells = new SwapFileMatrix(searchWindow);
        }
    }

    public void put(int col, int row, double value) {
        windowCells.put(col, row, value);
    }

    public double get(int col, int row) {
        return windowCells.get(col, row);
    }

    public int size() {
        return windowCells.size();
    }

    public void freeMem() {
        if (windowCells instanceof SwapFileMatrix)
            try {
                ((SwapFileMatrix) windowCells).freeMem();
            } catch (Throwable t) {
            }
    }

    private CostMatrix windowCells;
}


text:
interface Base {
    readonly value: number;
}
interface Identical {
    readonly value: number;
}
interface Mutable {
    value: number;
}
interface DifferentType {
    readonly value: string;
}
interface DifferentName {
    readonly other: number;
}
let base: Base;
base.value = 12 // error, lhs can't be a readonly property
let identical: Base | Identical;
identical.value = 12; // error, lhs can't be a readonly property
let mutable: Base | Mutable;
mutable.value = 12; // error, lhs can't be a readonly property
let differentType: Base | DifferentType;
differentType.value = 12; // error, lhs can't be a readonly property
let differentName: Base | DifferentName;
differentName.value = 12; // error, property 'value' doesn't exist

//// [unionTypeReadonly.js]
var base;
base.value = 12; // error, lhs can't be a readonly property
var identical;
identical.value = 12; // error, lhs can't be a readonly property
var mutable;
mutable.value = 12; // error, lhs can't be a readonly property
var differentType;
differentType.value = 12; // error, lhs can't be a readonly property
var differentName;
differentName.value = 12; // error, property 'value' doesn't exist


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.
 */
/*
 * This code was generated by https://github.com/google/apis-client-generator/
 * (build: 2022-10-26 23:10:20 UTC)
 * on 2022-10-26 at 23:10:36 UTC
 * Modify at your own risk.
 */

package com.google.api.services.businesscommunications.v1.model;

/**
 * Request to begin business information verification for a location.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Business Communications. For a detailed explanation
 * see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class RequestLocationVerificationRequest extends com.google.api.client.json.GenericJson {

  @Override
  public RequestLocationVerificationRequest set(String fieldName, Object value) {
    return (RequestLocationVerificationRequest) super.set(fieldName, value);
  }

  @Override
  public RequestLocationVerificationRequest clone() {
    return (RequestLocationVerificationRequest) super.clone();
  }

}


text:
package main

import (
	"flag"
	"fmt"
	"io"
	"log"
	"net"
	"os"
	"strings"
	"time"

	"github.com/artyom/autoflags"
)

func main() {
	config := struct {
		Timeout time.Duration `flag:"t,connect timeout"`
		Verbose bool          `flag:"v,be verbose on errors"`
		Redirs  redirections  `flag:"r,redirection to serve: bind_host:port/to_host:port (multiple -r params can be used)"`
	}{
		Timeout: 5 * time.Second,
	}
	autoflags.Parse(&config)
	if len(config.Redirs) == 0 {
		flag.Usage()
		os.Exit(1)
	}
	for _, r := range config.Redirs {
		go serve(r, config.Verbose, config.Timeout)
	}
	select {}
}

func serve(r redir, verbose bool, timeout time.Duration) {
	ln, err := net.Listen("tcp", r.From)
	if err != nil {
		log.Fatal(err)
	}
	defer ln.Close()
	for {
		conn, err := ln.Accept()
		if err != nil {
			log.Fatal(err)
		}
		go handleConn(conn, r.To, verbose, timeout)
	}
}

func handleConn(conn net.Conn, addr string, verbose bool, timeout time.Duration) {
	defer conn.Close()
	remote, err := net.DialTimeout("tcp", addr, timeout)
	if err != nil {
		if verbose {
			log.Print(err)
		}
		return
	}
	defer remote.Close()
	go io.Copy(conn, remote)
	io.Copy(remote, conn)
}

type redir struct {
	From string
	To   string
}

type redirections []redir

func (r *redirections) String() string { return "" }
func (r *redirections) Set(value string) error {
	p := strings.SplitN(value, "/", 2)
	if len(p) != 2 {
		return fmt.Errorf("invalid parameter, should be in form: bind_host:port,to_host:port")
	}
	*r = append(*r, redir{From: p[0], To: p[1]})
	return nil
}


text:
package org.metaborg.spoofax.core.stratego.primitive.renaming;

import java.util.Set;

import org.metaborg.spoofax.core.stratego.primitive.generic.GenericPrimitiveLibrary;
import org.spoofax.interpreter.library.AbstractPrimitive;

import com.google.inject.Inject;
import com.google.inject.name.Named;

public class RenamingLibrary extends GenericPrimitiveLibrary {
    public static final String name = "RenamingLibrary";
    public static final String REGISTRY_NAME = "RENAMING";

    @Inject public RenamingLibrary(@Named(name) Set<AbstractPrimitive> primitives) {
        super(primitives, RenamingLibrary.REGISTRY_NAME);
    }

}


text:
package org.lockss.test;

public abstract class TimingReporterImpl implements TimingReporter {
  protected long m_timeStart = -1;
  protected long m_count = 0;
  protected long m_sumTime = 0;
  protected long m_sumTimeSquared = 0;

  public void startTimer() {
    m_timeStart = System.currentTimeMillis();
  }

  public void stopTimer() {
    long timeEnd = System.currentTimeMillis();
    long delta = timeEnd - m_timeStart;

    // Increment all counters.
    m_count++;
    m_sumTime += delta;
    m_sumTimeSquared += delta * delta;
  }

  // The average for the time recorded.
  protected double averageTime() {
    return (double) m_sumTime / (double) m_count;
  }

  // The standard deviation for the time recorded.
  protected double stddevTime() {
    return Math.sqrt((m_sumTimeSquared - (m_sumTime * m_sumTime / m_count)) / (m_count - 1));
  }
}


text:
This intention calculates the value of a compile
time constant sub-expression, and replaces it with an equivalent literal expression.
It's intended for cases where you don't wish to replace an entire constant expression,
just a portion of it

Powered by JavaScript IntentionPowerPack


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Revis. gen. pl. (Leipzig) 3: 472 (1898)

#### Original name
Engizostoma passerinii Kuntze

### Remarks
null


text:
(function(Application, Window, Utils, VFS, API, GUI) {
  'use strict';

  window.OSjs       = window.OSjs       || {};
  OSjs.Helpers      = OSjs.Helpers      || {};

  /////////////////////////////////////////////////////////////////////////////
  // Default Application Window Helper
  /////////////////////////////////////////////////////////////////////////////

  /**
   * This is a helper to more easily create an application.
   *
   * Use in combination with 'DefaultApplication'
   *
   * @see OSjs.Helpers.DefaultApplication
   * @api OSjs.Helpers.DefaultApplicationWindow
   *
   * @class
   */
  function DefaultApplicationWindow(name, app, args, scheme, file) {
    Window.apply(this, arguments);

    this.hasClosingDialog = false;
    this.currentFile = file ? new VFS.File(file) : null;
    this.hasChanged = false;
  }

  DefaultApplicationWindow.prototype = Object.create(Window.prototype);
  DefaultApplicationWindow.constructor = Window;

  /**
   * Destroy
   */
  DefaultApplicationWindow.prototype.destroy = function() {
    Window.prototype.destroy.apply(this, arguments);

    this.currentFile = null;
  };

  /**
   * Initialize
   */
  DefaultApplicationWindow.prototype.init = function(wm, app, scheme) {
    var root = Window.prototype.init.apply(this, arguments);
    return root;
  };

  /**
   * Applies default Window GUI stuff
   */
  DefaultApplicationWindow.prototype._inited = function() {
    var result = Window.prototype._inited.apply(this, arguments);
    var self = this;
    var app = this._app;

    var menuMap = {
      MenuNew:    function() { app.newDialog(self.currentFile, self); },
      MenuSave:   function() { app.saveDialog(self.currentFile, self); },
      MenuSaveAs: function() { app.saveDialog(self.currentFile, self, true); },
      MenuOpen:   function() { app.openDialog(self.currentFile, self); },
      MenuClose:  function() { self._close(); }
    };

    this._scheme.find(this, 'SubmenuFile').on('select', function(ev) {
      if ( menuMap[ev.detail.id] ) { menuMap[ev.detail.id](); }
    });

    this._scheme.find(this, 'MenuSave').set('disabled', true);

    // Load given file
    if ( this.currentFile ) {
      if ( !this._app.openFile(this.currentFile, this) ) {
        this.currentFile = null;
      }
    }

    return result;
  };

  /**
   * On Drag-And-Drop Event
   */
  DefaultApplicationWindow.prototype._onDndEvent = function(ev, type, item, args) {
    if ( !Window.prototype._onDndEvent.apply(this, arguments) ) { return; }

    if ( type === 'itemDrop' && item ) {
      var data = item.data;
      if ( data && data.type === 'file' && data.mime ) {
        this._app.openFile(new VFS.File(data), this);
      }
    }
  };

  /**
   * On Close
   */
  DefaultApplicationWindow.prototype._close = function() {
    var self = this;
    if ( this.hasClosingDialog ) {
      return;
    }

    if ( this.hasChanged ) {
      this.hasClosingDialog = true;
      this.checkHasChanged(function(discard) {
        self.hasClosingDialog = false;
        if ( discard ) {
          self.hasChanged = false; // IMPORTANT
          self._close();
        }
      });
      return;
    }

    Window.prototype._close.apply(this, arguments);
  };

  /**
   * Checks if current file has changed
   *
   * @param   Function      cb        Callback => fn(discard_changes)
   *
   * @return  void
   *
   * @method  DefaultApplicationWindow::checkHasChanged()
   */
  DefaultApplicationWindow.prototype.checkHasChanged = function(cb) {
    var self = this;

    if ( this.hasChanged ) {
      this._toggleDisabled(true);

      API.createDialog('Confirm', {
        buttons: ['yes', 'no'],
        message: API._('MSG_GENERIC_APP_DISCARD')
      }, function(ev, button) {
        self._toggleDisabled(false);
        cb(button === 'ok' || button === 'yes');
      });
      return;
    }

    cb(true);
  };

  /**
   * Show opened/created file
   *
   * @param   OSjs.VFS.File       file        File
   * @param   Mixed               content     File contents
   *
   * YOU SHOULD EXTEND THIS METHOD IN YOUR WINDOW TO ACTUALLY DISPLAY CONTENT
   *
   * @return  void
   *
   * @method  DefaultApplicationWindow::showFile()
   */
  DefaultApplicationWindow.prototype.showFile = function(file, content) {
    this.updateFile(file);
  };

  /**
   * Updates current view for given File
   *
   * @param   OSjs.VFS.File       file        File
   *
   * @return  void
   *
   * @method  DefaultApplicationWindow::updateFile()
   */
  DefaultApplicationWindow.prototype.updateFile = function(file) {
    this.currentFile = file || null;
    this.hasChanged = false;

    if ( this._scheme && (this._scheme instanceof GUI.Scheme) ) {
      this._scheme.find(this, 'MenuSave').set('disabled', !file);
    }

    if ( file ) {
      this._setTitle(file.filename, true);
    } else {
      this._setTitle();
    }
  };

  /**
   * Gets file data
   *
   * YOU SHOULD IMPLEMENT THIS METHOD IN YOUR WINDOW TO RETURN FILE CONTENTS
   *
   * @return  Mixed File contents
   *
   * @method  DefaultApplicationWindow::getFileData()
   */
  DefaultApplicationWindow.prototype.getFileData = function() {
    return null;
  };

  /////////////////////////////////////////////////////////////////////////////
  // EXPORTS
  /////////////////////////////////////////////////////////////////////////////

  OSjs.Helpers.DefaultApplicationWindow = DefaultApplicationWindow;

})(OSjs.Core.Application, OSjs.Core.Window, OSjs.Utils, OSjs.VFS, OSjs.API, OSjs.GUI);


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (c) 2015 [1076559197@qq.com | tchen0707@gmail.com]
  ~
  ~ 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.
  -->

<resources>
    <!-- youku dialog -->
    <dimen name="yp_youku_dialog_width">552dp</dimen>
    <dimen name="yp_youku_dialog_height">295dp</dimen>
    <dimen name="yp_youku_dialog_bottom_height">93dp</dimen>
    <dimen name="yp_youku_dialog_txt_cancel_textsize">30dp</dimen>
    <dimen name="yp_edittext_add_txt_linespacingextra">5dp</dimen>
    <dimen name="yp_normal_content_textsize">36dp</dimen>

    <!-- youku investigate ad -->
    <dimen name="yp_investigate_height">65dp</dimen>
    <dimen name="yp_investigate_close_width">74dp</dimen>
    <dimen name="yp_investigate_text_container_width">96dp</dimen>
    <dimen name="yp_investigate_text_margin_left">17dp</dimen>
    <dimen name="yp_investigate_text_size">24dp</dimen>
    <dimen name="yp_investigate_arrowright_width">52dp</dimen>
    <dimen name="yp_investigate_margin_bottom">172dp</dimen>

        <dimen name="paytip_full_width">383dp</dimen>
    <dimen name="paytip_full_height">109dp</dimen>
    <dimen name="paytip_close_width">74dp</dimen>
    <dimen name="paytip_close_height">65dp</dimen>
    <dimen name="paytip_close_margin">17dp</dimen>
    <dimen name="paytip_full_tip_width">240dp</dimen>
    <dimen name="paytip_full_arrow_width">52dp</dimen>
    <dimen name="paytip_full_textsize">20dp</dimen>
    <dimen name="paytip_small_textsize">24dp</dimen>
    <dimen name="paytip_full_margin_bottom">172dp</dimen>
    <dimen name="paytip_small_tip_width">96dp</dimen>
    <dimen name="paytip_small_margin_bottom">96dp</dimen>

    <!-- 播放广告 youku -->
    <dimen name="player_ad_count_text_size_youku">24dp</dimen>
    <dimen name="player_ad_text_height_youku">65dp</dimen>
    <dimen name="player_ad_skip_width_youku">145dp</dimen>
    <dimen name="player_ad_more_width_youku">150dp</dimen>
    <dimen name="player_ad_go_full_width_youku">70dp</dimen>
    <dimen name="player_ad_more_padding_youku">2dp</dimen>
</resources>


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:id="@+id/ll__place_schedule"
  style="@style/PlacePageItemFrame"
  android:tag="schedule"
  tools:visibility="visible">
  <ImageView
    android:id="@+id/iv__place_schedule"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginRight="@dimen/margin_base"
    android:src="@drawable/ic_operating_hours"
    android:tint="?iconTint"/>

  <TextView
    android:id="@+id/tv__place_schedule"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:textAppearance="@style/MwmTextAppearance.PlacePage"
    tools:text="Today 16:00-18.00"/>
</LinearLayout>


text:
#include <linux/kernel.h>
#include <linux/kernel_stat.h>
#include <linux/kprobes.h>
#include <linux/notifier.h>
#include <linux/init.h>
#include <linux/cpu.h>
#include <asm/cputime.h>
#include <asm/nmi.h>
#include <asm/smp.h>
#include "entry.h"

static DEFINE_PER_CPU(struct s390_idle_data, s390_idle);

void enabled_wait(void)
{
	struct s390_idle_data *idle = this_cpu_ptr(&s390_idle);
	unsigned long long idle_time;
	unsigned long psw_mask;

	trace_hardirqs_on();

	/* Wait for external, I/O or machine check interrupt. */
	psw_mask = PSW_KERNEL_BITS | PSW_MASK_WAIT | PSW_MASK_DAT |
		PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK;
	clear_cpu_flag(CIF_NOHZ_DELAY);

	/* Call the assembler magic in entry.S */
	psw_idle(idle, psw_mask);

	trace_hardirqs_off();

	/* Account time spent with enabled wait psw loaded as idle time. */
	write_seqcount_begin(&idle->seqcount);
	idle_time = idle->clock_idle_exit - idle->clock_idle_enter;
	idle->clock_idle_enter = idle->clock_idle_exit = 0ULL;
	idle->idle_time += idle_time;
	idle->idle_count++;
	account_idle_time(idle_time);
	write_seqcount_end(&idle->seqcount);
}
NOKPROBE_SYMBOL(enabled_wait);

static ssize_t show_idle_count(struct device *dev,
				struct device_attribute *attr, char *buf)
{
	struct s390_idle_data *idle = &per_cpu(s390_idle, dev->id);
	unsigned long long idle_count;
	unsigned int seq;

	do {
		seq = read_seqcount_begin(&idle->seqcount);
		idle_count = ACCESS_ONCE(idle->idle_count);
		if (ACCESS_ONCE(idle->clock_idle_enter))
			idle_count++;
	} while (read_seqcount_retry(&idle->seqcount, seq));
	return sprintf(buf, "%llu\n", idle_count);
}
DEVICE_ATTR(idle_count, 0444, show_idle_count, NULL);

static ssize_t show_idle_time(struct device *dev,
				struct device_attribute *attr, char *buf)
{
	struct s390_idle_data *idle = &per_cpu(s390_idle, dev->id);
	unsigned long long now, idle_time, idle_enter, idle_exit;
	unsigned int seq;

	do {
		now = get_tod_clock();
		seq = read_seqcount_begin(&idle->seqcount);
		idle_time = ACCESS_ONCE(idle->idle_time);
		idle_enter = ACCESS_ONCE(idle->clock_idle_enter);
		idle_exit = ACCESS_ONCE(idle->clock_idle_exit);
	} while (read_seqcount_retry(&idle->seqcount, seq));
	idle_time += idle_enter ? ((idle_exit ? : now) - idle_enter) : 0;
	return sprintf(buf, "%llu\n", idle_time >> 12);
}
DEVICE_ATTR(idle_time_us, 0444, show_idle_time, NULL);

cputime64_t arch_cpu_idle_time(int cpu)
{
	struct s390_idle_data *idle = &per_cpu(s390_idle, cpu);
	unsigned long long now, idle_enter, idle_exit;
	unsigned int seq;

	do {
		now = get_tod_clock();
		seq = read_seqcount_begin(&idle->seqcount);
		idle_enter = ACCESS_ONCE(idle->clock_idle_enter);
		idle_exit = ACCESS_ONCE(idle->clock_idle_exit);
	} while (read_seqcount_retry(&idle->seqcount, seq));
	return idle_enter ? ((idle_exit ?: now) - idle_enter) : 0;
}

void arch_cpu_idle_enter(void)
{
	local_mcck_disable();
}

void arch_cpu_idle(void)
{
	if (!test_cpu_flag(CIF_MCCK_PENDING))
		/* Halt the cpu and keep track of cpu time accounting. */
		enabled_wait();
	local_irq_enable();
}

void arch_cpu_idle_exit(void)
{
	local_mcck_enable();
	if (test_cpu_flag(CIF_MCCK_PENDING))
		s390_handle_mcck();
}

void arch_cpu_idle_dead(void)
{
	cpu_die();
}


text:
const log = require('../utils/log');
const wizard = require('../utils/wizard');
const tfvarsUtil = require('../utils/terraformTfvars');

const REQUIRED_ENV_VARS = ['TF_VAR_tectonic_license_path', 'TF_VAR_tectonic_pull_secret_path'];

// Expects an input file <prefix>.progress to exist
const steps = (prefix, expectedOutputFilePath, ignoredKeys) => {
  // Test input cluster config
  const cc = tfvarsUtil.loadJson(`${prefix}.progress`).clusterConfig;

  const testPage = (page, nextInitiallyDisabled) => wizard.testPage(page, 'bare-metal-tf', cc, nextInitiallyDisabled);

  return {
    [`${prefix}: Platform`]: client => {
      const platformPage = client.page.platformPage();
      platformPage.test('@metalGUI');
      platformPage.expect.element(wizard.nextStep).to.have.attribute('class').which.not.contains('disabled');
      platformPage.click(wizard.nextStep);
    },

    [`${prefix}: Cluster Info`]: ({page}) => testPage(page.clusterInfoPage()),
    [`${prefix}: Cluster DNS`]: ({page}) => testPage(page.clusterDnsPage()),
    [`${prefix}: Certificate Authority`]: ({page}) => testPage(page.certificateAuthorityPage(), false),
    [`${prefix}: Matchbox Address`]: ({page}) => testPage(page.matchboxAddressPage()),
    [`${prefix}: Matchbox Credentials`]: ({page}) => testPage(page.matchboxCredentialsPage()),
    [`${prefix}: Define Masters`]: ({page}) => testPage(page.defineMastersPage()),
    [`${prefix}: Define Workers`]: ({page}) => testPage(page.defineWorkersPage()),
    [`${prefix}: Network Configuration`]: ({page}) => testPage(page.networkConfigurationPage(), false),
    [`${prefix}: etcd Connection`]: ({page}) => testPage(page.etcdConnectionPage(), false),
    [`${prefix}: SSH Key`]: ({page}) => testPage(page.sshKeysPage()),
    [`${prefix}: Console Login`]: ({page}) => testPage(page.consoleLoginPage()),

    [`${prefix}: Manual Boot`]: client => tfvarsUtil.testManualBoot(client, expectedOutputFilePath, ignoredKeys),
  };
};

const toExport = {
  before (client) {
    const missing = REQUIRED_ENV_VARS.filter(ev => !process.env[ev]);
    if (missing.length) {
      console.error(`Missing environment variables: ${missing.join(', ')}.\n`);
      process.exit(1);
    }
    client.url(client.launch_url);
  },

  after (client) {
    client.getLog('browser', log.logger);
    client.end();
  },
};

const ignoredKeys = [
  'tectonic_admin_email',
  'tectonic_admin_password',
  'tectonic_license_path',
  'tectonic_pull_secret_path',
  'tectonic_stats_url',
  'tectonic_update_app_id',
  'tectonic_update_channel',
  'tectonic_update_server',
];

module.exports = Object.assign(
  toExport,
  steps('metal', '../output/metal.tfvars'),
  steps('metal-smoke', '../../../../tests/smoke/bare-metal/vars/metal.tfvars.json', ignoredKeys)
);


text:
# ferris-wheel

 [![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [![Ask me anything](https://img.shields.io/badge/ask%20me-anything-1abc9c.svg)](https://github.com/IonicaBizau/ama) [![Version](https://img.shields.io/npm/v/ferris-wheel.svg)](https://www.npmjs.com/package/ferris-wheel) [![Downloads](https://img.shields.io/npm/dt/ferris-wheel.svg)](https://www.npmjs.com/package/ferris-wheel) [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/johnnyb?utm_source=github&utm_medium=button&utm_term=johnnyb&utm_campaign=github)

> An application that simulates a ferris wheel.

## Question

Having a ferris wheel with `n` chairs (from `1` to `n`), `p` persons come

to buy tickets. Each rotation costs 1 euro and on each ticket is written

how many times is the person allowed to rotate.

This application should say:

 - How much will earn the host of the ferris wheel?
 - What's the order of the persons that left the wheel?
 - What's the last chair that was emptied?

## Example

```sh
How many chairs? n = 3
How many persons? p = 2
Rotations:
> c(1) = 10
> c(2) = 3
Sum: 13 euro
Order of persons that left the wheel: 2 1
Last chair that was emptied: 1
```

## :question: Get Help

There are few ways to get help:

 1. Please [post questions on Stack Overflow](https://stackoverflow.com/questions/ask). You can open issues with questions, as long you add a link to your Stack Overflow question.
 2. For bug reports and feature requests, open issues. :bug:
 3. For direct and quick help, you can [use Codementor](https://www.codementor.io/johnnyb). :rocket:

## :yum: How to contribute
Have an idea? Found a bug? See [how to contribute][contributing].

## :sparkling_heart: Support my projects
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously,
this takes time. You can integrate and use these projects in your applications *for free*! You can even change the source code and redistribute (even resell it).

However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:

 - Starring and sharing the projects you like :rocket:
 - [![Buy me a book][badge_amazon]][amazon]—I love books! I will remember you after years if you buy me one. :grin: :book:
 - [![PayPal][badge_paypal]][paypal-donations]—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea:
 - [![Support me on Patreon][badge_patreon]][patreon]—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
 - **Bitcoin**—You can send me bitcoins at this address (or scanning the code below): `1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6`

    ![](https://i.imgur.com/z6OQI95.png)

Thanks! :heart:

## :scroll: License

[MIT][license] © [Ionică Bizău][website]

[license]: /LICENSE
[website]: https://ionicabizau.net
[contributing]: /CONTRIBUTING.md
[docs]: /DOCUMENTATION.md
[badge_patreon]: https://ionicabizau.github.io/badges/patreon.svg
[badge_amazon]: https://ionicabizau.github.io/badges/amazon.svg
[badge_paypal]: https://ionicabizau.github.io/badges/paypal.svg
[badge_paypal_donate]: https://ionicabizau.github.io/badges/paypal_donate.svg
[patreon]: https://www.patreon.com/ionicabizau
[amazon]: http://amzn.eu/hRo9sIZ
[paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RVXDDLKKLQRJW


text:
from pylab import *
import re
import inspect
from pp_utils import *

formatter = matplotlib.ticker.EngFormatter(places=3)
formatter.ENG_PREFIXES[-6] = 'u'

def scatterplot_MultiBrSmartBridgeAuto_400x(results):

    print "scatterplot_MultiBrSmartBridgeAuto_400x"
    data = {}

    ncol = 4
    nrow = 3

    xtitle = "Hop Count"
    ytitle = "Reach Delay (s)"

    for result in results:
        if result.mode == "MultiBrSmartBridgeAuto" and 'S400' in result.id:
            if 'pingm' in result.time_info and result.time_info['pingm'] > -1:
                if 'ping1' in result.ping_info and result.ping_info['ping1'] != None:
                    if result.id not in data:
                        data[result.id] = {'x':[], 'y':[]}

                    data[result.id]['x'].append(64 - int(result.ping_info['ping1']['ttl']))
                    data[result.id]['y'].append(int(result.time_info['pingm'])/1000)

    fig400x = plt.figure(figsize=(25,15)) #figsize=(,)
    index400x = 1

    for testid in sorted(data.keys()):
        if 'S400' in testid:
            # ax = fig400x.add_subplot(nrow,ncol,index400x, title="%s, %d points" % (testid,len(data[testid]['x'])), xlim=(0,10), ylim=(0,80), xlabel=xtitle, ylabel=ytitle)
            ax = fig400x.add_subplot(nrow,ncol,index400x, title="%s, %d points" % (testid,len(data[testid]['x'])), xlabel=xtitle, ylabel=ytitle)
            ax.scatter(data[testid]['x'],data[testid]['y'])
            print("plotting %s len %d" % (testid, len(data[testid]['x'])))
            # print(index400x)
            index400x+=1

    fig400x.savefig('MultiBrSmartBridgeAuto_400x.pdf', format='pdf')

def scatterplot_MultiBrSmartBridgeAuto_500x(results):

    print "scatterplot_MultiBrSmartBridgeAuto_500x"
    data = {}

    ncol = 4
    nrow = 3

    xtitle = "Hop Count"
    ytitle = "Reach Delay (s)"

    for result in results:
        if result.mode == "MultiBrSmartBridgeAuto" and 'S500' in result.id:
            if 'pingm' in result.time_info and result.time_info['pingm'] > -1:
                if 'ping1' in result.ping_info and result.ping_info['ping1'] != None:
                    if result.id not in data:
                        data[result.id] = {'x':[], 'y':[]}

                    data[result.id]['x'].append(64 - int(result.ping_info['ping1']['ttl']))
                    data[result.id]['y'].append(int(result.time_info['pingm'])/1000)

    fig500x = plt.figure(figsize=(25,15)) #figsize=(,)
    index500x = 1

    for testid in sorted(data.keys()):
        if 'S500' in testid:
            # ax = fig500x.add_subplot(nrow,ncol,index500x, title="%s, %d points" % (testid,len(data[testid]['x'])), xlim=(0,10), ylim=(0,80), xlabel=xtitle, ylabel=ytitle)
            ax = fig500x.add_subplot(nrow,ncol,index500x, title="%s, %d points" % (testid,len(data[testid]['x'])), xlabel=xtitle, ylabel=ytitle)
            ax.scatter(data[testid]['x'],data[testid]['y'])
            print("plotting %s len %d" % (testid, len(data[testid]['x'])))
            # print(index500x)
            index500x+=1

    fig500x.savefig('MultiBrSmartBridgeAuto_500x.pdf', format='pdf')

def scatterplot_MultiBrSmartBridgeAuto_500x_vs_delay(results):

    print "scatterplot_MultiBrSmartBridgeAuto_500x_vs_delay"
    data = {}

    ncol = 4
    nrow = 3

    xtitle = "Time befor move (s)"
    ytitle = "Unreachability Duration (s)"

    for result in results:
        if result.mode == "MultiBrSmartBridgeAuto" and 'S500' in result.id:
            if 'ping1' in result.ping_info and result.ping_info['ping1'] != None:
                if 'pingm' in result.time_info and result.time_info['pingm'] > -1:
                    if result.id not in data:
                        data[result.id] = {'xraw':[], 'yraw':[], 'x':[], 'y':[]}

                    data[result.id]['xraw'].append(int(result.start_delay))
                    data[result.id]['yraw'].append(int(result.time_info['pingm'])/1000)

    fig500x = plt.figure(figsize=(25,15)) #figsize=(,)
    index500x = 1

    plotcolor = 'r'
    plotmarker = 'o'
    plotline = '-'

    for testid in sorted(data.keys()):
        data[testid]['x'] = sorted(unique(data[testid]['xraw']))
        temp = [[] for i in range(len(data[testid]['x']))]
        for k in range(len(data[testid]['xraw'])):
            temp[data[testid]['x'].index(data[testid]['xraw'][k])].append(data[testid]['yraw'][k])
        data[testid]['y'] = temp

    ax = fig500x.add_subplot(nrow,ncol,index500x, title="Unreachability Duration vs. Move Time", xlim=(0,2400), ylim=(0,100), xlabel=xtitle, ylabel=ytitle)
    for testid in sorted(data.keys()):
        if sorted(data.keys()).index(testid) == 0:
            plotcolor = 'b'
            plotmarker = 'x'
            plotlabel = 'No extra traffic'
        elif sorted(data.keys()).index(testid) == 1:
            plotcolor = 'g'
            plotmarker = 'o'
            plotlabel = 'Self UDP collect traffic'
        elif sorted(data.keys()).index(testid) == 2:
            plotcolor = 'y'
            plotmarker = 's'
            plotlabel = 'All-node UDP collect traffic'
        else:
            plotcolor = 'r'
            plotmarker = '^'
            plotlabel = 'All-node UDP echo traffic'
        tempmean = [[] for i in range(len(data[testid]['x']))]
        tempstd = [[] for i in range(len(data[testid]['x']))]
        for i in range(len(tempmean)):
            tempmean[i] = mean(data[testid]['y'][i])
            tempstd[i] = std(data[testid]['y'][i])
        ax.plot(data[testid]['x'],tempmean, label=plotlabel, linestyle=plotline, marker=plotmarker, color=plotcolor)
        ax.errorbar(data[testid]['x'], tempmean, tempstd, fmt='-', color=plotcolor)
        handles, labels = ax.get_legend_handles_labels()
        ax.legend(handles[::-1], labels[::-1])
        print("plotting 500x RvsD %s" % testid)
    index500x+=1

    ax = fig500x.add_subplot(nrow,ncol,index500x, title="Unreachability Duration vs. Move Time", xlim=(0,2400), ylim=(0,100), xlabel=xtitle, ylabel=ytitle)
    plotcolor = 'b'
    plotmarker = 'o'
    plotline = '-'
    temp = [[] for i in range(len(data[testid]['x']))]
    tempmean = [[] for i in range(len(data[testid]['x']))]
    tempstd = [[] for i in range(len(data[testid]['x']))]
    for testid in sorted(data.keys()):
        for i in range(len(data[testid]['y'])):
            temp[i].extend(data[testid]['y'][i])
    for i in range(len(tempmean)):
        tempmean[i] = mean(temp[i])
        tempstd[i] = std(temp[i])
    ax.plot(data[testid]['x'],tempmean, label=plotlabel, linestyle=plotline, marker=plotmarker, color=plotcolor)
    ax.errorbar(data[testid]['x'], tempmean, tempstd, fmt='-', color=plotcolor)

    fig500x.savefig('MultiBrSmartBridgeAuto_500x_vs_delay.pdf', format='pdf')

def scatterplot_MultiBrSmartBridgeAuto_502x(results):

    print "scatterplot_MultiBrSmartBridgeAuto_502x"
    data = {}

    ncol = 4
    nrow = 3

    xtitle = "Hop Count"
    ytitle = "Reach Delay (s)"

    for result in results:
        if result.mode == "MultiBrSmartBridgeAuto" and 'S502' in result.id:
            if 'pingm' in result.time_info and result.time_info['pingm'] > -1:
                if 'ping1' in result.ping_info and result.ping_info['ping1'] != None:
                    if result.id not in data:
                        data[result.id] = {}
                    if result.start_delay not in data[result.id]:
                        data[result.id][result.start_delay] = {'x':[], 'y':[]}

                    data[result.id][result.start_delay]['x'].append(64 - int(result.ping_info['ping1']['ttl']))
                    data[result.id][result.start_delay]['y'].append(int(result.time_info['pingm'])/1000)

    fig502x = plt.figure(figsize=(25,15))
    index502x = 1

    for testid in data:
        sortedid = sorted(data.keys())
        for start_delay in data[testid]:
            sorteddelay = sorted(data[testid].keys())
            if 'S502' in testid:
                idx = sorteddelay.index(start_delay)*ncol + sortedid.index(testid) + 1
                # ax = fig502x.add_subplot(nrow,ncol,idx, title="%s-%s, %d points" % (testid,start_delay,len(data[testid][start_delay]['x'])), xlim=(0,10), ylim=(0,80), xlabel=xtitle, ylabel=ytitle)
                ax = fig502x.add_subplot(nrow,ncol,idx, title="%s-%s, %d points" % (testid,start_delay,len(data[testid][start_delay]['x'])), xlabel=xtitle, ylabel=ytitle)
                ax.scatter(data[testid][start_delay]['x'],data[testid][start_delay]['y'])
                print("plotting %s %s len %d" % (testid, start_delay, len(data[testid][start_delay]['x'])))
                # print(index502x)
                # index502x+=1

    fig502x.savefig('MultiBrSmartBridgeAuto_502x.pdf', format='pdf')

def scatterplot_MultiBrSmartBridgeAuto_502x_vs_delay(results):

    print "scatterplot_MultiBrSmartBridgeAuto_502x_vs_delay"
    data = {}

    ncol = 4
    nrow = 3

    xtitle = "Time befor move (s)"
    ytitle = "Unreachability Duration (s)"

    for result in results:
        if result.mode == "MultiBrSmartBridgeAuto" and 'S502' in result.id:
            if 'ping1' in result.ping_info and result.ping_info['ping1'] != None:
                if 'pingm' in result.time_info and result.time_info['pingm'] > -1:
                    if result.id not in data:
                        data[result.id] = {'xraw':[], 'yraw':[], 'x':[], 'y':[]}

                    data[result.id]['xraw'].append(int(result.start_delay))
                    data[result.id]['yraw'].append(int(result.time_info['pingm'])/1000)

    fig500x = plt.figure(figsize=(25,15)) #figsize=(,)
    index500x = 1

    plotcolor = 'r'
    plotmarker = 'o'
    plotline = '-'

    for testid in sorted(data.keys()):
        data[testid]['x'] = sorted(unique(data[testid]['xraw']))
        temp = [[] for i in range(len(data[testid]['x']))]
        for k in range(len(data[testid]['xraw'])):
            temp[data[testid]['x'].index(data[testid]['xraw'][k])].append(data[testid]['yraw'][k])
        data[testid]['y'] = temp

    ax = fig500x.add_subplot(nrow,ncol,index500x, title="Unreachability Duration vs. Move Time", xlim=(0,2400), ylim=(0,100), xlabel=xtitle, ylabel=ytitle)
    for testid in sorted(data.keys()):
        if sorted(data.keys()).index(testid) == 0:
            plotcolor = 'b'
            plotmarker = 'x'
            plotlabel = 'No extra traffic'
        elif sorted(data.keys()).index(testid) == 1:
            plotcolor = 'g'
            plotmarker = 'o'
            plotlabel = 'Self UDP collect traffic'
        elif sorted(data.keys()).index(testid) == 2:
            plotcolor = 'y'
            plotmarker = 's'
            plotlabel = 'All-node UDP collect traffic'
        else:
            plotcolor = 'r'
            plotmarker = '^'
            plotlabel = 'All-node UDP echo traffic'
        tempmean = [[] for i in range(len(data[testid]['x']))]
        tempstd = [[] for i in range(len(data[testid]['x']))]
        for i in range(len(tempmean)):
            tempmean[i] = mean(data[testid]['y'][i])
            tempstd[i] = std(data[testid]['y'][i])
        ax.plot(data[testid]['x'],tempmean, label=plotlabel, linestyle=plotline, marker=plotmarker, color=plotcolor)
        ax.errorbar(data[testid]['x'], tempmean, tempstd, fmt='-', color=plotcolor)
        handles, labels = ax.get_legend_handles_labels()
        ax.legend(handles[::-1], labels[::-1])
        print("plotting 502x RvsD %s" % testid)
    index500x+=1

    ax = fig500x.add_subplot(nrow,ncol,index500x, title="Unreachability Duration vs. Move Time", xlim=(0,2400), ylim=(0,100), xlabel=xtitle, ylabel=ytitle)
    plotcolor = 'b'
    plotmarker = 'o'
    plotline = '-'
    temp = [[] for i in range(len(data[testid]['x']))]
    tempmean = [[] for i in range(len(data[testid]['x']))]
    tempstd = [[] for i in range(len(data[testid]['x']))]
    for testid in sorted(data.keys()):
        for i in range(len(data[testid]['y'])):
            temp[i].extend(data[testid]['y'][i])
    for i in range(len(tempmean)):
        tempmean[i] = mean(temp[i])
        tempstd[i] = std(temp[i])
    ax.plot(data[testid]['x'],tempmean, label=plotlabel, linestyle=plotline, marker=plotmarker, color=plotcolor)
    ax.errorbar(data[testid]['x'], tempmean, tempstd, fmt='-', color=plotcolor)

    fig500x.savefig('MultiBrSmartBridgeAuto_502x_vs_delay.pdf', format='pdf')

def scatterplot_MultiBrSmartBridgeAuto_600x(results):

    print "scatterplot_MultiBrSmartBridgeAuto_600x"
    data = {}

    ncol = 4
    nrow = 3

    xtitle = "Hop Count"
    ytitle = "Reach Delay (s)"

    for result in results:
        if result.mode == "MultiBrSmartBridgeAuto" and 'S502' in result.id:
            if 'pingm' in result.time_info and result.time_info['pingm'] > -1:
                if 'ping1' in result.ping_info and result.ping_info['ping1'] != None:
                    if result.id not in data:
                        data[result.id] = {}
                    if result.start_delay not in data[result.id]:
                        data[result.id][result.start_delay] = {'x':[], 'y':[]}

                    data[result.id][result.start_delay]['x'].append(64 - int(result.ping_info['ping1']['ttl']))
                    data[result.id][result.start_delay]['y'].append(int(result.time_info['pingm'])/1000)

    fig600x = plt.figure(figsize=(25,15))
    index600x = 1

    for testid in data:
        sortedid = sorted(data.keys())
        for start_delay in data[testid]:
            sorteddelay = sorted(data[testid].keys())
            if 'S600' in testid:
                idx = sorteddelay.index(start_delay)*ncol + sortedid.index(testid) + 1
                # ax = fig600x.add_subplot(nrow,ncol,idx, title="%s-%s, %d points" % (testid,start_delay,len(data[testid][start_delay]['x'])), xlim=(0,10), ylim=(0,80), xlabel=xtitle, ylabel=ytitle)
                ax = fig600x.add_subplot(nrow,ncol,idx, title="%s-%s, %d points" % (testid,start_delay,len(data[testid][start_delay]['x'])), xlabel=xtitle, ylabel=ytitle)
                ax.scatter(data[testid][start_delay]['x'],data[testid][start_delay]['y'])
                print("plotting %s %s len %d" % (testid, start_delay, len(data[testid][start_delay]['x'])))
                # print(index600x)
                index600x+=1

    fig600x.savefig('MultiBrSmartBridgeAuto_600x.pdf', format='pdf')


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Omphalia nauseabunda Mont.

### Remarks
null


text:
package org.sagebionetworks.repo.model.dbo.file.download.v2;

import java.util.List;

import org.json.JSONObject;
import org.sagebionetworks.repo.model.EntityRef;
import org.sagebionetworks.repo.model.download.ActionRequiredCount;
import org.sagebionetworks.repo.model.download.AvailableFilter;
import org.sagebionetworks.repo.model.download.DownloadListItem;
import org.sagebionetworks.repo.model.download.DownloadListItemResult;
import org.sagebionetworks.repo.model.download.FilesStatisticsResponse;
import org.sagebionetworks.repo.model.download.Sort;

public interface DownloadListDAO {

	/**
	 * Add a batch of files to a user's download list.
	 *
	 * @param userId     The id of the user.
	 * @param batchToAdd The batch of files to add.
	 * @return The number of files that were actually added.
	 */
	long addBatchOfFilesToDownloadList(Long userId, List<DownloadListItem> batchToAdd);

	/**
	 * For a given list of DownloadListItem, filter out all items that are not actual files.
	 *
	 * @param batch
	 * @return
	 */
	List<DownloadListItem> filterUnsupportedTypes(List<DownloadListItem> batch);

	/**
	 *
	 * @param userId        The id of the user.
	 * @param batchToRemove The batch of files to remove.
	 * @return The number of files that were actually removed.
	 */
	long removeBatchOfFilesFromDownloadList(Long userId, List<? extends DownloadListItem> batchToRemove);

	/**
	 * Clear all files from the user's download list.
	 *
	 * @param userId
	 */
	void clearDownloadList(Long userId);

	/**
	 * Get a single page of files from a user's download list that are available for
	 * download.
	 *
	 * @param accessCallback Callback used to determine which entities on the user's
	 *                       download list that the user can download.
	 * @param userId
	 * @param filter
	 * @param sort
	 * @param limit
	 * @param offset
	 * @return
	 */
	List<DownloadListItemResult> getFilesAvailableToDownloadFromDownloadList(EntityAccessCallback accessCallback,
			Long userId, AvailableFilter filter, List<Sort> sort, Long limit, Long offset);

	/**
	 * Get the DBODownloadList for the given user.
	 *
	 * @param userId
	 * @return
	 */
	DBODownloadList getDBODownloadList(Long userId);

	/**
	 *
	 * @param userId
	 * @return
	 */
	List<DBODownloadListItem> getDBODownloadListItems(Long userId);

	/**
	 * Get the DownloadListItemResult for the given user and each item.
	 *
	 * @param userId
	 * @param item
	 * @return
	 */
	List<DownloadListItemResult> getDownloadListItems(Long userId, DownloadListItem... item);

	/**
	 * Clear all download data for all users.
	 */
	void truncateAllData();

	/**
	 * Read all of value from a temporary of the items from a user's download list
	 * that the user has download access to.
	 *
	 * @param accessCallback
	 * @param userId
	 * @param batchSize
	 * @return
	 */
	List<Long> getAvailableFilesFromDownloadList(EntityAccessCallback accessCallback, Long userId, int batchSize);

	/**
	 * Get the total number of files currently on the user's download list.
	 *
	 * @param userId
	 * @return
	 */
	long getTotalNumberOfFilesOnDownloadList(Long userId);

	/**
	 * Get the download list statistics for the given user.
	 * @param createAccessCallback
	 * @param id
	 * @return
	 */
	FilesStatisticsResponse getListStatistics(EntityAccessCallback createAccessCallback, Long id);

	/**
	 * Get a single page of actions required to download one or more files from the user's download list.
	 * @param callback
	 * @param userId
	 * @param limit
	 * @param offset
	 * @return
	 */
	List<ActionRequiredCount> getActionsRequiredFromDownloadList(EntityActionRequiredCallback callback,
			Long userId, Long limit, Long offset);

	/**
	 * Add all of the children for the given parentId to the user's download list.
	 *
	 * @param id
	 * @param parentId
	 * @param useVersion When true, the current version of the file will be used.
	 *                   When false, the version number will be null;
	 * @param limit      Limit the number of files that can be added.
	 * @return The total number of files added.
	 */
	Long addChildrenToDownloadList(Long id, Long parentId, boolean useVersion, long limit);

	/**
	 * For the given item load all of the details needed to write to a manifest
	 * @param item
	 * @return
	 */
	JSONObject getItemManifestDetails(DownloadListItem item);

	/**
	 * Adds all of the files in the list of dataset items to the user's download list.
	 *
	 * @param userId
	 * @param items
	 * @param limit		 Limit the number of files that can be added.
	 * @return The total number of files added.
	 */
	Long addDatasetItemsToDownloadList(Long userId, List<EntityRef> items, long limit);

}


text:
google.identity.accesscontextmanager.v1
========================================

.. automodule:: google.identity.accesscontextmanager.v1.access_level_pb2
    :members:
    :inherited-members:

.. automodule:: google.identity.accesscontextmanager.v1.access_policy_pb2
    :members:
    :inherited-members:

.. automodule:: google.identity.accesscontextmanager.v1.service_perimeter_pb2
    :members:
    :inherited-members:


text:
package org.elasticlib.node.providers;

import java.io.IOException;
import java.io.OutputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import javax.json.JsonWriter;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.UriInfo;
import javax.ws.rs.ext.MessageBodyWriter;
import javax.ws.rs.ext.Provider;
import org.elasticlib.common.json.JsonWriting;
import org.elasticlib.common.mappable.Mappable;
import org.elasticlib.common.yaml.YamlWriter;
import static org.elasticlib.node.providers.MessageBodyWriterUtil.isJson;
import static org.elasticlib.node.providers.MessageBodyWriterUtil.isYaml;
import static org.elasticlib.node.providers.MessageBodyWriterUtil.writerFactory;
import static org.yaml.snakeyaml.DumperOptions.LineBreak.UNIX;

/**
 * Custom HTTP body writer for Mappable instances. Produces either JSON or YAML. For JSON, nicely format output if
 * request contains query parameter "pretty=true".
 */
@Provider
@Produces({"application/json", "text/json", "application/yaml", "text/yaml", "*/*"})
public class MappableBodyWriter implements MessageBodyWriter<Mappable> {

    @Context
    private UriInfo uriInfo;

    @Override
    public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
        if (!Mappable.class.isAssignableFrom(type)) {
            return false;
        }
        return isJson(mediaType) || isYaml(mediaType);
    }

    @Override
    public long getSize(Mappable t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
        // Deprecated by JAX-RS 2.0 and ignored by Jersey runtime.
        return -1;
    }

    @Override
    public void writeTo(Mappable t,
                        Class<?> type,
                        Type genericType,
                        Annotation[] annotations,
                        MediaType mediaType,
                        MultivaluedMap<String, Object> httpHeaders,
                        OutputStream entityStream) throws IOException {

        if (isYaml(mediaType)) {
            writeYamlTo(t, entityStream);

        } else {
            writeJsonTo(t, entityStream);
        }
    }

    private void writeYamlTo(Mappable t, OutputStream entityStream) throws IOException {
        try (YamlWriter writer = new YamlWriter(entityStream, UNIX)) {
            writer.write(t);
        }
    }

    private void writeJsonTo(Mappable t, OutputStream entityStream) {
        try (JsonWriter writer = writerFactory(uriInfo).createWriter(entityStream)) {
            writer.write(JsonWriting.write(t));
        }
    }
}


text:
namespace mirage.tests {
    import LayoutFlags = mirage.core.LayoutFlags;

    QUnit.module("Panel");

    QUnit.test("children", () => {
        var sp = new StackPanel();

        var child1 = new core.LayoutNode();
        sp.appendChild(child1);
        strictEqual(child1.tree.parent, sp, "append parent");
        strictEqual(sp.childCount, 1, "append childCount");
        strictEqual(sp.getChildAt(0), child1, "append getChildAt");

        var child2 = new core.LayoutNode();
        sp.prependChild(child2);
        strictEqual(child2.tree.parent, sp, "prepend parent");
        strictEqual(sp.childCount, 2, "prepend childCount");
        strictEqual(sp.getChildAt(1), child1, "prepend getAt 1");
        strictEqual(sp.getChildAt(0), child2, "prepend getAt 0");

        var child3 = new core.LayoutNode();
        sp.insertChild(child3, 1);
        strictEqual(sp.getChildAt(2), child1, "insertChild getAt 2");
        strictEqual(sp.getChildAt(0), child2, "insertChild getAt 0");
        strictEqual(sp.getChildAt(1), child3, "insertChild getAt 1");
        sp.removeChildAt(1);

        sp.removeChildAt(0);
        equal(child2.tree.parent, null, "removeAt parent");

        sp.removeChild(child1);
        equal(child1.tree.parent, null, "remove parent");
        strictEqual(sp.childCount, 0, "remove childCount");
    });
}


text:
#import <React/RCTBridgeModule.h>
#import <React/RCTEventDispatcher.h>
#import <React/RCTEventEmitter.h>
#import <React/RCTUIManager.h>
#import <React/RCTUIManagerObserverCoordinator.h>

#import "RCTValueAnimatedNode.h"

@interface RCTNativeAnimatedModule : RCTEventEmitter <RCTBridgeModule, RCTValueAnimatedNodeObserver, RCTEventDispatcherObserver, RCTUIManagerObserver>

@end


text:
FROM ubuntu:16.04

MAINTAINER Kevin DeMarco

#ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update && \
    apt-get install -y git sudo build-essential apt-utils aptdaemon

# Create user, allow sudo without password, point to id_rsa
RUN adduser --uid 1000 --disabled-password --gecos '' syllo && \
    adduser syllo sudo && \
    echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

USER syllo
WORKDIR /home/syllo

RUN git clone https://github.com/afrl-rq/OpenUxAS.git
WORKDIR ./OpenUxAS

RUN chmod +x ./install_prerequisites.sh
RUN bash -c "./install_prerequisites.sh"
RUN ninja -C build


text:
export interface IStadiumBlockName {
  name(): String;
  fromJson(jsonString: String): IStadiumBlockName;
}

export class StadiumBlockName1 implements IStadiumBlockName {
  private blockName: String;

  constructor() {
    this.blockName = "1";
  }

  public name(): String {
    return this.blockName;
  }
  public fromJson(jsonString: String): IStadiumBlockName {
    return new StadiumBlockName1();
  }
}

export class StadiumBlockName2 implements IStadiumBlockName {
  private blockName: String = "2";

  public name(): String {
    return this.blockName;
  }
  public fromJson(jsonString: String): IStadiumBlockName {
    return new StadiumBlockName2();
  }
}

export class StadiumBlockName3 implements IStadiumBlockName {
  private blockName: String = "3";

  public name(): String {
    return this.blockName;
  }
  public fromJson(jsonString: String): IStadiumBlockName {
    return new StadiumBlockName3();
  }
}

export class StadiumBlockName4 implements IStadiumBlockName {
  private blockName: String = "4";

  public name(): String {
    return this.blockName;
  }
  public fromJson(jsonString: String): IStadiumBlockName {
    return new StadiumBlockName4();
  }
}


text:
pub mod indentation;
/// Isolate parts of string.
#[ cfg( all( feature = "isolate", feature = "use_std" ) ) ]
pub mod isolate;
/// Parsing of numbers.
#[ cfg( all( feature = "parse_number", feature = "use_std" ) ) ]
pub mod number;
/// Parse string.
#[ cfg( all( feature = "parse_request", feature = "use_std" ) ) ]
pub mod parse_request;
/// Spit string with a delimeter.
#[ cfg( all( feature = "split", feature = "use_std" ) ) ]
pub mod split;

/// Protected namespace of the module.
pub mod protected
{
  pub use super::orphan::*;
  #[ cfg( all( feature = "indentation", feature = "use_std" ) ) ]
  pub use super::indentation::orphan::*;
  #[ cfg( all( feature = "isolate", feature = "use_std" ) ) ]
  pub use super::isolate::orphan::*;
  #[ cfg( all( feature = "parse_number", feature = "use_std" ) ) ]
  pub use super::number::orphan::*;
  #[ cfg( all( feature = "parse_request", feature = "use_std" ) ) ]
  pub use super::parse_request::orphan::*;
  #[ cfg( all( feature = "split", feature = "use_std" ) ) ]
  pub use super::split::orphan::*;
}

#[ doc( inline ) ]
pub use protected::*;

/// Parented namespace of the module.
pub mod orphan
{
  pub use super::exposed::*;
}

/// Exposed namespace of the module.
pub mod exposed
{
  #[ cfg( all( feature = "indentation", feature = "use_std" ) ) ]
  pub use super::indentation::exposed::*;
  #[ cfg( all( feature = "isolate", feature = "use_std" ) ) ]
  pub use super::isolate::exposed::*;
  #[ cfg( all( feature = "parse_number", feature = "use_std" ) ) ]
  pub use super::number::exposed::*;
  #[ cfg( all( feature = "parse_request", feature = "use_std" ) ) ]
  pub use super::parse_request::exposed::*;
  #[ cfg( all( feature = "split", feature = "use_std" ) ) ]
  pub use super::split::exposed::*;
}

/// Namespace of the module to include with `use module::*`.
pub mod prelude
{
  #[ cfg( all( feature = "indentation", feature = "use_std" ) ) ]
  pub use super::indentation::prelude::*;
  #[ cfg( all( feature = "isolate", feature = "use_std" ) ) ]
  pub use super::isolate::prelude::*;
  #[ cfg( all( feature = "parse_number", feature = "use_std" ) ) ]
  pub use super::number::prelude::*;
  #[ cfg( all( feature = "parse_request", feature = "use_std" ) ) ]
  pub use super::parse_request::prelude::*;
  #[ cfg( all( feature = "split", feature = "use_std" ) ) ]
  pub use super::split::prelude::*;
}


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;

namespace DockSample
{
    public partial class DummyPropertyWindow : ToolWindow
    {
        public DummyPropertyWindow()
        {
            InitializeComponent();
			comboBox.SelectedIndex = 0;
			propertyGrid.SelectedObject = propertyGrid;
        }
    }
}


text:
//// Copyright (c) Microsoft Corporation. All rights reserved

(function () {
    "use strict";
    var page = WinJS.UI.Pages.define("/html/setAccountPicture.html", {
        ready: function (element, options) {
            hideVisibleHolders();
            document.getElementById("setImage").addEventListener("click", setImage, false);
            document.getElementById("setVideo").addEventListener("click", setVideo, false);
            Windows.System.UserProfile.UserInformation.addEventListener("accountpicturechanged", accountPictureChanged);
        }
    });

    function setImage() {
        hideVisibleHolders();
        var openPicker = new Windows.Storage.Pickers.FileOpenPicker();
        openPicker.viewMode = Windows.Storage.Pickers.PickerViewMode.thumbnail;
        openPicker.suggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.picturesLibrary;
        openPicker.fileTypeFilter.replaceAll([".bmp", ".png", ".jpg", ".jpeg"]);

        openPicker.pickSingleFileAsync().done(function (file) {
            if (file) {
                // setAccountPictureAsync() accepts 3 storageFile objects for setting the small image, large image, and video.
                // More than one type can be set in the same call, but small image must be accompanied by a large image and/or video.
                // If only a large image is passed, the small image will be autogenerated.
                // If only a video is passed, the large image and small will be autogenerated.
                // Videos must be convertable to mp4, <=5MB, and height and width >= 448 pixels.
                Windows.System.UserProfile.UserInformation.setAccountPicturesAsync(null, file, null).done(function (result) {
                    // A user might turn off access to the Account Picture in PC Settings, therefore we need to check the result for success.
                    if (result === Windows.System.UserProfile.SetAccountPictureResult.success) {
                        WinJS.log && WinJS.log("Successfully updated account picture.", "sample", "status");
                    } else {
                        // A user might turn off access to the account
                        WinJS.log && WinJS.log("Setting account picture failed.", "sample", "status");
                    }
                });
            } else {
                WinJS.log && WinJS.log("No image was selected.", "sample", "status");
            }
        });
    }

    function setVideo() {
        hideVisibleHolders();
        var openPicker = new Windows.Storage.Pickers.FileOpenPicker();
        openPicker.viewMode = Windows.Storage.Pickers.PickerViewMode.thumbnail;
        openPicker.suggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.picturesLibrary;
        openPicker.fileTypeFilter.replaceAll([".mov", ".mp4", ".wmv"]);

        openPicker.pickSingleFileAsync().done(function (file) {
            if (file) {
                // setAccountPictureAsync() accepts 3 storageFile objects for setting the small image, large image, and video.
                // More than one type can be set in the same call, but small image must be accompanied by a large image and/or video.
                // If only a large image is passed, the small image will be autogenerated.
                // If only a video is passed, the large image and small will be autogenerated.
                // Videos must be convertable to mp4, <=5MB, and height and width >= 448 pixels.
                Windows.System.UserProfile.UserInformation.setAccountPicturesAsync(null, null, file).done(function (result) {
                    // A user might turn off access to the Account Picture in PC Settings, therefore we need to check the result for success.
                    if (result === Windows.System.UserProfile.SetAccountPictureResult.success) {
                        WinJS.log && WinJS.log("Successfully updated account picture.", "sample", "status");
                    } else {
                        // A user might turn off access to the account
                        WinJS.log && WinJS.log("Setting account picture failed.", "sample", "status");
                    }
                });
            } else {
                WinJS.log && WinJS.log("No video was selected.", "sample", "status");
            }
        });
    }

    // This function is the handler for the AccountPictureChangedEvent, the event listener is added in initialize() below.
    function accountPictureChanged() {
        hideVisibleHolders();
        if (Windows.System.UserProfile.UserInformation.nameAccessAllowed) {
            var smallImage = Windows.System.UserProfile.UserInformation.getAccountPicture(Windows.System.UserProfile.AccountPictureKind.smallImage);
            if (smallImage) {
                document.getElementById("smallImageHolder").src = URL.createObjectURL(smallImage, { oneTimeOnly: true });
                document.getElementById("smallImageHolder").style.visibility = "visible";
            }
            var largeImage = Windows.System.UserProfile.UserInformation.getAccountPicture(Windows.System.UserProfile.AccountPictureKind.largeImage);
            if (largeImage) {
                document.getElementById("largeImageHolder").src = URL.createObjectURL(largeImage, { oneTimeOnly: true });
                document.getElementById("largeImageHolder").style.visibility = "visible";
            }
            var video = Windows.System.UserProfile.UserInformation.getAccountPicture(Windows.System.UserProfile.AccountPictureKind.video);
            if (video) {
                document.getElementById("videoHolder").src = URL.createObjectURL(video, { oneTimeOnly: true });
                document.getElementById("videoHolder").style.visibility = "visible";
            }
        } else {
            WinJS.log && WinJS.log("Access to account picture disabled by Privacy Setting or Group Policy.", "sample", "error");
        }
    }

    function hideVisibleHolders() {
        document.getElementById("smallImageHolder").style.visibility = "hidden";
        document.getElementById("largeImageHolder").style.visibility = "hidden";
        document.getElementById("videoHolder").style.visibility = "hidden";
        WinJS.log && WinJS.log(" ", "sample", "status");
    }
})();


text:
<?php

namespace MCueto\SimpleBlogBundle\Controller;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use MCueto\SimpleBlogBundle\Entity\Post;

class DefaultController extends Controller
{

  /**
  * Lists Blog Index.
  *
  * @Route("/blog/{page}", name="simpleblog_index")
  * @Method("GET")
  */
  public function indexAction($page = 1)
  {
    $limit = 3;
    $offset = ($page == 1) ? 0 : ($page-1)*$limit;

    $em = $this->getDoctrine()->getManager();

    $posts = $em->getRepository('SimpleBlogBundle:Post')->findBy(
      array('active' => '1'),
      array('id' => 'DESC'),
      $limit,
      $offset
    );

    return $this->render('SimpleBlogBundle:Default:index.html.twig', array(
      'posts' => $posts
    ));

  }

  /**
  * Specific Blog Article.
  *
  * @Route("/blog/article/{alias}", name="simpleblog_detail")
  * @Method("GET")
  */
  public function showAction(Request $request, Post $post)
  {
    $relatedPost = null;

    $em = $this->getDoctrine()->getManager();
    $er = $em->getRepository('SimpleBlogBundle:Post');
    $relatedPost = $er->getPreviousPost($post);

    return $this->render('SimpleBlogBundle:Default:detail.html.twig',
      array(
        'post' => $post,
        'relatedPost' => $relatedPost
      )
    );
  }

}


text:
'use strict';

/**
 * Filter a list of file paths to only return the first.
 *
 * @param {Array.<string>} paths
 *     A list of file paths.
 * @param {function(Err, Array.<string>)} cb
 *     Callback called with any error and a list of files that have been
 *     approved as "staged".
 */
var filterStagedPaths = exports.filterStagedPaths = function(paths, cb) {
  cb(null, paths.shift());
};