text:
<?php

namespace App\Filters;

use CodeIgniter\Filters\FilterInterface;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;

class MyFilter implements FilterInterface
{
    public function before(RequestInterface $request, $arguments = null)
    {
        // Do something here
    }

    public function after(RequestInterface $request, ResponseInterface $response, $arguments = null)
    {
        // Do something here
    }
}


text:
import os

from .base import MigrationExecutor
from .multiproc import MultiprocessingExecutor  # noqa
from .standard import StandardExecutor

def get_executor(codename=None):
    codename = codename or os.environ.get('EXECUTOR', StandardExecutor.codename)

    for klass in MigrationExecutor.__subclasses__():
        if klass.codename == codename:
            return klass

    raise NotImplementedError('No executor with codename %s' % codename)

redpajama_set_name: RedPajamaGithub


text:
namespace performance_manager {

namespace {

PerformanceManagerRegistryImpl* g_instance = nullptr;

}  // namespace

PerformanceManagerRegistryImpl::PerformanceManagerRegistryImpl() {
  DCHECK(!g_instance);
  g_instance = this;

  // The registry should be created after the PerformanceManager.
  DCHECK(PerformanceManager::IsAvailable());
}

PerformanceManagerRegistryImpl::~PerformanceManagerRegistryImpl() {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  // TearDown() should have been invoked to reset |g_instance| and clear
  // |web_contents_| and |render_process_user_data_| prior to destroying the
  // registry.
  DCHECK(!g_instance);
  DCHECK(web_contents_.empty());
  DCHECK(render_process_hosts_.empty());
  DCHECK(pm_owned_.empty());
  DCHECK(pm_registered_.empty());
  // TODO(crbug.com/1084611): |observers_| and |mechanisms_| should also be
  // empty by now!
}

// static
PerformanceManagerRegistryImpl* PerformanceManagerRegistryImpl::GetInstance() {
  return g_instance;
}

void PerformanceManagerRegistryImpl::AddObserver(
    PerformanceManagerMainThreadObserver* observer) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  observers_.AddObserver(observer);
}

void PerformanceManagerRegistryImpl::RemoveObserver(
    PerformanceManagerMainThreadObserver* observer) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  observers_.RemoveObserver(observer);
}

void PerformanceManagerRegistryImpl::AddMechanism(
    PerformanceManagerMainThreadMechanism* mechanism) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  mechanisms_.AddObserver(mechanism);
}

void PerformanceManagerRegistryImpl::RemoveMechanism(
    PerformanceManagerMainThreadMechanism* mechanism) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  mechanisms_.RemoveObserver(mechanism);
}

bool PerformanceManagerRegistryImpl::HasMechanism(
    PerformanceManagerMainThreadMechanism* mechanism) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  return mechanisms_.HasObserver(mechanism);
}

void PerformanceManagerRegistryImpl::PassToPM(
    std::unique_ptr<PerformanceManagerOwned> pm_owned) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  pm_owned_.PassObject(std::move(pm_owned));
}

std::unique_ptr<PerformanceManagerOwned>
PerformanceManagerRegistryImpl::TakeFromPM(PerformanceManagerOwned* pm_owned) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  return pm_owned_.TakeObject(pm_owned);
}

void PerformanceManagerRegistryImpl::RegisterObject(
    PerformanceManagerRegistered* pm_object) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  pm_registered_.RegisterObject(pm_object);
}

void PerformanceManagerRegistryImpl::UnregisterObject(
    PerformanceManagerRegistered* pm_object) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  pm_registered_.UnregisterObject(pm_object);
}

PerformanceManagerRegistered*
PerformanceManagerRegistryImpl::GetRegisteredObject(uintptr_t type_id) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  return pm_registered_.GetRegisteredObject(type_id);
}

void PerformanceManagerRegistryImpl::CreatePageNodeForWebContents(
    content::WebContents* web_contents) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);

  auto result = web_contents_.insert(web_contents);
  DCHECK(result.second);

  PerformanceManagerTabHelper::CreateForWebContents(web_contents);
  PerformanceManagerTabHelper* tab_helper =
      PerformanceManagerTabHelper::FromWebContents(web_contents);
  DCHECK(tab_helper);
  tab_helper->SetDestructionObserver(this);

  for (auto& observer : observers_)
    observer.OnPageNodeCreatedForWebContents(web_contents);
}

void PerformanceManagerRegistryImpl::SetPageType(
    content::WebContents* web_contents,
    PageType type) {
  PerformanceManagerTabHelper* tab_helper =
      PerformanceManagerTabHelper::FromWebContents(web_contents);
  DCHECK(tab_helper);

  PerformanceManager::CallOnGraph(
      FROM_HERE,
      // Unretained() is safe because PerformanceManagerTabHelper owns the
      // PageNodeImpl and deletes it by posting a task to the PerformanceManager
      // sequence, which will be sequenced after the task posted here.
      base::BindOnce(&PageNodeImpl::SetType,
                     base::Unretained(tab_helper->primary_page_node()), type));
}

PerformanceManagerRegistryImpl::Throttles
PerformanceManagerRegistryImpl::CreateThrottlesForNavigation(
    content::NavigationHandle* handle) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);

  Throttles combined_throttles;
  for (auto& mechanism : mechanisms_) {
    Throttles throttles = mechanism.CreateThrottlesForNavigation(handle);
    combined_throttles.insert(combined_throttles.end(),
                              std::make_move_iterator(throttles.begin()),
                              std::make_move_iterator(throttles.end()));
  }
  return combined_throttles;
}

void PerformanceManagerRegistryImpl::NotifyBrowserContextAdded(
    content::BrowserContext* browser_context) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);

  content::StoragePartition* storage_partition =
      browser_context->GetDefaultStoragePartition();

  // Create an adapter for the service worker context.
  auto insertion_result = service_worker_context_adapters_.emplace(
      browser_context, std::make_unique<ServiceWorkerContextAdapter>(
                           storage_partition->GetServiceWorkerContext()));
  DCHECK(insertion_result.second);
  ServiceWorkerContextAdapter* service_worker_context_adapter =
      insertion_result.first->second.get();

  auto worker_watcher = std::make_unique<WorkerWatcher>(
      browser_context->UniqueId(),
      storage_partition->GetDedicatedWorkerService(),
      storage_partition->GetSharedWorkerService(),
      service_worker_context_adapter, &process_node_source_,
      &frame_node_source_);
  bool inserted =
      worker_watchers_.emplace(browser_context, std::move(worker_watcher))
          .second;
  DCHECK(inserted);
}

void PerformanceManagerRegistryImpl::
    CreateProcessNodeAndExposeInterfacesToRendererProcess(
        service_manager::BinderRegistry* registry,
        content::RenderProcessHost* render_process_host) {
  registry->AddInterface(base::BindRepeating(&BindProcessCoordinationUnit,
                                             render_process_host->GetID()),
                         base::SequencedTaskRunner::GetCurrentDefault());

  // Ideally this would strictly be a "Create", but when a
  // RenderFrameHost is "resurrected" with a new process it will
  // already have user data attached. This will happen on renderer
  // crash.
  EnsureProcessNodeForRenderProcessHost(render_process_host);
}

void PerformanceManagerRegistryImpl::ExposeInterfacesToRenderFrame(
    mojo::BinderMapWithContext<content::RenderFrameHost*>* map) {
  map->Add<performance_manager::mojom::DocumentCoordinationUnit>(
      base::BindRepeating(&BindDocumentCoordinationUnit));
}

void PerformanceManagerRegistryImpl::NotifyBrowserContextRemoved(
    content::BrowserContext* browser_context) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);

  auto it = worker_watchers_.find(browser_context);
  DCHECK(it != worker_watchers_.end());
  it->second->TearDown();
  worker_watchers_.erase(it);

  // Remove the adapter.
  size_t removed = service_worker_context_adapters_.erase(browser_context);
  DCHECK_EQ(removed, 1u);
}

void PerformanceManagerRegistryImpl::TearDown() {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);

  // The registry should be torn down before the PerformanceManager.
  DCHECK(PerformanceManager::IsAvailable());

  // Notify any observers of the tear down. This lets them unregister things,
  // etc.
  for (auto& observer : observers_)
    observer.OnBeforePerformanceManagerDestroyed();

  DCHECK_EQ(g_instance, this);
  g_instance = nullptr;

  // Destroy WorkerNodes before ProcessNodes, because ProcessNode checks that it
  // has no associated WorkerNode when torn down.
  for (auto& kv : worker_watchers_) {
    kv.second->TearDown();
  }
  worker_watchers_.clear();

  service_worker_context_adapters_.clear();

  for (auto* web_contents : web_contents_) {
    PerformanceManagerTabHelper* tab_helper =
        PerformanceManagerTabHelper::FromWebContents(web_contents);
    DCHECK(tab_helper);
    // Clear the destruction observer to avoid a nested notification.
    tab_helper->SetDestructionObserver(nullptr);
    // Destroy the tab helper.
    tab_helper->TearDown();
    web_contents->RemoveUserData(PerformanceManagerTabHelper::UserDataKey());
  }
  web_contents_.clear();

  for (auto* render_process_host : render_process_hosts_) {
    RenderProcessUserData* user_data =
        RenderProcessUserData::GetForRenderProcessHost(render_process_host);
    DCHECK(user_data);
    // Clear the destruction observer to avoid a nested notification.
    user_data->SetDestructionObserver(nullptr);
    // Destroy the user data.
    render_process_host->RemoveUserData(RenderProcessUserData::UserDataKey());
  }
  render_process_hosts_.clear();

  // Tear down PM owned objects. This lets them clear up object registrations,
  // observers, mechanisms, etc.
  pm_owned_.ReleaseObjects();

  DCHECK(pm_owned_.empty());
  DCHECK(pm_registered_.empty());
  // TODO(crbug.com/1084611): |observers_| and |mechanisms_| should also be
  // empty by now!
}

void PerformanceManagerRegistryImpl::OnPerformanceManagerTabHelperDestroying(
    content::WebContents* web_contents) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  const size_t num_removed = web_contents_.erase(web_contents);
  DCHECK_EQ(1U, num_removed);
}

void PerformanceManagerRegistryImpl::OnRenderProcessUserDataDestroying(
    content::RenderProcessHost* render_process_host) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  const size_t num_removed = render_process_hosts_.erase(render_process_host);
  DCHECK_EQ(1U, num_removed);
}

void PerformanceManagerRegistryImpl::EnsureProcessNodeForRenderProcessHost(
    content::RenderProcessHost* render_process_host) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);

  auto result = render_process_hosts_.insert(render_process_host);
  if (result.second) {
    // Create a RenderProcessUserData if |render_process_host| doesn't already
    // have one.
    RenderProcessUserData* user_data =
        RenderProcessUserData::CreateForRenderProcessHost(render_process_host);
    user_data->SetDestructionObserver(this);
  }
}

void PerformanceManagerRegistryImpl::OnRenderProcessHostCreated(
    content::RenderProcessHost* host) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);

  // Create the ProcessNode if it doesn't already exist. This is the case in
  // web_tests and content_browsertests which do not invoke
  // CreateProcessNodeAndExposeInterfacesToRendererProcess().
  EnsureProcessNodeForRenderProcessHost(host);

  // Notify the ProcessNode that its process was launched.
  RenderProcessUserData::GetForRenderProcessHost(host)->OnProcessLaunched();
}

}  // namespace performance_manager


text:
package org.elasticsearch.index.store.memory;

import org.elasticsearch.common.inject.AbstractModule;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.index.store.IndexStore;

/**
 *
 */
public class MemoryIndexStoreModule extends AbstractModule {

    private final Settings settings;

    public MemoryIndexStoreModule(Settings settings) {
        this.settings = settings;
    }

    @Override
    protected void configure() {
        bind(IndexStore.class).to(ByteBufferIndexStore.class).asEagerSingleton();
    }
}


text:
package org.dayatang.hrm.organisation.domain;

import javax.inject.Inject;

import org.dayatang.domain.InstanceFactory;
import org.dayatang.ioc.spring.factory.SpringInstanceProvider;
import org.junit.After;
import org.junit.Before;
import org.junit.runner.RunWith;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.transaction.TransactionConfiguration;
import org.springframework.transaction.annotation.Transactional;

/**
 * 集成测试基类。用于管理持久化和IoC基础设施
 *
 * @author yyang
 *
 */

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("/applicationContext.xml")
@TransactionConfiguration(transactionManager = "txManager")
@Transactional
public class AbstractIntegrationTest {

    @Inject
    private ApplicationContext applicationContext;

    @Before
    public void setUp() throws Exception {
        SpringInstanceProvider provider = new SpringInstanceProvider(applicationContext);
        InstanceFactory.setInstanceProvider(provider);
    }

    @After
    public void tearDown() throws Exception {
        InstanceFactory.setInstanceProvider(null);
    }

}


text:
.wr360_player
{
    width:100%;
    height:100%;
    background:#fff;
    -webkit-touch-callout:none;
    -webkit-user-select:none;
    -khtml-user-select:none;
    -moz-user-select:none;
    -ms-user-select:none;
    user-select:none;
    -webkit-tap-highlight-color:rgba(0,0,0,0);
    -ms-touch-action:none;
    touch-action:pan-y;
}

.wr360_player .container
{
    position:relative;
    overflow:hidden;
    margin:0 !important;
    padding:0 !important;
    border:0 !important;
    box-shadow:none !important;
    background:inherit !important;
    max-width:none !important;
    font-family:Tahoma, sans-serif;
    cursor:pointer !important;
}

.wr360_player .container::before
{
    display:none !important;
}

.wr360_player .container .spinner_hint
{
    width:100%;
    height:100%;
    z-index:11;
    position:absolute;
    left:0;
    top:0;
    display:none;
    cursor:pointer;
}

.wr360_player .container .spinner_hint .spinner_hint_aligner
{
    position:absolute;
    bottom:20px;
    left:0;
    width:100%;
    text-align:center;
    z-index:1;
}

.wr360_player .container .spinner_hint .spinner_hint_item
{
    padding:7px 18px 7px 18px;
    line-height:14px;
    color:#696969;
    font-size:11px;
    background:rgba(240, 240, 240, 0.88);
    border-radius:0;
    margin:0 auto 0 auto;
    max-width:300px;
    font-family:Tahoma,Helvetica,Sans-Serif;
    opacity:0;
    display:inline-block;
    transition:0.2s ease;
}

@-moz-document url-prefix()
{
    .wr360_player .container .spinner_hint .spinner_hint_item
    {
        padding-bottom:8px;
    }
}

.wr360_player .container .spinner_hint:hover .spinner_hint_item
{
    background:rgba(225, 225, 225, 0.78);
    color:#555;
    transition:0.3s ease;
    padding-left:22px;
    padding-right:22px;
}

.wr360_player img
{
    max-width:none !important;
    max-height:none !important;
    border:none !important;
    box-shadow:none !important;
    cursor:pointer !important;
    image-rendering:-webkit-optimize-contrast;
}

.wr360_player .arrow_zoom_cursor,
.wr360_player .arrow_zoom_cursor > img
{
    cursor:url(../img/zoom_light/pointer-zoom-in.svg), zoom-in !important;
}

.wr360_player .arrow_zoom_cursor.container_zoomed,
.wr360_player .arrow_zoom_cursor.container_zoomed > img
{
    cursor:url(../img/zoom_light/pointer-zoom-out.svg), zoom-out !important;
}

.wr360_player .arrow_zoom_cursor.container_zoomoff,
.wr360_player .arrow_zoom_cursor.container_zoomoff > img
{
    cursor:url(../img/zoom_light/pointer-zoom-off.svg), pointer !important;
}

.wr360_player .zoom_cursor,
.wr360_player .zoom_cursor > img
{
    cursor:zoom-in !important;
}

.wr360_player .zoom_cursor.container_zoomed,
.wr360_player .zoom_cursor.container_zoomed > img
{
    cursor:zoom-out !important;
}

.wr360_player .zoom_cursor.container_zoomoff,
.wr360_player .zoom_cursor.container_zoomoff > img
{
    cursor:pointer !important;
}

/* Desktop Safari doesn't work well with -webkit-optimize-contrast so apply this Safari only hack */
@media not all and (min-resolution:.001dpcm)
{
    @media
    {
        .wr360_player img
		{
            image-rendering:auto;
        }
    }
}

.wr360_player .container .panning
{
    position:absolute;
    left:0;
    top:0;
    background-size:100% 100%;
    background-repeat:no-repeat;
    background-position:center;
    z-index:1;
    display:none;
}

.wr360_player .container .theme_panel_back
{
	display:none;
}

.wr360_player .container .theme_panel
{
    position:absolute;
    width:100%;
    bottom:0px;
    left:0;
    height:66px;
    z-index:3;
    pointer-events:none;
    visibility:hidden;
}

.wr360_player .container .theme_header
{
    height:20px;
    z-index:2;
    margin:3px 0 0 0;
    position:absolute;
    top:0;
    left:0;
    width:100%;
    font-family:Tahoma,Helvetica,Sans-Serif;
}

.wr360_player .container .theme_header .progress_wrap
{
    float:left;
    cursor:pointer;
}

.wr360_player .container .theme_header .progress_wrap .progress_bar_anim_fs
{
    margin:10px 0 0 15px;
    height:28px;
    -webkit-user-select:none;
    -moz-user-select:none;
    -ms-user-select:none;
    user-select:none;
    display:none;
}

.wr360_player .container .theme_header .progress_wrap .progress_bar_anim
{
    margin:1px 0 0 6px;
    height:16px;
    -webkit-user-select:none;
    -moz-user-select:none;
    -ms-user-select:none;
    user-select:none;
    display:none;
}

.wr360_player .container .theme_header .progress_wrap .progress_bar_anim_fs div,
.wr360_player .container .theme_header .progress_wrap .progress_bar_anim div
{
    height:100%;
    width:5px;
    opacity:0;
    margin:0 2px 0 0;
    background-color:#bbb;
    float:left;
    overflow:hidden;
    -webkit-animation:wr360_progress_delay 1.2s infinite ease-in-out;
    animation:wr360_progress_delay 1.2s infinite ease-in-out;
}

.wr360_player .container .theme_header .progress_wrap .progress_bar_anim_fs div
{
    width:6px;
    margin:0 3px 0 0;
    background-color:#aaa;
}

.wr360_player .container .theme_header .progress_wrap .progress_bar_anim .animbar1,
.wr360_player .container .theme_header .progress_wrap .progress_bar_anim_fs .animbar1
{
    -webkit-animation-delay:-1.2s;
    animation-delay:-1.2s;
}

.wr360_player .container .theme_header .progress_wrap .progress_bar_anim .animbar2,
.wr360_player .container .theme_header .progress_wrap .progress_bar_anim_fs .animbar2
{
    -webkit-animation-delay:-1.1s;
    animation-delay:-1.1s;
}

.wr360_player .container .theme_header .progress_wrap .progress_bar_anim .animbar3,
.wr360_player .container .theme_header .progress_wrap .progress_bar_anim_fs .animbar3
{
    -webkit-animation-delay:-1.0s;
    animation-delay:-1.0s;
}

.wr360_player .container .theme_header .progress_wrap .progress_bar_anim .animbar4,
.wr360_player .container .theme_header .progress_wrap .progress_bar_anim_fs .animbar4
{
    -webkit-animation-delay:-0.9s;
    animation-delay:-0.9s;
}

.wr360_player .container .theme_header .progress_wrap .progress_bar_anim .animbar5,
.wr360_player .container .theme_header .progress_wrap .progress_bar_anim_fs .animbar5
{
    -webkit-animation-delay:-0.8s;
    animation-delay:-0.8s;
}

.wr360_player .container .theme_header .progress_wrap .progress_bar_anim span.percentnums
{
    font-size:8px;
    line-height:16px;
    height:16px;
    width:25px;
    float:left;
    color:#999;
    margin:0 0 0 4px;
    display:none;
}

.wr360_player .container .theme_header .progress_wrap .progress_bar_anim_fs span.percentnums
{
    font-size:11px;
    line-height:28px;
    height:28px;
    width:25px;
    float:left;
    color:#999;
    margin:0 0 0 6px;
    display:none;
}

@-moz-document url-prefix()
{
    .wr360_player .container .theme_header .progress_wrap .progress_bar_anim span.percentnums,
    .wr360_player .container .theme_header .progress_wrap .progress_bar_anim_fs span.percentnums
    {
        margin-top: -1px;
    }
}

@-webkit-keyframes wr360_progress_delay
{
    0%, 40%, 100%
    {
        -webkit-transform:scaleY(0.5);
    }

    20%
	{
        -webkit-transform:scaleY(1.0);
        opacity:1;
    }
}

@keyframes wr360_progress_delay
{
    0%, 40%, 100%
    {
        transform:scaleY(0.5);
        -webkit-transform: scaleY(0.5);
    }
    20%
      {
        transform:scaleY(1.0);
        -webkit-transform: scaleY(1.0);
        opacity:1;
    }
}

.wr360_player .container .theme_header a.watermark
{
    margin:5px 0 0 5px;
    float:left;
    width:1px;
    height:1px;
    cursor:pointer;
    display:none;
}

.wr360_player .container .theme_panel .toolbar
{
    position:relative;
    padding:0 15px 0 15px;
    margin:15px auto 0 auto;
    box-sizing:content-box !important;
    border:none !important;
    background:inherit !important;
    pointer-events:none;
}

.wr360_player .container .theme_panel .toolbar > a
{
    width:0;
	height:0;
    display:none !important;
    transition:none !important;
}

.wr360_player .container .theme_panel .toolbar a.fullscreenon_button
{
	width:36px;
	height:36px;
    background:url(../img/zoom_light/fullscreenon.svg) no-repeat 0 0;
	background-size:36px 36px;
	background-color:rgba(248,248,248,0.8);
    display:block !important;
    cursor:pointer;
    pointer-events:auto;
}

.wr360_player.wr360_player_fs .container .theme_panel .toolbar a.fullscreenon_button
{
    display:none !important;
}

.wr360_player a.fullscreenoff_button
{
    background:url(../img/zoom_light/fullscreenoff.svg) no-repeat center center;
    width:50px;
    height:50px;
    top:20px;
    right:23px;
    z-index:10;
    position:absolute;
    cursor:pointer;
    display:block;
    transition:none !important;
}

.wr360_player .container .theme_panel .toolbar > a:hover,
.wr360_player a.fullscreenoff_button:hover
{
	opacity:0.8;
}

.wr360_player .container .hotspot_indicator
{
    z-index:4;
    cursor:pointer;
    background-repeat:no-repeat;
    --anim-duration:2000ms;
}

.wr360_player .container .indicator_effect_pulseRinged
{
    position:relative;
}

.wr360_player .container .indicator_effect_pulseRinged::after
{
    content:"";
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:100%;
    border-radius:50%;
    transform-origin:center;
    z-index:1;
    animation:wr360_effect_pulse_ringed var(--anim-duration) ease-out infinite;
}

.wr360_player .container .indicator_effect_pulseRinged::before
{
    content:"";
    position:absolute;
    top:-1px;
    left:-1px;
    width:100%;
    height:100%;
    border-radius:50%;
    border:1px solid rgba(200, 200, 200, 0);
    transform-origin:center;
    z-index:2;
    animation:wr360_effect_pulse_ringed_border var(--anim-duration) ease-out infinite;
}

.wr360_player .container .indicator_effect_spin
{
    animation:wr360_effect_spin var(--anim-duration) linear infinite;
}

.wr360_player .container .indicator_effect_scaleUp
{
    transform:scale(0, 0);
    animation:wr360_effect_scale_up .3s cubic-bezier(.22, .02, .13, .99) forwards;
}

.wr360_player .container .indicator_effect_pulseSimple
{
    animation:wr360_effect_pulse_simple var(--anim-duration) ease-out 0s infinite;
}

.wr360_player .container .indicator_effect_pulseOuter
{
    border-radius:50%;
    animation:wr360_effect_pulse_outer var(--anim-duration) ease-out infinite;
}

.wr360_player .container .indicator_effect_pulseRipple
{
    position:relative;
    box-sizing:border-box;
}

.wr360_player .container .indicator_effect_pulseRipple::after,
.wr360_player .container .indicator_effect_pulseRipple::before
{
    content:"";
    position:absolute;
    box-sizing:border-box;
    top:0;
    left:0;
    width:100%;
    height:100%;
    border-radius:50%;
    background:rgba(0,0,0,0);
    border:1px solid #eee;
    transform-origin:center;
    animation:wr360_effect_pulse_ripple var(--anim-duration) linear 0s infinite;
}

.wr360_player .container .indicator_effect_pulseRipple::before
{
    animation-delay:1s;
}

.wr360_player .container .indicator_effect_pulseDoubleOuter
{
    border-radius:50%;
    animation:wr360_effect_pulse_double_outer var(--anim-duration) ease-out infinite;
}

.wr360_player .container .hotspot_indicator_hidden
{
    display:none !important;
}

.wr360_player .container .indicator_link_wrap
{
    z-index:3;
    position:absolute;
}

.wr360_player .container .indicator_link
{
    transform-origin:top left;
    position:absolute;
}

.wr360_player .container .position_rollover
{
    position:absolute;
    left:0;
    top:0;
    visibility:hidden;
    z-index:15;
    cursor:pointer;
}

.wr360_player .container .position_rollover > a
{
    display:inline-block;
    box-sizing:border-box;
    text-decoration:none;
}

.wr360_player .container .position_rollover > div
{
    box-sizing:border-box;
}

.wr360_player .container .lightbox_rollover
{
    z-index:18;
    width:100%;
    height:100%;
    background-color:rgba(0, 0, 0, 1);
    position:absolute;
    top:0;
    left:0;
    display:none;
    cursor:default;
}

.wr360_player .container .lightbox_rollover *,
.wr360_player .container .lightbox_rollover2 *
{
    box-sizing:border-box;
}

.wr360_player .container .lightbox_rollover .closelbox
{
    position:absolute;
    background:url(../img/zoom_light/lightbox_close.svg) 7px 7px no-repeat;
    right:15px;
    top:15px;
    width:28px;
    height:28px;
    cursor:pointer;
}

.wr360_player .container .lightbox_rollover .closelbox:hover
{
    opacity:0.8;
}

.wr360_player .container .lightbox_rollover .img_wrap
{
    width:100%;
    height:100%;
    max-width:100%;
    max-height:100%;
    background-position:center center;
    background-repeat:no-repeat;
}

.wr360_player .container .lightbox_rollover a.img_wrap
{
    display:block;
}

.wr360_player .container .lightbox_rollover .img_title
{
    position:absolute;
    padding:0;
    max-width:100%;
    width:100%;
    text-align:left;
    bottom:0;
    left:0;
    background-color:rgba(65, 65, 65, 0.9);
}

.wr360_player .container .lightbox_rollover .img_title a
{
    color:#ff0000;
}

.wr360_player .container .lightbox_rollover .img_title .usr_text
{
    display:inline-block;
    color:#fff;
    width:50%;
    text-align:left;
    padding:15px 20px 19px 20px;
    line-height:19px;
    font-size:16px;
}

.wr360_player .container .lightbox_rollover .img_title a.usr_text
{
    display:block;
    text-decoration: none;
}

.wr360_player .container .lightbox_rollover2
{
    position:relative;
    padding:0;
    width:100%;
    height:100%;
    top:0;
    left:0;
    z-index:18;
    background:transparent;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
}

.wr360_player .container .lightbox_rollover2 .lbox2_wrap
{
    width:100%;
    height:100%;
    position:relative;
    cursor:auto;
}

.wr360_player .container .lightbox_rollover2 .closelbox
{
    position:absolute;
    right:7px;
    top:7px;
    width:26px;
    height:26px;
    opacity:1;
    background:none;
    cursor:pointer;
    z-index:2;
}

.wr360_player .container .lightbox_rollover2 .closelbox:hover
{
    opacity:0.7;
}

.wr360_player .container .lightbox_rollover2 .closelbox > div
{
    position:absolute;
    left:calc(50% - 1px);
    content:' ';
    height:100%;
    width:2px;
    background-color:#999999;
}

.wr360_player .container .lightbox_rollover2 .closelbox div:nth-child(1)
{
    transform:rotate(45deg);
}

.wr360_player .container .lightbox_rollover2 .closelbox div:nth-child(2)
{
    transform:rotate(-45deg);
}

.wr360_player .container .lightbox_rollover2 .lbox2_content
{
    width:100%;
    height:100%;
    position:relative;
    z-index:1;
    overflow:auto;
    padding:0 5px 0 5px;
    scrollbar-width:thin;
    scrollbar-color:#b3b3b3 transparent;
    cursor:auto;
}

.wr360_player .container .lightbox_rollover2 .lbox2_content::-webkit-scrollbar
{
    width:6px;
}

.wr360_player .container .lightbox_rollover2 .lbox2_content::-webkit-scrollbar-thumb
{
    background-color:#b3b3b3;
    border-radius:6px;
}

.wr360_player .container .lightbox_rollover2 a.lbox2_content
{
    display:block;
    text-decoration:none;
    color:inherit;
    cursor:pointer;
}

.wr360_player .container .lightbox_rollover2 .lbox2_content.lbox2_frame
{
    overflow:hidden;
    padding:0;
}

.wr360_player .container .lightbox_rollover2 .lbox2_content iframe
{
    width:100%;
    height:100%;
    border:none;
}

.wr360_player .container .lightbox_rollover2 .lbox2_content img
{
    cursor:auto !important;
}

.wr360_player .container .lightbox_rollover2 .lbox2_wait
{
    position:absolute;
    width:50px;
    height:50px;
    bottom:0;
    top:0;
    left:0;
    right:0;
    margin:auto;
    background-color:#999;
    border-radius:100%;
    animation:wr360_popup_wait 0.9s infinite ease-in-out;
    z-index:0;
}

@keyframes wr360_effect_pulse_ringed
{
    0%
    {
        box-shadow:0 0 1px 0 rgba(238, 238, 238, 0.7);
    }
    50%
    {
        box-shadow:0 0 1px 7px rgba(238, 238, 238, 0.7);
    }
    100%
    {
        box-shadow:0 0 1px 0 rgba(238, 238, 238, 0.7);
    }
}

@keyframes wr360_effect_pulse_ringed_border
{
    0%
    {
        transform:scale(1);
        border-color:rgba(200, 200, 200, 0);
    }
    50%
    {
        transform:scale(1.46);
        border-color:rgba(200, 200, 200, 0.7);
    }
    100%
    {
        transform:scale(1);
        border-color:rgba(200, 200, 200, 0);
    }
}

@keyframes wr360_effect_spin
{
    100%
    {
        transform:rotate(360deg);
    }
}

@keyframes wr360_effect_scale_up
{
    100%
    {
        transform:scale(1, 1);
    }
}

@keyframes wr360_effect_pulse_simple
{
    0%, 100%
    {
        transform:scale(0.84);
        opacity:0.85;
    }
    50%
    {
        transform:scale(1.0);
        opacity:1;
    }
}

@keyframes wr360_effect_pulse_outer
{
    0%
    {
        box-shadow: 0 0 1px 0 rgba(238, 238, 238, 1), 0 0 0 0 rgba(238, 238, 238, 0);
    }
    100%
    {
        box-shadow:0 0 1px 15px rgba(238, 238, 238, 0), 0 0 0 0 rgba(238, 238, 238, 0.7);
    }
}

@keyframes wr360_effect_pulse_ripple
{
    0%
    {
        transform:scale(1);
        opacity:0.9;
    }
    90%
    {
        transform:scale(2.0);
        opacity:0;
    }
    100%
    {
        transform:scale(1);
        opacity:0;
    }
}

@keyframes wr360_effect_pulse_double_outer
{
    0%
    {
        box-shadow:0 0 0 1px rgba(0, 0, 0, 0), 0 0 0 0 rgba(0, 0, 0, 0);
    }
    15%
    {
        box-shadow:0 0 0 5px rgba(238, 238, 238, 0.5), 0 0 3px 10px rgba(238, 238, 238, 0.5);
    }
    100%
    {
        box-shadow:0 0 0 4px rgba(0, 0, 0, 0), 0 0 3px 20px rgba(238, 238, 238, 0);
    }
}

@keyframes wr360_popup_wait
{
    0%
    {
        transform:scale(0);
    }
    100%
    {
        transform:scale(1.0);
        opacity:0;
    }
}


text:
'use strict';

angular.module('myApp.profileBuilder', ['ngRoute'])

.config(['$routeProvider', function($routeProvider) {
  $routeProvider.when('/profileBuilder', {
    templateUrl: 'profileBuilder/profileBuilder.html',
    controller: 'ProfileCtrl'
  });
}])

.controller('ProfileCtrl', function($scope) {
  $scope.page = 0;
  $scope.name = "Anonymous Student";
});


text:
using YTMusicDownloaderLib.Workspaces;

namespace YTMusicDownloader.ViewModel.Messages
{
    internal class WorkspaceErrorMessage
    {
        #region Construction

        public WorkspaceErrorMessage(Workspace workspace)
        {
            Workspace = workspace;
        }

        #endregion

        #region Properties

        public Workspace Workspace { get; }

        #endregion

        #region Fields

        #endregion

        #region Methods

        #endregion
    }
}


text:
namespace autofill {
class AutofillProfile;
}  // namespace autofill

namespace payments {

struct BasicCardResponse;
class PaymentMethodData;

namespace data_util {

// Helper function to get an instance of PaymentAddressPtr from an autofill
// profile.
mojom::PaymentAddressPtr GetPaymentAddressFromAutofillProfile(
    const autofill::AutofillProfile& profile,
    const std::string& app_locale);

// Helper function to get an instance of web::BasicCardResponse from an autofill
// credit card.
std::unique_ptr<BasicCardResponse> GetBasicCardResponseFromAutofillCreditCard(
    const autofill::CreditCard& card,
    const std::u16string& cvc,
    const autofill::AutofillProfile& billing_profile,
    const std::string& app_locale);

// Parse all the supported payment methods from the merchant including 1) the
// supported card networks from supportedMethods and  "basic-card"'s
// supportedNetworks and 2) the url-based payment method identifiers.
// |out_supported_networks| is filled with a list of networks
// in the order that they were specified by the merchant.
// |out_basic_card_supported_networks| is a subset of |out_supported_networks|
// that includes all networks that were specified as part of "basic-card". This
// is used to know whether to return the card network name (e.g., "visa") or
// "basic-card" in the PaymentResponse. |method_data.supported_networks| is
// expected to only contain basic-card card network names (the list is at
// https://www.w3.org/Payments/card-network-ids).
// |out_url_payment_method_identifiers| is filled with a list of all the
// payment method identifiers specified by the merchant that are URL-based.
void ParseSupportedMethods(
    const std::vector<PaymentMethodData>& method_data,
    std::vector<std::string>* out_supported_networks,
    std::set<std::string>* out_basic_card_supported_networks,
    std::vector<GURL>* out_url_payment_method_identifiers,
    std::set<std::string>* out_payment_method_identifiers);

// Formats |card_number| for display. For example, "4111111111111111" is
// formatted into "4111 1111 1111 1111". This method does not format masked card
// numbers, which start with a letter.
std::u16string FormatCardNumberForDisplay(const std::u16string& card_number);

// Returns the subset of |stringified_method_data| map where the keys are in the
// |supported_payment_method_names| set. Used for ensuring that a payment app
// will not be queried about payment method names that it does not support.
//
// FilterStringifiedMethodData({"a": {"b"}: "c": {"d"}}, {"a"}) -> {"a": {"b"}}
//
// Both the return value and the first parameter to the function have the
// following format:
// Key: Payment method identifier, such as "example-test" or
//      "https://example.test".
// Value: The set of all payment method specific parameters for the given
//        payment method identifier, each one serialized into a JSON string,
//        e.g., '{"key": "value"}'.
std::unique_ptr<std::map<std::string, std::set<std::string>>>
FilterStringifiedMethodData(
    const std::map<std::string, std::set<std::string>>& stringified_method_data,
    const std::set<std::string>& supported_payment_method_names);

}  // namespace data_util
}  // namespace payments

#endif  // COMPONENTS_PAYMENTS_CORE_PAYMENT_REQUEST_DATA_UTIL_H_


text:
package corejava.multithreaded;
import java.util.concurrent.*;

/**
 * Second exercise on multithreading.
 * This time, we make only one instance of our main class.
 * i.e. we don't use the CoinFlipper class but rather we directly
 * implement Runnable.
 *
 * To visualize task: Basically, what we do is have five people flip a coin
 * one thousand times - all at the same time. If any of them flip three
 * heads in a row, we make a note of it in the output.
 * @author m
 */

public class FlipCoins2 implements Runnable {
	public static void main(String[] args) {
		/**
		 * note that you cannot do tasks.execute(this) directly
		 * from the main method. When we're in 'main,' no instance
		 * of the surrounding class has been instantiated, so there
		 * is no "this" to use. So we have to make a call to the
		 * constructor which executes tasks.execute(this).
		 *
		 * Similarly, we cannot make an instance of an inner class
		 * directly from the main method for the same reason.
		 */
		new FlipCoins2();
	}

	/**
	 * Constructor.
	 * This is where we implement the logic that was originally
	 * in FlipCoins1's 'main' method.
	 */
	public FlipCoins2() {
		int poolSize = 10;
		ExecutorService tasks = Executors.newFixedThreadPool(poolSize);
		for (int i = 0; i < 5; i++) {
			tasks.execute(this);	// executes the overriden 'run' below.
		}
		tasks.shutdown();
	}

	/**
	 * Override 'run'
	 * This is where we place the logic that was originally
	 * in the CoinFlipper class.
	 */
	@Override
	public void run() {
		int numHeads = 0;
		for (int i = 0; i < 1000; i++) {
			double coin = Math.random();
			if (coin < 0.5) {
				numHeads++;
			} else {
				numHeads = 0;
			}
			if (numHeads >= 3) {
				System.out.printf("%s got %d heads in a row.%n",
								Thread.currentThread().getName(), numHeads);
			}
		}
	}
}


text:
namespace net {

URLRequestFileJob::FileMetaInfo::FileMetaInfo()
    : file_size(0),
      mime_type_result(false),
      file_exists(false),
      is_directory(false) {
}

URLRequestFileJob::URLRequestFileJob(
    URLRequest* request,
    NetworkDelegate* network_delegate,
    const base::FilePath& file_path,
    const scoped_refptr<base::TaskRunner>& file_task_runner)
    : URLRequestJob(request, network_delegate),
      file_path_(file_path),
      stream_(new FileStream(file_task_runner)),
      file_task_runner_(file_task_runner),
      remaining_bytes_(0),
      weak_ptr_factory_(this) {}

void URLRequestFileJob::Start() {
  FileMetaInfo* meta_info = new FileMetaInfo();
  file_task_runner_->PostTaskAndReply(
      FROM_HERE,
      base::Bind(&URLRequestFileJob::FetchMetaInfo, file_path_,
                 base::Unretained(meta_info)),
      base::Bind(&URLRequestFileJob::DidFetchMetaInfo,
                 weak_ptr_factory_.GetWeakPtr(),
                 base::Owned(meta_info)));
}

void URLRequestFileJob::Kill() {
  stream_.reset();
  weak_ptr_factory_.InvalidateWeakPtrs();

  URLRequestJob::Kill();
}

bool URLRequestFileJob::ReadRawData(IOBuffer* dest,
                                    int dest_size,
                                    int* bytes_read) {
  DCHECK_NE(dest_size, 0);
  DCHECK(bytes_read);
  DCHECK_GE(remaining_bytes_, 0);

  if (remaining_bytes_ < dest_size)
    dest_size = static_cast<int>(remaining_bytes_);

  // If we should copy zero bytes because |remaining_bytes_| is zero, short
  // circuit here.
  if (!dest_size) {
    *bytes_read = 0;
    return true;
  }

  int rv = stream_->Read(dest,
                         dest_size,
                         base::Bind(&URLRequestFileJob::DidRead,
                                    weak_ptr_factory_.GetWeakPtr(),
                                    make_scoped_refptr(dest)));
  if (rv >= 0) {
    // Data is immediately available.
    *bytes_read = rv;
    remaining_bytes_ -= rv;
    DCHECK_GE(remaining_bytes_, 0);
    return true;
  }

  // Otherwise, a read error occured.  We may just need to wait...
  if (rv == ERR_IO_PENDING) {
    SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0));
  } else {
    NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv));
  }
  return false;
}

bool URLRequestFileJob::IsRedirectResponse(GURL* location,
                                           int* http_status_code) {
  if (meta_info_.is_directory) {
    // This happens when we discovered the file is a directory, so needs a
    // slash at the end of the path.
    std::string new_path = request_->url().path();
    new_path.push_back('/');
    GURL::Replacements replacements;
    replacements.SetPathStr(new_path);

    *location = request_->url().ReplaceComponents(replacements);
    *http_status_code = 301;  // simulate a permanent redirect
    return true;
  }

#if defined(OS_WIN)
  // Follow a Windows shortcut.
  // We just resolve .lnk file, ignore others.
  if (!LowerCaseEqualsASCII(file_path_.Extension(), ".lnk"))
    return false;

  base::FilePath new_path = file_path_;
  bool resolved;
  resolved = base::win::ResolveShortcut(new_path, &new_path, NULL);

  // If shortcut is not resolved succesfully, do not redirect.
  if (!resolved)
    return false;

  *location = FilePathToFileURL(new_path);
  *http_status_code = 301;
  return true;
#else
  return false;
#endif
}

Filter* URLRequestFileJob::SetupFilter() const {
  // Bug 9936 - .svgz files needs to be decompressed.
  return LowerCaseEqualsASCII(file_path_.Extension(), ".svgz")
      ? Filter::GZipFactory() : NULL;
}

bool URLRequestFileJob::GetMimeType(std::string* mime_type) const {
  DCHECK(request_);
  if (meta_info_.mime_type_result) {
    *mime_type = meta_info_.mime_type;
    return true;
  }
  return false;
}

void URLRequestFileJob::SetExtraRequestHeaders(
    const HttpRequestHeaders& headers) {
  std::string range_header;
  if (headers.GetHeader(HttpRequestHeaders::kRange, &range_header)) {
    // We only care about "Range" header here.
    std::vector<HttpByteRange> ranges;
    if (HttpUtil::ParseRangeHeader(range_header, &ranges)) {
      if (ranges.size() == 1) {
        byte_range_ = ranges[0];
      } else {
        // We don't support multiple range requests in one single URL request,
        // because we need to do multipart encoding here.
        // TODO(hclam): decide whether we want to support multiple range
        // requests.
        NotifyDone(URLRequestStatus(URLRequestStatus::FAILED,
                                    ERR_REQUEST_RANGE_NOT_SATISFIABLE));
      }
    }
  }
}

void URLRequestFileJob::OnSeekComplete(int64 result) {
}

void URLRequestFileJob::OnReadComplete(IOBuffer* buf, int result) {
}

URLRequestFileJob::~URLRequestFileJob() {
}

void URLRequestFileJob::FetchMetaInfo(const base::FilePath& file_path,
                                      FileMetaInfo* meta_info) {
  base::File::Info file_info;
  meta_info->file_exists = base::GetFileInfo(file_path, &file_info);
  if (meta_info->file_exists) {
    meta_info->file_size = file_info.size;
    meta_info->is_directory = file_info.is_directory;
  }
  // On Windows GetMimeTypeFromFile() goes to the registry. Thus it should be
  // done in WorkerPool.
  meta_info->mime_type_result = GetMimeTypeFromFile(file_path,
                                                    &meta_info->mime_type);
}

void URLRequestFileJob::DidFetchMetaInfo(const FileMetaInfo* meta_info) {
  meta_info_ = *meta_info;

  // We use URLRequestFileJob to handle files as well as directories without
  // trailing slash.
  // If a directory does not exist, we return ERR_FILE_NOT_FOUND. Otherwise,
  // we will append trailing slash and redirect to FileDirJob.
  // A special case is "\" on Windows. We should resolve as invalid.
  // However, Windows resolves "\" to "C:\", thus reports it as existent.
  // So what happens is we append it with trailing slash and redirect it to
  // FileDirJob where it is resolved as invalid.
  if (!meta_info_.file_exists) {
    DidOpen(ERR_FILE_NOT_FOUND);
    return;
  }
  if (meta_info_.is_directory) {
    DidOpen(OK);
    return;
  }

  int flags = base::File::FLAG_OPEN |
              base::File::FLAG_READ |
              base::File::FLAG_ASYNC;
  int rv = stream_->Open(file_path_, flags,
                         base::Bind(&URLRequestFileJob::DidOpen,
                                    weak_ptr_factory_.GetWeakPtr()));
  if (rv != ERR_IO_PENDING)
    DidOpen(rv);
}

void URLRequestFileJob::DidOpen(int result) {
  if (result != OK) {
    NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, result));
    return;
  }

  if (!byte_range_.ComputeBounds(meta_info_.file_size)) {
    NotifyDone(URLRequestStatus(URLRequestStatus::FAILED,
               ERR_REQUEST_RANGE_NOT_SATISFIABLE));
    return;
  }

  remaining_bytes_ = byte_range_.last_byte_position() -
                     byte_range_.first_byte_position() + 1;
  DCHECK_GE(remaining_bytes_, 0);

  if (remaining_bytes_ > 0 && byte_range_.first_byte_position() != 0) {
    int rv = stream_->Seek(base::File::FROM_BEGIN,
                           byte_range_.first_byte_position(),
                           base::Bind(&URLRequestFileJob::DidSeek,
                                      weak_ptr_factory_.GetWeakPtr()));
    if (rv != ERR_IO_PENDING) {
      // stream_->Seek() failed, so pass an intentionally erroneous value
      // into DidSeek().
      DidSeek(-1);
    }
  } else {
    // We didn't need to call stream_->Seek() at all, so we pass to DidSeek()
    // the value that would mean seek success. This way we skip the code
    // handling seek failure.
    DidSeek(byte_range_.first_byte_position());
  }
}

void URLRequestFileJob::DidSeek(int64 result) {
  OnSeekComplete(result);
  if (result != byte_range_.first_byte_position()) {
    NotifyDone(URLRequestStatus(URLRequestStatus::FAILED,
                                ERR_REQUEST_RANGE_NOT_SATISFIABLE));
    return;
  }

  set_expected_content_size(remaining_bytes_);
  NotifyHeadersComplete();
}

void URLRequestFileJob::DidRead(scoped_refptr<IOBuffer> buf, int result) {
  if (result > 0) {
    SetStatus(URLRequestStatus());  // Clear the IO_PENDING status
    remaining_bytes_ -= result;
    DCHECK_GE(remaining_bytes_, 0);
  }

  OnReadComplete(buf.get(), result);
  buf = NULL;

  if (result == 0) {
    NotifyDone(URLRequestStatus());
  } else if (result < 0) {
    NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, result));
  }

  NotifyReadComplete(result);
}

}  // namespace net


text:
package com.jcwhatever.pvs.commands.admin.ext;

import com.jcwhatever.nucleus.managed.commands.CommandInfo;
import com.jcwhatever.pvs.api.commands.AbstractPVCommand;

@CommandInfo(
        command="ext",
        description="Manage arena extensions.")

public class ExtCommand extends AbstractPVCommand {

    public ExtCommand() {
        super();

        registerCommand(AddSubCommand.class);
        registerCommand(RemoveSubCommand.class);
        registerCommand(ListSubCommand.class);
        registerCommand(TypesSubCommand.class);
    }
}


text:
package org.kuali.rice.kns.web.struts.form;

import org.apache.commons.lang.StringUtils;
import org.kuali.rice.core.api.CoreApiServiceLocator;
import org.kuali.rice.kns.authorization.AuthorizationConstants;
import org.kuali.rice.core.api.encryption.EncryptionService;
import org.kuali.rice.kns.datadictionary.BusinessObjectEntry;
import org.kuali.rice.kns.inquiry.Inquirable;
import org.kuali.rice.kns.service.BusinessObjectAuthorizationService;
import org.kuali.rice.kns.service.BusinessObjectMetaDataService;
import org.kuali.rice.kns.service.KNSServiceLocator;
import org.kuali.rice.krad.bo.Exporter;
import org.kuali.rice.krad.datadictionary.exception.UnknownBusinessClassAttributeException;
import org.kuali.rice.krad.service.DataDictionaryService;
import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
import org.kuali.rice.krad.service.KualiModuleService;
import org.kuali.rice.krad.service.ModuleService;
import org.kuali.rice.krad.util.KRADConstants;

import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Constructor;
import java.security.GeneralSecurityException;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * This class is the action form for inquiries.
 *
 * @deprecated Use {@link org.kuali.rice.krad.web.form.InquiryForm}.
 */
@Deprecated
public class InquiryForm extends KualiForm {
    private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(InquiryForm.class);

    private static final long serialVersionUID = 1L;
    private String fieldConversions;
    private List sections;
    private String businessObjectClassName;
    private Map editingMode;
    private String formKey;
    private boolean canExport;

    @Override
    public void addRequiredNonEditableProperties(){
    	super.addRequiredNonEditableProperties();
    	registerRequiredNonEditableProperty(KRADConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE);
    	registerRequiredNonEditableProperty(KRADConstants.DISPATCH_REQUEST_PARAMETER);
    	registerRequiredNonEditableProperty(KRADConstants.DOC_FORM_KEY);
    	registerRequiredNonEditableProperty(KRADConstants.FORM_KEY);
    	registerRequiredNonEditableProperty(KRADConstants.FIELDS_CONVERSION_PARAMETER);
    	registerRequiredNonEditableProperty(KRADConstants.BACK_LOCATION);
    }

    /**
     * The following map is used to pass primary key values between invocations of the inquiry screens after the start method has been called.  Values in this map will remain encrypted
     * if the value was passed in as encrypted
     */
    private Map<String, String> inquiryPrimaryKeys;

    private Map<String, String> inquiryDecryptedPrimaryKeys;

    /**
     * A map of collection name -> Boolean mappings.  Used to denote whether a collection name is configured to show inactive records.
     */
    private Map<String, Boolean> inactiveRecordDisplay;

    private Inquirable inquirable;

    public InquiryForm() {
        super();
        this.editingMode = new HashMap();
        this.editingMode.put(AuthorizationConstants.EditMode.VIEW_ONLY, "TRUE");
        this.inactiveRecordDisplay = null;
    }

    @Override
    public void populate(HttpServletRequest request) {
    // set to null for security reasons (so POJO form base can't access it), then we'll make an new instance of it after
    // POJO form base is done
        this.inquirable = null;
        super.populate(request);
        if (request.getParameter("returnLocation") != null) {
            setBackLocation(request.getParameter("returnLocation"));
        }
        if (request.getParameter(KRADConstants.DOC_FORM_KEY) != null) {
            setFormKey(request.getParameter(KRADConstants.DOC_FORM_KEY));
        }
        //if the action is download attachment then skip the following populate logic
        if(!KRADConstants.DOWNLOAD_BO_ATTACHMENT_METHOD.equals(getMethodToCall())){
        	inquirable = getInquirable(getBusinessObjectClassName());

        	// the following variable is true if the method to call is not start, meaning that we already called start
        	boolean passedFromPreviousInquiry = !KRADConstants.START_METHOD.equals(getMethodToCall()) && !KRADConstants.CONTINUE_WITH_INQUIRY_METHOD_TO_CALL.equals(getMethodToCall()) && !KRADConstants
                    .DOWNLOAD_CUSTOM_BO_ATTACHMENT_METHOD.equals(getMethodToCall());

        	// There is no requirement that an inquiry screen must display the primary key values.  However, when clicking on hide/show (without javascript) and
        	// hide/show inactive, the PK values are needed to allow the server to properly render results after the user clicks on a hide/show button that results
        	// in server processing.  This line will populate the form with the PK values so that they may be used in subsequent requests.  Note that encrypted
        	// values will remain encrypted in this map.
        	this.inquiryPrimaryKeys = new HashMap<String, String>();
        	this.inquiryDecryptedPrimaryKeys = new HashMap<String, String>();

        	populatePKFieldValues(request, getBusinessObjectClassName(), passedFromPreviousInquiry);

        	populateInactiveRecordsInIntoInquirable(inquirable, request);
        	populateExportCapabilities(request, getBusinessObjectClassName());
        }
    }

    protected Inquirable getInquirable(String boClassName) {
        try {
            Class customInquirableClass = null;

            try {
                BusinessObjectEntry entry = (BusinessObjectEntry) KRADServiceLocatorWeb.getDataDictionaryService().getDataDictionary().getBusinessObjectEntry(boClassName);
                customInquirableClass = entry.getInquiryDefinition().getInquirableClass();
            }
            catch (Exception e) {
                LOG.error("Unable to correlate business object class with maintenance document entry");
            }

            Inquirable kualiInquirable = KNSServiceLocator.getKualiInquirable(); // get inquirable impl from Spring

            if (customInquirableClass != null) {
                Class[] defaultConstructor = new Class[] {};
                Constructor cons = customInquirableClass.getConstructor(defaultConstructor);
                kualiInquirable = (Inquirable) cons.newInstance();
            }

            kualiInquirable.setBusinessObjectClass(Class.forName(boClassName));

            return kualiInquirable;
        }
        catch (Exception e) {
            LOG.error("Error attempting to retrieve inquirable.", e);
            throw new RuntimeException("Error attempting to retrieve inquirable.");
        }
    }

    /**
     * Gets the alt keys for a class.  Will not return null but and empty list if no keys exist.
     *
     * @param clazz the class.
     * @return the alt keys
     */
    private List<List<String>> getAltkeys(Class<?> clazz) {
    	final KualiModuleService kualiModuleService = KRADServiceLocatorWeb.getKualiModuleService();
    	final ModuleService moduleService = kualiModuleService.getResponsibleModuleService(clazz);

        List<List<String>> altKeys = null;
        if (moduleService != null) {
        	altKeys = moduleService.listAlternatePrimaryKeyFieldNames(clazz);
        }

        return altKeys != null ? altKeys : new ArrayList<List<String>>();
    }

    protected void populatePKFieldValues(HttpServletRequest request, String boClassName, boolean passedFromPreviousInquiry) {
        try {
            EncryptionService encryptionService = CoreApiServiceLocator.getEncryptionService();
            DataDictionaryService dataDictionaryService = KRADServiceLocatorWeb.getDataDictionaryService();
            BusinessObjectAuthorizationService businessObjectAuthorizationService = KNSServiceLocator
                    .getBusinessObjectAuthorizationService();
            BusinessObjectMetaDataService businessObjectMetaDataService = KNSServiceLocator
                    .getBusinessObjectMetaDataService();

            Class businessObjectClass = Class.forName(boClassName);

            // build list of key values from request, if all keys not given throw error
            List<String> boPKeys = KRADServiceLocatorWeb.getLegacyDataAdapter().listPrimaryKeyFieldNames(businessObjectClass);
            final List<List<String>> altKeys = this.getAltkeys(businessObjectClass);

            altKeys.add(boPKeys);
            boolean bFound = false;
            for(List<String> boKeys : altKeys ){
            	if(bFound)
            		break;
	            int keyCount = boKeys.size();
	            int foundCount = 0;
                for (String boKey : boKeys) {
                    String pkParamName = boKey;
	                if (passedFromPreviousInquiry) {
	                    pkParamName = KRADConstants.INQUIRY_PK_VALUE_PASSED_FROM_PREVIOUS_REQUEST_PREFIX + pkParamName;
	                }

	                if (request.getParameter(pkParamName) != null) {
	                	foundCount++;
	                	String parameter = request.getParameter(pkParamName);

                        Boolean forceUppercase = Boolean.FALSE;
                        try {
                            forceUppercase = dataDictionaryService.getAttributeForceUppercase(businessObjectClass, boKey);
                        } catch (UnknownBusinessClassAttributeException ex) {
                            // swallowing exception because this check for ForceUppercase would
                            // require a DD entry for the attribute.  it is only checking keys
                            // so most likely there should be an entry.
                            LOG.warn("BO class " + businessObjectClassName + " property " + boKey + " should probably have a DD definition.", ex);
                        }
                        String parameterCopy = parameter;
                        if (forceUppercase) {
	                		parameter = parameter.toUpperCase();
	                	}

                        inquiryPrimaryKeys.put(boKey, parameter);
                        if (businessObjectAuthorizationService.attributeValueNeedsToBeEncryptedOnFormsAndLinks(businessObjectClass, boKey)) {
                            try {
                                if(CoreApiServiceLocator.getEncryptionService().isEnabled()) {
                                    inquiryDecryptedPrimaryKeys.put(boKey, encryptionService.decrypt(parameterCopy));
                                }
                            } catch (GeneralSecurityException e) {
                                LOG.error("BO class " + businessObjectClassName + " property " + boKey + " should have been encrypted, but there was a problem decrypting it.");
                                throw e;
                            }
                        }
                        else {
                            inquiryDecryptedPrimaryKeys.put(boKey, parameter);
                        }
                    }
                }
                if (foundCount == keyCount) {
                    bFound = true;
                }
            }
            if(!bFound){
                LOG.error("All keys not given to lookup for bo class name " + businessObjectClass.getName());
                throw new RuntimeException("All keys not given to lookup for bo class name " + businessObjectClass.getName());
            }
        }
        catch (ClassNotFoundException e) {
        	LOG.error("Can't instantiate class: " + boClassName, e);
        	throw new RuntimeException("Can't instantiate class: " + boClassName);
        }
        catch (GeneralSecurityException e) {
        	LOG.error("Can't decrypt value", e);
        	throw new RuntimeException("Can't decrypt value");
        }
    }

    /**
     * Examines the BusinessObject's data dictionary entry to determine if it supports
     * XML export or not and set's canExport appropriately.
     */
    protected void populateExportCapabilities(HttpServletRequest request, String boClassName) {
    	setCanExport(false);
    	BusinessObjectEntry businessObjectEntry = (BusinessObjectEntry) KRADServiceLocatorWeb.getDataDictionaryService().getDataDictionary().getBusinessObjectEntry(boClassName);
    	Class<? extends Exporter> exporterClass = businessObjectEntry.getExporterClass();
    	if (exporterClass != null) {
    		try {
    			Exporter exporter = exporterClass.newInstance();
    			if (exporter.getSupportedFormats(businessObjectEntry.getBusinessObjectClass()).contains(KRADConstants.XML_FORMAT)) {
    				setCanExport(true);
    			}
    		} catch (Exception e) {
    			LOG.error("Failed to locate or create exporter class: " + exporterClass, e);
    			throw new RuntimeException("Failed to locate or create exporter class: " + exporterClass);
    		}
    	}
    }

    /**
     * @return Returns the fieldConversions.
     */
    public String getFieldConversions() {
        return fieldConversions;
    }

    /**
     * @param fieldConversions The fieldConversions to set.
     */
    public void setFieldConversions(String fieldConversions) {
        this.fieldConversions = fieldConversions;
    }

    /**
     * @return Returns the inquiry sections.
     */
    public List getSections() {
        return sections;
    }

    /**
     * @param sections The sections to set.
     */
    public void setSections(List sections) {
        this.sections = sections;
    }

    /**
     * @return Returns the businessObjectClassName.
     */
    public String getBusinessObjectClassName() {
        return businessObjectClassName;
    }

    /**
     * @param businessObjectClassName The businessObjectClassName to set.
     */
    public void setBusinessObjectClassName(String businessObjectClassName) {
        this.businessObjectClassName = businessObjectClassName;
    }

    public Map getEditingMode() {
        return editingMode;
    }

    /**
     * Gets the map used to pass primary key values between invocations of the inquiry screens after the start method has been called.  All field values that were passed in encrypted will
     * be encrypted in this map
     *
     * @return
     */
    public Map<String, String> getInquiryPrimaryKeys() {
        return this.inquiryPrimaryKeys;
    }

    /**
     * Gets the map used to pass primary key values between invocations of the inquiry screens after the start method has been called.  All fields will be decrypted
     *
     * Purposely not named as a getter, to make it harder for POJOFormBase to access it
     *
     * @return
     */
    public Map<String, String> retrieveInquiryDecryptedPrimaryKeys() {
        return this.inquiryDecryptedPrimaryKeys;
    }

    /**
     * Sets the map used to pass primary key values between invocations of the inquiry screens after the start method has been called.
     *
     * @param inquiryPrimaryKeys
     */
    public void setInquiryPrimaryKeys(Map<String, String> inquiryPrimaryKeys) {
        this.inquiryPrimaryKeys = inquiryPrimaryKeys;
    }

    /**
     * Gets map of collection name -> Boolean mappings.  Used to denote whether a collection name is configured to show inactive records.
     *
     * @return
     */
    public Map<String, Boolean> getInactiveRecordDisplay() {
        return getInquirable().getInactiveRecordDisplay();
    }

    public Inquirable getInquirable() {
        return inquirable;
    }

    protected void populateInactiveRecordsInIntoInquirable(Inquirable inquirable, HttpServletRequest request) {
        for (Enumeration e = request.getParameterNames(); e.hasMoreElements();) {
            String paramName = (String) e.nextElement();
            if (paramName.startsWith(KRADConstants.INACTIVE_RECORD_DISPLAY_PARAM_PREFIX)) {
                String collectionName = StringUtils.substringAfter(paramName, KRADConstants.INACTIVE_RECORD_DISPLAY_PARAM_PREFIX);
                Boolean showInactive = Boolean.parseBoolean(request.getParameter(paramName));
                inquirable.setShowInactiveRecords(collectionName, showInactive);
            }
        }
    }

    public String getFormKey() {
        return this.formKey;
    }

    public void setFormKey(String formKey) {
        this.formKey = formKey;
    }

	/**
	 * Returns true if this Inquiry supports XML export of the BusinessObject.
	 */
	public boolean isCanExport() {
		return this.canExport;
	}

	/**
	 * Sets whether or not this Inquiry supports XML export of it's BusinessObject.
	 */
	public void setCanExport(boolean canExport) {
		this.canExport = canExport;
	}

}