text:
package org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser;

import org.apache.ivy.core.module.descriptor.Artifact;
import org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor;
import org.apache.ivy.core.module.descriptor.MDArtifact;

import java.net.URL;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;

import static com.google.common.collect.Sets.newLinkedHashSet;
import static java.util.Arrays.asList;
import static org.gradle.api.internal.artifacts.ivyservice.IvyUtil.artifactsEqual;

public class IvyMDArtifact {

    private Set<String> configurations = new LinkedHashSet<String>();
    private final DefaultModuleDescriptor md;
    private final String artName;
    private final String type;
    private final String ext;
    private final URL url;
    private final Map<String, String> extraAttributes;

    public IvyMDArtifact(DefaultModuleDescriptor md, String artName, String type, String ext, URL url, Map<String, String> extraAttributes) {
        this.md = md;
        this.artName = artName;
        this.type = type;
        this.ext = ext;
        this.url = url;
        this.extraAttributes = extraAttributes;
    }

    public IvyMDArtifact(DefaultModuleDescriptor md, String artName, String type, String ext) {
        this(md, artName, type, ext, null, null);
    }

    public IvyMDArtifact addConfiguration(String confName) {
        configurations.add(confName);
        return this;
    }

    public Set<String> getConfigurations() {
        return configurations;
    }

    public void addTo(DefaultModuleDescriptor target) {
        if (configurations.isEmpty()) {
            throw new IllegalArgumentException("Artifact should be attached to at least one configuration.");
        }

        MDArtifact newArtifact = new MDArtifact(md, artName, type, ext, url, extraAttributes);
        //Adding the artifact will replace any existing artifact
        //This potentially leads to loss of information - the configurations of the replaced artifact are lost (see GRADLE-123)
        //Hence we attempt to find an existing artifact and merge the information
        Artifact[] allArtifacts = target.getAllArtifacts();
        for (Artifact existing : allArtifacts) {
            if (artifactsEqual(existing, newArtifact)) {
                if (!(existing instanceof MDArtifact)) {
                    throw new IllegalArgumentException("Cannot update an existing artifact (" + existing + ") in provided module descriptor (" + target + ")"
                            + " because the artifact is not an instance of MDArtifact." + target);
                }
                addArtifact((MDArtifact) existing, this.configurations, target);
                return; //there is only one matching artifact
            }
        }
        addArtifact(newArtifact, this.configurations, target);
    }

    private static void addArtifact(MDArtifact artifact, Set<String> configurations, DefaultModuleDescriptor target) {
        //The existing artifact configurations will be first
        Set<String> existingConfigurations = newLinkedHashSet(asList(artifact.getConfigurations()));
        for (String c : configurations) {
            if (!existingConfigurations.contains(c)) {
                artifact.addConfiguration(c);
                target.addArtifact(c, artifact);
            }
        }
    }
}


text:
@interface PayHelper ()
@end

@implementation PayHelper

- (instancetype)init{
    self = [super init];
    if (self) {
        [[OEZHandleOpenURLHelper shared] addHandleDelegate:self];

    }

    return self;
}

- (void)payWithMode:(id)mode {
    //根据需求 可更换使用model种类
}

- (void)payHelperWithType:(PayType)type withPayStatus:(PayStatus)payStatus withData:(id)data {
    if ([self.delegate respondsToSelector:@selector(payHelperWithType:withPayStatus:withData:)]) {
        [self.delegate payHelperWithType:type withPayStatus:payStatus withData:data];
    }

}

- (BOOL)handleOpenURL:(NSURL *)url {
    return NO;
}

- (NSString *)getKey {
    return nil;
}
@end

redpajama_set_name: RedPajamaGithub


text:
/*
  cssobj v${version}
  ${time}
  commit ${commitHash}

  https://github.com/cssobj/cssobj
  Released under the MIT License.

  Components version info:
  - cssobj-core@${versionCore}
    ${commitHashCore}
  - cssobj-plugin-cssom@${versionCSSOM}
    ${commitHashCSSOM}
  - cssobj-plugin-localize@${versionLocalize}
    ${commitHashLocalize}
*/


text:
define(
  [
    'backbone',
    'underscore',
    'handlebars',
    'text!data-download/templates/download-filter-card.handlebars',
    'text!data-download/templates/download-filter-card-options.handlebars'
  ],
  function(Backbone, _, Handlebars, tpl, optionsTpl) {
    'use strict';
    var DataDownloadIndexView = Backbone.View.extend({
      template: Handlebars.compile(tpl),
      optionsTemplate: Handlebars.compile(optionsTpl),

      events: {
        'keyup .js-search-filter': 'onSearchChange',
        'change .js-select-all': 'onSelectAllChange',
        'change .js-select': 'onSelectChange'
      },

      initialize: function(settings) {
        this.filter = settings.filter;
        this.selection = [];
        this.render(this.filter);
        this.optionsContainer = this.$('#' + settings.filter.id + '-options');
        this.renderOptions(this.filter.options, this.filter.placeholder);
      },

      renderOptions: function(options, placeholder) {
        this.filter.options = options;
        var selected = _.filter(options, function(option) {
          return option.selected;
        });
        this.selection = _.map(selected, function(select) {
          return select.value + '';
        });
        this.selectAllEl.prop('disabled', !options.length);
        this.optionsContainer.html(
          this.optionsTemplate({
            id: this.filter.id,
            options: options,
            placeholder: placeholder || ''
          })
        );
      },

      render: function(filter) {
        this.$el.html(this.template(filter));
        this.selectAllEl = this.$('.js-select-all');
      },

      getAllOptionsValues: function(options) {
        if (!options) return [];

        return options.map(function(option) {
          return option.value + '';
        });
      },

      onSearchChange: function(e) {
        var options = [];
        var search = e.currentTarget.value.toUpperCase();

        function filterOptions(option) {
          return option.name.toUpperCase().indexOf(search) > -1;
        }

        if (search) {
          if (!this.initialOptions) {
            this.initialOptions = this.filter.options;
            options = this.filter.options.filter(filterOptions);
          } else {
            options = this.initialOptions.filter(filterOptions);
          }
        } else if (this.initialOptions) {
          options = this.initialOptions;
          this.initialOptions = false;
        } else {
          options = this.filter.options;
        }
        this.renderOptions(options, this.filter.placeholder);
      },

      onSelectAllChange: function(e) {
        var selected = false;
        if (e.currentTarget.checked) {
          selected = true;
          this.selection = this.getAllOptionsValues(this.filter.options);
        } else {
          this.selection = [];
        }
        this.setAllInputsValue(selected);
        this.trigger('option:changed', this.selection);
      },

      setAllMarked: function(value) {
        this.setAllInputsMarked(value);
        this.setAllInputsValue(value);
      },

      setAllInputsMarked: function(value) {
        this.$('.js-select-all').prop('checked', value);
      },

      setAllInputsValue: function(value) {
        this.selection = value
          ? this.getAllOptionsValues(this.filter.options)
          : [];
        this.$('.js-select').each(function(index, item) {
          item.checked = value;
        });
      },

      onSelectChange: function(e) {
        e.preventDefault();
        var value = e.currentTarget.value;
        var checked = e.currentTarget.checked;
        if (checked) {
          this.selection.push(value);
        } else {
          var index = this.selection.indexOf(value);
          if (index > -1) {
            this.selection.splice(index, 1);
          }
        }
        this.trigger('option:changed', this.selection);
        if (!this.selection.length) {
          this.setAllInputsMarked(false);
        } else if (this.selection.length === this.filter.options.length) {
          this.setAllInputsMarked(true);
        }
      }
    });

    return DataDownloadIndexView;
  }
);


text:
using System;
using Cairo;
using Gtk;
using Pinta.Core;
using Mono.Unix;

namespace Pinta.Tools
{
	// This is a base class for brush type tools (paintbrush, eraser, etc)
	public class BaseBrushTool : BaseTool
	{
		protected ToolBarComboBox brush_width;
		protected ToolBarLabel brush_width_label;
		protected ToolBarButton brush_width_minus;
		protected ToolBarButton brush_width_plus;

		protected ImageSurface undo_surface;
		protected bool surface_modified;
		protected uint mouse_button;

		protected override bool ShowAntialiasingButton { get { return true; } }

		public virtual int BrushWidth {
			get {
				int width;
				if (brush_width != null)
				{
					if (Int32.TryParse(brush_width.ComboBox.ActiveText, out width))
					{
						if (width > 0)
						{
							(brush_width.ComboBox as Gtk.ComboBoxEntry).Entry.Text = width.ToString();
							return width;
						}
					}

					(brush_width.ComboBox as Gtk.ComboBoxEntry).Entry.Text = DEFAULT_BRUSH_WIDTH.ToString();
				}
				return DEFAULT_BRUSH_WIDTH;
			}
			set { (brush_width.ComboBox as Gtk.ComboBoxEntry).Entry.Text = value.ToString (); }
		}

		#region ToolBar
		protected override void OnBuildToolBar (Toolbar tb)
		{
			base.OnBuildToolBar (tb);

			if (brush_width_label == null)
				brush_width_label = new ToolBarLabel (string.Format (" {0}: ", Catalog.GetString ("Brush width")));

			tb.AppendItem (brush_width_label);

			if (brush_width_minus == null) {
				brush_width_minus = new ToolBarButton ("Toolbar.MinusButton.png", "", Catalog.GetString ("Decrease brush size"));
				brush_width_minus.Clicked += MinusButtonClickedEvent;
			}

			tb.AppendItem (brush_width_minus);

			if (brush_width == null)
				brush_width = new ToolBarComboBox (65, 1, true, "1", "2", "3", "4", "5", "6", "7", "8", "9",
				"10", "11", "12", "13", "14", "15", "20", "25", "30", "35",
				"40", "45", "50", "55");

			tb.AppendItem (brush_width);

			if (brush_width_plus == null) {
				brush_width_plus = new ToolBarButton ("Toolbar.PlusButton.png", "", Catalog.GetString ("Increase brush size"));
				brush_width_plus.Clicked += PlusButtonClickedEvent;
			}

			tb.AppendItem (brush_width_plus);
		}

		protected virtual void MinusButtonClickedEvent (object o, EventArgs args)
		{
			if (BrushWidth > 1)
				BrushWidth--;
		}

		protected virtual void PlusButtonClickedEvent (object o, EventArgs args)
		{
			BrushWidth++;
		}
		#endregion

		#region Mouse Handlers
		protected override void OnMouseUp (Gtk.DrawingArea canvas, Gtk.ButtonReleaseEventArgs args, Cairo.PointD point)
		{
			Document doc = PintaCore.Workspace.ActiveDocument;

			if (undo_surface != null) {
				if (surface_modified)
					doc.History.PushNewItem (new SimpleHistoryItem (Icon, Name, undo_surface, doc.CurrentUserLayerIndex));
				else if (undo_surface != null)
					(undo_surface as IDisposable).Dispose ();
			}

			surface_modified = false;
			undo_surface = null;
			mouse_button = 0;
		}

		protected override void OnMouseDown (Gtk.DrawingArea canvas, Gtk.ButtonPressEventArgs args, Cairo.PointD point)
		{
			// If we are already drawing, ignore any additional mouse down events
			if (mouse_button > 0)
				return;

			Document doc = PintaCore.Workspace.ActiveDocument;

			surface_modified = false;
			undo_surface = doc.CurrentUserLayer.Surface.Clone ();
			mouse_button = args.Event.Button;

			OnMouseMove (canvas, null, point);
		}
		#endregion

		#region Protected Methods
		protected Gdk.Rectangle GetRectangleFromPoints (Point a, Point b)
		{
			int x = Math.Min (a.X, b.X) - BrushWidth - 2;
			int y = Math.Min (a.Y, b.Y) - BrushWidth - 2;
			int w = Math.Max (a.X, b.X) - x + (BrushWidth * 2) + 4;
			int h = Math.Max (a.Y, b.Y) - y + (BrushWidth * 2) + 4;

			return new Gdk.Rectangle (x, y, w, h);
		}

		protected Gdk.Rectangle GetRectangleFromPoints (Gdk.Point a, Gdk.Point b)
		{
			int x = Math.Min (a.X, b.X);
			int y = Math.Min (a.Y, b.Y);
			int w = Math.Max (a.X, b.X);
			int h = Math.Max (a.Y, b.Y);

			var rect = new Gdk.Rectangle (x, y, w, h);
			rect.Inflate (BrushWidth, BrushWidth);
			return rect;
		}
		#endregion
	}
}


text:
var aws = require('aws-sdk');
var logger = require('_pr/logger')(module);

if (process.env.http_proxy) {
    aws.config.update({
        httpOptions: {
            proxy: process.env.http_proxy
        }
    });
}
var AWSCloudFormation = function(awsSettings) {

    var that = this;
    var params = new Object();

    if (typeof awsSettings.region !== undefined) {
        params.region = awsSettings.region;
    }

    if (typeof awsSettings.isDefault !== undefined && awsSettings.isDefault == true) {
        params.credentials = new aws.EC2MetadataCredentials({httpOptions: {timeout: 5000}});
    } else if (typeof awsSettings.access_key !== undefined && typeof awsSettings.secret_key !== undefined) {
        params.accessKeyId = awsSettings.access_key;
        params.secretAccessKey = awsSettings.secret_key;
    }

    var cloudFormation = new aws.CloudFormation(params);

    var that = this;
    this.createStack = function(stackOptions, callback) {
        var options = {
            StackName: stackOptions.name,
            Parameters: stackOptions.templateParameters,

        };
        if (stackOptions.templateBody) {
            options.TemplateBody = stackOptions.templateBody;
        } else {
            options.TemplateURL = stackOptions.templateBody;
        }

        cloudFormation.createStack(options, function(err, stackData) {
            if (err) {
                callback(err, null);
                return;
            }
            callback(null, stackData);
        });
    };

    this.deleteStack = function(stackNameOrId, callback) {
        cloudFormation.deleteStack({
            StackName: stackNameOrId
        }, function(err, deleteData) {
            if (err) {
                callback(err, null);
                return;
            }
            callback(null, deleteData);
        });
    };

    function describeStacks(stackNameOrId, nextToken, callback) {
        cloudFormation.describeStacks({
            StackName: stackNameOrId,
            NextToken: nextToken
        }, function(err, res) {
            if (err) {
                callback(err, null);
                return;
            };
            callback(null, res.Stacks);

        });

    }

    this.getListOfStacks = function(nextToken, callback) {
        describeStacks(null, nextToken, callback);
    };

    this.getStack = function(stackNameOrId, callback) {
        if (!stackNameOrId) {
            process.nextTick(function() {
                callback(null, null);
            });
            return;
        }
        describeStacks(stackNameOrId, null, function(err, stacks) {
            if (err) {
                callback(err, null);
                return;
            }
            if (stacks.length) {
                callback(null, stacks[0]);
            } else {
                callback(null, null);
            }
        });

    };

    this.waitForStackCompleteStatus = function(stackId, callback) {
        var self = this;
        logger.debug('Checking status ==>');
        this.getStack(stackId, function(err, stack) {
            if (err) {
                callback(err, null);
                return;
            }
            logger.debug('status ==>', stack.StackStatus);
            switch (stack.StackStatus) {
                case 'CREATE_IN_PROGRESS':
                    setTimeout(function() {
                        self.waitForStackCompleteStatus(stackId, callback);
                    }, 3000);
                    break;
                case 'CREATE_FAILED':
                    callback({
                        stackStatus: stack.StackStatus
                    }, null);
                    break;
                case 'CREATE_COMPLETE':
                    callback(null, stack);
                    break;
                default:
                    callback({
                        stackStatus: stack.StackStatus
                    }, null);
                    return;
            }

        });

    };

    function listStackResources(stackNameOrId, nextToken, callback) {
        cloudFormation.listStackResources({
            StackName: stackNameOrId,
            NextToken: nextToken
        }, function(err, res) {
            if (err) {
                callback(err, null);
                return;
            };
            callback(null, res);
        });
    }

    this.listAllStackResources = function(stackNameOrId, callback) {
        var self = this;
        var resources = [];

        function listResources(nextToken, callback) {
            listStackResources(stackNameOrId, nextToken, function(err, res) {
                if (err) {
                    callback(err, null);
                    return;
                }
                resources = resources.concat(res.StackResourceSummaries);
                if (res.NextToken) {
                    listResources(res.NextToken, callback);
                } else {
                    callback(null, resources);
                }

            });
        }
        listResources(null, callback);
    };

    this.getStackEvents = function(stackNameOrId, nextToken, callback) {
        var params = {
            StackName: stackNameOrId
        };
        if (nextToken) {
            params.NextToken = nextToken;
        }

        cloudFormation.describeStackEvents(params, function(err, data) {

            if (err) {
                callback(err, null);
                return;
            }

            callback(null, {
                events: data.StackEvents,
                nextToken: data.NextToken
            });
        });

    };

    this.getAllStackEvents = function(stackNameOrId, callback) {
        var self = this;
        var events = [];

        function getEvents(nextToken, callback) {
            self.getStackEvents(stackNameOrId, nextToken, function(err, data) {
                if (err) {
                    callback(err, null);
                    return;
                }
                events = events.concat(data.events);
                if (data.nextToken) {
                    getEvents(data.nextToken, callback);
                } else {
                    callback(null, events)
                }
            });
        }
        getEvents(null, callback);

    };

};

module.exports = AWSCloudFormation;


text:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />

<link rel="shortcut icon" type="image/x-icon" href="../favicon.ico" />
<title>Class Hierarchy | Android Developers</title>

<link rel="stylesheet"
href="http://fonts.googleapis.com/css?family=Roboto+Condensed">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:light,regular,medium,thin,italic,mediumitalic,bold"
  title="roboto">
<link href="../assets/css/default.css?v=2" rel="stylesheet" type="text/css">

<link href="../assets/css/fullscreen.css" rel="stylesheet" class="fullscreen"
type="text/css">

            Quicknav
            Quicknav

              Design

Develop

Distribute

Links

Google Play Developer Console

Android Developers Blog

About Android

Android Sites

Android.com

Android Developers

Android Open Source Project

      <form onsubmit="return submit_search()">
        <input id="search_autocomplete" type="text" value="" autocomplete="off" name="q"
          onfocus="search_focus_changed(this, true)" onblur="search_focus_changed(this, false)"
          onkeydown="return search_changed(event, true, '../')"
          onkeyup="return search_changed(event, false, '../')" />
      </form>

      close

About

Wear

TV

Auto

Get Started

Devices

Style

Patterns

Building Blocks

Downloads

Videos

Training

API Guides

Reference

Tools

Google Services

Google Play

Essentials

Get Users

Engage & Retain

Monetize

Tools & Reference

Developer Stories

Training

API Guides

Reference

Tools

Google Services

Results

Loading...

Class Hierarchy

          API level:

            <select id="apiLevelSelector">

            </select>

Android APIs

  com.google.android.gms

  com.google.android.gms.actions

  com.google.android.gms.ads

  com.google.android.gms.ads.doubleclick

  com.google.android.gms.ads.identifier

  com.google.android.gms.ads.mediation

  com.google.android.gms.ads.mediation.admob

  com.google.android.gms.ads.mediation.customevent

  com.google.android.gms.ads.purchase

  com.google.android.gms.ads.search

  com.google.android.gms.analytics

  com.google.android.gms.analytics.ecommerce

  com.google.android.gms.appindexing

  com.google.android.gms.appstate

  com.google.android.gms.auth

  com.google.android.gms.auth.api

  com.google.android.gms.cast

  com.google.android.gms.common

  com.google.android.gms.common.annotation

  com.google.android.gms.common.api

  com.google.android.gms.common.data

  com.google.android.gms.common.images

  com.google.android.gms.drive

  com.google.android.gms.drive.events

  com.google.android.gms.drive.metadata

  com.google.android.gms.drive.query

  com.google.android.gms.drive.widget

  com.google.android.gms.fitness

  com.google.android.gms.fitness.data

  com.google.android.gms.fitness.request

  com.google.android.gms.fitness.result

  com.google.android.gms.fitness.service

  com.google.android.gms.games

  com.google.android.gms.games.achievement

  com.google.android.gms.games.event

  com.google.android.gms.games.leaderboard

  com.google.android.gms.games.multiplayer

  com.google.android.gms.games.multiplayer.realtime

  com.google.android.gms.games.multiplayer.turnbased

  com.google.android.gms.games.quest

  com.google.android.gms.games.request

  com.google.android.gms.games.snapshot

  com.google.android.gms.gcm

  com.google.android.gms.identity.intents

  com.google.android.gms.identity.intents.model

  com.google.android.gms.location

  com.google.android.gms.maps

  com.google.android.gms.maps.model

  com.google.android.gms.panorama

  com.google.android.gms.plus

  com.google.android.gms.plus.model.moments

  com.google.android.gms.plus.model.people

  com.google.android.gms.security

  com.google.android.gms.tagmanager

  com.google.android.gms.wallet

  com.google.android.gms.wallet.fragment

  com.google.android.gms.wearable

Select a package to view its members

      fullscreen
      Use Tree NavigationUse Panel Navigation

Class Hierarchy

Class
Interfaces

        R

        R.attr

        R.color

        R.drawable

        R.id

        R.integer

        R.string

        R.style

        R.styleable

        ReserveIntents

        SearchIntents

        AdListener

        AdRequest

        AdRequest.Builder

        AdSize

        InterstitialAd

        PublisherAdRequest

        PublisherAdRequest.Builder

        PublisherInterstitialAd

        AdvertisingIdClient

        AdvertisingIdClient.Info

        AdMobExtras

            NetworkExtras

        CustomEventExtras

            NetworkExtras

        SearchAdRequest

        SearchAdRequest.Builder

        ExceptionReporter

            Thread.UncaughtExceptionHandler

        GoogleAnalytics

        HitBuilders

        HitBuilders.HitBuilder

        HitBuilders.AppViewBuilder

        HitBuilders.EventBuilder

        HitBuilders.ExceptionBuilder

        HitBuilders.ItemBuilder

        HitBuilders.ScreenViewBuilder

        HitBuilders.SocialBuilder

        HitBuilders.TimingBuilder

        HitBuilders.TransactionBuilder

        Logger.LogLevel

        StandardExceptionParser

            ExceptionParser

        Tracker

        Product

        ProductAction

        Promotion

        AppIndex

        AppIndexApi.AppIndexingLink

        AppStateManager

        AppStateStatusCodes

        AccountChangeEvent

            SafeParcelable

        AccountChangeEventsRequest

            SafeParcelable

        AccountChangeEventsResponse

            SafeParcelable

        GoogleAuthUtil

        GoogleAuthApiClientImpl

        GoogleAuthApiRequest

            SafeParcelable

        GoogleAuthApiResponse

            SafeParcelable

        ApplicationMetadata

            SafeParcelable

        Cast

        Cast.CastOptions

            Api.ApiOptions.HasOptions

        Cast.CastOptions.Builder

        Cast.Listener

        CastDevice

            SafeParcelable

        CastMediaControlIntent

        CastStatusCodes

        LaunchOptions

            SafeParcelable

        LaunchOptions.Builder

        MediaInfo

        MediaInfo.Builder

        MediaMetadata

        MediaStatus

        MediaTrack

        MediaTrack.Builder

        RemoteMediaPlayer

            Cast.MessageReceivedCallback

        TextTrackStyle

        AccountPicker

        ConnectionResult

        GooglePlayServicesUtil

        Scopes

        Api

        Api.ApiOptions.NoOptions

            Api.ApiOptions.NotRequiredOptions

        Batch

            PendingResult

        Batch.Builder

        BatchResult

            Result

        BatchResultToken

        CommonStatusCodes

        DriveStatusCodes

        FitnessStatusCodes

        GeofenceStatusCodes

        WearableStatusCodes

        GoogleApiClient.Builder

        Scope

        Status

            Result

            SafeParcelable

        DataBuffer

            Releasable

            Iterable

        AppStateBuffer

        MetadataBuffer

        GameBuffer

        PlayerBuffer

        AchievementBuffer

        EventBuffer

        LeaderboardBuffer

        LeaderboardScoreBuffer

        InvitationBuffer

        ParticipantBuffer

        TurnBasedMatchBuffer

        MilestoneBuffer

        QuestBuffer

        GameRequestBuffer

        SnapshotMetadataBuffer

        MomentBuffer

        PersonBuffer

        DataEventBuffer

            Result

        DataItemBuffer

            Result

        DataBufferUtils

        FreezableUtils

        ImageManager

        WebImage

            SafeParcelable

        Contents

            SafeParcelable

        CreateFileActivityBuilder

        Drive

        DriveId

            SafeParcelable

        ExecutionOptions

        ExecutionOptions.Builder

        Metadata

            Freezable

        MetadataChangeSet

        MetadataChangeSet.Builder

        OpenFileActivityBuilder

        ChangeEvent

            SafeParcelable

            ResourceEvent

        CompletionEvent

            SafeParcelable

            ResourceEvent

        Filters

        Query

            SafeParcelable

        Query.Builder

        SearchableField

        SortOrder

            SafeParcelable

        SortOrder.Builder

        SortableField

        Fitness

        FitnessActivities

        HistoryApi.ViewIntentBuilder

        SessionsApi.ViewIntentBuilder

        BleDevice

            SafeParcelable

        Bucket

            SafeParcelable

        DataPoint

            SafeParcelable

        DataSet

            SafeParcelable

        DataSource

            SafeParcelable

        DataSource.Builder

        DataType

            SafeParcelable

        Device

            SafeParcelable

        Field

            SafeParcelable

        Session

            SafeParcelable

        Session.Builder

        Subscription

            SafeParcelable

        Value

            SafeParcelable

        BleScanCallback

        DataDeleteRequest

            SafeParcelable

        DataDeleteRequest.Builder

        DataReadRequest

            SafeParcelable

        DataReadRequest.Builder

        DataSourcesRequest

            SafeParcelable

        DataSourcesRequest.Builder

        DataTypeCreateRequest

            SafeParcelable

        DataTypeCreateRequest.Builder

        SensorRequest

        SensorRequest.Builder

        SessionInsertRequest

            SafeParcelable

        SessionInsertRequest.Builder

        SessionReadRequest

            SafeParcelable

        SessionReadRequest.Builder

        StartBleScanRequest

            SafeParcelable

        StartBleScanRequest.Builder

        BleDevicesResult

            Result

            SafeParcelable

        DataReadResult

            Result

            SafeParcelable

        DataSourcesResult

            Result

            SafeParcelable

        DataTypeResult

            Result

            SafeParcelable

        ListSubscriptionsResult

            Result

            SafeParcelable

        SessionReadResult

            Result

            SafeParcelable

        SessionStopResult

            Result

            SafeParcelable

        FitnessSensorServiceRequest

            SafeParcelable

        GameEntity

            SafeParcelable

            Game

        Games

        Games.GamesOptions

            Api.ApiOptions.Optional

        Games.GamesOptions.Builder

        GamesActivityResultCodes

        GamesStatusCodes

        PageDirection

        PlayerEntity

            SafeParcelable

            Player

        PlayerLevel

            SafeParcelable

        PlayerLevelInfo

            SafeParcelable

        AchievementEntity

            SafeParcelable

            Achievement

        EventEntity

            SafeParcelable

            Event

        ScoreSubmissionData

        ScoreSubmissionData.Result

        InvitationEntity

            SafeParcelable

            Invitation

        ParticipantEntity

            SafeParcelable

            Participant

        ParticipantResult

            SafeParcelable

        ParticipantUtils

        RealTimeMessage

            Parcelable

        RoomConfig

        RoomConfig.Builder

        RoomEntity

            SafeParcelable

            Room

        LoadMatchesResponse

        TurnBasedMatchConfig

        TurnBasedMatchConfig.Builder

        TurnBasedMatchEntity

            SafeParcelable

            TurnBasedMatch

        MilestoneEntity

            SafeParcelable

            Milestone

        QuestEntity

            SafeParcelable

            Quest

        GameRequestEntity

            SafeParcelable

            GameRequest

        SnapshotContents

            SafeParcelable

        SnapshotEntity

            SafeParcelable

            Snapshot

        SnapshotMetadataChange

            SafeParcelable

        SnapshotMetadataChange.Builder

        SnapshotMetadataEntity

            SafeParcelable

            SnapshotMetadata

        GoogleCloudMessaging

        Task

            Parcelable

        Address

        Address.AddressOptions

            Api.ApiOptions.HasOptions

        UserAddressRequest

            SafeParcelable

        UserAddressRequest.Builder

        CountrySpecification

            SafeParcelable

        UserAddress

            SafeParcelable

        ActivityRecognition

        ActivityRecognitionClient

            GooglePlayServicesClient

        ActivityRecognitionResult

            SafeParcelable

        DetectedActivity

            SafeParcelable

        Geofence.Builder

        GeofencingEvent

        LocationClient

            GooglePlayServicesClient

        LocationRequest

            SafeParcelable

        LocationServices

        LocationStatusCodes

        CameraUpdate

        CameraUpdateFactory

        GoogleMap

        GoogleMapOptions

            SafeParcelable

        MapsInitializer

        Projection

        StreetViewPanorama

        StreetViewPanoramaOptions

            SafeParcelable

        UiSettings

        BitmapDescriptor

        BitmapDescriptorFactory

        CameraPosition

            SafeParcelable

        CameraPosition.Builder

        Circle

        CircleOptions

            SafeParcelable

        GroundOverlay

        GroundOverlayOptions

            SafeParcelable

        IndoorBuilding

        IndoorLevel

        LatLng

            SafeParcelable

        LatLngBounds

            SafeParcelable

        LatLngBounds.Builder

        Marker

        MarkerOptions

            SafeParcelable

        Polygon

        PolygonOptions

            SafeParcelable

        Polyline

        PolylineOptions

            SafeParcelable

        StreetViewPanoramaCamera

            SafeParcelable

        StreetViewPanoramaCamera.Builder

        StreetViewPanoramaLink

            SafeParcelable

        StreetViewPanoramaLocation

            SafeParcelable

        StreetViewPanoramaOrientation

            SafeParcelable

        StreetViewPanoramaOrientation.Builder

        Tile

            SafeParcelable

        TileOverlay

        TileOverlayOptions

            SafeParcelable

        UrlTileProvider

            TileProvider

        VisibleRegion

            SafeParcelable

        Panorama

        Plus

        Plus.PlusOptions

            Api.ApiOptions.Optional

        Plus.PlusOptions.Builder

        PlusClient

            GooglePlayServicesClient

        PlusClient.Builder

        PlusOneButton.DefaultOnPlusOneClickListener

            View.OnClickListener

            PlusOneButton.OnPlusOneClickListener

        PlusShare

        PlusShare.Builder

        ItemScope.Builder

        Moment.Builder

        Person.Cover.Layout

        Person.Gender

        Person.ObjectType

        Person.Organizations.Type

        Person.RelationshipStatus

        Person.Urls.Type

        ProviderInstaller

        Container

        DataLayer

        TagManager

        Address

            SafeParcelable

        Cart

            SafeParcelable

        Cart.Builder

        CountrySpecification

            SafeParcelable

        FullWallet

            SafeParcelable

        FullWalletRequest

            SafeParcelable

        FullWalletRequest.Builder

        InstrumentInfo

            SafeParcelable

        LineItem

            SafeParcelable

        LineItem.Builder

        LoyaltyWalletObject

            SafeParcelable

        MaskedWallet

            SafeParcelable

        MaskedWallet.Builder

        MaskedWalletRequest

            SafeParcelable

        MaskedWalletRequest.Builder

        NotifyTransactionStatusRequest

            SafeParcelable

        NotifyTransactionStatusRequest.Builder

        OfferWalletObject

            SafeParcelable

        ProxyCard

            SafeParcelable

        Wallet

        Wallet.WalletOptions

            Api.ApiOptions.HasOptions

        Wallet.WalletOptions.Builder

        WalletConstants

        BuyButtonAppearance

        BuyButtonText

        Dimension

        WalletFragmentInitParams

            SafeParcelable

        WalletFragmentInitParams.Builder

        WalletFragmentMode

        WalletFragmentOptions

            SafeParcelable

        WalletFragmentOptions.Builder

        WalletFragmentState

        WalletFragmentStyle

            SafeParcelable

        WalletLogoImageType

        Asset

            SafeParcelable

        DataMap

        DataMapItem

        PutDataMapRequest

        PutDataRequest

            SafeParcelable

        Wearable

        Wearable.WearableOptions

            Api.ApiOptions.Optional

        Wearable.WearableOptions.Builder

  Except as noted, this content is licensed under Apache 2.0.
  For details and restrictions, see the
  Content License.

    Android GmsCore 1501030 r —

    About Android  |
    Legal  |
    Support


text:
package binary

import "fmt"

// Object is the interface to any class that wants to be encoded/decoded.
type Object interface {
	// Class returns the serialize information and functionality for this type.
	// The method should be valid on a nil pointer.
	Class() Class
}

// ObjectCast is automatically called by the generated decoders.
func ObjectCast(obj Object) Object {
	return obj
}

// UpgradeDecoder provides a decoder interface which maybe used to
// decode a stream from an old version into a newer version.
type UpgradeDecoder interface {
	// New constructs a new Object that this decoder handles.
	// For a frozen decoder, this would be the new version, not the frozen one, and as such the type returned may not
	// match the schema this decoder was registered against.
	New() Object
	// DecodeTo reads into the supplied object from the supplied Decoder.
	// The object must be the same concrete type that New would create, the
	// implementation is allowed to panic if it is not.
	DecodeTo(Decoder, Object)
}

// Class represents a struct type in the binary registry.
type Class interface {
	// Encode writes the supplied object to the supplied Encoder.
	// The object must be a type the Class understands, the implementation is
	// allowed to panic if it is not.
	Encode(Encoder, Object)

	// DecodeTo reads into the supplied object from the supplied Decoder.
	// The object must be a type the Class understands, the implementation is
	// allowed to panic if it is not.
	DecodeTo(Decoder, Object)

	// Returns the type descriptor for the class.
	Schema() *Entity
}

type FrozenClassBase struct{}

// FrozenClassBase provides Encode() so that they satisfy the above Class
// interface, but they should never be called.
func (c *FrozenClassBase) Encode(e Encoder, o Object) {
	e.SetError(fmt.Errorf(
		"Attempt to encode a frozen object of type %T id %v", o, o.Class().Schema()))
}

// Generate is used to tag structures that need an auto generated Class.
// The codergen function searches packages for structs that have this type as an
// anonymous field, and then automatically generates the encoding and decoding
// functionality for those structures. For example, the following struct would
// create the Class with methods needed to encode and decode the Name and Value
// fields, and register that class.
// The embedding will also fully implement the binary.Object interface, but with
// methods that panic. This will get overridden with the generated Methods.
// This is important because it means the package is resolvable without the
// generated code, which means the types can be correctly evaluated during the
// generation process.
//
// type MyNamedValue struct {
//    binary.Generate
//    Name  string
//    Value []byte
// }
//
// Code generation can be customized with tags:
// type MySomethingThatWontHaveAJavaEquivalent struct {
//     binary.Generate `java:"disable"`
// }
//
// We currently use the following tags:
//   cpp
//   java
//   disable
//   display
//   globals
//   id
//   identity
//   implements
//   javaDefineEmptyArrays:"true"
//      If applied to a struct, any slice fields being read from the wire that
//      have a length of zero will be set to the same instance of an empty array
//      to avoid unnecessary allocations. e.g. ...service.atom.Observations.
//   version
//
type Generate struct{}

func (Generate) Class() Class { panic("Class() not implemented") }

var _ Object = Generate{} // Verify that Generate implements Object.

// Frozen is used to tag structures that represent past versions of types
// which may appear in old capture files. Frozen must be include a "name" tag
// which identifies the name of the struct now in use. Manual upgrading is
// provided with a function of the form:
//
//  func (before *FrozenStruct) upgrade(after *GenerateStruct)
//
// See binary/test/frozen.go for examples
type Frozen struct{}

func (Frozen) Class() Class { panic("Class() not implemented") }

var _ Object = Frozen{} // Verify that Frozen implements Object.


text: Cracking the Coding Interview: Programming Questions and Solutions in Golang


text:
import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common";

import { environment } from "environments/environment";

import { SharedModule } from "app/shared/shared.module";

import { CategoryCreateComponent } from "./category-create/category-create.component";
import { CategoryDetailsComponent } from "./category-details/category-details.component";
import { CategoryEditComponent } from "./category-edit/category-edit.component";
import { CategoriesListComponent } from "./categories-list/categories-list.component";
import { CategoriesStubService } from "app/categories/service/categories-stub.service";
import { CategoriesService, CategoriesRealService } from "app/categories/service/categories.service";
import { CategoriesRoutingModule } from "app/categories/categories-routing.module";

import { IngredientsService, IngredientsRealService } from "app/ingredients/service/ingredients.service";
import { IngredientsStubService } from "app/ingredients/service/ingredients-stub.service";

@NgModule({
  imports: [
    SharedModule,
    CategoriesRoutingModule
  ],
  declarations: [
    CategoryCreateComponent,
    CategoryDetailsComponent,
    CategoryEditComponent,
    CategoriesListComponent
  ],
  providers: [
    {
      provide: CategoriesService,
      useClass: environment.fake ? CategoriesStubService : CategoriesRealService
    },
    {
      provide: IngredientsService,
      useClass: environment.fake ? IngredientsStubService : IngredientsRealService
    }
  ]
})
export class CategoriesModule { }


text:
package com.intellij.openapi.components;

/**
 * THIS CLASS WAS GENERATED AUTOMATICALLY WITH StubGen BASED ON IDEA BINARIES
 * DON'T MODIFY IT MANUALLY!

 * @author Alexander Kochurov (alexander.kochurov@maxifier.com)
 */
public interface BaseComponent extends NamedComponent {
     void disposeComponent();

     void initComponent();

}


text:
package com.wanglinkeji.wanglin.activity;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.view.inputmethod.InputMethodManager;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.PopupWindow;
import android.widget.TextView;
import android.widget.Toast;

import com.wanglinkeji.wanglin.R;
import com.wanglinkeji.wanglin.adapter.ListViewAdapter_NeighborHouseEstate;
import com.wanglinkeji.wanglin.model.HousingEstateModel;
import com.wanglinkeji.wanglin.model.HousingEstateblogModel;
import com.wanglinkeji.wanglin.util.DBUtil;
import com.wanglinkeji.wanglin.util.HttpUtil;
import com.wanglinkeji.wanglin.util.OtherUtil;
import com.wanglinkeji.wanglin.util.WangLinApplication;
import com.wanglinkeji.wanglin.util.WanglinHttpResponseListener;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

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

/**
 * Created by Administrator on 2016/9/10.
 * 搜索小区Acitivity
 */
public class SearchHouseEstateActivity extends Activity implements View.OnClickListener {

    private ImageView imageView_cancle, imageView_searchIcon;

    private ListView listView_houseList;

    private EditText editText_keyWord;

    private PopupWindow loading_page;

    private View rootView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.layout_activity_search_house_estate);

        viewInit();
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            //返回按钮
            case R.id.imageview_searchHouseEstate_cancle:{
                SearchHouseEstateActivity.this.finish();
                break;
            }
            case R.id.imageview_searchHouseEstate_searchIncon:{
                if (editText_keyWord.getText().length() == 0){
                    Toast.makeText(SearchHouseEstateActivity.this, "搜索内容不能为空哦!", Toast.LENGTH_SHORT).show();
                }else {
                    loading_page.showAtLocation(rootView, Gravity.CENTER, 0, 0);
                    searchHouseEstateByKeyWord(editText_keyWord.getText().toString());
                    //收起软键盘
                    ((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(editText_keyWord.getWindowToken(), 0);
                }
                break;
            }
            default:
                break;
        }
    }

    private void viewInit() {
        loading_page = OtherUtil.getLoadingPage(SearchHouseEstateActivity.this);
        rootView = LayoutInflater.from(SearchHouseEstateActivity.this).inflate(R.layout.layout_activity_search_house_estate, null);
        imageView_cancle = (ImageView) findViewById(R.id.imageview_searchHouseEstate_cancle);
        imageView_cancle.setOnClickListener(this);
        imageView_searchIcon = (ImageView) findViewById(R.id.imageview_searchHouseEstate_searchIncon);
        imageView_searchIcon.setOnClickListener(this);
        listView_houseList = (ListView) findViewById(R.id.listview_searchHousEstate_houseList);
        listView_houseList.setAdapter(new ArrayAdapter<HousingEstateModel>(SearchHouseEstateActivity.this, android.R.layout.simple_expandable_list_item_1,
                HousingEstateModel.list_housingEstate_neighbor));
        listView_houseList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
                Intent intent = new Intent();
                intent.putExtra("houseEstateName", HousingEstateModel.list_housingEstate_neighbor.get((new Long(l).intValue())).getName());
                intent.putExtra("houseEstateId", HousingEstateModel.list_housingEstate_neighbor.get(new Long(l).intValue()).getId());
                setResult(RESULT_OK, intent);
                SearchHouseEstateActivity.this.finish();
            }
        });
        editText_keyWord = (EditText) findViewById(R.id.edittext_searchHousingEstate_searchHousingEstate);
        editText_keyWord.setText(getIntent().getStringExtra("keyWord"));
        editText_keyWord.setOnEditorActionListener(new TextView.OnEditorActionListener() {
            @Override
            public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
                if (editText_keyWord.getText().length() == 0){
                    Toast.makeText(SearchHouseEstateActivity.this, "搜索内容不能为空哦!", Toast.LENGTH_SHORT).show();
                }else {
                    loading_page.showAtLocation(rootView, Gravity.CENTER, 0, 0);
                    searchHouseEstateByKeyWord(editText_keyWord.getText().toString());
                    //收起软键盘
                    ((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(editText_keyWord.getWindowToken(), 0);
                }
                return true;
            }
        });

    }

    private void searchHouseEstateByKeyWord(String keyword){
        Map<String, String> params = new HashMap<>();
        params.put("Lng", String.valueOf(WangLinApplication.locationInfoModel.getLongitude()));
        params.put("Lat", String.valueOf(WangLinApplication.locationInfoModel.getLatitude()));
        params.put("RegionId", String.valueOf(WangLinApplication.locationInfoModel.getLocationCityId()));
        params.put("Key", keyword);
        HttpUtil.sendVolleyStringRequest_Post(SearchHouseEstateActivity.this, HttpUtil.seatchHouseEstateByKeyWork_url, params, DBUtil.getLoginUser().getToken(),
                "yellow_searchHouseEstateByKeyWord", new WanglinHttpResponseListener() {
                    @Override
                    public void onSuccessResponse(JSONObject jsonObject_response) {
                        try {
                            JSONArray jsonArray_housingEstatelist = jsonObject_response.getJSONArray("Data");
                            HousingEstateModel.list_housingEstate_neighbor = new ArrayList<>();
                            for (int i = 0; i < jsonArray_housingEstatelist.length(); i++) {
                                JSONObject jsonObject_housingEstate = jsonArray_housingEstatelist.getJSONObject(i);
                                HousingEstateModel housingEstateModel = new HousingEstateModel();
                                housingEstateModel.setId(jsonObject_housingEstate.getInt("Id")); //设置小区ID
                                housingEstateModel.setName(jsonObject_housingEstate.getString("Name")); //设置小区名
                                housingEstateModel.setCity(jsonObject_housingEstate.getString("City"));//设置小区城市
                                housingEstateModel.setRegionId(jsonObject_housingEstate.getInt("RegionId")); //设置区域ID
                                housingEstateModel.setCityId(jsonObject_housingEstate.getInt("CityId"));//设置城市ID
                                //设置小区口号
                                housingEstateModel.setSlogan(jsonObject_housingEstate.getString("Slogan"));
                                if (housingEstateModel.getSlogan().equals("null")) {
                                    housingEstateModel.setSlogan("");
                                }
                                HousingEstateModel.list_housingEstate_neighbor.add(housingEstateModel);
                            }
                            listView_houseList.setAdapter(new ArrayAdapter<HousingEstateModel>(SearchHouseEstateActivity.this, android.R.layout.simple_expandable_list_item_1,
                                    HousingEstateModel.list_housingEstate_neighbor));
                            loading_page.dismiss();
                        } catch (JSONException e) {
                            loading_page.dismiss();
                            Toast.makeText(SearchHouseEstateActivity.this, "搜索失败,失败原因:解析返回结果出错,请重试!", Toast.LENGTH_SHORT).show();
                            e.printStackTrace();
                        }
                    }
                    @Override
                    public void onConnectingError() {
                        loading_page.dismiss();
                    }
                    @Override
                    public void onDisconnectError() {
                        loading_page.dismiss();
                    }
                });
    }

}


text:
import contextlib
import logging
import urllib.parse

import pytest

asyncio = pytest.importorskip("asyncio")
aiohttp = pytest.importorskip("aiohttp")

import vcr  # noqa: E402

from .aiohttp_utils import aiohttp_app, aiohttp_request  # noqa: E402

def run_in_loop(fn):
    with contextlib.closing(asyncio.new_event_loop()) as loop:
        asyncio.set_event_loop(loop)
        task = loop.create_task(fn(loop))
        return loop.run_until_complete(task)

def request(method, url, output="text", **kwargs):
    def run(loop):
        return aiohttp_request(loop, method, url, output=output, **kwargs)

    return run_in_loop(run)

def get(url, output="text", **kwargs):
    return request("GET", url, output=output, **kwargs)

def post(url, output="text", **kwargs):
    return request("POST", url, output="text", **kwargs)

@pytest.fixture(params=["https", "http"])
def scheme(request):
    """Fixture that returns both http and https."""
    return request.param

def test_status(tmpdir, scheme):
    url = scheme + "://httpbin.org"
    with vcr.use_cassette(str(tmpdir.join("status.yaml"))):
        response, _ = get(url)

    with vcr.use_cassette(str(tmpdir.join("status.yaml"))) as cassette:
        cassette_response, _ = get(url)
        assert cassette_response.status == response.status
        assert cassette.play_count == 1

@pytest.mark.parametrize("auth", [None, aiohttp.BasicAuth("vcrpy", "test")])
def test_headers(tmpdir, scheme, auth):
    url = scheme + "://httpbin.org"
    with vcr.use_cassette(str(tmpdir.join("headers.yaml"))):
        response, _ = get(url, auth=auth)

    with vcr.use_cassette(str(tmpdir.join("headers.yaml"))) as cassette:
        if auth is not None:
            request = cassette.requests[0]
            assert "AUTHORIZATION" in request.headers
        cassette_response, _ = get(url, auth=auth)
        assert dict(cassette_response.headers) == dict(response.headers)
        assert cassette.play_count == 1
        assert "istr" not in cassette.data[0]
        assert "yarl.URL" not in cassette.data[0]

def test_case_insensitive_headers(tmpdir, scheme):
    url = scheme + "://httpbin.org"
    with vcr.use_cassette(str(tmpdir.join("whatever.yaml"))):
        _, _ = get(url)

    with vcr.use_cassette(str(tmpdir.join("whatever.yaml"))) as cassette:
        cassette_response, _ = get(url)
        assert "Content-Type" in cassette_response.headers
        assert "content-type" in cassette_response.headers
        assert cassette.play_count == 1

def test_text(tmpdir, scheme):
    url = scheme + "://httpbin.org"
    with vcr.use_cassette(str(tmpdir.join("text.yaml"))):
        _, response_text = get(url)

    with vcr.use_cassette(str(tmpdir.join("text.yaml"))) as cassette:
        _, cassette_response_text = get(url)
        assert cassette_response_text == response_text
        assert cassette.play_count == 1

def test_json(tmpdir, scheme):
    url = scheme + "://httpbin.org/get"
    headers = {"Content-Type": "application/json"}

    with vcr.use_cassette(str(tmpdir.join("json.yaml"))):
        _, response_json = get(url, output="json", headers=headers)

    with vcr.use_cassette(str(tmpdir.join("json.yaml"))) as cassette:
        _, cassette_response_json = get(url, output="json", headers=headers)
        assert cassette_response_json == response_json
        assert cassette.play_count == 1

def test_binary(tmpdir, scheme):
    url = scheme + "://httpbin.org/image/png"
    with vcr.use_cassette(str(tmpdir.join("binary.yaml"))):
        _, response_binary = get(url, output="raw")

    with vcr.use_cassette(str(tmpdir.join("binary.yaml"))) as cassette:
        _, cassette_response_binary = get(url, output="raw")
        assert cassette_response_binary == response_binary
        assert cassette.play_count == 1

def test_stream(tmpdir, scheme):
    url = scheme + "://httpbin.org/get"

    with vcr.use_cassette(str(tmpdir.join("stream.yaml"))):
        resp, body = get(url, output="raw")  # Do not use stream here, as the stream is exhausted by vcr

    with vcr.use_cassette(str(tmpdir.join("stream.yaml"))) as cassette:
        cassette_resp, cassette_body = get(url, output="stream")
        assert cassette_body == body
        assert cassette.play_count == 1

@pytest.mark.parametrize("body", ["data", "json"])
def test_post(tmpdir, scheme, body, caplog):
    caplog.set_level(logging.INFO)
    data = {"key1": "value1", "key2": "value2"}
    url = scheme + "://httpbin.org/post"
    with vcr.use_cassette(str(tmpdir.join("post.yaml"))):
        _, response_json = post(url, **{body: data})

    with vcr.use_cassette(str(tmpdir.join("post.yaml"))) as cassette:
        request = cassette.requests[0]
        assert request.body == data
        _, cassette_response_json = post(url, **{body: data})
        assert cassette_response_json == response_json
        assert cassette.play_count == 1

    assert next(
        (
            log
            for log in caplog.records
            if log.getMessage() == "<Request (POST) {}> not in cassette, sending to real server".format(url)
        ),
        None,
    ), "Log message not found."

def test_params(tmpdir, scheme):
    url = scheme + "://httpbin.org/get?d=d"
    headers = {"Content-Type": "application/json"}
    params = {"a": 1, "b": 2, "c": "c"}

    with vcr.use_cassette(str(tmpdir.join("get.yaml"))) as cassette:
        _, response_json = get(url, output="json", params=params, headers=headers)
        assert response_json["args"] == {"a": "1", "b": "2", "c": "c", "d": "d"}

    with vcr.use_cassette(str(tmpdir.join("get.yaml"))) as cassette:
        _, cassette_response_json = get(url, output="json", params=params, headers=headers)
        assert cassette_response_json == response_json
        assert cassette.play_count == 1

def test_params_same_url_distinct_params(tmpdir, scheme):
    url = scheme + "://httpbin.org/get"
    headers = {"Content-Type": "application/json"}
    params = {"a": 1, "b": 2, "c": "c"}

    with vcr.use_cassette(str(tmpdir.join("get.yaml"))) as cassette:
        _, response_json = get(url, output="json", params=params, headers=headers)

    with vcr.use_cassette(str(tmpdir.join("get.yaml"))) as cassette:
        _, cassette_response_json = get(url, output="json", params=params, headers=headers)
        assert cassette_response_json == response_json
        assert cassette.play_count == 1

    other_params = {"other": "params"}
    with vcr.use_cassette(str(tmpdir.join("get.yaml"))) as cassette:
        with pytest.raises(vcr.errors.CannotOverwriteExistingCassetteException):
            get(url, output="text", params=other_params)

def test_params_on_url(tmpdir, scheme):
    url = scheme + "://httpbin.org/get?a=1&b=foo"
    headers = {"Content-Type": "application/json"}

    with vcr.use_cassette(str(tmpdir.join("get.yaml"))) as cassette:
        _, response_json = get(url, output="json", headers=headers)
        request = cassette.requests[0]
        assert request.url == url

    with vcr.use_cassette(str(tmpdir.join("get.yaml"))) as cassette:
        _, cassette_response_json = get(url, output="json", headers=headers)
        request = cassette.requests[0]
        assert request.url == url
        assert cassette_response_json == response_json
        assert cassette.play_count == 1

def test_aiohttp_test_client(aiohttp_client, tmpdir):
    loop = asyncio.get_event_loop()
    app = aiohttp_app()
    url = "/"
    client = loop.run_until_complete(aiohttp_client(app))

    with vcr.use_cassette(str(tmpdir.join("get.yaml"))):
        response = loop.run_until_complete(client.get(url))

    assert response.status == 200
    response_text = loop.run_until_complete(response.text())
    assert response_text == "hello"
    response_text = loop.run_until_complete(response.text(errors="replace"))
    assert response_text == "hello"

    with vcr.use_cassette(str(tmpdir.join("get.yaml"))) as cassette:
        response = loop.run_until_complete(client.get(url))

    request = cassette.requests[0]
    assert request.url == str(client.make_url(url))
    response_text = loop.run_until_complete(response.text())
    assert response_text == "hello"
    assert cassette.play_count == 1

def test_aiohttp_test_client_json(aiohttp_client, tmpdir):
    loop = asyncio.get_event_loop()
    app = aiohttp_app()
    url = "/json/empty"
    client = loop.run_until_complete(aiohttp_client(app))

    with vcr.use_cassette(str(tmpdir.join("get.yaml"))):
        response = loop.run_until_complete(client.get(url))

    assert response.status == 200
    response_json = loop.run_until_complete(response.json())
    assert response_json is None

    with vcr.use_cassette(str(tmpdir.join("get.yaml"))) as cassette:
        response = loop.run_until_complete(client.get(url))

    request = cassette.requests[0]
    assert request.url == str(client.make_url(url))
    response_json = loop.run_until_complete(response.json())
    assert response_json is None
    assert cassette.play_count == 1

def test_redirect(aiohttp_client, tmpdir):
    url = "https://mockbin.org/redirect/302/2"

    with vcr.use_cassette(str(tmpdir.join("redirect.yaml"))):
        response, _ = get(url)

    with vcr.use_cassette(str(tmpdir.join("redirect.yaml"))) as cassette:
        cassette_response, _ = get(url)

        assert cassette_response.status == response.status
        assert len(cassette_response.history) == len(response.history)
        assert len(cassette) == 3
        assert cassette.play_count == 3

    # Assert that the real response and the cassette response have a similar
    # looking request_info.
    assert cassette_response.request_info.url == response.request_info.url
    assert cassette_response.request_info.method == response.request_info.method
    assert {k: v for k, v in cassette_response.request_info.headers.items()} == {
        k: v for k, v in response.request_info.headers.items()
    }
    assert cassette_response.request_info.real_url == response.request_info.real_url

def test_not_modified(aiohttp_client, tmpdir):
    """It doesn't try to redirect on 304"""
    url = "https://httpbin.org/status/304"

    with vcr.use_cassette(str(tmpdir.join("not_modified.yaml"))):
        response, _ = get(url)

    with vcr.use_cassette(str(tmpdir.join("not_modified.yaml"))) as cassette:
        cassette_response, _ = get(url)

        assert cassette_response.status == 304
        assert response.status == 304
        assert len(cassette_response.history) == len(response.history)
        assert len(cassette) == 1
        assert cassette.play_count == 1

def test_double_requests(tmpdir):
    """We should capture, record, and replay all requests and response chains,
    even if there are duplicate ones.

    We should replay in the order we saw them.
    """
    url = "https://httpbin.org/get"

    with vcr.use_cassette(str(tmpdir.join("text.yaml"))):
        _, response_text1 = get(url, output="text")
        _, response_text2 = get(url, output="text")

    with vcr.use_cassette(str(tmpdir.join("text.yaml"))) as cassette:
        resp, cassette_response_text = get(url, output="text")
        assert resp.status == 200
        assert cassette_response_text == response_text1

        # We made only one request, so we should only play 1 recording.
        assert cassette.play_count == 1

        # Now make the second test to url
        resp, cassette_response_text = get(url, output="text")

        assert resp.status == 200

        assert cassette_response_text == response_text2

        # Now that we made both requests, we should have played both.
        assert cassette.play_count == 2

def test_cookies(scheme, tmpdir):
    async def run(loop):
        cookies_url = scheme + (
            "://httpbin.org/response-headers?"
            "set-cookie=" + urllib.parse.quote("cookie_1=val_1; Path=/") + "&"
            "Set-Cookie=" + urllib.parse.quote("Cookie_2=Val_2; Path=/")
        )
        home_url = scheme + "://httpbin.org/"
        tmp = str(tmpdir.join("cookies.yaml"))
        req_cookies = {"Cookie_3": "Val_3"}
        req_headers = {"Cookie": "Cookie_4=Val_4"}

        # ------------------------- Record -------------------------- #
        with vcr.use_cassette(tmp) as cassette:
            async with aiohttp.ClientSession(loop=loop) as session:
                cookies_resp = await session.get(cookies_url)
                home_resp = await session.get(home_url, cookies=req_cookies, headers=req_headers)
                assert cassette.play_count == 0
        assert_responses(cookies_resp, home_resp)

        # -------------------------- Play --------------------------- #
        with vcr.use_cassette(tmp, record_mode=vcr.mode.NONE) as cassette:
            async with aiohttp.ClientSession(loop=loop) as session:
                cookies_resp = await session.get(cookies_url)
                home_resp = await session.get(home_url, cookies=req_cookies, headers=req_headers)
                assert cassette.play_count == 2
        assert_responses(cookies_resp, home_resp)

    def assert_responses(cookies_resp, home_resp):
        assert cookies_resp.cookies.get("cookie_1").value == "val_1"
        assert cookies_resp.cookies.get("Cookie_2").value == "Val_2"
        request_cookies = home_resp.request_info.headers["cookie"]
        assert "cookie_1=val_1" in request_cookies
        assert "Cookie_2=Val_2" in request_cookies
        assert "Cookie_3=Val_3" in request_cookies
        assert "Cookie_4=Val_4" in request_cookies

    run_in_loop(run)

def test_cookies_redirect(scheme, tmpdir):
    async def run(loop):
        # Sets cookie as provided by the query string and redirects
        cookies_url = scheme + "://httpbin.org/cookies/set?Cookie_1=Val_1"
        tmp = str(tmpdir.join("cookies.yaml"))

        # ------------------------- Record -------------------------- #
        with vcr.use_cassette(tmp) as cassette:
            async with aiohttp.ClientSession(loop=loop) as session:
                cookies_resp = await session.get(cookies_url)
                assert not cookies_resp.cookies
                cookies = session.cookie_jar.filter_cookies(cookies_url)
                assert cookies["Cookie_1"].value == "Val_1"
                assert cassette.play_count == 0
            cassette.requests[1].headers["Cookie"] == "Cookie_1=Val_1"

        # -------------------------- Play --------------------------- #
        with vcr.use_cassette(tmp, record_mode=vcr.mode.NONE) as cassette:
            async with aiohttp.ClientSession(loop=loop) as session:
                cookies_resp = await session.get(cookies_url)
                assert not cookies_resp.cookies
                cookies = session.cookie_jar.filter_cookies(cookies_url)
                assert cookies["Cookie_1"].value == "Val_1"
                assert cassette.play_count == 2
            cassette.requests[1].headers["Cookie"] == "Cookie_1=Val_1"

        # Assert that it's ignoring expiration date
        with vcr.use_cassette(tmp, record_mode=vcr.mode.NONE) as cassette:
            cassette.responses[0]["headers"]["set-cookie"] = [
                "Cookie_1=Val_1; Expires=Wed, 21 Oct 2015 07:28:00 GMT"
            ]
            async with aiohttp.ClientSession(loop=loop) as session:
                cookies_resp = await session.get(cookies_url)
                assert not cookies_resp.cookies
                cookies = session.cookie_jar.filter_cookies(cookies_url)
                assert cookies["Cookie_1"].value == "Val_1"

    run_in_loop(run)

def test_not_allow_redirects(tmpdir):
    url = "https://mockbin.org/redirect/308/5"
    path = str(tmpdir.join("redirects.yaml"))

    with vcr.use_cassette(path):
        response, _ = get(url, allow_redirects=False)
        assert response.url.path == "/redirect/308/5"
        assert response.status == 308

    with vcr.use_cassette(path) as cassette:
        response, _ = get(url, allow_redirects=False)
        assert response.url.path == "/redirect/308/5"
        assert response.status == 308
        assert cassette.play_count == 1


text:
from django_hstore.apps import GEODJANGO_INSTALLED

if GEODJANGO_INSTALLED:
    from django.test import TestCase
    from django.contrib.gis.geos import GEOSGeometry
    from django_hstore_tests.models import Location

    class TestDictionaryFieldPlusGIS(TestCase):
        """ Test DictionaryField with gis backend """
        pnt1 = GEOSGeometry('POINT(65.5758316 57.1345383)')
        pnt2 = GEOSGeometry('POINT(65.2316 57.3423233)')

        def setUp(self):
            Location.objects.all().delete()

        def _create_locations(self):
            loc1 = Location.objects.create(name='Location1', data={'prop1': '1', 'prop2': 'test_value'}, point=self.pnt1)
            loc2 = Location.objects.create(name='Location2', data={'prop1': '2', 'prop2': 'test_value'}, point=self.pnt2)
            return loc1, loc2

        def test_location_create(self):
            l1, l2 = self._create_locations()
            other_loc = Location.objects.get(point__contains=self.pnt1)
            self.assertEqual(other_loc.data, {'prop1': '1', 'prop2': 'test_value'})

        def test_location_hupdate(self):
            l1, l2 = self._create_locations()
            Location.objects.filter(point__contains=self.pnt1).hupdate('data', {'prop1': '2'})
            loc = Location.objects.exclude(point__contains=self.pnt2)[0]
            self.assertEqual(loc.data, {'prop1': '2', 'prop2': 'test_value'})
            loc = Location.objects.get(point__contains=self.pnt2)
            self.assertNotEqual(loc.data, {'prop1': '1', 'prop2': 'test_value'})

        def test_location_contains(self):
            l1, l2 = self._create_locations()
            self.assertEqual(Location.objects.filter(data__contains={'prop1': '1'}).count(), 1)
            self.assertEqual(Location.objects.filter(data__contains={'prop1': '2'}).count(), 1)

        def test_location_geomanager(self):
            l1, l2 = self._create_locations()
            d1 = Location.objects.filter(point__distance_lte=(self.pnt1, 70000))
            self.assertEqual(d1.count(), 2)

        def test_manager(self):
            from django_hstore.managers import HStoreGeoManager
            isinstance(Location.objects, HStoreGeoManager)
            hasattr(Location.objects, 'hpeek')
            hasattr(Location.objects, 'hslice')
            hasattr(Location.objects, 'hkeys')

    # noqa
    class TestReferencesFieldPlusGIS(TestDictionaryFieldPlusGIS):
        """ Test ReferenceField with gis backend """

        def _create_locations(self):
            loc1 = Location.objects.create(name='Location1', data={'prop1': '1', 'prop2': 'test_value'}, point=self.pnt1)
            loc2 = Location.objects.create(name='Location2', data={'prop1': '2', 'prop2': 'test_value'}, point=self.pnt2)
            return loc1, loc2

        def test_location_create(self):
            l1, l2 = self._create_locations()
            loc_1 = Location.objects.get(point__contains=self.pnt1)
            self.assertEqual(loc_1.data, {'prop1': '1', 'prop2': 'test_value'})
            loc_2 = Location.objects.get(point__contains=self.pnt2)
            self.assertEqual(loc_2.data, {'prop1': '2', 'prop2': 'test_value'})

        def test_location_hupdate(self):
            l1, l2 = self._create_locations()
            Location.objects.filter(point__contains=self.pnt1).hupdate('data', {'prop1': '2'})
            loc = Location.objects.exclude(point__contains=self.pnt2)[0]
            self.assertEqual(loc.data, {'prop1': '2', 'prop2': 'test_value'})
            loc = Location.objects.get(point__contains=self.pnt2)
            self.assertNotEqual(loc.data, {'prop1': '1', 'prop2': 'test_value'})


text:
Lines and asterisks indicating significant differences between two groups on a plot are commonly used in the life and social sciences.
To my knowledge, no MATLAB function for adding these is openly available.
`sigstar` makes it easy to add lines and significance asterisks joining one or more pairs of groups on bar charts, box plots, and even line plots. The user simply supplies the identities of the two groups and the p-value
(which the user has calculated using an appropriate test).

<img src="https://github.com/raacampbell/sigstar/blob/gh-pages/images/ss.png" />

### Usage
Group identity is defined as x-axis locations or, optionally, group names (if the x-axis labels are strings).
`sigstar` converts the supplied p-values to the appropriate number of asterisks and plots these over the lines that link the pair of groups.
`sigstar` attempts to intelligently place lines and asterisks so that they do not overlie existing plot elements.
By default, bars with longer horizontal extents are plotted above shorter bars.
This is the convention and it looks neater.
The user has control over the order in which significance bars are added.
Modifying the order provides control over the vertical position of the bars.
This is important for obtaining a neat result in a cluttered plot.

### More
See examples in "`help sigstar`" for details.
The handles of the added plot elements are returned by default, providing the user with fine control of the plot's appearance.
This is important since it's difficult to provision for all possible usage scenarios (see `demo_sigstar`).
The function should produce publication quality results, but you may need to play with the figure size and asterisk font size.

### Correct usage of significance stars
Significance indicators, like significance stars, are often missued.
Keep the following guidelines in mind when using this function:
* Only use the stars to highlight important results. Do not clutter your figures with irrelevent statistical tests.
* If your data can be fitted with a line or curve then do this and report and the coefficients and their associated confidence intervals. Do not perform multiple significance tests between different points along the curve. This is almost always bad practice.
* Barplots hide data: avoid them (even with error bars). Instead use historgrams, violin plots, box plots, or [notBoxPlots](https://github.com/raacampbell/notBoxPlot).


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.misker.mike.hasher">

    <uses-permission
        android:name="android.permission.INTERNET"
        android:required="false" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <uses-sdk
        android:maxSdkVersion="30"
        android:required="false" />

    <uses-feature
        android:name="android.hardware.screen.portrait"
        android:required="false" />

    <application
        android:allowBackup="false"
        android:icon="@mipmap/icon"
        android:label="@string/Hashr"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name="com.misker.mike.hasher.Main"
            android:windowSoftInputMode="stateHidden">

            <tools:validation testUrl="https://web.misker.me/hashr" />

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data
                    android:scheme="https"
                    android:host="web.misker.me"
                    android:pathPattern="/hashr" />
            </intent-filter>

        </activity>

        <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="ca-app-pub-5863757662079397~1363106066" />

    </application>

</manifest>


text:
package avlTree.mergers;

import avlTree.IAvlTree;
import avlTree.helpers.IRebalancingCounter;

public class MergingStrategy implements IMergingStrategy {
    private final IAvlTree[] avlTrees;
    private final int offset;
    private final int count;

    private final int[][] bestValues;
    private final int[][] bestIndexes;
    private final int[][] heights;

    public MergingStrategy(IAvlTree[] avlTrees) {
        this(avlTrees, 0, avlTrees.length);
    }

    public MergingStrategy(IAvlTree[] avlTrees, int offset, int count) {
        this.avlTrees = avlTrees;
        this.offset = offset;
        this.count = count;

        bestValues = new int[count][count];
        bestIndexes = new int[count][count];
        heights = new int[count][count];
        for (int i = 0; i < count; i++)
            for (int j = 0; j < count; j++)
                bestValues[i][j] = -1;
    }

    @Override
    public IAvlTree apply(IRebalancingCounter rebalancingCounter) {
        return apply(0, count - 1, rebalancingCounter);
    }

    private IAvlTree apply(int leftInclusive, int rightInclusive, IRebalancingCounter rebalancingCounter) {
        if (leftInclusive == rightInclusive)
            return getTree(leftInclusive);
        int middle = calculateBestIndex(leftInclusive, rightInclusive);
        IAvlTree leftTree = apply(leftInclusive, middle, rebalancingCounter);
        IAvlTree rightTree = apply(middle + 1, rightInclusive, rebalancingCounter);
        return leftTree.merge(rightTree, rebalancingCounter);
    }

    private IAvlTree getTree(int index) {
        return avlTrees[index + offset];
    }

    private int getHeight(int leftInclusive, int rightInclusive) {
        int maxHeight = Integer.MIN_VALUE;
        for (int i = leftInclusive; i <= rightInclusive; i++)
            maxHeight = Math.max(maxHeight, (int) getTree(i).getHeight());
        return maxHeight + rightInclusive - leftInclusive;
    }

    private int calculateBestIndex(int leftInclusive, int rightInclusive) {
        if (leftInclusive > rightInclusive)
            throw new RuntimeException(String.format("Invalid range [%d, %d]", leftInclusive, rightInclusive));

        if (bestValues[leftInclusive][rightInclusive] != -1)
            return bestIndexes[leftInclusive][rightInclusive];

        if (leftInclusive == rightInclusive) {
            bestValues[leftInclusive][rightInclusive] = 0;
            bestIndexes[leftInclusive][rightInclusive] = -1;
            heights[leftInclusive][rightInclusive] = (int) getTree(leftInclusive).getHeight();
        } else
            calculateValue(leftInclusive, rightInclusive);

        return bestIndexes[leftInclusive][rightInclusive];
    }

    private void calculateValue(int leftInclusive, int rightInclusive) {
        int bestValue = Integer.MAX_VALUE;
        int bestIndex = -1;
        for (int index = leftInclusive; index < rightInclusive; index++) {
            calculateBestIndex(leftInclusive, index);
            calculateBestIndex(index + 1, rightInclusive);
            int candidate = bestValues[leftInclusive][index] + bestValues[index + 1][rightInclusive] +
                    Math.abs(heights[leftInclusive][index] - heights[index + 1][rightInclusive]);
            if (candidate < bestValue) {
                bestValue = candidate;
                bestIndex = index;
            }
        }
        bestValues[leftInclusive][rightInclusive] = bestValue;
        bestIndexes[leftInclusive][rightInclusive] = bestIndex;
        heights[leftInclusive][rightInclusive] = getHeight(leftInclusive, rightInclusive);
    }
}


text:
package com.google.ads.googleads.v10.resources;

public final class CampaignAudienceViewProto {
  private CampaignAudienceViewProto() {}
  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistryLite registry) {
  }

  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistry registry) {
    registerAllExtensions(
        (com.google.protobuf.ExtensionRegistryLite) registry);
  }
  static final com.google.protobuf.Descriptors.Descriptor
    internal_static_google_ads_googleads_v10_resources_CampaignAudienceView_descriptor;
  static final
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_ads_googleads_v10_resources_CampaignAudienceView_fieldAccessorTable;

  public static com.google.protobuf.Descriptors.FileDescriptor
      getDescriptor() {
    return descriptor;
  }
  private static  com.google.protobuf.Descriptors.FileDescriptor
      descriptor;
  static {
    java.lang.String[] descriptorData = {
      "\n?google/ads/googleads/v10/resources/cam" +
      "paign_audience_view.proto\022\"google.ads.go" +
      "ogleads.v10.resources\032\037google/api/field_" +
      "behavior.proto\032\031google/api/resource.prot" +
      "o\"\344\001\n\024CampaignAudienceView\022L\n\rresource_n" +
      "ame\030\001 \001(\tB5\340A\003\372A/\n-googleads.googleapis." +
      "com/CampaignAudienceView:~\352A{\n-googleads" +
      ".googleapis.com/CampaignAudienceView\022Jcu" +
      "stomers/{customer_id}/campaignAudienceVi" +
      "ews/{campaign_id}~{criterion_id}B\213\002\n&com" +
      ".google.ads.googleads.v10.resourcesB\031Cam" +
      "paignAudienceViewProtoP\001ZKgoogle.golang." +
      "org/genproto/googleapis/ads/googleads/v1" +
      "0/resources;resources\242\002\003GAA\252\002\"Google.Ads" +
      ".GoogleAds.V10.Resources\312\002\"Google\\Ads\\Go" +
      "ogleAds\\V10\\Resources\352\002&Google::Ads::Goo" +
      "gleAds::V10::Resourcesb\006proto3"
    };
    descriptor = com.google.protobuf.Descriptors.FileDescriptor
      .internalBuildGeneratedFileFrom(descriptorData,
        new com.google.protobuf.Descriptors.FileDescriptor[] {
          com.google.api.FieldBehaviorProto.getDescriptor(),
          com.google.api.ResourceProto.getDescriptor(),
        });
    internal_static_google_ads_googleads_v10_resources_CampaignAudienceView_descriptor =
      getDescriptor().getMessageTypes().get(0);
    internal_static_google_ads_googleads_v10_resources_CampaignAudienceView_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_google_ads_googleads_v10_resources_CampaignAudienceView_descriptor,
        new java.lang.String[] { "ResourceName", });
    com.google.protobuf.ExtensionRegistry registry =
        com.google.protobuf.ExtensionRegistry.newInstance();
    registry.add(com.google.api.FieldBehaviorProto.fieldBehavior);
    registry.add(com.google.api.ResourceProto.resource);
    registry.add(com.google.api.ResourceProto.resourceReference);
    com.google.protobuf.Descriptors.FileDescriptor
        .internalUpdateFileDescriptor(descriptor, registry);
    com.google.api.FieldBehaviorProto.getDescriptor();
    com.google.api.ResourceProto.getDescriptor();
  }

  // @@protoc_insertion_point(outer_class_scope)
}


text:
var logger = require('log4js').getLogger('commandExecutor');
var path = require('path');
var spawn = require('child_process').spawn;

/**
 *
 *
 * opts - {
 *     "arguments" - CSV of arguments to run the command with "bootstrap-cloud,softlayer"
 *     "executable" - cloudify.sh location
 *     "cloudifyHome" - the cloudify home directory
 * }
 *
 *
 * handlers: {
 *
 *      "onErr" - on error `function(error){}`
 *      "onStdout" - on std out data  `function(data){}`
 *      "onStderr" - on err data  `function(data){}`
  *     "onClose" - on close `function(exitCode){}`
 *
 * }
 *
 *
 *
 * @param opts
 */

exports.execute = function( opts , handlers ){

    logger.info('executing', opts);

    var executable = opts.executable;
    var argumentsArray = [].concat(opts.arguments);

    var cloudifyHome = opts.cloudifyHome;

    logger.info( 'executable=' , path.resolve(executable) );
    logger.info( 'splitted arguments=' , argumentsArray );
    logger.info( 'cloudifyHome=' , cloudifyHome );

    process.env.CLOUDIFY_HOME = cloudifyHome;

    var myCmd = spawn( 	executable, argumentsArray );

    if ( !handlers.onStdout ){
        throw 'stdout handler is missing!';
    }
    myCmd.stdout.on('data', handlers.onStdout );

    if ( !handlers.onStderr ){
        throw 'stderr handler is missing'
    }
    myCmd.stderr.on('data', handlers.onStderr );

    if ( !handlers.onErr ){
        throw 'onerr handler is missing';
    }
    myCmd.on('error', handlers.onErr );

    if ( !handlers.onClose ){
        throw 'onclose handler is missing';
    }
    myCmd.on('exit', handlers.onClose);
};


text:
Many mobile apps share the same server side requirements.

This is a single server implementation providing:
* common ready to use services (think of builtins)
* configurable layer of services for common use cases (think of reusable apps)
* extensibility via python code (think of custom modules)

## What

We want to provide server side support for mobile apps, which includes:

* [Authentication](authentication.md)
* [Push notifications] (push_notifications.md)
* [Cloud database] (cloud_database.md)
* [Analytics] (analytics.md)

This will be provided by a django based web application.

The platform should have the following features:

* Support for multiple client applications
* Have a web based user interface
* Expose a REST API
* Be extensible with python code
* Be easily deployable to common infrastructures

## Future

* Static assets
* Async tasks
* Proxy


text:
package falgout.backup;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.NoSuchFileException;
import java.nio.file.Path;

import org.junit.rules.ExternalResource;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;

public class TemporaryFileStructure extends ExternalResource {
    private String prefix;
    public Path dir;
    public Path file1;
    public Path file2;
    public Path dir1;

    @Override
    public Statement apply(Statement base, Description description) {
        prefix = description.getTestClass().getSimpleName();
        return super.apply(base, description);
    }

    @Override
    protected void before() throws Throwable {
        dir = Files.createTempDirectory(prefix);
        dir1 = dir.resolve("dir1");
        file1 = dir.resolve("file1");
        file2 = dir1.resolve("file2");

        Files.createDirectory(dir1);
        Files.createFile(file1);
        Files.createFile(file2);
    }

    @Override
    protected void after() {
        try {
            Directories.delete(dir);
        } catch (NoSuchFileException e) {} catch (IOException e) {
            throw new Error(e);
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8" ?>
<!-- Don`t EDIT this FILE! -->
<content>

  <!-- -=== MANUAL CONTROL ===- -->

  <!-- Serial Monitor Menus -->
  <menu id="Form_CurvePlugins.button1">Построить</menu>
  <menu id="Form_CurvePlugins.button2">Подробнее
(Wikipedia)</menu>
  <menu id="Form_CurvePlugins.button3">Обновить</menu>
  <menu id="Form_CurvePlugins.label_cantFindPlugins">Не найдено плагинов</menu>
  <menu id="Form_CurvePlugins.label_creator_content">label2</menu>
  <menu id="Form_CurvePlugins.label_creator_name">История</menu>
  <menu id="Form_CurvePlugins.label_discr_content">label2</menu>
  <menu id="Form_CurvePlugins.label_discr_title">Описание</menu>
  <menu id="Form_CurvePlugins.label_load">Подождите, пока компилируются и
подготавливаются плагины. Это может занять
до п +</menu>
  <menu id="Form_CurvePlugins.label_prev_1">label1</menu>
  <menu id="Form_CurvePlugins.label_prev_2">label1</menu>
  <menu id="Form_CurvePlugins.label_Title">title</menu>
  <menu id="Form_CurvePlugins.label_usage_content">label2</menu>
  <menu id="Form_CurvePlugins.label_usage_discr">Применение</menu>
  <menu id="Form_CurvePlugins.loadingCircle_tab1">loadingCircle2</menu>
  <menu id="Form_CurvePlugins.Text">Мастер кривых</menu>

</content>


text:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
        xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
        jcr:primaryType="nt:unstructured"
        sling:resourceType="composum/nodes/system/tools/osgi/bundles"
        sling:resourceSuperType="composum/nodes/console/tools/page"/>


text:
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System.Collections.Generic;
using System.Linq;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Editor.Shared.Extensions;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Text.Operations;

namespace Microsoft.CodeAnalysis.Editor.Implementation.InlineRename
{
    /// <summary>
    /// This class contains the logic common to VS and ETA when implementing IInlineRenameUndoManager
    /// </summary>
    internal abstract class AbstractInlineRenameUndoManager<TBufferState>
    {
        protected class ActiveSpanState
        {
            public string ReplacementText;
            public int SelectionAnchorPoint;
            public int SelectionActivePoint;
        }

        protected readonly InlineRenameService InlineRenameService;

        protected readonly Dictionary<ITextBuffer, TBufferState> UndoManagers = new Dictionary<ITextBuffer, TBufferState>();
        protected readonly Stack<ActiveSpanState> UndoStack = new Stack<ActiveSpanState>();
        protected readonly Stack<ActiveSpanState> RedoStack = new Stack<ActiveSpanState>();
        protected ActiveSpanState initialState;
        protected ActiveSpanState currentState;
        protected bool updatePending = false;

        public AbstractInlineRenameUndoManager(InlineRenameService inlineRenameService)
        {
            this.InlineRenameService = inlineRenameService;
        }

        public void Disconnect()
        {
            this.UndoManagers.Clear();
            this.UndoStack.Clear();
            this.RedoStack.Clear();
            this.initialState = null;
            this.currentState = null;
        }

        private void UpdateCurrentState(string replacementText, ITextSelection selection, SnapshotSpan activeSpan)
        {
            var snapshot = activeSpan.Snapshot;
            var selectionSpan = selection.GetSnapshotSpansOnBuffer(snapshot.TextBuffer).Single();

            var start = selectionSpan.Start.TranslateTo(snapshot, PointTrackingMode.Positive).Position - activeSpan.Start.Position;
            var end = selectionSpan.End.TranslateTo(snapshot, PointTrackingMode.Positive).Position - activeSpan.Start.Position;

            this.currentState = new ActiveSpanState()
            {
                ReplacementText = replacementText,
                SelectionAnchorPoint = selection.IsReversed ? end : start,
                SelectionActivePoint = selection.IsReversed ? start : end
            };
        }

        public void CreateInitialState(string replacementText, ITextSelection selection, SnapshotSpan startingSpan)
        {
            UpdateCurrentState(replacementText, selection, startingSpan);
            this.initialState = this.currentState;
        }

        public void OnTextChanged(ITextSelection selection, SnapshotSpan singleTrackingSpanTouched)
        {
            this.RedoStack.Clear();
            if (!this.UndoStack.Any())
            {
                this.UndoStack.Push(this.initialState);
            }

            // For now, we will only ever be one Undo away from the beginning of the rename session.  We can
            // implement Undo merging in the future.
            var replacementText = singleTrackingSpanTouched.GetText();
            UpdateCurrentState(replacementText, selection, singleTrackingSpanTouched);

            this.InlineRenameService.ActiveSession.ApplyReplacementText(replacementText, propagateEditImmediately: false);
        }

        public void UpdateSelection(ITextView textView, ITextBuffer subjectBuffer, ITrackingSpan activeRenameSpan)
        {
            var snapshot = subjectBuffer.CurrentSnapshot;
            var anchor = new VirtualSnapshotPoint(snapshot, this.currentState.SelectionAnchorPoint + activeRenameSpan.GetStartPoint(snapshot));
            var active = new VirtualSnapshotPoint(snapshot, this.currentState.SelectionActivePoint + activeRenameSpan.GetStartPoint(snapshot));
            textView.SetSelection(anchor, active);
        }

        public void Undo(ITextBuffer subjectBuffer)
        {
            if (this.UndoStack.Count > 0)
            {
                this.RedoStack.Push(this.currentState);
                this.currentState = this.UndoStack.Pop();
                this.InlineRenameService.ActiveSession.ApplyReplacementText(this.currentState.ReplacementText, propagateEditImmediately: true);
            }
            else
            {
                this.InlineRenameService.ActiveSession.Cancel();
            }
        }

        public void Redo(ITextBuffer subjectBuffer)
        {
            if (this.RedoStack.Count > 0)
            {
                this.UndoStack.Push(this.currentState);
                this.currentState = this.RedoStack.Pop();
                this.InlineRenameService.ActiveSession.ApplyReplacementText(this.currentState.ReplacementText, propagateEditImmediately: true);
            }
        }

        protected abstract void UndoTemporaryEdits(ITextBuffer subjectBuffer, bool disconnect, bool undoConflictResolution);

        protected void ApplyReplacementText(ITextBuffer subjectBuffer, ITextUndoHistory undoHistory, object propagateSpansEditTag, IEnumerable<ITrackingSpan> spans, string replacementText)
        {
            // roll back to the initial state for the buffer after conflict resolution
            this.UndoTemporaryEdits(subjectBuffer, disconnect: false, undoConflictResolution: replacementText == string.Empty);

            using (var transaction = undoHistory.CreateTransaction(GetUndoTransactionDescription(replacementText)))
            using (var edit = subjectBuffer.CreateEdit(EditOptions.None, null, propagateSpansEditTag))
            {
                foreach (var span in spans)
                {
                    if (span.GetText(subjectBuffer.CurrentSnapshot) != replacementText)
                    {
                        edit.Replace(span.GetSpan(subjectBuffer.CurrentSnapshot), replacementText);
                    }
                }

                edit.ApplyAndLogExceptions();
                if (!edit.HasEffectiveChanges && !this.UndoStack.Any())
                {
                    transaction.Cancel();
                }
                else
                {
                    transaction.Complete();
                }
            }
        }

        protected string GetUndoTransactionDescription(string replacementText)
        {
            return replacementText == string.Empty ? "Delete Text" : replacementText;
        }
    }
}


text:
<?php declare(strict_types=1);

namespace PeeHaa\AsyncTwitter\Examples\Status;

use PeeHaa\AsyncTwitter\Api\Request\Status\Destroy;

require_once __DIR__ . '/../vendor/autoload.php';

$apiClient = require __DIR__ . '/create-client.php';

$request = (new Destroy(789019501211840512))
    ->trimUser()
;

\Amp\wait($apiClient->request($request));


text:
class Course::Group < ActiveRecord::Base
  after_initialize :set_defaults, if: :new_record?
  before_validation :set_defaults, if: :new_record?

  belongs_to :course, inverse_of: :groups
  has_many :group_users, inverse_of: :course_group, dependent: :destroy,
                         class_name: Course::GroupUser.name, foreign_key: :course_group_id
  has_many :users, through: :group_users

  accepts_nested_attributes_for :group_users, allow_destroy: true,
                                              reject_if: -> (params) { params[:user_id].blank? }

  validate :validate_new_users_are_unique

  private

  # Set default values
  def set_defaults
    group_users.build(user: creator, role: :manager,
                      creator: creator, updater: updater) if should_create_manager?
  end

  # Checks if the current group has sufficient information to have a manager, but does not
  # currently exist.
  #
  # @return [bool]
  def should_create_manager?
    course && creator &&
      course.course_users.exists?(user: creator) &&
      !group_users.exists?(user: creator)
  end

  # Validate that the new users are unique.
  #
  # Validating that the users in general are unique is already handled by the uniqueness
  # constraint in the {GroupUser} model. However, the uniqueness constraint does not work with
  # new records and will raise a {RecordNotUnique} error in that circumstance.
  def validate_new_users_are_unique
    new_group_users = group_users.select(&:new_record?)
    return if new_group_users.count == new_group_users.uniq(&:user).count

    errors.add(:group_users, :invalid)
    (new_group_users - new_group_users.uniq(&:user)).each do |group_user|
      group_user.errors.add(:user, :taken)
    end
  end
end


text:
using System;

namespace ninja.marching.flatstates
{
	public class IsWeapon:Axiom
	{
		public readonly Term<Item> Item;
		public IsWeapon (Term<Item> item) : base ("IsWeapon", item)
		{
			Item = item;
		}
	}
}


text:
import data = require('../data/interfaces');
import ValidationError = require('./ValidationError');
import Validator = require('./Validator');

// TODO
var i18n = {
	notANumber: 'Not a number',
	notAnInteger: 'Not an integer',
	numberTooSmall: 'Number too small',
	numberTooLarge: 'Number too large'
};

/**
 * Ensures that the value is a valid number.
 */
class NumericValidator extends Validator {
	options:NumericValidator.IOptions;

	validate(model:data.IModel, key:string, value:any):void {
		var options = this.options;

		value = Number(value);

		if (isNaN(value)) {
			model.addError(key, new ValidationError(i18n.notANumber));
			return;
		}

		if (options.integerOnly && Math.floor(value) !== value) {
			model.addError(key, new ValidationError(i18n.notAnInteger));
		}

		if (options.min != null && value < options.min) {
			model.addError(key, new ValidationError(i18n.numberTooSmall, { min: options.min }));
		}

		if (options.max != null && value > options.max) {
			model.addError(key, new ValidationError(i18n.numberTooLarge, { max: options.max }));
		}
	}
}

module NumericValidator {
	export interface IOptions extends Validator.IOptions {
		/**
		 * If provided, the value must be greater or equal to this number.
		 */
		min?:number;

		/**
		 * If provided, the value must be smaller or equal to this number.
		 */
		max?:number;

		/**
		 * If `true`, the value must be an integer.
		 */
		integerOnly?:boolean;
	}
}

export = NumericValidator;


text:
$(linefix)

function linefix() {
  var maxHeights = [];
  $('.linefix').each(function () {
    var group = $(this).data('linefix')
    if (typeof maxHeights[group] == 'undefined') maxHeights[group] = 0
    if (maxHeights[group] < $(this).height()) maxHeights[group] = $(this).height()
  })

  for (var group in maxHeights) {
    $('[data-linefix=' + group + ']').height(maxHeights[group])
  }

  var maxWidths = []
  $('.widthfix:visible').each(function () {
    var group = $(this).data('widthfix')
    if (typeof maxWidths[group] == 'undefined') maxWidths[group] = 0
    if (maxWidths[group] < $(this).width()) maxWidths[group] = $(this).width()
      console.log(maxWidths[group], $(this).width())
  })

  for (var group in maxWidths) {
    $('[data-widthfix=' + group + ']').width(maxWidths[group] - - 1) // なぜかそのままのwidthだと崩れることがあるので +1 しておく
  }
}