text:
package com.fragmobile;

import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.BottomNavigationView;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.telephony.TelephonyManager;
import android.view.MenuItem;

import com.fragmobile.container.ContainerFragAction;
import com.fragmobile.data.manager.FragDataAdapter;
import com.fragmobile.database.manager.FragDataBaseManager;
import com.fragmobile.engine.msg.FragMobileMessage;
import com.fragmobile.engine.util.ContainerFragResource;

/**
 *
 */
public class MainActivity extends AppCompatActivity {

    /**
     *
     */
    private         TelephonyManager        telephonyManagerReference;

    /**
     *
     */
    private         Context                 mContext;
    /**
     *
     */
    private static  boolean                 warningUserVerified;

    /**
     *
     */
    private static  boolean                 openFragMobile = false;

    /**
     *
     */
    private BottomNavigationView            navigation;

    /**
     *
     */
    private FragDataBaseManager             fragDataBaseManagerRefer;

    /**
     *
     */
    private boolean                         createdDefault;

    /**
     *
     */
    AppCompatActivity                       internalRefer;

    /**
     *
     */
    public MainActivity () {
        this.fragDataBaseManagerRefer   = new FragDataBaseManager(this);
        this.internalRefer              = this;
    }

    /**
     *
     */
    private BottomNavigationView.OnNavigationItemSelectedListener mOnNavigationItemSelectedListener
            = new BottomNavigationView.OnNavigationItemSelectedListener() {
        @Override
        public boolean onNavigationItemSelected(@NonNull MenuItem item) {
            switch (item.getItemId()) {
                case R.id.navigation_home:
                    final  int  codTitleActivityHome =   R.string.app_name;
                    String      strTitleHome         =   getString(codTitleActivityHome);
                    setTitle(strTitleHome);
                    ContainerFragAction.showHomeScreen(internalRefer);
                    return true;
                case R.id.navigation_dashboard:
                    final  int  codTitleActivity    =   R.string.title_activity_cad_user;
                    String      strTitle            =   getString(codTitleActivity);
                    setTitle(strTitle);
                    ContainerFragResource.setRequestHome_Frag(true);
                    ContainerFragAction.showCadScreen(internalRefer);
                    return true;
                case R.id.navigation_notifications:
                    final int codTitleListFragActivity  =   R.string.title_activity_frag_list;
                    String    strListFrag               =   getString(codTitleListFragActivity);
                    setTitle(strListFrag);
                    ContainerFragAction.showFrag(internalRefer);
                    return true;
            }
            return false;
        }

    };

    /**
     *
     * @param savedInstanceState
     */
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ContainerFragResource.setFragDataAdapter(new FragDataAdapter(this));
        setContentView(R.layout.activity_main);

        this.loaderDataBase();

        FragmentManager fragmentManager = this.getSupportFragmentManager();
        ContainerFragAction.setFragManager(fragmentManager);

        this.navigation = (BottomNavigationView) findViewById(R.id.navigation);
        this.navigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener);
        this.mContext   =   this.getApplicationContext();
        ContainerFragResource.putBottomNavigationView(this.navigation);

        if (!MainActivity.openFragMobile) {
            this.runResource();
            MainActivity.openFragMobile = true;
        }

        this.fragDataBaseManagerRefer.createOrOpenDataBase();
        ContainerFragResource.setReferFragDataBaseManager(this.fragDataBaseManagerRefer);
        ContainerFragResource.viewListFragBean();
    }

    /**
     *
     */
    private void userVer () {
        boolean boolFragSysDefaultCad   =   ContainerFragResource.isFragSysDefaultCurrentCad();
        boolean cadUserOK               =   ContainerFragResource.isFragCadUser();

        if (boolFragSysDefaultCad) {
            if(cadUserOK) {
                if (ContainerFragResource.isFragSysDefaultCurrentCad()) {
                    int codStrWarningCadUserDefault = R.string.warning_cad_user_default;
                    String strMsg =
                            this.getString(codStrWarningCadUserDefault);
                    FragMobileMessage.showMessageWarning(this, strMsg);
                    ContainerFragResource.setFragSysDefaultIsCurrentCad(false);
                }
            }
        } else {
            if (!cadUserOK) {
                if (!this.warningUserVerified) {
                    this.msgInputUser();
                    MainActivity.warningUserVerified = true;
                }
            }
        }

    }
    /**
     *
     */
    @Override
    protected void onStart() {
        super.onStart();
        ContainerFragResource.setActivityMain(this);
        ContainerFragAction.showHomeScreen(this);
        //VERIFICAR SE JÁ É USUARIO
        this.userVer();
        ContainerFragResource.processStateHome(this.navigation);
    }

    /**
     *
     */
    @Override
    protected void onStop() {
        super.onStop();
    }

    /**
     *
     */
    private void toAssignTelephonyManagerinApp () {
        this.telephonyManagerReference =
                (TelephonyManager) this.mContext.getSystemService(Context.TELEPHONY_SERVICE);
    }

    /**
     *
     * @return
     */
    private final String getIMEI () {
        final String IMEI_RETURN = this.telephonyManagerReference.getDeviceId();
        return IMEI_RETURN;
    }

    /**
     *
     */
    private void runResource () {
        this.mContext                =   this.getApplicationContext();
        this.warningUserVerified     =   false;
        this.toAssignTelephonyManagerinApp();

        //Carga de Recursos
        ContainerFragResource.setResourceIDDevice(this.getIMEI());
    }

    /**
     *
     */
    private void loaderDataBase () {

        this.fragDataBaseManagerRefer.openUserCad();
       /* FragRowItem fragRowItem1 = new FragRowItem("Teste1");
        FragRowItem fragRowItem2 = new FragRowItem("Teste2");

        FragRowItem fragRowItem3 = new FragRowItem("Teste3");
        FragRowItem fragRowItem4 = new FragRowItem("Teste4");

        FragRowItem fragRowItem5 = new FragRowItem("Teste5");
        FragRowItem fragRowItem6 = new FragRowItem("Teste6");

        FragRowItem fragRowItem7 = new FragRowItem("Teste7");
        FragRowItem fragRowItem8 = new FragRowItem("Teste8");

        FragRowItem fragRowItem9 = new FragRowItem("Teste9");
        FragRowItem fragRowItem10 = new FragRowItem("Teste10");

        FragRowItem fragRowItem11 = new FragRowItem("Teste11");
        FragRowItem fragRowItem12 = new FragRowItem("Teste12");

        FragRowItem fragRowItem13 = new FragRowItem("Teste13");
        FragRowItem fragRowItem14 = new FragRowItem("Teste14");

        List<FragRowItem> listItem = new ArrayList<FragRowItem>();
        listItem.add(fragRowItem1);
        listItem.add(fragRowItem2);

        listItem.add(fragRowItem3);
        listItem.add(fragRowItem4);

        listItem.add(fragRowItem5);
        listItem.add(fragRowItem6);

        listItem.add(fragRowItem7);
        listItem.add(fragRowItem8);

        listItem.add(fragRowItem9);
        listItem.add(fragRowItem10);

        listItem.add(fragRowItem11);
        listItem.add(fragRowItem12);

        listItem.add(fragRowItem13);
        listItem.add(fragRowItem14);

        ContainerFragResource.putListFragRowItem(listItem);*/
    }
    /**
     *
     */
    private final void msgInputUser () {
        final int                   codTitle    =   R.string.title_app_msg_input_user;
        final int                   codMsg      =   R.string.app_msg_input_user;
        final int                   codBtOk     =   R.string.bt_yes_msg_input_user;
        final int                   codBtNo     =   R.string.bt_no_msg_input_user;
        final String                title       =   this.getApplication().getString(codTitle);
        final String                msg         =   this.getApplication().getString(codMsg);
        final String                btOk        =   this.getApplication().getString(codBtOk);
        final String                btNo        =   this.getApplication().getString(codBtNo);
        final MainActivity          refer       =   this;

        AlertDialog.Builder alertDialogInputUser = new AlertDialog.Builder(this);
        alertDialogInputUser.setTitle(title);
        alertDialogInputUser.setMessage(msg);

        alertDialogInputUser.setPositiveButton(btOk,new DialogInterface.OnClickListener(){
            @Override
            public void onClick(DialogInterface dialog, int which) {
                final  int  codTitleActivity    =   R.string.title_activity_cad_user;
                String      strTitle            =   getString(codTitleActivity);
                ContainerFragAction.showCadScreen(internalRefer);
                setTitle(strTitle);
                navigation.setSelectedItemId(R.id.navigation_dashboard);
                dialog.dismiss();
            }
        });

        alertDialogInputUser.setNegativeButton(btNo,new DialogInterface.OnClickListener(){
            @Override
            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
            }
        });

        AlertDialog alert = alertDialogInputUser.create();
        alert.show();
    }

    @Override
    public void onDestroy () {
        super.onDestroy();
    }
}


text:
<?php

namespace Propel\Tests\Common\Config\Loader;

use Propel\Common\Config\Loader\IniFileLoader;
use Propel\Common\Config\FileLocator;
use Propel\Tests\Common\Config\ConfigTestCase;

class IniFileLoaderTest extends ConfigTestCase
{
    protected $loader;

    protected function setUp()
    {
        $this->loader = new IniFileLoader(new FileLocator(sys_get_temp_dir()));
    }

    public function testSupports()
    {
        $this->assertTrue($this->loader->supports('foo.ini'), '->supports() returns true if the resource is loadable');
        $this->assertTrue($this->loader->supports('foo.properties'), '->supports() returns true if the resource is loadable');
        $this->assertTrue($this->loader->supports('foo.ini.dist'), '->supports() returns true if the resource is loadable');
        $this->assertTrue($this->loader->supports('foo.properties.dist'), '->supports() returns true if the resource is loadable');
        $this->assertFalse($this->loader->supports('foo.foo'), '->supports() returns true if the resource is loadable');
        $this->assertFalse($this->loader->supports('foo.foo.dist'), '->supports() returns true if the resource is loadable');
    }

    public function testIniFileCanBeLoaded()
    {
        $content = <<<EOF
;test ini
foo = bar
bar = baz
EOF;
        $this->dumpTempFile('parameters.ini', $content);

        $test = $this->loader->load('parameters.ini');
        $this->assertEquals('bar', $test['foo']);
        $this->assertEquals('baz', $test['bar']);
    }

    /**
     * @expectedException        \InvalidArgumentException
     * @expectedExceptionMessage The file "inexistent.ini" does not exist (in:
     */
    public function testIniFileDoesNotExist()
    {
        $this->loader->load('inexistent.ini');
    }

    /**
     * @expectedException        Propel\Common\Config\Exception\InvalidArgumentException
     * @expectedExceptionMessage The configuration file 'nonvalid.ini' has invalid content.
     */
    public function testIniFileHasInvalidContent()
    {
        $content = <<<EOF
{not ini content}
only plain
text
EOF;
        $this->dumpTempFile('nonvalid.ini', $content);

        @$this->loader->load('nonvalid.ini');
    }

    public function testIniFileIsEmpty()
    {
        $content = '';
        $this->dumpTempFile('empty.ini', $content);

        $actual = $this->loader->load('empty.ini');

        $this->assertEquals(array(), $actual);
    }

    public function testWithSections()
    {
        $content = <<<EOF
[Cartoons]
Dog          = Pluto
Donald[]     = Huey
Donald[]     = Dewey
Donald[]     = Louie
Mickey[love] = Minnie
EOF;
        $this->dumpTempFile('section.ini', $content);
        $actual = $this->loader->load('section.ini');

        $this->assertEquals('Pluto', $actual['Cartoons']['Dog']);
        $this->assertEquals('Huey', $actual['Cartoons']['Donald'][0]);
        $this->assertEquals('Dewey', $actual['Cartoons']['Donald'][1]);
        $this->assertEquals('Louie', $actual['Cartoons']['Donald'][2]);
        $this->assertEquals('Minnie', $actual['Cartoons']['Mickey']['love']);
    }

    public function testNestedSections()
    {
        $content = <<<EOF
foo.bar.baz   = foobar
foo.bar.babaz = foobabar
bla.foo       = blafoo
bla.bar       = blabar
EOF;
        $this->dumpTempFile('nested.ini', $content);
        $actual = $this->loader->load('nested.ini');

        $this->assertEquals('foobar', $actual['foo']['bar']['baz']);
        $this->assertEquals('foobabar', $actual['foo']['bar']['babaz']);
        $this->assertEquals('blafoo', $actual['bla']['foo']);
        $this->assertEquals('blabar', $actual['bla']['bar']);
    }

    public function testMixedNestedSections()
    {
        $content = <<<EOF
bla.foo.bar = foobar
bla.foobar[] = foobarArray
bla.foo.baz[] = foobaz1
bla.foo.baz[] = foobaz2

EOF;
        $this->dumpTempFile('mixnested.ini', $content);
        $actual = $this->loader->load('mixnested.ini');

        $this->assertEquals('foobar', $actual['bla']['foo']['bar']);
        $this->assertEquals('foobarArray', $actual['bla']['foobar'][0]);
        $this->assertEquals('foobaz1', $actual['bla']['foo']['baz'][0]);
        $this->assertEquals('foobaz2', $actual['bla']['foo']['baz'][1]);
    }

    /**
     * @expectedException Propel\Common\Config\Exception\InputOutputException
     * @expectedMessage You don't have permissions to access configuration file notreadable.ini.
     */
    public function testIniFileNotReadableThrowsException()
    {
        $content = <<<EOF
foo = bar
bar = baz
EOF;

        $this->dumpTempFile('notreadable.ini', $content);
        $this->getFilesystem()->chmod(sys_get_temp_dir() . '/notreadable.ini', 0200);

        $actual = $this->loader->load('notreadable.ini');
        $this->assertEquals('bar', $actual['foo']);
        $this->assertEquals('baz', $actual['bar']);

    }
}

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Linq;
using Microsoft.SharePoint;

namespace TITcs.SharePoint.SSOM.Utils
{
    public static class FeatureUtils
    {
        /// <summary>
        /// SharePoint Server Publishing Infrastructure
        /// </summary>
        /// <param name="site">SPSite</param>
        public static void ActivePublishInfrastructure(SPSite site)
        {
            Active(site, "f6924d36-2fa8-4f0b-b16d-06b7250180fa");
        }

        /// <summary>
        /// SharePoint Server Publishing
        /// </summary>
        /// <param name="site"></param>
        /// <param name="allWebsites"></param>
        public static void ActivePublishing(SPSite site, bool allWebsites = false)
        {
            ActivePublishInfrastructure(site);//Pré-requisito

            var guid = "94c94ca6-b32f-4da9-a9e3-1f3d343d7ecb";

            Active(site, guid);

            if (allWebsites)
                foreach (SPWeb web in site.AllWebs)
                {
                    Active(web, guid);
                }
        }

        public static void Active(SPSite site, string guid)
        {
            Guid gui = new Guid(guid);

            if (site.Features.Cast<SPFeature>().Any(f => f.DefinitionId == gui))
                site.Features.Add(gui, true);
        }

        public static void Active(SPWeb web, string guid)
        {
            Guid gui = new Guid(guid);

            if (web.Features.Cast<SPFeature>().Any(f => f.DefinitionId == gui))
                web.Features.Add(gui, true);
        }
    }
}


text:
@interface DKBackgroundStyleForwarderView : NSView

@end


text:
<resources>
    <string name="app_name">Week2_NYTimeSearch</string>
    <string name="action_settings">Settings</string>
    <string name="hint">Enter search query</string>
    <string name="search">Search</string>
    <string name="title_activity_article">Article</string>
    <string name="title_activity_setting">Setting</string>
    <string name="saveSetting">Save</string>
</resources>


text:
SpecBegin(JGHViewController)

describe(@"alertButton", ^{

    it(@"shows alert which can be dismissed", ^{
        // press "Show Alert" button
        [tester tapViewWithAccessibilityLabel:@"Show Alert"];

        // verify that the alert is shown
        [tester waitForTappableViewWithAccessibilityLabel:@"Alert"];

        // dismiss alert
        [tester tapViewWithAccessibilityLabel:@"Dismiss"];
    });
});

SpecEnd


text:
#ifndef BOOST_POLYGON_SORT_ADAPTOR_HPP
#define BOOST_POLYGON_SORT_ADAPTOR_HPP
#ifdef __ICC
#pragma warning(disable:2022)
#pragma warning(disable:2023)
#endif

#include <algorithm>

//! @brief polygon_sort_adaptor default implementation that calls std::sort
namespace pdalboost {} namespace boost = pdalboost; namespace pdalboost {
  namespace polygon {

    template<typename iterator_type>
    struct dummy_to_delay_instantiation{
      typedef int unit_type; // default GTL unit
    };

    //! @brief polygon_sort_adaptor default implementation that calls std::sort
    template<typename T>
    struct polygon_sort_adaptor {
      //! @brief wrapper that mimics std::sort() function and takes
      // the same arguments
      template<typename RandomAccessIterator_Type>
      static void sort(RandomAccessIterator_Type _First,
                       RandomAccessIterator_Type _Last)
      {
         std::sort(_First, _Last);
      }
      //! @brief wrapper that mimics std::sort() function overload and takes
      // the same arguments
      template<typename RandomAccessIterator_Type, typename Pred_Type>
      static void sort(RandomAccessIterator_Type _First,
                       RandomAccessIterator_Type _Last,
                       const Pred_Type& _Comp)
      {
         std::sort(_First, _Last, _Comp);
      }
    };

    //! @brief user level wrapper for sorting quantities
    template <typename iter_type>
    void polygon_sort(iter_type _b_, iter_type _e_)
    {
      polygon_sort_adaptor<typename dummy_to_delay_instantiation<iter_type>::unit_type>::sort(_b_, _e_);
    }

    //! @brief user level wrapper for sorting quantities that takes predicate
    // as additional argument
    template <typename iter_type, typename pred_type>
    void polygon_sort(iter_type _b_, iter_type _e_, const pred_type& _pred_)
    {
      polygon_sort_adaptor<typename dummy_to_delay_instantiation<iter_type>::unit_type>::sort(_b_, _e_, _pred_);
    }

  } // namespace polygon
}   // namespace pdalboost
#endif


text:
layout: post
title: "Hello World"
subtitle: "So Cliche."
header-img: "post-bg-05.jpg"
tag: nonsense
collection: "Nonsense"
collection-url: "/nonsense"
credit: "https://github.com/IronSummitMedia/startbootstrap-clean-blog-jekyll/tree/gh-pages/img"
---

I've never really been into blogs. I certainly never thought I'd actually write one. Lately it has felt like it would probably be a good idea to put some of my thoughts into a format that I can keep and share. I guess that I'm doing this because I want to start having projects in my life again.

The last few years have been crazy and tough and I never found time for me. Now I'm going to do the things that I want to do, and blog about whatever I feel like blogging about.

Join me on a quest to find myself or something.

Finding myself isn't as cool as Adventure Time though.


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>Specification for Topiarist functions</title>

	<link rel="shortcut icon" type="image/png" href="jasmine-1.3.0/jasmine_favicon.png">

	<link rel="stylesheet" type="text/css" href="jasmine-1.3.0/jasmine.css">
	<script type="text/javascript" src="jasmine-1.3.0/jasmine.js"></script>
	<script type="text/javascript" src="jasmine-1.3.0/jasmine-html.js"></script>

	<!--[if lt IE 9]>
	<script type="text/javascript" src="es3-compatibility/es5-shim.js"></script>
	<![endif]-->

	<!-- source files here... -->
	<script type="text/javascript" src="../lib/topiarist.js"></script>

	<!-- test helper files here... -->

	<!-- spec files here... -->
	<script type="text/javascript" src="ExtendSpec.js"></script>
	<script type="text/javascript" src="ImplementSpec.js"></script>
	<script type="text/javascript" src="ClassIsASpec.js"></script>
	<script type="text/javascript" src="IsASpec.js"></script>
	<script type="text/javascript" src="FulfillsSpec.js"></script>
	<script type="text/javascript" src="ClassFulfillsSpec.js"></script>
	<script type="text/javascript" src="MixinSpec.js"></script>
	<script type="text/javascript" src="InheritSpec.js"></script>

	<script type="text/javascript">
		(function() {
			var jasmineEnv = jasmine.getEnv();
			jasmineEnv.updateInterval = 1000;

			var htmlReporter = new jasmine.HtmlReporter();

			jasmineEnv.addReporter(htmlReporter);

			jasmineEnv.specFilter = function(spec) {
				return htmlReporter.specFilter(spec);
			};

			var currentWindowOnload = window.onload;

			window.onload = function() {
				if (currentWindowOnload) {
					currentWindowOnload();
				}
				execJasmine();
			};

			function execJasmine() {
				jasmineEnv.execute();
			}

		})();
	</script>

</head>

<body>
</body>
</html>


text:
Story-Size-Dist
=========================

## Overview
This app creates a histogram showing a count of Stories versus Story Size (PlanEstimate).

![Story-Size-Dist](https://raw2.github.com/markwilliams970/Story-Size-Distribution/master/image/story-size-dist.png)

## License

AppTemplate is released under the MIT license.  See the file [LICENSE](https://raw.github.com/RallyApps/AppTemplate/master/LICENSE) for the full text.


text:
class QPushButton;

class EditorButtonFactory : public QWidget
{
public:
    EditorButtonFactory(QWidget *parent = 0);
    ~EditorButtonFactory();

    /// Takes ownership of the created button.
    QPushButton* AddButton(const QString &objectName, const QString &text);

private:
    QList<QPushButton*> buttons;
};


text:
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using WiimoteLib;
using WiimoteLib.DataTypes;

namespace WiimoteTest
{
	public partial class MultipleWiimoteForm : Form
	{
		// map a wiimote to a specific state user control dealie
		Dictionary<Guid,WiimoteInfo> mWiimoteMap = new Dictionary<Guid,WiimoteInfo>();
		WiimoteCollection mWC;

		public MultipleWiimoteForm()
		{
			InitializeComponent();
		}

		private void MultipleWiimoteForm_Load(object sender, EventArgs e)
		{
			// find all wiimotes connected to the system
			mWC = new WiimoteCollection();
			int index = 1;

			try
			{
				mWC.FindAllWiimotes();
			}
			catch(WiimoteNotFoundException ex)
			{
				MessageBox.Show(ex.Message, "Wiimote not found error", MessageBoxButtons.OK, MessageBoxIcon.Error);
			}
			catch(WiimoteException ex)
			{
				MessageBox.Show(ex.Message, "Wiimote error", MessageBoxButtons.OK, MessageBoxIcon.Error);
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.Message, "Unknown error", MessageBoxButtons.OK, MessageBoxIcon.Error);
			}

			foreach(Wiimote wm in mWC)
			{
				// create a new tab
				TabPage tp = new TabPage("Wiimote " + index);
				tabWiimotes.TabPages.Add(tp);

				// create a new user control
				WiimoteInfo wi = new WiimoteInfo(wm);
				tp.Controls.Add(wi);

				// setup the map from this wiimote's ID to that control
				mWiimoteMap[wm.ID] = wi;

				// connect it and set it up as always
				wm.WiimoteChanged += wm_WiimoteChanged;
				wm.WiimoteExtensionChanged += wm_WiimoteExtensionChanged;

				wm.Connect();
				if(wm.WiimoteState.ExtensionType != ExtensionType.BalanceBoard)
					wm.SetReportType(InputReport.IRExtensionAccel, IRSensitivity.Maximum, true);

				wm.SetLEDs(index++);
			}
		}

		void wm_WiimoteChanged(object sender, WiimoteChangedEventArgs e)
		{
			WiimoteInfo wi = mWiimoteMap[((Wiimote)sender).ID];
			wi.UpdateState(e);
		}

		void wm_WiimoteExtensionChanged(object sender, WiimoteExtensionChangedEventArgs e)
		{
			// find the control for this Wiimote
			WiimoteInfo wi = mWiimoteMap[((Wiimote)sender).ID];
			wi.UpdateExtension(e);

			if(e.Inserted)
				((Wiimote)sender).SetReportType(InputReport.IRExtensionAccel, true);
			else
				((Wiimote)sender).SetReportType(InputReport.IRAccel, true);
		}

		private void MultipleWiimoteForm_FormClosing(object sender, FormClosingEventArgs e)
		{
			foreach(Wiimote wm in mWC)
				wm.Disconnect();
		}
	}
}


text:
<?php

namespace BAS\MainBundle\Project\Phase;

use BAS\MainBundle\Exception\Project\Phase\UnknownPhaseException;
use BAS\MainBundle\Entity\Project as ProjectEntity;
use BAS\MainBundle\Project\Project;

/**
 * As you may guess from namespace and class name the main purpose of the class
 * is to generate instances of Project's Phase
 */
class PhaseFactory
{
    private $phaseEnum = array(
        0   => 'UninitializedPhase'
    );

    /**
     * returns an instance of ProjectPhase
     * @param ProjectEntity $projectEntity
     * @return ProjectPhase
     * @throws UnknownPhaseException
     */
    public function getInstance (ProjectEntity $projectEntity, Project $project)
    {
        $phaseId = $projectEntity->getPhase();
        if (is_null($phaseId)) {
            $phaseId = 0;
        }

        if (!array_key_exists($phaseId, $this->phaseEnum)) {
            throw new UnknownPhaseException(
                'You are trying to create unexisting type of phase'
            );
        }

        $phaseClassName = $this->phaseEnum[$phaseId];

        return $this->getInstanceByName($phaseClassName, $projectEntity, $project);
    }

    /**
     * returns an instance of ProjectPhase by classname of Phase
     * @param string $phaseClassName class name of needed phase
     * @param ProjectEntity $projectEntity
     * @return ProjectPhase
     * @throws UnknownPhaseException
     */
    public function getInstanceByName ($phaseClassName, ProjectEntity $projectEntity, Project $project)
    {
        $phaseClassName = 'BAS\\MainBundle\\Project\\Phase\\'. $phaseClassName;
        return new $phaseClassName($projectEntity, $project, $this);
    }

    /**
     * returns id of requested phase
     * @param string $instanceClassName
     * @return int
     */
    public function getInstanceId($instanceClassName)
    {
        return array_search($instanceClassName, $this->phaseEnum);
    }
}


text:
<?php

/**
* <auto-generated>
*     This code was generated by Codezu.
*
*     Changes to this file may cause incorrect behavior and will be lost if
*     the code is regenerated.
* </auto-generated>
*/

namespace Mozu\Api\Clients\Platform;

use Mozu\Api\MozuClient;
use Mozu\Api\Urls\Platform\ApplicationUrl;

/**
* platform/developer related resources. DOCUMENT_HERE
*/
class ApplicationClient {

	/**
	* platform-developer Get GetAppPackageNames description DOCUMENT_HERE
	*
	* @param string $applicationKey The application key uniquely identifies the developer namespace, application ID, version, and package in Dev Center. The format is {Dev Account namespace}.{Application ID}.{Application Version}.{Package name}.
	* @param string $responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
	* @return MozuClient
	*/
	public static function getAppPackageNamesClient($applicationKey, $responseFields =  null)
	{
		$url = ApplicationUrl::getAppPackageNamesUrl($applicationKey, $responseFields);
		$mozuClient = new MozuClient();
		$mozuClient->withResourceUrl($url);
		return $mozuClient;

	}

	/**
	* platform-developer Get GetAppVersions description DOCUMENT_HERE
	*
	* @param string $nsAndAppId The application key uniquely identifies the developer namespace, application ID, version, and package in Dev Center. The format is {Dev Account namespace}.{Application ID}.{Application Version}.{Package name}.
	* @param string $responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
	* @return MozuClient
	*/
	public static function getAppVersionsClient($nsAndAppId, $responseFields =  null)
	{
		$url = ApplicationUrl::getAppVersionsUrl($nsAndAppId, $responseFields);
		$mozuClient = new MozuClient();
		$mozuClient->withResourceUrl($url);
		return $mozuClient;

	}

	/**
	* platform-developer Get GetPackageFileMetadata description DOCUMENT_HERE
	*
	* @param string $applicationKey The application key uniquely identifies the developer namespace, application ID, version, and package in Dev Center. The format is {Dev Account namespace}.{Application ID}.{Application Version}.{Package name}.
	* @param string $filepath Represents the file name and location.
	* @param string $responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
	* @return MozuClient
	*/
	public static function getPackageFileMetadataClient($applicationKey, $filepath, $responseFields =  null)
	{
		$url = ApplicationUrl::getPackageFileMetadataUrl($applicationKey, $filepath, $responseFields);
		$mozuClient = new MozuClient();
		$mozuClient->withResourceUrl($url);
		return $mozuClient;

	}

	/**
	* platform-developer Get GetPackageMetadata description DOCUMENT_HERE
	*
	* @param string $applicationKey The application key uniquely identifies the developer namespace, application ID, version, and package in Dev Center. The format is {Dev Account namespace}.{Application ID}.{Application Version}.{Package name}.
	* @param string $responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
	* @return MozuClient
	*/
	public static function getPackageMetadataClient($applicationKey, $responseFields =  null)
	{
		$url = ApplicationUrl::getPackageMetadataUrl($applicationKey, $responseFields);
		$mozuClient = new MozuClient();
		$mozuClient->withResourceUrl($url);
		return $mozuClient;

	}

	/**
	* platform-developer Post UpsertPackageFile description DOCUMENT_HERE
	*
	* @param string $applicationKey The application key uniquely identifies the developer namespace, application ID, version, and package in Dev Center. The format is {Dev Account namespace}.{Application ID}.{Application Version}.{Package name}.
	* @param string $filepath The application key uniquely identifies the developer namespace, application ID, version, and package in Dev Center. The format is {Dev Account namespace}.{Application ID}.{Application Version}.{Package name}.
	* @param string $lastModifiedTime The date and time of the last file insert or update. This parameter is optional.
	* @param string $responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
	* @param Stream $stream Data stream that delivers information. Used to input and output data.
	* @return MozuClient
	*/
	public static function upsertPackageFileClient($stream, $applicationKey, $filepath, $lastModifiedTime =  null, $responseFields =  null, $contentType= null)
	{
		$url = ApplicationUrl::upsertPackageFileUrl($applicationKey, $filepath, $lastModifiedTime, $responseFields);
		$mozuClient = new MozuClient();
		$mozuClient->withResourceUrl($url)->withStreamBody($stream)->withHeader(Headers::CONTENT_TYPE ,$contentType);
		return $mozuClient;

	}

	/**
	* platform-developer Post RenamePackageFile description DOCUMENT_HERE
	*
	* @param string $applicationKey The application key uniquely identifies the developer namespace, application ID, version, and package in Dev Center. The format is {Dev Account namespace}.{Application ID}.{Application Version}.{Package name}.
	* @param string $responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
	* @param RenameInfo $renameInfo Information required to update the name of a file in a package, which consists of the original name and the new name.
	* @return MozuClient
	*/
	public static function renamePackageFileClient($renameInfo, $applicationKey, $responseFields =  null)
	{
		$url = ApplicationUrl::renamePackageFileUrl($applicationKey, $responseFields);
		$mozuClient = new MozuClient();
		$mozuClient->withResourceUrl($url)->withBody($renameInfo);
		return $mozuClient;

	}

	/**
	* platform-developer Delete DeletePackageFile description DOCUMENT_HERE
	*
	* @param string $applicationKey The application key uniquely identifies the developer namespace, application ID, version, and package in Dev Center. The format is {Dev Account namespace}.{Application ID}.{Application Version}.{Package name}.
	* @param string $filepath Represents the file name and location.
	*/
	public static function deletePackageFileClient($applicationKey, $filepath)
	{
		$url = ApplicationUrl::deletePackageFileUrl($applicationKey, $filepath);
		$mozuClient = new MozuClient();
		$mozuClient->withResourceUrl($url);
		return $mozuClient;

	}

}

?>


text:
namespace theia {

// The type of matching to perform.
enum class MatchingStrategy {
  BRUTE_FORCE = 0,
  CASCADE_HASHING = 1,
};

// A factory method for creating an L2-based feature matcher (i.e. for float
// descriptors).
std::unique_ptr<FeatureMatcher<L2> > CreateFeatureMatcher(
    const MatchingStrategy& matching_strategy);

}  // namespace theia

#endif  // THEIA_MATCHING_CREATE_FEATURE_MATCHER_H_


text:
typedef enum direction {
  DIR_UP,
  DIR_RIGHT,
  DIR_DOWN,
  DIR_LEFT,
  DIR_UNKNOWN
} direction;

typedef void (*game_draw_cell_cb)(tile *tile);

void game_init(game_draw_cell_cb draw_cell);

void game_add_random_tile(void);

bool game_is_finsihed(void);

void game_move(direction direction);

bool game_won(void);

bool game_moved(void);

void game_draw(void);

unsigned int game_score(void);

unsigned int game_best_score(void);

void game_dump(void);


text:
.class Lcom/mediatek/gallery3d/mav/MAVView$1$1;
.super Ljava/lang/Object;
.source "MAVView.java"

# interfaces
.implements Ljava/lang/Runnable;

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/mediatek/gallery3d/mav/MAVView$1;->run()V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$1:Lcom/mediatek/gallery3d/mav/MAVView$1;

.field final synthetic val$scrollX:I

# direct methods
.method constructor <init>(Lcom/mediatek/gallery3d/mav/MAVView$1;I)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 465
    iput-object p1, p0, Lcom/mediatek/gallery3d/mav/MAVView$1$1;->this$1:Lcom/mediatek/gallery3d/mav/MAVView$1;

    iput p2, p0, Lcom/mediatek/gallery3d/mav/MAVView$1$1;->val$scrollX:I

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public run()V
    .locals 2

    .prologue
    .line 468
    iget-object v0, p0, Lcom/mediatek/gallery3d/mav/MAVView$1$1;->this$1:Lcom/mediatek/gallery3d/mav/MAVView$1;

    iget-object v0, v0, Lcom/mediatek/gallery3d/mav/MAVView$1;->this$0:Lcom/mediatek/gallery3d/mav/MAVView;

    iget v1, p0, Lcom/mediatek/gallery3d/mav/MAVView$1$1;->val$scrollX:I

    #calls: Lcom/mediatek/gallery3d/mav/MAVView;->scrollDeltaDistance(I)V
    invoke-static {v0, v1}, Lcom/mediatek/gallery3d/mav/MAVView;->access$400(Lcom/mediatek/gallery3d/mav/MAVView;I)V

    .line 469
    return-void
.end method


text:
package com.pipipark.commons.business;

import java.util.HashSet;
import java.util.Set;

/**
 * 业务系统扫描包路径.
 * @version 1.0
 * @author 陈文杰
联系邮箱

 * @since 2017年5月16日
 */
class BusinessScanPackage {

	private Set<String> url;

	public BusinessScanPackage(){
		url = new HashSet<String>();
	}

	public void add(String url){
		if(this.url.contains(url)){
			return;
		}
		this.url.add(url);
	}
	public Set<String> get(){
		return this.url;
	}
}


text:
/*
 *  all.js
 *
 *  David Janes
 *  IOTDB.org
 *  2016-07-24
 */

const transporter = require("../transporter");
const _ = require("iotdb")._;

const testers = require("iotdb-transport").testers;

const transport = transporter.make();
testers.put(transport, { id: "ThingA" });
testers.put(transport, { id: "ThingB" });
testers.put(transport, { id: "ThingB", band: "istate" });
testers.put(transport, { id: "ThingB", band: "ostate" });
testers.all(transport);


text:
#ifndef HMAC_SHA1_
#define HMAC_SHA1_

typedef enum {
    ALG_HMAC_MD5,
    ALG_HMAC_SHA1_160
} alg_hmac_md_e;

/**
 * \brief Calculate HMAC-SHA1-160 or HMAC-MD5
 *
 *  Calculate HMAC-SHA1-160 or HMAC-MD5
 *
 * \param md message digest algorithm
 * \param key pointer to key
 * \param key_len key length
 * \param data pointer to data
 * \param data_len data length
 * \param result pointer to result
 * \param result_len in bytes, maximum is 20 bytes
 *
 * \return < 0 failure
 * \return >= 0 success
 *
 */
int8_t hmac_md_calc(const alg_hmac_md_e md, const uint8_t *key, uint16_t key_len, const uint8_t *data, uint16_t data_len, uint8_t *result, uint8_t result_len);

#endif /* HMAC_SHA1_ */


text:
Debug = debug.Debug;

var expected_events = 1;
var log = [];

var p = new Promise(function(resolve, reject) {
  log.push("resolve");
  resolve();
});

function MyPromise(resolver) {
  var reject = function() {
    log.push("throw in reject");
    throw new Error("reject");  // event
  };
  var resolve = function() { };
  log.push("construct");
  resolver(resolve, reject);
};

MyPromise.prototype = new Promise(function() {});
MyPromise.__proto__ = Promise;
p.constructor = MyPromise;

var q = p.then(
  function() {
    log.push("throw caught");
    throw new Error("caught");  // event
  });

function listener(event, exec_state, event_data, data) {
  try {
    if (event == Debug.DebugEvent.Exception) {
      expected_events--;
      assertTrue(expected_events >= 0);
      if (expected_events == 0) {
        assertEquals(["resolve", "construct", "end main",
                      "throw caught"], log);
        assertEquals("caught", event_data.exception().message);
      } else {
        assertUnreachable();
      }
      assertTrue(exec_state.frame(0).sourceLineText().indexOf('// event') > 0);
    }
  } catch (e) {
    %AbortJS(e + "\n" + e.stack);
  }
}

Debug.setBreakOnUncaughtException();
Debug.setListener(listener);

log.push("end main");

function testDone(iteration) {
  function checkResult() {
    try {
      assertTrue(iteration < 10);
      if (expected_events === 0) {
        assertEquals(["resolve", "construct", "end main",
                      "throw caught", "throw in reject"], log);
      } else {
        testDone(iteration + 1);
      }
    } catch (e) {
      %AbortJS(e + "\n" + e.stack);
    }
  }

  %EnqueueMicrotask(checkResult);
}

testDone(0);


text:
package com.microsoft.azure.management.samples;

import com.microsoft.azure.management.appservice.samples.ManageFunctionAppBasic;
import com.microsoft.azure.management.appservice.samples.ManageFunctionAppSourceControl;
import com.microsoft.azure.management.appservice.samples.ManageFunctionAppWithDomainSsl;
import com.microsoft.azure.management.appservice.samples.ManageLinuxWebAppBasic;
import com.microsoft.azure.management.appservice.samples.ManageLinuxWebAppSqlConnection;
import com.microsoft.azure.management.appservice.samples.ManageLinuxWebAppWithDomainSsl;
import com.microsoft.azure.management.appservice.samples.ManageLinuxWebAppWithTrafficManager;
import com.microsoft.azure.management.appservice.samples.ManageWebAppBasic;
import com.microsoft.azure.management.appservice.samples.ManageWebAppSlots;
import com.microsoft.azure.management.appservice.samples.ManageWebAppSourceControlAsync;
import com.microsoft.azure.management.appservice.samples.ManageWebAppSqlConnection;
import com.microsoft.azure.management.appservice.samples.ManageWebAppWithDomainSsl;
import com.microsoft.azure.management.appservice.samples.ManageWebAppWithTrafficManager;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;

public class AppServiceSampleTests extends SamplesTestBase {
    @Test
    public void testManageWebAppBasic() {
        Assert.assertTrue(ManageWebAppBasic.runSample(azure));
    }

    @Test
    public void testManageWebAppSlots() {
        Assert.assertTrue(ManageWebAppSlots.runSample(azure));
    }

    @Test
    @Ignore("Failing in playback - dependent on git")
    public void testManageWebAppSourceControlAsync() {
        Assert.assertTrue(ManageWebAppSourceControlAsync.runSample(azure));
    }

    @Test
    @Ignore("Stops in between for user input")
    public void testManageWebAppSqlConnection() {
        Assert.assertTrue(ManageWebAppSqlConnection.runSample(azure));
    }

    @Test
    public void testManageWebAppWithDomainSsl() {
        Assert.assertTrue(ManageWebAppWithDomainSsl.runSample(azure));
    }

    @Test
    public void testManageWebAppWithTrafficManager() {
        Assert.assertTrue(ManageWebAppWithTrafficManager.runSample(azure));
    }

    @Test
    public void testManageLinuxWebAppBasic() {
        Assert.assertTrue(ManageLinuxWebAppBasic.runSample(azure));
    }

    @Test
    @Ignore("Stops in between for user input")
    public void testManageLinuxWebAppSqlConnection() {
        Assert.assertTrue(ManageLinuxWebAppSqlConnection.runSample(azure));
    }

    @Test
    public void testManageLinuxWebAppWithDomainSsl() {
        Assert.assertTrue(ManageLinuxWebAppWithDomainSsl.runSample(azure));
    }

    @Test
    public void testManageLinuxWebAppWithTrafficManager() {
        Assert.assertTrue(ManageLinuxWebAppWithTrafficManager.runSample(azure));
    }

    @Test
    public void testManageFunctionAppBasic() {
        Assert.assertTrue(ManageFunctionAppBasic.runSample(azure));
    }

    @Test
    public void testManageFunctionAppWithDomainSsl() {
        Assert.assertTrue(ManageFunctionAppWithDomainSsl.runSample(azure));
    }

    @Test
    @Ignore("Failing in playback - dependent on git")
    public void testManageFunctionAppSourceControl() {
        Assert.assertTrue(ManageFunctionAppSourceControl.runSample(azure));
    }
}


text:
package manifold.rt.api;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * A class annotated with this will not have the Manifold bootstrap
 * class initialization block injected.
 */
@SuppressWarnings("unused")
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.TYPE)
public @interface NoBootstrap
{
}


text:
@Version("1.0.1")
package org.apache.sling.api.auth;

import aQute.bnd.annotation.Version;


text:
* [I select "\_\_\_" in the "\_\_\_" drop down list](i-select-"\_\_\_"-in-the-"\_\_\_"-drop-down-list)
    * [regex](regex)
    * [execution](execution)
    * [timing](timing)
# I select "\_\_\_" in the "\_\_\_" drop down list
## regex
 regex should match 'I select "Mountain Standard" in the "Time Zone" drop down list'

```
verifyStepMatch('I select "Mountain Standard" in the "Time Zone" drop down list');
```

 regex should capture the option text, element name, and element type

```
verifyStepCaptures('I select "Mountain Standard" in the "Time Zone" drop down list', 'Mountain Standard', 'Time Zone', ' drop down list');
```

 regex should capture the option text, element name, and a blank string if no element type is provided

```
verifyStepCaptures('I select "Mountain Standard" in the "Time Zone"', 'Mountain Standard', 'Time Zone', '');
```

## execution
 execution should select the correct option by its text from the correct drop-down

```
return executeStep('I select "Mountain Standard" in the "Time Zone" drop down list', function() {
  return Promise.all([
    expect(element(By.cssContainingText('option', 'Eastern Standard')).isSelected()).to.eventually.equal(false),
    expect(element(By.cssContainingText('option', 'Central Standard')).isSelected()).to.eventually.equal(false),
    expect(element(By.cssContainingText('option', 'Mountain Standard')).isSelected()).to.eventually.equal(true)
  ]);
});
```

## timing
 timing should wait for the drop down menu to appear before selecting

```
return browser.driver.executeScript("setTimeout( function() { $(\"div#test\").append(' <select id=\"timezone\"> <option selected>Eastern Standard</option> <option>Mountain Standard</option> <option>Central Standard</option> </select>'); }, 200 )").then(() => {
  return executeStep('I select "Mountain Standard" in the "Time Zone" drop down list', function() {
    expect(currentStepResult.status).to.equal(Cucumber.Status.PASSED);
  });
});
```


text:
define(['angular','ops-mgr/alerts/module-name', 'kylo-utils/LazyLoadUtil','constants/AccessConstants','kylo-common', 'kylo-services','kylo-opsmgr'], function (angular,moduleName,lazyLoadUtil,AccessConstants) {
   var module = angular.module(moduleName, []);

    module.config(['$stateProvider','$compileProvider',function ($stateProvider,$compileProvider) {
        //preassign modules until directives are rewritten to use the $onInit method.
        //https://docs.angularjs.org/guide/migration#migrating-from-1-5-to-1-6
        $compileProvider.preAssignBindingsEnabled(true);

        $stateProvider.state(AccessConstants.UI_STATES.ALERTS.state,{
            url:'/alerts',
            views: {
                'content': {
                    templateUrl: 'js/ops-mgr/alerts/alerts-table.html',
                }
            },
            resolve: {
                loadPage: lazyLoad()
            },
            data:{
                breadcrumbRoot:true,
                displayName:'Alerts',
                module:moduleName,
                permissions:AccessConstants.UI_STATES.ALERTS.permissions
            }
        }).state(AccessConstants.UI_STATES.ALERT_DETAILS.state,{
            url:"/alert-details/{alertId}",
            views: {
                'content': {
                    templateUrl: 'js/ops-mgr/alerts/alert-details.html',
                    controller:'AlertDetailsController',
                    controllerAs:'vm'
                }
            },
            params: {
                alertId: null
            },
            resolve: {
                loadMyCtrl: lazyLoadController(['ops-mgr/alerts/AlertDetailsController'])
            },
            data:{
                displayName:'Alert Details',
                module:moduleName,
                permissions:AccessConstants.UI_STATES.ALERT_DETAILS.permissions
            }
        })

        function lazyLoadController(path){
            return lazyLoadUtil.lazyLoadController(path,['ops-mgr/alerts/module-require']);
        }

        function lazyLoad(){
            return lazyLoadUtil.lazyLoad(['ops-mgr/alerts/module-require']);
        }

    }]);
    return module;

});


text:
package com.eyekabob.db;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class DBUtils {
    private static final String USER = "eyekabob";
    private static final String PASS = "privateeye";
    private static final String DB_NAME = "eyekabob";
    private static final String DB_HOST = "localhost";
    private static final String JDBC = "jdbc";
    private static final String MYSQL = "mysql";
    private static final String CONNECTION = JDBC + ":" + MYSQL + "://" + DB_HOST + "/" + DB_NAME;

    public static Connection getConn() throws SQLException {
        return DriverManager.getConnection(CONNECTION, USER, PASS);
    }

    /**
     * Query for a prepared statement given an array of arguments to the statement.
     * The preparedStatementStr should look something like:
     * "SELECT * FROM MY_TABLE WHERE ID=?"
     *
     * Given the above example and assuming ID is an int, the preparedArgs should be an
     * array containing one int:
     * [12345]
     *
     * @param preparedStatementStr
     * @param preparedArgs
     * @return A list of rows, represented as maps. Each row has a column name key and an Object value.
     * @throws SQLException
     */
    public static List<Map<String, Object>> query(String preparedStatementStr, Object... preparedArgs) throws SQLException {
        try {
            Class.forName("com.mysql.jdbc.Driver");
        }
        catch (ClassNotFoundException e) {
            e.printStackTrace();
            return null;
        }
        Connection conn = getConn();
        PreparedStatement preparedStatement = conn.prepareStatement(preparedStatementStr);
        int argCount = 1;
        for (Object arg : preparedArgs) {
            if (arg instanceof Integer) {
                preparedStatement.setInt(argCount, (Integer)arg);
            }
            else if (arg instanceof String) {
                preparedStatement.setString(argCount, (String)arg);
            }
            argCount++;
        }

        ResultSet resultSet = preparedStatement.executeQuery();
        ResultSetMetaData metaData = resultSet.getMetaData();
        int columnCount = metaData.getColumnCount();
        List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
        while (resultSet.next()) {
            Map<String, Object> row = new HashMap<String, Object>();
            for (int colIndex = 1; colIndex < columnCount + 1; colIndex++) {
                String columnName = metaData.getColumnName(colIndex);
                row.put(columnName, resultSet.getObject(colIndex));
            }
            result.add(row);
        }

        return result;
    }
}


text:
import test from 'ava';

import getChild from '../../../src/vue-kindergarten/getChild';

test('returns null if no child given', (t) => {
  t.is(null, getChild());
});

test('returns given child if not function', (t) => {
  const child = {};

  t.is(child, getChild(child));
});

test('extracts child from the given store', (t) => {
  const child = store => store.foo;

  const store = { foo: 'bar' };

  t.is('bar', getChild(child, { store }));
});

test('returns return value of the child method', (t) => {
  const child = () => 'bar';

  t.is('bar', getChild(child));
});


text:
package io.gravitee.repository.mongodb.management.internal.api;

import io.gravitee.repository.mongodb.management.internal.model.CategoryMongo;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

/**
 * @author Azize ELAMRANI (azize.elamrani at graviteesource.com)
 * @author GraviteeSource Team
 */
@Repository
public interface CategoryMongoRepository extends MongoRepository<CategoryMongo, String> {

    @Query("{ 'environmentId': ?0 }")
    List<CategoryMongo> findByEnvironmentId(String environmentId);

    @Query("{ 'environmentId': ?1, 'key': ?0 }")
    Optional<CategoryMongo> findByKeyAndEnvironment(String key, String environment);

    @Query("{ 'page': ?0 }")
    List<CategoryMongo> findByPage(String page);
}


text:
(function($){
	$( document ).ready( function() {
		var $body = $( 'body' );

		$( '.et_dashboard_authorize' ).click( function() {
			var $this_button = $( this ),
				$key_field = $this_button.closest( 'ul' ).find( '.api_option_key' ),
				$spinner = $this_button.closest( 'li' ).find( 'span.spinner' );

			authorize_aweber( $key_field, $spinner );

			return false;
		});

		function authorize_aweber( $key_field, $spinner ) {
			var $container = $key_field.closest( '.et_dashboard_form' );

			$key_field.css( { 'border' : 'none' } );

			if ( $key_field.length && '' == $key_field.val() ) {
				$key_field.css( { 'border' : '1px solid red' } );
			} else {
				$.ajax({
					type: 'POST',
					url: builder_settings.ajaxurl,
					data: {
						action : 'et_builder_authorize_aweber',
						et_builder_nonce : builder_settings.et_builder_nonce,
						et_builder_api_key : $key_field.val()
					},
					beforeSend: function( data ) {
						$spinner.addClass( 'et_dashboard_spinner_visible' );
					},

					success: function( data ){
						$spinner.removeClass( 'et_dashboard_spinner_visible' );

						if ( 'success' == data || '' == data ) {
							$( $container ).find( '.et_dashboard_authorize' ).text( builder_settings.reauthorize_text );
							window.et_dashboard_generate_warning( builder_settings.authorization_successflull, '#', '', '', '', '' );
						} else {
							window.et_dashboard_generate_warning( data, '#', '', '', '', '' );
						}
					}
				});
			}

			return false;
		}

		$( '.et_dashboard_get_lists' ).click( function() {
			var $this_button = $( this ),
				$this_spinner = $this_button.closest( 'li' ).find( 'span.spinner' ),
				service_name = $this_button.hasClass( 'et_pb_aweber' ) ? 'aweber' : 'mailchimp',
				options_fromform = $( '.et_builder #et_dashboard_options' ).serialize();

			$.ajax({
				type: 'POST',
				url: builder_settings.ajaxurl,
				data: {
					action : 'et_builder_refresh_lists',
					et_builder_nonce : builder_settings.et_builder_nonce,
					et_builder_mail_service : service_name,
					et_builder_form_options : options_fromform
				},
				beforeSend: function( data ) {
					$this_spinner.addClass( 'et_dashboard_spinner_visible' );
				},

				success: function( data ) {
					$this_spinner.removeClass( 'et_dashboard_spinner_visible' );
					window.et_dashboard_generate_warning( data, '#', '', '', '', '' );
				}
			});

			return false;
		});

		$( '.et_dashboard_updates_save' ).click( function() {
			var $this_button = $( this ),
				$this_container = $this_button.closest( 'ul' ),
				$this_spinner = $this_container.find( 'span.spinner' ),
				username = $this_container.find( '.updates_option_username' ).val(),
				api_key = $this_container.find( '.updates_option_api_key' ).val();

			$.ajax({
				type: 'POST',
				url: builder_settings.ajaxurl,
				data: {
					action : 'et_builder_save_updates_settings',
					et_builder_nonce : builder_settings.et_builder_nonce,
					et_builder_updates_username : username,
					et_builder_updates_api_key : api_key
				},
				beforeSend: function( data ) {
					$this_spinner.addClass( 'et_dashboard_spinner_visible' );
				},

				success: function( data ) {
					$this_spinner.removeClass( 'et_dashboard_spinner_visible' );
				}
			});

			return false;
		});

		$( '.et_google_api_save' ).click( function() {
			var $this_button = $( this ),
				$this_container = $this_button.closest( 'ul' ),
				$this_spinner = $this_container.find( 'span.spinner' ),
				api_key = $this_container.find( '.google_api_key' ).val();

			$.ajax({
				type: 'POST',
				url: builder_settings.ajaxurl,
				data: {
					action : 'et_builder_save_google_api_settings',
					et_builder_nonce : builder_settings.et_builder_nonce,
					et_builder_google_api_key : api_key
				},
				beforeSend: function( data ) {
					$this_spinner.addClass( 'et_dashboard_spinner_visible' );
				},

				success: function( data ) {
					$this_spinner.removeClass( 'et_dashboard_spinner_visible' );
				}
			});

			return false;
		});

		$( '#et_pb_save_plugin' ).click( function() {
			var $loading_animation = $( '#et_pb_loading_animation' ),
				$success_animation = $( '#et_pb_success_animation' ),
				options_fromform;

			tinyMCE.triggerSave();
			options_fromform = $( '.' + dashboardSettings.plugin_class + ' #et_dashboard_options' ).serialize();

			$.ajax({
				type: 'POST',
				url: builder_settings.ajaxurl,
				data: {
					action : 'et_builder_save_settings',
					options : options_fromform,
					options_sub_title : '',
					save_settings_nonce : builder_settings.save_settings
				},
				beforeSend: function ( xhr ) {
					$loading_animation.removeClass( 'et_pb_hide_loading' );
					$success_animation.removeClass( 'et_pb_active_success' );
					$loading_animation.show();
				},
				success: function( data ) {
					$loading_animation.addClass( 'et_pb_hide_loading' );
					$success_animation.addClass( 'et_pb_active_success' ).show();

					setTimeout( function(){
						$success_animation.fadeToggle();
						$loading_animation.fadeToggle();
					}, 1000 );
				}
			});

			return false;
		});

		$body.append( '

' );
		$body.append( '

' );

		$( '#et_pb_loading_animation' ).hide();
		$( '#et_pb_success_animation' ).hide();
	});
})(jQuery)


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <View
        android:id="@+id/offline_bar"
        style="@style/offline_bar"
        android:layout_alignParentTop="true"
        android:visibility="visible" />

    <LinearLayout
        android:id="@+id/friends_course_no_friends_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_centerInParent="true"
        android:padding="12dp"
        android:gravity="center_vertical"
        android:visibility="gone"
        android:orientation="vertical"
        tools:visibility="gone">

        <TextView
            android:id="@+id/error_message"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center"
            tools:text="@string/error_no_friends_connected"
            android:textSize="14sp"
            android:textStyle="bold"
            android:textColor="@color/grey_5"/>

        <TextView
            android:id="@+id/friends_course_no_btn_share_app"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/com_facebook_button_blue"
            android:gravity="center"
            android:textColor="@color/white"
            android:textAllCaps="true"
            android:textStyle="bold"
            android:drawableLeft="@drawable/ic_facebookwhite"
            android:drawableStart="@drawable/ic_facebookwhite"
            android:drawablePadding="12dp"
            android:paddingLeft="12dp"
            android:paddingStart="12dp"
            android:paddingRight="0dp"
            android:paddingEnd="0dp"
            android:layout_marginRight="8dp"
            android:layout_marginLeft="8dp"
            android:layout_marginTop="12dp"
            tools:text="@string/btn_share_app"
            tools:targetApi="17"/>

    </LinearLayout>

    <android.support.v4.widget.SwipeRefreshLayout
        android:id="@+id/swipe_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@id/offline_bar"
        android:visibility="visible">

        <ListView
            tools:listitem="@layout/row_course_list"
            android:id="@+id/my_course_list"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:divider="@android:color/transparent"
            android:dividerHeight="10.0sp"
            android:drawSelectorOnTop="false"
            android:listSelector="@color/grey_act_background"
            android:padding="10dp"
            android:scrollbars="none"
            android:clipToPadding="false"/>
    </android.support.v4.widget.SwipeRefreshLayout>

    <ProgressBar
        android:id="@+id/api_spinner"
        style="@style/api_progress_style"
        android:visibility="visible" />

    <LinearLayout
        android:id="@+id/offline_panel"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:visibility="gone"
        tools:visibility="visible">

        <include layout="@layout/panel_offline_mode" />
    </LinearLayout>

</RelativeLayout>


text:
Routing of Messages in MassTransit
""""""""""""""""""""""""""""""""""

How are messages routed?

RabbitMQ Routing Conventions
'''''''''''''''''''''''''''''

As we were building in the RabbitMQ support into MassTransit, we tried to follow the best
practices for RabbitMQ at the time. Also, since C# is a strongly typed language,
we have tried to make the most of that as well. MassTransit follows a routing scheme
that is based on the type of the message. All messages published in MassTransit are
routed by the Message Type. In our case the Message Type is going to be the .Net type of
the message class.

Another goal was leveraging RabbitMQ for as much of the routing logic possible. With MSMQ
we had to manage the routing logic ourselves and that added quite a bit of code to the project.
But with RabbitMQ's advanced routing features we hoped we could excise that piece of the system.

To achieve that we devised a routing system that leaned on RabbitMQ's concepts of bindings
and exchanges. By doing so the routing logic has been completely moved to RabbitMQ, which
has lead to us also working well with RabbitMQ's clustering support giving us more HA scenarios
as well.

Let's see the story of the following message classes

.. sourcecode:: csharp

  public class PingMessage { ... }
  public interface LiteCustomerData { ... }
  public class FullCustomerData : LiteCustomerData { ... }

Next we will see what happens when you subscribe to any of these messages.

A note about RabbitMQ. You send to exchanges in RabbitMQ. You receive messages
from queues. So how the hell do messages get anywhere? That's where
bindings come into play. You bind a queue to an exchange. That way one exchange
can service multiple queues. This abstracts the sending of the message from
the target queue. Pretty cool, eh? Ok, anyways.

MassTransit creates an exchange for each message type. So in the three messages
above you would see three exchanges. We also set up a pattern where we bind
exchanges to exchanges from the most specific to the most general. In this
example that would be:

  PingMessage

  FullCustomerData -> LiteCustomerData

.. NOTE::

  A word about Exchange to Exchange bindings. It is a RabbitMQ only feature.
  Exchange queue. To limit the amount of RabbitMQ churn we have established a
  directly bound exchange to your queue. This lets you come on and off the network with
  little impact to the flow of messages. [#churn]_

If you are leveraging our interface based messaging with a message class like

.. sourcecode:: csharp

  public class MyMessage : IMessageAA {}

You would see two exchanges 'MyMessage' and 'IMessageAA'. You will also see an
exchange to exchange binding from 'MyMessage' to 'IMessageAA' (from concrete
to the interface). If you subscribet to the concrete type you get a binding to
'MyMessage' if you subscribe to 'IMessageAA' you get a binding to 'IMessageAA'.

NOTE: Why are we doing this?

.. rubric:: Footnotes

.. [#churn] http://blog.springsource.com/2011/04/01/routing-topologies-for-performance-and-scalability-with-rabbitmq/
.. [#dump] http://codebetter.com/drusellers/2011/05/08/brain-dump-conventional-routing-in-rabbitmq/


text:
package ru.lanwen.jenkins.juseppe.util;

import org.hamcrest.Description;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeDiagnosingMatcher;

import java.io.File;

/**
 * @author lanwen (Merkushev Kirill)
 */
public final class JuseppeMatchers {
    private JuseppeMatchers() {
    }

    public static Matcher<File> exists() {
        return new TypeSafeDiagnosingMatcher<File>() {
            @Override
            protected boolean matchesSafely(File item, Description mismatchDescription) {
                mismatchDescription.appendValue(item.getAbsolutePath()).appendText(" not exists");
                return item.exists();
            }

            @Override
            public void describeTo(Description description) {
                description.appendText("file should exist");
            }
        };
    }
}


text:
"""Text summaries and TensorFlow operations to create them."""

from tensorboard.plugins.text import metadata
from tensorboard.plugins.text import summary_v2

# Export V2 versions.
text = summary_v2.text
text_pb = summary_v2.text_pb

def op(name, data, display_name=None, description=None, collections=None):
    """Create a legacy text summary op.

    Text data summarized via this plugin will be visible in the Text Dashboard
    in TensorBoard. The standard TensorBoard Text Dashboard will render markdown
    in the strings, and will automatically organize 1D and 2D tensors into tables.
    If a tensor with more than 2 dimensions is provided, a 2D subarray will be
    displayed along with a warning message. (Note that this behavior is not
    intrinsic to the text summary API, but rather to the default TensorBoard text
    plugin.)

    Args:
      name: A name for the generated node. Will also serve as a series name in
        TensorBoard.
      data: A string-type Tensor to summarize. The text must be encoded in UTF-8.
      display_name: Optional name for this summary in TensorBoard, as a
        constant `str`. Defaults to `name`.
      description: Optional long-form description for this summary, as a
        constant `str`. Markdown is supported. Defaults to empty.
      collections: Optional list of ops.GraphKeys. The collections to which to add
        the summary. Defaults to [Graph Keys.SUMMARIES].

    Returns:
      A TensorSummary op that is configured so that TensorBoard will recognize
      that it contains textual data. The TensorSummary is a scalar `Tensor` of
      type `string` which contains `Summary` protobufs.

    Raises:
      ValueError: If tensor has the wrong type.
    """
    # TODO(nickfelt): remove on-demand imports once dep situation is fixed.
    import tensorflow.compat.v1 as tf

    if display_name is None:
        display_name = name
    summary_metadata = metadata.create_summary_metadata(
        display_name=display_name, description=description
    )
    with tf.name_scope(name):
        with tf.control_dependencies([tf.assert_type(data, tf.string)]):
            return tf.summary.tensor_summary(
                name="text_summary",
                tensor=data,
                collections=collections,
                summary_metadata=summary_metadata,
            )

def pb(name, data, display_name=None, description=None):
    """Create a legacy text summary protobuf.

    Arguments:
      name: A name for the generated node. Will also serve as a series name in
        TensorBoard.
      data: A Python bytestring (of type bytes), or Unicode string. Or a numpy
        data array of those types.
      display_name: Optional name for this summary in TensorBoard, as a
        `str`. Defaults to `name`.
      description: Optional long-form description for this summary, as a
        `str`. Markdown is supported. Defaults to empty.

    Raises:
      ValueError: If the type of the data is unsupported.

    Returns:
      A `tf.Summary` protobuf object.
    """
    # TODO(nickfelt): remove on-demand imports once dep situation is fixed.
    import tensorflow.compat.v1 as tf

    try:
        tensor = tf.make_tensor_proto(data, dtype=tf.string)
    except TypeError as e:
        raise ValueError(e)

    if display_name is None:
        display_name = name
    summary_metadata = metadata.create_summary_metadata(
        display_name=display_name, description=description
    )
    tf_summary_metadata = tf.SummaryMetadata.FromString(
        summary_metadata.SerializeToString()
    )
    summary = tf.Summary()
    summary.value.add(
        tag="%s/text_summary" % name,
        metadata=tf_summary_metadata,
        tensor=tensor,
    )
    return summary


text:
package com.jeff.footballmanager.activity;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.zip.Checksum;

import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.AdapterView.OnItemLongClickListener;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;
import android.widget.Toast;

import com.jeff.footballmanager.R;
import com.jeff.footballmanager.adapter.MyAdapter;
import com.jeff.footballmanager.adapter.MySimpleAdapter;
import com.jeff.footballmanager.param.CompetitionAPIRetParam;
import com.jeff.footballmanager.param.PlayerAPIRetParam;
import com.jeff.footballmanager.param.StaticParam;
import com.jeff.footballmanager.param.TeamAPIRetParam;
import com.jeff.footballmanager.utils.GetApiAsyncTask;
import com.jeff.footballmanager.utils.GsonUtils;

public class FootballDetailsActivity extends BaseActivity {

	private ImageView imgMenu,backTo;
	private TextView menuTitle;
	private ListView listView;
	/**
	 * 当前项,球员,球队,球赛已经排名
	 */
	private int type;
	public static final int GET_PLAYER = 0;
	public static final int GET_TEAM = 1;
	public static final int GET_COMPETITION = 2;
	public static final int GET_TECHNO = 3;
	private String json = null;

	private MySimpleAdapter adapter = null;
	private boolean firstInit = false;
	private List<Map<String,Object>> result = null;
	private List<Map<String,Object>> listViewContent = null;

	private static final int DELETE_INFO = 0;
	private static final int GET_INFO = 1;
	private static final int ADD_INFO = 2;
	private static final int EDIT_INFO = 3;
	/**
	 * 当前状态,获取信息,编辑信息,删除信息,添加信息
	 */
	private static int CURRENT_STATUS = GET_INFO;
	private static int myShowType = 0;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_football_details);

		initView();
		getAPIData();
		setListener();
	}

	//调用异步方法获取数据
	private void getAPIData() {
		GetApiAsyncTask asyncTask = null;
		switch (type) {
		case GET_PLAYER:
			menuTitle.setText(getString(R.string.player));
			asyncTask = new GetApiAsyncTask(
				FootballDetailsActivity.this,
					StaticParam.API+StaticParam.API_GET_ALL_PLAYER+StaticParam.API_TOKEN);
			break;
		case GET_TEAM:
			menuTitle.setText(getString(R.string.team));
			asyncTask = new GetApiAsyncTask(
				FootballDetailsActivity.this,
					StaticParam.API+StaticParam.API_GET_ALL_TEAM+StaticParam.API_TOKEN);
			break;
		case GET_COMPETITION:
			menuTitle.setText(getString(R.string.competition));
			asyncTask = new GetApiAsyncTask(
				FootballDetailsActivity.this,
					StaticParam.API+StaticParam.API_GET_ALL_COMPETITION+StaticParam.API_TOKEN);
			break;
		case GET_TECHNO:
			menuTitle.setText(getString(R.string.techno_count));
			doAfterGetData("");
			break;
		default:
			break;
		}
		if(null!=asyncTask)
		{
			if(StaticParam.USER_NO.equals("")){
				SharedPreferences pref = getSharedPreferences("userInfo",MODE_PRIVATE);
				StaticParam.USER_NO = pref.getString("userNo","");
			}
			asyncTask.execute("&userNo="+StaticParam.USER_NO);
		}
	}

	//异步任务完成以后调用重写的方法得到数据
	@Override
	public void doAfterGetData(String data) {
		this.json =  data;
		result = getData();
		if(CURRENT_STATUS==GET_INFO){
			listViewContent = result;
			if(StaticParam.FAULT.equals(listViewContent.get(0).get("msg"))){
				showToastFault(FootballDetailsActivity.this,getString(R.string.errorconnect), 1000);
			}else if(StaticParam.SUCCESS.equals(listViewContent.get(0).get("msg"))){
				showToastFault(FootballDetailsActivity.this,getString(R.string.no_data), 1000);
			}else{
				//得到数据之后绑定适配器
				if(!firstInit){
					adapter = new MySimpleAdapter(FootballDetailsActivity.this,R.layout.foot_details_list_item,listViewContent);
					listView.setAdapter(adapter);
					firstInit = true;
				}else{
					adapter.notifyDataSetChanged();
				}
			}
		}else{
			if(result.get(0).get("msg").equals("fault")){
				showToastFault(FootballDetailsActivity.this,getString(R.string.errorconnect), 1000);
				//操作失败重新加载一遍数据提示用户
				CURRENT_STATUS = GET_INFO;
				getAPIData();
			}else{
//				showToastSuccess(FootballDetailsActivity.this,getString(R.string.success_opeation), 1000);
			}
		}
	}

	//get data from server
	private List<Map<String,Object>> getData() {
		List<Map<String,Object>> result = null;
		switch (type) {
		case GET_PLAYER:
			result = getPlayerData();
			break;
		case GET_TEAM:
			result = getTeamData();
			break;
		case GET_COMPETITION:
			result = getCompetitionData();
			break;
		case GET_TECHNO:
			result = getTechnoData();
			break;
		default:
			break;
		}
		return result;
	}

	private List<Map<String, Object>> getTechnoData() {
		CURRENT_STATUS=GET_INFO;
		List<Map<String,Object>> result = new ArrayList<Map<String,Object>>();
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("name",getString(R.string.rank_player_assting));
		map.put("country","");
		map.put("tel",getString(R.string.count_asst));
		result.add(map);
		Map<String,Object> map1 = new HashMap<String,Object>();
		map1.put("name",getString(R.string.rank_player_score));
		map1.put("country","");
		map1.put("tel",getString(R.string.count_score));
		result.add(map1);
		Map<String,Object> map2 = new HashMap<String,Object>();
		map2.put("name",getString(R.string.rank_player_history_assting));
		map2.put("country","");
		map2.put("tel",getString(R.string.count_his_assi));
		result.add(map2);
		Map<String,Object> map3 = new HashMap<String,Object>();
		map3.put("name",getString(R.string.rank_player_history_score));
		map3.put("country","");
		map3.put("tel",getString(R.string.count_his_scor));
		result.add(map3);
		Map<String,Object> map4 = new HashMap<String,Object>();
		map4.put("name",getString(R.string.rank_team));
		map4.put("country","");
		map4.put("tel",getString(R.string.count_team));
		result.add(map4);
		return result;
	}

	private List<Map<String, Object>> getCompetitionData() {
		Map<String,Object> map = null;
		List<Map<String,Object>> result = new ArrayList<Map<String,Object>>();
		CompetitionAPIRetParam competitionData = GsonUtils.getGson().fromJson(json,new CompetitionAPIRetParam().getClass());
		if(CURRENT_STATUS==GET_INFO){
			if(competitionData!=null&&!competitionData.getMsg().equals(StaticParam.FAULT))
			{
				if(null==competitionData.getData()||competitionData.getData().size()==0){
					map = new HashMap<String,Object>();
					map.put("msg",StaticParam.SUCCESS);
					result.add(map);
					return result;
				}
				for(int i=0,j=competitionData.getData().size();i<j;i++){
					map = new HashMap<String,Object>();
					map.put("name",getString(R.string.win_)+competitionData.getData().get(i).getChampionTeam());
					map.put("country",getString(R.string.score_)+competitionData.getData().get(i).getChampionScore());
					map.put("tel",getString(R.string.lost_)+competitionData.getData().get(i).getSecondTeam()+"  "+getString(R.string.score_)+competitionData.getData().get(i).getSecondScore());
					map.put("no",""+competitionData.getData().get(i).getCompetitionNo());
					result.add(map);
				}
			}else{
				map = new HashMap<String,Object>();
				map.put("msg",StaticParam.FAULT);
				result.add(map);
			}
		}else{
			map = new HashMap<String,Object>();
			if(competitionData==null||competitionData.getMsg().equals(StaticParam.FAULT)){
				map.put("msg",StaticParam.FAULT);
			}else{
				map.put("msg",StaticParam.SUCCESS);
			}
			result.add(map);
		}
		return result;
	}

	@Override
	public void onBackPressed() {
		if(myShowType==0){
			CURRENT_STATUS = GET_INFO;
			FootballDetailsActivity.this.finish();
			overridePendingTransition(R.anim.push_right_in,
				R.anim.push_right_out);
		}else{
			myShowType=0;
			backTo.setBackgroundResource(R.drawable.add);
			adapter.setShowType(MySimpleAdapter.CHECK_HIDDEN);
			adapter.notifyDataSetChanged();
		}
	}

	private List<Map<String, Object>> getTeamData() {
		Map<String,Object> map = null;
		List<Map<String,Object>> result = new ArrayList<Map<String,Object>>();
		TeamAPIRetParam teamData = GsonUtils.getGson().fromJson(json,new TeamAPIRetParam().getClass());
		if(CURRENT_STATUS==GET_INFO){
			if(teamData!=null&&!teamData.getMsg().equals(StaticParam.FAULT))
			{
				if(null==teamData.getData()||teamData.getData().size()==0){
					map = new HashMap<String,Object>();
					map.put("msg",StaticParam.SUCCESS);
					result.add(map);
					return result;
				}
				for(int i=0,j=teamData.getData().size();i<j;i++){
					map = new HashMap<String,Object>();
					map.put("name",teamData.getData().get(i).getTeamName());
					map.put("country",getString(R.string.native_place_)+teamData.getData().get(i).getNativePlace());
					map.put("tel",getString(R.string.trainer_)+teamData.getData().get(i).getTrainer());
					map.put("no",""+teamData.getData().get(i).getTeamNo());
					result.add(map);
				}
			}else{
				map = new HashMap<String,Object>();
				map.put("msg",StaticParam.FAULT);
				result.add(map);
			}
		}else{
			map = new HashMap<String,Object>();
			if(teamData==null||teamData.getMsg().equals(StaticParam.FAULT)){
				map.put("msg",StaticParam.FAULT);
			}else{
				map.put("msg",StaticParam.SUCCESS);
			}
			result.add(map);
		}
		return result;
	}

	private List<Map<String, Object>> getPlayerData() {
		Map<String,Object> map = null;
		List<Map<String,Object>> result = new ArrayList<Map<String,Object>>();
		PlayerAPIRetParam playerData  = GsonUtils.getGson().fromJson(json,new PlayerAPIRetParam().getClass());
		if(CURRENT_STATUS==GET_INFO){
			if(playerData!=null&&!playerData.getMsg().equals(StaticParam.FAULT))
			{
				if(null==playerData.getData()||playerData.getData().size()==0){
					map = new HashMap<String,Object>();
					map.put("msg",StaticParam.SUCCESS);
					result.add(map);
					return result;
				}
				for(int i=0,j=playerData.getData().size();i<j;i++){
					map = new HashMap<String,Object>();
					map.put("name",playerData.getData().get(i).getName());
					map.put("country",getString(R.string.role_)+playerData.getData().get(i).getRole());
					map.put("tel",getString(R.string.mobile_)+playerData.getData().get(i).getMobile());
					map.put("no",""+playerData.getData().get(i).getPlayerNo());
					result.add(map);
				}
			}else{
				map = new HashMap<String,Object>();
				map.put("msg",StaticParam.FAULT);
				result.add(map);
			}
		}else{
			map = new HashMap<String,Object>();
			if(playerData==null||playerData.getMsg().equals(StaticParam.FAULT)){
				map.put("msg",StaticParam.FAULT);
			}else{
				map.put("msg",StaticParam.SUCCESS);
			}
			result.add(map);
		}
		return result;
	}

	private void setListener() {
		//添加信息
		backTo.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				if(myShowType==0){
					CURRENT_STATUS = ADD_INFO;
					Intent intent = new Intent(FootballDetailsActivity.this,AddFootballInfoActivity.class);
					intent.putExtra("type", type);
					startActivityForResult(intent, 0);
					FootballDetailsActivity.this.overridePendingTransition(R.anim.push_left_in,R.anim.push_left_out);
				}else{
//					Builder dialog = new AlertDialog.Builder(FootballDetailsActivity.this);
//					dialog.setTitle(getString(R.string.hint_info_)).setMessage(getString(R.string.sure_to_delete));
//					dialog.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
//						@Override
//						public void onClick(DialogInterface dialog, int which) {
							CURRENT_STATUS=DELETE_INFO;
							boolean[] checkStatus = adapter.getCheckStatus();
							for(int i=checkStatus.length-1;i>=0;i--){
								if(checkStatus[i]){
									deleteItem(i);
									listViewContent.remove(i);
								}
							}
							adapter.setShowType(MySimpleAdapter.CHECK_HIDDEN);
							backTo.setBackgroundResource(R.drawable.add);
							myShowType=0;
							adapter.notifyDataSetChanged();
//						}
//					});
//						dialog.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
//							@Override
//							public void onClick(DialogInterface dialog, int which) {
//								dialog.cancel();
//							}
//						});
//						dialog.setCancelable(true);
//						dialog.show();
				}
			}
		});

//		listView.setOnItemLongClickListener(new OnItemLongClickListener() {
//			@Override
//			public boolean onItemLongClick(AdapterView<?> parent, View view,
//					int position, long id) {
//
//				final int item = position;
//				if(type != GET_TECHNO){
//					MySimpleAdapter.showType = MySimpleAdapter.CHECK_SHOW;
//					adapter.notifyDataSetChanged();
//					View layout = LayoutInflater.from(FootballDetailsActivity.this).inflate(R.layout.my_dialog,null);
//					ListView listV = (ListView) layout.findViewById(R.id.mydialog);
//					List<Map<String,String>> data = new ArrayList<>();
//					Map<String,String> map = new HashMap<>();
//					map.put("item","删除此项");
//					Map<String,String> map1 = new HashMap<>();
//					map1.put("item","多选删除");
//					Map<String,String> map2 = new HashMap<>();
//					map2.put("item","删除所有");
//					data.add(map);data.add(map1);data.add(map2);
//					listV.setAdapter(new SimpleAdapter(FootballDetailsActivity.this, data,R.layout.item,new String[]{"item"},new int[]{R.id.itemText}));

//					Builder dialog = new AlertDialog.Builder(FootballDetailsActivity.this);
//					dialog.setView(layout);
//					dialog.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
//						@Override
//						public void onClick(DialogInterface dialog, int which) {
//							CURRENT_STATUS=DELETE_INFO;
//							deleteItem(item);
//						}
//					});
//					dialog.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
//						@Override
//						public void onClick(DialogInterface dialog, int which) {
//							dialog.cancel();
//						}
//					});
//					dialog.setCancelable(true);
//					dialog.show();

//					listV.setOnItemClickListener(new OnItemClickListener() {
//						@Override
//						public void onItemClick(AdapterView<?> parent, View view,
//								int position, long id) {
//							switch (position) {
//							case 0:
//								showToastSuccess(FootballDetailsActivity.this,"删除当前项",1000);
//								CURRENT_STATUS=DELETE_INFO;
//								deleteItem(item);
//								break;
//							case 1:
//								showToastSuccess(FootballDetailsActivity.this,"多选删除",1000);
//								break;
//							case 2:
//								showToastSuccess(FootballDetailsActivity.this,"删除所有项",1000);
//								break;
//							default:
//								break;
//							}
//						}
//					});
//				}
//				return true;
//			}
//		});

		listView.setOnItemClickListener(new OnItemClickListener() {
			@Override
			public void onItemClick(AdapterView<?> parent, View view,
					int position, long id) {
				if(type == GET_TECHNO){
					startMyActivity(FootballDetailsActivity.this,new TeamRankActivity(),null, position);
					overridePendingTransition(R.anim.push_left_in,R.anim.push_left_out);
				}else{
					Intent intent = new Intent(FootballDetailsActivity.this,EditInfoActivity.class);
					intent.putExtra("type",type);
					intent.putExtra("no",listViewContent.get(position).get("no").toString());
					startActivityForResult(intent, 1);
					overridePendingTransition(R.anim.push_left_in,R.anim.push_left_out);
				}
			}
		});

		imgMenu.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				onBackPressed();
			}
		});

	}

	//长按删除选中项
	protected void deleteItem(int position) {
		GetApiAsyncTask asyncTask = null;
		switch (type) {
		case GET_PLAYER:
			asyncTask = new GetApiAsyncTask(
				FootballDetailsActivity.this,
					StaticParam.API+StaticParam.API_DELETE_PLAYER
						+StaticParam.API_TOKEN
							+"&playerNo="+listViewContent.get(position).get("no"));
			break;
		case GET_TEAM:
			asyncTask = new GetApiAsyncTask(
				FootballDetailsActivity.this,
					StaticParam.API+StaticParam.API_DELETE_TEAM
						+StaticParam.API_TOKEN
							+"&teamNo="+listViewContent.get(position).get("no"));
			break;
		case GET_COMPETITION:
			asyncTask = new GetApiAsyncTask(
				FootballDetailsActivity.this,
					StaticParam.API+StaticParam.API_DELETE_COMPETITION
						+StaticParam.API_TOKEN
							+"&competitionNo="+listViewContent.get(position).get("no"));
			break;
		default:
			break;
		}
//		listViewContent.remove(position);
//		adapter.notifyDataSetChanged();
		asyncTask.execute("");
	}

	private void initView() {
		//初始化标题
		imgMenu = (ImageView) findViewById(R.id.imgMenu2);
		imgMenu.setBackgroundResource(R.drawable.left171);
		menuTitle = (TextView) findViewById(R.id.menuTitle2);
		type = getIntent().getIntExtra("num",0);
		backTo = (ImageView) findViewById(R.id.backTo2);
		backTo.setBackgroundResource(R.drawable.add);
		if(type==3)
			backTo.setVisibility(View.GONE);
		listView = (ListView) findViewById(R.id.foot_details_listview);
	}

	@Override
	protected void onActivityResult(int arg0, int arg1, Intent arg2) {
		switch (arg1) {
		case GET_PLAYER:
			type=GET_PLAYER;
			break;
		case GET_TEAM:
			type=GET_TEAM;
			break;
		case GET_COMPETITION:
			type=GET_COMPETITION;
			break;
		default:
			break;
		}
		CURRENT_STATUS=GET_INFO;
		getAPIData();
		firstInit=false;
	}

	public class MySimpleAdapter extends BaseAdapter {

		private List<Map<String,Object>> data;
		private int resource;
		private Context context;
		private boolean[] checkStatus = null;

		public static final int CHECK_HIDDEN = 0;
		public static final int CHECK_SHOW = 1;
		public int showType = CHECK_HIDDEN;

		public int getShowType() {
			return showType;
		}

		public void setShowType(int showType) {
			this.showType = showType;
		}

		public MySimpleAdapter(Context context,int resource,List<Map<String,Object>> data){
			this.context = context;
			this.data = data;
			this.resource = resource;
			if(data!=null)
			this.checkStatus = new boolean[data.size()];
		}

		public boolean[] getCheckStatus() {
			return checkStatus;
		}

		public void setCheckStatus(boolean[] checkStatus) {
			this.checkStatus = checkStatus;
		}

		@Override
		public int getCount() {
			return null!=data?data.size():0;
		}

		@Override
		public Object getItem(int position) {
			return data.get(position);
		}

		@Override
		public long getItemId(int position) {
			return position;
		}

		@Override
		public View getView(int position, View convertView, ViewGroup parent) {
			View view;
			ViewHolder holder;

			if(convertView==null){
				holder = new ViewHolder();
				view = LayoutInflater.from(context).inflate(resource, null);

				holder.layout = (LinearLayout) view.findViewById(R.id.lineay);
				holder.checkBox = (CheckBox) view.findViewById(R.id.mycheckBox);
				holder.nameText = (TextView) view.findViewById(R.id.details_name);
				holder.detailsMore = (TextView) view.findViewById(R.id.details_more);
				holder.telText = (TextView) view.findViewById(R.id.details_tel);

				view.setTag(holder);
			}else{
				view = convertView;
				holder = (ViewHolder) view.getTag();
			}

			holder.nameText.setText(data.get(position).get("name").toString());
			holder.detailsMore.setText(data.get(position).get("country").toString());
			holder.telText.setText(data.get(position).get("tel").toString());

			final int item = position;
			if(showType==CHECK_HIDDEN){
				holder.checkBox.setVisibility(View.GONE);
				//跳转到详情页面
				holder.layout.setOnClickListener(new OnClickListener() {
					@Override
					public void onClick(View v) {
						if(type == GET_TECHNO){
							startMyActivity(FootballDetailsActivity.this,new TeamRankActivity(),null,item);
							overridePendingTransition(R.anim.push_left_in,R.anim.push_left_out);
						}else{
							Intent intent = new Intent(FootballDetailsActivity.this,EditInfoActivity.class);
							intent.putExtra("type",type);
							intent.putExtra("no",data.get(item).get("no").toString());
							startActivityForResult(intent, 1);
							overridePendingTransition(R.anim.push_left_in,R.anim.push_left_out);
						}
					}
				});

				holder.layout.setOnLongClickListener(new OnLongClickListener() {
					@Override
					public boolean onLongClick(View v) {
						if(type != GET_TECHNO){
							Toast.makeText(context, getString(R.string.check_delete),Toast.LENGTH_LONG).show();
							showType = CHECK_SHOW;
							myShowType = CHECK_SHOW;
							backTo.setBackgroundResource(R.drawable.ok);
							adapter.notifyDataSetChanged();
						}
						return true;
					}
				});

			}else{

				holder.layout.setOnClickListener(null);
				holder.layout.setOnLongClickListener(null);
				holder.checkBox.setVisibility(View.VISIBLE);
				holder.checkBox.setChecked(checkStatus[item]);

				holder.checkBox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
					@Override
					public void onCheckedChanged(CompoundButton buttonView,
							boolean isChecked) {
						checkStatus[item] = isChecked;
					}
				});
			}

			return view;
		}
	}

	//临时存储控件信息
	class ViewHolder{
		LinearLayout layout;
		CheckBox checkBox;
		TextView nameText,detailsMore,telText;
	}
}


text:
class WXDLLIMPEXP_FWD_BASE wxEvent;
class WXDLLIMPEXP_FWD_BASE wxEvtHandler;

// ----------------------------------------------------------------------------
// wxEventFilter is used with wxEvtHandler::AddFilter() and ProcessEvent().
// ----------------------------------------------------------------------------

class wxEventFilter
{
public:
    // Possible return values for FilterEvent().
    //
    // Notice that the values of these enum elements are fixed due to backwards
    // compatibility constraints.
    enum
    {
        // Process event as usual.
        Event_Skip = -1,

        // Don't process the event normally at all.
        Event_Ignore = 0,

        // Event was already handled, don't process it normally.
        Event_Processed = 1
    };

    wxEventFilter()
    {
        m_next = NULL;
    }

    virtual ~wxEventFilter()
    {
        wxASSERT_MSG( !m_next, "Forgot to call wxEvtHandler::RemoveFilter()?" );
    }

    // This method allows to filter all the events processed by the program, so
    // you should try to return quickly from it to avoid slowing down the
    // program to a crawl.
    //
    // Return value should be -1 to continue with the normal event processing,
    // or true or false to stop further processing and pretend that the event
    // had been already processed or won't be processed at all, respectively.
    virtual int FilterEvent(wxEvent& event) = 0;

private:
    // Objects of this class are made to be stored in a linked list in
    // wxEvtHandler so put the next node ponter directly in the class itself.
    wxEventFilter* m_next;

    // And provide access to it for wxEvtHandler [only].
    friend class wxEvtHandler;

    wxDECLARE_NO_COPY_CLASS(wxEventFilter);
};

#endif // _WX_EVENTFILTER_H_


text:
export const zIndexWindowControls = 120
export const zIndexTooltip = 110
export const zIndexMenu = 109
export const zIndexMenuBackdrop = 108
export const zIndexDialog = 100
// NOTE(2Pac): It's ok this is the same value as z-index of the dialog itself, since the same
// component controls both of them, and their DOM ordering is pretty guaranteed. While also allowing
// us to display the scrim above the non-top dialogs in case more than one are open.
export const zIndexDialogScrim = 100
export const zIndexSnackbar = 90
export const zIndexBottomSheet = 80
export const zIndexScrollMask = 75
export const zIndexSideNav = 70
export const zIndexBackdrop = 60
export const zIndexFab = 40
export const zIndexAppBar = 30


text:
package storage

import (
	"math"

	"github.com/prometheus/prometheus/tsdb/chunkenc"
)

// BufferedSeriesIterator wraps an iterator with a look-back buffer.
type BufferedSeriesIterator struct {
	it    chunkenc.Iterator
	buf   *sampleRing
	delta int64

	lastTime int64
	ok       bool
}

// NewBuffer returns a new iterator that buffers the values within the time range
// of the current element and the duration of delta before, initialized with an
// empty iterator. Use Reset() to set an actual iterator to be buffered.
func NewBuffer(delta int64) *BufferedSeriesIterator {
	return NewBufferIterator(chunkenc.NewNopIterator(), delta)
}

// NewBufferIterator returns a new iterator that buffers the values within the
// time range of the current element and the duration of delta before.
func NewBufferIterator(it chunkenc.Iterator, delta int64) *BufferedSeriesIterator {
	bit := &BufferedSeriesIterator{
		buf:   newSampleRing(delta, 16),
		delta: delta,
	}
	bit.Reset(it)

	return bit
}

// Reset re-uses the buffer with a new iterator, resetting the buffered time
// delta to its original value.
func (b *BufferedSeriesIterator) Reset(it chunkenc.Iterator) {
	b.it = it
	b.lastTime = math.MinInt64
	b.ok = true
	b.buf.reset()
	b.buf.delta = b.delta
	it.Next()
}

// ReduceDelta lowers the buffered time delta, for the current SeriesIterator only.
func (b *BufferedSeriesIterator) ReduceDelta(delta int64) bool {
	return b.buf.reduceDelta(delta)
}

// PeekBack returns the nth previous element of the iterator. If there is none buffered,
// ok is false.
func (b *BufferedSeriesIterator) PeekBack(n int) (t int64, v float64, ok bool) {
	return b.buf.nthLast(n)
}

// Buffer returns an iterator over the buffered data. Invalidates previously
// returned iterators.
func (b *BufferedSeriesIterator) Buffer() chunkenc.Iterator {
	return b.buf.iterator()
}

// Seek advances the iterator to the element at time t or greater.
func (b *BufferedSeriesIterator) Seek(t int64) bool {
	t0 := t - b.buf.delta

	// If the delta would cause us to seek backwards, preserve the buffer
	// and just continue regular advancement while filling the buffer on the way.
	if t0 > b.lastTime {
		b.buf.reset()

		b.ok = b.it.Seek(t0)
		if !b.ok {
			return false
		}
		b.lastTime, _ = b.Values()
	}

	if b.lastTime >= t {
		return true
	}
	for b.Next() {
		if b.lastTime >= t {
			return true
		}
	}

	return false
}

// Next advances the iterator to the next element.
func (b *BufferedSeriesIterator) Next() bool {
	if !b.ok {
		return false
	}

	// Add current element to buffer before advancing.
	b.buf.add(b.it.At())

	b.ok = b.it.Next()
	if b.ok {
		b.lastTime, _ = b.Values()
	}

	return b.ok
}

// Values returns the current element of the iterator.
func (b *BufferedSeriesIterator) Values() (int64, float64) {
	return b.it.At()
}

// Err returns the last encountered error.
func (b *BufferedSeriesIterator) Err() error {
	return b.it.Err()
}

type sample struct {
	t int64
	v float64
}

func (s sample) T() int64 {
	return s.t
}

func (s sample) V() float64 {
	return s.v
}

type sampleRing struct {
	delta int64

	buf []sample // lookback buffer
	i   int      // position of most recent element in ring buffer
	f   int      // position of first element in ring buffer
	l   int      // number of elements in buffer

	it sampleRingIterator
}

func newSampleRing(delta int64, sz int) *sampleRing {
	r := &sampleRing{delta: delta, buf: make([]sample, sz)}
	r.reset()

	return r
}

func (r *sampleRing) reset() {
	r.l = 0
	r.i = -1
	r.f = 0
}

// Returns the current iterator. Invalidates previously returned iterators.
func (r *sampleRing) iterator() chunkenc.Iterator {
	r.it.r = r
	r.it.i = -1
	return &r.it
}

type sampleRingIterator struct {
	r *sampleRing
	i int
}

func (it *sampleRingIterator) Next() bool {
	it.i++
	return it.i < it.r.l
}

func (it *sampleRingIterator) Seek(int64) bool {
	return false
}

func (it *sampleRingIterator) Err() error {
	return nil
}

func (it *sampleRingIterator) At() (int64, float64) {
	return it.r.at(it.i)
}

func (r *sampleRing) at(i int) (int64, float64) {
	j := (r.f + i) % len(r.buf)
	s := r.buf[j]
	return s.t, s.v
}

// add adds a sample to the ring buffer and frees all samples that fall
// out of the delta range.
func (r *sampleRing) add(t int64, v float64) {
	l := len(r.buf)
	// Grow the ring buffer if it fits no more elements.
	if l == r.l {
		buf := make([]sample, 2*l)
		copy(buf[l+r.f:], r.buf[r.f:])
		copy(buf, r.buf[:r.f])

		r.buf = buf
		r.i = r.f
		r.f += l
		l = 2 * l
	} else {
		r.i++
		if r.i >= l {
			r.i -= l
		}
	}

	r.buf[r.i] = sample{t: t, v: v}
	r.l++

	// Free head of the buffer of samples that just fell out of the range.
	tmin := t - r.delta
	for r.buf[r.f].t < tmin {
		r.f++
		if r.f >= l {
			r.f -= l
		}
		r.l--
	}
}

// reduceDelta lowers the buffered time delta, dropping any samples that are
// out of the new delta range.
func (r *sampleRing) reduceDelta(delta int64) bool {
	if delta > r.delta {
		return false
	}
	r.delta = delta

	if r.l == 0 {
		return true
	}

	// Free head of the buffer of samples that just fell out of the range.
	l := len(r.buf)
	tmin := r.buf[r.i].t - delta
	for r.buf[r.f].t < tmin {
		r.f++
		if r.f >= l {
			r.f -= l
		}
		r.l--
	}
	return true
}

// nthLast returns the nth most recent element added to the ring.
func (r *sampleRing) nthLast(n int) (int64, float64, bool) {
	if n > r.l {
		return 0, 0, false
	}
	t, v := r.at(r.l - n)
	return t, v, true
}

func (r *sampleRing) samples() []sample {
	res := make([]sample, r.l)

	k := r.f + r.l
	var j int
	if k > len(r.buf) {
		k = len(r.buf)
		j = r.l - k + r.f
	}

	n := copy(res, r.buf[r.f:k])
	copy(res[n:], r.buf[:j])

	return res
}