text:
// Copyright (c) Lex Li. All rights reserved.
//
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace JexusManager.Features.IsapiFilters
{
    using System;
    using System.Collections;
    using System.Reflection;
    using System.Windows.Forms;

    using JexusManager.Properties;
    using JexusManager.Services;

    using Microsoft.Web.Management.Client;
    using Microsoft.Web.Management.Client.Win32;

    internal partial class IsapiFiltersPage : ModuleListPage
    {
        private sealed class PageTaskList : ShowHelpTaskList
        {
            private readonly IsapiFiltersPage _owner;

            public PageTaskList(IsapiFiltersPage owner)
            {
                _owner = owner;
            }

            [Obfuscation(Exclude = true)]
            public override void ShowHelp()
            {
                _owner.ShowHelp();
            }
        }

        private sealed class IsapiFiltersListViewItem : ListViewItem
        {
            public IsapiFiltersItem Item { get; }

            private readonly IsapiFiltersPage _page;

            public IsapiFiltersListViewItem(IsapiFiltersItem item, IsapiFiltersPage page)
                : base(item.Name)
            {
                this.Item = item;
                _page = page;
                this.SubItems.Add(new ListViewSubItem(this, item.Path));
                this.SubItems.Add(new ListViewSubItem(this, item.Flag));
            }
        }

        private IsapiFiltersFeature _feature;
        private PageTaskList _taskList;

        public IsapiFiltersPage()
        {
            this.InitializeComponent();
        }

        protected override void Initialize(object navigationData)
        {
            base.Initialize(navigationData);
            var service = (IConfigurationService)this.GetService(typeof(IConfigurationService));
            pictureBox1.Image = service.Scope.GetImage();

            _feature = new IsapiFiltersFeature(this.Module);
            _feature.IsapiFiltersSettingsUpdated = this.InitializeListPage;
            _feature.Load();
        }

        protected override void InitializeListPage()
        {
            toolStrip2.Visible = !_feature.IsInOrder;
            listView1.Items.Clear();
            foreach (var file in _feature.Items)
            {
                listView1.Items.Add(new IsapiFiltersListViewItem(file, this));
            }

            if (_feature.SelectedItem == null)
            {
                this.Refresh();
                return;
            }

            foreach (IsapiFiltersListViewItem item in listView1.Items)
            {
                if (item.Item == _feature.SelectedItem)
                {
                    item.Selected = true;
                }
            }
        }

        protected override void Refresh()
        {
            this.Tasks.Fill(tsActionPanel, cmsActionPanel);
            base.Refresh();
        }

        private void ListView1SelectedIndexChanged(object sender, EventArgs e)
        {
            _feature.SelectedItem = listView1.SelectedItems.Count > 0
                ? ((IsapiFiltersListViewItem)listView1.SelectedItems[0]).Item
                : null;
            // TODO: optimize refresh when null to not null (vice versa)
            this.Refresh();
        }

        protected override bool ShowHelp()
        {
            _feature.ShowHelp();
            return true;
        }

        protected override TaskListCollection Tasks
        {
            get
            {
                if (_taskList == null)
                {
                    _taskList = new PageTaskList(this);
                }

                base.Tasks.Add(_feature.GetTaskList());
                base.Tasks.Add(_taskList);
                return base.Tasks;
            }
        }
    }
}


text:
require 'rubygems' if RUBY_VERSION < '1.9.0'
require 'sensu-plugin/metric/cli'
require 'socket'

class VMStat < Sensu::Plugin::Metric::CLI::Graphite

  option :scheme,
    :description => "Metric naming scheme, text to prepend to .$parent.$child",
    :long => "--scheme SCHEME",
    :default => "#{Socket.gethostname}.vmstat"

  def convert_integers(values)
    values.each_with_index do |value, index|
      begin
        converted = Integer(value)
        values[index] = converted
      rescue ArgumentError
      end
    end
    values
  end

  def run
    result = convert_integers(`vmstat 1 2|tail -n1`.split(" "))
    timestamp = Time.now.to_i
    metrics = {
      :procs => {
         :waiting => result[0],
         :uninterruptible => result[1]
       },
       :memory => {
         :swap_used => result[2],
         :free => result[3],
         :buffers => result[4],
         :cache => result[5]
       },
       :swap => {
         :in => result[6],
         :out => result[7]
       },
       :io => {
         :received => result[8],
         :sent => result[9]
       },
       :system => {
         :interrupts_per_second => result[10],
         :context_switches_per_second => result[11]
       },
       :cpu => {
         :user => result[12],
         :system => result[13],
         :idle => result[14],
         :waiting => result[15]
      }
    }
    metrics.each do |parent, children|
      children.each do |child, value|
        output [config[:scheme], parent, child].join("."), value, timestamp
      end
    end
    ok
  end

end

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

    <title>Home</title>
    <meta charset="utf-8">
    <meta name="format-detection" content="telephone=no">
    <link rel="icon" href="images/favicon.ico" type="image/x-icon">
    <link rel="stylesheet" href="css/grid.css">
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/camera.css">
    <link rel="stylesheet" href="css/owl-carousel.css">

Business

Company

800-2345-6789

One of our representatives will happily contact you within 24 hours. For urgent needs call us at

Home

About

Lorem ipsum dolor

Conse ctetur adipisicing

Elit sed do eiusmod

Lorem ipsum

Conse adipisicing

Sit amet dolore

Incididunt ut labore

Et dolore magna

Ut enim ad minim

Services

FAQS

Contacts

Helping with any of your business needs!

The best strategies to attract new business

A wide range of global business information

Global
research

Lorem ipsum dolor sit amet conse ctetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud.

Creative
ideas

Lorem ipsum dolor sit amet conse ctetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud.

New
services

Lorem ipsum dolor sit amet conse ctetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud.

Pro
management

Lorem ipsum dolor sit amet conse ctetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud.

Incididunt ut labore et dolore

Lorem ipsum dolor sit amet conse ctetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolor.

Incididunt ut labore et dolore

Lorem ipsum dolor sit amet conse ctetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolor.

Incididunt ut labore et dolore

Lorem ipsum dolor sit amet conse ctetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolor.

Incididunt ut labore et dolore

Lorem ipsum dolor sit amet conse ctetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolor.

About

Lorem ipsum dolor sit amet conse ctetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatu. Lorem ipsum dolor sit amet conse ctetur adipisicing elit, sed do eiusmod tempor incididunt. Lorem ipsum dolor sit amet conse ctetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna.
Read more

Services

Lorem ipsum dolor sit amet conse ctetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.

Lorem ipsum dolor sit amet

Conse ctetur adipisicing

Elit sed do eiusmod tempor

Incididunt ut labore

Et dolore magna aliqua

Ut enim ad minim veniam

Quis nostrud exercitation

Incididunt ut labore

Et dolore magna aliqua

Read more

Help center

Ask professionals:

Monday - Friday:

8am-7pm

Saturday:

8am-5pm

Sunday:

1pm-5pm

24/7 Online Support:

800-2345-6789

                          <q>Lorem ipsum dolor sit amet conse ctetur adipisicing elit, sed do eiusmod tempor incididunt ut labore.</q>

                        Incididunt ut labor

                          <q>Lorem ipsum dolor sit amet conse ctetur adipisicing elit, sed do eiusmod tempor incididunt ut labore.</q>

                        Incididunt ut labor

                          <q>Lorem ipsum dolor sit amet conse ctetur adipisicing elit, sed do eiusmod tempor incididunt ut labore.</q>

                        Incididunt ut labor

                          <q>Lorem ipsum dolor sit amet conse ctetur adipisicing elit, sed do eiusmod tempor incididunt ut labore.</q>

                        Incididunt ut labor

                    <address>4578 Marmora Road,Glasgow
 D04 89GR</address>

info@demolink.org

800-2345-6789

800-2345-6790

Follow on facebook

Follow on Twitter

Business Company © .  Privacy PolicyMore Business Website Templates at TemplateMonster.com


text:
var spotifySchema = [
  {
    name: 'text',
    dataType: 'STRING',
    semantics: {
      conceptType: 'DIMENSION'
    }
  },
  {
    name: 'popularity',
    dataType: 'NUMBER',
    semantics: {
      conceptType: 'METRIC'
    }
  }
];

function getAuthType() {
  var response = {
    type: 'OAUTH2'
  };
  return response;
}
var getOAuthService = function() {
  var scriptProps = PropertiesService.getScriptProperties();
  return OAuth2.createService('Spotify')
    .setAuthorizationBaseUrl('https://accounts.spotify.com/authorize')
    .setTokenUrl('https://accounts.spotify.com/api/token')
    .setClientId(scriptProps.getProperty('OAUTH_CLIENT_ID'))
    .setClientSecret(scriptProps.getProperty('OAUTH_CLIENT_SECRET'))
    .setPropertyStore(PropertiesService.getUserProperties())
    .setCallbackFunction('authCallback');
};
function authCallback(request) {
  var authorized = getOAuthService().handleCallback(request);
  if (authorized) {
    return HtmlService.createHtmlOutput('Success! You can close this tab.');
  } else {
    return HtmlService.createHtmlOutput('Denied. You can close this tab');
  }
}
function isAuthValid() {
  var service = getOAuthService();
  if (service == null) {
    return false;
  }
  return service.hasAccess();
}
function get3PAuthorizationUrls() {
  var service = getOAuthService();
  if (service == null) {
    return '';
  }
  return service.getAuthorizationUrl();
}
function resetAuth() {
  var service = getOAuthService();
  service.reset();
}
function getConfig(request) {
  var config = {
    configParams: [
      {
        type: 'INFO',
        name: 'Spotify search',
        text: 'Enter the artist for all their Spotify rated popularity tracks'
      },
      {
        type: 'TEXTINPUT',
        name: 'artistName',
        displayName: 'Search',
        helpText: 'e.g. Coldplay',
        placeholder: 'Search for an artist for all songs'
      }
    ]
  };
  return config;
}
function getSchema(request) {
  var reqSchema = {
    schema: spotifySchema
  };
  return reqSchema;
}
function getData(request) {
  // Create schema for requested fields
  var requestedSchema = request.fields.map(function(field) {
    for (var i = 0; i < spotifySchema.length; i++) {
      if (spotifySchema[i].name == field.name) {
        return spotifySchema[i];
      }
    }
  });

  // Fetch and parse data from API
  var url = [
    'https://api.spotify.com/v1/search?q=',
    request.configParams.artistName,
    '&type=track'
  ];

  var options = {
    headers: {
      Authorization: 'Bearer ' + getOAuthService().getAccessToken()
    }
  };
  var response = UrlFetchApp.fetch(url.join(''), options);
  var parsedResponse = JSON.parse(response).tracks.items;
  console.log(parsedResponse);

  // Transform parsed data and filter for requested fields
  var requestedData = parsedResponse.map(function(trackSearch) {
    var values = [];
    requestedSchema.forEach(function(field) {
      switch (field.name) {
        case 'text':
          values.push(trackSearch.name);
          break;
        case 'popularity':
          values.push(trackSearch.popularity);
          break;
        default:
          values.push('');
          break;
      }
    });
    return {
      values: values
    };
  });

  return {
    schema: requestedSchema,
    rows: requestedData
  };
}


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _commandRole = require('./abstract/commandRole');

var _commandRole2 = _interopRequireDefault(_commandRole);

var _compositeRole = require('./abstract/compositeRole');

var _compositeRole2 = _interopRequireDefault(_compositeRole);

var _inputRole = require('./abstract/inputRole');

var _inputRole2 = _interopRequireDefault(_inputRole);

var _landmarkRole = require('./abstract/landmarkRole');

var _landmarkRole2 = _interopRequireDefault(_landmarkRole);

var _rangeRole = require('./abstract/rangeRole');

var _rangeRole2 = _interopRequireDefault(_rangeRole);

var _roletypeRole = require('./abstract/roletypeRole');

var _roletypeRole2 = _interopRequireDefault(_roletypeRole);

var _sectionRole = require('./abstract/sectionRole');

var _sectionRole2 = _interopRequireDefault(_sectionRole);

var _sectionheadRole = require('./abstract/sectionheadRole');

var _sectionheadRole2 = _interopRequireDefault(_sectionheadRole);

var _selectRole = require('./abstract/selectRole');

var _selectRole2 = _interopRequireDefault(_selectRole);

var _structureRole = require('./abstract/structureRole');

var _structureRole2 = _interopRequireDefault(_structureRole);

var _widgetRole = require('./abstract/widgetRole');

var _widgetRole2 = _interopRequireDefault(_widgetRole);

var _windowRole = require('./abstract/windowRole');

var _windowRole2 = _interopRequireDefault(_windowRole);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ariaAbstractRoles = new Map([['command', _commandRole2.default], ['composite', _compositeRole2.default], ['input', _inputRole2.default], ['landmark', _landmarkRole2.default], ['range', _rangeRole2.default], ['roletype', _roletypeRole2.default], ['section', _sectionRole2.default], ['sectionhead', _sectionheadRole2.default], ['select', _selectRole2.default], ['structure', _structureRole2.default], ['widget', _widgetRole2.default], ['window', _windowRole2.default]]);

exports.default = ariaAbstractRoles;


text:
@interface UserPoolMFAViewController ()

@property (weak, nonatomic) IBOutlet UILabel *cancel;

@end

@implementation UserPoolMFAViewController

#pragma mark - UIViewController

- (void) viewWillAppear:(BOOL)animated {
    self.codeSentTo.text = self.destination;
    self.authenticationCode.text = nil;
}

- (void)viewDidLoad {
    [super viewDidLoad];

}

- (IBAction)onSignIn:(id)sender {
    self.mfaCodeCompletionSource.result = self.authenticationCode.text;
}

- (IBAction)onCancel:(id)sender {
    [self.navigationController popViewControllerAnimated:YES];
}

@end


text:
from unittest import TestCase

def before_scenario(context, scenario):
    context.test = TestCase()

def after_scenario(context, scenario):
    if hasattr(context, "chat_server"):
        if not context.chat_server.poll():
            context.chat_server.kill()


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.Immutable;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CodeRefactorings;
using Microsoft.CodeAnalysis.CSharp.ConvertAutoPropertyToFullProperty;
using Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.CodeRefactorings;
using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces;
using Microsoft.CodeAnalysis.Test.Utilities;
using Microsoft.CodeAnalysis.Text;
using Roslyn.Test.Utilities;
using Xunit;

namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.ConvertAutoPropertyToFullProperty
{
    public partial class ConvertAutoPropertyToFullPropertyTests : AbstractCSharpCodeActionTest
    {
        protected override CodeRefactoringProvider CreateCodeRefactoringProvider(Workspace workspace, TestParameters parameters)
            => new CSharpConvertAutoPropertyToFullPropertyCodeRefactoringProvider();

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task SimpleAutoPropertyTest()
        {
            var text = @"
class TestClass
{
    public int G[||]oo { get; set; }
}
";
            var expected = @"
class TestClass
{
    private int goo;

    public int Goo
    {
        get
        {
            return goo;
        }
        set
        {
            goo = value;
        }
    }
}
";
            await TestInRegularAndScriptAsync(text, expected, options: DoNotPreferExpressionBodiedAccessors);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task ExtraLineAfterProperty()
        {
            var text = @"
class TestClass
{
    public int G[||]oo { get; set; }

}
";
            var expected = @"
class TestClass
{
    private int goo;

    public int Goo
    {
        get
        {
            return goo;
        }
        set
        {
            goo = value;
        }
    }

}
";
            await TestInRegularAndScriptAsync(text, expected, options: DoNotPreferExpressionBodiedAccessors);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task WithInitialValue()
        {
            var text = @"
class TestClass
{
    public int G[||]oo { get; set; } = 2
}
";
            var expected = @"
class TestClass
{
    private int goo = 2;

    public int Goo
    {
        get
        {
            return goo;
        }
        set
        {
            goo = value;
        }
    }
}
";
            await TestInRegularAndScriptAsync(text, expected, options: DoNotPreferExpressionBodiedAccessors);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task WithCalculatedInitialValue()
        {
            var text = @"
class TestClass
{
    const int num = 345;
    public int G[||]oo { get; set; } = 2*num
}
";
            var expected = @"
class TestClass
{
    const int num = 345;
    private int goo = 2 * num;

    public int Goo
    {
        get
        {
            return goo;
        }
        set
        {
            goo = value;
        }
    }
}
";
            await TestInRegularAndScriptAsync(text, expected, options: DoNotPreferExpressionBodiedAccessors);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task WithPrivateSetter()
        {
            var text = @"
class TestClass
{
    public int G[||]oo { get; private set; }
}
";
            var expected = @"
class TestClass
{
    private int goo;

    public int Goo
    {
        get
        {
            return goo;
        }
        private set
        {
            goo = value;
        }
    }
}
";
            await TestInRegularAndScriptAsync(text, expected, options: DoNotPreferExpressionBodiedAccessors);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task WithFieldNameAlreadyUsed()
        {
            var text = @"
class TestClass
{
    private int goo;

    public int G[||]oo { get; private set; }
}
";
            var expected = @"
class TestClass
{
    private int goo;
    private int goo1;

    public int Goo
    {
        get
        {
            return goo1;
        }
        private set
        {
            goo1 = value;
        }
    }
}
";
            await TestInRegularAndScriptAsync(text, expected, options: DoNotPreferExpressionBodiedAccessors);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task WithComments()
        {
            var text = @"
class TestClass
{
    // Comments before
    public int G[||]oo { get; private set; } //Comments during
    //Comments after
}
";
            var expected = @"
class TestClass
{
    private int goo;

    // Comments before
    public int Goo
    {
        get
        {
            return goo;
        }
        private set
        {
            goo = value;
        }
    } //Comments during
    //Comments after
}
";
            await TestInRegularAndScriptAsync(text, expected, options: DoNotPreferExpressionBodiedAccessors);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task WithExpressionBody()
        {
            var text = @"
class TestClass
{
    public int G[||]oo { get; set; }
}
";
            var expected = @"
class TestClass
{
    private int goo;

    public int Goo { get => goo; set => goo = value; }
}
";
            await TestInRegularAndScriptAsync(text, expected, options: PreferExpressionBodiedAccessorsWhenPossible);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task WithExpressionBodyWhenOnSingleLine()
        {
            var text = @"
class TestClass
{
    public int G[||]oo { get; set; }
}
";
            var expected = @"
class TestClass
{
    private int goo;

    public int Goo { get => goo; set => goo = value; }
}
";
            await TestInRegularAndScriptAsync(text, expected, options: PreferExpressionBodiedAccessorsWhenOnSingleLine);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task WithExpressionBodyWhenOnSingleLine2()
        {
            var text = @"
class TestClass
{
    public int G[||]oo
    {
        get;
        set;
    }
}
";
            var expected = @"
class TestClass
{
    private int goo;

    public int Goo
    {
        get => goo;
        set => goo = value;
    }
}
";
            await TestInRegularAndScriptAsync(text, expected, options: PreferExpressionBodiedAccessorsWhenOnSingleLine);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task WithExpressionBodyWithTrivia()
        {
            var text = @"
class TestClass
{
    public int G[||]oo { get /* test */ ; set /* test2 */ ; }
}
";
            var expected = @"
class TestClass
{
    private int goo;

    public int Goo { get /* test */ => goo; set /* test2 */ => goo = value; }
}
";
            await TestInRegularAndScriptAsync(text, expected, options: PreferExpressionBodiedAccessorsWhenPossible);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task WithPropertyOpenBraceOnSameLine()
        {
            var text = @"
class TestClass
{
    public int G[||]oo { get; set; }
}
";
            var expected = @"
class TestClass
{
    private int goo;

    public int Goo {
        get
        {
            return goo;
        }
        set
        {
            goo = value;
        }
    }
}
";
            await TestInRegularAndScriptAsync(text, expected, options: DoNotPreferExpressionBodiedAccessorsAndPropertyOpenBraceOnSameLine);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task WithAccessorOpenBraceOnSameLine()
        {
            var text = @"
class TestClass
{
    public int G[||]oo { get; set; }
}
";
            var expected = @"
class TestClass
{
    private int goo;

    public int Goo
    {
        get {
            return goo;
        }
        set {
            goo = value;
        }
    }
}
";
            await TestInRegularAndScriptAsync(text, expected, options: DoNotPreferExpressionBodiedAccessorsAndAccessorOpenBraceOnSameLine);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task StaticProperty()
        {
            var text = @"
class TestClass
{
    public static int G[||]oo { get; set; }
}
";
            var expected = @"
class TestClass
{
    private static int goo;

    public static int Goo
    {
        get
        {
            return goo;
        }
        set
        {
            goo = value;
        }
    }
}
";
            await TestInRegularAndScriptAsync(text, expected, options: DoNotPreferExpressionBodiedAccessors);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task ProtectedProperty()
        {
            var text = @"
class TestClass
{
    protected int G[||]oo { get; set; }
}
";
            var expected = @"
class TestClass
{
    private int goo;

    protected int Goo
    {
        get
        {
            return goo;
        }
        set
        {
            goo = value;
        }
    }
}
";
            await TestInRegularAndScriptAsync(text, expected, options: DoNotPreferExpressionBodiedAccessors);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task InternalProperty()
        {
            var text = @"
class TestClass
{
    internal int G[||]oo { get; set; }
}
";
            var expected = @"
class TestClass
{
    private int goo;

    internal int Goo
    {
        get
        {
            return goo;
        }
        set
        {
            goo = value;
        }
    }
}
";
            await TestInRegularAndScriptAsync(text, expected, options: DoNotPreferExpressionBodiedAccessors);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task WithAttributes()
        {
            var text = @"
class TestClass
{
    [A]
    public int G[||]oo { get; set; }
}
";
            var expected = @"
class TestClass
{
    private int goo;

    [A]
    public int Goo
    {
        get
        {
            return goo;
        }
        set
        {
            goo = value;
        }
    }
}
";
            await TestInRegularAndScriptAsync(text, expected, options: DoNotPreferExpressionBodiedAccessors);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task CommentsInAccessors()
        {
            var text = @"
class TestClass
{
    /// <summary>
    /// test stuff here
    /// </summary>
    public int Testg[||]oo { /* test1 */ get /* test2 */; /* test3 */ set /* test4 */; /* test5 */ } /* test6 */
}
";
            var expected = @"
class TestClass
{
    private int testgoo;

    /// <summary>
    /// test stuff here
    /// </summary>
    public int Testgoo
    { /* test1 */
        get /* test2 */
        {
            return testgoo;
        } /* test3 */
        set /* test4 */
        {
            testgoo = value;
        } /* test5 */
    } /* test6 */
}
";
            await TestInRegularAndScriptAsync(text, expected, options: DoNotPreferExpressionBodiedAccessors);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task OverrideProperty()
        {
            var text = @"
class MyBaseClass
{
    public virtual string Name { get; set; }
}

class MyDerivedClass : MyBaseClass
{
    public override string N[||]ame {get; set;}
}
";
            var expected = @"
class MyBaseClass
{
    public virtual string Name { get; set; }
}

class MyDerivedClass : MyBaseClass
{
    private string name;

    public override string Name
    {
        get
        {
            return name;
        }
        set
        {
            name = value;
        }
    }
}
";
            await TestInRegularAndScriptAsync(text, expected, options: DoNotPreferExpressionBodiedAccessors);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task SealedProperty()
        {
            var text = @"
class MyClass
{
    public sealed string N[||]ame {get; set;}
}
";
            var expected = @"
class MyClass
{
    private string name;

    public sealed string Name
    {
        get
        {
            return name;
        }
        set
        {
            name = value;
        }
    }
}
";
            await TestInRegularAndScriptAsync(text, expected, options: DoNotPreferExpressionBodiedAccessors);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task VirtualProperty()
        {
            var text = @"
class MyBaseClass
{
    public virtual string N[||]ame { get; set; }
}

class MyDerivedClass : MyBaseClass
{
    public override string Name {get; set;}
}
";
            var expected = @"
class MyBaseClass
{
    private string name;

    public virtual string Name
    {
        get
        {
            return name;
        }
        set
        {
            name = value;
        }
    }
}

class MyDerivedClass : MyBaseClass
{
    public override string Name {get; set;}
}
";
            await TestInRegularAndScriptAsync(text, expected, options: DoNotPreferExpressionBodiedAccessors);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task PrivateProperty()
        {
            var text = @"
class MyClass
{
    private string N[||]ame { get; set; }
}
";
            var expected = @"
class MyClass
{
    private string name;

    private string Name
    {
        get
        {
            return name;
        }
        set
        {
            name = value;
        }
    }
}
";
            await TestInRegularAndScriptAsync(text, expected, options: DoNotPreferExpressionBodiedAccessors);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task AbstractProperty()
        {
            var text = @"
class MyBaseClass
{
    public abstract string N[||]ame { get; set; }
}

class MyDerivedClass : MyBaseClass
{
    public override string Name {get; set;}
}
";
            await TestMissingAsync(text);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task ExternProperty()
        {
            var text = @"
class MyBaseClass
{
    extern string N[||]ame { get; set; }
}
";
            await TestMissingAsync(text);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task GetterOnly()
        {
            var text = @"
class TestClass
{
    public int G[||]oo { get;}
}
";
            var expected = @"
class TestClass
{
    private readonly int goo;

    public int Goo
    {
        get
        {
            return goo;
        }
    }
}
";
            await TestInRegularAndScriptAsync(text, expected, options: DoNotPreferExpressionBodiedAccessors);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task GetterOnlyExpressionBodies()
        {
            var text = @"
class TestClass
{
    public int G[||]oo { get;}
}
";
            var expected = @"
class TestClass
{
    private readonly int goo;

    public int Goo => goo;
}
";
            await TestInRegularAndScriptAsync(text, expected, options: PreferExpressionBodiesOnAccessorsAndMethods);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task SetterOnly()
        {
            var text = @"
class TestClass
{
    public int G[||]oo
    {
        set {}
    }
}
";
            await TestMissingAsync(text);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task ExpressionBodiedAccessors()
        {
            var text = @"
class TestClass
{
   private int testgoo;

   public int testg[||]oo {get => testgoo; set => testgoo = value; }
}
";
            await TestMissingAsync(text);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task CursorAtBeginning()
        {
            var text = @"
class TestClass
{
    [||]public int Goo { get; set; }
}
";
            var expected = @"
class TestClass
{
    private int goo;

    public int Goo
    {
        get
        {
            return goo;
        }
        set
        {
            goo = value;
        }
    }
}
";
            await TestInRegularAndScriptAsync(text, expected, options: DoNotPreferExpressionBodiedAccessors);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task CursorAtEnd()
        {
            var text = @"
class TestClass
{
    public int Goo[||] { get; set; }
}
";
            var expected = @"
class TestClass
{
    private int goo;

    public int Goo
    {
        get
        {
            return goo;
        }
        set
        {
            goo = value;
        }
    }
}
";
            await TestInRegularAndScriptAsync(text, expected, options: DoNotPreferExpressionBodiedAccessors);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task CursorOnAccessors()
        {
            var text = @"
class TestClass
{
    public int Goo { g[||]et; set; }
}
";
            await TestMissingAsync(text);
        }

        [WorkItem(35180, "https://github.com/dotnet/roslyn/issues/35180")]
        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task CursorInType()
        {
            var text = @"
class TestClass
{
    public in[||]t Goo { get; set; }
}
";
            var expected = @"
class TestClass
{
    private int goo;

    public int Goo
    {
        get
        {
            return goo;
        }
        set
        {
            goo = value;
        }
    }
}
";
            await TestInRegularAndScriptAsync(text, expected, options: DoNotPreferExpressionBodiedAccessors);
        }

        [WorkItem(35180, "https://github.com/dotnet/roslyn/issues/35180")]
        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task SelectionWhole()
        {
            var text = @"
class TestClass
{
    [|public int Goo { get; set; }|]
}
";
            var expected = @"
class TestClass
{
    private int goo;

    public int Goo
    {
        get
        {
            return goo;
        }
        set
        {
            goo = value;
        }
    }
}
";
            await TestInRegularAndScriptAsync(text, expected, options: DoNotPreferExpressionBodiedAccessors);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task SelectionName()
        {
            var text = @"
class TestClass
{
    public int [|Goo|] { get; set; }
}
";
            var expected = @"
class TestClass
{
    private int goo;

    public int Goo
    {
        get
        {
            return goo;
        }
        set
        {
            goo = value;
        }
    }
}
";
            await TestInRegularAndScriptAsync(text, expected, options: DoNotPreferExpressionBodiedAccessors);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task MoreThanOneGetter()
        {
            var text = @"
class TestClass
{
    public int Goo { g[||]et; get; }
}
";
            await TestMissingAsync(text);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task MoreThanOneSetter()
        {
            var text = @"
class TestClass
{
    public int Goo { get; s[||]et; set; }
}
";
            await TestMissingAsync(text);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task CustomFieldName()
        {
            var text = @"
class TestClass
{
    public int G[||]oo { get; set; }
}
";
            var expected = @"
class TestClass
{
    private int testingGoo;

    public int Goo
    {
        get
        {
            return testingGoo;
        }
        set
        {
            testingGoo = value;
        }
    }
}
";
            await TestInRegularAndScriptAsync(text, expected, options: UseCustomFieldName);
        }

        [WorkItem(28013, "https://github.com/dotnet/roslyn/issues/26992")]
        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task UnderscorePrefixedFieldName()
        {
            var text = @"
class TestClass
{
    public int G[||]oo { get; set; }
}
";
            var expected = @"
class TestClass
{
    private int _goo;

    public int Goo
    {
        get
        {
            return _goo;
        }
        set
        {
            _goo = value;
        }
    }
}
";
            await TestInRegularAndScriptAsync(text, expected, options: UseUnderscorePrefixedFieldName);
        }

        [WorkItem(28013, "https://github.com/dotnet/roslyn/issues/26992")]
        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task PropertyNameEqualsToClassNameExceptFirstCharCasingWhichCausesFieldNameCollisionByDefault()
        {
            var text = @"
class stranger
{
    public int S[||]tranger { get; set; }
}
";
            var expected = @"
class stranger
{
    private int stranger;

    public int Stranger { get => stranger; set => stranger = value; }
}
";
            await TestInRegularAndScriptAsync(text, expected);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task NonStaticPropertyWithCustomStaticFieldName()
        {
            var text = @"
class TestClass
{
    public int G[||]oo { get; set; }
}
";
            var expected = @"
class TestClass
{
    private int goo;

    public int Goo
    {
        get
        {
            return goo;
        }
        set
        {
            goo = value;
        }
    }
}
";
            await TestInRegularAndScriptAsync(text, expected, options: UseCustomStaticFieldName);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task StaticPropertyWithCustomStaticFieldName()
        {
            var text = @"
class TestClass
{
    public static int G[||]oo { get; set; }
}
";
            var expected = @"
class TestClass
{
    private static int staticfieldtestGoo;

    public static int Goo
    {
        get
        {
            return staticfieldtestGoo;
        }
        set
        {
            staticfieldtestGoo = value;
        }
    }
}
";
            await TestInRegularAndScriptAsync(text, expected, options: UseCustomStaticFieldName);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task InInterface()
        {
            var text = @"
interface IGoo
{
    public int Goo { get; s[||]et; }
}
";
            await TestMissingAsync(text);
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task InStruct()
        {
            var text = @"
struct goo
{
    public int G[||]oo { get; set; }
}
";
            var expected = @"
struct goo
{
    private int goo;

    public int Goo
    {
        get
        {
            return goo;
        }
        set
        {
            goo = value;
        }
    }
}
";
            await TestInRegularAndScriptAsync(text, expected, options: DoNotPreferExpressionBodiedAccessors);
        }

        [WorkItem(22146, "https://github.com/dotnet/roslyn/issues/22146")]
        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task PartialClasses()
        {
            var text = @"
partial class Program
{
    int P { get; set; }
}

partial class Program
{
    int [||]Q { get; set; }
}
";
            var expected = @"
partial class Program
{
    int P { get; set; }
}

partial class Program
{
    private int q;

    int Q { get => q; set => q = value; }
}
";
            await TestInRegularAndScriptAsync(text, expected);
        }

        [WorkItem(22146, "https://github.com/dotnet/roslyn/issues/22146")]
        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task PartialClassInSeparateFiles1()
        {
            var file1 = @"
partial class Program
{
    int [||]P { get; set; }
}";
            var file2 = @"
partial class Program
{
    int Q { get; set; }
}";
            var file1AfterRefactor = @"
partial class Program
{
    private int p;

    int P { get => p; set => p = value; }
}";

            var xmlString = string.Format(@"
<Workspace>
    <Project Language=""{0}"" CommonReferences=""true"">
        <Document FilePath=""file1"">{1}</Document>
        <Document FilePath=""file2"">{2}</Document>
    </Project>
</Workspace>", LanguageNames.CSharp, file1, file2);

            using (var testWorkspace = TestWorkspace.Create(xmlString))
            {
                // refactor file1 and check
                var (_, action) = await GetCodeActionsAsync(testWorkspace, parameters: default);
                await TestActionAsync(
                    testWorkspace,
                    file1AfterRefactor,
                    action,
                    conflictSpans: ImmutableArray<TextSpan>.Empty,
                    renameSpans: ImmutableArray<TextSpan>.Empty,
                    warningSpans: ImmutableArray<TextSpan>.Empty,
                    navigationSpans: ImmutableArray<TextSpan>.Empty,
                    parameters: default);
            }
        }

        [WorkItem(22146, "https://github.com/dotnet/roslyn/issues/22146")]
        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task PartialClassInSeparateFiles2()
        {
            var file1 = @"
partial class Program
{
    int P { get; set; }
}";
            var file2 = @"
partial class Program
{
    int Q[||] { get; set; }
}";
            var file2AfterRefactor = @"
partial class Program
{
    private int q;

    int Q { get => q; set => q = value; }
}";

            var xmlString = string.Format(@"
<Workspace>
    <Project Language=""{0}"" CommonReferences=""true"">
        <Document FilePath=""file1"">{1}</Document>
        <Document FilePath=""file2"">{2}</Document>
    </Project>
</Workspace>", LanguageNames.CSharp, file1, file2);

            using (var testWorkspace = TestWorkspace.Create(xmlString))
            {
                // refactor file2 and check
                var (_, action) = await GetCodeActionsAsync(testWorkspace, parameters: default);
                await TestActionAsync(
                    testWorkspace,
                    file2AfterRefactor,
                    action,
                    conflictSpans: ImmutableArray<TextSpan>.Empty,
                    renameSpans: ImmutableArray<TextSpan>.Empty,
                    warningSpans: ImmutableArray<TextSpan>.Empty,
                    navigationSpans: ImmutableArray<TextSpan>.Empty,
                    parameters: default);
            }
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task InvalidLocation()
        {
            await TestMissingAsync(@"namespace NS
{
    public int G[||]oo { get; set; }
}");

            await TestMissingAsync("public int G[||]oo { get; set; }");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.ConvertAutoPropertyToFullProperty)]
        public async Task NullBackingField()
        {
            await TestInRegularAndScriptAsync(
@"
#nullable enable

class Program
{
    string? Name[||] { get; set; }
}",
@"
#nullable enable

class Program
{
    private string? name;

    string? Name { get => name; set => name = value; }
}");
        }
    }
}


text:
"""
Generic definition of type:

* :class:`DifferentialEquation` (``dY/dt = expr : type``)
* :class:`Equation` (``Y = expr : type``)
* :class:`Declaration` (``Y : type``)
"""
import compiler
import compiler.ast
import compiler.visitor

class DefinitionError(Exception):
    """ Definition Error """
    pass

class Definition(object):
    """ Generic definition of type:

    * :class:`DifferentialEquation` (``dY/dt = expr : type``)
    * :class:`Equation` (``Y = expr : type``)
    * :class:`Declaration` (``Y : type``)
    """

    def __init__(self, definition, constants=None):
        if not constants:
            constants = {}
        self._definition = str(definition.replace(' ',''))
        self._varname = None
        self._dtype = None
        self._lhs = ""
        self._rhs = ""
        self._variables = []

    def setup(self, constants=None):
        """ Parse definition

        **Parameters**

        definition : str
            Declaration, equation or differential equation expression.
            """
        if not constants: constants = {}
        raise(NotImplementedError)

    def __repr__(self):
        """ x.__repr__() <==> repr(x) """

        classname = self.__class__.__name__
        return "%s('%s = %s : %s')" % (classname, self._lhs, self._rhs, self._dtype)

    def _get_varname(self):
        """ Get variable name (left hand side) """
        return self._varname
    varname = property(_get_varname,
                       doc='''Equation variable name (left hand side) ''')

    def _get_lhs(self):
        """ Get equation left hand side """
        return self._lhs
    lhs = property(_get_lhs,
                   doc='''Equation left hand-side''')

    def _get_rhs(self):
        """ Get equation right hand side """
        return self._rhs
    rhs = property(_get_lhs,
                   doc='''Equation right hand-side''')

    def _get_definition(self):
        """ Get equation original definition """
        return self._definition
    definition = property(_get_definition,
                          doc='''Equation original definition''')

    def _get_dtype(self):
        """Get equation data type """
        return self._dtype
    dtype = property(_get_dtype,
                     doc='''Equation data type''')

class Visitor(compiler.visitor.ASTVisitor):
    """
    This class is used with compiler.walk and extract functions calls,
    variables and dotted variable names from an expression.
    """

    def __init__(self):
        compiler.visitor.ASTVisitor.__init__(self)
        self._funcs = []
        self._vars  = []
        self._constants = []
        self._call = False

    def visitName(self, node):
        name = node.name
        if not self._call:
            if name not in self._vars:
                self._vars.append(name)
        else:
            if name not in self._funcs:
                self._funcs.append(name)

    def visitCallFunc(self, node):
        """ """
        self._call = True
        self.visit(node.node)
        self._call = False
        if node.args:
            for arg in node.args: self.visit(arg)
        if node.star_args:
            self.visit(node.dstar_args)
        if node.dstar_args:
            self.visit(node.dstar_args)

    def visitGetattr(self, node):
        """ """
        dotted = []
        n = node
        while isinstance(n, compiler.ast.Getattr):
            dotted.append(n.attrname)
            n = n.expr
            try:
                dotted.append(n.name)
            except AttributeError:
                pass
                #print >> sys.stderr, "ignoring", node
            else:
                name = ".".join(reversed(dotted))
                if not self._call:
                    if name not in self._constants:
                        self._constants.append(name)
                else:
                    if name not in self._funcs:
                        self._funcs.append(name)


text:
package org.pentaho.mondrian.tck;

import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;

import mondrian.rolap.RolapConnection;

import org.apache.log4j.Logger;
import org.pentaho.mondrian.tck.TestBase.QueryAndResult;

public class ConcurrentValidatingMdxQueryRunner extends Thread {
  private static final Logger LOGGER = Logger.getLogger( ConcurrentValidatingMdxQueryRunner.class );
  private long mRunTime;
  private long mStartTime;
  private long mStopTime;
  private volatile List<Throwable> mExceptions = new ArrayList<Throwable>();
  private String threadName;
  private int mRunCount;
  private int mSuccessCount;
  private boolean mRandomQueries;

  private QueryAndResult[] mdxQueries;
  private boolean usePooling;

  /**
   * Runs concurrent queries without flushing cache. This constructor
   * provides backward compatibilty for usage in {@link ConcurrentMdxTest}.
   *
   * @param numSeconds Running time
   * @param useRandomQuery If set to true, the runner will
   *        pick a random query from the set. If set to false,
   *        the runner will circle through queries sequentially
   * @param queriesAndResults The array of pairs of query and expected result
   */
  public ConcurrentValidatingMdxQueryRunner(
      int numSeconds,
      boolean useRandomQuery,
      boolean usePooling,
      QueryAndResult[] queriesAndResults ) {
    this.mdxQueries = queriesAndResults;
    this.mRunTime = numSeconds * 1000;
    this.mRandomQueries = useRandomQuery;
    this.usePooling = usePooling;
  }

  /**
   * Runs a number of queries until time expires. For each iteration,
   * if cache is to be flushed, do it before running the query.
   */
  public void run() {
    mStartTime = System.currentTimeMillis();
    threadName = Thread.currentThread().getName();
    try {
      int queryIndex = -1;

      while ( System.currentTimeMillis() - mStartTime < mRunTime ) {
        try {
          if ( mRandomQueries ) {
            queryIndex =
              (int) ( Math.random() * mdxQueries.length );
          } else {
            queryIndex = mRunCount % mdxQueries.length;
          }

          mRunCount++;

          MondrianExpectation expectation = MondrianExpectation.newBuilder()
              .query( mdxQueries[queryIndex].query )
              .result( mdxQueries[queryIndex].result )
              .canBeRandomlyCanceled()
              .build();
          MondrianContext
            .forCatalog( FoodMartCatalogs.FLAT_WITH_FEW_DIMS, usePooling )
            .verify( expectation );

          mSuccessCount++;

        } catch ( Throwable e ) {
          mExceptions.add(
              new Exception(
                "Exception occurred in iteration " + mRunCount
                + " of thread " + Thread.currentThread().getName(),
                e ) );
        }
      }
      mStopTime = System.currentTimeMillis();
    } catch ( Throwable e ) {
      mExceptions.add( e );
    }
  }

  /**
   * Prints result of this test run.
   */
  private void report() {
    String message = MessageFormat.format(
        " {0} ran {1} queries, {2} successfully in {3} milliseconds",
        threadName,
        mRunCount,
        mSuccessCount,
        mStopTime - mStartTime );

    LOGGER.info( message );

    for ( Throwable throwable : mExceptions ) {
      LOGGER.error( throwable );
    }
  }

  /**
   * Creates and runs concurrent threads of tests
   *
   * @param numThreads Number of concurrent threads
   * @param runTimeInSeconds Running Time
   * @param randomQueries Whether to pick queries in random or in sequence
   * @param printReport Whether to print report
   * @param queriesAndResults Array of pairs of query and expected result
   * @return The list of failures
   */
  static List<Throwable> runTest(
      int numThreads,
      int runTimeInSeconds,
      boolean randomQueries,
      boolean printReport,
      boolean usePooling,
      QueryAndResult[] queriesAndResults ) throws Exception {

    ConcurrentValidatingMdxQueryRunner[] runners =
      new ConcurrentValidatingMdxQueryRunner[numThreads];
    List<Throwable> allExceptions = new ArrayList<Throwable>();

    MondrianContext ctx =
        MondrianContext.forCatalog( FoodMartCatalogs.FLAT_WITH_FEW_DIMS, usePooling );
    ctx.olapConnection.unwrap( RolapConnection.class )
      .getCacheControl( null )
        .flushSchemaCache();

    for ( int idx = 0; idx < runners.length; idx++ ) {
      runners[idx] = new ConcurrentValidatingMdxQueryRunner(
        runTimeInSeconds,
        randomQueries,
        usePooling,
        queriesAndResults );
    }

    for ( int idx = 0; idx < runners.length; idx++ ) {
      runners[idx].start();
    }

    for ( int idx = 0; idx < runners.length; idx++ ) {
      try {
        runners[idx].join();
      } catch ( InterruptedException e ) {
        e.printStackTrace();
      }
    }

    for ( int idx = 0; idx < runners.length; idx++ ) {
      allExceptions.addAll( runners[idx].mExceptions );
      if ( printReport ) {
        runners[idx].report();
      }
    }
    return allExceptions;
  }
}


text:
#pragma once
#include <JavaScriptCore/ScriptFetcher.h>


text:
        <button onclick="onBtShowYearColumn()">Show Year</button>
        <button onclick="onBtHideYearColumn()">Hide Year</button>


text:
package com.jtechapps.FloppyThreeD.Screens;

import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator;
import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator.FreeTypeFontParameter;
import com.badlogic.gdx.graphics.g3d.Model;
import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
import com.badlogic.gdx.scenes.scene2d.utils.SpriteDrawable;
import com.jtechapps.FloppyThreeD.NativeInterface;
import com.jtechapps.FloppyThreeD.ScoreManager;
import com.jtechapps.FloppyThreeD.SettingsManager;

public class SettingsScreen implements Screen {
	private NativeInterface nface;
	private Game g;
	private SpriteBatch batch;
	private Texture background;
	private float width;
	private float height;
	private Texture quickresetTexture;
	private Texture noobTexture;
	private Texture easyTexture;
	private Texture mediumTexture;
	private Texture hardTexture;
	private Texture proTexture;
	private Stage stage;
	private Texture quickresetonTexture;
	private Texture menuTexture;
	private Texture aboutTexture;
	private SettingsManager settingsManager = new SettingsManager();
	private Sound buttonSound;

	public SettingsScreen(Game game, NativeInterface nativeinterface){
		g = game;
		nface = nativeinterface;
	}

	@Override
	public void render(float delta) {
		Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
		batch.begin();
		batch.draw(background, 0, 0, width, height);
		batch.end();
		stage.draw();
	}

	@Override
	public void resize(int width, int height) {

	}

	@Override
	public void show() {
		batch = new SpriteBatch();
		background = new Texture("img/backgroundonev2.png");
		width = Gdx.graphics.getWidth();
		height = Gdx.graphics.getHeight();
		//load up the buttons
		quickresetTexture = new Texture("img/quickresetoff.png");
		quickresetonTexture = new Texture("img/quickreseton.png");
		noobTexture = new Texture("img/noob.png");
		easyTexture = new Texture("img/easy.png");
		mediumTexture = new Texture("img/medium.png");
		hardTexture = new Texture("img/hard.png");
		proTexture = new Texture("img/pro.png");
		aboutTexture = new Texture("img/aboutbutton.png");
		menuTexture = new Texture("img/menubutton.png");
		//sounds
		buttonSound = Gdx.audio.newSound(Gdx.files.internal("sounds/buttonsound.wav"));

		//use images for the stage
		stage = new Stage();
		final Image quickreset = new Image(quickresetTexture);
		if(settingsManager.getquickreset()){
			quickreset.setDrawable(new SpriteDrawable(new Sprite(quickresetonTexture)));
		}
		quickreset.setWidth(width/5);
		quickreset.setHeight(height/7);
		quickreset.setX(width/4);
		quickreset.setY(height-height/4-quickreset.getHeight());
		quickreset.addListener(new ClickListener() {
		    public boolean touchDown(InputEvent event, float x, float y, int pointer, int button)
		    {
		    	buttonSound.play();
		        settingsManager.togglequickreset();
		        if(settingsManager.getquickreset()){
					quickreset.setDrawable(new SpriteDrawable(new Sprite(quickresetonTexture)));
				}
		        else{
		        	quickreset.setDrawable(new SpriteDrawable(new Sprite(quickresetTexture)));
		        }
		        return true;
		    }
		});
		stage.addActor(quickreset);

		final Image difficulty = new Image(easyTexture);
		if(settingsManager.getdifficulty()==0){
			difficulty.setDrawable(new SpriteDrawable(new Sprite(noobTexture)));
		}
		else if(settingsManager.getdifficulty()==1){
			difficulty.setDrawable(new SpriteDrawable(new Sprite(easyTexture)));
		}
		else if(settingsManager.getdifficulty()==2){
			difficulty.setDrawable(new SpriteDrawable(new Sprite(mediumTexture)));
		}
		else if(settingsManager.getdifficulty()==3){
			difficulty.setDrawable(new SpriteDrawable(new Sprite(hardTexture)));
		}
		else if(settingsManager.getdifficulty()==4){
			difficulty.setDrawable(new SpriteDrawable(new Sprite(proTexture)));
		}
		difficulty.setWidth(width/5);
		difficulty.setHeight(height/7);
		difficulty.setX(width-width/4-difficulty.getWidth());
		difficulty.setY(height-height/4-difficulty.getHeight());
		difficulty.addListener(new ClickListener() {
		    public boolean touchDown(InputEvent event, float x, float y, int pointer, int button)
		    {
		    	buttonSound.play();
		        settingsManager.toggledifficulty();
		        if(settingsManager.getdifficulty()==0){
					difficulty.setDrawable(new SpriteDrawable(new Sprite(noobTexture)));
				}
				else if(settingsManager.getdifficulty()==1){
					difficulty.setDrawable(new SpriteDrawable(new Sprite(easyTexture)));
				}
				else if(settingsManager.getdifficulty()==2){
					difficulty.setDrawable(new SpriteDrawable(new Sprite(mediumTexture)));
				}
				else if(settingsManager.getdifficulty()==3){
					difficulty.setDrawable(new SpriteDrawable(new Sprite(hardTexture)));
				}
				else if(settingsManager.getdifficulty()==4){
					difficulty.setDrawable(new SpriteDrawable(new Sprite(proTexture)));
				}
		        return true;
		    }
		});
		stage.addActor(difficulty);

		Image menu = new Image(menuTexture);
		menu.setWidth(width/5);
		menu.setHeight(height/7);
		menu.setX(width/4);
		menu.setY(height-height/4-menu.getHeight()-quickreset.getHeight()-quickreset.getHeight()/2);
		menu.addListener(new ClickListener() {
		    public boolean touchDown(InputEvent event, float x, float y, int pointer, int button)
		    {
		    	buttonSound.play();
		        g.setScreen(new MainMenuScreen(g, nface));
		        return true;
		    }
		});
		stage.addActor(menu);

		Image about = new Image(aboutTexture);
		about.setWidth(width/5);
		about.setHeight(height/7);
		about.setX(width-width/4-difficulty.getWidth());
		about.setY(height-height/4-about.getHeight()-difficulty.getHeight()-difficulty.getHeight()/2);
		about.addListener(new ClickListener() {
		    public boolean touchDown(InputEvent event, float x, float y, int pointer, int button)
		    {
		    	buttonSound.play();
		        g.setScreen(new AboutScreen(g, nface));
		        return true;
		    }
		});
		stage.addActor(about);

		if(nface.getAssetManger()==null){// load assets
        	nface.setAssetManger(new  AssetManager());
        	nface.getAssetManger().load("models/pipe.g3db",Model.class);
        	nface.getAssetManger().load("models/bird.g3db",Model.class);
        	FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("fonts/arial.ttf"));
			FreeTypeFontParameter parameter = new FreeTypeFontParameter();
			parameter.size = (int) (height/18);
			nface.setFont1(generator.generateFont(parameter));
			generator.dispose();
        	nface.getAssetManger().finishLoading();
        }

		Gdx.input.setInputProcessor(stage);
	}

	@Override
	public void hide() {

	}

	@Override
	public void pause() {

	}

	@Override
	public void resume() {

	}

	@Override
	public void dispose() {
		background.dispose();
		quickresetTexture.dispose();
		quickresetonTexture.dispose();
		noobTexture.dispose();
		easyTexture.dispose();
		mediumTexture.dispose();
		hardTexture.dispose();
		proTexture.dispose();
		menuTexture.dispose();
		aboutTexture.dispose();
		batch.dispose();
		stage.dispose();
		buttonSound.dispose();
		this.dispose();
	}

}


text:
package org.apache.storm.st.helper;

import org.apache.storm.st.wrapper.StormCluster;

public abstract class AbstractTest {
    protected final StormCluster cluster = new StormCluster();
    static {
        System.setProperty("user.timezone", "UTC");
    }
}


text:
class InvalidLineException(Exception):
    pass


text:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="ricardo.com.br.musicplayer.fragment.LoadingFragment">

    <android.support.v4.widget.ContentLoadingProgressBar
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        style="@style/Base.Widget.AppCompat.ProgressBar"
        android:layout_gravity="center"/>

</FrameLayout>


text:
<!DOCTYPE html>

    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title></title>
    <link rel="Stylesheet" href="../css/analysis.css" />

Agreguj punkty

Narzędzie do pracy z warstwą obiektów punktowych oraz warstwą obiektów powierzchniowych. Pierwszą operacją jest przyporządkowanie punktów do poszczególnych obszarów. Po określeniu tej zależności przestrzennej między punktami i obszarami wykonywane są obliczenia statystyczne dotyczące wszystkich punktów na obszarze, a następnie statystyki te są przypisywane do danego obszaru. Najbardziej podstawowym obliczeniem statystycznym jest liczba punktów przypadająca na dany obszar, jednak można uzyskać również inne statystyki.

Przyjmijmy na przykład, że masz obiekty punktowe reprezentujące lokalizację kawiarni oraz obiekty powierzchniowe reprezentujące powiaty i chcesz uzyskać podsumowanie sprzedaży kawy w powiatach. Zakładając, że kawiarnie mają atrybut  TOTAL_SALES, możesz obliczyć sumę wszystkich atrybutów TOTAL_SALES dla każdego powiatu lub wyznaczyć minimalną bądź maksymalną wartość TOTAL_SALES w każdym z nich, a także odchylenie standardowe dla poszczególnych powiatów.

Rezultatem tych operacji jest mapa, na której kolor każdego obszaru jest zależny od wartości wyniku ilorazu liczby wszystkich punktów przez powierzchnię obszaru. Ten iloraz liczby przez powierzchnię nazywany jest normalizacją — jest to procedura używana przez kartografów w celu przedstawiania danych według obszaru. Normalizacja pomaga w lepszym zrozumieniu relacji przestrzennych, ponieważ przy wizualnym porównywaniu obszarów brana pod uwagę jest powierzchnia danego obszaru.

Jeśli zaznaczono opcję  Użyj bieżącego zasięgu mapy, w analizie wezmą udział jedynie obiekty w wejściowej warstwie punktowej i warstwie obszaru widoczne w bieżącym zasięgu mapy. Jeśli powyższa opcja nie jest zaznaczona, analizowane będą wszystkie obiekty w wejściowej warstwie punktowej i warstwie obszaru, nawet jeśli będą znajdować się poza bieżącym zasięgiem mapy.

Wybierz warstwę zawierającą punkty w celu agregowania do obszarów

Warstwa punktów, która zostanie agregowana do obszarów.

Poza wybraniem warstwy na mapie można wybrać opcję  Wybierz warstwę analizy Living Atlas lub Wybierz warstwę analizy dostępną w dolnej części menu rozwijanego. Zostanie wtedy otwarta galeria zawierająca kolekcje warstw przydatnych podczas wielu analiz.

Wybierz warstwę zawierającą obszary agregacji

Warstwa obszaru, dla której będą agregowane punkty. Wszystkie punkty znajdujące się w granicach obszarów w tej warstwie zostaną uwzględnione w obliczeniach i opcjonalnie zsumowane przy użyciu wybranych operacji statycznych.

Poza wybraniem warstwy na mapie można wybrać opcję  Wybierz warstwę analizy Living Atlas lub Wybierz warstwę analizy dostępną w dolnej części menu rozwijanego. Zostanie wtedy otwarta galeria zawierająca kolekcje warstw przydatnych podczas wielu analiz.

Zachowaj obszary bez punktów

Opcja umożliwiająca określenie, czy obszary, na których nie ma punktów mają być wyświetlane w warstwie wynikowej. Jeśli nie zostanie zaznaczona, obszary, w których nie ma punktów, nie będą widoczne. Jeśli zostanie zaznaczona, obszary, w których nie ma punktów będą widoczne.

Dodaj statystyki

Można wykonywać obliczenia statystyczne z wykorzystaniem atrybutów wejściowej warstwy punktowej, takie jak: suma, średnia, wartość minimalna i maksymalna oraz odchylenie standardowe. Warstwa wynikowa
zawiera nowy atrybut dla każdego wykonanego obliczenia statystycznego. Dodać można dowolną statystykę danych liczbowych poprzez wybranie atrybutu oraz właściwej operacji statystycznej (wyświetlone zostanie nowa rozwijana lista).

Wybierz pole, według którego wykonane będzie grupowanie

 Można tworzyć grupy statystyczne za pomocą atrybutów w wejściowej warstwie punktowej. Na przykład, jeśli wykonujesz agregację obejmującą przestępstwa w sąsiednich granicach, możesz mieć atrybut Crime_type z pięcioma różnymi rodzajami przestępstw. Każdy unikalny typ przestępstwa stanowi odrębną grupę, a na podstawie wybranej przez Ciebie statystyki zostaną obliczone dane statystyczne dla każdej unikalnej wartości atrybutu Crime_type. Statystyki dotyczące każdej z grup oraz liczba punktów zostaną wyświetlone w oknie podręcznym warstwy wynikowej. W wyniku wybrania atrybutu grupowania tworzone są dwa elementy: warstwa wynikowa oraz tabela wyników zawierająca statystyki dla każdej unikalnej grupy.

Dodaj mniejszość, większość

To pole wyboru jest aktywowane po wybraniu pola, według którego jest wykonywane grupowanie. Aby dowiedzieć się, które wartości atrybutów w danej grupie stanowią mniejszość (nie są dominujące) lub większość (są dominujące) w obrębie danego obszaru, zaznacz opcję  Dodaj mniejszość, większość. Po wybraniu opcji Dodaj mniejszość, większość, do warstwy wynikowej zostają dodane dwa nowe pola. Jeżeli wybierzesz także opcję Dodaj wartości procentowe, do warstwy wynikowej zostaną dodane dwa dodatkowe pola z procentowym podziałem dominujących i niedominujących wartości atrybutów w każdej z grup.

Jeżeli na przykład pracujesz jako planista miasta i chcesz sprawdzić, które gatunki drzew stanowią mniejszość, a które większość we wszystkich parkach znajdujących się na terenie miasta, zagreguj dane dotyczące drzew z danymi dotyczącymi obszarów parków i zaznacz opisywaną opcję.

Dodaj wartości procentowe

To pole wyboru zostaje aktywowane po wybraniu pola, według którego wykonywane jest grupowanie.    Jeżeli chcesz sprawdzić, jaką wartość procentową stanowią poszczególne wartości atrybutów w każdej z grup, zaznacz opcję  Dodaj wartości procentowe.  Do tabeli wyników zostanie dodane nowe pole zawierające wartości procentowe, jakie stanowią poszczególne wartości atrybutów w każdej z grup.   Jeżeli wybierzesz także opcję Dodaj mniejszość, większość, do warstwy wynikowej zostaną dodane dwa dodatkowe pola z procentowym podziałem dominujących i niedominujących wartości atrybutów w każdej z grup.

Nazwa warstwy wynikowej

Jest to nazwa warstwy, która zostanie utworzona w zakładce  Moje zasoby i zostanie dodana do mapy. Nazwa domyślna jest tworzona w oparciu o nazwę narzędzia i nazwę warstwy wejściowej. Jeśli warstwa już istnieje, wyświetlony zostanie komunikat z prośbą o podanie innej nazwy.

Używając listy rozwijanej  Zapisz wynik w, można określić nazwę folderu w zakładce Moje zasoby, gdzie zostanie zapisany wynik.


text:
{% extends "layout.html" %}
{% block body %}
{% if error %}
Warning: {{ error }}
{% endif %}

Couldn't find your article, did you mean one of these?

{% for item in options %}

{{ item }}

{% endfor %}

 <form role="form" action="{{ url_for('mashup') }}" method=post>

        Wikipedia Article:
        <input name="article" type="text" class="form-control" id="article" placeholder="Enter article">

    <button type="submit" class="btn btn-default">Submit</button>
</form>

{% endblock %}


text:
This is a work in progress to implement the specs currently discussed at:
https://review.openstack.org/#/c/177740/


text:
<?php

class SimpleTags_Admin_ClickTags {
	/**
	 * Constructor
	 *
	 * @return void
	 * @author Amaury Balmer
	 */
	public function __construct() {
		// Ajax action, JS Helper and admin action
		add_action( 'wp_ajax_' . 'simpletags', array( __CLASS__, 'ajax_check' ) );

		// Box for post/page
		add_action( 'admin_menu', array( __CLASS__, 'admin_menu' ), 1 );

		// Javascript
		add_action( 'admin_enqueue_scripts', array( __CLASS__, 'admin_enqueue_scripts' ), 11 );
	}

	/**
	 * Init somes JS and CSS need for this feature
	 *
	 * @return void
	 * @author Amaury Balmer
	 */
	public static function admin_enqueue_scripts() {
		global $pagenow;

		wp_register_script( 'st-helper-click-tags', STAGS_URL . '/assets/js/helper-click-tags.js', array(
			'jquery',
			'st-helper-add-tags'
		), STAGS_VERSION );
		wp_localize_script( 'st-helper-click-tags', 'stHelperClickTagsL10n', array(
			'show_txt' => __( 'Display click tags', 'simpletags' ),
			'hide_txt' => __( 'Hide click tags', 'simpletags' )
		) );

		// Register location
		$wp_post_pages = array( 'post.php', 'post-new.php' );
		$wp_page_pages = array( 'page.php', 'page-new.php' );

		// Helper for posts/pages
		if ( in_array( $pagenow, $wp_post_pages ) || ( in_array( $pagenow, $wp_page_pages ) && is_page_have_tags() ) ) {
			wp_enqueue_script( 'st-helper-click-tags' );
		}
	}

	/**
	 * Register metabox
	 *
	 * @return void
	 * @author Amaury Balmer
	 */
	public static function admin_menu() {
		add_meta_box( 'st-clicks-tags', __( 'Click tags', 'simpletags' ), array(
			__CLASS__,
			'metabox'
		), 'post', 'advanced', 'core' );
		if ( is_page_have_tags() ) {
			add_meta_box( 'st-clicks-tags', __( 'Click tags', 'simpletags' ), array(
				__CLASS__,
				'metabox'
			), 'page', 'advanced', 'core' );
		}
	}

	/**
	 * Put default HTML for people without JS
	 *
	 * @return void
	 * @author Amaury Balmer
	 */
	public static function metabox() {
		echo SimpleTags_Admin::getDefaultContentBox();
	}

	/**
	 * Ajax Dispatcher
	 *
	 * @return void
	 * @author Amaury Balmer
	 */
	public static function ajax_check() {
		if ( isset( $_GET['stags_action'] ) && $_GET['stags_action'] == 'click_tags' ) {
			self::ajax_click_tags();
		}
	}

	/**
	 * Display a span list for click tags
	 *
	 * @return void
	 * @author Amaury Balmer
	 */
	public static function ajax_click_tags() {
		status_header( 200 ); // Send good header HTTP
		header( "Content-Type: text/html; charset=" . get_bloginfo( 'charset' ) );

		if ( (int) wp_count_terms( 'post_tag', 'ignore_empty=false' ) == 0 ) { // No tags to suggest
			echo '
' . __( 'No terms in your WordPress database.', 'simpletags' ) . '
';
			exit();
		}

		// Prepare search
		$search  = ( isset( $_GET['q'] ) ) ? trim( stripslashes( $_GET['q'] ) ) : '';
		$post_id = ( isset( $_GET['post_id'] ) ) ? intval( $_GET['post_id'] ) : 0;

		// Order tags before selection (count-asc/count-desc/name-asc/name-desc/random)
		$order_click_tags = strtolower( SimpleTags_Plugin::get_option_value( 'order_click_tags' ) );
		$order_by         = $order = '';
		switch ( $order_click_tags ) {
			case 'count-asc':
				$order_by = 'tt.count';
				$order    = 'ASC';
				break;
			case 'random':
				$order_by = 'RAND()';
				$order    = '';
				break;
			case 'count-desc':
				$order_by = 'tt.count';
				$order    = 'DESC';
				break;
			case 'name-desc':
				$order_by = 't.name';
				$order    = 'DESC';
				break;
			default : // name-asc
				$order_by = 't.name';
				$order    = 'ASC';
				break;
		}

		// Get all terms, or filter with search
		$terms = SimpleTags_Admin::getTermsForAjax( 'post_tag', $search, $order_by, $order );
		if ( empty( $terms ) || $terms == false ) {
			echo '
' . __( 'No results from your WordPress database.', 'simpletags' ) . '
';
			exit();
		}

		// Get terms for current post
		$post_terms = array();
		if ( $post_id > 0 ) {
			$post_terms = wp_get_post_terms( $post_id, 'post_tag', array( 'fields' => 'ids' ) );
		}

		foreach ( (array) $terms as $term ) {
			$class_current = in_array( $term->term_id, $post_terms ) ? 'used_term' : '';
			echo '' . esc_html( stripslashes( $term->name ) ) . '' . "\n";
		}
		echo '

';

		exit();
	}
}


text:
#region License

#endregion

using System.Runtime.InteropServices;

namespace VulkaNet
{
    [StructLayout(LayoutKind.Sequential)]
    public struct VkSurfaceCapabilitiesKHR
    {
        public int MinImageCount;
        public int MaxImageCount;
        public VkExtent2D CurrentExtent;
        public VkExtent2D MinImageExtent;
        public VkExtent2D MaxImageExtent;
        public int MaxImageArrayLayers;
        public VkSurfaceTransformFlagsKHR SupportedTransforms;
        public VkSurfaceTransformFlagBitsKHR CurrentTransform;
        public VkCompositeAlphaFlagsKHR SupportedCompositeAlpha;
        public VkImageUsageFlags SupportedUsageFlags;
    }
}


text:
package org.dominokit.domino.api.client.mvp.presenter;

import java.util.function.Supplier;
import org.dominokit.domino.api.client.mvp.view.View;

public class ViewablePresenterSupplier<P extends ViewBaseClientPresenter<V>, V extends View>
    extends PresenterSupplier<P> {

  private Supplier<V> viewSupplier;

  public ViewablePresenterSupplier(boolean singleton, Supplier<P> presenterFactory) {
    super(singleton, presenterFactory);
  }

  @Override
  protected void onBeforeInitPresenter() {
    presenter.setViewSupplier(viewSupplier);
  }

  public void setViewSupplier(Supplier<V> viewSupplier) {
    this.viewSupplier = viewSupplier;
  }
}


text:
====================================================
 Fainty - yet another widget library for awesome WM
====================================================

Fainty is small widget library for the `Awesome WM`_. It is not very
modular or extensible, has no external dependencies and provides
text-based widgets that look and behave like standard awesome widgets.

This library requires awesome 4.0. Last working version for 3.5 could
be found at v3.5 tag.

Warning: this is small one-man project without stable API, and beware
of bad English.

Why create another library?
===========================

The NIH syndrome.

Widgets
=======

List of included widgets:

* **fainty.widgets.alsa** - ALSA volume widget that can manage several
  channels of one or multiple sound cards.
* **fainty.widgets.kbdd** - Widget that displays and controls keyboard
  layouts with use of kbdd_.
* **fainty.widgets.awpwkb** - Widget for awpwkb_ per-window keyboard
  layout switcher.
* **fainty.widgets.calendar** - Textclock with calendar popup.
* **fainty.widgets.battery** - Widget with battery information.
* **fainty.widgets.pulseaudio** - PulseAudio widget that can control
  sources and sinks volume and muted state.
* **fainty.widgets.notifications** - Widget that displays
  notifications count.

Installation
============

Clone this repository and put fainty directory in your config path::

 cp -R fainty ${XDG_CONFIG_HOME}/awesome/

Add this to the top of your rc.lua::

 local fainty = require("fainty")

Usage
=====

Look to documentation in doc_ subdirectory.

Screeenshots
============

.. image:: https://i.imgur.com/wUsybSz.png

License
=======

This library released under MIT license, see LICENSE for more detail.

.. _Awesome WM: https://awesomewm.org/
.. _kbdd: https://github.com/qnikst/kbdd/
.. _awpwkb: https://github.com/vladimir-g/awpwkb/
.. _doc: doc/


text:
'use strict';

/**
 * Describes a rule for http route matching.
 *
 */
class HttpRouteMatchRule {
  /**
   * Create a HttpRouteMatchRule.
   * @property {object} path Path to match for routing.
   * @property {string} [path.value] Uri path to match for request.
   * @property {string} [path.rewrite] replacement string for matched part of
   * the Uri.
   * @property {array} [headers] headers and their values to match in request.
   */
  constructor() {
  }

  /**
   * Defines the metadata of HttpRouteMatchRule
   *
   * @returns {object} metadata of HttpRouteMatchRule
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'HttpRouteMatchRule',
      type: {
        name: 'Composite',
        className: 'HttpRouteMatchRule',
        modelProperties: {
          path: {
            required: true,
            serializedName: 'path',
            defaultValue: {},
            type: {
              name: 'Composite',
              className: 'HttpRouteMatchPath'
            }
          },
          headers: {
            required: false,
            serializedName: 'headers',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'HttpRouteMatchHeaderElementType',
                  type: {
                    name: 'Composite',
                    className: 'HttpRouteMatchHeader'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = HttpRouteMatchRule;


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

    <application
        android:allowBackup="false"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name="rouchuan.viewpagerlayoutmanager.MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".circle.CircleLayoutActivity"
            android:parentActivityName=".MainActivity" />
        <activity
            android:name=".circlescale.CircleScaleLayoutActivity"
            android:parentActivityName=".MainActivity" />
        <activity
            android:name=".scale.ScaleLayoutActivity"
            android:parentActivityName=".MainActivity" />
        <activity
            android:name=".gallery.GalleryLayoutActivity"
            android:parentActivityName=".MainActivity" />
        <activity
            android:name=".carousel.CarouselLayoutActivity"
            android:parentActivityName=".MainActivity" />
        <activity
            android:name=".rotate.RotateLayoutActivity"
            android:parentActivityName=".MainActivity" />
    </application>

</manifest>


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context="com.huetoyou.chatexchange.ui.activity.main.MainActivity">

        <LinearLayout
            android:id="@+id/content_main"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:orientation="vertical">

        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:baselineAligned="false"
            android:orientation="horizontal"
            android:visibility="gone">

            <HorizontalScrollView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                tools:ignore="UselessParent">

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">

                    <android.support.design.widget.TabLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_gravity="bottom">

                    </android.support.design.widget.TabLayout>
                </LinearLayout>
            </HorizontalScrollView>

        </LinearLayout>

</LinearLayout>


text:
using System;

namespace Azure.AI.TextAnalytics.Legacy.Models
{
    internal static partial class ConditionalityExtensions
    {
        public static string ToSerialString(this Conditionality value) => value switch
        {
            Conditionality.Hypothetical => "hypothetical",
            Conditionality.Conditional => "conditional",
            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown Conditionality value.")
        };

        public static Conditionality ToConditionality(this string value)
        {
            if (string.Equals(value, "hypothetical", StringComparison.InvariantCultureIgnoreCase)) return Conditionality.Hypothetical;
            if (string.Equals(value, "conditional", StringComparison.InvariantCultureIgnoreCase)) return Conditionality.Conditional;
            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown Conditionality value.");
        }
    }
}


text:
001
018
019    package org.apache.hadoop.mapred.lib.aggregate;
020
021    import org.apache.hadoop.classification.InterfaceAudience;
022    import org.apache.hadoop.classification.InterfaceStability;
023
024    /**
025     * This class implements a value aggregator that dedupes a sequence of objects.
026     */
027    @InterfaceAudience.Public
028    @InterfaceStability.Stable
029    public class UniqValueCount
030        extends org.apache.hadoop.mapreduce.lib.aggregate.UniqValueCount
031        implements ValueAggregator<Object> {
032      /**
033       * the default constructor
034       *
035       */
036      public UniqValueCount() {
037        super();
038      }
039
040      /**
041       * constructor
042       * @param maxNum the limit in the number of unique values to keep.
043       *
044       */
045      public UniqValueCount(long maxNum) {
046        super(maxNum);
047      }
048    }


text:
import { FontSizeSetting } from '../models/fontSizeSetting';

const fontSizes = {
  tBodyTd: new FontSizeSetting(10, 22, 18),
  tHeadTh: new FontSizeSetting(10, 22, 18),
  runTextHolder: new FontSizeSetting(14, 30, 21),
  headerClock: new FontSizeSetting(14, 30, 22),
  headerLogo: new FontSizeSetting(14, 30, 22),
}

export const GlobalVariable = Object.freeze({
  BASE_API_URL: 'http://board.quick.aero/api/v2/',
  BASE_URL: 'http://board.quick.aero',
  FONT_SIZES: fontSizes,
  SETTINGS: {
    settings: {
      system: {
        refreshInterval: 10,
        scrollInterval: 10,
        displayShipper: true,
        displayConsignee: true,
        flightDisplay: 0,
        showTransit: true,
        showTransitType: 1,
        showExpectedDelivery: true,
        dropDelivered: true,
        numberOfSigns: 999
      },
      alerts: {
        primaryInTransit: true,
        primaryInTransitTime: 25,
        primaryInTransitTextColor: '#fff',
        primaryInTransitBackgroundColor: '#f00',
        secondaryInTransit: true,
        secondaryInTransitTime: 25,
        secondaryInTransitTextColor: '#fff',
        secondaryInTransitBackgroundColor: '#000',
        etaNote: true,
        etaNoteType: 1,
        etaNoteTextColor: '#fff',
        etaNoteBackgroundColor: '#63b821',
      },
      graphics: {
        titleBackground: '#555',
        titleTextColor: '#fff',
        tableHeaderColor: '#016c8f',
        tableTextColor: '#fff',
        tableRowColor1: '#064778',
        tableRowColor2: '#00325d',
        businessName: 'Your Business Name Here'
      },
      fontSizes: {
        tBodyTd: fontSizes.tBodyTd.base,
        tHeadTh: fontSizes.tHeadTh.base,
        runTextHolder: fontSizes.runTextHolder.base,
        headerClock: fontSizes.headerClock.base,
        headerLogo: fontSizes.headerLogo.base
      }
    }
  }
});


text:
import http.client

from rdr_service.model.participant import Participant
from rdr_service.dao.participant_summary_dao import ParticipantSummaryDao
from rdr_service.dao.participant_dao import ParticipantDao
from tests.helpers.unittest_base import BaseTestCase

class ParticipantDataSegmentTest(BaseTestCase):
    def setUp(self):
        super().setUp()
        provider_link = {"primary": False, "organization": {"reference": "columbia"}}
        self.participant = {"providerLink": [provider_link]}
        self.provider_link_2 = {"primary": True, "organization": {"reference": "Organization/PITT"}}
        self.summary_dao = ParticipantSummaryDao()
        self.dao = ParticipantDao()

    def tearDown(self):
        BaseTestCase.switch_auth_user('example@example.com', 'example')

    def test_one_partner_cannot_see_others_participant(self):
        vibrent_participant_list = []
        carevo_participant_list = []

        BaseTestCase.switch_auth_user('example@spellman.com', 'vibrent')
        response = self.participant_generator(3)
        for i in response:
            vibrent_participant_list.append(i['participantId'])

        BaseTestCase.switch_auth_user('example@care.com', 'careevolution')

        response = self.participant_generator(3)
        for i in response:
            carevo_participant_list.append(i['participantId'])

        # care evolution can only retrieve vibrent participants in envs < prod.
        for i in vibrent_participant_list:
            # print('getting participant...')
            self.send_get("Participant/{}".format(i))

        BaseTestCase.switch_auth_user('example@spellman.com', 'vibrent')
        # vibrent can not retrieve care evolution participants
        for i in carevo_participant_list:
            self.send_get("Participant/{}".format(i), expected_status=http.client.BAD_REQUEST)

        participant = self.send_get("Participant/{}".format(vibrent_participant_list[0]))

        BaseTestCase.switch_auth_user('example@care.com', 'careevolution')
        # Change the provider link for a vibrent participant
        participant_id = participant['participantId']
        path = "Participant/%s" % participant_id
        # carevo can not update
        self.send_put(path, participant, headers={"If-Match": 'W/"1"'}, expected_status=http.client.BAD_REQUEST)

        # get carevo participant
        participant_id = carevo_participant_list[0]
        path = "Participant/%s" % participant_id
        # carevo can update
        self.send_put(path, participant, headers={"If-Match": 'W/"1"'})

        # test hpro can get all participants
        BaseTestCase.switch_auth_user('example@hpro.com', 'healthpro')
        vibrent_participant_list.extend(carevo_participant_list)
        self.assertEqual(len(vibrent_participant_list), 6)
        for i in vibrent_participant_list:
            self.send_get("Participant/{}".format(i))

    def test_cannot_get_summary(self):
        BaseTestCase.switch_auth_user('example@spellman.com', 'vibrent')
        participant_id = 22
        self.dao.insert(Participant(participantId=participant_id, biobankId=2))
        refetched = self.dao.get(participant_id)
        self.summary_dao.insert(self.participant_summary(refetched))

        BaseTestCase.switch_auth_user('example@care.com', 'careevolution')
        # we dont return bad request for participant summary, we filter by participant origin
        response = self.send_get("ParticipantSummary?participantId={}".format(participant_id))
        self.assertEqual(len(response['entry']), 1)

        BaseTestCase.switch_auth_user('example@spellman.com', 'vibrent')
        response = self.send_get("ParticipantSummary?participantId={}".format(participant_id))
        self.assertEqual(len(response['entry']), 1)

    def test_update_hpro_can_edit(self):
        BaseTestCase.switch_auth_user('example@care.com', 'careevolution')
        response = self.send_post("Participant", self.participant)

        # Change the provider link for the participant
        participant_id = response["participantId"]
        response["providerLink"] = [self.provider_link_2]
        path = "Participant/%s" % participant_id
        BaseTestCase.switch_auth_user('example@spellman.com', 'hpro')
        self.send_put(path, response, headers={"If-Match": 'W/"1"'})

    def participant_generator(self, num):
        for _ in range(num):
            res = self.send_post("Participant", self.participant)
            yield res


text:
package apollo.gui.event;

import java.util.EventListener;
import apollo.gui.event.ReverseComplementEvent;

public interface ReverseComplementListener extends EventListener {

  public boolean handleReverseComplementEvent(ReverseComplementEvent evt);

}


text:
<!DOCTYPE html>

    <meta charset="UTF-8" />
    <meta name="robots" content="index, follow, all" />
    <title>Patterns\Traits | Patterns</title>

            <link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
        <link rel="stylesheet" type="text/css" href="../css/bootstrap-theme.min.css">
        <link rel="stylesheet" type="text/css" href="../css/sami.css">

        <meta name="MobileOptimized" content="width">
        <meta name="HandheldFriendly" content="true">
        <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">

                <form id="search-form" action="../search.html" method="GET">

            <input name="search"
                   class="typeahead form-control"
                   type="search"
                   placeholder="Search">
        </form>

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-elements">
                    Toggle navigation

                </button>
                Patterns

Classes

Namespaces

Interfaces

Traits

Index

Search

Namespace

Patterns

Traits

Patterns\Traits

Classes

                                            Patterns\Traits\AccessibleTrait

                    Magic properties accessors

                                            Patterns\Traits\OptionableTrait

                    This trait is the exact copy of the \Patterns\Abstracts\AbstractOptionable class.

                                            Patterns\Traits\SingletonTrait

                    Basic singleton object definition

                                            Patterns\Traits\TemplateViewTrait

                    This trait is the exact copy of the \Patterns\Abstracts\AbstractView class.

        Generated by Sami, the API Documentation Generator.


text:
import time
from nep import*
import signal
import sys
import datetime as dt

def time_diference(str_t1,str_t2):

    try:
        y = dt.datetime.strptime(str_t1, "%Y-%m-%d %H:%M:%S.%f")
    except:
        y = dt.datetime.strptime(str_t1, "%Y-%m-%d %H:%M:%S")

    try:
        x = dt.datetime.strptime(str_t2, "%Y-%m-%d %H:%M:%S.%f")
    except:
        x = dt.datetime.strptime(str_t2, "%Y-%m-%d %H:%M:%S")

    diff_h = abs(x.hour - y.hour)
    diff_min = abs(x.minute - y.minute)
    diff_sec = abs(x.second - y.second)
    diff_micro = abs(x.microsecond - y.microsecond)

    print str(diff_h) + ":" +  str(diff_min) + ":" + str(diff_sec) + "." + str(diff_micro)

def signal_handler(signal, frame):
    """Signal handler used to close the app"""
    msg = {'trigger':2}
    pub.send_info(msg)
    print('Signal Handler, you pressed Ctrl+C!')
    print('Exit in 2 seconds...')
    time.sleep(2)
    sys.exit()

# New signal handler
signal.signal(signal.SIGINT, signal_handler)

lan = launcher()
lan.launch("camera1.py")
lan.launch("camera2.py")
lan.launch("ATM_node.py")

time.sleep(5)
y = raw_input("Press ENTER to start comunication")
print ("....")

pub = publisher("/trigger", True)
##sub1 = subscriber("/force_plate", False)
sub1 = subscriber("/camera1", False)
sub2 = subscriber("/camera2", False)
sub3 = subscriber("/force_plate", False)

# Test comunication, not change ----
msg = {'trigger':3}
pub.send_info(msg)
time.sleep(.2)
pub.send_info(msg)
time.sleep(.2)
pub.send_info(msg)
# ----------------------------------

y = raw_input("Press ENTER to start acquisition")

msg = {'trigger':0}
pub.send_info(msg)
start = time.time()

while True:

    success1, info1 = sub1.listen_info(True)
    if success1:
        end = time.time()
        #print(end - start)
        start = time.time()
        time.sleep(.01)
        camera1_time = str(info1['time'])
        pub.send_info(msg)

    success2, info2 = sub2.listen_info(False)
    if success2:
        start = time.time()
        camera2_time = str(info2['time'])

    success3, info3 = sub3.listen_info(False)
    if success3:
        force_time = str(info3['time'])

    if(success1 and success2):
        print "cameras:"
        time_diference(camera1_time,camera2_time)

    if(success1 and success3):
        print "force:"
        time_diference(camera1_time,force_time)


text:
package com.remyoukaour.spectrogram;

import java.io.ByteArrayInputStream;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioInputStream;

public abstract class SampledData {
	private static final int BUFFERED_SAMPLES = 2048;

	public abstract int size();
	public abstract double get(int i);
	public abstract double[] get(int start, int length);

	public AudioInputStream toStream(int hertz) {
		AudioFormat format = new AudioFormat(hertz, 16, 1, true, true);
		int n = size();
		byte[] data = new byte[n * 2];
		int off = 0;
		for (int i = 0; i < n; i += BUFFERED_SAMPLES) {
			double[] buffer = get(i, BUFFERED_SAMPLES);
			for (int j = 0; j < BUFFERED_SAMPLES && i + j < n; j++, off += 2) {
				double v = buffer[j] * 32768.0;
				short s = v > Short.MAX_VALUE ? Short.MAX_VALUE :
						v < Short.MIN_VALUE ? Short.MIN_VALUE : (short)v;
				ByteUtils.shortToBytes(s, true, data, off);
			}
		}
		return new AudioInputStream(new ByteArrayInputStream(data), format, n);
	}
}


text:
import { Representation } from "../../../../manifest";
import filterByBitrate from "../filter_by_bitrate";

describe("ABR - filterByBitrate", () => {
  const fakeReps = [
    { bitrate : 100 },
    { bitrate : 100 },
    { bitrate : 1000 },
    { bitrate : 10000 },
    { bitrate : 100000 },
  ];

  describe("filterByBitrate", () => {
    it("should return no Representation if no Representation was specified", () => {
      expect(filterByBitrate([], Infinity))
        .toEqual([]);
    });

    it("should return all representations when specified bitrate is infinite", () => {
      expect(filterByBitrate(fakeReps as Representation[], Infinity))
        .toEqual(fakeReps);
    });

    it("should return the lowest representation when specified bitrate is 0", () => {
      const expectedFilteredReps = [ { bitrate : 100 },
                                     { bitrate : 100 } ];
      expect(filterByBitrate(fakeReps as Representation[], 0))
        .toEqual(expectedFilteredReps);
    });

    it("should filter representation when specified bitrate is 999", () => {
      const expectedFilteredReps = [ { bitrate : 100 },
                                     { bitrate : 100 },
                                     { bitrate : 1000 } ];
      expect(filterByBitrate(fakeReps as Representation[], 1010))
        .toEqual(expectedFilteredReps);
    });
  });

});