text:
    vazco/Universe Selectize

> This package is part of Universe, a framework based on [Meteor platform](http://meteor.com)
maintained by [Vazco](http://www.vazco.eu).

> It works standalone, but you can get max out of it when using the whole system.

## Demo
http://universe-autoform-select.stg.vazco.eu/

https://github.com/vazco/meteor-universe-selectize-demo.git

## Installation

In a Meteor app directory, enter:

```bash
$ meteor add vazco:universe-selectize
```

## Usage

```js
{{> universeSelectize name="test1" options=options multiple=false create=true}}

{{> universeSelectize name="test2" options=options multiple=true create=true remove=true}}
```

## Options

		universe-selectize options

		Option
		Description
		Type
		Default

		options
		Required. A function returning either an array of options, or a Mongo.Cursor. The function is re-evaluated automatically using Tracker when its reactive data sources change.
		function
		undefined

        placeholder
        Optional. A placeholder option.
        String
        null

        optionsPlaceholder
        Optional. Show placeholder in options dropdown.
        Boolean or String
        false

        disabled
        Optional.
        Boolean
        false

		multiple
		Optional.
		Boolean
		false

        removeButton
        Optional.
        Boolean
        true

        create
        Optional. Allows the user to create a new items that aren't in the list of options.
        Boolean
        true

        createText
        Optional. Allows the user to change the create text.
        String
        undefined

        createMethod
        Optional. Name of method to call after create new item. Method can return new value for item.
        String
        undefined

        optionsMethod
        Optional. Name of method to get more items. Method should return array of options.
        String
        undefined

        optionsMethodParams
        Optional. Additional params for optionsMethod.
        Object
        undefined

        sortMethod
        Optional.
        Function
        'label'

## License

**Like every package maintained by [Vazco](https://vazco.eu/), Universe Selectize is [MIT licensed](https://github.com/vazco/uniforms/blob/master/LICENSE).**


text:
define(['MessageCenter'], function (mc) {
    function Utilizer() {
        if (Utilizer.prototype._instance) return Utilizer.prototype._instance;
        Utilizer.prototype._instance = this;
        this.clearData = function() {
            App.m.publish("clear:widgets");

            if (App.a && App.a.widget) {
                _.each(App.a.widgets, function (w, i) {
                    delete App.a.widgets[i];
                });
                App.a.widgets = [];
            };
            App.m.publish("clear:dashboard");
            for (var key in App.a) {
                delete App.a[key];
            };
            delete App.a;
        };
        mc.subscribe('viewchange:DashboardList', {
            subscriber: this,
            callback: this.clearData
        });

    }
    Utilizer.prototype.toString = function(){ return "Utilizer"};
    return new Utilizer();

});

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Sabre\VObject\Property\ICalendar;

use
    Sabre\VObject\Property,
    Sabre\VObject\Parser\MimeDir,
    Sabre\VObject\DateTimeParser,
    Sabre\VObject\TimeZoneUtil;

class Date extends DateTime {

}


text:
layout: logistics
title: Get ready to DevFest
permalink: /logistics/
---

 {% include header.html %}

 {% include find-way.html %}

 {% include direction-details.html %}


text:
    <title>Loading...</title>

Navigate to another page to trigger beforeunload handler.


text:
package org.dashbuilder.displayer.json;

import java.util.Arrays;
import java.util.Collection;

import org.dashbuilder.dataset.group.DateIntervalType;
import org.dashbuilder.dataset.json.DataSetJSONMarshaller;
import org.dashbuilder.dataset.json.DataSetLookupJSONMarshaller;
import org.dashbuilder.displayer.DisplayerSettings;
import org.dashbuilder.displayer.DisplayerSettingsFactory;
import org.dashbuilder.json.JsonObject;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import static org.junit.Assert.*;
import static org.dashbuilder.dataset.group.AggregateFunctionType.*;
import static org.dashbuilder.dataset.sort.SortOrder.DESCENDING;

@RunWith(Parameterized.class)
public class DisplayerSettingsJsonTest {

    DataSetJSONMarshaller datasetJsonMarshaller = new DataSetJSONMarshaller();
    DataSetLookupJSONMarshaller lookupJsonMarshaller = new DataSetLookupJSONMarshaller();
    DisplayerSettingsJSONMarshaller displayerJsonMarshaller = new DisplayerSettingsJSONMarshaller(datasetJsonMarshaller, lookupJsonMarshaller);

    public static final DisplayerSettings OPPS_BY_PIPELINE = DisplayerSettingsFactory.newPieChartSettings()
            .uuid("opps-by-pipeline")
            .dataset("SALES_OPPS")
            .group("PIPELINE")
            .column("PIPELINE", "Pipeline")
            .column(COUNT, "Number of opps")
            .title("salesopps_displayers_by_pipeline_title")
            .titleVisible(false)
            .width(500).height(300)
            .margins(10, 10, 10, 10)
            .filterOn(false, true, true)
            .refreshOn()
            .buildSettings();

    public static final DisplayerSettings OPPS_BY_STATUS = DisplayerSettingsFactory.newPieChartSettings()
            .uuid("opps-by-status")
            .dataset("SALES_OPPS")
            .group("STATUS")
            .column("STATUS", "Status")
            .column("AMOUNT", SUM, "Total amount")
            .title("salesopps_displayers_by_status_title")
            .titleVisible(false)
            .margins(10, 10, 10, 10)
            .filterOn(false, true, true)
            .refreshOn()
            .buildSettings();

    public static final DisplayerSettings OPPS_BY_SALESMAN = DisplayerSettingsFactory.newPieChartSettings()
            .uuid("opps-by-salesman")
            .dataset("SALES_OPPS")
            .group("SALES_PERSON")
            .column("SALES_PERSON", "Sales person")
            .column("AMOUNT", SUM, "Total amount")
            .title("salesopps_displayers_by_salesman_title")
            .titleVisible(false)
            .margins(10, 10, 10, 10)
            .filterOn(false, true, true)
            .refreshOn()
            .buildSettings();

    public static final DisplayerSettings OPPS_EXPECTED_PIPELINE = DisplayerSettingsFactory.newAreaChartSettings()
            .uuid("opps-expected-pipeline")
            .dataset("SALES_OPPS")
            .group("CLOSING_DATE").dynamic(24, DateIntervalType.MONTH, true)
            .column("CLOSING_DATE", "Closing date")
            .column("EXPECTED_AMOUNT", SUM, "salesopps_displayers_by_exp_pipeline_column1")
            .title("salesopps_displayers_by_exp_pipeline_title")
            .titleVisible(false)
            .width(500).height(300)
            .margins(20, 50, 100, 100)
            .filterOn(true, true, true)
            .refreshOn()
            .buildSettings();

    public static final DisplayerSettings OPPS_BY_PRODUCT = DisplayerSettingsFactory.newBarChartSettings()
            .subType_Bar()
            .uuid("opps-by-product")
            .dataset("SALES_OPPS")
            .group("PRODUCT")
            .column("PRODUCT", "Product")
            .column("AMOUNT", SUM, "salesopps_displayers_by_product_column1")
            .title("salesopps_displayers_by_product_title")
            .titleVisible(false)
            .margins(10, 50, 100, 100)
            .filterOn(false, true, true)
            .refreshOn()
            .buildSettings();

    public static final DisplayerSettings OPPS_BY_COUNTRY = DisplayerSettingsFactory.newBarChartSettings()
            .subType_Bar()
            .uuid("opps-by-country")
            .dataset("SALES_OPPS")
            .group("COUNTRY")
            .column("COUNTRY", "Country")
            .column("AMOUNT", SUM, "alesopps_displayers_by_country_column1")
            .title("salesopps_displayers_by_country_title")
            .titleVisible(false)
            .margins(10, 80, 100, 100)
            .filterOn(false, true, true)
            .refreshOn()
            .buildSettings();

    public static final DisplayerSettings OPPS_COUNTRY_SUMMARY = DisplayerSettingsFactory.newTableSettings()
            .uuid("opps-country-summary")
            .dataset("SALES_OPPS")
            .group("COUNTRY")
            .column("COUNTRY", "salesopps_displayers_country_summary_column1")
            .column("AMOUNT", SUM, "salesopps_displayers_country_summary_column2")
            .column(COUNT, "salesopps_displayers_country_summary_column3")
            .column("AMOUNT", AVERAGE, "salesopps_displayers_country_summary_column4")
            .column("AMOUNT", MIN, "salesopps_displayers_country_summary_column5")
            .column("AMOUNT", MAX, "salesopps_displayers_country_summary_column6")
            .title("salesopps_displayers_country_summary_title")
            .titleVisible(false)
            .tablePageSize(20)
            .filterOff(true)
            .refreshOn()
            .buildSettings();

    public static final DisplayerSettings OPPS_ALLOPPS_LISTING = DisplayerSettingsFactory.newTableSettings()
            .uuid("opps-allopps-listing")
            .dataset("SALES_OPPS")
            .title("salesopps_displayers_all_list_title")
            .titleVisible(false)
            .tablePageSize(20)
            .tableOrderEnabled(true)
            .tableOrderDefault("AMOUNT", DESCENDING)
            .filterOn(true, true, true)
            .refreshOn()
            .buildSettings();

    @Parameterized.Parameters
    public static Collection displayerIds() {
        return Arrays.asList(new Object[][]{
                {OPPS_ALLOPPS_LISTING},
                {OPPS_BY_COUNTRY},
                {OPPS_BY_PIPELINE},
                {OPPS_BY_PRODUCT},
                {OPPS_BY_SALESMAN},
                {OPPS_BY_STATUS},
                {OPPS_COUNTRY_SUMMARY},
                {OPPS_EXPECTED_PIPELINE}
        });
    }

    protected DisplayerSettings displayerSettings;

    public DisplayerSettingsJsonTest(DisplayerSettings settings) {
        this.displayerSettings = settings;
    }

    @Test
    public void testSettingsMarshalling() {

        JsonObject _jsonObj = displayerJsonMarshaller.toJsonObject(displayerSettings);
        assertNotNull(_jsonObj.toString());

        DisplayerSettings unmarshalled = displayerJsonMarshaller.fromJsonString(_jsonObj.toString());
        assertEquals(unmarshalled, displayerSettings);
    }
}


text:
package io.gravitee.am.identityprovider.api;

import java.util.Collections;
import java.util.List;
import java.util.Map;

/**
 * @author Titouan COMPIEGNE (titouan.compiegne at graviteesource.com)
 * @author GraviteeSource Team
 */
public interface IdentityProviderRoleMapper {

    Map<String, String[]> getRoles();

    void setRoles(Map<String, String[]> roles);

    default List<String> apply(AuthenticationContext context, Map<String, Object> userInfo) {
        // default implementation is used to avoid breaking plugins not provided by Gravitee.
        return Collections.emptyList();
    }
}


text:
package org.apache.cassandra.net;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.TimeoutException;

import javax.annotation.Nullable;

import com.google.common.annotations.VisibleForTesting;

import org.apache.cassandra.concurrent.ScheduledExecutorPlus;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.apache.cassandra.config.DatabaseDescriptor;
import org.apache.cassandra.db.ConsistencyLevel;
import org.apache.cassandra.db.Mutation;
import org.apache.cassandra.exceptions.RequestFailureReason;
import org.apache.cassandra.io.IVersionedAsymmetricSerializer;
import org.apache.cassandra.locator.InetAddressAndPort;
import org.apache.cassandra.locator.Replica;
import org.apache.cassandra.metrics.InternodeOutboundMetrics;
import org.apache.cassandra.service.AbstractWriteResponseHandler;
import org.apache.cassandra.service.StorageProxy;
import org.apache.cassandra.service.paxos.Commit;
import org.apache.cassandra.utils.FBUtilities;

import static java.lang.String.format;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static java.util.concurrent.TimeUnit.NANOSECONDS;
import static org.apache.cassandra.concurrent.ExecutorFactory.Global.executorFactory;
import static org.apache.cassandra.concurrent.ExecutorFactory.SimulatorSemantics.DISCARD;
import static org.apache.cassandra.concurrent.Stage.INTERNAL_RESPONSE;
import static org.apache.cassandra.utils.Clock.Global.nanoTime;
import static org.apache.cassandra.utils.MonotonicClock.Global.preciseTime;

/**
 * An expiring map of request callbacks.
 *
 * Used to match response (id, peer) pairs to corresponding {@link RequestCallback}s, or, if said responses
 * don't arrive in a timely manner (within verb's timeout), to expire the callbacks.
 *
 * Since we reuse the same request id for multiple messages now, the map is keyed by (id, peer) tuples
 * rather than just id as it used to before 4.0.
 */
public class RequestCallbacks implements OutboundMessageCallbacks
{
    private static final Logger logger = LoggerFactory.getLogger(RequestCallbacks.class);

    private final MessagingService messagingService;
    private final ScheduledExecutorPlus executor = executorFactory().scheduled("Callback-Map-Reaper", DISCARD);
    private final ConcurrentMap<CallbackKey, CallbackInfo> callbacks = new ConcurrentHashMap<>();

    RequestCallbacks(MessagingService messagingService)
    {
        this.messagingService = messagingService;

        long expirationInterval = defaultExpirationInterval();
        executor.scheduleWithFixedDelay(this::expire, expirationInterval, expirationInterval, NANOSECONDS);
    }

    /**
     * @return the registered {@link CallbackInfo} for this id and peer, or {@code null} if unset or expired.
     */
    @Nullable
    CallbackInfo get(long id, InetAddressAndPort peer)
    {
        return callbacks.get(key(id, peer));
    }

    /**
     * Remove and return the {@link CallbackInfo} associated with given id and peer, if known.
     */
    @Nullable
    @VisibleForTesting
    public CallbackInfo remove(long id, InetAddressAndPort peer)
    {
        return callbacks.remove(key(id, peer));
    }

    /**
     * Register the provided {@link RequestCallback}, inferring expiry and id from the provided {@link Message}.
     */
    void addWithExpiration(RequestCallback cb, Message message, InetAddressAndPort to)
    {
        // mutations need to call the overload with a ConsistencyLevel
        assert message.verb() != Verb.MUTATION_REQ && message.verb() != Verb.COUNTER_MUTATION_REQ;
        CallbackInfo previous = callbacks.put(key(message.id(), to), new CallbackInfo(message, to, cb));
        assert previous == null : format("Callback already exists for id %d/%s! (%s)", message.id(), to, previous);
    }

    public void addWithExpiration(AbstractWriteResponseHandler<?> cb,
                                  Message<?> message,
                                  Replica to,
                                  ConsistencyLevel consistencyLevel,
                                  boolean allowHints)
    {
        assert message.verb() == Verb.MUTATION_REQ || message.verb() == Verb.COUNTER_MUTATION_REQ || message.verb() == Verb.PAXOS_COMMIT_REQ;
        CallbackInfo previous = callbacks.put(key(message.id(), to.endpoint()), new WriteCallbackInfo(message, to, cb, consistencyLevel, allowHints));
        assert previous == null : format("Callback already exists for id %d/%s! (%s)", message.id(), to.endpoint(), previous);
    }

    <In,Out> IVersionedAsymmetricSerializer<In, Out> responseSerializer(long id, InetAddressAndPort peer)
    {
        CallbackInfo info = get(id, peer);
        return info == null ? null : info.responseVerb.serializer();
    }

    @VisibleForTesting
    public void removeAndRespond(long id, InetAddressAndPort peer, Message message)
    {
        CallbackInfo ci = remove(id, peer);
        if (null != ci) ci.callback.onResponse(message);
    }

    private void removeAndExpire(long id, InetAddressAndPort peer)
    {
        CallbackInfo ci = remove(id, peer);
        if (null != ci) onExpired(ci);
    }

    private void expire()
    {
        long start = preciseTime.now();
        int n = 0;
        for (Map.Entry<CallbackKey, CallbackInfo> entry : callbacks.entrySet())
        {
            if (entry.getValue().isReadyToDieAt(start))
            {
                if (callbacks.remove(entry.getKey(), entry.getValue()))
                {
                    n++;
                    onExpired(entry.getValue());
                }
            }
        }
        logger.trace("Expired {} entries", n);
    }

    private void forceExpire()
    {
        for (Map.Entry<CallbackKey, CallbackInfo> entry : callbacks.entrySet())
            if (callbacks.remove(entry.getKey(), entry.getValue()))
                onExpired(entry.getValue());
    }

    private void onExpired(CallbackInfo info)
    {
        messagingService.latencySubscribers.maybeAdd(info.callback, info.peer, info.timeout(), NANOSECONDS);

        InternodeOutboundMetrics.totalExpiredCallbacks.mark();
        messagingService.markExpiredCallback(info.peer);

        if (info.invokeOnFailure())
            INTERNAL_RESPONSE.submit(() -> info.callback.onFailure(info.peer, RequestFailureReason.TIMEOUT));
    }

    void shutdownNow(boolean expireCallbacks)
    {
        executor.shutdownNow();
        if (expireCallbacks)
            forceExpire();
    }

    void shutdownGracefully()
    {
        expire();
        if (!callbacks.isEmpty())
            executor.schedule(this::shutdownGracefully, 100L, MILLISECONDS);
        else
            executor.shutdownNow();
    }

    void awaitTerminationUntil(long deadlineNanos) throws TimeoutException, InterruptedException
    {
        if (!executor.isTerminated())
        {
            long wait = deadlineNanos - nanoTime();
            if (wait <= 0 || !executor.awaitTermination(wait, NANOSECONDS))
                throw new TimeoutException();
        }
    }

    @VisibleForTesting
    public void unsafeClear()
    {
        callbacks.clear();
    }

    private static CallbackKey key(long id, InetAddressAndPort peer)
    {
        return new CallbackKey(id, peer);
    }

    private static class CallbackKey
    {
        final long id;
        final InetAddressAndPort peer;

        CallbackKey(long id, InetAddressAndPort peer)
        {
            this.id = id;
            this.peer = peer;
        }

        @Override
        public boolean equals(Object o)
        {
            if (!(o instanceof CallbackKey))
                return false;
            CallbackKey that = (CallbackKey) o;
            return this.id == that.id && this.peer.equals(that.peer);
        }

        @Override
        public int hashCode()
        {
            return Long.hashCode(id) + 31 * peer.hashCode();
        }

        @Override
        public String toString()
        {
            return "{id:" + id + ", peer:" + peer + '}';
        }
    }

    @VisibleForTesting
    public static class CallbackInfo
    {
        final long createdAtNanos;
        final long expiresAtNanos;

        final InetAddressAndPort peer;
        public final RequestCallback callback;

        @Deprecated // for 3.0 compatibility purposes only
        public final Verb responseVerb;

        private CallbackInfo(Message message, InetAddressAndPort peer, RequestCallback callback)
        {
            this.createdAtNanos = message.createdAtNanos();
            this.expiresAtNanos = message.expiresAtNanos();
            this.peer = peer;
            this.callback = callback;
            this.responseVerb = message.verb().responseVerb;
        }

        public long timeout()
        {
            return expiresAtNanos - createdAtNanos;
        }

        boolean isReadyToDieAt(long atNano)
        {
            return atNano > expiresAtNanos;
        }

        boolean shouldHint()
        {
            return false;
        }

        boolean invokeOnFailure()
        {
            return callback.invokeOnFailure();
        }

        public String toString()
        {
            return "{peer:" + peer + ", callback:" + callback + ", invokeOnFailure:" + invokeOnFailure() + '}';
        }
    }

    // FIXME: shouldn't need a specialized container for write callbacks; hinting should be part of
    //        AbstractWriteResponseHandler implementation.
    static class WriteCallbackInfo extends CallbackInfo
    {
        // either a Mutation, or a Paxos Commit (MessageOut)
        private final Object mutation;
        private final Replica replica;

        @VisibleForTesting
        WriteCallbackInfo(Message message, Replica replica, RequestCallback<?> callback, ConsistencyLevel consistencyLevel, boolean allowHints)
        {
            super(message, replica.endpoint(), callback);
            this.mutation = shouldHint(allowHints, message, consistencyLevel) ? message.payload : null;
            //Local writes shouldn't go through messaging service (https://issues.apache.org/jira/browse/CASSANDRA-10477)
            //noinspection AssertWithSideEffects
            assert !peer.equals(FBUtilities.getBroadcastAddressAndPort());
            this.replica = replica;
        }

        public boolean shouldHint()
        {
            return mutation != null && StorageProxy.shouldHint(replica);
        }

        public Replica getReplica()
        {
            return replica;
        }

        public Mutation mutation()
        {
            return getMutation(mutation);
        }

        private static Mutation getMutation(Object object)
        {
            assert object instanceof Commit || object instanceof Mutation : object;
            return object instanceof Commit ? ((Commit) object).makeMutation()
                                            : (Mutation) object;
        }

        private static boolean shouldHint(boolean allowHints, Message sentMessage, ConsistencyLevel consistencyLevel)
        {
            return allowHints && sentMessage.verb() != Verb.COUNTER_MUTATION_REQ && consistencyLevel != ConsistencyLevel.ANY;
        }
    }

    @Override
    public void onOverloaded(Message<?> message, InetAddressAndPort peer)
    {
        removeAndExpire(message, peer);
    }

    @Override
    public void onExpired(Message<?> message, InetAddressAndPort peer)
    {
        removeAndExpire(message, peer);
    }

    @Override
    public void onFailedSerialize(Message<?> message, InetAddressAndPort peer, int messagingVersion, int bytesWrittenToNetwork, Throwable failure)
    {
        removeAndExpire(message, peer);
    }

    @Override
    public void onDiscardOnClose(Message<?> message, InetAddressAndPort peer)
    {
        removeAndExpire(message, peer);
    }

    private void removeAndExpire(Message message, InetAddressAndPort peer)
    {
        removeAndExpire(message.id(), peer);

        /* in case of a write sent to a different DC, also expire all forwarding targets */
        ForwardingInfo forwardTo = message.forwardTo();
        if (null != forwardTo)
            forwardTo.forEach(this::removeAndExpire);
    }

    public static long defaultExpirationInterval()
    {
        return DatabaseDescriptor.getMinRpcTimeout(NANOSECONDS) / 2;
    }
}


text:
Ti={_Vendor}'s Responsibilities for Equipment and Labor

sec={_Vendor} will furnish and pay for all labor, materials, services, tools, software, equipment, and other resources (including, without limitation, computer resources) necessary to perform the Services, except as otherwise expressly specified in an {_SOW}.

=[G/Z/ol/Base]


text:
package weiboclient4j.params;

/**
 * @author Hover Ruan
 */
public enum CountType implements ParameterAction {
    Status("status"),
    Follower("follower"),
    Comment("cmt"),
    DirectMessage("dm"),
    MentionStatus("mention_status"),
    MentionComment("mention_cmt");

    private String value;

    CountType(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }

    public void addParameter(Parameters params) {
        params.add("type", getValue());
    }
}


text:
package com.winterwell.depot;

import com.thoughtworks.xstream.converters.Converter;
import com.thoughtworks.xstream.converters.MarshallingContext;
import com.thoughtworks.xstream.converters.UnmarshallingContext;
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
import com.winterwell.utils.ReflectionUtils;
import com.winterwell.utils.web.XStreamUtils;

/**
 * Alter XStream to guard {@link INotSerializable}.
 * TODO test this!
 * @see XStreamUtils which uses reflection to access this.
 * @author daniel
 */
public class INotSerializableBlocker implements Converter {

	public INotSerializableBlocker() {
	}

	@Override
	public boolean canConvert(Class type) {
		return ReflectionUtils.isa(type, INotSerializable.class);
	}

	@Override
	public void marshal(Object source, HierarchicalStreamWriter writer,
			MarshallingContext context) {
		throw new UnsupportedOperationException("Not for serialising: "+source.getClass()+": "+source);
	}

	@Override
	public Object unmarshal(HierarchicalStreamReader reader,
			UnmarshallingContext context)
	{
		throw new IllegalStateException(reader.getNodeName());
	}

}


text:
import mgdpck
from mgdpck import _version
from mgdpck import data_access
from mgdpck import exceptions
from mgdpck import logging_util
from mgdpck import model
from mgdpck import actions
from mgdpck.readers import *
from mgdpck.writters import *
# from scripts import mgd


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Reactive.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Newtonsoft.Json;

namespace Microsoft.Net.Http.Tests
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        async public Task TestMethod1()
        {
            variable<HttpClient> client = new HttpClient();
            variable<string> url = "http://jsonplaceholder.typicode.com/users";
            var result = client.GetStringAsync(url);
            var deserialized = __JsonConvert.DeserializeObject<IEnumerable<User>>(result);
            deserialized = deserialized.FirstAsync();
            var serialized = __JsonConvert.SerializeObject(deserialized);
            await __Console.WriteLine(serialized);
        }
    }

    public class User
    {
        public int ID { get; set; }
        public string Name { get; set; }
        public string UserName { get; set; }
        public string Email { get; set; }
        public string Phone { get; set; }
        public string Website { get; set; }
        public Address Address { get; set; }
    }

    public class Address
    {
        public string Street { get; set; }
        public string Suite { get; set; }
        public string City { get; set; }
        public string Zipcode { get; set; }
    }

    public class variable<T> : IObservable<T>
    {
        private readonly IObservable<T> observable;

        private variable(T value)
        {
            this.observable = Observable.Return(value);
        }

        public static implicit operator variable<T>(T value)
        {
            return new variable<T>(value);
        }

        public IDisposable Subscribe(IObserver<T> observer)
        {
            return observable.Subscribe(observer);
        }
    }
}


text:
// SPDX-License-Identifier: Apache-2.0

#include <gtest/gtest.h>
#include <stumpless.h>
#include <stumpless.hpp>

using namespace stumpless;

namespace {

  class CppTargetTest : public::testing::Test {
  protected:
    StreamTarget *target;

    virtual void
    SetUp( void ) {
      target = new StreamTarget( "test-target", stdout );
    }

    virtual void
    TearDown( void ) {
      delete target;
    }

  };

  TEST_F( CppTargetTest, GetFilter ) {
    target->GetFilter(  );
  }

  TEST_F( CppTargetTest, GetMask ) {
    target->GetMask(  );
  }

  TEST_F( CppTargetTest, SetFilter ) {
    stumpless_filter_func_t old_filter = target->GetFilter(  );

    target->SetFilter( []( const struct stumpless_target *target,
                           const struct stumpless_entry *entry ) -> bool {
      return true;
    } );

    ASSERT_NE( target->GetFilter(  ), old_filter );
  }

  TEST_F( CppTargetTest, SetMask ) {
    int old_mask = target->GetMask(  );
    int new_mask = STUMPLESS_SEVERITY_MASK_UPTO( STUMPLESS_SEVERITY_ERR );
    ASSERT_NE( old_mask, new_mask );

    target->SetMask( new_mask );

    int actual_mask = target->GetMask(  );
    EXPECT_EQ( actual_mask, new_mask );
  }
}


text:
package org.spongepowered.api.event.entity;

import org.spongepowered.api.util.event.Cancellable;

/**
 * An event that occurs when an entity becomes ignited.
 */
public interface EntityIgniteEvent extends EntityEvent, Cancellable {

    /**
     * Gets the amount of ticks the entity will remain on fire.
     *
     * @return The amount of ticks the entity will remain on fire
     */
    int getFireTicks();

    /**
     * Sets the amount of ticks the entity will remain on fire.
     *
     * @param fireTicks The amount of ticks the entity will remain on fire
     */
    void setFireTicks(int fireTicks);

    /**
     * Checks if this is a flowerpot.
     *
     * @return Whether this is a flowerpot
     */
    boolean isFlowerPot();
}


text:
package org.qi4j.manual.recipes.sideeffects;

public interface Confirmable
{
}


text:
<?php
namespace Yjv\Bundle\ReportRenderingBundle\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Reference;

use Symfony\Component\DependencyInjection\ContainerBuilder;

use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;

class AddDataTransformersPass implements CompilerPassInterface {

    public function process(ContainerBuilder $container) {

        if (!$container->hasDefinition('yjv.report_rendering.data_transformer.registry')) {

			return;
		}

		$dataTransformerRegistry = $container->getDefinition('yjv.report_rendering.data_transformer.registry');

		foreach ($container->findTaggedServiceIds('yjv.report_rendering.data_transformer') as $id => $tags) {

			$tag = $tags[0];

			if (!isset($tag['alias'])) {

			    throw new \RuntimeException(sprintf('service "%s" tagged "yjv.report_rendering.data_transformer" must have an alias attribute', $id));
			}

		    $dataTransformerRegistry->addMethodCall('set', array($tag['alias'], new Reference($id)));
		}
	}
}


text:
package com.yp.xueba;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.View;

public class GifView extends View implements Runnable {
    gifOpenHelper gHelper;
    private boolean isStop = true;
    int delta;
    String title;

    Bitmap bmp;

    // construct - refer for java
    public GifView(Context context) {
        this(context, null);

    }

    // construct - refer for xml
    public GifView(Context context, AttributeSet attrs) {
        super(context, attrs);
//Ìí¼ÓÊôÐÔ
        TypedArray ta = context.obtainStyledAttributes(attrs,
                R.styleable.gifView);
        int n = ta.getIndexCount();

        for (int i = 0; i < n; i++) {
            int attr = ta.getIndex(i);

            switch (attr) {
            case R.styleable.gifView_src:
                int id = ta.getResourceId(R.styleable.gifView_src, 0);
                setSrc(id);
                break;

            case R.styleable.gifView_delay:
                int idelta = ta.getInteger(R.styleable.gifView_delay, 1);
                setDelta(idelta);
                break;

            case R.styleable.gifView_stop:
                boolean sp = ta.getBoolean(R.styleable.gifView_stop, false);
                if (!sp) {
                    setStop();
                }
                break;
            }

        }

        ta.recycle();
    }

    /**
     * ÉèÖÃÍ£Ö¹
     *
     * @param stop
     */
    public void setStop() {
        isStop = false;
    }

    /**
     * ÉèÖÃÆô¶¯
     */
    public void setStart() {
        isStop = true;

        Thread updateTimer = new Thread(this);
        updateTimer.start();
    }

    /**
     * ͨ¹ýÏÂƱÉèÖõڼ¸ÕÅͼƬÏÔʾ
     * @param id
     */
    public void setSrc(int id) {

        gHelper = new gifOpenHelper();
        gHelper.read(GifView.this.getResources().openRawResource(id));
        bmp = gHelper.getImage();// µÃµ½µÚÒ»ÕÅͼƬ
    }

    public void setDelta(int is) {
        delta = is;
    }

    // to meaure its Width & Height
    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        setMeasuredDimension(measureWidth(widthMeasureSpec),
                measureHeight(heightMeasureSpec));
    }

    private int measureWidth(int measureSpec) {
        return gHelper.getWidth();
    }

    private int measureHeight(int measureSpec) {
        return gHelper.getHeigh();
    }

    protected void onDraw(Canvas canvas) {
        // TODO Auto-generated method stub
        canvas.drawBitmap(bmp, 0, 0, new Paint());
        bmp = gHelper.nextBitmap();

    }

    public void run() {
        // TODO Auto-generated method stub
        while (isStop) {
            try {
                this.postInvalidate();
                Thread.sleep(gHelper.nextDelay() / delta);
            } catch (Exception ex) {

            }
        }
    }

}


text:
package uk.ac.ucl.chime.tests;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openehr.rm.datastructure.itemstructure.representation.Element;
import org.openehr.rm.datatypes.text.DvCodedText;

import uk.ac.ucl.chime.utilities.ArchetypeWrapperFactory;
import uk.ac.ucl.chime.wrappers.CodedTextValueConstraintBindingWrapper;
import uk.ac.ucl.chime.wrappers.ElementWrapper;
import uk.ac.ucl.chime.wrappers.archetypewrappers.ArchetypeWrapper;
import uk.ac.ucl.chime.wrappers.archetypewrappers.EvaluationArchetypeWrapper;

public class CodedTextValueConstraintBindingWrapperTest extends AbstractOpenEHRTestCase {

	private ArchetypeWrapper termBoundArcWrp;

	@Before
	public void setUp() throws Exception {
		super.setUp();
		ArchetypeWrapperFactory factory = new ArchetypeWrapperFactory();
		termBoundArcWrp = factory.loadFromFile("c:\\archetypeRepository\\openEHR-EHR-EVALUATION.SOAP_Assessment_RCPTERMBOUND.v3.adl");
	}

	@After
	public void tearDown() throws Exception {
		super.tearDown();
	}

	@Test
	public void testGetTestInstance() throws Exception {
		EvaluationArchetypeWrapper wrapper = (EvaluationArchetypeWrapper) termBoundArcWrp;
		ElementWrapper ew = wrapper.getElementAtNode("/data[at0001]/items[at0003]/value");
		assertEquals(ew == null, false);
		//get 100 test instances, which should have different codes
		for(int i = 0; i < 100; i++){
			Object rmElement = ew.getTestInstance();
			if (rmElement == null)//at the moment, random terminology code generator may return null
				continue;
			DvCodedText dvCodedTxt =  (DvCodedText) ((Element)rmElement).getValue();
			assertEquals(dvCodedTxt.getValue() == null, false);
			assertEquals(dvCodedTxt.getValue().length() < 1, false);
			assertEquals(dvCodedTxt.getDefiningCode().getCodeString() == null, false);
			assertEquals(dvCodedTxt.getDefiningCode().getCodeString().length() < 1, false);
			assertEquals(((DvCodedText)dvCodedTxt).getValue().length() > 0 , true);
		}
	}

}


text:
define("dojox/charting/widget/Chart", ["dojo/_base/kernel", "dojo/_base/lang", "dojo/_base/array","dojo/dom-attr","dojo/_base/declare", "dojo/query",
	"dijit/_WidgetBase", "../Chart", "dojox/lang/utils", "dojox/lang/functional","dojox/lang/functional/lambda"],
	function(kernel, lang, arr, domAttr, declare, query, _WidgetBase, Chart, du, df, dfl){

	var collectParams, collectAxisParams, collectPlotParams,
		collectActionParams, collectDataParams,
		notNull = function(o){ return o; },
		dc = lang.getObject("dojox.charting");

	collectParams = function(node, type, kw){
		var dp = eval("(" + type + ".prototype.defaultParams)");
		var x, attr;
		for(x in dp){
			if(x in kw){ continue; }
			attr = node.getAttribute(x);
			kw[x] = du.coerceType(dp[x], attr == null || typeof attr == "undefined" ? dp[x] : attr);
		}
		var op = eval("(" + type + ".prototype.optionalParams)");
		for(x in op){
			if(x in kw){ continue; }
			attr = node.getAttribute(x);
			if(attr != null){
				kw[x] = du.coerceType(op[x], attr);
			}
		}
	};

	collectAxisParams = function(node){
		var name = node.getAttribute("name"), type = node.getAttribute("type");
		if(!name){ return null; }
		var o = {name: name, kwArgs: {}}, kw = o.kwArgs;
		if(type){
			if(dc.axis2d[type]){
				type = kernel._scopeName + "x.charting.axis2d." + type;
			}
			var axis = eval("(" + type + ")");
			if(axis){ kw.type = axis; }
		}else{
			type = kernel._scopeName + "x.charting.axis2d.Default";
		}
		collectParams(node, type, kw);
		// compatibility conversions
		if(kw.font || kw.fontColor){
			if(!kw.tick){
				kw.tick = {};
			}
			if(kw.font){
				kw.tick.font = kw.font;
			}
			if(kw.fontColor){
				kw.tick.fontColor = kw.fontColor;
			}
		}
		return o;
	};

	collectPlotParams = function(node){
		// var name = d.attr(node, "name"), type = d.attr(node, "type");
		var name = node.getAttribute("name"), type = node.getAttribute("type");
		if(!name){ return null; }
		var o = {name: name, kwArgs: {}}, kw = o.kwArgs;
		if(type){
			if(dc.plot2d && dc.plot2d[type]){
				type = kernel._scopeName + "x.charting.plot2d." + type;
			}
			var plot = eval("(" + type + ")");
			if(plot){ kw.type = plot; }
		}else{
			type = kernel._scopeName + "x.charting.plot2d.Default";
		}
		collectParams(node, type, kw);
		return o;
	};

	collectActionParams = function(node){
		// var plot = d.attr(node, "plot"), type = d.attr(node, "type");
		var plot = node.getAttribute("plot"), type = node.getAttribute("type");
		if(!plot){ plot = "default"; }
		var o = {plot: plot, kwArgs: {}}, kw = o.kwArgs;
		if(type){
			if(dc.action2d[type]){
				type = kernel._scopeName + "x.charting.action2d." + type;
			}
			var action = eval("(" + type + ")");
			if(!action){ return null; }
			o.action = action;
		}else{
			return null;
		}
		collectParams(node, type, kw);
		return o;
	};

	collectDataParams = function(node){
		var ga = lang.partial(domAttr.get, node);
		var name = ga("name");
		if(!name){ return null; }
		var o = { name: name, kwArgs: {} }, kw = o.kwArgs, t;
		t = ga("plot");
		if(t != null){ kw.plot = t; }
		t = ga("marker");
		if(t != null){ kw.marker = t; }
		t = ga("stroke");
		if(t != null){ kw.stroke = eval("(" + t + ")"); }
		t = ga("outline");
		if(t != null){ kw.outline = eval("(" + t + ")"); }
		t = ga("shadow");
		if(t != null){ kw.shadow = eval("(" + t + ")"); }
		t = ga("fill");
		if(t != null){ kw.fill = eval("(" + t + ")"); }
		t = ga("font");
		if(t != null){ kw.font = t; }
		t = ga("fontColor");
		if(t != null){ kw.fontColor = eval("(" + t + ")"); }
		t = ga("legend");
		if(t != null){ kw.legend = t; }
		t = ga("data");
		if(t != null){
			o.type = "data";
			o.data = t ? arr.map(String(t).split(','), Number) : [];
			return o;
		}
		t = ga("array");
		if(t != null){
			o.type = "data";
			o.data = eval("(" + t + ")");
			return o;
		}
		t = ga("store");
		if(t != null){
			o.type = "store";
			o.data = eval("(" + t + ")");
			t = ga("field");
			o.field = t != null ? t : "value";
			t = ga("query");
			if(!!t){ kw.query = t; }
			t = ga("queryOptions");
			if(!!t){ kw.queryOptions = eval("(" + t + ")"); }
			t = ga("start");
			if(!!t){ kw.start = Number(t); }
			t = ga("count");
			if(!!t){ kw.count = Number(t); }
			t = ga("sort");
			if(!!t){ kw.sort = eval("("+t+")"); }
			t = ga("valueFn");
			if(!!t){ kw.valueFn = dfl.lambda(t); }
			return o;
		}
		return null;
	};

	return declare("dojox.charting.widget.Chart", _WidgetBase, {
		// summary:
		//		A chart widget.  This is leveraging dojox/charting/Chart as a Dijit widget.

		// parameters for the markup

		// theme: dojox/charting/SimpleTheme?
		//		An optional theme to use for styling the chart.
		theme: null,

		// margins: Object?
		//		The margins around the chart. Default is { l:10, t:10, r:10, b:10 }.
		margins: null,

		// chart area, define them as undefined to:
		// allow the parser to take them into account
		// but make sure they have no defined value to not override theme

		// stroke: dojox.gfx.Stroke?
		//		The outline of the chart (stroke in vector graphics terms).
		stroke: undefined,
		// fill: dojox.gfx.Fill?
		//		The color for the chart.
		fill:   undefined,

		// methods

		buildRendering: function(){
			this.inherited(arguments);

			n = this.domNode;

			// collect chart parameters
			var axes    = query("> .axis", n).map(collectAxisParams).filter(notNull),
				plots   = query("> .plot", n).map(collectPlotParams).filter(notNull),
				actions = query("> .action", n).map(collectActionParams).filter(notNull),
				series  = query("> .series", n).map(collectDataParams).filter(notNull);

			// build the chart
			n.innerHTML = "";
			var c = this.chart = new Chart(n, {
				margins: this.margins,
				stroke:  this.stroke,
				fill:    this.fill,
				textDir: this.textDir
			});

			// add collected parameters
			if(this.theme){
				c.setTheme(this.theme);
			}
			axes.forEach(function(axis){
				c.addAxis(axis.name, axis.kwArgs);
			});
			plots.forEach(function(plot){
				c.addPlot(plot.name, plot.kwArgs);
			});

			this.actions = actions.map(function(action){
				return new action.action(c, action.plot, action.kwArgs);
			});

			var render = df.foldl(series, function(render, series){
				if(series.type == "data"){
					c.addSeries(series.name, series.data, series.kwArgs);
					render = true;
				}else{
					c.addSeries(series.name, [0], series.kwArgs);
					var kw = {};
					du.updateWithPattern(
						kw,
						series.kwArgs,
						{
							"query": "",
							"queryOptions": null,
							"start": 0,
							"count": 1 //,
							// "sort": []
						},
						true
					);
					if(series.kwArgs.sort){
						// sort is a complex object type and doesn't survive coercian
						kw.sort = lang.clone(series.kwArgs.sort);
					}
					lang.mixin(kw, {
						onComplete: function(data){
							var values;
							if("valueFn" in series.kwArgs){
								var fn = series.kwArgs.valueFn;
								values = arr.map(data, function(x){
									return fn(series.data.getValue(x, series.field, 0));
								});
							}else{
								values = arr.map(data, function(x){
									return series.data.getValue(x, series.field, 0);
								});
							}
							c.addSeries(series.name, values, series.kwArgs).render();
						}
					});
					series.data.fetch(kw);
				}
				return render;
			}, false);
			if(render){ c.render(); }
		},
		destroy: function(){
			// summary:
			//		properly destroy the widget
			this.chart.destroy();
			this.inherited(arguments);
		},
		resize: function(box){
			// summary:
			//		Resize the widget.
			// description:
			//		Resize the domNode and the widget surface to the dimensions of a box of the following form:
			//		`{ l: 50, t: 200, w: 300: h: 150 }`
			//		If no box is provided, resize the surface to the marginBox of the domNode.
			// box:
			//		If passed, denotes the new size of the widget.
			this.chart.resize(box);
		}
	});
});


text:
package org.gradoop.flink.model.impl.operators.matching.single.cypher.utils;

/**
 * Specifies the direction of an expand operation
 */
public enum ExpandDirection {
  /**
   * Expand along incoming edges
   */
  IN,
  /**
   * Expand along outgoing edges
   */
  OUT
}


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

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

    #region Component Designer generated code

    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    {
      this.components = new System.ComponentModel.Container();
      System.Windows.Forms.Label FirstNameLabel;
      System.Windows.Forms.Label IdLabel;
      System.Windows.Forms.Label LastNameLabel;
      this.CloseButton = new System.Windows.Forms.Button();
      this.ApplyButton = new System.Windows.Forms.Button();
      this.Cancel_Button = new System.Windows.Forms.Button();
      this.OKButton = new System.Windows.Forms.Button();
      this.GroupBox1 = new System.Windows.Forms.GroupBox();
      this.AssignmentsDataGridView = new System.Windows.Forms.DataGridView();
      this.RoleListBindingSource = new System.Windows.Forms.BindingSource(this.components);
      this.AssignmentsBindingSource = new System.Windows.Forms.BindingSource(this.components);
      this.ResourceBindingSource = new System.Windows.Forms.BindingSource(this.components);
      this.UnassignButton = new System.Windows.Forms.Button();
      this.AssignButton = new System.Windows.Forms.Button();
      this.FirstNameTextBox = new System.Windows.Forms.TextBox();
      this.IdLabel1 = new System.Windows.Forms.Label();
      this.LastNameTextBox = new System.Windows.Forms.TextBox();
      this.ErrorProvider1 = new System.Windows.Forms.ErrorProvider(this.components);
      this.ReadWriteAuthorization1 = new Csla.Windows.ReadWriteAuthorization(this.components);
      this.RefreshButton = new System.Windows.Forms.Button();
      this.bindingSourceRefresh1 = new Csla.Windows.BindingSourceRefresh(this.components);
      this.ProjectId = new System.Windows.Forms.DataGridViewTextBoxColumn();
      this.ProjectName = new System.Windows.Forms.DataGridViewLinkColumn();
      this.Assigned = new System.Windows.Forms.DataGridViewTextBoxColumn();
      this.Role = new System.Windows.Forms.DataGridViewComboBoxColumn();
      FirstNameLabel = new System.Windows.Forms.Label();
      IdLabel = new System.Windows.Forms.Label();
      LastNameLabel = new System.Windows.Forms.Label();
      this.GroupBox1.SuspendLayout();
      ((System.ComponentModel.ISupportInitialize)(this.AssignmentsDataGridView)).BeginInit();
      ((System.ComponentModel.ISupportInitialize)(this.RoleListBindingSource)).BeginInit();
      ((System.ComponentModel.ISupportInitialize)(this.AssignmentsBindingSource)).BeginInit();
      ((System.ComponentModel.ISupportInitialize)(this.ResourceBindingSource)).BeginInit();
      ((System.ComponentModel.ISupportInitialize)(this.ErrorProvider1)).BeginInit();
      ((System.ComponentModel.ISupportInitialize)(this.bindingSourceRefresh1)).BeginInit();
      this.SuspendLayout();
      //
      // FirstNameLabel
      //
      this.ReadWriteAuthorization1.SetApplyAuthorization(FirstNameLabel, false);
      FirstNameLabel.AutoSize = true;
      FirstNameLabel.Location = new System.Drawing.Point(13, 42);
      FirstNameLabel.Name = "FirstNameLabel";
      FirstNameLabel.Size = new System.Drawing.Size(60, 13);
      FirstNameLabel.TabIndex = 2;
      FirstNameLabel.Text = "First Name:";
      //
      // IdLabel
      //
      this.ReadWriteAuthorization1.SetApplyAuthorization(IdLabel, false);
      IdLabel.AutoSize = true;
      IdLabel.Location = new System.Drawing.Point(13, 13);
      IdLabel.Name = "IdLabel";
      IdLabel.Size = new System.Drawing.Size(19, 13);
      IdLabel.TabIndex = 0;
      IdLabel.Text = "Id:";
      //
      // LastNameLabel
      //
      this.ReadWriteAuthorization1.SetApplyAuthorization(LastNameLabel, false);
      LastNameLabel.AutoSize = true;
      LastNameLabel.Location = new System.Drawing.Point(13, 68);
      LastNameLabel.Name = "LastNameLabel";
      LastNameLabel.Size = new System.Drawing.Size(61, 13);
      LastNameLabel.TabIndex = 4;
      LastNameLabel.Text = "Last Name:";
      //
      // CloseButton
      //
      this.CloseButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
      this.ReadWriteAuthorization1.SetApplyAuthorization(this.CloseButton, false);
      this.CloseButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
      this.CloseButton.Location = new System.Drawing.Point(501, 100);
      this.CloseButton.Name = "CloseButton";
      this.CloseButton.Size = new System.Drawing.Size(75, 23);
      this.CloseButton.TabIndex = 10;
      this.CloseButton.Text = "Close";
      this.CloseButton.UseVisualStyleBackColor = true;
      this.CloseButton.Click += new System.EventHandler(this.CloseButton_Click);
      //
      // ApplyButton
      //
      this.ApplyButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
      this.ReadWriteAuthorization1.SetApplyAuthorization(this.ApplyButton, false);
      this.ApplyButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
      this.ApplyButton.Location = new System.Drawing.Point(501, 42);
      this.ApplyButton.Name = "ApplyButton";
      this.ApplyButton.Size = new System.Drawing.Size(75, 23);
      this.ApplyButton.TabIndex = 8;
      this.ApplyButton.Text = "Apply";
      this.ApplyButton.UseVisualStyleBackColor = true;
      this.ApplyButton.Click += new System.EventHandler(this.ApplyButton_Click);
      //
      // Cancel_Button
      //
      this.Cancel_Button.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
      this.ReadWriteAuthorization1.SetApplyAuthorization(this.Cancel_Button, false);
      this.Cancel_Button.DialogResult = System.Windows.Forms.DialogResult.Cancel;
      this.Cancel_Button.Location = new System.Drawing.Point(501, 71);
      this.Cancel_Button.Name = "Cancel_Button";
      this.Cancel_Button.Size = new System.Drawing.Size(75, 23);
      this.Cancel_Button.TabIndex = 9;
      this.Cancel_Button.Text = "Cancel";
      this.Cancel_Button.UseVisualStyleBackColor = true;
      this.Cancel_Button.Click += new System.EventHandler(this.Cancel_Button_Click);
      //
      // OKButton
      //
      this.OKButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
      this.ReadWriteAuthorization1.SetApplyAuthorization(this.OKButton, false);
      this.OKButton.Location = new System.Drawing.Point(501, 13);
      this.OKButton.Name = "OKButton";
      this.OKButton.Size = new System.Drawing.Size(75, 23);
      this.OKButton.TabIndex = 7;
      this.OKButton.Text = "OK";
      this.OKButton.UseVisualStyleBackColor = true;
      this.OKButton.Click += new System.EventHandler(this.OKButton_Click);
      //
      // GroupBox1
      //
      this.GroupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
      this.ReadWriteAuthorization1.SetApplyAuthorization(this.GroupBox1, false);
      this.GroupBox1.Controls.Add(this.AssignmentsDataGridView);
      this.GroupBox1.Controls.Add(this.UnassignButton);
      this.GroupBox1.Controls.Add(this.AssignButton);
      this.GroupBox1.Location = new System.Drawing.Point(16, 91);
      this.GroupBox1.Name = "GroupBox1";
      this.GroupBox1.Size = new System.Drawing.Size(449, 310);
      this.GroupBox1.TabIndex = 6;
      this.GroupBox1.TabStop = false;
      this.GroupBox1.Text = "Assigned projects";
      //
      // AssignmentsDataGridView
      //
      this.AssignmentsDataGridView.AllowUserToAddRows = false;
      this.AssignmentsDataGridView.AllowUserToDeleteRows = false;
      this.AssignmentsDataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
      this.ReadWriteAuthorization1.SetApplyAuthorization(this.AssignmentsDataGridView, false);
      this.AssignmentsDataGridView.AutoGenerateColumns = false;
      this.AssignmentsDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
      this.AssignmentsDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
            this.ProjectId,
            this.ProjectName,
            this.Assigned,
            this.Role});
      this.AssignmentsDataGridView.DataSource = this.AssignmentsBindingSource;
      this.AssignmentsDataGridView.Location = new System.Drawing.Point(6, 19);
      this.AssignmentsDataGridView.MultiSelect = false;
      this.AssignmentsDataGridView.Name = "AssignmentsDataGridView";
      this.AssignmentsDataGridView.RowHeadersVisible = false;
      this.AssignmentsDataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
      this.AssignmentsDataGridView.Size = new System.Drawing.Size(356, 285);
      this.AssignmentsDataGridView.TabIndex = 0;
      this.AssignmentsDataGridView.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.AssignmentsDataGridView_CellContentClick);
      //
      // RoleListBindingSource
      //
      this.RoleListBindingSource.DataSource = typeof(ProjectTracker.Library.RoleList);
      this.bindingSourceRefresh1.SetReadValuesOnChange(this.RoleListBindingSource, false);
      //
      // AssignmentsBindingSource
      //
      this.AssignmentsBindingSource.DataMember = "Assignments";
      this.AssignmentsBindingSource.DataSource = this.ResourceBindingSource;
      this.bindingSourceRefresh1.SetReadValuesOnChange(this.AssignmentsBindingSource, false);
      //
      // ResourceBindingSource
      //
      this.ResourceBindingSource.DataSource = typeof(ProjectTracker.Library.ResourceEdit);
      this.bindingSourceRefresh1.SetReadValuesOnChange(this.ResourceBindingSource, true);
      //
      // UnassignButton
      //
      this.UnassignButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
      this.ReadWriteAuthorization1.SetApplyAuthorization(this.UnassignButton, false);
      this.UnassignButton.Location = new System.Drawing.Point(368, 48);
      this.UnassignButton.Name = "UnassignButton";
      this.UnassignButton.Size = new System.Drawing.Size(75, 23);
      this.UnassignButton.TabIndex = 2;
      this.UnassignButton.Text = "Unassign";
      this.UnassignButton.UseVisualStyleBackColor = true;
      this.UnassignButton.Click += new System.EventHandler(this.UnassignButton_Click);
      //
      // AssignButton
      //
      this.AssignButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
      this.ReadWriteAuthorization1.SetApplyAuthorization(this.AssignButton, false);
      this.AssignButton.Location = new System.Drawing.Point(368, 19);
      this.AssignButton.Name = "AssignButton";
      this.AssignButton.Size = new System.Drawing.Size(75, 23);
      this.AssignButton.TabIndex = 1;
      this.AssignButton.Text = "Assign";
      this.AssignButton.UseVisualStyleBackColor = true;
      this.AssignButton.Click += new System.EventHandler(this.AssignButton_Click);
      //
      // FirstNameTextBox
      //
      this.FirstNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
      this.ReadWriteAuthorization1.SetApplyAuthorization(this.FirstNameTextBox, true);
      this.FirstNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.ResourceBindingSource, "FirstName", true));
      this.FirstNameTextBox.Location = new System.Drawing.Point(80, 39);
      this.FirstNameTextBox.Name = "FirstNameTextBox";
      this.FirstNameTextBox.Size = new System.Drawing.Size(385, 20);
      this.FirstNameTextBox.TabIndex = 3;
      //
      // IdLabel1
      //
      this.IdLabel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
      this.ReadWriteAuthorization1.SetApplyAuthorization(this.IdLabel1, true);
      this.IdLabel1.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.ResourceBindingSource, "Id", true));
      this.IdLabel1.Location = new System.Drawing.Point(80, 13);
      this.IdLabel1.Name = "IdLabel1";
      this.IdLabel1.Size = new System.Drawing.Size(385, 23);
      this.IdLabel1.TabIndex = 1;
      //
      // LastNameTextBox
      //
      this.LastNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
      this.ReadWriteAuthorization1.SetApplyAuthorization(this.LastNameTextBox, true);
      this.LastNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.ResourceBindingSource, "LastName", true));
      this.LastNameTextBox.Location = new System.Drawing.Point(80, 65);
      this.LastNameTextBox.Name = "LastNameTextBox";
      this.LastNameTextBox.Size = new System.Drawing.Size(385, 20);
      this.LastNameTextBox.TabIndex = 5;
      //
      // ErrorProvider1
      //
      this.ErrorProvider1.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
      this.ErrorProvider1.ContainerControl = this;
      this.ErrorProvider1.DataSource = this.ResourceBindingSource;
      //
      // RefreshButton
      //
      this.RefreshButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
      this.ReadWriteAuthorization1.SetApplyAuthorization(this.RefreshButton, false);
      this.RefreshButton.Location = new System.Drawing.Point(501, 129);
      this.RefreshButton.Name = "RefreshButton";
      this.RefreshButton.Size = new System.Drawing.Size(75, 23);
      this.RefreshButton.TabIndex = 11;
      this.RefreshButton.Text = "Refresh";
      this.RefreshButton.UseVisualStyleBackColor = true;
      this.RefreshButton.Click += new System.EventHandler(this.RefreshButton_Click);
      //
      // bindingSourceRefresh1
      //
      this.bindingSourceRefresh1.Host = this;
      //
      // projectIdDataGridViewTextBoxColumn
      //
      this.ProjectId.DataPropertyName = "ProjectId";
      this.ProjectId.HeaderText = "ProjectId";
      this.ProjectId.Name = "ProjectId";
      this.ProjectId.ReadOnly = true;
      this.ProjectId.Visible = false;
      this.ProjectId.Width = 74;
      //
      // projectNameDataGridViewTextBoxColumn
      //
      this.ProjectName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
      this.ProjectName.DataPropertyName = "ProjectName";
      this.ProjectName.FillWeight = 200F;
      this.ProjectName.HeaderText = "Project Name";
      this.ProjectName.Name = "ProjectName";
      this.ProjectName.ReadOnly = true;
      this.ProjectName.Resizable = System.Windows.Forms.DataGridViewTriState.True;
      this.ProjectName.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
      //
      // assignedDataGridViewTextBoxColumn
      //
      this.Assigned.DataPropertyName = "Assigned";
      this.Assigned.HeaderText = "Assigned";
      this.Assigned.Name = "Assigned";
      this.Assigned.ReadOnly = true;
      this.Assigned.Width = 75;
      //
      // Role
      //
      this.Role.DataPropertyName = "Role";
      this.Role.DataSource = this.RoleListBindingSource;
      this.Role.DisplayMember = "Value";
      this.Role.FillWeight = 200F;
      this.Role.HeaderText = "Role";
      this.Role.Name = "Role";
      this.Role.ValueMember = "Key";
      this.Role.Width = 35;
      //
      // ResourceEdit
      //
      this.ReadWriteAuthorization1.SetApplyAuthorization(this, false);
      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
      this.Controls.Add(this.RefreshButton);
      this.Controls.Add(this.CloseButton);
      this.Controls.Add(this.ApplyButton);
      this.Controls.Add(this.Cancel_Button);
      this.Controls.Add(this.OKButton);
      this.Controls.Add(this.GroupBox1);
      this.Controls.Add(FirstNameLabel);
      this.Controls.Add(this.FirstNameTextBox);
      this.Controls.Add(IdLabel);
      this.Controls.Add(this.IdLabel1);
      this.Controls.Add(LastNameLabel);
      this.Controls.Add(this.LastNameTextBox);
      this.Name = "ResourceEdit";
      this.Size = new System.Drawing.Size(588, 415);
      this.Load += new System.EventHandler(this.ResourceEdit_Load);
      this.GroupBox1.ResumeLayout(false);
      ((System.ComponentModel.ISupportInitialize)(this.AssignmentsDataGridView)).EndInit();
      ((System.ComponentModel.ISupportInitialize)(this.RoleListBindingSource)).EndInit();
      ((System.ComponentModel.ISupportInitialize)(this.AssignmentsBindingSource)).EndInit();
      ((System.ComponentModel.ISupportInitialize)(this.ResourceBindingSource)).EndInit();
      ((System.ComponentModel.ISupportInitialize)(this.ErrorProvider1)).EndInit();
      ((System.ComponentModel.ISupportInitialize)(this.bindingSourceRefresh1)).EndInit();
      this.ResumeLayout(false);
      this.PerformLayout();

    }

    #endregion

    internal System.Windows.Forms.Button CloseButton;
    internal System.Windows.Forms.Button ApplyButton;
    internal System.Windows.Forms.Button Cancel_Button;
    internal System.Windows.Forms.Button OKButton;
    internal System.Windows.Forms.GroupBox GroupBox1;
    internal System.Windows.Forms.Button UnassignButton;
    internal System.Windows.Forms.Button AssignButton;
    internal System.Windows.Forms.TextBox FirstNameTextBox;
    internal System.Windows.Forms.Label IdLabel1;
    internal System.Windows.Forms.TextBox LastNameTextBox;
    internal Csla.Windows.ReadWriteAuthorization ReadWriteAuthorization1;
    internal System.Windows.Forms.DataGridView AssignmentsDataGridView;
    internal System.Windows.Forms.BindingSource RoleListBindingSource;
    internal System.Windows.Forms.BindingSource AssignmentsBindingSource;
    internal System.Windows.Forms.BindingSource ResourceBindingSource;
    internal System.Windows.Forms.ErrorProvider ErrorProvider1;
    private Csla.Windows.BindingSourceRefresh bindingSourceRefresh1;
    internal System.Windows.Forms.Button RefreshButton;
    private System.Windows.Forms.DataGridViewTextBoxColumn ProjectId;
    private System.Windows.Forms.DataGridViewLinkColumn ProjectName;
    private System.Windows.Forms.DataGridViewTextBoxColumn Assigned;
    private System.Windows.Forms.DataGridViewComboBoxColumn Role;
  }
}


text:
module RuboCop
  module Cop
    module Layout
      # Access modifiers should be surrounded by blank lines.
      #
      # @example
      #
      #   # bad
      #   class Foo
      #     def bar; end
      #     private
      #     def baz; end
      #   end
      #
      #   # good
      #   class Foo
      #     def bar; end
      #
      #     private
      #
      #     def baz; end
      #   end
      class EmptyLinesAroundAccessModifier < Cop
        include AccessModifierNode

        MSG_AFTER = 'Keep a blank line after `%s`.'.freeze
        MSG_BEFORE_AND_AFTER = 'Keep a blank line before and after `%s`.'.freeze

        def on_send(node)
          return unless modifier_node?(node)

          return if empty_lines_around?(node)

          add_offense(node)
        end

        def autocorrect(node)
          lambda do |corrector|
            send_line = node.loc.line
            previous_line = processed_source[send_line - 2]
            next_line = processed_source[send_line]
            line = range_by_whole_lines(node.source_range)

            unless previous_line_empty?(previous_line)
              corrector.insert_before(line, "\n")
            end

            unless next_line_empty?(next_line)
              corrector.insert_after(line, "\n")
            end
          end
        end

        private

        def previous_line_ignoring_comments(processed_source, send_line)
          processed_source[0..send_line - 2].reverse.find do |line|
            !comment_line?(line)
          end
        end

        def previous_line_empty?(previous_line)
          block_start?(previous_line) ||
            class_def?(previous_line) ||
            previous_line.blank?
        end

        def next_line_empty?(next_line)
          body_end?(next_line) || next_line.blank?
        end

        def empty_lines_around?(node)
          send_line = node.loc.line
          previous_line = previous_line_ignoring_comments(processed_source,
                                                          send_line)
          next_line = processed_source[send_line]

          previous_line_empty?(previous_line) && next_line_empty?(next_line)
        end

        def class_def?(line)
          line =~ /^\s*(class|module)/
        end

        def block_start?(line)
          line.match(/ (do|{)( \|.*?\|)?\s?$/)
        end

        def body_end?(line)
          line =~ /^\s*end/
        end

        def message(node)
          previous_line = processed_source[node.loc.line - 2]

          if block_start?(previous_line) ||
             class_def?(previous_line)
            format(MSG_AFTER, node.loc.selector.source)
          else
            format(MSG_BEFORE_AND_AFTER, node.loc.selector.source)
          end
        end
      end
    end
  end
end


text:
using System.Collections.Generic;

namespace Oxide.Core.Logging
{
    /// <summary>
    /// Represents a set of loggers that fall under a single logger
    /// </summary>
    public sealed class CompoundLogger : Logger
    {
        // Loggers under this compound logger
        private HashSet<Logger> subloggers;

        // Any cached messages for new loggers
        private List<LogMessage> messagecache;

        /// <summary>
        /// Initializes a new instance of the CompoundLogger class
        /// </summary>
        public CompoundLogger()
            : base(true)
        {
            // Initialize
            subloggers = new HashSet<Logger>();
            messagecache = new List<LogMessage>();
        }

        /// <summary>
        /// Adds a sublogger to this compound logger
        /// </summary>
        /// <param name="logger"></param>
        public void AddLogger(Logger logger)
        {
            // Register it
            subloggers.Add(logger);

            // Write the message cache to it
            for (int i = 0; i < messagecache.Count; i++)
            {
                logger.Write(messagecache[i]);
            }
        }

        /// <summary>
        /// Removes a sublogger from this compound logger
        /// </summary>
        /// <param name="logger"></param>
        public void RemoveLogger(Logger logger)
        {
            // Unregister it
            subloggers.Remove(logger);
        }

        /// <summary>
        /// Writes a message to all subloggers of this logger
        /// </summary>
        /// <param name="type"></param>
        /// <param name="format"></param>
        /// <param name="args"></param>
        public override void Write(LogType type, string format, params object[] args)
        {
            // Write to all current subloggers
            foreach (Logger logger in subloggers)
                logger.Write(type, format, args);

            // Cache it for any loggers added late
            messagecache.Add(CreateLogMessage(type, format, args));
        }
    }
}


text:
namespace TodoApp.Migrations
{
    using System;
    using System.Data.Entity;
    using System.Data.Entity.Migrations;
    using System.Linq;
    using TodoApp.Models;
    using Microsoft.AspNet.Identity;
    using Microsoft.AspNet.Identity.EntityFramework;
    using Microsoft.AspNet.Identity.Owin;

    internal sealed class Configuration : DbMigrationsConfiguration<TodoApp.Models.ApplicationDbContext>
    {
        public Configuration()
        {
            AutomaticMigrationsEnabled = false;
            ContextKey = "TodoApp.Models.ApplicationDbContext";
        }

        protected override void Seed(TodoApp.Models.ApplicationDbContext context)
        {
            if (!context.Users.Any(u => u.UserName == "steve@example.com"))
            {
                var userStore = new UserStore<ApplicationUser>(context);
                var userManager = new UserManager<ApplicationUser>(userStore);
                var user = new ApplicationUser() { UserName = "steve@example.com", Email = "steve@example.com" };
                userManager.Create(user, "Password1!");

                context.TodoItems.AddOrUpdate(x => x.Id,
                    new TodoItem() { Id = 1, Name = "Buy Milk", ApplicationUserId = user.Id },
                    new TodoItem() { Id = 2, Name = "Buy Bananas", ApplicationUserId = user.Id },
                    new TodoItem() { Id = 3, Name = "Buy Cheese", ApplicationUserId = user.Id }
                );
            }
        }
    }
}


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

import java.util.concurrent.ThreadPoolExecutor;

import javax.enterprise.concurrent.ManagedThreadFactory;

import org.flowable.common.engine.impl.async.DefaultAsyncTaskExecutor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Simple JSR-236 async job executor to allocate threads through {@link ManagedThreadFactory}. Falls back to {@link AsyncExecutor} when a thread factory was not referenced in configuration.
 *
 * In Java EE 7, all application servers should provide access to a {@link ManagedThreadFactory}.
 *
 * @author Dimitris Mandalidis
 * @deprecated The factory should be configured in the engine configuration
 */
@Deprecated
public class ManagedAsyncJobExecutor extends DefaultAsyncJobExecutor {

    private static final Logger LOGGER = LoggerFactory.getLogger(ManagedAsyncJobExecutor.class);

    protected ManagedThreadFactory threadFactory;

    public ManagedThreadFactory getThreadFactory() {
        return threadFactory;
    }

    public void setThreadFactory(ManagedThreadFactory threadFactory) {
        this.threadFactory = threadFactory;
    }

    @Override
    protected void initAsyncJobExecutionThreadPool() {
        if (threadFactory == null) {
            LOGGER.warn("A managed thread factory was not found, falling back to self-managed threads");
            super.initAsyncJobExecutionThreadPool();
        } else if (taskExecutor != null) {
            // This is for backwards compatibility
            // If there is no task executor then use the Default one and start it immediatelly.
            DefaultAsyncTaskExecutor defaultAsyncTaskExecutor = new DefaultAsyncTaskExecutor();
            defaultAsyncTaskExecutor.setThreadFactory(threadFactory);
            defaultAsyncTaskExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
            defaultAsyncTaskExecutor.start();
            this.taskExecutor = defaultAsyncTaskExecutor;
            this.shutdownTaskExecutor = true;
        }
    }
}


text:
export interface OmdbMovie {
    Title: string;
    Year: string;
    Rated: string;
    Released: string;
    Runtime: string;
    Genre: string;
    Director: string;
    Writer: string;
    Actors: string;
    Plot: string;
    Language: string;
    Country: string;
    Awards: string;
    Poster: string;
    Metascore: string;
    imdbRating: string;
    imdbVotes: string;
    imdbID: string;
    Type: string;
    Response: string;
}

export interface OmdbTvshow {
    Title: string;
    Year: string;
    Rated: string;
    Released: string;
    Runtime: string;
    Genre: string;
    Director: string;
    Writer: string;
    Actors: string;
    Plot: string;
    Language: string;
    Country: string;
    Awards: string;
    Poster: string;
    Metascore: string;
    imdbRating: string;
    imdbVotes: string;
    imdbID: string;
    Type: string;
    Response: string;

    totalSeasons: string;
}

export interface OmdbEpisode {
    Title: string;
    Released: string;
    Episode: string;
    Type: string;
    imdbRating: string;
    imdbID: string;
}

export interface OmdbSeason {
    Title: string;
    Season: string;
    totalEpisodes: string;
    Episodes: OmdbEpisode[];
    Response: string;
}

export interface OmdbError {
    Response: string;
    Error: string;
}

export function isError(response: OmdbSeason | OmdbTvshow | OmdbMovie | OmdbError): response is OmdbError {
    return response.Response === "False";
}

export function isTvshow(response: OmdbMovie | OmdbTvshow | OmdbEpisode): response is OmdbTvshow {
    return response.Type === "series";
}

export function isMovie(response: OmdbMovie | OmdbTvshow | OmdbEpisode): response is OmdbTvshow {
    return response.Type === "movie";
}

export function isEpisode(response: OmdbMovie | OmdbTvshow | OmdbEpisode): response is OmdbEpisode {
    return response.Type === "episode";
}


text:
from cgi import parse_header
from collections import namedtuple
from http.cookies import SimpleCookie
from urllib.parse import parse_qs, urlunparse
from ujson import loads as json_loads

from mach9.exceptions import InvalidUsage

DEFAULT_HTTP_CONTENT_TYPE = 'application/octet-stream'
# HTTP/1.1: https://www.w3.org/Protocols/rfc2616/rfc2616-sec7.html#sec7.2.1
# > If the media type remains unknown, the recipient SHOULD treat it
# > as type 'application/octet-stream'

class CIDict(dict):
    '''Case Insensitive dict where all keys are converted to lowercase
    This does not maintain the inputted case when calling items() or keys()
    in favor of speed, since headers are case insensitive
    '''

    def get(self, key, default=None):
        return super().get(key.casefold(), default)

    def __getitem__(self, key):
        return super().__getitem__(key.casefold())

    def __setitem__(self, key, value):
        return super().__setitem__(key.casefold(), value)

    def __contains__(self, key):
        return super().__contains__(key.casefold())

class RequestParameters(dict):
    '''Hosts a dict with lists as values where get returns the first
    value of the list and getlist returns the whole shebang
    '''

    def get(self, name, default=None):
        '''Return the first value, either the default or actual'''
        return super().get(name, [default])[0]

    def getlist(self, name, default=None):
        '''Return the entire list'''
        return super().get(name, default)

class Request(dict):
    '''Properties of an HTTP request such as URL, headers, etc.'''
    __slots__ = (
        'scheme', 'method', 'query_string', 'path',
        'app', 'headers', 'version', 'method', '_cookies',
        'body', 'parsed_json', 'parsed_args', 'parsed_form', 'parsed_files',
        'ip', '_parsed_url', 'uri_template', 'stream', '_invalid_usage'
    )

    def __init__(self, message, invalid_usage=None):
        # TODO: Content-Encoding detection
        self.app = None

        _headers = [(h[0].decode().casefold(), h[1].decode())
                    for h in message['headers']]
        self.headers = CIDict(_headers)
        self.scheme = message['scheme']
        self.method = message['method']
        self.version = message['http_version']
        self.query_string = message['query_string'].decode('utf-8')
        self.path = message['path']
        self.ip = message['server']

        # Init but do not inhale
        self.body = b''
        self.parsed_json = None
        self.parsed_form = None
        self.parsed_files = None
        self.parsed_args = None
        self.uri_template = None
        self.stream = None
        self._cookies = None
        self._invalid_usage = invalid_usage or InvalidUsage

    @property
    def args(self):
        if self.parsed_args is None:
            if self.query_string:
                self.parsed_args = RequestParameters(
                    parse_qs(self.query_string))
            else:
                self.parsed_args = RequestParameters()
        return self.parsed_args

    @property
    def json(self):
        if self.parsed_json is None:
            try:
                self.parsed_json = json_loads(self.body)
            except Exception:
                if not self.body:
                    return None
                raise self._invalid_usage('Failed when parsing body as json')

        return self.parsed_json

    @property
    def token(self):
        '''Attempt to return the auth header token.

        :return: token related to request
        '''
        auth_header = self.headers.get('Authorization', '')
        if 'Token ' in auth_header:
            return auth_header.partition('Token ')[-1]
        else:
            return auth_header

    @property
    def form(self):
        if self.parsed_form is None:
            self.parsed_form = RequestParameters()
            self.parsed_files = RequestParameters()
            content_type = self.headers.get(
                'Content-Type', DEFAULT_HTTP_CONTENT_TYPE)
            content_type, parameters = parse_header(content_type)
            try:
                if content_type == 'application/x-www-form-urlencoded':
                    self.parsed_form = RequestParameters(
                        parse_qs(self.body.decode('utf-8')))
                elif content_type == 'multipart/form-data':
                    # TODO: Stream this instead of reading to/from memory
                    boundary = parameters['boundary'].encode('utf-8')
                    self.parsed_form, self.parsed_files = (
                        parse_multipart_form(self.body, boundary))
            except Exception:
                self.app.log.exception('Failed when parsing form')

        return self.parsed_form

    @property
    def files(self):
        if self.parsed_files is None:
            self.form  # compute form to get files

        return self.parsed_files

    @property
    def raw_args(self):
        return {k: v[0] for k, v in self.args.items()}

    @property
    def cookies(self):
        if self._cookies is None:
            cookie = self.headers.get('cookie')
            if cookie is not None:
                cookies = SimpleCookie()
                cookies.load(cookie)
                self._cookies = {name: cookie.value
                                 for name, cookie in cookies.items()}
            else:
                self._cookies = {}
        return self._cookies

    @property
    def host(self):
        # it appears that httptools doesn't return the host
        # so pull it from the headers
        return self.headers.get('Host', '')

    @property
    def url(self):
        return urlunparse((
            self.scheme,
            self.host,
            self.path,
            None,
            self.query_string,
            None))

File = namedtuple('File', ['type', 'body', 'name'])

def parse_multipart_form(body, boundary):
    '''Parse a request body and returns fields and files

    :param body: bytes request body
    :param boundary: bytes multipart boundary
    :return: fields (RequestParameters), files (RequestParameters)
    '''
    files = RequestParameters()
    fields = RequestParameters()

    form_parts = body.split(boundary)
    for form_part in form_parts[1:-1]:
        file_name = None
        file_type = None
        field_name = None
        line_index = 2
        line_end_index = 0
        while not line_end_index == -1:
            line_end_index = form_part.find(b'\r\n', line_index)
            form_line = form_part[line_index:line_end_index].decode('utf-8')
            line_index = line_end_index + 2

            if not form_line:
                break

            colon_index = form_line.index(':')
            form_header_field = form_line[0:colon_index].lower()
            form_header_value, form_parameters = parse_header(
                form_line[colon_index + 2:])

            if form_header_field == 'content-disposition':
                if 'filename' in form_parameters:
                    file_name = form_parameters['filename']
                field_name = form_parameters.get('name')
            elif form_header_field == 'content-type':
                file_type = form_header_value

        post_data = form_part[line_index:-4]
        if file_name or file_type:
            file = File(type=file_type, name=file_name, body=post_data)
            if field_name in files:
                files[field_name].append(file)
            else:
                files[field_name] = [file]
        else:
            value = post_data.decode('utf-8')
            if field_name in fields:
                fields[field_name].append(value)
            else:
                fields[field_name] = [value]

    return fields, files


text:
package com.cyl.bean.pojo;

import org.apache.ibatis.type.Alias;

/**
 *
 *@category:用户实体类
 * @author RyanCai
 * @日期:2015年4月15日 下午2:16:43
 */
@Alias("SysUser")
public class SysUser {

    private int id;

    private String username;

    private String loginpassword;

    private String getcashpassword;

    private int usertype;//用户类型:1是用户,2是商户,3是管理员

    private int isvip;

    private String idcauditstate;

    private int vipid;

    private int sex;

    private String mail;

    private int recommenduserid;

    private String qq;

    private String phone;

    private String tell;

    private String name;

    private int age;

    private String idcardno;

    private String personimg;

    private String idcardimg1;

    private String idcardimg2;

    private Double availableaccount;

    private Double frozenaccount;

    private Double presentexpaccount;

    private String remark;

    private int state;

    private int sysState;

    //分页参数
    private int offset;

    private int pageSize;

    public int getOffset() {
		return offset;
	}

	public void setOffset(int offset) {
		this.offset = offset;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

    public String getLoginpassword() {
        return loginpassword;
    }

    public void setLoginpassword(String loginpassword) {
        this.loginpassword = loginpassword == null ? null : loginpassword.trim();
    }

    public String getGetcashpassword() {
        return getcashpassword;
    }

    public void setGetcashpassword(String getcashpassword) {
        this.getcashpassword = getcashpassword == null ? null : getcashpassword.trim();
    }

    public Integer getUsertype() {
        return usertype;
    }

    public void setUsertype(Integer usertype) {
        this.usertype = usertype;
    }

    public Integer getIsvip() {
        return isvip;
    }

    public void setIsvip(Integer isvip) {
        this.isvip = isvip;
    }

    public String getIdcauditstate() {
        return idcauditstate;
    }

    public void setIdcauditstate(String idcauditstate) {
        this.idcauditstate = idcauditstate == null ? null : idcauditstate.trim();
    }

    public Integer getVipid() {
        return vipid;
    }

    public void setVipid(Integer vipid) {
        this.vipid = vipid;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public String getMail() {
        return mail;
    }

    public void setMail(String mail) {
        this.mail = mail == null ? null : mail.trim();
    }

    public Integer getRecommenduserid() {
        return recommenduserid;
    }

    public void setRecommenduserid(Integer recommenduserid) {
        this.recommenduserid = recommenduserid;
    }

    public String getQq() {
        return qq;
    }

    public void setQq(String qq) {
        this.qq = qq == null ? null : qq.trim();
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone == null ? null : phone.trim();
    }

    public String getTell() {
        return tell;
    }

    public void setTell(String tell) {
        this.tell = tell == null ? null : tell.trim();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getIdcardno() {
        return idcardno;
    }

    public void setIdcardno(String idcardno) {
        this.idcardno = idcardno == null ? null : idcardno.trim();
    }

    public String getPersonimg() {
        return personimg;
    }

    public void setPersonimg(String personimg) {
        this.personimg = personimg == null ? null : personimg.trim();
    }

    public String getIdcardimg1() {
        return idcardimg1;
    }

    public void setIdcardimg1(String idcardimg1) {
        this.idcardimg1 = idcardimg1 == null ? null : idcardimg1.trim();
    }

    public String getIdcardimg2() {
        return idcardimg2;
    }

    public void setIdcardimg2(String idcardimg2) {
        this.idcardimg2 = idcardimg2 == null ? null : idcardimg2.trim();
    }

    public Double getAvailableaccount() {
        return availableaccount;
    }

    public void setAvailableaccount(Double availableaccount) {
        this.availableaccount = availableaccount;
    }

    public Double getFrozenaccount() {
        return frozenaccount;
    }

    public void setFrozenaccount(Double frozenaccount) {
        this.frozenaccount = frozenaccount;
    }

    public Double getPresentexpaccount() {
        return presentexpaccount;
    }

    public void setPresentexpaccount(Double presentexpaccount) {
        this.presentexpaccount = presentexpaccount;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark == null ? null : remark.trim();
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Integer getSysState() {
        return sysState;
    }

    public void setSysState(Integer sysState) {
        this.sysState = sysState;
    }

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public void setUsertype(int usertype) {
		this.usertype = usertype;
	}

	public void setIsvip(int isvip) {
		this.isvip = isvip;
	}

	public void setVipid(int vipid) {
		this.vipid = vipid;
	}

	public void setSex(int sex) {
		this.sex = sex;
	}

	public void setRecommenduserid(int recommenduserid) {
		this.recommenduserid = recommenduserid;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public void setState(int state) {
		this.state = state;
	}

	public void setSysState(int sysState) {
		this.sysState = sysState;
	}
}


text:
Easily build color variations of Base16 with YAML scheme definitions and ERB templates.
See the [Base16](https://github.com/chriskempson/base16) repository for more information.
Requires Ruby 1.9 or greater.

## Usage
    > ./base16
Build all schemes

    > ./base16 -s schemes/default.yml
Build only the "default" theme

    > ./base16 https://awesome-schemes.com/my-scheme.yml
Build a scheme stored on some webspace.

## Templates
* Atom
* BBEdit (TextWrangler)
* Chrome DevTools (Web Inspector)
* Chrome Secure Shell
* CodeMirror
* ConEmu
* Console2
* DrRacket
* Emacs
* Escape Code Shell Script (shell)
* Geany
* Gedit
* Gimp Palette
* Gnome Terminal
* Guake
* highlight.js
* Highlighting Kate
* HTML Preview (preview)
* IDEA
* IPython Notebook
* iTerm 2
* Konsole
* Mate Terminal
* MinTTY
* MultiMarkdown Composer 2 (mmdc2)
* Mou
* Notepad++
* OS X Terminal (terminal-app)
* Pantheon Terminal
* prettify.js
* Prism.js
* PuTTY
* Pygments
* Qt Creator
* Rainbow
* Rouge
* Terminator
* Termite
* Textadept
* TextMate (Sublime Text)
* Vim
* Visual Studio
* Virtual Console (vconsole)
* Windows Command Prompt
* Xcode
* XFCE4 Terminal
* Xresources
* Zathura

## Maintainers
* [chriskempson](https://github.com/chriskempson) - HTML Preview, Vim, TextMate, iTerm 2, XFCE4 Terminal, Mou, Escape Code Shell Script, Gnome Terminal, BBEdit
* [jayferd](https://github.com/jayferd) - Rouge
* [neil477](https://github.com/neil477) - Emacs
* [joedynamite](https://github.com/joedynamite) - Xcode
* [robloach](https://github.com/robloach) - Geany
* [geoffstokes](https://github.com/geoffstokes) - Windows Command Prompt, MinTTY
* [idleberg](https://github.com/idleberg) - Atom, Chrome DevTools, CodeMirror, Gedit, highlight.js, Notepad++, prettify.js, Pygments, Rainbow
* [rgieseke](https://github.com/rgieseke) - Textadept
* [oxplot](https://github.com/oxplot) - Mate Terminal
* [esn89](https://github.com/esn89) - Zathura PDF Reader
* [romainx](https://github.com/romainx) - MultiMarkdown Composer 2
* [moonpyk](https://github.com/moonpyk) - ConEmu
* [jprjr](https://github.com/jprjr) - ConnectBot, vx-connectbot
* [atelierbram](https://github.com/atelierbram) - Prism

## License
Base16 Builder is released under the [MIT License](https://github.com/chriskempson/base16-builder/blob/master/LICENSE.md)


text:
package trinity.customExceptions;

public class SymbolAlreadyDefinedException extends Exception {

    //Parameterless Constructor
    public SymbolAlreadyDefinedException() {
    }

    //Constructor that accepts a message
    public SymbolAlreadyDefinedException(String message) {
        super(message);
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Humaria saccardoi Cavara

### Remarks
null


text:
layout: post-index
title: All Posts
excerpt: "A List of Posts"
image:
  feature: header-image.png
---


text:
package chapter3

import (
	"fmt"
	"math"
	"reflect"
)

// Interface for a geometry shape
type geometry interface {
	area() float64
	perim() float64
}

// The representation of a rectangle
type rect struct {
	width, height float64
}

func (r rect) area() float64 {
	return r.width * r.height
}

func (r rect) perim() float64 {
	return 2*r.width + 2*r.height
}

// The representation of a circle
type circle struct {
	radius float64
}

func (c circle) area() float64 {
	return math.Pi * c.radius
}

func (c circle) perim() float64 {
	return 2 * math.Pi * c.radius
}

// method using a interface
func measure(g geometry) {
	s := reflect.TypeOf(g)

	fmt.Println(s, g)
	fmt.Println(g.area())
	fmt.Println(g.perim())
}

func Interfaces() {
	r := rect{width: 3, height: 4}
	c := circle{radius: 5}

	measure(r)
	measure(c)
}


text:
@implementation RSSTBXMLParserDelegate

@synthesize parser;
@synthesize url;
@synthesize unescaper;
@synthesize currentItem;
@synthesize currentArray;
@synthesize categoriesArray;
-(id)init{
    return [self initWithURL:@""];
}

-(id)initWithURL:(NSString *)thisURL{
    self = [super init];
    url = [[NSURL alloc]initWithString:thisURL];
    //parser = [[TBXML alloc]initWithURL:thisURL];
    return self;
}

-(NSMutableArray *) getRSSArray;{
    currentArray = [[NSMutableArray alloc]init];
    if ([url.absoluteString isEqualToString:@""]) {
        NSLog(@"No URL set in delegate");
        return false;
    }
    parser = [[TBXML alloc] initWithURL:self.url];
    unescaper = [[XMLUnescaper alloc]init];
    if (parser.rootXMLElement) {
        [self parseElements:parser.rootXMLElement];
    }else{
        NSLog(@"Parser Couldn't find Root element");
    }

    return currentArray;
}
-(void)parseElements:(TBXMLElement *)element{
    do {
        if (element->firstChild){
            [self parseElements:element->firstChild];
        }
        if ([[TBXML elementName:element] isEqualToString:@"item"]) {

            TBXMLElement *title = [TBXML childElementNamed:@"title" parentElement:element];
            TBXMLElement *description = [TBXML childElementNamed:@"description" parentElement:element];
            TBXMLElement *iurl = [TBXML childElementNamed:@"link" parentElement:element];
            TBXMLElement *comments = [TBXML childElementNamed:@"comments" parentElement:element];
            TBXMLElement *pubDate = [TBXML childElementNamed:@"pubDate" parentElement:element];

            currentItem = [[RSSItem alloc]init];
            currentItem.title = [unescaper xmlSimpleUnescapeString:[NSMutableString stringWithString:[TBXML textForElement:title]]];
            currentItem.itemDiscription = [unescaper xmlSimpleUnescapeString:[NSMutableString stringWithString:[TBXML textForElement:description]]];
            currentItem.link = [NSURL URLWithString:[TBXML textForElement:iurl]];
            currentItem.comments = [NSURL URLWithString:[TBXML textForElement:comments]];
            currentItem.categories = categoriesArray;
            NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
            formatter.dateFormat = @"EEE, dd MMM yyyy HH:mm:ss zzzz";
            currentItem.pubDate = [formatter dateFromString:[TBXML textForElement:pubDate]];
            NSLog(@"%@",[formatter stringFromDate:currentItem.pubDate]);

            [currentArray addObject:currentItem];
            //NSLog(@"%@",currentItem.itemDiscription);
            categoriesArray = nil;
            currentItem = nil;
        }
        if ([[TBXML elementName:element] isEqualToString:@"category"]) {
            if (!categoriesArray) {
                categoriesArray = [[NSMutableArray alloc]init];
            }
            NSString *type = [TBXML textForElement:element];
            [categoriesArray addObject:type];

        }

    }while ((element = element->nextSibling));
}

@end


text:
title: "How to count pages in multiple PDF files on Windows"
categories:
  - tutorial
tags:
  - windows
  - command-line
author_profile: false
---

I needed to know the total number of pages in hundreds of PDFs. Thanks to [cpdf - Coherent PDF Command Line Tools](http://community.coherentpdf.com/) I was able to get this done from the Windows Command Prompt on Windows 8.1. Here's the command I used,

```powershell
> forfiles /s /m *.pdf /c "cmd /c C:\Users\Admin\Documents\cpdf\cpdf.exe -pages @path >> C:\Users\Admin\Documents\pages.txt && echo. >> C:\Users\Admin\Documents\pages.txt"
```

This populates pages.txt with number of pages in each PDF it comes across in the directory (and sub-directories) it has been run in. You can then paste pages.txt into any spreadsheet to calculate the sum of the series.

### How it works,

1. This tells you the number of pages in a PDF file
```powershell
> cpdf.exe -pages sample-pdf-file.pdf
```

2. `FORFILES` in Command Prompt (check `FORFILES /?` for help) lets you execute a command for a set of files.
```powershell
> forfiles /s /m *.pdf /c "cmd /c echo @file"
# `/s` flag tells it to look into sub-directories.
# `/m *.pdf` searches only PDF files.
# `/c "cmd /c echo @file"` tells it to run `echo @file` command in cmd.
```

3. Use `>>` to append stdout output to pages.txt

4. In hindsight, this is unnecessary. `&& echo. >> C:\Users\Admin\Documents\pages.txt` adds a newline after each pagecount. I added this because I didn't see newlines when I checked this in notepad. But that's probably because the output probably contained a Linux line ending (line feed aka `\n`) instead of the Windows line ending (carriage return and line feed `\r\n`).


text:
(function($){
  $(function(){

    $('.button-collapse').sideNav();
    $('.parallax').parallax();
    $('.scrollspy').scrollSpy();

  }); // end of document ready
})(jQuery); // end of jQuery name space