text:
/* AUTO-GENERATED FILE.  DO NOT MODIFY.
 *
 * This class was automatically generated by the
 * aapt tool from the resource data it found.  It
 * should not be modified by hand.
 */

package com.example.android.drawabletinting;

public final class R {
    public static final class array {
        public static final int blend_modes=0x7f040000;
    }
    public static final class attr {
        /**
Must be a color value, in the form of "#rgb", "#argb",
"#rrggbb", or "#aarrggbb".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
         */
        public static final int cardBackgroundColor=0x7f010000;
        /**
Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
         */
        public static final int cardCornerRadius=0x7f010001;
        /**
Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
         */
        public static final int cardElevation=0x7f010002;
        /**
Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
         */
        public static final int cardMaxElevation=0x7f010003;
        /**
Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
         */
        public static final int cardPreventCornerOverlap=0x7f010005;
        /**
Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
         */
        public static final int cardUseCompatPadding=0x7f010004;
        /**
Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
         */
        public static final int contentPadding=0x7f010006;
        /**
Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
         */
        public static final int contentPaddingBottom=0x7f01000a;
        /**
Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
         */
        public static final int contentPaddingLeft=0x7f010007;
        /**
Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
         */
        public static final int contentPaddingRight=0x7f010008;
        /**
Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
         */
        public static final int contentPaddingTop=0x7f010009;
    }
    public static final class color {
        public static final int cardview_dark_background=0x7f050000;
        public static final int cardview_light_background=0x7f050001;
        public static final int cardview_shadow_end_color=0x7f050002;
        public static final int cardview_shadow_start_color=0x7f050003;
        public static final int custom_tint=0x7f050009;
        public static final int deep_purple=0x7f050004;
        public static final int green=0x7f050005;
        public static final int light_blue=0x7f050006;
        public static final int light_purple=0x7f050007;
        public static final int red=0x7f050008;
    }
    public static final class dimen {
        public static final int cardview_compat_inset_shadow=0x7f060000;
        public static final int cardview_default_elevation=0x7f060001;
        public static final int cardview_default_radius=0x7f060002;
        public static final int horizontal_page_margin=0x7f060003;
        public static final int margin_huge=0x7f060004;
        public static final int margin_large=0x7f060005;
        public static final int margin_medium=0x7f060006;
        public static final int margin_small=0x7f060007;
        public static final int margin_tiny=0x7f060008;
        public static final int vertical_page_margin=0x7f060009;
    }
    public static final class drawable {
        public static final int btn_default_normal_holo=0x7f020000;
        public static final int buttonbackground=0x7f020001;
        public static final int ic_launcher=0x7f020002;
        public static final int tile=0x7f020003;
    }
    public static final class id {
        public static final int alphaSeek=0x7f0a0008;
        public static final int alphaText=0x7f0a0007;
        public static final int blendSpinner=0x7f0a0006;
        public static final int blueSeek=0x7f0a000e;
        public static final int blueText=0x7f0a000d;
        public static final int button=0x7f0a0004;
        public static final int greenSeek=0x7f0a000c;
        public static final int greenText=0x7f0a000b;
        public static final int image=0x7f0a0005;
        public static final int log_fragment=0x7f0a0002;
        public static final int menu_toggle_log=0x7f0a000f;
        public static final int redSeek=0x7f0a000a;
        public static final int redText=0x7f0a0009;
        public static final int sample_content_fragment=0x7f0a0003;
        public static final int sample_main_layout=0x7f0a0000;
        public static final int sample_output=0x7f0a0001;
    }
    public static final class layout {
        public static final int activity_main=0x7f030000;
        public static final int tinting_fragment=0x7f030001;
    }
    public static final class menu {
        public static final int main=0x7f090000;
    }
    public static final class string {
        public static final int app_name=0x7f070000;
        public static final int blend_mode_label=0x7f070001;
        public static final int intro_message=0x7f070002;
        public static final int prog_tint_label=0x7f070003;
        public static final int resource_tint_button=0x7f070004;
        public static final int resource_tint_label=0x7f070005;
        public static final int sample_hide_log=0x7f070006;
        public static final int sample_show_log=0x7f070007;
        public static final int value_alpha=0x7f070008;
        public static final int value_blue=0x7f070009;
        public static final int value_green=0x7f07000a;
        public static final int value_red=0x7f07000b;
    }
    public static final class style {
        public static final int AppTheme=0x7f080000;
        public static final int CardView=0x7f080001;
        public static final int CardView_Dark=0x7f080002;
        public static final int CardView_Light=0x7f080003;
        public static final int Theme_Base=0x7f080004;
        public static final int Theme_Sample=0x7f080005;
        public static final int Widget=0x7f080006;
        public static final int Widget_SampleMessage=0x7f080007;
        public static final int Widget_SampleMessageTile=0x7f080008;
    }
    public static final class styleable {
        /** Attributes that can be used with a CardView.

Includes the following attributes:

           <colgroup align="left" />
           <colgroup align="left" />

Attribute	Description

{@link #CardView_cardBackgroundColor com.example.android.drawabletinting:cardBackgroundColor}

{@link #CardView_cardCornerRadius com.example.android.drawabletinting:cardCornerRadius}

{@link #CardView_cardElevation com.example.android.drawabletinting:cardElevation}

{@link #CardView_cardMaxElevation com.example.android.drawabletinting:cardMaxElevation}

{@link #CardView_cardPreventCornerOverlap com.example.android.drawabletinting:cardPreventCornerOverlap}

{@link #CardView_cardUseCompatPadding com.example.android.drawabletinting:cardUseCompatPadding}

{@link #CardView_contentPadding com.example.android.drawabletinting:contentPadding}

{@link #CardView_contentPaddingBottom com.example.android.drawabletinting:contentPaddingBottom}

{@link #CardView_contentPaddingLeft com.example.android.drawabletinting:contentPaddingLeft}

{@link #CardView_contentPaddingRight com.example.android.drawabletinting:contentPaddingRight}

{@link #CardView_contentPaddingTop com.example.android.drawabletinting:contentPaddingTop}

           @see #CardView_cardBackgroundColor
           @see #CardView_cardCornerRadius
           @see #CardView_cardElevation
           @see #CardView_cardMaxElevation
           @see #CardView_cardPreventCornerOverlap
           @see #CardView_cardUseCompatPadding
           @see #CardView_contentPadding
           @see #CardView_contentPaddingBottom
           @see #CardView_contentPaddingLeft
           @see #CardView_contentPaddingRight
           @see #CardView_contentPaddingTop
         */
        public static final int[] CardView = {
            0x7f010000, 0x7f010001, 0x7f010002, 0x7f010003,
            0x7f010004, 0x7f010005, 0x7f010006, 0x7f010007,
            0x7f010008, 0x7f010009, 0x7f01000a
        };
        /**

This symbol is the offset where the {@link com.example.android.drawabletinting.R.attr#cardBackgroundColor}
          attribute's value can be found in the {@link #CardView} array.

Must be a color value, in the form of "#rgb", "#argb",
"#rrggbb", or "#aarrggbb".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
          @attr name com.example.android.drawabletinting:cardBackgroundColor
        */
        public static final int CardView_cardBackgroundColor = 0;
        /**

This symbol is the offset where the {@link com.example.android.drawabletinting.R.attr#cardCornerRadius}
          attribute's value can be found in the {@link #CardView} array.

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
          @attr name com.example.android.drawabletinting:cardCornerRadius
        */
        public static final int CardView_cardCornerRadius = 1;
        /**

This symbol is the offset where the {@link com.example.android.drawabletinting.R.attr#cardElevation}
          attribute's value can be found in the {@link #CardView} array.

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
          @attr name com.example.android.drawabletinting:cardElevation
        */
        public static final int CardView_cardElevation = 2;
        /**

This symbol is the offset where the {@link com.example.android.drawabletinting.R.attr#cardMaxElevation}
          attribute's value can be found in the {@link #CardView} array.

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
          @attr name com.example.android.drawabletinting:cardMaxElevation
        */
        public static final int CardView_cardMaxElevation = 3;
        /**

This symbol is the offset where the {@link com.example.android.drawabletinting.R.attr#cardPreventCornerOverlap}
          attribute's value can be found in the {@link #CardView} array.

Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
          @attr name com.example.android.drawabletinting:cardPreventCornerOverlap
        */
        public static final int CardView_cardPreventCornerOverlap = 5;
        /**

This symbol is the offset where the {@link com.example.android.drawabletinting.R.attr#cardUseCompatPadding}
          attribute's value can be found in the {@link #CardView} array.

Must be a boolean value, either "true" or "false".

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
          @attr name com.example.android.drawabletinting:cardUseCompatPadding
        */
        public static final int CardView_cardUseCompatPadding = 4;
        /**

This symbol is the offset where the {@link com.example.android.drawabletinting.R.attr#contentPadding}
          attribute's value can be found in the {@link #CardView} array.

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
          @attr name com.example.android.drawabletinting:contentPadding
        */
        public static final int CardView_contentPadding = 6;
        /**

This symbol is the offset where the {@link com.example.android.drawabletinting.R.attr#contentPaddingBottom}
          attribute's value can be found in the {@link #CardView} array.

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
          @attr name com.example.android.drawabletinting:contentPaddingBottom
        */
        public static final int CardView_contentPaddingBottom = 10;
        /**

This symbol is the offset where the {@link com.example.android.drawabletinting.R.attr#contentPaddingLeft}
          attribute's value can be found in the {@link #CardView} array.

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
          @attr name com.example.android.drawabletinting:contentPaddingLeft
        */
        public static final int CardView_contentPaddingLeft = 7;
        /**

This symbol is the offset where the {@link com.example.android.drawabletinting.R.attr#contentPaddingRight}
          attribute's value can be found in the {@link #CardView} array.

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
          @attr name com.example.android.drawabletinting:contentPaddingRight
        */
        public static final int CardView_contentPaddingRight = 8;
        /**

This symbol is the offset where the {@link com.example.android.drawabletinting.R.attr#contentPaddingTop}
          attribute's value can be found in the {@link #CardView} array.

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).

This may also be a reference to a resource (in the form
"@[package:]type:name") or
theme attribute (in the form
"?[package:][type:]name")
containing a value of this type.
          @attr name com.example.android.drawabletinting:contentPaddingTop
        */
        public static final int CardView_contentPaddingTop = 9;
    };
}


text:
help:
	@echo "Some usefull development shortcuts."
	@echo "  clean      Remove all generated files."
	@echo "  test       Run tests and analysis tools."
	@echo "  devsetup   Setup development environment."
	@echo "  publish    Build and upload package to pypi."

clean:
	@rm -rf env
	@rm -rf build
	@rm -rf dist
	@rm -rf *.egg
	@rm -rf *.egg-info
	@find | grep -i ".*\.pyc$$" | xargs -r -L1 rm

devsetup: clean
	@virtualenv -p /usr/bin/python2 env/py2
	@virtualenv -p /usr/bin/python3 env/py3
	@env/py2/bin/python setup.py develop
	@env/py3/bin/python setup.py develop
	@env/py2/bin/pip install ipython
	@env/py3/bin/pip install ipython
	@env/py2/bin/pip install pudb
	@env/py3/bin/pip install pudb

test: devsetup
	#screen -S dataserv -d -m env/py3/bin/python -m dataserv.app  # start server
	#env/py2/bin/python setup.py test
	env/py3/bin/python setup.py test
	#screen -S dataserv -X kill  # FIXME doesnt work in Makefile

publish: test
	env/py3/bin/python setup.py register sdist upload

# import pudb; pu.db # set break point

redpajama_set_name: RedPajamaGithub


text:
<li data-uid="<%= _id %>" class="page ui-state-default">
	<form class="form-inline">
		<%= fields.number.value %>
		<select class="article form-control">
			<% for(var i = 0, articles = getArticles(); i < articles.length; i++) { %>
				<option <% if (articles[i]._id == fields.article.value) { %> selected="selected" <% } %> value="<%= articles[i]._id %>"><%= articles[i].fields.title.value %></option>
			<% } %>
		</select>
		<select class="layout form-control">
			<% for(var i = 0, settings = getLayouts(); i < settings.length; i++) { %>
				<option <% if (fields.layout.value == settings[i]) { %> selected <% } %> value="<%= settings[i] %>"><%= settings[i] %></option>
			<% } %>
		</select>

	</form>


text:
<?php

namespace Illuminate\Tests\Integration\Mail;

use Illuminate\Contracts\Translation\HasLocalePreference;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Events\LocaleUpdated;
use Illuminate\Mail\Mailable;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\View;
use Illuminate\Testing\Assert;
use Orchestra\Testbench\TestCase;

class SendingMailWithLocaleTest extends TestCase
{
    protected function getEnvironmentSetUp($app)
    {
        $app['config']->set('mail.driver', 'array');

        $app['config']->set('app.locale', 'en');

        View::addLocation(__DIR__.'/Fixtures');

        app('translator')->setLoaded([
            '*' => [
                '*' => [
                    'en' => ['nom' => 'name'],
                    'ar' => ['nom' => 'esm'],
                    'es' => ['nom' => 'nombre'],
                ],
            ],
        ]);
    }

    public function testMailIsSentWithDefaultLocale()
    {
        Mail::to('test@mail.com')->send(new TestMail);

        $this->assertStringContainsString('name',
            app('mailer')->getSymfonyTransport()->messages()[0]->toString()
        );
    }

    public function testMailIsSentWithSelectedLocale()
    {
        Mail::to('test@mail.com')->locale('ar')->send(new TestMail);

        $this->assertStringContainsString('esm',
            app('mailer')->getSymfonyTransport()->messages()[0]->toString()
        );
    }

    public function testMailIsSentWithLocaleFromMailable()
    {
        $mailable = new TestMail;
        $mailable->locale('ar');

        Mail::to('test@mail.com')->send($mailable);

        $this->assertStringContainsString('esm',
            app('mailer')->getSymfonyTransport()->messages()[0]->toString()
        );
    }

    public function testMailIsSentWithLocaleUpdatedListenersCalled()
    {
        Carbon::setTestNow('2018-04-01');

        Event::listen(LocaleUpdated::class, function ($event) {
            Carbon::setLocale($event->locale);
        });

        Mail::to('test@mail.com')->locale('es')->send(new TimestampTestMail);

        Assert::assertMatchesRegularExpression('/nombre (en|dentro de) (un|1) d=C3=ADa/',
            app('mailer')->getSymfonyTransport()->messages()[0]->toString()
        );

        $this->assertSame('en', Carbon::getLocale());

        Carbon::setTestNow(null);
    }

    public function testLocaleIsSentWithModelPreferredLocale()
    {
        $recipient = new TestEmailLocaleUser([
            'email' => 'test@mail.com',
            'email_locale' => 'ar',
        ]);

        Mail::to($recipient)->send(new TestMail);

        $this->assertStringContainsString('esm',
            app('mailer')->getSymfonyTransport()->messages()[0]->toString()
        );
    }

    public function testLocaleIsSentWithSelectedLocaleOverridingModelPreferredLocale()
    {
        $recipient = new TestEmailLocaleUser([
            'email' => 'test@mail.com',
            'email_locale' => 'en',
        ]);

        Mail::to($recipient)->locale('ar')->send(new TestMail);

        $this->assertStringContainsString('esm',
            app('mailer')->getSymfonyTransport()->messages()[0]->toString()
        );
    }

    public function testLocaleIsSentWithModelPreferredLocaleWillIgnorePreferredLocaleOfTheCcRecipient()
    {
        $toRecipient = new TestEmailLocaleUser([
            'email' => 'test@mail.com',
            'email_locale' => 'ar',
        ]);

        $ccRecipient = new TestEmailLocaleUser([
            'email' => 'test.cc@mail.com',
            'email_locale' => 'en',
        ]);

        Mail::to($toRecipient)->cc($ccRecipient)->send(new TestMail);

        $this->assertStringContainsString('esm',
            app('mailer')->getSymfonyTransport()->messages()[0]->toString()
        );
    }

    public function testLocaleIsNotSentWithModelPreferredLocaleWhenThereAreMultipleRecipients()
    {
        $recipients = [
            new TestEmailLocaleUser([
                'email' => 'test@mail.com',
                'email_locale' => 'ar',
            ]),
            new TestEmailLocaleUser([
                'email' => 'test.2@mail.com',
                'email_locale' => 'ar',
            ]),
        ];

        Mail::to($recipients)->send(new TestMail);

        $this->assertStringContainsString('name',
            app('mailer')->getSymfonyTransport()->messages()[0]->toString()
        );
    }

    public function testLocaleIsSetBackToDefaultAfterMailSent()
    {
        Mail::to('test@mail.com')->locale('ar')->send(new TestMail);
        Mail::to('test@mail.com')->send(new TestMail);

        $this->assertSame('en', app('translator')->getLocale());

        $this->assertStringContainsString('esm',
            app('mailer')->getSymfonyTransport()->messages()[0]->toString()
        );

        $this->assertStringContainsString('name',
            app('mailer')->getSymfonyTransport()->messages()[1]->toString()
        );
    }
}

class TestMail extends Mailable
{
    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->view('view');
    }
}

class TestEmailLocaleUser extends Model implements HasLocalePreference
{
    protected $fillable = [
        'email',
        'email_locale',
    ];

    public function preferredLocale()
    {
        return $this->email_locale;
    }
}

class TimestampTestMail extends Mailable
{
    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->view('timestamp');
    }
}


text:
package net.coding.program.pay;

import android.content.Context;

import com.tencent.mm.opensdk.openapi.IWXAPI;
import com.tencent.mm.opensdk.openapi.WXAPIFactory;

/**
 * Created by chenchao on 16/5/10.
 */
public final class WXPay {

    public void regToWeixin(Context context) {
        IWXAPI api = WXAPIFactory.createWXAPI(context, PayKeys.WX_APP_ID, false);
        api.registerApp(PayKeys.WX_APP_ID);
    }

    public void pay(String s) {

    }

    private static WXPay wxPay;

    private WXPay() {
    }

    public static WXPay getInstance() {
        if (wxPay == null) {
            wxPay = new WXPay();
        }

        return wxPay;
    }

}


text:
package com.mcxtzhang.commonadapter.databinding.rv;

import android.databinding.ViewDataBinding;
import android.support.v7.widget.RecyclerView;

/**
 * 介绍:使用DataBinding ,告别ViewHolder
 * 作者:zhangxutong
 * 邮箱:mcxtzhang@163.com
 * 主页:http://blog.csdn.net/zxt0601
 * 时间: 16/09/25.
 */

public class BaseBindingVH<T extends ViewDataBinding> extends RecyclerView.ViewHolder {
    protected final T mBinding;

    public BaseBindingVH(T t) {
        super(t.getRoot());
        mBinding = t;
    }

    public T getBinding() {
        return mBinding;
    }
}


text:
package org.ethereum.gui;

import org.ethereum.manager.WorldManager;

import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Timer;
import java.util.TimerTask;

import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellRenderer;

import static org.ethereum.config.SystemProperties.CONFIG;

/**
 * www.ethereumJ.com
 * @author: Roman Mandeleil
 * Created on: 25/04/14 07:11
 */
public class PeersTableWindow extends JFrame {

    // Instance attributes used in this example
    private JPanel topPanel;
    private	JTable		table;
    private	JScrollPane scrollPane;
    private Timer updater = new Timer();

    private ToolBar toolBar;

	// Constructor of main frame
	public PeersTableWindow(ToolBar toolBar) {

        this.toolBar = toolBar;
        addCloseAction();

		// Set the frame characteristics
		setTitle("Ethereum Peers");
		setSize(515, 400);
		setLocation(615, 30);

		java.net.URL url = ClassLoader.getSystemResource("ethereum-icon.png");
		Toolkit kit = Toolkit.getDefaultToolkit();
		Image img = kit.createImage(url);
		this.setIconImage(img);

		// Create a panel to hold all other components
		topPanel = new JPanel();
		topPanel.setLayout(new BorderLayout());
        topPanel.setBackground(Color.WHITE);

		getContentPane().add(topPanel);
        getContentPane().setBackground(Color.WHITE);

		// Create a new table instance
		table = new JTable();
		table.setModel(new PeersTableModel());

		table.setFont(new Font("Courier New", Font.PLAIN, 15));
		table.setForeground(Color.GRAY);
		table.setTableHeader(null);

		TableCellRenderer tcr = table.getDefaultRenderer(String.class);
		DefaultTableCellRenderer renderer = (DefaultTableCellRenderer) tcr;
		renderer.setHorizontalAlignment(SwingConstants.CENTER);

		table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
		table.setCellSelectionEnabled(true);

		table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
		table.getColumnModel().getColumn(0).setPreferredWidth(60);
		table.getColumnModel().getColumn(1).setPreferredWidth(200);
        table.getColumnModel().getColumn(2).setPreferredWidth(160);
        table.getColumnModel().getColumn(3).setPreferredWidth(60);

		table.setRowMargin(3);
		table.setRowHeight(50);

        table.setShowHorizontalLines(true);
        table.setShowVerticalLines(true);
        table.setGridColor(new Color(230, 230, 230));

		// Add the table to a scrolling pane
		scrollPane = new JScrollPane(table);
        scrollPane.getViewport().setBackground(Color.WHITE);

		topPanel.add(scrollPane, BorderLayout.CENTER);

        updater.scheduleAtFixedRate(new TimerTask() {
            public void run() {
                table.revalidate();
                table.repaint();
            }
        }, 1000, 1000);

        if (CONFIG.peerDiscovery())
            WorldManager.getInstance().startPeerDiscovery();
    }

	public void addCloseAction() {
		this.addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e) {
				toolBar.peersToggle.setSelected(false);
			}
		});
	}

	public static void main(String args[]) {
		PeersTableWindow mainFrame = new PeersTableWindow(null);
		mainFrame.setVisible(true);
		mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}
}


text:
/**
 * Created by Yuriy Stul 17 May 2018
 */
package com.stulsoft.poc.prometheus.manager.samples.server1;

import java.util.LinkedHashMap;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.stulsoft.poc.prometheus.manager.MetricsManager;

import io.vertx.core.AbstractVerticle;
import io.vertx.core.AsyncResult;
import io.vertx.core.Future;
import io.vertx.core.eventbus.Message;
import io.vertx.core.eventbus.ReplyException;
import io.vertx.core.http.HttpServerResponse;
import io.vertx.core.json.Json;
import io.vertx.ext.web.Router;
import io.vertx.ext.web.RoutingContext;

/**
 * Test HttpServer
 *
 * @author Yuriy Stul
 *
 */
public class HttpServer extends AbstractVerticle {
	private static Logger logger = LoggerFactory.getLogger(HttpServer.class);

	private static final String SERVICE_NAME = "service_sample1";
	private static final String COUNTER_NAME_GETS = "gets";

	@Override
	public void start(Future<Void> startFuture) {
		logger.info("Starting HTTP server...");
		MetricsManager.getInstance().initDefaultMetrics();
		MetricsManager.getInstance().addCounter(SERVICE_NAME, COUNTER_NAME_GETS, "Counts all gets");
		io.vertx.core.http.HttpServer server = vertx.createHttpServer();

		Router router = Router.router(vertx);
		router.get("/").handler(this::serviceHandler);
		router.get("/metrics").handler(MetricsManager.getInstance().getMetricsHandler());

		final int port = 8080;

		server.requestHandler(router::accept).listen(port, ar -> {
			if (ar.succeeded()) {
				logger.info("HTTP server running on port {}", port);
				startFuture.complete();
			} else {
				logger.error("Failed start HTTP server. {}", ar.cause());
				startFuture.fail(ar.cause());
			}
		});

	}

	@Override
	public void stop(Future<Void> stopFuture) {
		logger.info("Stopping HTTP server...");
		stopFuture.complete();
	}

	private void serviceHandler(RoutingContext routingContext) {
		MetricsManager.getInstance().getCounter(SERVICE_NAME, COUNTER_NAME_GETS).inc();

		vertx.eventBus().send(Service1.EB_SERVICE_ADDRESS, "Get page",
				messageAsyncResult -> commonServiceHandler(routingContext, messageAsyncResult));
	}

	private void commonServiceHandler(RoutingContext routingContext, AsyncResult<Message<Object>> ar) {
		HttpServerResponse response = routingContext.response();
		if (ar.succeeded()) {
			handleMessage(response, ar.result());
		} else {
			handleErrorMessage(response, (ReplyException) ar.cause());
		}
	}

	private void handleMessage(HttpServerResponse response, Message<Object> message) {
		Map<String, String> results = new LinkedHashMap<>();
		results.put("response", message.body().toString());
		response
				.setStatusCode(400)
				.putHeader("content-type", "application/json")
				.end(Json.encodePrettily(results));
	}

	private void handleErrorMessage(HttpServerResponse response, ReplyException exception) {
		int errCode = exception.failureCode();
		String errMsg = exception.getMessage();
		Map<String, String> results = new LinkedHashMap<>();
		results.put("error", String.format("Failed getting page. Error code=%d, error message: %s", errCode, errMsg));

		response
				.setStatusCode(400)
				.putHeader("content-type", "application/json")
				.end(Json.encodePrettily(results));
	}

}


text:
package mainecoon
package tests

import scala.util.Try
import cats.~>
import cats.laws.discipline.SerializableTests
import mainecoon.laws.discipline.InvariantKTests
import autoInvariantKTests._
import shapeless.test.illTyped

class autoInvariantKTests extends MainecoonTestSuite {
  checkAll("SafeInvAlg[Option]", InvariantKTests[SafeInvAlg].invariantK[Try, Option, List])
  checkAll("InvariantK[SafeInvAlg]", SerializableTests.serializable(InvariantK[SafeInvAlg]))

  test("Alg with non effect method") {
    val tryInt = new NoEffectMethod[Try] {
      def a(i: Int): Int = i
    }

    tryInt.imapK(toFk)(otFk).a(2) should be(2)
  }

  test("Alg with contravariant Eff method") {
    val tryInt = new ContravariantEff[Try] {
      def a(i: Try[Int], j: String): Int = i.get
      def b(i: Try[Int]): Int = i.get
    }

    val oInt = tryInt.imapK(toFk)(otFk)
    oInt.a(Option(2), "ignored") should be(2)
    oInt.b(Option(3)) should be(3)
  }

  test("Alg with Invariant effect method") {
    val tryInt = new InvariantEff[Try] {
      def a(i: Try[Int], j: String): Try[Int] = i
    }

    val oInt = tryInt.imapK(toFk)(otFk)
    oInt.a(Option(2), "ignored") should be(Some(2))
  }

  test("Alg with extra type parameters auto derivation") {
    implicit object algWithExtraTP extends WithExtraTpeParam[Try, String] {
      def a(i: Try[String]) = i
      def b(i: Try[Int]) = i.map(_.toString)
    }
    import WithExtraTpeParam.autoDerive._
    WithExtraTpeParam[Option, String].a(Some("5")) should be(Some("5"))
    WithExtraTpeParam[Option, String].b(Some(5)) should be(Some("5"))
  }

  test("Alg with extra type parameters before effect type") {
    implicit val algWithExtraTP: AlgWithExtraTP2[String, Try] = new AlgWithExtraTP2[String, Try] {
      def a(i: Try[Int]) = i.map(_.toString)
    }
    import AlgWithExtraTP2.autoDerive._
    AlgWithExtraTP2[String, Option].a(Some(5)) should be(Some("5"))
  }

  test("Alg with type member") {
    implicit val tryInt = new AlgWithTypeMember[Try] {
      type T = String
      def a(i: Try[String]): Try[String] = i.map(_ + "a")
    }

    AlgWithTypeMember.imapK(tryInt)(toFk)(otFk).a(Some("4")) should be(Some("4a"))
  }

  test("Alg with type member fully refined") {
    implicit val tryInt = new AlgWithTypeMember[Try] {
      type T = String
      def a(i: Try[String]): Try[String] = i.map(_ + "a")
    }

    import AlgWithTypeMember.fullyRefined._
    import AlgWithTypeMember.fullyRefined.autoDerive._

    val algAux: AlgWithTypeMember.Aux[Option, String] = implicitly
    algAux.a(Some("4")) should be(Some("4a"))
  }

  test("turn off auto derivation") {
    implicit object foo extends AlgWithoutAutoDerivation[Try] {
      def a(i: Try[Int]): Try[Int] = i
    }

    illTyped { """ AlgWithoutAutoDerivation.autoDerive """}
  }

  test("with default impl") {
    implicit object foo extends AlgWithDefaultImpl[Try]
    foo.imapK(toFk)(otFk).const(Option(1)) should be(3)
  }

  test("with methods with type param") {
    implicit object foo extends AlgWithTypeParam[Try] {
      def a[T](i: Try[T]): Try[String] = i.map(_.toString)
    }
    foo.imapK(toFk)(otFk).a(Option(1)) should be(Some("1"))
  }
}

object autoInvariantKTests {
  implicit val toFk : Try ~> Option = λ[Try ~> Option](_.toOption)
  implicit val otFk : Option ~> Try = λ[Option ~> Try](o => Try(o.get))

  @autoInvariantK
  trait NoEffectMethod[F[_]] {
    def a(i: Int): Int
  }

  @autoInvariantK
  trait ContravariantEff[F[_]] {
    def a(i: F[Int], j: String): Int
    def b(i: F[Int]): Int
  }

  @autoInvariantK
  trait InvariantEff[F[_]] {
    def a(i: F[Int], j: String): F[Int]
  }

  @autoInvariantK @finalAlg
  trait AlgWithTypeMember[F[_]] {
    type T
    def a(i: F[T]): F[T]
  }

  object AlgWithTypeMember {
    type Aux[F[_], T0] = AlgWithTypeMember[F] { type T = T0 }
  }

  @autoInvariantK @finalAlg
  trait WithExtraTpeParam[F[_], T] {
    def a(i: F[T]): F[T]
    def b(i: F[Int]): F[T]
  }

  @autoInvariantK @finalAlg
  trait AlgWithExtraTP2[T, F[_]] {
    def a(i: F[Int]): F[T]
  }

  @autoInvariantK(autoDerivation = false)
  trait AlgWithoutAutoDerivation[F[_]] {
    def a(i: F[Int]): F[Int]
  }

  @autoInvariantK @finalAlg
  trait AlgWithDef[F[_]] {
    def a: F[Int]
    def b(c: F[Int]): F[String]
  }

  @autoInvariantK @finalAlg
  trait AlgWithDefaultImpl[F[_]] {
    def const(i: F[Int]): Int = 3
  }

  @autoInvariantK @finalAlg
  trait AlgWithTypeParam[F[_]] {
    def a[T](i: F[T]): F[String]
  }

  @autoInvariantK @finalAlg
  trait AlgWithCurryMethod[F[_]] {
    def a(t: F[Int])(b: String): F[String]
  }
}


text:
<?php

namespace Gizburdt\Cuztom\Fields;

use Gizburdt\Cuztom\Cuztom;
use Gizburdt\Cuztom\Support\Guard;

Guard::directAccess();

abstract class Field
{
    /**
     * All original args.
     * @var array
     */
    public $original;

    /**
     * Base.
     * @var mixed
     */
    public $object = null;
    public $value = null;
    public $metaBox = null;
    public $metaType = null;
    public $view = 'text';
    public $inputType = 'text';

    /**
     * Before/after id/name.
     * @var mixed
     */
    public $beforeName = '';
    public $afterName = '';
    public $beforeId = '';
    public $afterId = '';

    /**
     * Special.
     * @var mixed
     */
    public $parent;

    /**
     * Fillables.
     * @var mixed
     */
    public $id = null;
    public $type = null;
    public $label = '';
    public $description = '';
    public $explanation = '';
    public $default_value = '';
    public $options = [];
    public $args = [];
    public $required = false;
    public $repeatable = false;
    public $limit = null;
    public $html_attributes = [];
    public $css_class = '';
    public $cell_css_class = '';
    public $show_admin_column = false;
    public $admin_column_sortable = false;
    public $admin_column_filter = false;

    /**
     * Merges.
     * @var mixed
     */
    protected $merges = [
        'html_attributes',
    ];

    /**
     * Construct.
     *
     * @param array $args
     * @param array $values
     */
    public function __construct($args, $values = null)
    {
        // Original
        $this->original = $args;

        // Set all properties
        foreach ($args as $property => $value) {
            if (property_exists($this, $property)) {
                if (in_array($property, $this->merges) && isset($args[$property])) {
                    $this->$property = array_merge($args[$property], $this->$property);
                }

                $this->$property = (isset($args[$property]) ? $args[$property] : $this->$property);
            }
        }

        // Repeatable?
        if ($this->isRepeatable()) {
            $this->afterName = '[]';
        }

        // Value
        $this->value = $this->substractValue($values);

        // Do
        do_action('cuztom_field_init', $this);
    }

    /**
     * Outputs a field cell.
     *
     * @param string|array $value
     * @param string       $view
     */
    public function outputCell($value = null)
    {
        return Cuztom::view('fields/cell/default', [
            'field' => $this,
            'value' => $value,
        ]);
    }

    /**
     * Output based on type.
     *
     * @param  string|array $value
     * @param  string       $value
     * @return string
     */
    public function output($value = null)
    {
        $value = is_null($value) ? $this->value : $value;

        return $this->isRepeatable()
            ? $this->outputRepeatable().$this->getExplanation()
            : $this->outputInput($value).$this->getExplanation();
    }

    /**
     * Output field.
     *
     * @param  string|array $value
     * @param  string       $view
     * @return string
     */
    public function outputInput($value = null, $view = null)
    {
        $view = $view ? $view : $this->getView();

        return Cuztom::view('fields/'.$view, [
            'field' => $this,
            'value' => $value,
        ]);
    }

    /**
     * Repeatable output.
     *
     * @return string
     */
    public function outputRepeatable($value = null)
    {
        return Cuztom::view('fields/repeatable/repeatable', [
            'field'  => $this,
            'values' => $value,
        ]);
    }

    /**
     * Outputs repeatable control.
     *
     * @param  mixed  $value
     * @return string
     */
    public function outputRepeatableControl()
    {
        return Cuztom::view('fields/repeatable/control', [
            'field' => $this,
        ]);
    }

    /**
     * Parse value.
     *
     * @param  mixed $value.
     * @return mixed
     */
    public function parseValue($value)
    {
        return $value;
    }

    /**
     * Save meta.
     *
     * @param  int   $object
     * @param  mixed $value
     * @return bool
     */
    public function save($object, $values)
    {
        $value = isset($values[$this->id])
            ? apply_filters('cuztom_field_save_value', $this->parseValue($values[$this->id]), $this)
            : false;

        // Do
        do_action('cuztom_field_save', $this);

        // Save to respective content-type
        switch ($this->metaType) {
            case 'user':
                return (bool) update_user_meta($object, $this->id, $value);
            case 'term':
                return (bool) update_term_meta($object, $this->id, $value);
            case 'post':
                return (bool) update_post_meta($object, $this->id, $value);
        }

        // Default
        return false;
    }

    /**
     * Returns the input type.
     *
     * @return string
     */
    public function getInputType()
    {
        return apply_filters('cuztom_field_input_type', $this->inputType, $this);
    }

    /**
     * Returns the view name.
     *
     * @return string
     */
    public function getView()
    {
        return apply_filters('cuztom_field_view', $this->view, $this);
    }

    /**
     * Get the complete id.
     *
     * @return string
     */
    public function getId($extra = null)
    {
        $id = $this->beforeId.$this->id.$this->afterId;

        if (! Cuztom::isEmpty($extra)) {
            $id = $id.'_'.$extra;
        }

        return apply_filters('cuztom_field_id', $id, $this, $extra);
    }

    /**
     * Get the complete name.
     *
     * @return string
     */
    public function getName()
    {
        return apply_filters('cuztom_field_name', 'cuztom'.$this->beforeName.'['.$this->id.']'.$this->afterName, $this);
    }

    /**
     * Get the fields css classes.
     *
     * @param  array  $extra
     * @return string
     */
    public function getCssClass($extra = null)
    {
        $class = 'cuztom-input '.$this->css_class;

        if (! Cuztom::isEmpty($extra)) {
            $class = $class.' '.$extra;
        }

        return apply_filters('cuztom_field_css_class', $class, $this, $extra);
    }

    /**
     * Get the fields cell css classes.
     *
     * @param  array  $extra
     * @return string
     */
    public function getCellCssClass($extra = null)
    {
        return apply_filters('cuztom_field_cell_css_class', 'cuztom-field '.$this->cell_css_class, $this, $extra);
    }

    /**
     * Outputs the fields explanation.
     *
     * @return string
     */
    public function getExplanation()
    {
        return apply_filters(
            'cuztom_field_explanation',
            ($this->explanation ? ''.$this->explanation.'' : ''), $this
        );
    }

    /**
     * Outputs the fields data attributes.
     *
     * @param  array  $extra
     * @return string
     */
    public function getDataAttributes($extra = [])
    {
        $output = '';

        foreach (array_merge($this->html_attributes, $extra) as $attribute => $value) {
            if (! is_null($value)) {
                $output .= $attribute.'="'.$value.'"';
            } elseif (! $value && isset($this->args[Cuztom::uglify($attribute)])) {
                $output .= $attribute.'="'.$this->args[Cuztom::uglify($attribute)].'"';
            }
        }

        return apply_filters('cuztom_field_html_attributes', $output, $this, $extra);
    }

    /**
     * Outputs the fields column content.
     *
     * @param int $id
     */
    public function outputColumnContent($id)
    {
        $meta = get_post_meta($id, $this->id, true);

        if (! empty($meta) && $this->isRepeatable()) {
            echo implode($meta, ', ');
        } else {
            echo $meta;
        }
    }

    /**
     * Check what kind of meta we're dealing with.
     *
     * @param  string $metaType
     * @return bool
     */
    public function isMetaType($metaType)
    {
        return $this->metaType == $metaType;
    }

    /**
     * Check if the field is in repeatable mode.
     *
     * @return bool
     */
    public function isRepeatable()
    {
        return $this->repeatable;
    }

    /**
     * Check if the field is tabs or accordion.
     *
     * @return bool
     */
    public function isTabs()
    {
        return $this instanceof Tabs || $this instanceof Accordion;
    }

    /**
     * Check if the field is tabs or accordion.
     *
     * @return bool
     */
    public function isBundle()
    {
        return $this instanceof Bundle;
    }

    /**
     * Substract value of field from values array.
     *
     * @param  array  $values
     * @return string
     */
    public function substractValue($values)
    {
        if (isset($values[$this->id]) && ! Cuztom::isEmpty($values[$this->id])) {
            if (is_array($values[$this->id])) {
                $value = isset($values[$this->id][0]) ? maybe_unserialize($values[$this->id][0]) : null;
            } else {
                $value = maybe_unserialize($values[$this->id]);
            }
        } else {
            $value = $this->default_value;
        }

        return apply_filters('cuztom_field_value', $value, $this);
    }

    /**
     * Creates and returns a field object.
     *
     * @param  array       $args
     * @return object|bool
     */
    public static function create($args, $values)
    {
        $type = is_array($args) ? $args['type'] : $args;
        $class = str_replace(' ', '', ucwords(str_replace('_', ' ', $type)));
        $class = "Gizburdt\\Cuztom\\Fields\\$class";

        if (class_exists($class)) {
            $field = new $class($args, $values);

            Cuztom::addField($field);

            return $field;
        }

        return false;
    }
}


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

using Hyak.Common;
using System.Collections.Generic;

namespace Microsoft.Azure.Common.Authentication
{
    /// <summary>
    /// This class handles mapping management client types
    /// to the corresponding required resource provider names.
    /// </summary>
    internal static class RequiredResourceLookup
    {
        private const string BatchProviderNamespace = "microsoft.batch";
        private const string CacheProviderNamespace = "microsoft.cache";
        private const string ComputeProviderNamespace = "Microsoft.Compute";
        private const string DataFactoryProviderNamespace = "Microsoft.DataFactory";
        private const string InsightsProviderNamespace = "microsoft.insights";
        private const string KeyVaultProviderNamespace = "Microsoft.KeyVault";
        private const string NetworkProviderNamespace = "Microsoft.Network";
        private const string StorageProviderNamespace = "Microsoft.Storage";
        private const string WebAppProviderNamespace = "Microsoft.Web";

        internal static IList<string> RequiredProvidersForServiceManagement<T>() where T : ServiceClient<T>
        {
            if (typeof(T).FullName.EndsWith("WebSiteManagementClient"))
            {
                return new[] { "website" };
            }

            if (typeof(T).FullName.EndsWith("ManagedCacheClient"))
            {
                return new[] { "cacheservice.Caching" };
            }

            if (typeof(T).FullName.EndsWith("SchedulerManagementClient"))
            {
                return new[] { "scheduler.jobcollections" };
            }

            return new string[0];
        }

        internal static IList<string> RequiredProvidersForResourceManager<T>() where T : ServiceClient<T>
        {
            if (typeof(T).FullName.EndsWith("ResourceManagementClient"))
            {
                return new[] {
                    CacheProviderNamespace,
                    ComputeProviderNamespace,
                    InsightsProviderNamespace,
                    KeyVaultProviderNamespace,
                    NetworkProviderNamespace,
                    StorageProviderNamespace,
                    WebAppProviderNamespace
                };
            }
            if (typeof(T).FullName.EndsWith("BatchManagementClient"))
            {
                return new[] { BatchProviderNamespace };
            }

            if (typeof(T).FullName.Equals("Microsoft.Azure.Management.Compute.ComputeManagementClient"))
            {
                return new[] { ComputeProviderNamespace };
            }

            if (typeof(T).FullName.Equals("Microsoft.Azure.Management.Dns.DnsManagementClient"))
            {
                return new[] { NetworkProviderNamespace };
            }

            if (typeof(T).FullName.EndsWith("DataFactoryManagementClient"))
            {
                return new[] { DataFactoryProviderNamespace };
            }

            if (typeof(T).FullName.Equals("Microsoft.Azure.Management.Network.NetworkResourceProviderClient"))
            {
                return new[] { NetworkProviderNamespace };
            }

            if (typeof(T).FullName.Equals("Microsoft.Azure.Management.Storage.StorageManagementClient"))
            {
                return new[] { StorageProviderNamespace };
            }

            return new string[0];
        }
    }
}


text:
''' Texture object.

    A texture is an image loaded into video memory that can be efficiently
    drawn to the framebuffer.
'''
import numpy
import OpenGL.GL as gl

class TextureException(Exception):
    ''' Texture exception object. '''
    pass

class Texture(object):
    ''' Texture object.

    A texture is an image loaded into video memory that can be efficiently
    drawn to the framebuffer.
    '''

    def __init__(self, Z, format=None, interpolation=None):
        ''' Create texture.

        :Parameters:
            `Z` : numpy array
                Z may be a float32 or uint8 array with following shapes:
                    * M
                    * MxN
                    * MxNx[1,2,3,4]
            `format`: [None | 'A' | 'LA' | 'RGB' | 'RGBA']
                Specify the texture format to use. Most of times it is possible
                to find it automatically but there are a few cases where it not
                possible to decide. For example an array with shape (M,3) can be
                considered as 2D alpha texture of size (M,3) or a 1D RGB texture
                of size (M,).
        '''
        self._id = 0
        self._build(Z, format)

    def __del__(self):
        if self._id and gl.glDeleteTextures:
            gl.glDeleteTextures([self._id,])

    @property
    def target(self):
        ''' GL texture target (e.g., GL_TEXTURE_2D).

        :type: int, read-only
        '''
        return self._target

    @property
    def width(self):
        ''' Texture width.

        :type: int, read-only
        '''
        return self._width

    @property
    def height(self):
        ''' Texture height.

        :type: int, read-only
        '''
        return self._height

    @property
    def id(self):
        ''' GL texture name.

        :type: int, read-only
        '''
        #return self._id.value
        return self._id

    def blit(self, x, y, w, h, z=0, s=(0,1), t=(0,1)):
        ''' Draw texture to active framebuffer. '''

        if self.target == gl.GL_TEXTURE_1D:
            gl.glDisable (gl.GL_TEXTURE_2D)
            gl.glEnable (gl.GL_TEXTURE_1D)
            gl.glBindTexture(self.target, self.id)
            gl.glBegin(gl.GL_QUADS)
            gl.glTexCoord1f(s[0]), gl.glVertex2f(x,   y)
            gl.glTexCoord1f(s[0]), gl.glVertex2f(x,   y+h)
            gl.glTexCoord1f(s[1]), gl.glVertex2f(x+w, y+h)
            gl.glTexCoord1f(s[1]), gl.glVertex2f(x+w, y)
            gl.glEnd()
        else:
            gl.glEnable (gl.GL_TEXTURE_2D)
            gl.glDisable (gl.GL_TEXTURE_1D)
            gl.glBindTexture(self.target, self.id)
            gl.glBegin(gl.GL_QUADS)
            gl.glTexCoord2f(s[0], 1), gl.glVertex2f(x,   y)
            gl.glTexCoord2f(s[0], 0), gl.glVertex2f(x,   y+h)
            gl.glTexCoord2f(s[1], 0), gl.glVertex2f(x+w, y+h)
            gl.glTexCoord2f(s[1], 1), gl.glVertex2f(x+w, y)
            gl.glEnd()
        gl.glDisable (gl.GL_TEXTURE_1D)
        gl.glDisable (gl.GL_TEXTURE_2D)

    def _build (self, Z, format=None):
        ''' Build a new texture from Z and format. '''

        self._Z = Z

        # Check data type
        dtype = Z.dtype
        if dtype not in [numpy.float32, numpy.uint8]:
            raise TextureException('Array data type must be float32 or uint8.')
        if dtype == numpy.float32:
            self.src_type = gl.GL_FLOAT
        elif dtype == numpy.uint8:
            self.src_type = gl.GL_UNSIGNED_BYTE

        # Find shape & format
        shape = Z.shape
        if len(shape) == 1:
            self._target = gl.GL_TEXTURE_1D
            self.src_format = gl.GL_ALPHA
            self.dst_format = gl.GL_ALPHA16
        elif len(shape) == 2:
            if shape[1] == 1 and format in [None, 'A']:
                self._target = gl.GL_TEXTURE_1D
                self.src_format = gl.GL_ALPHA
                self.dst_format = gl.GL_ALPHA16
            elif shape[1] == 2 and format in [None, 'LA']:
                self._target = gl.GL_TEXTURE_1D
                self.src_format = gl.GL_LUMINANCE_ALPHA
                self.dst_format = gl.GL_LUMINANCE16_ALPHA16
            elif shape[1] == 3 and format in [None, 'RGB']:
                self._target = gl.GL_TEXTURE_1D
                self.src_format = gl.GL_RGB
                self.dst_format = gl.GL_RGB16
            elif shape[1] == 4 and format in [None, 'RGBA']:
                self._target = gl.GL_TEXTURE_1D
                self.src_format = gl.GL_RGBA
                self.dst_format = gl.GL_RGBA16
            elif format in [None, 'RGBA']:
                self._target = gl.GL_TEXTURE_2D
                self.src_format = gl.GL_ALPHA
                self.dst_format = gl.GL_ALPHA16
            else:
                raise TextureException(
                    'Array shape %s not compatible with any texture format'
                    % str(shape))
        elif len(shape) == 3:
            self._target = gl.GL_TEXTURE_2D
            if shape[2] == 1 and format in [None, 'A']:
                self.src_format = gl.GL_ALPHA
                self.dst_format = gl.GL_ALPHA16
            elif shape[2] == 2 and format in [None, 'LA']:
                self.src_format = gl.GL_LUMINANCE_ALPHA
                self.dst_format = gl.GL_LUMINANCE16_ALPHA16
            elif shape[2] == 3 and format in [None, 'RGB']:
                self.src_format = gl.GL_RGB
                self.dst_format = gl.GL_RGB16
            elif shape[2] == 4 and format in [None, 'RGBA']:
                self.src_format = gl.GL_RGBA
                self.dst_format = gl.GL_RGBA16
            else:
                raise TextureException(
                    'Array shape %s not compatible with any texture format'
                    % str(shape))

        # Build texture
        if self.target == gl.GL_TEXTURE_2D:
            width, height = shape[1], shape[0]
        else:
            width, height = shape[0], 0
        self._width = width
        self._height = height

        if self._id:
            #gl.glDeleteTextures(1, gl.byref(self._id))
            gl.glDeleteTextures([self._id])
        #id = gl.GLuint()
        #gl.glGenTextures(1, gl.byref(id))
        self._id = gl.glGenTextures(1)
        gl.glPixelStorei (gl.GL_UNPACK_ALIGNMENT, 1)
        gl.glPixelStorei (gl.GL_PACK_ALIGNMENT, 1)
        gl.glBindTexture (self.target, self.id)
        gl.glTexParameterf (self.target,
                            gl.GL_TEXTURE_MIN_FILTER, gl.GL_NEAREST)
        gl.glTexParameterf (self.target,
                            gl.GL_TEXTURE_MAG_FILTER, gl.GL_NEAREST)
        gl.glTexParameterf (self.target, gl.GL_TEXTURE_WRAP_S, gl.GL_CLAMP)
        gl.glTexParameterf (self.target, gl.GL_TEXTURE_WRAP_T, gl.GL_CLAMP)
        if self._target == gl.GL_TEXTURE_1D:
            gl.glTexImage1D (self.target, 0, self.dst_format, width, 0,
                             self.src_format, self.src_type, numpy.zeros(Z.shape,Z.dtype))
        else:
            gl.glTexImage2D (self.target, 0, self.dst_format, width, height, 0,
                             self.src_format, self.src_type, numpy.zeros(Z.shape,Z.dtype))
        self.update()

    def update(self, bias=0.0, scale=1.0):
        ''' Update texture. '''

        gl.glBindTexture(self.target, self.id)

        # Autoscale array using OpenGL pixel transfer parameters
        if self.target == gl.GL_TEXTURE_2D and self.src_type == gl.GL_FLOAT:
            gl.glPixelTransferf(gl.GL_ALPHA_SCALE, scale)
            gl.glPixelTransferf(gl.GL_ALPHA_BIAS, bias)
        if self.target == gl.GL_TEXTURE_1D:
            gl.glTexSubImage1D (self.target, 0, 0,
                                self._Z.shape[0],
                                self.src_format,
                                self.src_type,
                                self._Z) #.ctypes.data)
        else:
            gl.glTexSubImage2D (self.target, 0, 0, 0,
                                self._Z.shape[1],
                                self._Z.shape[0],
                                self.src_format,
                                self.src_type,
                                self._Z) #.ctypes.data)
        if self.target == gl.GL_TEXTURE_2D and self.src_type == gl.GL_FLOAT:
           # Default parameters
           gl.glPixelTransferf(gl.GL_ALPHA_SCALE, 1)
           gl.glPixelTransferf(gl.GL_ALPHA_BIAS, 0)


text:
package com.intellij.util;

import com.google.common.base.CharMatcher;
import com.google.common.base.Charsets;
import com.google.common.base.Splitter;
import com.google.common.collect.Lists;
import com.google.common.io.BaseEncoding;
import com.google.common.net.MediaType;
import com.intellij.openapi.util.Pair;
import com.intellij.util.io.URLUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import static com.intellij.openapi.util.text.StringUtil.stripQuotesAroundValue;

public final class UriUtil {
  public static final CharMatcher PARAM_CHAR_MATCHER = CharMatcher.anyOf("?#;");
  public static final CharMatcher SLASH_MATCHER = CharMatcher.is('/');

  private static final Pattern DATA_URI_PATTERN = Pattern.compile("data:([^,;]+/[^,;]+)(;charset=[^,;]+)?(;base64)?,(.+)");

  private UriUtil() {
  }

  public static String trimLastSlash(@NotNull String url) {
    return SLASH_MATCHER.trimTrailingFrom(url);
  }

  public static String trimParameters(@NotNull String url) {
    int end = PARAM_CHAR_MATCHER.indexIn(url);
    return end != -1 ? url.substring(0, end) : url;
  }

  public static boolean isDataUri(@NotNull String value) {
    return !value.isEmpty() && value.startsWith("data:", value.charAt(0) == '"' || value.charAt(0) == '\'' ? 1 : 0);
  }

  /**
   * Extracts byte array from given data:URL string.
   * data:URL will be decoded from base64 if it contains the marker of base64 encoding.
   *
   * @param dataUrl data:URL-like string (may be quoted)
   * @return extracted byte array or {@code null} if it cannot be extracted.
   */
  @Nullable
  public static byte[] getBytesFromDataUri(@NotNull String dataUrl) {
    Matcher matcher = DATA_URI_PATTERN.matcher(stripQuotesAroundValue(dataUrl));
    if (matcher.matches()) {
      try {
        String content = matcher.group(4);
        return ";base64".equalsIgnoreCase(matcher.group(3)) ? BaseEncoding.base64().decode(content) : content.getBytes(Charsets.UTF_8);
      }
      catch (IllegalArgumentException e) {
        return null;
      }
    }
    return null;
  }

  /**
   * Extracts mime-type of given data:URL string
   *
   * @param dataUrl data:URL-like string (may be quoted)
   * @return mime-type extracted from image or {@code null} if string doesn't contain mime definition.
   */
  @Nullable
  public static MediaType getMediaTypeFromDataUri(@NotNull String dataUrl) {
    Matcher matcher = DATA_URI_PATTERN.matcher(stripQuotesAroundValue(dataUrl));
    if (matcher.matches()) {
      try {
        return MediaType.parse(matcher.group(1));
      }
      catch (IllegalArgumentException e) {
        return null;
      }
    }
    return null;
  }

  /**
   * Splits the url into 2 parts: the scheme ("http", for instance) and the rest of the URL.

   * Scheme separator is not included neither to the scheme part, nor to the url part.

   * The scheme can be absent, in which case empty string is written to the first item of the Pair.
   */
  @NotNull
  public static Pair<String, String> splitScheme(@NotNull String url) {
    ArrayList<String> list = Lists.newArrayList(Splitter.on(URLUtil.SCHEME_SEPARATOR).limit(2).split(url));
    if (list.size() == 1) {
      return Pair.create("", list.get(0));
    }
    return Pair.create(list.get(0), list.get(1));
  }
}