text:
package org.apache.oodt.cas.resource.structs.exceptions;

/**
 * @author mattmann
 * @version $Revision$
 *
 *
Exception thrown when executing a {@link Job}.

 */
public class JobExecutionException extends JobException {

	/* serial version UID */
	private static final long serialVersionUID = 411415656412173490L;

	/**
	 *
	 */
	public JobExecutionException() {
		super();
		// TODO Auto-generated constructor stub
	}

	/**
	 * @param message
	 * @param cause
	 */
	public JobExecutionException(String message, Throwable cause) {
		super(message, cause);
		// TODO Auto-generated constructor stub
	}

	/**
	 * @param arg0
	 */
	public JobExecutionException(String arg0) {
		super(arg0);
		// TODO Auto-generated constructor stub
	}

	/**
	 * @param arg0
	 */
	public JobExecutionException(Throwable arg0) {
		super(arg0);
		// TODO Auto-generated constructor stub
	}

}


text:
package app.simone.multiplayer.view.nearby;

import android.content.Intent;
import android.support.test.filters.LargeTest;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import android.util.Log;
import android.widget.Button;

import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;

import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;

import app.simone.R;
import app.simone.shared.utils.Constants;

import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertTrue;

/**
 * Created by gzano on 29/08/2017.
 */
@RunWith(AndroidJUnit4.class)
@LargeTest
public class NearbyViewIntegratedTest {
    private String fakeMatchID = "fab3fc76-d17c-448b-b364-6b600343397c";
    private CharSequence waiting = "waiting for your color...";
    private NearbyGameActivity nearbyGameActivity;
    private DatabaseReference databaseRootReference = FirebaseDatabase.getInstance().getReference(Constants.NODE_ROOT);
    private Button button;
    @Rule
    public ActivityTestRule<NearbyGameActivity> activityTestRule = new ActivityTestRule<>(NearbyGameActivity.class, true, false);

    @Before
    public void setUp() {
        Intent intent = new Intent();
        intent.putExtra("match", fakeMatchID);
        activityTestRule.launchActivity(intent);
        nearbyGameActivity = activityTestRule.getActivity();
        button = (Button) nearbyGameActivity.findViewById(R.id.beautifulButton);
        assertNotNull(button);
        assertNotNull(nearbyGameActivity.getIntent().getStringExtra("match"));
    }

    @Test
    public void isButtonDisplayed() {

        onView(withId(R.id.beautifulButton)).perform(click()).check(matches(isDisplayed()));

    }

    @Test
    public void wrongStatus() {
        CharSequence textBefore = button.getText();
        onView(withId(R.id.beautifulButton)).perform(click());
        CharSequence whatAShame = "what a shame you lost the game";
        Log.d("BUTTONTEXT", " before " + textBefore + " after " + whatAShame);
        assertTrue(!textBefore.equals(whatAShame));
    }

}

redpajama_set_name: RedPajamaGithub


text:
stylish
=======

my styles for stylish


text:
package org.broad.igv.util.blat;

import com.google.gson.*;
import org.broad.igv.logging.*;
import org.broad.igv.feature.PSLRecord;
import org.broad.igv.feature.Strand;
import org.broad.igv.feature.genome.Genome;
import org.broad.igv.feature.genome.GenomeManager;
import org.broad.igv.feature.tribble.PSLCodec;
import org.broad.igv.prefs.Constants;
import org.broad.igv.prefs.PreferencesManager;
import org.broad.igv.track.BlatTrack;
import org.broad.igv.track.SequenceTrack;
import org.broad.igv.ui.IGV;
import org.broad.igv.ui.util.MessageUtils;
import org.broad.igv.util.*;

import java.io.IOException;
import java.net.URL;
import java.net.URLEncoder;
import java.util.*;

/**
 * Port of perl script blatPlot.pl   http://genomewiki.cse.ucsc.edu/index.php/Blat_Scripts
 *
 * @author jrobinso
 * Date: 11/21/12
 * Time: 8:28 AM
 */
public class BlatClient {

    private static Logger log = LogManager.getLogger(BlatClient.class);
    public static final int MINIMUM_BLAT_LENGTH = 20;

    public static List<PSLRecord> blat(String db, String userSeq) throws IOException {

        String serverType = PreferencesManager.getPreferences().get(Constants.BLAT_SERVER_TYPE, "");
        String urlpref = PreferencesManager.getPreferences().get(Constants.BLAT_URL);
        if (urlpref == null || urlpref.trim().length() == 0) {
            MessageUtils.showMessage("BLAT url is not configured");
            return Collections.EMPTY_LIST;
        }
        urlpref = urlpref.trim();

        if (serverType.equalsIgnoreCase("web_blat") || !urlpref.contains("$SEQUENCE")) {
            return LegacyBlatClient.blat(userSeq);

        } else {

            String dbEncoded = URLEncoder.encode(db, "UTF-8");
            urlpref = urlpref.replace("$SEQUENCE", userSeq).replace("$DB", dbEncoded);

            //Strip leading "file://" protocol, if any
            if (urlpref.startsWith("file://")) {
                urlpref = urlpref.substring("file://".length() + 1);
            }

            String jsonString = null;

            try {

                // If urlpref is not a URL, assume it is a command line program.  An example might be
                // blat.sh $SEQUENCE $DB

                if (URLUtils.isURL(urlpref)) {
                    jsonString = HttpUtils.getInstance().getContentsAsJSON(new URL(urlpref));
                } else {
                    jsonString = RuntimeUtils.exec(urlpref);
                }

                JsonObject obj = (new JsonParser()).parse(jsonString).getAsJsonObject();

                // If response includes "genome" property, verify against DB argument
                if (obj.has("genome")) {
                    String responseGenome = obj.get("genome").getAsString();
                    if (!(responseGenome.equalsIgnoreCase(db) || responseGenome.equalsIgnoreCase(dbEncoded))) {
                        throw new BlatException("Genome '" + db + "' not supported by BLAT server.");
                    }
                }

                // Collect PSL lines, stripping quotes from individual tokens in the process.
                JsonArray arr = obj.get("blat").getAsJsonArray();
                Iterator<JsonElement> iter = arr.iterator();
                List<String[]> results = new ArrayList<>();
                while (iter.hasNext()) {
                    JsonArray row = iter.next().getAsJsonArray();
                    String[] tokens = new String[row.size()];
                    for (int i = 0; i < row.size(); i++) {
                        String tmp = row.get(i).getAsString();
                        tokens[i] = StringUtils.stripQuotes(tmp);
                    }
                    results.add(tokens);
                }

                // Parse PSL lines into features.  The genome, if defined, is used to substitute chromosome aliases
                Genome genome = IGV.hasInstance() ? GenomeManager.getInstance().getCurrentGenome() : null;
                List<PSLRecord> features = new ArrayList<>(results.size());
                for (String[] tokens : results) {
                    features.add(PSLCodec.getPslRecord(tokens, genome));
                }

                return features;
            } catch (JsonSyntaxException e) {
                // This might be an html page, extract body text.
                String error = htmlToString(jsonString);
                throw new BlatException(error);
            } catch (InterruptedException e) {
                // Thrown from command line option
                throw new BlatException("Error executing blat command: " + e.getMessage(), e);
            }
        }
    }

    public static void doBlatQuery(final String userSeq, final String trackLabel) {

        try {
            Genome genome = GenomeManager.getInstance().getCurrentGenome();
            String db = genome.getBlatDB();
            if (db == null) {
                // If this is a known UCSC genome, or a custom blat server is configured, use the genome ID
                if (knownUCSCGenomes.contains(genome.getId()) ||
                        !PreferencesManager.getPreferences().get(Constants.BLAT_URL).equals(PreferencesManager.getDefault(Constants.BLAT_URL))) {
                    db = genome.getId();
                }
            }

            List<PSLRecord> features = blat(db, userSeq);
            if (features.isEmpty()) {
                MessageUtils.showMessage("No features found");
            } else {
                BlatTrack newTrack = new BlatTrack(db, userSeq, features, trackLabel); //species, userSeq, db, genome, trackLabel);
                IGV.getInstance().getTrackPanel(IGV.FEATURE_PANEL_NAME).addTrack(newTrack);
                IGV.getInstance().repaint();
                BlatQueryWindow win = new BlatQueryWindow(IGV.getInstance().getMainFrame(), userSeq, newTrack.getFeatures());
                win.setVisible(true);
            }
        } catch (Exception e1) {
            log.error("BLAT error.", e1);
            MessageUtils.showMessage(e1.getLocalizedMessage());
        }
    }

    public static void doBlatQueryFromRegion(final String chr, final int start, final int end, Strand strand) {

        if ((end - start) > 8000) {
            MessageUtils.showMessage("BLAT searches are limited to 8kb.  Please try a shorter sequence.");
            return;
        }

        Genome genome = GenomeManager.getInstance().getCurrentGenome();
        final byte[] seqBytes = genome.getSequence(chr, start, end);
        String userSeq = new String(seqBytes);

        if (strand == Strand.NEGATIVE) {
            userSeq = SequenceTrack.getReverseComplement(userSeq);
        }

        doBlatQuery(userSeq, "BLAT");
    }

    private static String htmlToString(String str) {

        // Remove script tags
        int idx1;
        int count = 0;
        while ((idx1 = str.indexOf("<script")) >= 0 && count < 10) {
            int idx2 = str.indexOf("</script>", idx1);
            if (idx1 > 0 && idx2 > idx1) {
                str = str.substring(0, idx1) + str.substring(idx2 + 9);
            }
            count++;
        }
        str = str.replaceAll("\\<.*?>", "").replace('\n', ' ');
        return str;

    }

    static Set knownUCSCGenomes = new HashSet<>(Arrays.asList("hg18", "hg19", "hg38", "ce10", "ce11", "galGal4",
            "galGal5", "galGal6", "panTro3", "panTro4", "panTro5", "panTro6", "felCat6", "bosTau7", "bosTau8",
            "bosTau9", "dm3", "dm6", "canFam3", "canFam5", "mm8", "mm9", "mm10", "mm39", "rn5", "rn6", "rn7",
            "rheMac3", "rheMac8", "rheMac10", "sacCer3", "susScr3", "xenTro9", "danRer10", "danRer11",
            "gorGor4", "gorGor6", "panPan2", "susScr11", "strPur2"));

}


text:
class MsgsearchesController < ApplicationController

  def show
    if params.include?(:q)
      create
      render :create
    else
      new
      render :new
    end
  end

  def new
  end

  def create
    @messages = Message.search(
      params[:q],
      :with => { :abuse_report_id => '@nil@', :system_message  => false } ,
      :page => (params[:page] || 1),
      :per_page => 10,
      :order => 'created_at DESC'
    )
  end

end


text:
package main

import (
	"flag"
	"log"
	"net/http"
	"os"

	"github.com/DanielDanteDosSantosViana/hire.me/config"
	"github.com/DanielDanteDosSantosViana/hire.me/router"
)

func main() {
	configFile := flag.String("config", "conf.toml", "Path para o arquivo de configuração")
	flag.Parse()
	if *configFile == "" {
		flag.PrintDefaults()
		os.Exit(1)
	}

	config.Load(*configFile)
	router.IniciarRotas()
	log.Println("Iniciou o serviço")
	http.ListenAndServe(config.Conf.Service.Port, nil)
}


text:
try:
    import arrow
except ImportError:
    raise ImportError("The arrow package is not installed.")

try:
    from odin.codecs.json_codec import JSON_TYPES
except ImportError:
    pass
else:
    JSON_TYPES[arrow.Arrow] = str

try:
    from odin.codecs.yaml_codec import YAML_TYPES
except ImportError:
    pass
else:
    YAML_TYPES[arrow.Arrow] = str

try:
    from odin.codecs.msgpack_codec import TYPE_SERIALIZERS
except ImportError:
    pass
else:
    TYPE_SERIALIZERS[arrow.Arrow] = str


text:
#define BOOST_TEST_MAIN
#ifdef BOOST_HEAP_INCLUDE_TESTS
#include <boost/test/included/unit_test.hpp>
#else
#include <boost/test/unit_test.hpp>
#endif

#include <algorithm>

#include <boost/heap/d_ary_heap.hpp>

#include "common_heap_tests.hpp"
#include "stable_heap_tests.hpp"
#include "mutable_heap_tests.hpp"
#include "merge_heap_tests.hpp"

template <int D, bool stable>
void run_d_ary_heap_test(void)
{
    typedef boost::heap::d_ary_heap<int, boost::heap::arity<D>,
                                         boost::heap::stable<stable>,
                                         boost::heap::compare<std::less<int> >,
                                         boost::heap::allocator<std::allocator<int> > > pri_queue;

    BOOST_CONCEPT_ASSERT((boost::heap::PriorityQueue<pri_queue>));

    run_concept_check<pri_queue>();
    run_common_heap_tests<pri_queue>();
    run_iterator_heap_tests<pri_queue>();
    run_copyable_heap_tests<pri_queue>();
    run_moveable_heap_tests<pri_queue>();
    run_reserve_heap_tests<pri_queue>();
    run_merge_tests<pri_queue>();

    run_ordered_iterator_tests<pri_queue>();

    if (stable) {
        typedef boost::heap::d_ary_heap<q_tester, boost::heap::arity<D>,
                                                  boost::heap::stable<stable>
                                       > stable_pri_queue;

        run_stable_heap_tests<stable_pri_queue>();
    }

#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
    cmpthings ord;
    boost::heap::d_ary_heap<thing, boost::heap::arity<D>, boost::heap::compare<cmpthings>, boost::heap::stable<stable> > vpq(ord);
    vpq.emplace(5, 6, 7);
#endif
}

BOOST_AUTO_TEST_CASE( d_ary_heap_test )
{
    run_d_ary_heap_test<2, false>();
    run_d_ary_heap_test<3, false>();
    run_d_ary_heap_test<4, false>();
    run_d_ary_heap_test<5, false>();
}

BOOST_AUTO_TEST_CASE( d_ary_heap_stable_test )
{
    run_d_ary_heap_test<2, true>();
    run_d_ary_heap_test<3, true>();
    run_d_ary_heap_test<4, true>();
    run_d_ary_heap_test<5, true>();
}

template <int D, bool stable>
void run_d_ary_heap_mutable_test(void)
{
    typedef boost::heap::d_ary_heap<int, boost::heap::mutable_<true>,
                                            boost::heap::arity<D>,
                                            boost::heap::stable<stable>
                                           > pri_queue;

    BOOST_CONCEPT_ASSERT((boost::heap::MutablePriorityQueue<pri_queue>));

    run_common_heap_tests<pri_queue>();
    run_moveable_heap_tests<pri_queue>();
    run_reserve_heap_tests<pri_queue>();
    run_mutable_heap_tests<pri_queue>();

    run_merge_tests<pri_queue>();

    run_ordered_iterator_tests<pri_queue>();

    if (stable) {
        typedef boost::heap::d_ary_heap<q_tester, boost::heap::mutable_<true>,
                                                boost::heap::arity<D>,
                                                boost::heap::stable<stable>
                                               > stable_pri_queue;
        run_stable_heap_tests<stable_pri_queue>();
    }
}

BOOST_AUTO_TEST_CASE( d_ary_heap_mutable_test )
{
    run_d_ary_heap_mutable_test<2, false>();
    run_d_ary_heap_mutable_test<3, false>();
    run_d_ary_heap_mutable_test<4, false>();
    run_d_ary_heap_mutable_test<5, false>();
}

BOOST_AUTO_TEST_CASE( d_ary_heap_mutable_stable_test )
{
    run_d_ary_heap_mutable_test<2, true>();
    run_d_ary_heap_mutable_test<3, true>();
    run_d_ary_heap_mutable_test<4, true>();
    run_d_ary_heap_mutable_test<5, true>();
}

BOOST_AUTO_TEST_CASE( d_ary_heap_compare_lookup_test )
{
    typedef boost::heap::d_ary_heap<int, boost::heap::arity<2>,
                                    boost::heap::compare<less_with_T>,
                                    boost::heap::allocator<std::allocator<int> > > pri_queue;
    run_common_heap_tests<pri_queue>();
}


text:
#pragma once
//------------------------------------------------------------------------------
/**
    @file Gfx/Resource/resourcePools.h
    @ingroup _priv
    @brief Gfx module resource pool classes
*/
#include "Resource/Core/ResourcePool.h"
#include "Gfx/Setup/PipelineSetup.h"
#include "Gfx/Resource/pipeline.h"
#include "Gfx/Resource/mesh.h"
#include "Gfx/Setup/MeshSetup.h"
#include "Gfx/Setup/ShaderSetup.h"
#include "Gfx/Resource/shader.h"
#include "Gfx/Resource/texture.h"
#include "Gfx/Setup/TextureSetup.h"

namespace Oryol {
namespace _priv {

class pipelinePool : public ResourcePool<pipeline, PipelineSetup> { };
class meshPool : public ResourcePool<mesh, MeshSetup> { };
class shaderPool : public ResourcePool<shader, ShaderSetup> { };
class texturePool : public ResourcePool<texture, TextureSetup> { };

} // namespace _priv
} // namespace Oryol


text:
package audit

import (
	"encoding/json"
	"os"
	"sync"

	"github.com/Jeffail/leaps/lib/store"
	"github.com/Jeffail/leaps/lib/text"
)

//------------------------------------------------------------------------------

// CompressedAuditor - Audit a documents transforms into a compressed structure
// for serialisation.
type CompressedAuditor struct {
	mut        sync.Mutex
	Transforms []text.OTransform
}

// OnTransform - Is called for every transform on a document as they arrive.
func (d *CompressedAuditor) OnTransform(tform text.OTransform) error {
	d.mut.Lock()
	if lTs := len(d.Transforms); lTs > 0 {
		// Attempt to merge this new transform into the last.
		if text.MergeTransforms(&d.Transforms[lTs-1], &tform) {
			d.mut.Unlock()
			return nil
		}
	}
	d.Transforms = append(d.Transforms, tform)
	d.mut.Unlock()
	return nil
}

//------------------------------------------------------------------------------

// ToJSON - An auditor collection that takes streams of operational transforms
// and can serialise them to JSON format:
// {
//   "document_1": [...],
//   "document_2": [...]
// }
type ToJSON struct {
	mut       sync.Mutex
	documents map[string]*CompressedAuditor
}

// NewToJSON - Create a new auditor collection that serialises to JSON
// structure.
func NewToJSON() *ToJSON {
	return &ToJSON{
		documents: map[string]*CompressedAuditor{},
	}
}

// Get - Return an auditor for a document.
func (t *ToJSON) Get(binderID string) (Auditor, error) {
	t.mut.Lock()
	defer t.mut.Unlock()

	a, ok := t.documents[binderID]
	if !ok {
		a = &CompressedAuditor{}
		t.documents[binderID] = a
	}
	return a, nil
}

// Reapply - Reapply the audited changes to a document store.
func (t *ToJSON) Reapply(docStore store.Type) error {
	t.mut.Lock()
	defer t.mut.Unlock()

	for k, v := range t.documents {
		doc, err := docStore.Read(k)
		if err != nil {
			if os.IsNotExist(err) {
				continue
			}
			return err
		}
		rContent := []rune(doc.Content)
		v.mut.Lock()
		for i := range v.Transforms {
			if err = text.ApplyTransform(&rContent, &v.Transforms[i]); err != nil {
				return err
			}
		}
		v.mut.Unlock()
		doc.Content = string(rContent)
		if err = docStore.Update(doc); err != nil {
			return err
		}
	}
	return nil
}

// Serialise - Return a JSON serialised copy of all audits.
func (t *ToJSON) Serialise() ([]byte, error) {
	t.mut.Lock()
	defer t.mut.Unlock()

	collection := map[string][]text.OTransform{}

	for k, v := range t.documents {
		v.mut.Lock()
		collection[k] = v.Transforms
	}

	data, err := json.Marshal(collection)

	for _, v := range t.documents {
		v.mut.Unlock()
	}

	return data, err
}

// Deserialise - Repopulate all audits based on a JSON serialised copy.
func (t *ToJSON) Deserialise(data []byte) error {
	t.mut.Lock()
	defer t.mut.Unlock()

	collection := map[string][]text.OTransform{}
	if err := json.Unmarshal(data, &collection); err != nil {
		return err
	}

	for k, v := range collection {
		t.documents[k] = &CompressedAuditor{Transforms: v}
	}

	return nil
}

//------------------------------------------------------------------------------


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
in Rambo (Ed. ), Iheringia, Sér. Bot. 4: 116 (1959)

#### Original name
Asterostromella taquarae var. robusta Rick

### Remarks
null


text:
import React from 'react';

import { screen } from '@testing-library/react';

import '__mock__/stripesCore.mock';
import '__mock__/stripesSmartComponent.mock';
import '__mock__/intl.mock';

import renderWithRouter from 'helpers/renderWithRouter';
import AddressTypesSettings from './AddressTypesSettings';

jest.unmock('@folio/stripes/components');

const renderAddressTypesSettings = (props) => renderWithRouter(<AddressTypesSettings {...props} />);

describe('Address-types settings', () => {
  it('renders', () => {
    const props = {
      resources: {},
      match: { path: '/settings/users/addresstypes' },
      location: { pathname: '/settings/users/addresstypes' },
      mutators: {},
      okapi: {
        url: 'https://folio-testing-okapi.dev.folio.org',
        tenant: 'diku',
        okapiReady: true,
        authFailure: [],
        bindings: {},
      },
    };
    renderAddressTypesSettings(props);

    expect(screen.getByTestId('controlled-vocab')).toBeTruthy();
  });
});


text:
// {namespace name=backend/swag_migration/main}
// {block name="backend/swag_migration/controller/main"}
Ext.define('Shopware.apps.SwagMigration.controller.Main', {

    /**
     * The parent class that this class extends.
     * @string
     */
    extend: 'Ext.app.Controller',

    /**
     * Class property which holds the main application if it is created
     *
     * @default null
     * @object
     */
    mainWindow: null,

    /**
     * A template method that is called when your application boots.
     * It is called before the Application's launch function is executed
     * so gives a hook point to run any code before your Viewport is created.
     *
     * @return void
     */
    init: function () {
        var me = this;

        me.subApplication.profileStore = me.getStore('Shopware.apps.SwagMigration.store.Profile').load();
        // these stores needs to be loaded dynamically depending on the database credentials
        me.subApplication.databaseStore = me.getStore('Shopware.apps.SwagMigration.store.Database');
        me.subApplication.mappingStoreLeft = me.getStore('Shopware.apps.SwagMigration.store.MappingLeft');
        me.subApplication.mappingStoreRight = me.getStore('Shopware.apps.SwagMigration.store.MappingRight');

        me.mainWindow = me.getView('main.Window').create({
            profileStore: me.subApplication.profileStore,
            databaseStore: me.subApplication.databaseStore,
            mappingStoreLeft: me.subApplication.mappingStoreLeft,
            mappingStoreRight: me.subApplication.mappingStoreRight
        });
        me.subApplication.setAppWindow(me.mainWindow);

        me.callParent(arguments);
    }

});
// {/block}


text:
using System;
using NExpect.Interfaces;

// ReSharper disable ClassNeverInstantiated.Global

namespace NExpect.Implementations.Strings;

internal class StringMore
    : ExpectationContextWithLazyActual<string>,
      IHasActual<string>,
      IStringMore
{
    public IStringAnd And =>
        Next<StringAnd>();

    public StringMore(Func<string> actualFetcher) : base(actualFetcher)
    {
    }
}


text:
namespace base {
class DictionaryValue;
class ListValue;
}

namespace content {
class WebUIDataSource;
}

namespace chromeos {

class KioskAppManager;

class KioskAppsHandler : public content::WebUIMessageHandler,
                         public KioskAppManagerObserver {
 public:
  KioskAppsHandler();
  virtual ~KioskAppsHandler();

  void GetLocalizedValues(content::WebUIDataSource* source);

  // content::WebUIMessageHandler overrides:
  virtual void RegisterMessages() OVERRIDE;

  // KioskAppPrefsObserver overrides:
  virtual void OnKioskAppDataChanged(const std::string& app_id) OVERRIDE;
  virtual void OnKioskAppDataLoadFailure(const std::string& app_id) OVERRIDE;
  virtual void OnKioskAppsSettingsChanged() OVERRIDE;

 private:
  // Sends all kiosk apps and settings to webui.
  void SendKioskAppSettings();

  // JS callbacks.
  void HandleInitializeKioskAppSettings(const base::ListValue* args);
  void HandleGetKioskAppSettings(const base::ListValue* args);
  void HandleAddKioskApp(const base::ListValue* args);
  void HandleRemoveKioskApp(const base::ListValue* args);
  void HandleEnableKioskAutoLaunch(const base::ListValue* args);
  void HandleDisableKioskAutoLaunch(const base::ListValue* args);
  void HandleSetDisableBailoutShortcut(const base::ListValue* args);

  // Callback for KioskAppManager::GetConsumerKioskModeStatus().
  void OnGetConsumerKioskModeStatus(
      chromeos::KioskAppManager::ConsumerKioskModeStatus status);

  KioskAppManager* kiosk_app_manager_;  // not owned.
  bool initialized_;
  bool is_kiosk_enabled_;
  base::WeakPtrFactory<KioskAppsHandler> weak_ptr_factory_;

  DISALLOW_COPY_AND_ASSIGN(KioskAppsHandler);
};

}  // namespace chromeos

#endif  // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_CHROMEOS_KIOSK_APPS_HANDLER_H_


text:
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using System.Linq;
using System.Text;

namespace Blink.Classes
{
    public class mapSet
    {
        List<string> mapNames;
        string setName;
        Random picker;
        Texture2D background;
        Texture2D[] thumbnails = new Texture2D[5];
        int column;
        bool selected = false;

        public mapSet(string name)
        {
            setName = name;
            mapNames = new List<string>();
            picker = new Random();
        }

        public string getName()
        {
            return setName;
        }

        public void setBackground(Texture2D b)
        {
            background = b;
        }

        public void setColumn(int c)
        {
            column = c;
        }

        public int getColumn()
        {
            return column;
        }

        public void select()
        {
            selected = true;
        }

        public void unselect()
        {
            selected = false;
        }

        public bool isSelected()
        {
            return selected;
        }

        public List<string> Maps()
        {
            return mapNames;
        }

        public Texture2D[] Thumbs()
        {
            return thumbnails;
        }

        //Random functionality TBD
        public void getRandomThumbs(ContentManager Content)
        {
            for(int i = 0; i < 5; i++)
            {
                //Texture2D mapThumbtext = Content.Load<Texture2D>("MapData/" + pickMap() + "Thumb");
                Texture2D mapThumbtext = Content.Load<Texture2D>("MapData/" + mapNames[i] + "Color");
                thumbnails[i] = mapThumbtext;
            }

        }

        public Texture2D getBackground()
        {
            return background;
        }

        public void addMap(string mapName)
        {
            mapNames.Add(mapName);
        }

        public string pickMap()
        {
            int mapNum = picker.Next(mapNames.Count);
            return mapNames.ElementAt(mapNum);
        }
    }
}


text:
.class public final Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;
.super Lcom/android/internal/os/BatteryStatsImpl$Timer;
.source "BatteryStatsImpl.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/internal/os/BatteryStatsImpl;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x19
    name = "SamplingTimer"
.end annotation

# instance fields
.field mCurrentReportedCount:I

.field mCurrentReportedTotalTime:J

.field mInDischarge:Z

.field mTrackingReportedValues:Z

.field mUnpluggedReportedCount:I

.field mUnpluggedReportedTotalTime:J

.field mUpdateVersion:I

# direct methods
.method constructor <init>(Ljava/util/ArrayList;ZLandroid/os/Parcel;)V
    .locals 4
    .parameter
    .parameter "inDischarge"
    .parameter "in"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/android/internal/os/BatteryStatsImpl$Unpluggable;",
            ">;Z",
            "Landroid/os/Parcel;",
            ")V"
        }
    .end annotation

    .prologue
    .local p1, unpluggables:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Lcom/android/internal/os/BatteryStatsImpl$Unpluggable;>;"
    const/4 v0, 0x1

    const/4 v1, 0x0

    .line 725
    invoke-direct {p0, v1, p1, p3}, Lcom/android/internal/os/BatteryStatsImpl$Timer;-><init>(ILjava/util/ArrayList;Landroid/os/Parcel;)V

    .line 726
    invoke-virtual {p3}, Landroid/os/Parcel;->readInt()I

    move-result v2

    iput v2, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mCurrentReportedCount:I

    .line 727
    invoke-virtual {p3}, Landroid/os/Parcel;->readInt()I

    move-result v2

    iput v2, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mUnpluggedReportedCount:I

    .line 728
    invoke-virtual {p3}, Landroid/os/Parcel;->readLong()J

    move-result-wide v2

    iput-wide v2, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mCurrentReportedTotalTime:J

    .line 729
    invoke-virtual {p3}, Landroid/os/Parcel;->readLong()J

    move-result-wide v2

    iput-wide v2, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mUnpluggedReportedTotalTime:J

    .line 730
    invoke-virtual {p3}, Landroid/os/Parcel;->readInt()I

    move-result v2

    if-ne v2, v0, :cond_0

    :goto_0
    iput-boolean v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mTrackingReportedValues:Z

    .line 731
    iput-boolean p2, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mInDischarge:Z

    .line 732
    return-void

    :cond_0
    move v0, v1

    .line 730
    goto :goto_0
.end method

.method constructor <init>(Ljava/util/ArrayList;ZZ)V
    .locals 1
    .parameter
    .parameter "inDischarge"
    .parameter "trackReportedValues"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/android/internal/os/BatteryStatsImpl$Unpluggable;",
            ">;ZZ)V"
        }
    .end annotation

    .prologue
    .line 736
    .local p1, unpluggables:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Lcom/android/internal/os/BatteryStatsImpl$Unpluggable;>;"
    const/4 v0, 0x0

    invoke-direct {p0, v0, p1}, Lcom/android/internal/os/BatteryStatsImpl$Timer;-><init>(ILjava/util/ArrayList;)V

    .line 737
    iput-boolean p3, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mTrackingReportedValues:Z

    .line 738
    iput-boolean p2, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mInDischarge:Z

    .line 739
    return-void
.end method

# virtual methods
.method protected computeCurrentCountLocked()I
    .locals 3

    .prologue
    .line 803
    iget v1, p0, Lcom/android/internal/os/BatteryStatsImpl$Timer;->mCount:I

    iget-boolean v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mInDischarge:Z

    if-eqz v0, :cond_0

    iget-boolean v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mTrackingReportedValues:Z

    if-eqz v0, :cond_0

    iget v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mCurrentReportedCount:I

    iget v2, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mUnpluggedReportedCount:I

    sub-int/2addr v0, v2

    :goto_0
    add-int/2addr v0, v1

    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method protected computeRunTimeLocked(J)J
    .locals 6
    .parameter "curBatteryRealtime"

    .prologue
    .line 798
    iget-wide v2, p0, Lcom/android/internal/os/BatteryStatsImpl$Timer;->mTotalTime:J

    iget-boolean v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mInDischarge:Z

    if-eqz v0, :cond_0

    iget-boolean v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mTrackingReportedValues:Z

    if-eqz v0, :cond_0

    iget-wide v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mCurrentReportedTotalTime:J

    iget-wide v4, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mUnpluggedReportedTotalTime:J

    sub-long/2addr v0, v4

    :goto_0
    add-long/2addr v0, v2

    return-wide v0

    :cond_0
    const-wide/16 v0, 0x0

    goto :goto_0
.end method

.method public getUpdateVersion()I
    .locals 1

    .prologue
    .line 752
    iget v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mUpdateVersion:I

    return v0
.end method

.method public logState(Landroid/util/Printer;Ljava/lang/String;)V
    .locals 3
    .parameter "pw"
    .parameter "prefix"

    .prologue
    .line 790
    invoke-super {p0, p1, p2}, Lcom/android/internal/os/BatteryStatsImpl$Timer;->logState(Landroid/util/Printer;Ljava/lang/String;)V

    .line 791
    new-instance v0, Ljava/lang/StringBuilder;

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

    invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "mCurrentReportedCount="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget v1, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mCurrentReportedCount:I

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, " mUnpluggedReportedCount="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget v1, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mUnpluggedReportedCount:I

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, " mCurrentReportedTotalTime="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-wide v1, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mCurrentReportedTotalTime:J

    invoke-virtual {v0, v1, v2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, " mUnpluggedReportedTotalTime="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-wide v1, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mUnpluggedReportedTotalTime:J

    invoke-virtual {v0, v1, v2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-interface {p1, v0}, Landroid/util/Printer;->println(Ljava/lang/String;)V

    .line 795
    return-void
.end method

.method public plug(JJ)V
    .locals 1
    .parameter "batteryUptime"
    .parameter "batteryRealtime"

    .prologue
    .line 785
    invoke-super {p0, p1, p2, p3, p4}, Lcom/android/internal/os/BatteryStatsImpl$Timer;->plug(JJ)V

    .line 786
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mInDischarge:Z

    .line 787
    return-void
.end method

.method readSummaryFromParcelLocked(Landroid/os/Parcel;)V
    .locals 3
    .parameter "in"

    .prologue
    const/4 v0, 0x1

    .line 830
    invoke-super {p0, p1}, Lcom/android/internal/os/BatteryStatsImpl$Timer;->readSummaryFromParcelLocked(Landroid/os/Parcel;)V

    .line 831
    invoke-virtual {p1}, Landroid/os/Parcel;->readLong()J

    move-result-wide v1

    iput-wide v1, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mCurrentReportedTotalTime:J

    iput-wide v1, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mUnpluggedReportedTotalTime:J

    .line 832
    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v1

    iput v1, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mCurrentReportedCount:I

    iput v1, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mUnpluggedReportedCount:I

    .line 833
    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v1

    if-ne v1, v0, :cond_0

    :goto_0
    iput-boolean v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mTrackingReportedValues:Z

    .line 834
    return-void

    .line 833
    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method reset(Lcom/android/internal/os/BatteryStatsImpl;Z)Z
    .locals 1
    .parameter "stats"
    .parameter "detachIfReset"

    .prologue
    .line 817
    invoke-super {p0, p1, p2}, Lcom/android/internal/os/BatteryStatsImpl$Timer;->reset(Lcom/android/internal/os/BatteryStatsImpl;Z)Z

    .line 818
    invoke-virtual {p0}, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->setStale()V

    .line 819
    const/4 v0, 0x1

    return v0
.end method

.method public setStale()V
    .locals 3

    .prologue
    const/4 v2, 0x0

    .line 742
    iput-boolean v2, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mTrackingReportedValues:Z

    .line 743
    const-wide/16 v0, 0x0

    iput-wide v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mUnpluggedReportedTotalTime:J

    .line 744
    iput v2, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mUnpluggedReportedCount:I

    .line 745
    return-void
.end method

.method public setUpdateVersion(I)V
    .locals 0
    .parameter "version"

    .prologue
    .line 748
    iput p1, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mUpdateVersion:I

    .line 749
    return-void
.end method

.method public unplug(JJ)V
    .locals 2
    .parameter "batteryUptime"
    .parameter "batteryRealtime"

    .prologue
    .line 776
    invoke-super {p0, p1, p2, p3, p4}, Lcom/android/internal/os/BatteryStatsImpl$Timer;->unplug(JJ)V

    .line 777
    iget-boolean v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mTrackingReportedValues:Z

    if-eqz v0, :cond_0

    .line 778
    iget-wide v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mCurrentReportedTotalTime:J

    iput-wide v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mUnpluggedReportedTotalTime:J

    .line 779
    iget v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mCurrentReportedCount:I

    iput v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mUnpluggedReportedCount:I

    .line 781
    :cond_0
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mInDischarge:Z

    .line 782
    return-void
.end method

.method public updateCurrentReportedCount(I)V
    .locals 1
    .parameter "count"

    .prologue
    .line 756
    iget-boolean v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mInDischarge:Z

    if-eqz v0, :cond_0

    iget v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mUnpluggedReportedCount:I

    if-nez v0, :cond_0

    .line 758
    iput p1, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mUnpluggedReportedCount:I

    .line 760
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mTrackingReportedValues:Z

    .line 762
    :cond_0
    iput p1, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mCurrentReportedCount:I

    .line 763
    return-void
.end method

.method public updateCurrentReportedTotalTime(J)V
    .locals 4
    .parameter "totalTime"

    .prologue
    .line 766
    iget-boolean v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mInDischarge:Z

    if-eqz v0, :cond_0

    iget-wide v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mUnpluggedReportedTotalTime:J

    const-wide/16 v2, 0x0

    cmp-long v0, v0, v2

    if-nez v0, :cond_0

    .line 768
    iput-wide p1, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mUnpluggedReportedTotalTime:J

    .line 770
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mTrackingReportedValues:Z

    .line 772
    :cond_0
    iput-wide p1, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mCurrentReportedTotalTime:J

    .line 773
    return-void
.end method

.method writeSummaryFromParcelLocked(Landroid/os/Parcel;J)V
    .locals 2
    .parameter "out"
    .parameter "batteryRealtime"

    .prologue
    .line 823
    invoke-super {p0, p1, p2, p3}, Lcom/android/internal/os/BatteryStatsImpl$Timer;->writeSummaryFromParcelLocked(Landroid/os/Parcel;J)V

    .line 824
    iget-wide v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mCurrentReportedTotalTime:J

    invoke-virtual {p1, v0, v1}, Landroid/os/Parcel;->writeLong(J)V

    .line 825
    iget v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mCurrentReportedCount:I

    invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeInt(I)V

    .line 826
    iget-boolean v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mTrackingReportedValues:Z

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeInt(I)V

    .line 827
    return-void

    .line 826
    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public writeToParcel(Landroid/os/Parcel;J)V
    .locals 2
    .parameter "out"
    .parameter "batteryRealtime"

    .prologue
    .line 808
    invoke-super {p0, p1, p2, p3}, Lcom/android/internal/os/BatteryStatsImpl$Timer;->writeToParcel(Landroid/os/Parcel;J)V

    .line 809
    iget v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mCurrentReportedCount:I

    invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeInt(I)V

    .line 810
    iget v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mUnpluggedReportedCount:I

    invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeInt(I)V

    .line 811
    iget-wide v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mCurrentReportedTotalTime:J

    invoke-virtual {p1, v0, v1}, Landroid/os/Parcel;->writeLong(J)V

    .line 812
    iget-wide v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mUnpluggedReportedTotalTime:J

    invoke-virtual {p1, v0, v1}, Landroid/os/Parcel;->writeLong(J)V

    .line 813
    iget-boolean v0, p0, Lcom/android/internal/os/BatteryStatsImpl$SamplingTimer;->mTrackingReportedValues:Z

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeInt(I)V

    .line 814
    return-void

    .line 813
    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method


text:
<?php

namespace Magium\Magento\Navigators\Admin\Customer;

class ByName extends AbstractCustomerNavigation
{

    public function getSelectorID()
    {
        return 'customerGrid_filter_name';
    }

}


text:
require 'rails_helper'

describe ChiefTransformer::Processor::TameUpdate do
  before(:all) { preload_standing_data }
  after(:all)  { clear_standing_data }

  let(:sample_operation_date) { Date.new(2013,8,5) }

  let(:chief_update) {
    create :chief_update, :applied, issue_date: sample_operation_date
  }

  describe '#process' do
    context 'TAME has last effective date' do
      let(:last_effective_date) { DateTime.parse("2009-11-15 11:00:00") }

      let!(:measure) {
        create :measure,
          :national,
          validity_start_date: DateTime.parse("2008-12-15 11:00:00"),
          goods_nomenclature_item_id: '0101010100',
          measure_type_id: 'VTS'
      }

      let!(:tame) { create(:tame, amend_indicator: "U",
                                  fe_tsmp: DateTime.parse("2008-11-15 11:00:00"),
                                  le_tsmp: last_effective_date,
                                  msrgp_code: "VT",
                                  msr_type: "S",
                                  tty_code: "813",
                                  adval_rate: 15.000,
                                  origin: chief_update.filename) }

      before { ChiefTransformer::Processor::TameUpdate.new(tame).process }

      it 'ends measure setting its validity end date to TAME last effective timestap' do
        expect(measure.reload.validity_end_date.to_date).to eq last_effective_date.to_date
      end
    end
  end
end


text:
from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('dojo', '0123_scan_type'),
    ]

    operations = [
        migrations.AlterField(
            model_name='sonarqube_issue',
            name='type',
            field=models.CharField(help_text='SonarQube issue type', max_length=20),
        ),
    ]


text:
package ttt;

public class TTTGame {

	// Instance variables--------------

	protected int[][] board;
	protected int rowDim;
	protected int colDim;
	protected int currentPlayer;
	protected int playerOnePiece;
	protected int playerTwoPiece;
	protected String status;
	protected int against;
	protected int move;

	// Constructors ------------------------------------------------------------------

	/**
	 * Constructs 3x3 board
	 */
	public TTTGame(){
		this(3, 3);
	}

	/**
	 * Constructs generic board
	 * @param rowDim	row dimension
	 * @param colDim	column dimension
	 */
	public TTTGame(int rowDim, int colDim){
		board = new int[rowDim][colDim];
		for (int i=0; i<3; i++) {
			for (int j=0; j<3; j++) {
				board[i][j] = -1;
			}
		}
		status = "No winner yet!";
	}

	// Instance methods ---------------------------------------------------------------
	/**
	 * Sets currentPlayer to next player!
	 * If currentPlayer = 0, currentPlayer is 1 or otherwise.
	 */
	public void nextPlayer(){
		currentPlayer = (currentPlayer + 1) % 2;
	}

	/**
	 * @return currentPlayer either 0 or 1.
	 */
	public int getCurrentPlayer(){
		return currentPlayer;
	}

	/**
	 * Adds current player's piece to each square of the board with
	 * given row, col, and player's piece.
	 * @param row  (0 <= row <= 2) are the columns of the board
	 * @param col	(0 <= col <= 2) are the rows of the board
	 * @param currentPlayer (0 or 1) is the current player
	 */
	public void markArray(int row, int col, int currentPlayer){
		board[row][col] = currentPlayer;
	}

	/**
	 * Gets the player's piece from the 2-D array at a certain i and j on the board.
	 * @param i (0 <= i <= 2) indices for arrays of the board.
	 * @param j (0 <= j <= 2) indices for elements of arrays on the board.
	 * @return  the an element of board at i and j.
	 */
	public int getPlayer(int i, int j) {
		return board[i][j];
	}

	/**
	 * Resets to a new empty board. Current player is set 0 in default.
	 * move is set to 0.
	 */
	public void reset(){
		for (int i=0; i<3; i++) {
			for (int j=0; j<3; j++) {
				board[i][j] = -1;
			}
		}
		move = 0;
		currentPlayer = 0;
		updateStatus("No winner yet!");
	}

	/**
	 * Checks to see if there is a tie.
	 * @return true if the move number is 9, else false.
	 */
	public boolean checkTie(){
		return move == 9;
	}

	/**
	 * Checks for winning for the currentPlayer either a rowWin, colWin, or both diagonal win.
	 * @param currentPlayer    ( 0 or 1 ) is the currentPlayer.
	 * @return   true is there is a rowWin, colWin or diagonal win for currentPlayer false otherwise.
	 */
	public boolean checkWin(int currentPlayer){
		return (colWin(currentPlayer)
			|| rowWin(currentPlayer)
			|| diagWin1(currentPlayer)
			|| diagWin2(currentPlayer));
	}

	/**
	 * Checks for every column if there is a win.
	 * @param 	currentPlayer ( 0 or 1) is current player index.
	 * @return  true if there is a colWin false otherwise.
	 */
	public boolean colWin(int currentPlayer){
		for (int i=0; i<3; i++) {
			if ((board[i][0] == currentPlayer) &&
					(board[i][1] == currentPlayer) &&
					(board[i][2] == currentPlayer)) {
				return true;
			}
		}
		return false;
	}

	/**
	 * Checks for every row if there is a win.
	 * @param currentPlayer (0 or 1) is current player index.
	 * @return  true if there is a rowWin false otherwise.
	 */
	public boolean rowWin(int currentPlayer){
		for (int i=0; i<3; i++) {
			if ((board[0][i] == currentPlayer) &&
					(board[1][i] == currentPlayer) &&
					(board[2][i] == currentPlayer)) {
				return true;
			}
		}
		return false;
	}

	/**
	 * Checks for descending (\) diagonal win
	 * @param currentPlayer  (0 or 1) is current player index.
	 * @return true if there is a (\) diagonal win false otherwise.
	 */
	public boolean diagWin1(int currentPlayer){
		if ((board[0][0] == currentPlayer) &&
				(board[1][1] == currentPlayer) &&
				(board[2][2] == currentPlayer)) {
			return true;
		}
		else {
			return false;
		}
	}

	/**
	 * Checks for descending (/) diagonal win
	 * @param currentPlayer  (0 or 1) is current player index.
	 * @return  true if there is a (/) diagonal win false otherwise.
	 */
	public boolean diagWin2(int currentPlayer){
		if ((board[0][2] == currentPlayer) &&
				(board[1][1] == currentPlayer) &&
				(board[2][0] == currentPlayer)) {
			return true;
		}
		else {
			return false;
		}
	}

	/**
	 * Sets the Players piece that is either 0 or 1 based on chosen piece.
	 * @param p (0 or 1) player's piece of the board.
	 */
	public void setPlayerOnePiece(int p) {
		playerOnePiece = p;
		setPlayerTwoPiece((p+1)%2);
	}

	/**
	 * Sets player two piece depending on p.
	 * @param p (0 or 1) player's piece of the board.
	 */
	public void setPlayerTwoPiece(int p) {
		playerTwoPiece = p;
	}

	/**
	 * Gets the player's piece on board  based on chosen piece.
	 * @param player (0 or 1) the player's piece denoted as the player on the board.
	 * @return  the player's piece on the board.
	 */
	public int getPiece(int player) {
		if (player == 0) {
			return playerOnePiece;
		}
		else {
			return playerTwoPiece;
		}
	}

	/**
	 * Updates the status of game to either a win or tie.
	 * @param s the string that is the status of the game.
	 */
	public void updateStatus(String s) {
		status = s;
	}

	/**
	 * Gets the status of the game for win or tie.
	 * @return the status of the game.
	 */
	public String getStatus() {
		return status;
	}
}


text:
[Hilfe](Help.md) > Charakter Assistent - Varianten und Auswahlmöglichkeiten

# Charakter Assistent - Varianten und Auswahlmöglichkeiten
Es ist möglich, dem Nutzer Auswahlmöglichkeiten via Popup anzubieten. Dies ist eine zweite XML-Datei, die gleich benannt ist, wie die jeweilige S/K/P, enthält aber zusätzlich "_var" am Ende, z.B. "Halbelf_var.xml". Diese Datei muss leider von Hand geschrieben werden. Die Dateien können auf Korrektheit überprüft werden, indem das Logging-Level in den Sephrasto-Einstellungen auf Debugging-Informationen gestellt wird - Fehler werden dann in sephrasto.log ausgegeben. Es folgen einige Beispiele, weitere können im Ilaris Advanced Baukasten gefunden werden.

**Beispiel 1:**

```
<Charakter>
  <Auswahl>
    <Attribut name="KK" wert="3"/>
    <Fertigkeit name="Schusswaffen" wert="2"/>
    <Übernatürliche-Fertigkeit name="Einfluss" wert="2"/>
    <Freie-Fertigkeit name="Sprache: Garethi" wert="2"/>
    <Talent name="Armbrüste"/>
    <Talent name="Adlerschwinge Wolfsgestalt" wert="40" kommentar="Wolf"/>
    <Vorteil name="Schildkampf I"/>
    <Vorteil name="Tierempathie" wert="20" kommentar="Pferde"/>
    <Eigenheit name="Streiter der Göttin"/>
  </Auswahl>
  <Auswahl>
    <Fertigkeit name="Schusswaffen" wert="1"/>
    <Fertigkeit name="Athletik" wert="2"/>
  </Auswahl>
</Charakter>
```

Es erscheint ein Popup, bei dem der Nutzer sich zwischen KK +3, Schusswaffen +2, etc. entscheiden muss. Die Attribute "wert" und "kommentar" werden nur bei Talenten und Vorteilen mit variablen Kosten benötigt.
Danach erscheint ein weiteres Popup, bei dem er sich zwischen Schusswaffen +1 und Athletik +2 entscheiden muss. Hat er bei der ersten Auswahl bereits Schusswaffen gewählt, so wird diese Fertigkeit aus Folge-Auswahlen entfernt. Da in diesem Fall die zweite Auswhal nur noch Athletik +2 enthält, wird dies automatisch appliziert und es erscheint kein zweites Popup.

**Beispiel 2, Spezies Halbelf:**

```
<Charakter>
  <Varianten>
    <Variante name="Firnelfische Abstammung">
      <Vorteil name="Resistenz gegen Kälte"/>
      <Fertigkeit name="Überleben" wert="1"/>
    </Variante>
    <Variante name="Nivesische Abstammung">
      <Attribut name="IN" wert="1"/>
    </Variante>
    <Variante name="Thorwalsche Abstammung">
      <Attribut name="GE" wert="-1"/>
      <Attribut name="KK" wert="1"/>
    </Variante>
  </Varianten>

  <Auswahl keine-varianten="0,1">
    <Vorteil name="Gut Aussehend"/>
  </Auswahl>

  <Auswahl varianten="2">
    <Vorteil name="Selbstbeherrschung" wert="1"/>
    <Vorteil name="Athletik" wert="1"/>
  </Auswahl>
</Charakter>
```
Eine Variante kann nur in einem Varianten-Element existieren. Sie verhält sich gleich wie eine Auswahl, nur werden alle Child-Elemente appliziert. Es erscheint ein Popup, bei dem der Nutzer die drei Varianten Firnelfische, Nivesische und Thorwalsche Abstammung zur Auswahl erhält, hierbei kann er auch keine oder mehrere auswählen.
Die erste Auswahl hat nur ein Element, zeigt also niemals ein Popup. Durch das Attribut "keine-varianten" wird Gut Aussehend allerdings nur appliziert, wenn nicht die Variante an Index 0 (Firnelfische Abstammung) oder 1 (Nivesische Abstammung) ausgewählt wurde. Es wird auch dann appliziert, wenn garkeine Variante ausgewählt wurde.
Die zweite Auswahl ist nur aktiv, wenn die Variante an Index 2 (Thorwalsche Abstammung) gewählt wurde - nur dann erscheint ein Popup, bei dem der Nutzer sich zwischen Selbstbeherrschung und Athletik entscheiden muss. Innerhalb von "Variante" ist keine Auswahl möglich (Variante appliziert immer alle Elemente) - mit dieser Methode können auch Varianten Auswahlmöglichkeiten bieten.

**Beispiel 3, Spezies Orks:**
```
<Charakter>
  <Varianten pflichtwahl="1">
    <Variante name="Mann" beschreibung="" geschlecht="männlich">
      <Eigenheit name="Jähzorn"/>
    </Variante>
    <Variante name="Frau" beschreibung="" geschlecht="weiblich">
      <Attribut name="MU" wert="-2"/>
      <Attribut name="KO" wert="-1"/>
      <Attribut name="KK" wert="-1"/>
    </Variante>
  </Varianten>
</Charakter>
```
Durch das Attribut "pflichtwahl" muss eine der Varianten ausgewählt werden, eine Mehrfachauswahl ist nicht möglich.
Das Attribut "geschlecht" kann mit den "männlich" oder "weiblich" bei Variante und Auswahl genutzt werden, um diese zu entfernen, wenn im Hauptfenster das entsprechende Geschlecht nicht ausgewählt wurde.
Das Attribut "beschreibung" kann genutzt werden um im Spezies-/Kurzbeschreibungsfeld neben dem Namen eine zusätzliche Beschreibung einzufügen, die nicht um Popup angezeigt wird. Falls das Attribut wie hier mit einem leeren Inhalt eingefügt wird, dann wird die Variante überhaupt nicht in das entsprechende Feld eingetragen.
Da es sich in diesem Beispiel um eine Pflichtwahl handelt, bei der immer nur eine Variante - Mann oder Frau - bestehen bleiben kann, wird die entsprechende Variante automatisch appliziert und kein Popup angezeigt.

**Beispiel 3, Profession Geode:**
```
<Charakter>
  <Auswahl>
    <Vorteil name="Magieabweisend" wert="-1"/>
  </Auswahl>
</Charakter>
```
Geoden sind üblicherweise Zwerge, sollten aber den Vorteil Magieabweisend dieser Spezies nicht haben. Bei Vorteilen und Talenten kann der Wert auf -1 gesetzt werden, wodurch diese entfernt werden, falls vorhanden.


text:
"""
Implements a complete console program. (Reused from Ben's older code)
"""

##########################################################################
## Imports
##########################################################################

import os
import sys

import argparse
import traceback

##########################################################################
## Helper functions
##########################################################################

def handle_default_args(args):
    """
    Include handling of any default arguments that all commands should
    implement here (for example, specifying the pythonpath).
    """

    if hasattr(args, 'pythonpath'):
        if args.pythonpath:
            sys.path.insert(0, args.pythonpath)

##########################################################################
## Console Program
##########################################################################

class ConsoleProgram(object):
    """
    The base program from which all console commands are derived.
    """

    description = None
    epilog      = None
    version     = None

    def __init__(self, **kwargs):
        self.version     = kwargs.get('version', self.__class__.version)
        self.description = kwargs.get('description', self.__class__.description)
        self.epilog      = kwargs.get('epilog', self.__class__.epilog)
        self.commands    = {} # Stores the subcommands of the program

        self._parser     = None
        self._subparsers = None

    @property
    def parser(self):
        """
        Instantiates the argparse parser
        """
        if self._parser is None:
            apkw = {
                'description': self.description,
                'epilog':      self.epilog,
                'version':     self.version,
            }
            self._parser = argparse.ArgumentParser(**apkw)
        return self._parser

    @property
    def subparsers(self):
        """
        Insantiates the subparsers for all commands
        """
        if self._subparsers is None:
            apkw = {
                'title': 'commands',
                'description': 'Commands for the %s program' % self.parser.prog,
            }
            self._subparsers = self.parser.add_subparsers(**apkw)
        return self._subparsers

    def register(self, command):
        """
        Registers a command with the program
        """
        command = command()
        if command.name in self.commands:
            raise ValueError("Command %s already registered!" % command.name)

        command.create_parser(self.subparsers)
        self.commands[command.name] = command

    def exit(self, code=0, message=None):
        """
        Exit the console program sanely.
        """

        ## If we have a parser, use it to exit
        if self._parser:
            if code > 0:
                self.parser.error(message)
            else:
                self.parser.exit(code, message)

        ## Else we are exiting before parser creation
        else:
            if message is not None:
                if code > 0:
                    sys.stderr.write(message)
                else:
                    sys.stdout.write(message)
            sys.exit(code)

        ## If we're here we didn't exit for some reason?
        raise Exception("Unable to exit the %s" % self.__class__.__name__)

    def execute(self):
        """
        Entry point to the execution of the program.
        """

        # Handle input from the command line
        args = self.parser.parse_args()                # Parse the arguments

        try:
            if not hasattr(args, 'func'):
                raise NotImplementedError("No commands registered with this program!")

            handle_default_args(args)                  # Handle the default args
            msg = "{}\n".format(args.func(args))       # Call the default function
            self.parser.exit(0, msg)                   # Exit cleanly with message

        except Exception as e:
            if hasattr(args, 'traceback') and args.traceback:
                traceback.print_exc()
            self.parser.error(str(e))                  # Exit with error