text:
AccountMembershipProvider.UnlockUser Method
===========================================
This method always throws a [NotImplementedException][1].

**Namespace:** [MvcAccount.Web.Security][2]
**Assembly:** MvcAccount (in MvcAccount.dll)

Syntax
------

```csharp
public override bool UnlockUser(
	string userName
)
```

#### Parameters

##### *userName*
Type: [System.String][3]
The user whose lock status you want to clear.

#### Return Value
Type: [Boolean][4]
true if the user was successfully unlocked; otherwise, false.

See Also
--------

#### Reference
[AccountMembershipProvider Class][5]
[MvcAccount.Web.Security Namespace][2]

[1]: http://msdn.microsoft.com/en-us/library/6byb74h9
[2]: ../README.md
[3]: http://msdn.microsoft.com/en-us/library/s1wwdcbf
[4]: http://msdn.microsoft.com/en-us/library/a28wyd50
[5]: README.md


text:
<!DOCTYPE html>

        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>dslinks - neotoma Database</title>

        <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
        <link rel="icon" type="image/png" sizes="16x16" href="../favicon.png">

        <link rel="stylesheet" href="../bower/admin-lte/bootstrap/css/bootstrap.min.css">

        <link rel="stylesheet" href="../bower/font-awesome/css/font-awesome.min.css">

        <link rel="stylesheet" href="../bower/ionicons/css/ionicons.min.css">

        <link rel="stylesheet" href="../bower/datatables.net-bs/css/dataTables.bootstrap.min.css">
        <link rel="stylesheet" href="../bower/datatables.net-buttons-bs/css/buttons.bootstrap.min.css">

        <link rel="stylesheet" href="../bower/codemirror/codemirror.css">

        <link href='../fonts/indieflower/indie-flower.css' rel='stylesheet' type='text/css'>
        <link href='../fonts/source-sans-pro/source-sans-pro.css' rel='stylesheet' type='text/css'>

        <link rel="stylesheet" href="../bower/admin-lte/dist/css/AdminLTE.min.css">

        <link rel="stylesheet" href="../bower/salvattore/salvattore.css">

        <link rel="stylesheet" href="../bower/admin-lte/dist/css/skins/_all-skins.min.css">

        <link rel="stylesheet" href="../schemaSpy.css">

                            neotoma Database
                            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse"></button>

Tables (current)

Columns

Constraints

Relationships

Orphan Tables

Anomalies

Routines

dslinks

0 rows

Columns

                                <button type="button" class="btn btn-box-tool" data-widget="collapse"></button>
                                <button type="button" class="btn btn-box-tool" data-widget="remove"></button>

                                    Column
                                    Type
                                    Size
                                    Nulls
                                    Auto
                                    Default
                                    Children
                                    Parents
                                    Comments

                                    datasetid
                                    int4
                                    10
                                    √

                                    null

                                                datasets.datasetid
                                                Implied ConstraintR

                                    collectionunitid
                                    int4
                                    10
                                    √

                                    null

                                                collectionunits.collectionunitid
                                                Implied ConstraintR

                                    siteid
                                    int4
                                    10
                                    √

                                    null

Relationships

                                <button type="button" class="btn btn-box-tool" data-widget="collapse"></button>
                                <button type="button" class="btn btn-box-tool" data-widget="remove"></button>

Close relationships within degrees of separation

One

One implied

Two implied

                                        <map id="oneDegreeRelationshipsDiagram" name="oneDegreeRelationshipsDiagram">
<area shape="rect" id="node1" href="dslinks.html" target="_top" title="dslinks" alt="" coords="5,5,267,139">
</map>

                                        <map id="oneDegreeRelationshipsDiagramImplied" name="oneDegreeRelationshipsDiagramImplied">
<area shape="rect" id="node1" href="datasets.html" target="_top" title="datasets" alt="" coords="260,5,459,211">
<area shape="rect" id="node2" href="collectionunits.html" target="_top" title="collectionunits" alt="" coords="5,112,216,347">
<area shape="rect" id="node3" href="dslinks.html" target="_top" title="dslinks" alt="" coords="503,80,764,213">
</map>

                                        <map id="twoDegreesRelationshipsDiagramImplied" name="twoDegreesRelationshipsDiagramImplied">
<area shape="rect" id="node1" href="analysisunits.html" target="_top" title="analysisunits" alt="" coords="520,156,719,244">
<area shape="rect" id="node2" href="collectionunits.html" target="_top" title="collectionunits" alt="" coords="265,207,476,441">
<area shape="rect" id="node4" href="collectiontypes.html" target="_top" title="collectiontypes" alt="" coords="5,231,221,319">
<area shape="rect" id="node5" href="depenvttypes.html" target="_top" title="depenvttypes" alt="" coords="12,336,215,424">
<area shape="rect" id="node6" href="sites.html" target="_top" title="sites" alt="" coords="27,125,200,213">
<area shape="rect" id="node7" href="rocktypes.html" target="_top" title="rocktypes" alt="" coords="27,441,199,529">
<area shape="rect" id="node3" href="chronologies.html" target="_top" title="chronologies" alt="" coords="522,367,717,455">
<area shape="rect" id="node8" href="collectors.html" target="_top" title="collectors" alt="" coords="533,15,706,103">
<area shape="rect" id="node9" href="dataprocessors.html" target="_top" title="dataprocessors" alt="" coords="785,719,1003,807">
<area shape="rect" id="node10" href="datasets.html" target="_top" title="datasets" alt="" coords="520,768,719,973">
<area shape="rect" id="node14" href="datasettypes.html" target="_top" title="datasettypes" alt="" coords="271,791,470,879">
<area shape="rect" id="node15" href="embargo.html" target="_top" title="embargo" alt="" coords="289,896,452,984">
<area shape="rect" id="node11" href="datasetdatabases.html" target="_top" title="datasetdatabases" alt="" coords="775,824,1013,912">
<area shape="rect" id="node12" href="datasetpis.html" target="_top" title="datasetpis" alt="" coords="803,929,985,1017">
<area shape="rect" id="node13" href="datasetpublications.html" target="_top" title="datasetpublications" alt="" coords="767,1035,1021,1123">
<area shape="rect" id="node16" href="datasetsubmissions.html" target="_top" title="datasetsubmissions" alt="" coords="767,1140,1021,1228">
<area shape="rect" id="node17" href="datasettaxonnotes.html" target="_top" title="datasettaxonnotes" alt="" coords="771,1245,1017,1333">
<area shape="rect" id="node18" href="datasetvariables.html" target="_top" title="datasetvariables" alt="" coords="779,1351,1009,1439">
<area shape="rect" id="node19" href="dsageranges.html" target="_top" title="dsageranges" alt="" coords="798,1456,990,1520">
<area shape="rect" id="node20" href="dsdatasample.html" target="_top" title="dsdatasample" alt="" coords="1069,191,1272,255">
<area shape="rect" id="node21" href="samples.html" target="_top" title="samples" alt="" coords="795,156,993,244">
<area shape="rect" id="node22" href="dslinks.html" target="_top" title="dslinks" alt="" coords="763,5,1025,139">
<area shape="rect" id="node23" href="dssampdata.html" target="_top" title="dssampdata" alt="" coords="800,1537,988,1601">
<area shape="rect" id="node24" href="isoinstrumentation.html" target="_top" title="isoinstrumentation" alt="" coords="771,1619,1017,1707">
<area shape="rect" id="node25" href="isosrmetadata.html" target="_top" title="isosrmetadata" alt="" coords="789,297,999,385">
<area shape="rect" id="node26" href="isostandards.html" target="_top" title="isostandards" alt="" coords="796,403,992,491">
<area shape="rect" id="node27" href="lithology.html" target="_top" title="lithology" alt="" coords="533,261,706,349">
<area shape="rect" id="node28" href="repositoryspecimens.html" target="_top" title="repositoryspecimens" alt="" coords="763,508,1025,596">
<area shape="rect" id="node29" href="synonymy.html" target="_top" title="synonymy" alt="" coords="807,613,981,701">
</map>

View Definition

                                <button type="button" class="btn btn-box-tool" data-widget="collapse"></button>
                                <button type="button" class="btn btn-box-tool" data-widget="remove"></button>

                            <textarea id="sql-script-codemirror" name="sql-script-codemirror" rows="" style="display: none;">SELECT ds.datasetid,
    ds.collectionunitid,
    sts.siteid
   FROM ((ndb.datasets ds
     LEFT JOIN ndb.collectionunits cu ON ((ds.collectionunitid = cu.collectionunitid)))
     LEFT JOIN ndb.sites sts ON ((cu.siteid = sts.siteid))); SELECT sites.siteid,
    collectionunits.collectionunitid,
    datasets.datasetid
   FROM ((ndb.sites
     JOIN ndb.collectionunits ON ((sites.siteid = collectionunits.siteid)))
     JOIN ndb.datasets ON ((collectionunits.collectionunitid = datasets.collectionunitid)));</textarea>

Possibly Referenced Tables/Views

datasets

collectionunits

sites

                    Generated by  SchemaSpy 6.1.0

redpajama_set_name: RedPajamaGithub


text:
namespace media {

RemotingRendererController::RemotingRendererController(
    scoped_refptr<RemotingSourceImpl> remoting_source)
    : remoting_source_(remoting_source), weak_factory_(this) {
  remoting_source_->AddClient(this);
}

RemotingRendererController::~RemotingRendererController() {
  DCHECK(thread_checker_.CalledOnValidThread());
  metrics_recorder_.WillStopSession(remoting::MEDIA_ELEMENT_DESTROYED);
  remoting_source_->RemoveClient(this);
}

void RemotingRendererController::OnStarted(bool success) {
  DCHECK(thread_checker_.CalledOnValidThread());

  if (success) {
    VLOG(1) << "Remoting started successively.";
    if (remote_rendering_started_) {
      metrics_recorder_.DidStartSession();
      DCHECK(!switch_renderer_cb_.is_null());
      switch_renderer_cb_.Run();
    } else {
      remoting_source_->StopRemoting(this);
    }
  } else {
    VLOG(1) << "Failed to start remoting.";
    remote_rendering_started_ = false;
    metrics_recorder_.WillStopSession(remoting::START_RACE);
  }
}

void RemotingRendererController::OnSessionStateChanged() {
  DCHECK(thread_checker_.CalledOnValidThread());
  UpdateFromSessionState(remoting::SINK_AVAILABLE, remoting::ROUTE_TERMINATED);
}

void RemotingRendererController::UpdateFromSessionState(
    remoting::StartTrigger start_trigger,
    remoting::StopTrigger stop_trigger) {
  VLOG(1) << "UpdateFromSessionState: " << remoting_source_->state();
  if (!sink_available_changed_cb_.is_null())
    sink_available_changed_cb_.Run(IsRemoteSinkAvailable());

  UpdateInterstitial(base::nullopt);
  UpdateAndMaybeSwitch(start_trigger, stop_trigger);
}

bool RemotingRendererController::IsRemoteSinkAvailable() {
  DCHECK(thread_checker_.CalledOnValidThread());

  switch (remoting_source_->state()) {
    case SESSION_CAN_START:
    case SESSION_STARTING:
    case SESSION_STARTED:
      return true;
    case SESSION_UNAVAILABLE:
    case SESSION_STOPPING:
    case SESSION_PERMANENTLY_STOPPED:
      return false;
  }

  return false;  // To suppress compile warning.
}

void RemotingRendererController::OnEnteredFullscreen() {
  DCHECK(thread_checker_.CalledOnValidThread());

  is_fullscreen_ = true;
  // See notes in OnBecameDominantVisibleContent() for why this is forced:
  is_dominant_content_ = true;
  UpdateAndMaybeSwitch(remoting::ENTERED_FULLSCREEN,
                       remoting::UNKNOWN_STOP_TRIGGER);
}

void RemotingRendererController::OnExitedFullscreen() {
  DCHECK(thread_checker_.CalledOnValidThread());

  is_fullscreen_ = false;
  // See notes in OnBecameDominantVisibleContent() for why this is forced:
  is_dominant_content_ = false;
  UpdateAndMaybeSwitch(remoting::UNKNOWN_START_TRIGGER,
                       remoting::EXITED_FULLSCREEN);
}

void RemotingRendererController::OnBecameDominantVisibleContent(
    bool is_dominant) {
  DCHECK(thread_checker_.CalledOnValidThread());

  // Two scenarios where "dominance" status mixes with fullscreen transitions:
  //
  //   1. Just before/after entering fullscreen, the element will, of course,
  //      become the dominant on-screen content via automatic page layout.
  //   2. Just before/after exiting fullscreen, the element may or may not
  //      shrink in size enough to become non-dominant. However, exiting
  //      fullscreen was caused by a user action that explicitly indicates a
  //      desire to exit remoting, so even if the element is still dominant,
  //      remoting should be shut down.
  //
  // Thus, to achieve the desired behaviors, |is_dominant_content_| is force-set
  // in OnEnteredFullscreen() and OnExitedFullscreen(), and changes to it here
  // are ignored while in fullscreen.
  if (is_fullscreen_)
    return;

  is_dominant_content_ = is_dominant;
  UpdateAndMaybeSwitch(remoting::BECAME_DOMINANT_CONTENT,
                       remoting::BECAME_AUXILIARY_CONTENT);
}

void RemotingRendererController::OnSetCdm(CdmContext* cdm_context) {
  DCHECK(thread_checker_.CalledOnValidThread());

  auto* remoting_cdm_context = RemotingCdmContext::From(cdm_context);
  if (!remoting_cdm_context)
    return;

  remoting_source_->RemoveClient(this);
  remoting_source_ = remoting_cdm_context->GetRemotingSource();
  remoting_source_->AddClient(this);
  UpdateFromSessionState(remoting::CDM_READY, remoting::DECRYPTION_ERROR);
}

void RemotingRendererController::OnRemotePlaybackDisabled(bool disabled) {
  DCHECK(thread_checker_.CalledOnValidThread());

  is_remote_playback_disabled_ = disabled;
  metrics_recorder_.OnRemotePlaybackDisabled(disabled);
  UpdateAndMaybeSwitch(remoting::ENABLED_BY_PAGE, remoting::DISABLED_BY_PAGE);
}

void RemotingRendererController::OnSetPoster(const GURL& poster_url) {
  DCHECK(thread_checker_.CalledOnValidThread());

  if (poster_url != poster_url_) {
    poster_url_ = poster_url;
    if (poster_url_.is_empty())
      UpdateInterstitial(SkBitmap());
    else
      DownloadPosterImage();
  }
}

void RemotingRendererController::SetSwitchRendererCallback(
    const base::Closure& cb) {
  DCHECK(thread_checker_.CalledOnValidThread());
  DCHECK(!cb.is_null());

  switch_renderer_cb_ = cb;
  // Note: Not calling UpdateAndMaybeSwitch() here since this method should be
  // called during the initialization phase of this RemotingRendererController;
  // and definitely before a whole lot of other things that are needed to
  // trigger a switch.
}

void RemotingRendererController::SetRemoteSinkAvailableChangedCallback(
    const base::Callback<void(bool)>& cb) {
  DCHECK(thread_checker_.CalledOnValidThread());

  sink_available_changed_cb_ = cb;
  if (!sink_available_changed_cb_.is_null())
    sink_available_changed_cb_.Run(IsRemoteSinkAvailable());
}

base::WeakPtr<remoting::RpcBroker> RemotingRendererController::GetRpcBroker()
    const {
  DCHECK(thread_checker_.CalledOnValidThread());

  return remoting_source_->GetRpcBroker()->GetWeakPtr();
}

void RemotingRendererController::StartDataPipe(
    std::unique_ptr<mojo::DataPipe> audio_data_pipe,
    std::unique_ptr<mojo::DataPipe> video_data_pipe,
    const RemotingSourceImpl::DataPipeStartCallback& done_callback) {
  DCHECK(thread_checker_.CalledOnValidThread());

  remoting_source_->StartDataPipe(std::move(audio_data_pipe),
                                  std::move(video_data_pipe), done_callback);
}

void RemotingRendererController::OnMetadataChanged(
    const PipelineMetadata& metadata) {
  DCHECK(thread_checker_.CalledOnValidThread());

  const gfx::Size old_size = pipeline_metadata_.natural_size;
  const bool was_audio_codec_supported = has_audio() && IsAudioCodecSupported();
  const bool was_video_codec_supported = has_video() && IsVideoCodecSupported();
  pipeline_metadata_ = metadata;
  const bool is_audio_codec_supported = has_audio() && IsAudioCodecSupported();
  const bool is_video_codec_supported = has_video() && IsVideoCodecSupported();
  metrics_recorder_.OnPipelineMetadataChanged(metadata);

  is_encrypted_ = false;
  if (has_video())
    is_encrypted_ |= metadata.video_decoder_config.is_encrypted();
  if (has_audio())
    is_encrypted_ |= metadata.audio_decoder_config.is_encrypted();

  if (pipeline_metadata_.natural_size != old_size)
    UpdateInterstitial(base::nullopt);

  remoting::StartTrigger start_trigger = remoting::UNKNOWN_START_TRIGGER;
  if (!was_audio_codec_supported && is_audio_codec_supported)
    start_trigger = remoting::SUPPORTED_AUDIO_CODEC;
  if (!was_video_codec_supported && is_video_codec_supported) {
    start_trigger = start_trigger == remoting::SUPPORTED_AUDIO_CODEC
                        ? remoting::SUPPORTED_AUDIO_AND_VIDEO_CODECS
                        : remoting::SUPPORTED_VIDEO_CODEC;
  }
  remoting::StopTrigger stop_trigger = remoting::UNKNOWN_STOP_TRIGGER;
  if (was_audio_codec_supported && !is_audio_codec_supported)
    stop_trigger = remoting::UNSUPPORTED_AUDIO_CODEC;
  if (was_video_codec_supported && !is_video_codec_supported) {
    stop_trigger = stop_trigger == remoting::UNSUPPORTED_AUDIO_CODEC
                       ? remoting::UNSUPPORTED_AUDIO_AND_VIDEO_CODECS
                       : remoting::UNSUPPORTED_VIDEO_CODEC;
  }
  UpdateAndMaybeSwitch(start_trigger, stop_trigger);
}

bool RemotingRendererController::IsVideoCodecSupported() {
  DCHECK(thread_checker_.CalledOnValidThread());
  DCHECK(has_video());

  switch (pipeline_metadata_.video_decoder_config.codec()) {
    case VideoCodec::kCodecH264:
    case VideoCodec::kCodecVP8:
      return true;
    default:
      VLOG(2) << "Remoting does not support video codec: "
              << pipeline_metadata_.video_decoder_config.codec();
      return false;
  }
}

bool RemotingRendererController::IsAudioCodecSupported() {
  DCHECK(thread_checker_.CalledOnValidThread());
  DCHECK(has_audio());

  switch (pipeline_metadata_.audio_decoder_config.codec()) {
    case AudioCodec::kCodecAAC:
    case AudioCodec::kCodecMP3:
    case AudioCodec::kCodecPCM:
    case AudioCodec::kCodecVorbis:
    case AudioCodec::kCodecFLAC:
    case AudioCodec::kCodecAMR_NB:
    case AudioCodec::kCodecAMR_WB:
    case AudioCodec::kCodecPCM_MULAW:
    case AudioCodec::kCodecGSM_MS:
    case AudioCodec::kCodecPCM_S16BE:
    case AudioCodec::kCodecPCM_S24BE:
    case AudioCodec::kCodecOpus:
    case AudioCodec::kCodecEAC3:
    case AudioCodec::kCodecPCM_ALAW:
    case AudioCodec::kCodecALAC:
    case AudioCodec::kCodecAC3:
      return true;
    default:
      VLOG(2) << "Remoting does not support audio codec: "
              << pipeline_metadata_.audio_decoder_config.codec();
      return false;
  }
}

void RemotingRendererController::OnPlaying() {
  DCHECK(thread_checker_.CalledOnValidThread());

  is_paused_ = false;
  UpdateAndMaybeSwitch(remoting::PLAY_COMMAND, remoting::UNKNOWN_STOP_TRIGGER);
}

void RemotingRendererController::OnPaused() {
  DCHECK(thread_checker_.CalledOnValidThread());

  is_paused_ = true;
}

bool RemotingRendererController::ShouldBeRemoting() {
  DCHECK(thread_checker_.CalledOnValidThread());

  if (switch_renderer_cb_.is_null()) {
    DCHECK(!remote_rendering_started_);
    return false;  // No way to switch to a RemotingRenderImpl.
  }

  const RemotingSessionState state = remoting_source_->state();
  if (is_encrypted_) {
    // Due to technical limitations when playing encrypted content, once a
    // remoting session has been started, always return true here to indicate
    // that the RemotingRendererImpl should be used. In the stopped states,
    // RemotingRendererImpl will display an interstitial to notify the user that
    // local rendering cannot be resumed.
    //
    // TODO(miu): Revisit this once more of the encrypted-remoting impl is
    // in-place. For example, this will prevent metrics from recording session
    // stop reasons.
    return state == RemotingSessionState::SESSION_STARTED ||
           state == RemotingSessionState::SESSION_STOPPING ||
           state == RemotingSessionState::SESSION_PERMANENTLY_STOPPED;
  }

  if (encountered_renderer_fatal_error_)
    return false;

  switch (state) {
    case SESSION_UNAVAILABLE:
      return false;  // Cannot remote media without a remote sink.
    case SESSION_CAN_START:
    case SESSION_STARTING:
    case SESSION_STARTED:
      break;  // Media remoting is possible, assuming other requirments are met.
    case SESSION_STOPPING:
    case SESSION_PERMANENTLY_STOPPED:
      return false;  // Use local rendering after stopping remoting.
  }

  switch (remoting_source_->sink_capabilities()) {
    case mojom::RemotingSinkCapabilities::NONE:
      return false;
    case mojom::RemotingSinkCapabilities::RENDERING_ONLY:
    case mojom::RemotingSinkCapabilities::CONTENT_DECRYPTION_AND_RENDERING:
      break;  // The sink is capable of remote rendering.
  }

  if ((!has_audio() && !has_video()) ||
      (has_video() && !IsVideoCodecSupported()) ||
      (has_audio() && !IsAudioCodecSupported())) {
    return false;
  }

  if (is_remote_playback_disabled_)
    return false;

  // Normally, entering fullscreen or being the dominant visible content is the
  // signal that starts remote rendering. However, current technical limitations
  // require encrypted content be remoted without waiting for a user signal.
  return is_fullscreen_ || is_dominant_content_;
}

void RemotingRendererController::UpdateAndMaybeSwitch(
    remoting::StartTrigger start_trigger,
    remoting::StopTrigger stop_trigger) {
  DCHECK(thread_checker_.CalledOnValidThread());

  bool should_be_remoting = ShouldBeRemoting();

  if (remote_rendering_started_ == should_be_remoting)
    return;

  // Only switch to remoting when media is playing. Since the renderer is
  // created when video starts loading/playing, receiver will display a black
  // screen before video starts playing if switching to remoting when paused.
  // Thus, the user experience is improved by not starting remoting until
  // playback resumes.
  if (should_be_remoting && is_paused_)
    return;

  // Switch between local renderer and remoting renderer.
  remote_rendering_started_ = should_be_remoting;

  if (remote_rendering_started_) {
    DCHECK(!switch_renderer_cb_.is_null());
    if (remoting_source_->state() ==
        RemotingSessionState::SESSION_PERMANENTLY_STOPPED) {
      switch_renderer_cb_.Run();
      return;
    }
    DCHECK_NE(start_trigger, remoting::UNKNOWN_START_TRIGGER);
    metrics_recorder_.WillStartSession(start_trigger);
    // |switch_renderer_cb_.Run()| will be called after remoting is started
    // successfully.
    remoting_source_->StartRemoting(this);
  } else {
    // For encrypted content, it's only valid to switch to remoting renderer,
    // and never back to the local renderer. The RemotingCdmController will
    // force-stop the session when remoting has ended; so no need to call
    // StopRemoting() from here.
    DCHECK(!is_encrypted_);
    DCHECK_NE(stop_trigger, remoting::UNKNOWN_STOP_TRIGGER);
    metrics_recorder_.WillStopSession(stop_trigger);
    switch_renderer_cb_.Run();
    remoting_source_->StopRemoting(this);
  }
}

void RemotingRendererController::SetShowInterstitialCallback(
    const ShowInterstitialCallback& cb) {
  DCHECK(thread_checker_.CalledOnValidThread());
  show_interstitial_cb_ = cb;
  UpdateInterstitial(SkBitmap());
  if (!poster_url_.is_empty())
    DownloadPosterImage();
}

void RemotingRendererController::SetDownloadPosterCallback(
    const DownloadPosterCallback& cb) {
  DCHECK(thread_checker_.CalledOnValidThread());
  DCHECK(download_poster_cb_.is_null());
  download_poster_cb_ = cb;
  if (!poster_url_.is_empty())
    DownloadPosterImage();
}

void RemotingRendererController::UpdateInterstitial(
    const base::Optional<SkBitmap>& image) {
  DCHECK(thread_checker_.CalledOnValidThread());
  if (show_interstitial_cb_.is_null() ||
      pipeline_metadata_.natural_size.IsEmpty())
    return;

  RemotingInterstitialType type = RemotingInterstitialType::BETWEEN_SESSIONS;
  switch (remoting_source_->state()) {
    case SESSION_STARTED:
      type = RemotingInterstitialType::IN_SESSION;
      break;
    case SESSION_PERMANENTLY_STOPPED:
      type = RemotingInterstitialType::ENCRYPTED_MEDIA_FATAL_ERROR;
      break;
    case SESSION_UNAVAILABLE:
    case SESSION_CAN_START:
    case SESSION_STARTING:
    case SESSION_STOPPING:
      break;
  }

  show_interstitial_cb_.Run(image, pipeline_metadata_.natural_size, type);
}

void RemotingRendererController::DownloadPosterImage() {
  if (download_poster_cb_.is_null() || show_interstitial_cb_.is_null())
    return;
  DCHECK(!poster_url_.is_empty());

  const base::TimeTicks download_start_time = base::TimeTicks::Now();
  download_poster_cb_.Run(
      poster_url_,
      base::Bind(&RemotingRendererController::OnPosterImageDownloaded,
                 weak_factory_.GetWeakPtr(), poster_url_, download_start_time));
}

void RemotingRendererController::OnPosterImageDownloaded(
    const GURL& download_url,
    base::TimeTicks download_start_time,
    const SkBitmap& image) {
  DCHECK(thread_checker_.CalledOnValidThread());

  metrics_recorder_.OnPosterImageDownloaded(
      base::TimeTicks::Now() - download_start_time, !image.drawsNothing());
  if (download_url != poster_url_)
    return;  // The poster image URL has changed during the download.
  UpdateInterstitial(image);
}

void RemotingRendererController::OnRendererFatalError(
    remoting::StopTrigger stop_trigger) {
  DCHECK(thread_checker_.CalledOnValidThread());

  // Do not act on errors caused by things like Mojo pipes being closed during
  // shutdown.
  if (!remote_rendering_started_)
    return;

  encountered_renderer_fatal_error_ = true;
  UpdateAndMaybeSwitch(remoting::UNKNOWN_START_TRIGGER, stop_trigger);
}

}  // namespace media


text:
namespace glm
{
	/// @addtogroup core_func_common
	/// @{

	/// Returns x if x >= 0; otherwise, it returns -x.
	///
	/// @tparam genType floating-point or signed integer; scalar or vector types.
	///
	/// @see GLSL abs man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<typename genType>
	GLM_FUNC_DECL GLM_CONSTEXPR genType abs(genType x);

	/// Returns x if x >= 0; otherwise, it returns -x.
	///
	/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
	/// @tparam T Floating-point or signed integer scalar types
	/// @tparam Q Value from qualifier enum
	///
	/// @see GLSL abs man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> abs(vec<L, T, Q> const& x);

	/// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0.
	///
	/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
	/// @tparam T Floating-point scalar types
	/// @tparam Q Value from qualifier enum
	///
	/// @see GLSL sign man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL vec<L, T, Q> sign(vec<L, T, Q> const& x);

	/// Returns a value equal to the nearest integer that is less then or equal to x.
	///
	/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
	/// @tparam T Floating-point scalar types
	/// @tparam Q Value from qualifier enum
	///
	/// @see GLSL floor man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL vec<L, T, Q> floor(vec<L, T, Q> const& x);

	/// Returns a value equal to the nearest integer to x
	/// whose absolute value is not larger than the absolute value of x.
	///
	/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
	/// @tparam T Floating-point scalar types
	/// @tparam Q Value from qualifier enum
	///
	/// @see GLSL trunc man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL vec<L, T, Q> trunc(vec<L, T, Q> const& x);

	/// Returns a value equal to the nearest integer to x.
	/// The fraction 0.5 will round in a direction chosen by the
	/// implementation, presumably the direction that is fastest.
	/// This includes the possibility that round(x) returns the
	/// same value as roundEven(x) for all values of x.
	///
	/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
	/// @tparam T Floating-point scalar types
	/// @tparam Q Value from qualifier enum
	///
	/// @see GLSL round man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL vec<L, T, Q> round(vec<L, T, Q> const& x);

	/// Returns a value equal to the nearest integer to x.
	/// A fractional part of 0.5 will round toward the nearest even
	/// integer. (Both 3.5 and 4.5 for x will return 4.0.)
	///
	/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
	/// @tparam T Floating-point scalar types
	/// @tparam Q Value from qualifier enum
	///
	/// @see GLSL roundEven man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	/// @see New round to even technique
	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL vec<L, T, Q> roundEven(vec<L, T, Q> const& x);

	/// Returns a value equal to the nearest integer
	/// that is greater than or equal to x.
	///
	/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
	/// @tparam T Floating-point scalar types
	/// @tparam Q Value from qualifier enum
	///
	/// @see GLSL ceil man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL vec<L, T, Q> ceil(vec<L, T, Q> const& x);

	/// Return x - floor(x).
	///
	/// @tparam genType Floating-point scalar or vector types.
	///
	/// @see GLSL fract man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<typename genType>
	GLM_FUNC_DECL genType fract(genType x);

	/// Return x - floor(x).
	///
	/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
	/// @tparam T Floating-point scalar types
	/// @tparam Q Value from qualifier enum
	///
	/// @see GLSL fract man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL vec<L, T, Q> fract(vec<L, T, Q> const& x);

	template<typename genType>
	GLM_FUNC_DECL genType mod(genType x, genType y);

	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL vec<L, T, Q> mod(vec<L, T, Q> const& x, T y);

	/// Modulus. Returns x - y * floor(x / y)
	/// for each component in x using the floating point value y.
	///
	/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
	/// @tparam T Floating-point scalar types, include glm/gtc/integer for integer scalar types support
	/// @tparam Q Value from qualifier enum
	///
	/// @see GLSL mod man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL vec<L, T, Q> mod(vec<L, T, Q> const& x, vec<L, T, Q> const& y);

	/// Returns the fractional part of x and sets i to the integer
	/// part (as a whole number floating point value). Both the
	/// return value and the output parameter will have the same
	/// sign as x.
	///
	/// @tparam genType Floating-point scalar or vector types.
	///
	/// @see GLSL modf man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<typename genType>
	GLM_FUNC_DECL genType modf(genType x, genType& i);

	/// Returns y if y < x; otherwise, it returns x.
	///
	/// @tparam genType Floating-point or integer; scalar or vector types.
	///
	/// @see GLSL min man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<typename genType>
	GLM_FUNC_DECL GLM_CONSTEXPR genType min(genType x, genType y);

	/// Returns y if y < x; otherwise, it returns x.
	///
	/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
	/// @tparam T Floating-point or integer scalar types
	/// @tparam Q Value from qualifier enum
	///
	/// @see GLSL min man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> min(vec<L, T, Q> const& x, T y);

	/// Returns y if y < x; otherwise, it returns x.
	///
	/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
	/// @tparam T Floating-point or integer scalar types
	/// @tparam Q Value from qualifier enum
	///
	/// @see GLSL min man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> min(vec<L, T, Q> const& x, vec<L, T, Q> const& y);

	/// Returns y if x < y; otherwise, it returns x.
	///
	/// @tparam genType Floating-point or integer; scalar or vector types.
	///
	/// @see GLSL max man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<typename genType>
	GLM_FUNC_DECL GLM_CONSTEXPR genType max(genType x, genType y);

	/// Returns y if x < y; otherwise, it returns x.
	///
	/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
	/// @tparam T Floating-point or integer scalar types
	/// @tparam Q Value from qualifier enum
	///
	/// @see GLSL max man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> max(vec<L, T, Q> const& x, T y);

	/// Returns y if x < y; otherwise, it returns x.
	///
	/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
	/// @tparam T Floating-point or integer scalar types
	/// @tparam Q Value from qualifier enum
	///
	/// @see GLSL max man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> max(vec<L, T, Q> const& x, vec<L, T, Q> const& y);

	/// Returns min(max(x, minVal), maxVal) for each component in x
	/// using the floating-point values minVal and maxVal.
	///
	/// @tparam genType Floating-point or integer; scalar or vector types.
	///
	/// @see GLSL clamp man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<typename genType>
	GLM_FUNC_DECL GLM_CONSTEXPR genType clamp(genType x, genType minVal, genType maxVal);

	/// Returns min(max(x, minVal), maxVal) for each component in x
	/// using the floating-point values minVal and maxVal.
	///
	/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
	/// @tparam T Floating-point or integer scalar types
	/// @tparam Q Value from qualifier enum
	///
	/// @see GLSL clamp man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> clamp(vec<L, T, Q> const& x, T minVal, T maxVal);

	/// Returns min(max(x, minVal), maxVal) for each component in x
	/// using the floating-point values minVal and maxVal.
	///
	/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
	/// @tparam T Floating-point or integer scalar types
	/// @tparam Q Value from qualifier enum
	///
	/// @see GLSL clamp man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> clamp(vec<L, T, Q> const& x, vec<L, T, Q> const& minVal, vec<L, T, Q> const& maxVal);

	/// If genTypeU is a floating scalar or vector:
	/// Returns x * (1.0 - a) + y * a, i.e., the linear blend of
	/// x and y using the floating-point value a.
	/// The value for a is not restricted to the range [0, 1].
	///
	/// If genTypeU is a boolean scalar or vector:
	/// Selects which vector each returned component comes
	/// from. For a component of 'a' that is false, the
	/// corresponding component of 'x' is returned. For a
	/// component of 'a' that is true, the corresponding
	/// component of 'y' is returned. Components of 'x' and 'y' that
	/// are not selected are allowed to be invalid floating point
	/// values and will have no effect on the results. Thus, this
	/// provides different functionality than
	/// genType mix(genType x, genType y, genType(a))
	/// where a is a Boolean vector.
	///
	/// @see GLSL mix man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	///
	/// @param[in]  x Value to interpolate.
	/// @param[in]  y Value to interpolate.
	/// @param[in]  a Interpolant.
	///
	/// @tparam	genTypeT Floating point scalar or vector.
	/// @tparam genTypeU Floating point or boolean scalar or vector. It can't be a vector if it is the length of genTypeT.
	///
	/// @code
	/// #include <glm/glm.hpp>
	/// ...
	/// float a;
	/// bool b;
	/// glm::dvec3 e;
	/// glm::dvec3 f;
	/// glm::vec4 g;
	/// glm::vec4 h;
	/// ...
	/// glm::vec4 r = glm::mix(g, h, a); // Interpolate with a floating-point scalar two vectors.
	/// glm::vec4 s = glm::mix(g, h, b); // Returns g or h;
	/// glm::dvec3 t = glm::mix(e, f, a); // Types of the third parameter is not required to match with the first and the second.
	/// glm::vec4 u = glm::mix(g, h, r); // Interpolations can be perform per component with a vector for the last parameter.
	/// @endcode
	template<typename genTypeT, typename genTypeU>
	GLM_FUNC_DECL genTypeT mix(genTypeT x, genTypeT y, genTypeU a);

	template<length_t L, typename T, typename U, qualifier Q>
	GLM_FUNC_DECL vec<L, T, Q> mix(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, U, Q> const& a);

	template<length_t L, typename T, typename U, qualifier Q>
	GLM_FUNC_DECL vec<L, T, Q> mix(vec<L, T, Q> const& x, vec<L, T, Q> const& y, U a);

	/// Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType.
	///
	/// @see GLSL step man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<typename genType>
	GLM_FUNC_DECL genType step(genType edge, genType x);

	/// Returns 0.0 if x < edge, otherwise it returns 1.0.
	///
	/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
	/// @tparam T Floating-point scalar types
	/// @tparam Q Value from qualifier enum
	///
	/// @see GLSL step man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL vec<L, T, Q> step(T edge, vec<L, T, Q> const& x);

	/// Returns 0.0 if x < edge, otherwise it returns 1.0.
	///
	/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
	/// @tparam T Floating-point scalar types
	/// @tparam Q Value from qualifier enum
	///
	/// @see GLSL step man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL vec<L, T, Q> step(vec<L, T, Q> const& edge, vec<L, T, Q> const& x);

	/// Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and
	/// performs smooth Hermite interpolation between 0 and 1
	/// when edge0 < x < edge1. This is useful in cases where
	/// you would want a threshold function with a smooth
	/// transition. This is equivalent to:
	/// genType t;
	/// t = clamp ((x - edge0) / (edge1 - edge0), 0, 1);
	/// return t * t * (3 - 2 * t);
	/// Results are undefined if edge0 >= edge1.
	///
	/// @tparam genType Floating-point scalar or vector types.
	///
	/// @see GLSL smoothstep man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<typename genType>
	GLM_FUNC_DECL genType smoothstep(genType edge0, genType edge1, genType x);

	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL vec<L, T, Q> smoothstep(T edge0, T edge1, vec<L, T, Q> const& x);

	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL vec<L, T, Q> smoothstep(vec<L, T, Q> const& edge0, vec<L, T, Q> const& edge1, vec<L, T, Q> const& x);

	/// Returns true if x holds a NaN (not a number)
	/// representation in the underlying implementation's set of
	/// floating point representations. Returns false otherwise,
	/// including for implementations with no NaN
	/// representations.
	///
	/// /!\ When using compiler fast math, this function may fail.
	///
	/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
	/// @tparam T Floating-point scalar types
	/// @tparam Q Value from qualifier enum
	///
	/// @see GLSL isnan man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL vec<L, bool, Q> isnan(vec<L, T, Q> const& x);

	/// Returns true if x holds a positive infinity or negative
	/// infinity representation in the underlying implementation's
	/// set of floating point representations. Returns false
	/// otherwise, including for implementations with no infinity
	/// representations.
	///
	/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
	/// @tparam T Floating-point scalar types
	/// @tparam Q Value from qualifier enum
	///
	/// @see GLSL isinf man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<length_t L, typename T, qualifier Q>
	GLM_FUNC_DECL vec<L, bool, Q> isinf(vec<L, T, Q> const& x);

	/// Returns a signed integer value representing
	/// the encoding of a floating-point value. The floating-point
	/// value's bit-level representation is preserved.
	///
	/// @see GLSL floatBitsToInt man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	GLM_FUNC_DECL int floatBitsToInt(float const& v);

	/// Returns a signed integer value representing
	/// the encoding of a floating-point value. The floatingpoint
	/// value's bit-level representation is preserved.
	///
	/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
	/// @tparam Q Value from qualifier enum
	///
	/// @see GLSL floatBitsToInt man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<length_t L, qualifier Q>
	GLM_FUNC_DECL vec<L, int, Q> floatBitsToInt(vec<L, float, Q> const& v);

	/// Returns a unsigned integer value representing
	/// the encoding of a floating-point value. The floatingpoint
	/// value's bit-level representation is preserved.
	///
	/// @see GLSL floatBitsToUint man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	GLM_FUNC_DECL uint floatBitsToUint(float const& v);

	/// Returns a unsigned integer value representing
	/// the encoding of a floating-point value. The floatingpoint
	/// value's bit-level representation is preserved.
	///
	/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
	/// @tparam Q Value from qualifier enum
	///
	/// @see GLSL floatBitsToUint man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<length_t L, qualifier Q>
	GLM_FUNC_DECL vec<L, uint, Q> floatBitsToUint(vec<L, float, Q> const& v);

	/// Returns a floating-point value corresponding to a signed
	/// integer encoding of a floating-point value.
	/// If an inf or NaN is passed in, it will not signal, and the
	/// resulting floating point value is unspecified. Otherwise,
	/// the bit-level representation is preserved.
	///
	/// @see GLSL intBitsToFloat man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	GLM_FUNC_DECL float intBitsToFloat(int const& v);

	/// Returns a floating-point value corresponding to a signed
	/// integer encoding of a floating-point value.
	/// If an inf or NaN is passed in, it will not signal, and the
	/// resulting floating point value is unspecified. Otherwise,
	/// the bit-level representation is preserved.
	///
	/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
	/// @tparam Q Value from qualifier enum
	///
	/// @see GLSL intBitsToFloat man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<length_t L, qualifier Q>
	GLM_FUNC_DECL vec<L, float, Q> intBitsToFloat(vec<L, int, Q> const& v);

	/// Returns a floating-point value corresponding to a
	/// unsigned integer encoding of a floating-point value.
	/// If an inf or NaN is passed in, it will not signal, and the
	/// resulting floating point value is unspecified. Otherwise,
	/// the bit-level representation is preserved.
	///
	/// @see GLSL uintBitsToFloat man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	GLM_FUNC_DECL float uintBitsToFloat(uint const& v);

	/// Returns a floating-point value corresponding to a
	/// unsigned integer encoding of a floating-point value.
	/// If an inf or NaN is passed in, it will not signal, and the
	/// resulting floating point value is unspecified. Otherwise,
	/// the bit-level representation is preserved.
	///
	/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
	/// @tparam Q Value from qualifier enum
	///
	/// @see GLSL uintBitsToFloat man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<length_t L, qualifier Q>
	GLM_FUNC_DECL vec<L, float, Q> uintBitsToFloat(vec<L, uint, Q> const& v);

	/// Computes and returns a * b + c.
	///
	/// @tparam genType Floating-point scalar or vector types.
	///
	/// @see GLSL fma man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<typename genType>
	GLM_FUNC_DECL genType fma(genType const& a, genType const& b, genType const& c);

	/// Splits x into a floating-point significand in the range
	/// [0.5, 1.0) and an integral exponent of two, such that:
	/// x = significand * exp(2, exponent)
	///
	/// The significand is returned by the function and the
	/// exponent is returned in the parameter exp. For a
	/// floating-point value of zero, the significant and exponent
	/// are both zero. For a floating-point value that is an
	/// infinity or is not a number, the results are undefined.
	///
	/// @tparam genType Floating-point scalar or vector types.
	///
	/// @see GLSL frexp man page
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<typename genType, typename genIType>
	GLM_FUNC_DECL genType frexp(genType const& x, genIType& exp);

	/// Builds a floating-point number from x and the
	/// corresponding integral exponent of two in exp, returning:
	/// significand * exp(2, exponent)
	///
	/// If this product is too large to be represented in the
	/// floating-point type, the result is undefined.
	///
	/// @tparam genType Floating-point scalar or vector types.
	///
	/// @see GLSL ldexp man page;
	/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
	template<typename genType, typename genIType>
	GLM_FUNC_DECL genType ldexp(genType const& x, genIType const& exp);

	/// @}
}//namespace glm

#include "detail/func_common.inl"


text:
/*============================================================================*/
/*
  VFLib: https://github.com/vinniefalco/VFLib

  Copyright (C) 2008 by Vinnie Falco <vinnie.falco@gmail.com>

  This library contains portions of other open source products covered by
  separate licenses. Please see the corresponding source files for specific
  terms.

  VFLib is provided under the terms of The MIT License (MIT):

  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
  in the Software without restriction, including without limitation the rights
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:

  The above copyright notice and this permission notice shall be included in
  all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  IN THE SOFTWARE.
*/
/*============================================================================*/

void FPUFlags::clearUnsetFlagsFrom (const FPUFlags& flags)
{
  if (!flags.getMaskNaNs().is_set ())         m_maskNaNs.clear ();
  if (!flags.getMaskDenormals().is_set ())    m_maskDenormals.clear ();
  if (!flags.getMaskZeroDivides().is_set ())  m_maskZeroDivides.clear ();
  if (!flags.getMaskOverflows().is_set ())    m_maskOverflows.clear ();
  if (!flags.getMaskUnderflows().is_set ())   m_maskUnderflows.clear ();
//if (!flags.getMaskInexacts().is_set ())     m_maskInexacts.clear ();
  if (!flags.getFlushDenormals().is_set ())   m_flushDenormals.clear ();
  if (!flags.getInfinitySigned().is_set ())   m_infinitySigned.clear ();
  if (!flags.getRounding().is_set ())         m_rounding.clear ();
  if (!flags.getPrecision().is_set ())        m_precision.clear ();
}


text:
import { ParameterEditor, IParameterEditorDelegate } from "./parameterEditor.base";
import { createAndCloneTemplateElement } from "../admin.pageLoader";
import { Utils } from "../admin.utils";
import { IIoBrokerConversion_MapEntry, isMultiStateParameter, IIoBrokerConversion_Map_Parameters } from "../../yahka.functions/conversion.map";
import { isObject } from "util";

export class ParameterEditor_Map extends ParameterEditor {
    private templateNode: DocumentFragment;
    private stateRows: Element[] = [];
    private lastRow: HTMLDivElement;
    private stateTemplate: HTMLTemplateElement;
    constructor(valueChangeCallback: IParameterEditorDelegate) {
        super(valueChangeCallback);
        this.templateNode = createAndCloneTemplateElement(require('./parameterEditor.Map.inc.html'));

        this.stateTemplate = this.templateNode.querySelector('#mappingRow');
        this.lastRow = this.templateNode.querySelector('#lastRow')
        let addRow = this.templateNode.querySelector("#addRow");
        addRow.addEventListener('click', this.addRowClicked.bind(this));
    }

    createRow(item: IIoBrokerConversion_MapEntry | undefined): Element {
        let importedRow = <DocumentFragment>document.importNode(this.stateTemplate.content, true);
        let myRow = this.lastRow.parentElement.insertBefore(importedRow.firstElementChild, this.lastRow);
        this.stateRows.push(myRow);

        let leftField = <HTMLInputElement>myRow.querySelector('#ioBrokerValue');
        leftField.addEventListener('input', (ev) => this.valueChanged());
        let leftCheck = <HTMLInputElement>myRow.querySelector('#isSimpleValue');
        leftCheck.addEventListener('input', (ev) => this.valueChanged());

        let rightField = <HTMLInputElement>myRow.querySelector('#homekitValue');
        rightField.addEventListener('input', (ev) => this.valueChanged());

        myRow.querySelector('#delRow').addEventListener('click', () => {
            myRow.remove();
            this.stateRows = this.stateRows.filter(row => row != myRow);
            this.valueChanged();
        });

        myRow.querySelector('#moveUp').addEventListener('click', () => {
            let myIndex = this.stateRows.indexOf(myRow);
            let prevIndex = myIndex - 1;
            if (prevIndex < 0) {
                return;
            }

            let prevRow = this.stateRows[prevIndex];
            this.stateRows[prevIndex] = myRow;
            this.stateRows[myIndex] = prevRow;
            this.lastRow.parentElement.insertBefore(myRow, prevRow);
            this.valueChanged();
        });

        myRow.querySelector('#moveDown').addEventListener('click', () => {
            let myIndex = this.stateRows.indexOf(myRow);
            let nextIndex = myIndex + 1;
            if ((myIndex < 0) || (nextIndex >= this.stateRows.length)) {
                return;
            }

            let nextRow = this.stateRows[nextIndex];
            this.stateRows[nextIndex] = myRow;
            this.stateRows[myIndex] = nextRow;
            this.lastRow.parentElement.insertBefore(nextRow, myRow);
            this.valueChanged();
        });

        if (item === undefined)
            return myRow;

        if (isObject(item.left)) {
            Utils.setInputValue(leftField, JSON.stringify(item.left));
            leftCheck.checked = false;
        } else {
            Utils.setInputValue(leftField, item.left);
            leftCheck.checked = true;
        }
        Utils.setInputValue(rightField, item.right);

    }

    addRowClicked() {
        this.createRow(undefined);
        return false;
    }

    refreshAndShow(containerElement: HTMLElement, parameterValue: any) {
        this.removeChildren(containerElement);
        containerElement.appendChild(this.templateNode);

        if (parameterValue === undefined) {
            return
        }

        if (!isMultiStateParameter(parameterValue)) {
            return
        }

        parameterValue.mappings.forEach(item => this.createRow(item));
    }

    protected buildNewParameterValue(): any {
        return {
            mappings: this.stateRows.map((row): IIoBrokerConversion_MapEntry => {
                let ioValue = <HTMLInputElement>row.querySelector('#ioBrokerValue');
                let isSimpleValue = <HTMLInputElement>row.querySelector('#isSimpleValue');
                let leftValue = Utils.getInputValue(ioValue);
                let hkValue = <HTMLInputElement>row.querySelector('#homekitValue');
                return {
                    left: isSimpleValue.checked ? leftValue?.toString() : JSON.parse(leftValue?.toString()),
                    right: Utils.getInputValue(hkValue),
                }

            })
        }
    }
}


text:
using System;
using Microsoft.Kinect;

namespace KinectPowerPointControl.Gestures.Poses
{
    public class HandLeft_HandRightOfElbowPose : IGesturePose
    {
        public GesturePoseResult DetectPose(Body body) //TODO contemplar mano cerrada o abierta
        {
            if (body.Joints[JointType.HandLeft].Position.Y > body.Joints[JointType.ElbowLeft].Position.Y) //mano arriba del codo
            {
                if (body.Joints[JointType.HandLeft].Position.X > body.Joints[JointType.ElbowLeft].Position.X) //mano a la derecha del codo
                {
                    return GesturePoseResult.Succeeded;
                }

                // Hand has not dropped but is not quite where we expect it to be, pausing till next frame
                return GesturePoseResult.Undetermined;
            }

            return GesturePoseResult.Failed;
        }
    }

    public class HandLeft_HandLeftOfElbowPose : IGesturePose
    {
        public GesturePoseResult DetectPose(Body body) //TODO contemplar mano cerrada o abierta
        {
            if (body.Joints[JointType.HandLeft].Position.Y > body.Joints[JointType.ElbowLeft].Position.Y) //mano arriba del codo
            {
                if (body.Joints[JointType.HandLeft].Position.X < body.Joints[JointType.ElbowLeft].Position.X) //mano a la derecha del codo
                {
                    return GesturePoseResult.Succeeded;
                }

                // Hand has not dropped but is not quite where we expect it to be, pausing till next frame
                return GesturePoseResult.Undetermined;
            }

            return GesturePoseResult.Failed;
        }
    }

    public class HandLeft_HandClosedPose : IGesturePose
    {
        public GesturePoseResult DetectPose(Body body)
        {
            if (body.HandLeftState == HandState.Closed)
                return GesturePoseResult.Succeeded;

            return GesturePoseResult.Failed;
        }
    }

    public class HandLeft_HandOpenedPose : IGesturePose
    {
        public GesturePoseResult DetectPose(Body body)
        {
            if (body.HandLeftState == HandState.Open)
                return GesturePoseResult.Succeeded;

            return GesturePoseResult.Failed;
        }
    }
}


text:
require 'spec_helper'

module GraphMapperRails
  describe GraphMapperRails do
    context "Initializer" do
      it "invokes setup" do
        Initializer.setup do | config |
          config.class.should == Config
        end
      end

      it "invokes config" do
        Initializer.config.should_not be_nil
      end
    end

    context "Config" do
      it "invoke initialize" do
        Config.new.highcharts_js_path.should == "graph_mapper_rails/highcharts.js"
      end

      # TODO : fix spec file
=begin
      it "invoke get_mapper" do
        3.times { FactoryGirl.create(:sample) }

        Initializer.setup do |config|
          config.mapper_klass = Sample
          config.date.set_mapper do | mapper, record |
            mapper.key = record.created_at
            mapper.num = 1
          end

          config.set_options do | options |
            options.span_type   = GraphMapper::SPAN_WEEKLY
            options.date_format = "%-m/%-d"
            options.moving_average_length = 2
          end

          config.use_average = true
          config.duration = 3.months
        end

        # Initializer.config.date.get_mapper("test").should_not be_nil
      end
=end
    end
  end
end


text:
package brooklyn.entity.webapp;

import org.testng.Assert;
import org.testng.annotations.Test;

@Test
public class FilenameToWebContextMapperTest {

//    *   either ROOT.WAR or /       denotes root context
//    *

//    *   anything of form  FOO.?AR  (ending .?AR) is copied with that name (unless copying not necessary)
//    *                              and is expected to be served from /FOO
//    *

//    *   anything of form  /FOO     (with leading slash) is expected to be served from /FOO
//    *                              (and is copied as FOO.WAR)
//    *

//    *   anything of form  FOO      (without a dot) is expected to be served from /FOO
//    *                              (and is copied as FOO.WAR)
//    *

//    *   otherwise please note behaviour may vary on different appservers;
//    *   e.g. FOO.FOO would probably be ignored on appservers which expect a file copied across (usually),
//    *   but served as /FOO.FOO on systems that take a deployment context.

    FilenameToWebContextMapper m = new FilenameToWebContextMapper();

    private void assertMapping(String input, String context, String filename) {
        Assert.assertEquals(m.convertDeploymentTargetNameToContext(input), context);
        Assert.assertEquals(m.convertDeploymentTargetNameToFilename(input), filename);
    }

    public void testRootNames() {
        assertMapping("/", "/", "ROOT.war");
        assertMapping("ROOT.war", "/", "ROOT.war");

        //bad ones -- some of these aren't invertible
        assertMapping("/ROOT.war", "/ROOT.war", "ROOT.war.war");
        assertMapping("/ROOT", "/ROOT", "ROOT.war");

        //and leave empty string alone (will cause subsequent error)
        assertMapping("", "", "");
    }

    public void testOtherNames() {
        assertMapping("/foo", "/foo", "foo.war");
        assertMapping("/foo.foo", "/foo.foo", "foo.foo.war");
        assertMapping("foo.war", "/foo", "foo.war");
        assertMapping("foo.Ear", "/foo", "foo.Ear");
        assertMapping("foo", "/foo", "foo.war");

        //bad ones -- some of these aren't invertible
        assertMapping("foo.foo", "/foo.foo", "foo.foo");
    }

    public void testInferFromUrl() {
        Assert.assertEquals(m.findArchiveNameFromUrl("http//localhost/simple.war", false), "simple.war");
        Assert.assertEquals(m.findArchiveNameFromUrl("http//localhost/simple.Ear?type=raw", false), "simple.Ear");
        Assert.assertEquals(m.findArchiveNameFromUrl("http//localhost/simple.war?type=raw*other=sample.war", false), "simple.war");
        Assert.assertEquals(m.findArchiveNameFromUrl("http//localhost/get?file=simple.war", false), "simple.war");
        Assert.assertEquals(m.findArchiveNameFromUrl("http//localhost/get?file=simple.war&other=ignore", false), "simple.war");
        //takes the first (but logs warning in verbose mode)
        Assert.assertEquals(m.findArchiveNameFromUrl("http//localhost/get?file=simple.war&other=sample.war", false), "simple.war");
        //allows hyphen
        Assert.assertEquals(m.findArchiveNameFromUrl("http//localhost/get?file=simple-simon.war&other=sample", false), "simple-simon.war");
        Assert.assertEquals(m.findArchiveNameFromUrl("http//localhost/get?file=simple\\simon.war&other=sample", false), "simon.war");
    }

}


text:
require File.expand_path('../../lib/today', __FILE__)
require File.expand_path('../../spec/support/models', __FILE__)
require 'rspec'


text:
<?php namespace estvoyage\risingsun\comparison\unary;

use estvoyage\risingsun\{ comparison, block, oboolean };

class disjunction
	implements
		comparison\unary
{
	private
		$comparisons,
		$oboolean
	;

	function __construct(comparison\unary\container $comparisons, oboolean $oboolean)
	{
		$this->comparisons = $comparisons;
		$this->oboolean = $oboolean;
	}

	function recipientOfComparisonWithOperandIs($operand, comparison\recipient $recipient)
	{
		$self = clone $this;

		$self->comparisons
			->payloadForUnaryComparisonContainerIteratorIs(
				new comparison\unary\container\iterator\any,
				new comparison\unary\container\payload\disjunction(
					$operand,
					new comparison\recipient\oboolean(
						$self->oboolean,
						new oboolean\recipient\functor(
							new block\functor(
								function($oboolean) use ($self)
								{
									$self->oboolean = $oboolean;
								}
							)
						)
					)
				)
			)
		;

		$self->oboolean->recipientOfNBooleanIs($recipient);
	}
}


text:
generate list for all-resources and available-resource.

## list.acquire()

get available resource
Steps:
  check if resource at least has 1 member
  get last resource / pop it from available list. push it to busy list.
  if available is empty, blocking.
  add to busy set with expired timestamp to release when maxTimeoutToRelease reached

input key: all-resource set, available, busy-list
input args: timeout block (in second)

## list.release(resource)

return resource to end of available list.
Steps:
  remove resource from busy list.
  check if resource is not removed while busy by checking if it exist in all resource set
  if exist, return it to available list
  else do nothing

input key: busy, busy-set, all-resource, available,
input args: resource


text:
<?php
/**
 * Woocommerce Compatibility
 *
 * @package Moesia
 */

/**
 * Declare support
 */
add_theme_support( 'woocommerce' );

/**
 * Remove WooCommerce wrappers
 */
remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);

/**
 * Add the wrappers for the theme
 */
add_action('woocommerce_before_main_content', 'my_theme_wrapper_start', 10);
add_action('woocommerce_after_main_content', 'my_theme_wrapper_end', 10);

function my_theme_wrapper_start() {
	echo '
';
		echo '';
}

function my_theme_wrapper_end() {
		echo '';
	echo '
';
}

/**
 * Remove default WooCommerce CSS
 */

add_filter( 'woocommerce_enqueue_styles', 'jk_dequeue_styles' );
function jk_dequeue_styles( $enqueue_styles ) {
	unset( $enqueue_styles['woocommerce-general'] );	// Remove the gloss
	return $enqueue_styles;
}

/**
 * Enqueue custom CSS for Woocommerce
 */
function moesia_woocommerce_css() {
	if ( class_exists('WooCommerce') ) {
    	wp_enqueue_style( 'moesia-wc-css', get_template_directory_uri() . '/woocommerce/css/wc.css' );
	}
}
add_action( 'wp_enqueue_scripts', 'moesia_woocommerce_css' );

/**
 * Add short product description on WC categories
 */
function moesia_product_desc() {
	$content = get_the_content();
	$trimmed = wp_trim_words( $content, 20 );
	echo '
' . $trimmed . '
';
}
add_action( 'woocommerce_after_shop_loop_item', 'moesia_product_desc', 9 );


text:
package metrics

import (
	"time"

	e2eperftype "k8s.io/kubernetes/test/e2e/perftype"
)

// LatencyMetric is a struct for dashboard metrics.
type LatencyMetric struct {
	Perc50  time.Duration `json:"Perc50"`
	Perc90  time.Duration `json:"Perc90"`
	Perc99  time.Duration `json:"Perc99"`
	Perc100 time.Duration `json:"Perc100"`
}

// PodStartupLatency is a struct for managing latency of pod startup.
type PodStartupLatency struct {
	CreateToScheduleLatency LatencyMetric `json:"createToScheduleLatency"`
	ScheduleToRunLatency    LatencyMetric `json:"scheduleToRunLatency"`
	RunToWatchLatency       LatencyMetric `json:"runToWatchLatency"`
	ScheduleToWatchLatency  LatencyMetric `json:"scheduleToWatchLatency"`
	E2ELatency              LatencyMetric `json:"e2eLatency"`
}

// SummaryKind returns the summary of pod startup latency.
func (l *PodStartupLatency) SummaryKind() string {
	return "PodStartupLatency"
}

// PrintHumanReadable returns pod startup letency with JSON format.
func (l *PodStartupLatency) PrintHumanReadable() string {
	return PrettyPrintJSON(l)
}

// PrintJSON returns pod startup letency with JSON format.
func (l *PodStartupLatency) PrintJSON() string {
	return PrettyPrintJSON(PodStartupLatencyToPerfData(l))
}

func latencyToPerfData(l LatencyMetric, name string) e2eperftype.DataItem {
	return e2eperftype.DataItem{
		Data: map[string]float64{
			"Perc50":  float64(l.Perc50) / 1000000, // us -> ms
			"Perc90":  float64(l.Perc90) / 1000000,
			"Perc99":  float64(l.Perc99) / 1000000,
			"Perc100": float64(l.Perc100) / 1000000,
		},
		Unit: "ms",
		Labels: map[string]string{
			"Metric": name,
		},
	}
}

// PodStartupLatencyToPerfData transforms PodStartupLatency to PerfData.
func PodStartupLatencyToPerfData(latency *PodStartupLatency) *e2eperftype.PerfData {
	perfData := &e2eperftype.PerfData{Version: currentAPICallMetricsVersion}
	perfData.DataItems = append(perfData.DataItems, latencyToPerfData(latency.CreateToScheduleLatency, "create_to_schedule"))
	perfData.DataItems = append(perfData.DataItems, latencyToPerfData(latency.ScheduleToRunLatency, "schedule_to_run"))
	perfData.DataItems = append(perfData.DataItems, latencyToPerfData(latency.RunToWatchLatency, "run_to_watch"))
	perfData.DataItems = append(perfData.DataItems, latencyToPerfData(latency.ScheduleToWatchLatency, "schedule_to_watch"))
	perfData.DataItems = append(perfData.DataItems, latencyToPerfData(latency.E2ELatency, "pod_startup"))
	return perfData
}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.manager.task"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="14"
        android:targetSdkVersion="17" />

    <permission
        android:name="com.manager.task.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />

    <uses-permission android:name="com.manager.task.permission.MAPS_RECEIVE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <application
        android:name=".TaskManagerApplication"
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.manager.task.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".AddTaskActivity" >
        </activity>
        <activity android:name=".AddLocationMapActivity" >
        </activity>

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="AIzaSyAvJzA8IZcdElvmeqyN9MgZDbgYLA_t-7A" />
    </application>

    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />

</manifest>


text:
This is the changelog for the 2.x series.

## 2.1.1

- Fix a bug where Traversable queues (non-array iterables) will fail because the `reset()`, `current()`, and `next()` array functions are incompatible
- Improve the overall code quality of the project (through internal changes that do not alter the public API)

## 2.1.0

- Raise a more obvious error message when Relay is given an empty queue (#43)
- Fix a bug that broke callable middleware (#45)
- Properly declare PSR dependencies and make it clear that Relay provides an implementation of PSR-15's `Psr\Http\Server\RequestHandlerInterface` (#46)
- Add support for queue items that implement `Psr\Http\Server\RequestHandlerInterface` (#48)
- Replace abandoned `zendframework/zend-diactoros` with same version `laminas/laminas-diactoros`

## 2.0.0

The 2.x series introduces a major change to the way Relay handles middleware. While the 1.x series featured a "double
pass" signature (`function (request, response, next)`), the 2.x series is fully-compatible with
[PSR-15](https://www.php-fig.org/psr/psr-15/)'s "single pass" or "lambda" recommendation
(`function (request, handler) : response`).

Note that middleware designed for Relay 1.x are not compatible with PSR-15 server request handlers ("dispatchers")
like Relay 2.x.


text:
<?php
namespace Album;

class Controller_Image_comment extends \Controller_Site
{
	protected $check_not_auth_action = array(
		'list',
	);

	public function before()
	{
		parent::before();
	}

	public function action_create($album_image_id = null)
	{
		if (!$album_image_id || !$album_image = Model_AlbumImage::find($album_image_id))
		{
			throw new \HttpNotFoundException;
		}

		// Lazy validation
		if (\Input::post('body'))
		{
			\Util_security::check_csrf();

			// Create a new comment
			$comment = new Model_AlbumImageComment(array(
				'body' => \Input::post('body'),
				'album_image_id' => $album_image_id,
				'member_id' => $this->u->id,
			));

			// Save the post and the comment will save too
			if ($comment->save())
			{
				\Session::set_flash('message', 'コメントしました。');
			}
			else
			{
				\Session::set_flash('error', 'コメントに失敗しました。');
			}

			\Response::redirect('album/image/'.$album_image_id);
		}
		else
		{
			Controller_Image::action_detail($album_image_id);
		}
	}

	/**
	 * Album image comment delete
	 *
	 * @access  public
	 * @params  integer
	 * @return  Response
	 */
	public function action_delete($id = null)
	{
		$id = (int)$id;
		if (!$id || !$album_image_comment = Model_AlbumImageComment::check_authority($id, $this->u->id))
		{
			throw new \HttpNotFoundException;
		}
		\Util_security::check_csrf(\Input::get(\Config::get('security.csrf_token_key')));

		$album_image_id = $album_image_comment->album_image_id;
		$album_image_comment->delete();

		\Session::set_flash('message', 'コメントを削除しました。');
		\Response::redirect('album/image/'.$album_image_id);
	}
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>CivilOctave: amarjeet@lab.gdy.club/manage_8py_source.tex Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

CivilOctave

Main Page

Related Pages

Packages

Files

File List

File Members

amarjeet@lab.gdy.club

manage_8py_source.tex

Go to the documentation of this file.

    1 \hypertarget{manage_8py_source}{}\section{manage.\+py}

    2 \label{manage_8py_source}\index{/home/amarjeet/projects/\+Civil\+Octave/sage/manage.\+py@{/home/amarjeet/projects/\+Civil\+Octave/sage/manage.\+py}}

    3

    4 \begin{DoxyCode}

    5 \hypertarget{manage_8py_source_l00001}{}\hyperlink{namespacemanage}{00001} \textcolor{comment}{##}

    6 00002 \textcolor{comment}{# @package manage}

    7 00003 \textcolor{comment}{# This code to start server and application }

    8 00004 \textcolor{comment}{# additional argument is find initial to start processing of intruppted }

    9 00005 \textcolor{comment}{# files }

   10 00006 \textcolor{comment}{# @author amarjeet kapoor}

   11 00007 \textcolor{comment}{# }

   12 00008 \textcolor{comment}{#}

   13 00009

   14 00010

   15 00011

   16 00012 \textcolor{comment}{#!/usr/bin/env python}

   17 00013 \textcolor{keyword}{import} os

   18 00014 \textcolor{keyword}{import} sys,threading

   19 00015 \textcolor{keyword}{import} initial\_file

   20 00016

   21 00017

   22 00018 \textcolor{keywordflow}{if} \_\_name\_\_ == \textcolor{stringliteral}{"\_\_main\_\_"}:

   23 00019

   24 00020     os.environ.setdefault(\textcolor{stringliteral}{"DJANGO\_SETTINGS\_MODULE"}, \textcolor{stringliteral}{"sage.settings"})

   25 00021

   26 00022     \textcolor{keyword}{from} django.core.management \textcolor{keyword}{import} execute\_from\_command\_line

   27 00023

   28 00024

   29 00025     \textcolor{comment}{##}

   30 00026     \textcolor{comment}{# code to fire thread to process intrupted process}

   31 00027     \hyperlink{bootstrap_8min_8js_ac2d69f5011896c6ed4a54e0dd36f6334}{if}(sys.argv[1]== \textcolor{stringliteral}{'initial'}):

   32 00028

   33 00029         \textcolor{comment}{#remove our argument so that argv can be send to django}

   34 00030         sys.argv.remove(\textcolor{stringliteral}{'initial'})

   35 00031

   36 00032         \textcolor{comment}{## }

   37 00033         \textcolor{comment}{# starting thread}

   38 00034         \textcolor{comment}{# @args initial\_file.pdfemail()}

   39 \hypertarget{manage_8py_source_l00035}{}\hyperlink{namespacemanage_ab0c13dd165a5c8a6f3e3c029a2acd921}{00035}         thread = threading.Thread(target=initial\_file.pdfemail,args=())

   40 00036         thread.daemon = \textcolor{keyword}{True}

   41 00037         thread.start()

   42 00038

   43 00039     execute\_from\_command\_line(sys.argv)

   44 \end{DoxyCode}

<address class="footer">
Generated on Fri Dec 18 2015 17:15:35 for CivilOctave by

 1.8.11
</address>


text:
package convenientadditions.api.gui.widget;

import convenientadditions.api.gui.IGui;
import net.minecraft.client.gui.GuiScreen;

public interface IWidgetKeyboardListener extends IWidget {
    <T extends GuiScreen & IGui> boolean onKey(T guiScreen, char typedChar, int keyCode);
}


text:
package com.blog.common.utils;

/**
 * Created by liuhaibin on 07/01/2017.
 */
public class StringUtils extends org.apache.commons.lang3.StringUtils {

    /**
     * 一次性判断多个或者单个对象为空
     * @param objects
     * @return
     */
    public static boolean isEmpty(Object...objects){
        Boolean result = false;

        if (objects == null || objects.length == 0)
            return result;

        for (Object object : objects){
            if (null == object || "".equals(object.toString().trim())){
                result = true;
                break;
            }
        }
        return result;
    }

    /**
     * 判断多个String对象是否为空
     * @param objects
     * @return
     */
    public static boolean isEmpty(String...objects){
        Object[] object = objects;
        return isEmpty(object);
    }

    /**
     * 判断一个String对象是否为空
     * @param str
     * @return
     */
    public static boolean isEmpty(String str){
        Object object = str;
        return isEmpty(object);
    }

}


text:
package unit;

import com.samgau.start.common.util.TransferUtil;
import com.samgau.start.model.Employee;
import com.samgau.start.model.dto.EmployeeDTO;
import org.junit.Assert;
import org.junit.Test;

/**
 * Created by Chingiskhan on 03.04.2017.
 */
public class TransferUtilTest {

    @Test
    public void testGetAsEmployeeDTO() {
        Employee employee = new Employee();
        employee.setId(1L);
        employee.setName("2");
        employee.setAddress("3");
        employee.setSkype("4");
        employee.setPhone("5");
        employee.setMail("6");

        EmployeeDTO employeeDTO = TransferUtil.getAsEmployeeDTO(employee);
        Assert.assertEquals(employeeDTO.getName(), "2");
        Assert.assertEquals(employeeDTO.getAddress(), "3");
        Assert.assertEquals(employeeDTO.getSkype(), "4");
        Assert.assertEquals(employeeDTO.getPhone(), "5");
        Assert.assertEquals(employeeDTO.getMail(), "6");
    }

}


text:
ACCEPTED

#### According to
Integrated Taxonomic Information System

#### Published in
Fl. N. Amer. 2:193. 1842

#### Original name
Brachyris californica DC.

### Remarks
null


text:
package io.dmitryivanov.tcpfrontman

import io.netty.channel.ChannelInitializer
import io.netty.channel.socket.SocketChannel
import io.netty.handler.logging.{ LogLevel, LoggingHandler }

class TcpProxyInitializer(remoteHost: String, remotePort: Int) extends ChannelInitializer[SocketChannel] {

  override def initChannel(ch: SocketChannel): Unit = {
    ch.pipeline().addLast(
      new LoggingHandler(LogLevel.INFO),
      new TcpProxyFrontendHandler(remoteHost, remotePort))
  }
}


text:
#ifndef VIENNAFEM_QUADRATURE_QUAD_HPP
#define VIENNAFEM_QUADRATURE_QUAD_HPP

#include "viennafem/forwards.h"

#include "viennafem/quadrature/line.hpp"

#include "viennafem/quadrature/triangle.hpp"
#include "viennafem/quadrature/quadrilateral.hpp"

#include "viennafem/quadrature/tetrahedron.hpp"
#include "viennafem/quadrature/hexahedron.hpp"

/** @file   quad.hpp
    @brief  Main header file for all quadrature rules. Provides convenience functions for deducing the quadrature rule automatically.
*/

namespace viennafem
{
  namespace detail
  {
    // prototype:
    template <typename ReferenceCellType, typename BasisTag>
    inline viennamath::numerical_quadrature make_quadrature_rule_impl(BasisTag)
    {
      std::cerr << "Quadrature rule not available!" << std::endl;
      throw "Quadrature rule not available!";
      return viennamath::numerical_quadrature(NULL);
    }

    //
    // Line:
    //
    template <>
    inline viennamath::numerical_quadrature make_quadrature_rule_impl<viennafem::unit_interval>(lagrange_tag<1>)
    {
      // conservative estimate: second-order accurate:
      return viennamath::numerical_quadrature(new rt_gauss_quad_element <viennafem::unit_interval, 3>());
    }

    template <>
    inline viennamath::numerical_quadrature make_quadrature_rule_impl<viennafem::unit_interval>(lagrange_tag<2>)
    {
      // conservative estimate: forth-order accurate:
      return viennamath::numerical_quadrature(new rt_gauss_quad_element <viennafem::unit_interval, 5>());
    }

    template <>
    inline viennamath::numerical_quadrature make_quadrature_rule_impl<viennafem::unit_interval>(lagrange_tag<3>)
    {
      // use fifth-order rule and hope the best (no sixth-order rule available so far)
      return viennamath::numerical_quadrature(new rt_gauss_quad_element <viennafem::unit_interval, 5>());
    }

    //
    // Quadrilateral:
    //
    template <>
    inline viennamath::numerical_quadrature make_quadrature_rule_impl<viennafem::unit_square>(lagrange_tag<1>)
    {
      // conservative estimate: second-order accurate:
      return viennamath::numerical_quadrature(new rt_gauss_quad_element <viennafem::unit_square, 3>());
    }

    template <>
    inline viennamath::numerical_quadrature make_quadrature_rule_impl<viennafem::unit_square>(lagrange_tag<2>)
    {
      // conservative estimate: forth-order accuracy required:
      return viennamath::numerical_quadrature(new rt_gauss_quad_element <viennafem::unit_square, 5>());
    }

    //
    // Triangle:
    //
    template <>
    inline viennamath::numerical_quadrature make_quadrature_rule_impl<viennafem::unit_triangle>(lagrange_tag<1>)
    {
      // conservative estimate: second-order accurate:
      return viennamath::numerical_quadrature(new rt_strang_quad_element <viennafem::unit_triangle, 2>());
    }

    template <>
    inline viennamath::numerical_quadrature make_quadrature_rule_impl<viennafem::unit_triangle>(lagrange_tag<2>)
    {
      // conservative estimate: forth-order accuracy required:
      return viennamath::numerical_quadrature(new rt_strang_quad_element <viennafem::unit_triangle, 4>());
    }

    //
    // Hexahedron:
    //
    template <>
    inline viennamath::numerical_quadrature make_quadrature_rule_impl<viennafem::unit_cube>(lagrange_tag<1>)
    {
      // conservative estimate: second-order accurate:
      return viennamath::numerical_quadrature(new rt_gauss_quad_element <viennafem::unit_cube, 3>());
    }

    template <>
    inline viennamath::numerical_quadrature make_quadrature_rule_impl<viennafem::unit_cube>(lagrange_tag<2>)
    {
      // conservative estimate: forth-order accuracy required:
      return viennamath::numerical_quadrature(new rt_gauss_quad_element <viennafem::unit_cube, 5>());
    }

    //
    // Tetrahedron:
    //
    template <>
    inline viennamath::numerical_quadrature make_quadrature_rule_impl<viennafem::unit_tetrahedron>(lagrange_tag<1>)
    {
      // conservative estimate: second-order accurate:
      return viennamath::numerical_quadrature(new rt_keast_quad_element <viennafem::unit_tetrahedron, 2>());
    }

    template <>
    inline viennamath::numerical_quadrature make_quadrature_rule_impl<viennafem::unit_tetrahedron>(lagrange_tag<2>)
    {
      // conservative estimate: forth-order accuracy required:
      return viennamath::numerical_quadrature(new rt_keast_quad_element <viennafem::unit_tetrahedron, 4>());
    }

  } //namespace detail

  //
  // Public interface:
  //

  /** @brief Convenience function which returns a suitable quadrature rule for the given PDE(s) and the domain */
  template <typename PDESystemType, typename DomainType>
  viennamath::numerical_quadrature make_quadrature_rule(PDESystemType const & pde_system, DomainType const & /*domain*/)
  {
    typedef typename viennagrid::result_of::cell_tag<DomainType>::type    CellTag;

    // runtime switcher:
    switch (pde_system.option(0).trial_space_id())
    {
      case space_to_id< lagrange_tag<1> >::value:
          return detail::make_quadrature_rule_impl<typename reference_cell_for_basis<CellTag, viennafem::lagrange_tag<1> >::type>(lagrange_tag<1>());
      case space_to_id< lagrange_tag<2> >::value:
          return detail::make_quadrature_rule_impl<typename reference_cell_for_basis<CellTag, viennafem::lagrange_tag<2> >::type>(lagrange_tag<2>());
      case space_to_id< lagrange_tag<3> >::value:
          return detail::make_quadrature_rule_impl<typename reference_cell_for_basis<CellTag, viennafem::lagrange_tag<3> >::type>(lagrange_tag<3>());
    }

    std::cerr << "make_quadrature_rule(): Cannot derive quadrature rule!" << std::endl;
    throw "Cannot derive quadrature rule!";

    return viennamath::numerical_quadrature(NULL);
  }

}

#endif


text:
{% load bootstrap3 %}
{% bootstrap_css %}
{% bootstrap_javascript %}
{% bootstrap_messages %}

Solicitações

            Id
            Solicitante
            Teleconsultor
            Data

        {% for solicitacao in object_list %}

            {{ solicitacao.id }}
            {{ solicitacao.solicitante }}
            {{ solicitacao.teleconsultor }}
            {{ solicitacao.data }}

                     Editar

                     Apagar

        {% endfor %}

     Nova Solicitação


text:
var minnow = require('./../../client/client')

var _ = require('underscorem')

exports.complexRemoval = function(config, done){
	minnow.makeServer(config, function(){
		minnow.makeClient(config.port, function(client){
			client.view('general', ['Pete'], function(err, c){

				var first = false
				done.poll(function(){
					//console.log(JSON.stringify(c.toJson()))

					if(c.matches.size() === 2){
						first = true
					}else if(first && c.matches.size() === 1){
						done()
						return true
					}
				})

				minnow.makeClient(config.port, function(otherClient){
					otherClient.view('empty', function(err, v){
						var a = v.make('entity', {name: 'Pete'})
						var b = v.make('entity', {name: 'Pete'})

						setTimeout(function(){
							b.removed.set(true)
						},200)
					})
				})

			})
		})
	})
}

exports.globalForEq = function(config, done){
	minnow.makeServer(config, function(){
		minnow.makeClient(config.port, function(client){
			client.view('empty', function(err, vv){
				var strConfig = vv.make('config', {str: 'Pete'}, function(){
					client.view('specific', [strConfig], function(err, c){
						if(err) throw err

						var first = false
						done.poll(function(){
							console.log(JSON.stringify(c.toJson()))

							if(c.matches.size() === 2){
								first = true
							}else if(first && c.matches.size() === 1){
								done()
								return true
							}
						})

						minnow.makeClient(config.port, function(otherClient){
							otherClient.view('empty', function(err, v){
								var a = v.make('entity', {name: 'Pete'})
								var b = v.make('entity', {name: 'Pete'})

								setTimeout(function(){
									b.removed.set(true)
								},200)
							})
						})
					})
				})
			})
		})
	})
}

exports.globalForEqWithChange = function(config, done){
	minnow.makeServer(config, function(){
		minnow.makeClient(config.port, function(client){
			client.view('empty', function(err, vv){
				var strConfig = vv.make('config', {str: 'Pete'}, function(){
					client.view('specific', [strConfig], function(err, c){
						if(err) throw err

						var first = false
						done.poll(function(){
							//console.log(JSON.stringify(c.toJson()))

							if(c.matches.size() === 2){
								first = true
							}else if(first && c.matches.size() === 1){
								done()
								return true
							}
						})

						minnow.makeClient(config.port, function(otherClient){
							otherClient.view('empty', function(err, v){
								var a = v.make('entity', {name: 'Pete'})
								var b = v.make('entity', {name: 'Pete'})

								setTimeout(function(){
									strConfig.str.set('Bill')
									b.removed.set(true)
									strConfig.str.set('Pete')
								},200)
							})
						})
					})
				})
			})
		})
	})
}


text:
--TEST--
ZE2 $this cannot be exchanged
--SKIPIF--
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
--FILE--
<?php

/* please don't shorten this test. It shows what would happen if
 * the fatal error would have been a warning.
 */
class Foo
{
    function replace($other)
    {
    	echo __METHOD__ . "\n";
        $this = $other;
        print $this->prop;
        print $other->prop;
    }

    function indirect($other)
    {
    	echo __METHOD__ . "\n";
        $this = $other;
        $result = $this = $other;
        print $result->prop;
        print $this->prop;
    }

    function retrieve(&$other)
    {
    	echo __METHOD__ . "\n";
    	$other = $this;
    }
}

$object = new Foo;
$object->prop = "Hello\n";

$other  = new Foo;
$other->prop = "World\n";

$object->replace($other);
$object->indirect($other);

print $object->prop; // still shows 'Hello'

$object->retrieve($other);
print $other->prop;  // shows 'Hello'

?>
===DONE===
--EXPECTF--

Fatal error: Cannot re-assign $this in %s on line %d, position %d


text:
<?php namespace Packettide\Sire;

use Mustache_Engine as Mustache;

/**
* Setup and render Mustache templates
*/

class Templater
{

	function __construct(Mustache $mustache)
	{
		$this->mustache = $mustache;
	}

	/**
	 * Set name to use with Templater
	 * @param  Packettide\Sire\Name   $name
	 */
	public function with(Name $name)
	{
		$this->name = $name;
	}

	/**
	 * Add Name data to a given array
	 * @param  array $array
	 * @return array
	 */
	private function augmentArray($array)
	{
		$baseData = array(
			"name" => $this->name,
			"Name" => $this->name->upper(),
			"names" => $this->name->plural(),
			"Names" => $this->name->pluralUpper(),
			"nameLiterate" => $this->name->literate(),
			"NameLiterate" => $this->name->literateUpper(),
			"namesLiterate" => $this->name->pluralLiterate(),
			"NamesLiterate" => $this->name->pluralLiterateUpper(),
		);

		return array_merge($array, $baseData);
	}

	/**
	 * Process a template
	 * @param  string $template Mustache template
	 * @param  array $data
	 * @param  string $target
	 */
	public function template($template, $data, $target)
	{
		$path = dirname($target);

		// Make sure target directory exists
		if (!is_dir($path)) mkdir($path);

		$augmentedData = $this->augmentArray($data);
		$rendered = $this->mustache->render($template, $augmentedData);

		// Save data to $target location
		file_put_contents($target, $rendered);
	}
}


text: PRAGMA foreign_keys = 1;