text:
.class abstract Lcom/android/server/pm/PackageManagerService$HandlerParams;
.super Ljava/lang/Object;
.source "PackageManagerService.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/server/pm/PackageManagerService;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x402
    name = "HandlerParams"
.end annotation

# static fields
.field private static final MAX_RETRIES:I = 0x4

# instance fields
.field private mRetries:I

.field private final mUser:Landroid/os/UserHandle;

.field final synthetic this$0:Lcom/android/server/pm/PackageManagerService;

# direct methods
.method constructor <init>(Lcom/android/server/pm/PackageManagerService;Landroid/os/UserHandle;)V
    .locals 1
    .param p2, "user"    # Landroid/os/UserHandle;

    .prologue
    .line 9546
    iput-object p1, p0, Lcom/android/server/pm/PackageManagerService$HandlerParams;->this$0:Lcom/android/server/pm/PackageManagerService;

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

    .line 9541
    const/4 v0, 0x0

    iput v0, p0, Lcom/android/server/pm/PackageManagerService$HandlerParams;->mRetries:I

    .line 9547
    iput-object p2, p0, Lcom/android/server/pm/PackageManagerService$HandlerParams;->mUser:Landroid/os/UserHandle;

    .line 9548
    return-void
.end method

# virtual methods
.method getUser()Landroid/os/UserHandle;
    .locals 1

    .prologue
    .line 9551
    iget-object v0, p0, Lcom/android/server/pm/PackageManagerService$HandlerParams;->mUser:Landroid/os/UserHandle;

    return-object v0
.end method

.method abstract handleReturnCode()V
.end method

.method abstract handleServiceError()V
.end method

.method abstract handleStartCopy()V
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation
.end method

.method final serviceError()V
    .locals 0

    .prologue
    .line 9579
    invoke-virtual {p0}, Lcom/android/server/pm/PackageManagerService$HandlerParams;->handleServiceError()V

    .line 9580
    invoke-virtual {p0}, Lcom/android/server/pm/PackageManagerService$HandlerParams;->handleReturnCode()V

    .line 9581
    return-void
.end method

.method final startCopy()Z
    .locals 4

    .prologue
    .line 9559
    :try_start_0
    iget v2, p0, Lcom/android/server/pm/PackageManagerService$HandlerParams;->mRetries:I

    add-int/lit8 v2, v2, 0x1

    iput v2, p0, Lcom/android/server/pm/PackageManagerService$HandlerParams;->mRetries:I

    const/4 v3, 0x4

    if-le v2, v3, :cond_0

    .line 9560
    const-string v2, "PackageManager"

    const-string v3, "Failed to invoke remote methods on default container service. Giving up"

    invoke-static {v2, v3}, Landroid/util/Slog;->w(Ljava/lang/String;Ljava/lang/String;)I

    .line 9561
    iget-object v2, p0, Lcom/android/server/pm/PackageManagerService$HandlerParams;->this$0:Lcom/android/server/pm/PackageManagerService;

    iget-object v2, v2, Lcom/android/server/pm/PackageManagerService;->mHandler:Lcom/android/server/pm/PackageManagerService$PackageHandler;

    const/16 v3, 0xb

    invoke-virtual {v2, v3}, Lcom/android/server/pm/PackageManagerService$PackageHandler;->sendEmptyMessage(I)Z

    .line 9562
    invoke-virtual {p0}, Lcom/android/server/pm/PackageManagerService$HandlerParams;->handleServiceError()V

    .line 9563
    const/4 v1, 0x0

    .line 9574
    :goto_0
    return v1

    .line 9565
    :cond_0
    invoke-virtual {p0}, Lcom/android/server/pm/PackageManagerService$HandlerParams;->handleStartCopy()V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 9566
    const/4 v1, 0x1

    .line 9573
    .local v1, "res":Z
    :goto_1
    invoke-virtual {p0}, Lcom/android/server/pm/PackageManagerService$HandlerParams;->handleReturnCode()V

    goto :goto_0

    .line 9568
    .end local v1    # "res":Z
    :catch_0
    move-exception v0

    .line 9570
    .local v0, "e":Landroid/os/RemoteException;
    iget-object v2, p0, Lcom/android/server/pm/PackageManagerService$HandlerParams;->this$0:Lcom/android/server/pm/PackageManagerService;

    iget-object v2, v2, Lcom/android/server/pm/PackageManagerService;->mHandler:Lcom/android/server/pm/PackageManagerService$PackageHandler;

    const/16 v3, 0xa

    invoke-virtual {v2, v3}, Lcom/android/server/pm/PackageManagerService$PackageHandler;->sendEmptyMessage(I)Z

    .line 9571
    const/4 v1, 0x0

    .restart local v1    # "res":Z
    goto :goto_1
.end method


text:
.. _ref_cli_edgedb_server_uninstall:

=======================
edgedb server uninstall
=======================

Uninstall EdgeDB server.

.. cli:synopsis::

     edgedb server uninstall [<options>]

Description
===========

``edgedb server uninstall`` is a terminal command for removing a
specific EdgeDB server version from your system.

Options
=======

:cli:synopsis:`--all`
    Uninstalls all server versions.

:cli:synopsis:`--nightly`
    Uninstalls the nightly server version.

:cli:synopsis:`--unused`
    Uninstalls server versions that are not used to run any instances.

:cli:synopsis:`--version=<version>`
    Specifies the version of the server to be uninstalled.

:cli:synopsis:`-v, --verbose`
    Produce a more verbose output.

redpajama_set_name: RedPajamaGithub


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Septogloeum nuttallii Harkn.

### Remarks
null


text:
package org.apache.spark.ml.ann

import breeze.linalg.{DenseMatrix => BDM, DenseVector => BDV, fliplr, flipud, sum}
import org.apache.spark.mllib.linalg.{Vectors, DenseVector, Vector}

/**
 * Layer properties of Convolutional Layer
 * @param numInMap number of inputs
 * @param numOutMap number of outputs
 * @param kernelSize kernelSize of format x * y
 * @param inputMapSize size of each input feature map.
 */
private[ann] class ConvolutionalLayer(
    val numInMap: Int,
    val numOutMap: Int,
    val kernelSize: MapSize,
    val inputMapSize: MapSize) extends Layer {

  override def getInstance(weights: Vector, position: Int): LayerModel = {
    ConvolutionalLayerModel(this, weights, position)
  }

  override def getInstance(seed: Long = 11L): LayerModel = {
    ConvolutionalLayerModel(this, seed)
  }
}

/**
 * ConvolutionLayerModel contains multiple kernels and applies a 2D convolution over the input maps.
 * @param inMapNum number of input feature maps
 * @param outMapNum number of output feature maps
 * @param kernels weights in the form of inNum * outNum * kernelSize
 * @param bias bias for each outMap, with length equal to outMapNum
 * @param inputMapSize size of each input feature map
 */
private[ann] class ConvolutionalLayerModel private(
    inMapNum: Int,
    outMapNum: Int,
    kernels: Array[Array[BDM[Double]]],
    bias: Array[Double],
    inputMapSize: MapSize) extends LayerModel {

  require(kernels.length == inMapNum)
  require(kernels.length > 0 && kernels(0).length == outMapNum)
  require(bias.length == outMapNum)

  private val kernelSize = new MapSize(kernels(0)(0).rows, kernels(0)(0).cols)
  private val outputSize = inputMapSize.subtract(kernelSize, 1)

  override val size = kernelSize.x * kernelSize.y * inMapNum * outMapNum + bias.length

  /**
    * @param data each column contains all the data for one sample, with size of
    *             inMapNum * inputMapSize.
    */
  override def eval(data: BDM[Double]): BDM[Double] = {
    require(data.rows == this.inMapNum * inputMapSize.x * inputMapSize.y)
    // local copy
    val inMapNum = this.inMapNum
    val outMapNum = this.outMapNum
    val kernels = this.kernels
    val bias = this.bias

    val batchOutput = new BDM[Double](outputSize.x * outputSize.y * outMapNum, data.cols)
    (0 until data.cols).foreach{ col =>
      val inputMaps = FeatureMapRolling.extractMaps(data(::, col), inputMapSize)
      val output = new Array[BDM[Double]](this.outMapNum)
      var j = 0
      while (j < outMapNum) {
        var sum: BDM[Double] = ConvolutionalLayerModel.convValid(inputMaps(0), kernels(0)(j))
        var i = 1
        while (i < inMapNum) {
          sum += ConvolutionalLayerModel.convValid(inputMaps(i), kernels(i)(j))
          i += 1
        }
        output(j) = sum + bias(j)
        j += 1
      }
      // reorganize feature maps to a single column in a dense matrix.
      batchOutput(::, col) := FeatureMapRolling.mergeMaps(output)
    }
    batchOutput
  }

  override def prevDelta(nextDelta: BDM[Double], output: BDM[Double]): BDM[Double] = {

    // local copy
    val inMapNum = this.inMapNum
    val outMapNum = this.outMapNum
    val kernels = this.kernels

    val batchDelta = new BDM[Double](inputMapSize.x * inputMapSize.y * inMapNum, output.cols)
    (0 until output.cols).foreach{ col =>
      val nextDeltaMaps = FeatureMapRolling.extractMaps(nextDelta(::, col), outputSize)
      val deltas = new Array[BDM[Double]](inMapNum)
      var i = 0
      while (i < inMapNum) {
        // rotate kernel by 180 degrees and get full convolution
        var sum: BDM[Double] = ConvolutionalLayerModel.convFull(nextDeltaMaps(0),
          flipud(fliplr(kernels(i)(0))))
        var j = 1
        while (j < outMapNum) {
          sum += ConvolutionalLayerModel.convFull(nextDeltaMaps(j), flipud(fliplr(kernels(i)(j))))
          j += 1
        }
        deltas(i) = sum
        i += 1
      }
      // reorganize delta maps to a single column in a dense matrix.
      batchDelta(::, col) := FeatureMapRolling.mergeMaps(deltas)
    }

    batchDelta
  }

  override def grad(delta: BDM[Double], input: BDM[Double]): Array[Double] = {

    var batchGradient = new BDV[Double](this.size)
    (0 until input.cols).foreach{ col =>
      val inputMaps = FeatureMapRolling.extractMaps(input(::, col), inputMapSize)
      val deltaMaps = FeatureMapRolling.extractMaps(delta(::, col), outputSize)

      val kernelGradient = getKernelsGradient(inputMaps, deltaMaps)
      val biasGradient = getBiasGradient(deltaMaps)
      val single = ConvolutionalLayerModel.roll(kernelGradient, biasGradient)
      batchGradient = batchGradient + single
    }

    (batchGradient / input.cols.toDouble).toArray
  }

  /**
   * get kernels gradient
   */
  private def getKernelsGradient(input: Array[BDM[Double]],
      delta: Array[BDM[Double]]): Array[Array[BDM[Double]]] = {
    val outMapNum = this.outMapNum
    val inMapNum = this.inMapNum
    val kernelGradient = Array.ofDim[BDM[Double]](inMapNum, outMapNum)
    var j = 0
    while (j < outMapNum) {
      var i = 0
      while (i < inMapNum) {
        kernelGradient(i)(j) = ConvolutionalLayerModel.convValid(input(i), delta(j))
        i += 1
      }
      j += 1
    }
    kernelGradient
  }

  /**
   * get bias gradient
   *
   * @param deltas errors of this layer
   */
  private def getBiasGradient(deltas: Array[BDM[Double]]): Array[Double] = {
    val outMapNum = this.outMapNum

    val gradient = new Array[Double](outMapNum)
    var j: Int = 0
    while (j < outMapNum) {
      gradient(j) = sum(deltas(j))
      j += 1
    }
    gradient
  }

  override def weights(): Vector = Vectors.fromBreeze(ConvolutionalLayerModel.roll(kernels, bias))

}

/**
* Fabric for Convolutional layer models
*/
private[ann] object ConvolutionalLayerModel {

  /**
   * Creates a model of Convolutional layer
   * @param layer layer properties
   * @param weights vector with weights
   * @param position position of weights in the vector
   * @return model of Convolutional layer
   */
  def apply(layer: ConvolutionalLayer, weights: Vector, position: Int): ConvolutionalLayerModel = {
    val (w, b) = unroll(weights, position,
      layer.numInMap,
      layer.numOutMap,
      layer.kernelSize,
      layer.inputMapSize)
    new ConvolutionalLayerModel(layer.numInMap, layer.numOutMap, w, b, layer.inputMapSize)
  }

  /**
   * Creates a model of Affine layer
   * @param layer layer properties
   * @param seed seed
   * @return model of Affine layer
   */
  def apply(layer: ConvolutionalLayer, seed: Long): ConvolutionalLayerModel = {
    val bias = new Array[Double](layer.numOutMap) // bias init to 0
    val kernel = Array.ofDim[BDM[Double]](layer.numInMap, layer.numOutMap)
    for (i <- 0 until layer.numInMap)
      for (j <- 0 until layer.numOutMap)
        kernel(i)(j) = (BDM.rand[Double](layer.kernelSize.x, layer.kernelSize.y) - 0.05) / 10.0

    new ConvolutionalLayerModel(layer.numInMap, layer.numOutMap, kernel, bias, layer.inputMapSize)
  }

  /**
   * roll kernels and bias into the array format for [[org.apache.spark.mllib.optimization]]
   */
  private[ann] def roll(kernels: Array[Array[BDM[Double]]], bias: Array[Double]): BDV[Double] = {
    val rows = kernels.length
    val cols = kernels(0).length
    val m = kernels(0)(0).rows * kernels(0)(0).cols
    val result = new Array[Double](m * rows * cols + bias.length)
    var offset = 0
    var i = 0
    while(i < rows){
      var j = 0
      while(j < cols){
        System.arraycopy(kernels(i)(j).toArray, 0, result, offset, m)
        offset += m
        j += 1
      }
      i += 1
    }
    System.arraycopy(bias, 0, result, offset, bias.length)
    new BDV(result)
  }

  /**
   * Unrolls the weights from the vector
   * @param weights vector with weights
   * @param position position of weights for this layer
   * @param numIn number of layer inputs
   * @param numOut number of layer outputs
   * @return matrix A and vector b
   */
  def unroll(weights: Vector,
      position: Int,
      numIn: Int,
      numOut: Int,
      kernelSize: MapSize,
      inputSize: MapSize): (Array[Array[BDM[Double]]], Array[Double]) = {
    val weightsCopy = weights.toArray
    var offset = position
    val kernels = new Array[Array[BDM[Double]]](numIn)
    for(i <- 0 until numIn){
      kernels(i) = new Array[BDM[Double]](numOut)
      for(j <- 0 until numOut){
        val a = new BDM[Double](kernelSize.x, kernelSize.y, weightsCopy, offset)
        kernels(i)(j) = a
        offset += kernelSize.x * kernelSize.y
      }
    }

    val b = new BDV[Double](weightsCopy, offset, 1, numOut).toArray
    (kernels, b)
  }

  /**
   * full conv
   *
   * @param matrix
   * @param kernel
   * @return
   */
  private[ann] def convFull(matrix: BDM[Double], kernel: BDM[Double]): BDM[Double] = {
    val m: Int = matrix.rows
    val n: Int = matrix.cols
    val km: Int = kernel.rows
    val kn: Int = kernel.cols
    val extendMatrix = new BDM[Double](m + 2 * (km - 1), n + 2 * (kn - 1))
    var i = 0
    var j = 0
    while (i < m) {
      while (j < n) {
        extendMatrix(i + km - 1, j + kn - 1) = matrix(i, j)
        j += 1
      }
      i += 1
    }
    convValid(extendMatrix, kernel)
  }

  /**
   * valid conv
   *
   * @param matrix
   * @param kernel
   * @return
   */
  private[ann] def convValid(matrix: BDM[Double], kernel: BDM[Double]): BDM[Double] = {
    val m: Int = matrix.rows
    val n: Int = matrix.cols
    val km: Int = kernel.rows
    val kn: Int = kernel.cols
    val kns: Int = n - kn + 1
    val kms: Int = m - km + 1
    val outMatrix: BDM[Double] = new BDM[Double](kms, kns)
    var i = 0
    while (i < kms) {
      var j = 0
      while (j < kns) {
        var sum = 0.0
        for (ki <- 0 until km) {
          for (kj <- 0 until kn)
            sum += matrix(i + ki, j + kj) * kernel(ki, kj)
        }
        outMatrix(i, j) = sum
        j += 1
      }
      i += 1
    }
    outMatrix
  }
}


text:
class ApplicationRecord < ActiveRecord::Base
  self.abstract_class = true

  def self.human_attribute_name(attribute_key_name, options = {})
    # *_id must have same human name for localized forms with references and admin area lists
    # *_before_type_cast must have same human name for meaningful format validation errors
    super(attribute_key_name.to_s.remove('_id', '_before_type_cast'), options)
  end
end


text:
<?xml version="1.0" encoding="utf-8" ?>
<objects
	xmlns="http://www.springframework.net"
	xmlns:r="http://www.springframework.net/remoting">

	<description>Registers the calculator service as a SAO in 'Singleton' mode.</description>

	<r:saoExporter
		targetName="singletonCalculator"
		serviceName="RemotedSaoSingletonCalculator" />

	<!--
		Old fashion way without remoting config parser...
	<object name="saoSingletonCalculator" type="Spring.Remoting.SaoExporter, Spring.Services">
		<property name="TargetName" value="singletonCalculator" />
		<property name="ServiceName" value="RemotedSaoSingletonCalculator" />
	</object>
	-->

</objects>


text:
@extends('admin._master')

@section('page-toolbar')

@endsection

@section('css')

@endsection

@section('js')

@endsection

@section('js-init')

@endsection

@section('content')

        @if(isset($object) && !$object->parent_id)

                    id }}" class="btn btn-secondary-outline default">
                         Reply

        @else

                    Comment reply for parent_id }}">#{{ $object->parent_id }}

        @endif

            <form class="form-horizontal form-bordered" action="" method="POST" accept-charset="UTF-8">
                {!! csrf_field() !!}

Title

                            <input class="form-control" type="text" name="title" value="{{ $object->title or '' }}" autocomplete="off">

Name

                            <input class="form-control" type="text" name="name" value="{{ $object->name or '' }}" autocomplete="off">

Phone

                            <input class="form-control" type="text" name="phone" value="{{ $object->phone or '' }}" autocomplete="off">

Email

                            <input class="form-control" type="text" name="email" value="{{ $object->email or '' }}" autocomplete="off">

Status

                            <select name="status" class="form-control">
                                <option value="0" {{ $object->status != 1 ? 'selected=selected' : '' }}>Pending</option>
                                <option value="1" {{ $object->status == 1 ? 'selected=selected' : '' }}>Allowed</option>
                            </select>

Content

                            <textarea name="content" rows="5" class="form-control">{!! $object->content or '' !!}</textarea>

                            <button type="submit" class="btn btn-circle green font-white btn-default">
                                 Update
                            </button>

            </form>

@endsection


text:
namespace CUETools.Codecs
{
    public class AudioPCMConfig
    {
        public static readonly AudioPCMConfig RedBook = new AudioPCMConfig(16, 2, 44100);
        public enum SpeakerConfig
        {
            SPEAKER_FRONT_LEFT = 0x1,
            SPEAKER_FRONT_RIGHT = 0x2,
            SPEAKER_FRONT_CENTER = 0x4,
            SPEAKER_LOW_FREQUENCY = 0x8,
            SPEAKER_BACK_LEFT = 0x10,
            SPEAKER_BACK_RIGHT = 0x20,
            SPEAKER_FRONT_LEFT_OF_CENTER = 0x40,
            SPEAKER_FRONT_RIGHT_OF_CENTER = 0x80,
            SPEAKER_BACK_CENTER = 0x100,
            SPEAKER_SIDE_LEFT = 0x200,
            SPEAKER_SIDE_RIGHT = 0x400,
            SPEAKER_TOP_CENTER = 0x800,
            SPEAKER_TOP_FRONT_LEFT = 0x1000,
            SPEAKER_TOP_FRONT_CENTER = 0x2000,
            SPEAKER_TOP_FRONT_RIGHT = 0x4000,
            SPEAKER_TOP_BACK_LEFT = 0x8000,
            SPEAKER_TOP_BACK_CENTER = 0x10000,
            SPEAKER_TOP_BACK_RIGHT = 0x20000,

            DIRECTOUT = 0,
            KSAUDIO_SPEAKER_MONO = (SPEAKER_FRONT_CENTER),
            KSAUDIO_SPEAKER_STEREO = (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT),
            KSAUDIO_SPEAKER_QUAD = (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT),
            KSAUDIO_SPEAKER_SURROUND = (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_BACK_CENTER),
            KSAUDIO_SPEAKER_5POINT1 = (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT),
            KSAUDIO_SPEAKER_5POINT1_SURROUND = (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT),
            KSAUDIO_SPEAKER_7POINT1 = (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_FRONT_LEFT_OF_CENTER | SPEAKER_FRONT_RIGHT_OF_CENTER),
            KSAUDIO_SPEAKER_7POINT1_SURROUND = (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT)
        }

        private int _bitsPerSample;
        private int _channelCount;
        private int _sampleRate;
        private SpeakerConfig _channelMask;

        public int BitsPerSample { get { return _bitsPerSample; } }
        public int ChannelCount { get { return _channelCount; } }
        public int SampleRate { get { return _sampleRate; } }
        public int BlockAlign { get { return _channelCount * ((_bitsPerSample + 7) / 8); } }
        public SpeakerConfig ChannelMask { get { return _channelMask; } }
        public bool IsRedBook { get { return _bitsPerSample == 16 && _channelCount == 2 && _sampleRate == 44100; } }
        public static SpeakerConfig GetDefaultChannelMask(int channelCount)
        {
            switch (channelCount)
            {
                case 1:
                    return SpeakerConfig.KSAUDIO_SPEAKER_MONO;
                case 2:
                    return SpeakerConfig.KSAUDIO_SPEAKER_STEREO;
                case 3:
                    return SpeakerConfig.KSAUDIO_SPEAKER_STEREO | SpeakerConfig.SPEAKER_LOW_FREQUENCY;
                case 4:
                    return SpeakerConfig.KSAUDIO_SPEAKER_QUAD;
                case 5:
                    //return SpeakerConfig.KSAUDIO_SPEAKER_5POINT1 & ~SpeakerConfig.SPEAKER_LOW_FREQUENCY;
                    return SpeakerConfig.KSAUDIO_SPEAKER_5POINT1_SURROUND & ~SpeakerConfig.SPEAKER_LOW_FREQUENCY;
                case 6:
                    //return SpeakerConfig.KSAUDIO_SPEAKER_5POINT1;
                    return SpeakerConfig.KSAUDIO_SPEAKER_5POINT1_SURROUND;
                case 7:
                    return SpeakerConfig.KSAUDIO_SPEAKER_5POINT1_SURROUND | SpeakerConfig.SPEAKER_BACK_CENTER;
                case 8:
                    return SpeakerConfig.KSAUDIO_SPEAKER_7POINT1_SURROUND;
            }
            return (SpeakerConfig)((1 << channelCount) - 1);
        }

        public AudioPCMConfig(int bitsPerSample, int channelCount, int sampleRate, SpeakerConfig channelMask = SpeakerConfig.DIRECTOUT)
        {
            _bitsPerSample = bitsPerSample;
            _channelCount = channelCount;
            _sampleRate = sampleRate;
            _channelMask = channelMask == 0 ? GetDefaultChannelMask(channelCount) : channelMask;
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Ash.Core
{
    public interface INodePool<T>
    {
        T UnPool();
        void Pool(T node);
    }
}


text:
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.chrome.browser.tasks.tab_management;
import org.chromium.chrome.browser.flags.CachedFeatureFlags;
import org.chromium.chrome.browser.flags.ChromeFeatureList;

/**
 * A class to handle whether store hours feature is enabled.
 */
public class StoreTrackingUtilities {
    /**
     * @return Whether the show store hours on tabs feature is enabled.
     */
    public static boolean isStoreHoursOnTabsEnabled() {
        return CachedFeatureFlags.isEnabled(ChromeFeatureList.STORE_HOURS)
                && !PriceTrackingUtilities.isTrackPricesOnTabsEnabled();
    }
}


text:
<?php

namespace Surfnet\StepupBundle;

use Surfnet\StepupBundle\DependencyInjection\Compiler\AttachRequestIdInjectorToGuzzleClientsPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;

class SurfnetStepupBundle extends Bundle
{
    public function build(ContainerBuilder $container)
    {
        parent::build($container);

        $container->addCompilerPass(new AttachRequestIdInjectorToGuzzleClientsPass());
    }
}


text:
package ai.verta.swagger._public.modeldb.model

import scala.util.Try

import net.liftweb.json._

import ai.verta.swagger._public.modeldb.model.DatasetTypeEnumDatasetType._
import ai.verta.swagger._public.modeldb.model.DatasetVisibilityEnumDatasetVisibility._
import ai.verta.swagger._public.modeldb.model.OperatorEnumOperator._
import ai.verta.swagger._public.modeldb.model.PathLocationTypeEnumPathLocationType._
import ai.verta.swagger._public.modeldb.model.ProtobufNullValue._
import ai.verta.swagger._public.modeldb.model.ValueTypeEnumValueType._
import ai.verta.swagger.client.objects._

case class ModeldbDeleteDatasetVersions (
  dataset_id: Option[String] = None,
  ids: Option[List[String]] = None
) extends BaseSwagger {
  def toJson(): JValue = ModeldbDeleteDatasetVersions.toJson(this)
}

object ModeldbDeleteDatasetVersions {
  def toJson(obj: ModeldbDeleteDatasetVersions): JObject = {
    new JObject(
      List[Option[JField]](
        obj.dataset_id.map(x => JField("dataset_id", JString(x))),
        obj.ids.map(x => JField("ids", ((x: List[String]) => JArray(x.map(JString)))(x)))
      ).flatMap(x => x match {
        case Some(y) => List(y)
        case None => Nil
      })
    )
  }

  def fromJson(value: JValue): ModeldbDeleteDatasetVersions =
    value match {
      case JObject(fields) => {
        val fieldsMap = fields.map(f => (f.name, f.value)).toMap
        ModeldbDeleteDatasetVersions(
          // TODO: handle required
          dataset_id = fieldsMap.get("dataset_id").map(JsonConverter.fromJsonString),
          ids = fieldsMap.get("ids").map((x: JValue) => x match {case JArray(elements) => elements.map(JsonConverter.fromJsonString); case _ => throw new IllegalArgumentException(s"unknown type ${x.getClass.toString}")})
        )
      }
      case _ => throw new IllegalArgumentException(s"unknown type ${value.getClass.toString}")
    }
}


text:
<?php

namespace FSi\Component\Cache\Tests;

use FSi\Component\Cache\FileCache;

class FileCacheTest extends CacheTest
{
    protected $cacheDir;

    protected function setUp()
    {
        $tempPath = dirname(__FILE__) . '/../../../../temp/' ;
        $this->cacheDir = $tempPath . "fsi_cache_". uniqid();
    }

    protected function _getCacheDriver()
    {
        for ($i = 0; $i <= 32; $i ++) {
            $this->assertFalse(is_dir($this->cacheDir));
            $cache = new FileCache(array('directory' => $this->cacheDir, 'dirlevel' => $i));
            $this->assertTrue(is_dir($this->cacheDir));
            $this->rrmdir($this->cacheDir);
        }

        $this->assertFalse(is_dir($this->cacheDir));
        $cache = new FileCache(array('directory' => $this->cacheDir));
        $this->assertTrue(is_dir($this->cacheDir));
        $cache->clear();
        return $cache;
    }

    public function testClearExpired()
    {
       $cache = $this->_getCacheDriver();
       $cache->setItem('key1', 'test', 20);
       $cache->setItem('key2', 'test', 3);

       sleep(5);
       $cache->clearExpired();

       $this->assertTrue($cache->hasItem('key1'));
       $this->assertFalse($cache->hasItem('key2'));
    }

    public function testRemoveItem()
    {
        $cache = $this->_getCacheDriver();

        $cache->setItem('key', 'test', 0, 'ns');
        $cache->setItem('key', 'test');

        $this->assertTrue($cache->hasItem('key'));
        $this->assertTrue($cache->hasItem('key', 'ns'));
        $this->assertTrue($cache->removeItem('key'));
        $this->assertFalse($cache->removeItem('key'));
        $this->assertTrue($cache->removeItem('key', 'ns'));
        $this->assertFalse($cache->removeItem('key', 'ns'));
        $this->assertFalse($cache->hasItem('key'));
        $this->assertFalse($cache->hasItem('key', 'ns'));
    }

    public function tearDown()
    {
        /* Clear empty cache dirs */
        $this->rrmdir($this->cacheDir);
    }

    private function rrmdir($dir)
    {
        foreach(glob($dir . '/*') as $file) {
            if(is_dir($file)) {
                $this->rrmdir($file);
            } else {
                unlink($file);
            }
        }

        rmdir($dir);
    }
}


text:
package cgeo.geocaching.loaders;

import cgeo.geocaching.SearchResult;
import cgeo.geocaching.connector.gc.GCConstants;
import cgeo.geocaching.connector.gc.RecaptchaHandler;
import cgeo.geocaching.network.Network;
import cgeo.geocaching.network.Parameters;
import cgeo.geocaching.utils.Log;
import cgeo.geocaching.utils.TextUtils;

import org.apache.commons.lang3.StringUtils;

import android.content.Context;
import android.os.Handler;
import android.support.v4.content.AsyncTaskLoader;

import java.util.concurrent.CountDownLatch;

public abstract class AbstractSearchLoader extends AsyncTaskLoader<SearchResult> implements RecaptchaReceiver {

    public enum CacheListLoaderType {
        OFFLINE,
        POCKET,
        HISTORY,
        NEAREST,
        COORDINATE,
        KEYWORD,
        ADDRESS,
        FINDER,
        OWNER,
        MAP,
        REMOVE_FROM_HISTORY,
        NEXT_PAGE;

        public int getLoaderId() {
            return ordinal();
        }
    }

    private Handler recaptchaHandler = null;
    private String recaptchaChallenge = null;
    private String recaptchaKey = null;
    private String recaptchaText = null;
    private SearchResult search;
    private boolean loading;
    private CountDownLatch latch = new CountDownLatch(1);

    public AbstractSearchLoader(Context context) {
        super(context);
    }

    public abstract SearchResult runSearch();

    public boolean isLoading() {
        return loading;
    }

    @Override
    public SearchResult loadInBackground() {
        loading = true;
        try {
            if (search == null) {
                search = runSearch();
            } else {
                // Unless we make a new Search the Loader framework won't deliver results. It does't do equals only identity
                search = new SearchResult(search);
            }
        } catch (Exception e) {
            Log.e("Error in Loader ", e);
        }
        loading = false;
        if (search == null) {
            search = new SearchResult();
        }
        return search;
    }

    @Override
    protected void onStartLoading() {
        forceLoad();
    }

    public void setRecaptchaHandler(final Handler recaptchaHandler) {
        this.recaptchaHandler = recaptchaHandler;
    }

    @Override
    public void notifyNeed() {
        if (recaptchaHandler != null) {
            recaptchaHandler.sendEmptyMessage(RecaptchaHandler.SHOW_CAPTCHA);
        }
    }

    @Override
    public void waitForUser() {
        try {
            latch.await();
        } catch (InterruptedException e) {
            Log.w("searchThread is not waiting for user…");
        }
    }

    @Override
    public void setKey(String key) {
        recaptchaKey = key;
    }

    @Override
    public void fetchChallenge() {
        recaptchaChallenge = null;

        if (StringUtils.isNotEmpty(recaptchaKey)) {
            final Parameters params = new Parameters("k", recaptchaKey);
            final String recaptchaJs = Network.getResponseData(Network.getRequest("http://www.google.com/recaptcha/api/challenge", params));

            if (StringUtils.isNotBlank(recaptchaJs)) {
                recaptchaChallenge = TextUtils.getMatch(recaptchaJs, GCConstants.PATTERN_SEARCH_RECAPTCHACHALLENGE, true, 1, null, true);
            }
        }
    }

    @Override
    public String getChallenge() {
        return recaptchaChallenge;
    }

    @Override
    public void setText(String text) {
        recaptchaText = text;
        latch.countDown();
    }

    @Override
    public String getText() {
        return recaptchaText;
    }

    @Override
    public void reset() {
        super.reset();
        search = null;
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

  <title>CSS 2.1 Test Suite: content: counters(c, ".", armenian)</title>
  <link rel="help" href="http://www.w3.org/TR/CSS21/generate.html#propdef-content"/>
  <link rel="help" href="http://www.w3.org/TR/CSS21/syndata.html#counter"/>
  <link rel="help" href="http://www.w3.org/TR/CSS21/generate.html#counter-styles"/>
  <meta http-equiv="Content-Style-Type" content="text/css"/>


text:
extern "C"
{

QTCEXPORT(void*,qtc_QModelIndex)() {
  QModelIndex*tr = new QModelIndex();
  return (void*) tr;
}

QTCEXPORT(void*,qtc_QModelIndex1)(void* x1) {
  QModelIndex*tr = new QModelIndex((const QModelIndex&)(*(QModelIndex*)x1));
  return (void*) tr;
}

QTCEXPORT(void*,qtc_QModelIndex_child)(void* x0, int x1, int x2) {
  QModelIndex * tc = new QModelIndex(((QModelIndex*)x0)->child((int)x1, (int)x2));
  return (void*)(tc);
}

QTCEXPORT(int,qtc_QModelIndex_column)(void* x0) {
  return (int) ((QModelIndex*)x0)->column();
}

QTCEXPORT(void*,qtc_QModelIndex_data)(void* x0) {
  QVariant * tc = new QVariant(((QModelIndex*)x0)->data());
  return (void*)(tc);
}

QTCEXPORT(void*,qtc_QModelIndex_data1)(void* x0, int x1) {
  QVariant * tc = new QVariant(((QModelIndex*)x0)->data((int)x1));
  return (void*)(tc);
}

QTCEXPORT(long,qtc_QModelIndex_flags)(void* x0) {
  return (long) ((QModelIndex*)x0)->flags();
}

QTCEXPORT(long long int,qtc_QModelIndex_internalId)(void* x0) {
  return (long long int) ((QModelIndex*)x0)->internalId();
}

QTCEXPORT(void*,qtc_QModelIndex_internalPointer)(void* x0) {
  return (void*) ((QModelIndex*)x0)->internalPointer();
}

QTCEXPORT(int,qtc_QModelIndex_isValid)(void* x0) {
  return (int) ((QModelIndex*)x0)->isValid();
}

QTCEXPORT(void*,qtc_QModelIndex_model)(void* x0) {
  QAbstractItemModel * tc = (QAbstractItemModel*)(((QModelIndex*)x0)->model());
  QPointer<QAbstractItemModel> * ttc = new QPointer<QAbstractItemModel>(tc);
  return (void*)(ttc);
}

QTCEXPORT(void*,qtc_QModelIndex_parent)(void* x0) {
  QModelIndex * tc = new QModelIndex(((QModelIndex*)x0)->parent());
  return (void*)(tc);
}

QTCEXPORT(int,qtc_QModelIndex_row)(void* x0) {
  return (int) ((QModelIndex*)x0)->row();
}

QTCEXPORT(void*,qtc_QModelIndex_sibling)(void* x0, int x1, int x2) {
  QModelIndex * tc = new QModelIndex(((QModelIndex*)x0)->sibling((int)x1, (int)x2));
  return (void*)(tc);
}

QTCEXPORT(void,qtc_QModelIndex_finalizer)(void* x0) {
  delete ((QModelIndex*)x0);
}

QTCEXPORT(void*,qtc_QModelIndex_getFinalizer)() {
  return (void*)(&qtc_QModelIndex_finalizer);
}

QTCEXPORT(void,qtc_QModelIndex_delete)(void* x0) {
  delete((QModelIndex*)x0);
}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<tryton>
    <data>

        <!-- webshop root navigation -->
        <record id="webshop__root_cms_menu" model="nereid.cms.menuitem">
            <field name="title">Root Nav</field>
            <field name="sequence" eval="10"/>
            <field name="type_">view</field>
            <field name="target">_self</field>
        </record>

        <!-- Create article category: Customer Service -->
        <record id="ac_customer_service" model="nereid.cms.article.category">
            <field name="title">Customer Service</field>
            <field name="unique_name">customer-service</field>
        </record>
        <record id="a_faq" model="nereid.cms.article">
            <field name="title">FAQ</field>
            <field name="uri">faq</field>
            <field name="sequence" eval="10"/>
            <field name="content">Some frequently asked questions</field>
        </record>
        <record id="a_shipping" model="nereid.cms.article">
            <field name="title">Shipping</field>
            <field name="uri">shipping</field>
            <field name="sequence" eval="20"/>
            <field name="content">Some shipping menthods</field>
        </record>
           <record id="a_bulk_order" model="nereid.cms.article">
            <field name="title">Bulk Order</field>
            <field name="uri">bulk-order</field>
            <field name="sequence" eval="30"/>
            <field name="content">Some content related to bult order</field>
        </record>

        <record id="a_customer_stories" model="nereid.cms.article">
            <field name="title">Customer Stories</field>
            <field name="uri">customers-stories</field>
            <field name="sequence" eval="40"/>
            <field name="content">Checkout our customer stories</field>
        </record>
        <record id="customer_service-a_faq"  model="nereid.cms.category-article">
            <field name="category" ref="ac_customer_service"/>
            <field name="article" ref="a_faq"/>
        </record>
        <record id="customer_service-a_shipping"  model="nereid.cms.category-article">
            <field name="category" ref="ac_customer_service"/>
            <field name="article" ref="a_shipping"/>
        </record>
        <record id="customer_service-a_bulk_order"  model="nereid.cms.category-article">
            <field name="category" ref="ac_customer_service"/>
            <field name="article" ref="a_bulk_order"/>
        </record>

        <!-- Create category: About Us-->
        <record id="ac_about_us" model="nereid.cms.article.category">
            <field name="title">About Us</field>
            <field name="unique_name">about-us</field>
        </record>
        <record id="a_our_identity" model="nereid.cms.article">
            <field name="title">Our Identity</field>
            <field name="uri">our-identity</field>
            <field name="sequence" eval="10"/>
            <field name="content">Some thing about the company</field>
        </record>
        <record id="a_career" model="nereid.cms.article">
            <field name="title">Career</field>
            <field name="uri">career</field>
            <field name="sequence" eval="20"/>
            <field name="content">Join us</field>
        </record>
        <record id="ac_about_us-a_our_identity"  model="nereid.cms.category-article">
            <field name="category" ref="ac_about_us"/>
            <field name="article" ref="a_our_identity"/>
        </record>
        <record id="ac_about_us-a_carrer"  model="nereid.cms.category-article">
            <field name="category" ref="ac_about_us"/>
            <field name="article" ref="a_career"/>
        </record>

        <!-- Create category: Contact Us-->
        <record id="ac_contact_us" model="nereid.cms.article.category">
            <field name="title">Contact Us</field>
            <field name="unique_name">contact-us</field>
        </record>
        <record id="a_office_location" model="nereid.cms.article">
            <field name="title">Office Location</field>
            <field name="uri">office-location</field>
            <field name="sequence" eval="10"/>
            <field name="content">Current office location</field>
        </record>
        <record id="ac_contact_us-a_office_location"  model="nereid.cms.category-article">
            <field name="category" ref="ac_contact_us"/>
            <field name="article" ref="a_office_location"/>
        </record>

        <!-- Create category: Press-->
        <record id="ac_press" model="nereid.cms.article.category">
            <field name="title">Press</field>
            <field name="unique_name">press</field>
        </record>
           <record id="a_press_realeases" model="nereid.cms.article">
            <field name="title">Press Realeases</field>
            <field name="uri">press-realeases</field>
            <field name="sequence" eval="10"/>
            <field name="content">Latest press realease</field>
        </record>
        <record id="a_publication" model="nereid.cms.article">
            <field name="title">Publications</field>
            <field name="uri">publications</field>
            <field name="sequence" eval="20"/>
            <field name="content">Latest publication</field>
        </record>
        <record id="a_media" model="nereid.cms.article">
            <field name="title">Media</field>
            <field name="uri">media</field>
            <field name="sequence" eval="30"/>
            <field name="content">We are in news</field>
        </record>
        <record id="ac_press-a_press_releases"  model="nereid.cms.category-article">
            <field name="category" ref="ac_press"/>
            <field name="article" ref="a_press_realeases"/>
        </record>
        <record id="ac_press-a_publication"  model="nereid.cms.category-article">
            <field name="category" ref="ac_press"/>
            <field name="article" ref="a_publication"/>
        </record>
        <record id="ac_press-a_media"  model="nereid.cms.category-article">
            <field name="category" ref="ac_press"/>
            <field name="article" ref="a_media"/>
        </record>

        <!-- Create category: Help-->
        <record id="ac_help" model="nereid.cms.article.category">
            <field name="title">Help</field>
            <field name="unique_name">help</field>
        </record>
        <record id="a_support" model="nereid.cms.article">
            <field name="title">Support</field>
            <field name="uri">support</field>
            <field name="sequence" eval="10"/>
            <field name="content">Minicube PCR Support</field>
        </record>
         <record id="a_software" model="nereid.cms.article">
            <field name="title">Software</field>
            <field name="uri">software</field>
            <field name="sequence" eval="20"/>
            <field name="content">Minicube PCR Software</field>
        </record>
         <record id="a_documentation" model="nereid.cms.article">
            <field name="title">Documentation</field>
            <field name="uri">documentation</field>
            <field name="sequence" eval="30"/>
            <field name="content">Minicube PCR Documentation</field>
        </record>
        <record id="ac_help-a_support"  model="nereid.cms.category-article">
            <field name="category" ref="ac_help"/>
            <field name="article" ref="a_support"/>
        </record>
        <record id="ac_help-a_software"  model="nereid.cms.category-article">
            <field name="category" ref="ac_help"/>
            <field name="article" ref="a_software"/>
        </record>
        <record id="ac_help-a_documentation"  model="nereid.cms.category-article">
            <field name="category" ref="ac_help"/>
            <field name="article" ref="a_documentation"/>
        </record>

        <!-- Create Banners and Banner Categories -->
        <record id="home_page_banner" model="nereid.cms.banner.category">
            <field name="name">Home Page Banners</field>
        </record>
        <record id="home_banner_1" model="nereid.cms.banner">
            <field name="name">banner1</field>
            <field name="category" ref="home_page_banner"/>
            <field name="type">remote_image</field>
            <field name="remote_image_url">/static-webshop/images/sample-img/banner1.jpg</field>
            <field name="state">published</field>
        </record>
        <record id="home_banner_2" model="nereid.cms.banner">
            <field name="name">banner2</field>
            <field name="category" ref="home_page_banner"/>
            <field name="type">remote_image</field>
            <field name="remote_image_url">/static-webshop/images/sample-img/banner2.jpg</field>
            <field name="state">published</field>
        </record>
        <record id="home_banner_3" model="nereid.cms.banner">
            <field name="name">banner3</field>
            <field name="category" ref="home_page_banner"/>
            <field name="type">remote_image</field>
            <field name="remote_image_url">/static-webshop/images/sample-img/banner3.jpg</field>
            <field name="state">published</field>
        </record>
    </data>
</tryton>


text:
require 'spec_helper'

describe ApplicationSettings::UpdateService do
  let(:application_settings) { create(:application_setting) }
  let(:admin) { create(:user, :admin) }
  let(:params) { {} }

  subject { described_class.new(application_settings, admin, params) }

  before do
    # So the caching behaves like it would in production
    stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')

    # Creating these settings first ensures they're used by other factories
    application_settings
  end

  describe 'updating terms' do
    context 'when the passed terms are blank' do
      let(:params) { { terms: ''  } }

      it 'does not create terms' do
        expect { subject.execute }.not_to change { ApplicationSetting::Term.count }
      end
    end

    context 'when passing terms' do
      let(:params) { { terms: 'Be nice!  '  } }

      it 'creates the terms' do
        expect { subject.execute }.to change { ApplicationSetting::Term.count }.by(1)
      end

      it 'does not create terms if they are the same as the existing ones' do
        create(:term, terms: 'Be nice!')

        expect { subject.execute }.not_to change { ApplicationSetting::Term.count }
      end

      it 'updates terms if they already existed' do
        create(:term, terms: 'Other terms')

        subject.execute

        expect(application_settings.terms).to eq('Be nice!')
      end

      it 'Only queries once when the terms are changed' do
        create(:term, terms: 'Other terms')
        expect(application_settings.terms).to eq('Other terms')

        subject.execute

        expect(application_settings.terms).to eq('Be nice!')
        expect { 2.times { application_settings.terms } }
          .not_to exceed_query_limit(0)
      end
    end
  end

  describe 'performance bar settings' do
    using RSpec::Parameterized::TableSyntax

    where(:params_performance_bar_enabled,
      :params_performance_bar_allowed_group_path,
      :previous_performance_bar_allowed_group_id,
      :expected_performance_bar_allowed_group_id) do
      true | '' | nil | nil
      true | '' | 42_000_000 | nil
      true | nil | nil | nil
      true | nil | 42_000_000 | nil
      true | 'foo' | nil | nil
      true | 'foo' | 42_000_000 | nil
      true | 'group_a' | nil | 42_000_000
      true | 'group_b' | 42_000_000 | 43_000_000
      true | 'group_a' | 42_000_000 | 42_000_000
      false | '' | nil | nil
      false | '' | 42_000_000 | nil
      false | nil | nil | nil
      false | nil | 42_000_000 | nil
      false | 'foo' | nil | nil
      false | 'foo' | 42_000_000 | nil
      false | 'group_a' | nil | nil
      false | 'group_b' | 42_000_000 | nil
      false | 'group_a' | 42_000_000 | nil
    end

    with_them do
      let(:params) do
        {
          performance_bar_enabled: params_performance_bar_enabled,
          performance_bar_allowed_group_path: params_performance_bar_allowed_group_path
        }
      end

      before do
        if previous_performance_bar_allowed_group_id == 42_000_000 || params_performance_bar_allowed_group_path == 'group_a'
          create(:group, id: 42_000_000, path: 'group_a')
        end

        if expected_performance_bar_allowed_group_id == 43_000_000 || params_performance_bar_allowed_group_path == 'group_b'
          create(:group, id: 43_000_000, path: 'group_b')
        end

        application_settings.update!(performance_bar_allowed_group_id: previous_performance_bar_allowed_group_id)
      end

      it 'sets performance_bar_allowed_group_id when present and performance_bar_enabled == true' do
        expect(application_settings.performance_bar_allowed_group_id).to eq(previous_performance_bar_allowed_group_id)

        if previous_performance_bar_allowed_group_id != expected_performance_bar_allowed_group_id
          expect { subject.execute }
            .to change(application_settings, :performance_bar_allowed_group_id)
            .from(previous_performance_bar_allowed_group_id).to(expected_performance_bar_allowed_group_id)
        else
          expect { subject.execute }
            .not_to change(application_settings, :performance_bar_allowed_group_id)
        end
      end
    end

    context 'when :performance_bar_allowed_group_path is not present' do
      let(:group) { create(:group) }

      before do
        application_settings.update!(performance_bar_allowed_group_id: group.id)
      end

      it 'does not change the performance bar settings' do
        expect { subject.execute }
          .not_to change(application_settings, :performance_bar_allowed_group_id)
      end
    end

    context 'when :performance_bar_enabled is not present' do
      let(:group) { create(:group) }
      let(:params) { { performance_bar_allowed_group_path: group.full_path } }

      it 'implicitely defaults to true' do
        expect { subject.execute }
          .to change(application_settings, :performance_bar_allowed_group_id)
          .from(nil).to(group.id)
      end
    end
  end
end


text:
/*	$OpenBSD: s_ccosf.c,v 1.2 2010/07/18 18:42:26 guenther Exp $	*/
/*
 * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

/*							ccosf()
 *
 *	Complex circular cosine
 *
 *
 *
 * SYNOPSIS:
 *
 * void ccosf();
 * cmplxf z, w;
 *
 * ccosf( &z, &w );
 *
 *
 *
 * DESCRIPTION:
 *
 * If
 *     z = x + iy,
 *
 * then
 *
 *     w = cos x  cosh y  -  i sin x sinh y.
 *
 *
 *
 * ACCURACY:
 *
 *                      Relative error:
 * arithmetic   domain     # trials      peak         rms
 *    IEEE      -10,+10     30000       1.8e-7       5.5e-8
 */

#include <openlibm_complex.h>
#include <openlibm_math.h>

/* calculate cosh and sinh */

static void
_cchshf(float xx, float *c, float *s)
{
	float x, e, ei;

	x = xx;
	if(fabsf(x) <= 0.5f) {
		*c = coshf(x);
		*s = sinhf(x);
	}
	else {
		e = expf(x);
		ei = 0.5f/e;
		e = 0.5f * e;
		*s = e - ei;
		*c = e + ei;
	}
}

float complex
ccosf(float complex z)
{
	float complex w;
	float ch, sh;

	_cchshf( cimagf(z), &ch, &sh );
	w = cosf( crealf(z) ) * ch + ( -sinf( crealf(z) ) * sh) * I;
	return (w);
}


text:
import proto  # type: ignore

__protobuf__ = proto.module(
    package="google.ads.googleads.v10.enums",
    marshal="google.ads.googleads.v10",
    manifest={
        "SkAdNetworkAttributionCreditEnum",
    },
)

class SkAdNetworkAttributionCreditEnum(proto.Message):
    r"""Container for enumeration of SkAdNetwork attribution credits."""

    class SkAdNetworkAttributionCredit(proto.Enum):
        r"""Enumerates SkAdNetwork attribution credits."""
        UNSPECIFIED = 0
        UNKNOWN = 1
        UNAVAILABLE = 2
        WON = 3
        CONTRIBUTED = 4

__all__ = tuple(sorted(__protobuf__.manifest))


text:
package com.trezoragent.sshagent;

import com.trezoragent.struct.PuttyStruct64;
import com.trezoragent.struct.PuttyStruct32;
import com.trezoragent.struct.PublicKeyDTO;
import com.trezoragent.struct.PuttyStruct;
import com.sun.jna.Platform;
import com.sun.jna.Pointer;
import com.sun.jna.WString;
import com.sun.jna.platform.win32.User32;
import com.sun.jna.platform.win32.WinBase;
import com.sun.jna.platform.win32.WinDef.*;
import com.sun.jna.platform.win32.WinNT;
import com.sun.jna.platform.win32.WinNT.HANDLE;
import com.sun.jna.platform.win32.WinUser;
import com.sun.jna.platform.win32.WinUser.*;
import com.sun.jna.platform.win32.WinUser.WindowProc;
import com.trezoragent.exception.ActionCancelledException;
import com.trezoragent.exception.DeviceTimeoutException;
import com.trezoragent.exception.GetIdentitiesFailedException;
import com.trezoragent.exception.SignFailedException;
import com.trezoragent.gui.TrayProcess;
import com.trezoragent.utils.AgentConstants;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.util.logging.Level;
import static com.trezoragent.utils.AgentConstants.*;
import com.trezoragent.utils.AgentUtils;
import com.trezoragent.utils.LocalizedLogger;
import java.util.List;
import java.util.logging.Logger;
import com.trezoragent.utils.IdentityUtils;
import org.spongycastle.util.encoders.Base64;

/**
 *
 * @author Martin Lizner
 *
 */
public class SSHAgent implements WindowProc {

    private User32 libU = null;
    private Kernel32 libK = null;
    private HWND hWnd = null;
    private WinNT.HANDLE sharedFile;
    private Pointer sharedMemory;

    private boolean createdCorrectly = false;
    private boolean mainLoopStarted = false;

    private HANDLE mutex = null; // mutex ref, for installer

    public SSHAgent() throws Exception {
        initCoreClasses();
        if (checkIfNoPageantProcessIsRunning()) {
            createProcess();
        } else {
            TrayProcess.createErrorWindow(LocalizedLogger.getLocalizedMessage("PAGEANT_IS_RUNNING"));
        }
    }

    /*
     * Creates and registers Windows process
     */
    private HWND createWindowsProcess() {

        WString windowClass = new WString(APPNAME);
        HMODULE hInst = libK.GetModuleHandle("");
        WNDCLASSEX wndclass = new WNDCLASSEX();
        wndclass.hInstance = hInst;
        wndclass.lpfnWndProc = SSHAgent.this;
        wndclass.lpszClassName = windowClass;
        // register window class
        libU.RegisterClassEx(wndclass);
        getLastError();
        // create new window
        HWND winprocess = libU
                .CreateWindowEx(
                        User32.WS_OVERLAPPED,
                        windowClass,
                        APPNAME,
                        0, 0, 0, 0, 0,
                        null, // WM_DEVICECHANGE contradicts parent=WinUser.HWND_MESSAGE
                        null, hInst, null);

        mutex = libK.CreateMutex(null, false, MUTEX_NAME);
        return winprocess;
    }

    /*
     * Start listening to Windows messages
     */
    public void startMainLoop() {
        mainLoopStarted = true;
        MSG msg = new MSG();
        while (libU.GetMessage(msg, null, 0, 0) == 1) {
            libU.TranslateMessage(msg);
            libU.DispatchMessage(msg);
        }
    }

    /*
     * This method is called by Windows to deliver message
     */
    @Override
    public LRESULT callback(HWND hwnd, int uMsg, WPARAM wParam, LPARAM lParam) {
        Logger.getLogger(SSHAgent.class.getName()).log(Level.FINE, "Windows requests operation: {0}", uMsg);

        switch (uMsg) {
            case MY_WM_COPYDATA: {
                return processMessage(hwnd, wParam, lParam);
            }
            case WinUser.WM_CREATE: {
                return new LRESULT(0);
            }
            case WinUser.WM_DESTROY: {
                libU.PostQuitMessage(0);
                return new LRESULT(0);
            }
            default:
                return libU.DefWindowProc(hwnd, uMsg, wParam, lParam);
        }
    }

    private int getLastError() {
        int rc = libK.GetLastError();
        if (rc != 0) {
            Logger.getLogger(SSHAgent.class.getName()).log(Level.SEVERE, "error {0}", rc);
        }
        return rc;
    }

    private LRESULT processMessage(HWND hwnd, WPARAM wParam, LPARAM lParam) {
        WinBase.SECURITY_ATTRIBUTES psa = null;
        String mapname = readFileNameFromInput(lParam);
        sharedFile
                = libK.CreateFileMapping(WinBase.INVALID_HANDLE_VALUE,
                        psa,
                        WinNT.PAGE_READWRITE,
                        0,
                        8192, // AGENT_MAX_MSGLEN
                        mapname);

        sharedMemory
                = Kernel32.INSTANCE.MapViewOfFile(sharedFile,
                        WinNT.SECTION_MAP_WRITE,
                        0, 0, 0);

        int ret = answerIfDevicePresent(sharedMemory);
        disconnectFromSharedMemory();

        return new LRESULT(ret);
    }

    /*
     *  Method answers to recieved message and writes response to shared memory
     *  1 = success, 0 = fail - Putty protocol defined
     */
    private int answerMessage(Pointer sharedMemory) {
        byte[] buff = new byte[5];
        sharedMemory.read(0, buff, 0, 5);
        AgentUtils.stopGUITimer(); // Cancel pubkey window request when SSH operations are in progress

        byte type = buff[4];
        switch (type) {
            case SSH2_AGENTC_REQUEST_IDENTITIES:
                processKeysRequest(sharedMemory);
                return 1;
            case SSH2_AGENTC_SIGN_REQUEST:
                processSignRequest(sharedMemory);
                return 1;
            default:
                writeAndLogFailure(sharedMemory, "Request for unsupported operation: " + type);
                return 0;

        }
    }

    private void processKeysRequest(final Pointer sharedMemory) {
        java.util.List<PublicKeyDTO> certs;
        try {
            certs = DeviceWrapper.getIdentitiesResponse(true);
            // TODO: If subsequent ssh sign request wont come, it means server doesnt know provided key, should we report? log? all? none?

            ByteBuffer ret = writeCertificatesToFrame(certs, SSH2_AGENT_IDENTITIES_ANSWER);
            sharedMemory.write(0, ret.array(), 0, ret.array().length);

        } catch (DeviceTimeoutException ex) {
            TrayProcess.handleException(ex);
        } catch (GetIdentitiesFailedException ex) {
            Logger.getLogger(SSHAgent.class.getName()).log(Level.SEVERE, "Operation {0} failed", "SSH2_AGENT_GET_IDENTITIES");
        }
    }

    private byte[] getDataFromRequest(Pointer sharedMemory, int offset) {
        byte[] length = new byte[4];
        sharedMemory.read(offset, length, 0, 4);
        ByteBuffer bb = ByteBuffer.wrap(length);
        int dataLength = bb.getInt();
        byte[] data = new byte[dataLength];
        sharedMemory.read(offset + 4, data, 0, dataLength);
        return data;

    }

    private String readFileNameFromInput(LPARAM lParam) {
        Class structPlatformClass = (Platform.is64Bit()) ? PuttyStruct64.class : PuttyStruct32.class;
        PuttyStruct ps = (PuttyStruct) PuttyStruct.newInstance(structPlatformClass, new Pointer(lParam.longValue()));
        ps.read();
        return new String(ps.lpData.getString(0).getBytes(Charset.forName("US-ASCII")));
    }

    public void disconnectFromSharedMemory() {
        if (sharedMemory != null) {
            libK.UnmapViewOfFile(sharedMemory);
        }
        if (sharedFile != null) {
            libK.CloseHandle(sharedFile);
        }
    }

    private int answerIfDevicePresent(Pointer sharedMemory) {
        if (AgentUtils.checkDeviceAvailable()) {
            return answerMessage(sharedMemory);
        } else {
            writeAndLogFailure(sharedMemory, "Device not available.");
            return 0;
        }
    }

    private void writeAndLogFailure(Pointer sharedMemory, String messageToLog) {
        Logger.getLogger(SSHAgent.class.getName()).log(Level.SEVERE, messageToLog);
        byte[] buff = new byte[5];
        buff[4] = SSH_AGENT_FAILURE;
        buff[1] = 1;
        sharedMemory.write(0, buff, 0, buff.length);
    }

    private void processSignRequest(Pointer sharedMemory) {
        byte[] keyInBytes = getDataFromRequest(sharedMemory, 5);
        byte[] challengeData = getDataFromRequest(sharedMemory, 5 + 4 + keyInBytes.length);
        byte[] signedDataRaw;
        byte[] signedData = null;
        byte[] userName = unframeUsernameFromChallengeBytes(challengeData);
        boolean isSignatureValid = false;
        String keyTypeProvided = unframeKeyTypeFromProvidedSSHKey(keyInBytes);

        Logger.getLogger(SSHAgent.class.getName()).log(Level.FINE, "Server sent challenge: {0}", Base64.toBase64String(challengeData));
        Logger.getLogger(SSHAgent.class.getName()).log(Level.FINE, "Effective username: {0}", new String(userName));
        Logger.getLogger(SSHAgent.class.getName()).log(Level.FINE, "Effective public key: {0}", Base64.toBase64String(keyInBytes));

        try {
            signedDataRaw = DeviceWrapper.signChallenge(challengeData, userName);
            if (signedDataRaw == null || signedDataRaw.length != 65) {
                throw new SignFailedException("HW sign response must have 65 bytes, length: " + signedDataRaw.length);
            }

            Logger.getLogger(SSHAgent.class.getName()).log(Level.FINE, "SSH server returned key type: {0}", keyTypeProvided);
            switch (keyTypeProvided) {
                case IdentityUtils.NISTP256_KEY_PREFIX:
                    try {
                        isSignatureValid = IdentityUtils.isValidSignature(IdentityUtils.unframeUncompressedNistpKeyFromSSHKey(keyInBytes),
                                challengeData, IdentityUtils.createDERSignResponse(signedDataRaw)); // double check that SSH server sent public key that can verify signature provided by HW
                    } catch (Throwable th) {
                        throw new SignFailedException("Error occured while validating signature.", th);
                    }

                    if (isSignatureValid) {
                        signedData = IdentityUtils.createSSHSignResponseFromNistpKey(signedDataRaw);
                    } else { // isSignatureValid==false
                        throw new SignFailedException("Signature was validated using provided public key with negative result.");
                    }

                    break;
                case IdentityUtils.ED25519_KEY_PREFIX:
                    // TODO: isSignatureValid missing, find secure java validator for ed25519
                    signedData = IdentityUtils.createSSHSignResponseFromEd25519Key(signedDataRaw);
                    break;
                default:
                    throw new SignFailedException("SSH server returned unknown key type: " + keyTypeProvided);
            }

            if (signedData != null) {
                sharedMemory.write(0, signedData, 0, signedData.length);
                TrayProcess.createInfo(LocalizedLogger.getLocalizedMessage("CERT_USE_SUCCESS", new String(userName), TrayProcess.deviceService.getDeviceLabel()));
            } else {
                TrayProcess.createWarning(LocalizedLogger.getLocalizedMessage("CERT_USED_ERROR"));
            }
        } catch (DeviceTimeoutException | SignFailedException ex) {
            TrayProcess.handleException(ex);
        } catch (ActionCancelledException ex) {
            Logger.getLogger(SSHAgent.class.getName()).log(Level.FINE, "Sign operation cancelled on HW.");
        }
    }

    private int getResponseLength(List<PublicKeyDTO> certs) {
        int length = 4 + 1 + 4; // total length (1x int) + result code (1x byte) + no. of keys (1x int)
        for (PublicKeyDTO i : certs) {
            length += 4;
            length += i.getbPublicKey().length;
            length += 4;
            length += i.getbComment().length;
        }
        return length;
    }

    private ByteBuffer writeCertificatesToFrame(List<PublicKeyDTO> certs, byte resultCode) {
        int responseLength = getResponseLength(certs);
        ByteBuffer ret = ByteBuffer.allocate(responseLength);
        ret.put(AgentUtils.frameArray(writeCertificatesToArray(certs, resultCode, responseLength - 4)));
        return ret;
    }

    private byte[] writeCertificatesToArray(List<PublicKeyDTO> certs, byte resultCode, int frameLength) {
        ByteBuffer ret = ByteBuffer.allocate(frameLength);

        ret.put(resultCode);
        if (!certs.isEmpty()) {
            ret.putInt(certs.size()); // number of keys (not byte size)
            for (PublicKeyDTO i : certs) {
                ret.put(AgentUtils.frameArray(i.getbPublicKey()));
                ret.put(AgentUtils.frameArray(i.getbComment()));
            }
        }
        return ret.array();
    }

    private void initCoreClasses() throws Exception {
        try {
            libU = User32.INSTANCE;
            libK = Kernel32.INSTANCE;
        } catch (java.lang.UnsatisfiedLinkError | java.lang.NoClassDefFoundError ex) {
            TrayProcess.handleException(ex);
            throw new Exception(ex.toString());
        }
    }

    private boolean checkIfNoPageantProcessIsRunning() {
        HWND isRunning = libU.FindWindow(APPNAME, APPNAME);
        return isRunning == null;
    }

    private void createProcess() {
        hWnd = createWindowsProcess();
        setCreatedCorrectly(true);
        Logger
                .getLogger(SSHAgent.class
                        .getName()).log(Level.INFO, AgentConstants.APP_PUBLIC_NAME + " " + AgentConstants.VERSION + " started successfully");
    }

    public boolean isCreatedCorrectly() {
        return createdCorrectly;
    }

    private synchronized void setCreatedCorrectly(boolean value) {
        createdCorrectly = value;
    }

    public boolean isMainLoopStarted() {
        return mainLoopStarted;
    }

    public void exitProcess() {
        Logger.getLogger(SSHAgent.class
                .getName()).log(Level.FINE, "Sending exit signal.");
        libU.DestroyWindow(hWnd);
        libK.CloseHandle(mutex); // just in case, mutex should be destroyed by now by process exit
        setCreatedCorrectly(false);

        //TrayProcess.deviceService.getWallet().disconnect();
        //TrayProcess.deviceService.getHardwareWalletService().stopAndWait();
        TrayProcess.deviceService.getClient().softDetach();
    }

    private byte[] unframeUsernameFromChallengeBytes(byte[] challengeData) {
        byte[] username;

        ByteBuffer bb = ByteBuffer.wrap(challengeData, 0, challengeData.length);
        int dataLength = bb.getInt(0); // = should be 32 bytes, random data generated on SSH server side
        bb.position(4 + dataLength + 4 + 1); // forward buffer to position where username frame starts
        int userNameLength = bb.getInt(4 + dataLength + 1); // determine the length of username
        username = new byte[userNameLength];
        bb.get(username, 0, userNameLength);

        return username;
    }

    private String unframeKeyTypeFromProvidedSSHKey(byte[] sshKey) {
        byte[] keyTypeBytes;

        ByteBuffer bb = ByteBuffer.wrap(sshKey, 0, sshKey.length);
        int keyTypeLength = bb.getInt(0); // determine the length of keytype
        bb.position(4); // forward buffer to position where keyType frame starts

        keyTypeBytes = new byte[keyTypeLength];
        bb.get(keyTypeBytes, 0, keyTypeLength);

        return new String(keyTypeBytes);
    }
}


text:
//B''H
package org.ebayopensource.turmeric.runtime.sif.impl.internal.service;

import java.net.URL;
import java.util.List;
import java.util.Map;

import javax.xml.namespace.QName;

import org.ebayopensource.turmeric.runtime.common.binding.DataBindingDesc;
import org.ebayopensource.turmeric.runtime.common.cachepolicy.CacheProvider;
import org.ebayopensource.turmeric.runtime.common.errors.ErrorDataProvider;
import org.ebayopensource.turmeric.runtime.common.exceptions.ErrorDataFactory;
import org.ebayopensource.turmeric.runtime.common.exceptions.ServiceException;
import org.ebayopensource.turmeric.runtime.common.impl.internal.service.ProtocolProcessorDesc;
import org.ebayopensource.turmeric.runtime.common.impl.internal.service.ServiceDesc;
import org.ebayopensource.turmeric.runtime.common.impl.internal.utils.ServiceNameUtils;
import org.ebayopensource.turmeric.runtime.common.impl.utils.ReflectionUtils;
import org.ebayopensource.turmeric.runtime.common.pipeline.Dispatcher;
import org.ebayopensource.turmeric.runtime.common.pipeline.LoggingHandler;
import org.ebayopensource.turmeric.runtime.common.pipeline.Pipeline;
import org.ebayopensource.turmeric.runtime.common.pipeline.Transport;
import org.ebayopensource.turmeric.runtime.common.service.HeaderMappingsDesc;
import org.ebayopensource.turmeric.runtime.common.service.ServiceOperationDesc;
import org.ebayopensource.turmeric.runtime.common.service.ServiceTypeMappings;
import org.ebayopensource.turmeric.runtime.common.types.G11nOptions;
import org.ebayopensource.turmeric.runtime.errorlibrary.ErrorConstants;
import org.ebayopensource.turmeric.runtime.sif.impl.internal.config.ClientConfigHolder;
import org.ebayopensource.turmeric.runtime.sif.pipeline.ApplicationRetryHandler;
import org.ebayopensource.turmeric.runtime.sif.pipeline.AutoMarkdownStateFactory;
import org.ebayopensource.turmeric.runtime.sif.pipeline.ErrorResponseAdapter;
import org.ebayopensource.turmeric.runtime.sif.service.ClientServiceId;

public final class ClientServiceDesc extends ServiceDesc {

	private final String m_clientName;
	private final Map<String,Transport> m_transports;
	private final DataBindingDesc m_defRequestDataBinding;
	private final DataBindingDesc m_defResponseDataBinding;
	private final DataBindingDesc m_defRestRequestDataBinding;
	private final DataBindingDesc m_defRestResponseDataBinding;
	private final String m_defTransportName;
	private final Transport m_defTransport;
	private final G11nOptions m_g11nOptions;
	private final String m_messageProtocolName;
	private final String m_responseTransport;
	private final Integer m_appLevelNumRetries;
	private final String m_serviceVersion;
	private final String m_useCase;
	private final String m_consumerId;
	private final URL m_defServiceLocationURL;
	private final ApplicationRetryHandler m_retryHandler;
	private final ErrorResponseAdapter m_customErrorResponseAdapter;
	private final CacheProvider m_cacheProviderClass;
	private final Boolean m_disableCacheOnLocal;
	private final Boolean m_skipCacheOnError;
	private final AutoMarkdownStateFactory m_autoMarkdownStateFactory;
	private final String m_urlPathInfo;
	private Class m_proxyClass;

//	public ClientServiceDesc(ClientServiceDesc desc, ClientServiceId id, QName serviceQName, ServiceTypeMappings typeMappings){
//
//	}

	public ClientServiceDesc(ClientServiceDesc descToCopy, ClientServiceId id,
			QName serviceQName,
			ClientConfigHolder config,
			Pipeline requestPipeline,
			Pipeline responsePipeline,
			Dispatcher requestDispatcher,
			Dispatcher responseDispatcher,
			Map<String,ServiceOperationDesc> operations,
			Map<String,ProtocolProcessorDesc> protocols,
			Map<String,DataBindingDesc> bindings,
			Map<String,Transport> transports,
			ServiceTypeMappings typeMappings,
			ClassLoader classLoader,
			G11nOptions g11nOptions,
			List<LoggingHandler> loggingHandlers,
			Class serviceInterfaceClass,
			DataBindingDesc defRequestDataBinding,
			DataBindingDesc defResponseDataBinding,
			String defTransportName,
			Transport defTransport,
			URL defServiceLocationURL,
			String serviceVersion,
			ApplicationRetryHandler retryHandler,
			ErrorResponseAdapter customErrorResponseAdapter,
			ErrorDataProvider errorDataProviderClass,
			CacheProvider cacheProviderClass,
			AutoMarkdownStateFactory autoMarkdownStateFactory,
			DataBindingDesc defRestRequestDataBinding,
			DataBindingDesc defRestResponseDataBinding,
			HeaderMappingsDesc requestHeaderMappings,
			HeaderMappingsDesc responseHeaderMappings,
			List<String> serviceLayers,
			String urlPathInfo
			) {
		super(descToCopy, id, serviceQName, config, requestPipeline, responsePipeline,
				requestDispatcher, responseDispatcher,
				operations, protocols, bindings,
				typeMappings, classLoader,
				loggingHandlers,
				serviceInterfaceClass,
				serviceLayers,
				requestHeaderMappings,
				responseHeaderMappings,
				errorDataProviderClass);

		config = config == null ? (ClientConfigHolder) descToCopy.getConfig()
				: config;
		id = id == null ? descToCopy.getServiceId() : id;
		transports = transports == null ? descToCopy.m_transports : transports;
		defRequestDataBinding = defRequestDataBinding == null ? descToCopy.m_defRequestDataBinding
				: defRequestDataBinding;
		defResponseDataBinding = defResponseDataBinding == null ? descToCopy.m_defResponseDataBinding
				: defResponseDataBinding;
		defRestRequestDataBinding = defRestRequestDataBinding == null ? descToCopy.m_defRestRequestDataBinding
				: defRestRequestDataBinding;
		defRestResponseDataBinding = defRestResponseDataBinding == null ? descToCopy.m_defRestResponseDataBinding
				: defRestResponseDataBinding;
		defTransportName = defTransportName == null ? descToCopy.m_defTransportName
				: defTransportName;
		defTransport = defTransport == null ? descToCopy.m_defTransport
				: defTransport;
		g11nOptions = g11nOptions == null ? descToCopy.m_g11nOptions
				: g11nOptions;
		serviceVersion = serviceVersion == null ? descToCopy.m_serviceVersion
				: serviceVersion;
		defServiceLocationURL = defServiceLocationURL == null ? descToCopy.m_defServiceLocationURL
				: defServiceLocationURL;
		retryHandler = retryHandler == null ? descToCopy.m_retryHandler
				: retryHandler;
		customErrorResponseAdapter = customErrorResponseAdapter == null ? descToCopy.m_customErrorResponseAdapter
				: customErrorResponseAdapter;
		autoMarkdownStateFactory = autoMarkdownStateFactory == null ? descToCopy.m_autoMarkdownStateFactory
				: autoMarkdownStateFactory;
		urlPathInfo = urlPathInfo == null ? descToCopy.m_urlPathInfo
				: urlPathInfo;
		cacheProviderClass = cacheProviderClass == null ? descToCopy.m_cacheProviderClass
				: cacheProviderClass;

		if (config == null || defTransportName == null || defTransport == null
				|| g11nOptions == null || retryHandler == null
				|| transports == null || defRequestDataBinding == null
				|| defRestResponseDataBinding == null
				|| defRestRequestDataBinding == null) {
			// checking config, do not allow fallback ServiceDesc on the client
			// side
			throw new NullPointerException();
		}

		m_clientName = id.getClientName();
		m_transports = transports == null ? descToCopy.m_transports : transports;
		m_defRequestDataBinding = defRequestDataBinding;				// required
		m_defResponseDataBinding = defResponseDataBinding;				// null OK
		m_defRestRequestDataBinding = defRestRequestDataBinding;		// required
		m_defRestResponseDataBinding = defRestResponseDataBinding;		// required
		m_defTransportName = defTransportName;
		m_defTransport = defTransport;
		m_g11nOptions = g11nOptions;
		m_messageProtocolName = config.getMessageProtocol();			// null OK
		m_responseTransport = config.getResponseTransport();			// null OK
		m_appLevelNumRetries = config.getAppLevelNumRetries();			// null OK
		m_serviceVersion = serviceVersion;								// null OK
		m_useCase = config.getInvocationUseCase();						// null OK
		m_consumerId = config.getConsumerId();                          // null OK
		m_defServiceLocationURL = defServiceLocationURL;				// null OK
		m_retryHandler = retryHandler;
		m_customErrorResponseAdapter = customErrorResponseAdapter;		// null OK
		m_autoMarkdownStateFactory = autoMarkdownStateFactory;			// null OK
		m_urlPathInfo = urlPathInfo;
		m_cacheProviderClass = cacheProviderClass;
		m_disableCacheOnLocal = config.isCacheDisabledOnLocal();
		m_skipCacheOnError = config.isSkipCacheOnError();

	}

	public ClientServiceDesc(ClientServiceId id,
		QName serviceQName,
		ClientConfigHolder config,
		Pipeline requestPipeline,
		Pipeline responsePipeline,
		Dispatcher requestDispatcher,
		Dispatcher responseDispatcher,
		Map<String,ServiceOperationDesc> operations,
		Map<String,ProtocolProcessorDesc> protocols,
		Map<String,DataBindingDesc> bindings,
		Map<String,Transport> transports,
		ServiceTypeMappings typeMappings,
		ClassLoader classLoader,
		G11nOptions g11nOptions,
		List<LoggingHandler> loggingHandlers,
		Class serviceInterfaceClass,
		DataBindingDesc defRequestDataBinding,
		DataBindingDesc defResponseDataBinding,
		String defTransportName,
		Transport defTransport,
		URL defServiceLocationURL,
		String serviceVersion,
		ApplicationRetryHandler retryHandler,
		ErrorResponseAdapter customErrorResponseAdapter,
		ErrorDataProvider errorDataProviderClass,
		CacheProvider cacheProviderClass,
		AutoMarkdownStateFactory autoMarkdownStateFactory,
		DataBindingDesc defRestRequestDataBinding,
		DataBindingDesc defRestResponseDataBinding,
		HeaderMappingsDesc requestHeaderMappings,
		HeaderMappingsDesc responseHeaderMappings,
		List<String> serviceLayers,
		String urlPathInfo
		)
	{
		super(id, serviceQName, config, requestPipeline, responsePipeline,
			requestDispatcher, responseDispatcher,
			operations, protocols, bindings,
			typeMappings, classLoader,
			loggingHandlers,
			serviceInterfaceClass,
			serviceLayers,
			requestHeaderMappings,
			responseHeaderMappings,
			errorDataProviderClass);

		if (config == null || defTransportName == null || defTransport == null ||
			g11nOptions == null || retryHandler == null || transports == null ||
			defRequestDataBinding == null || defRestResponseDataBinding == null ||
			defRestRequestDataBinding == null)
		{
			// checking config, do not allow fallback ServiceDesc on the client side
			throw new NullPointerException();
		}

		m_clientName = id.getClientName();
		m_transports = transports;
		m_defRequestDataBinding = defRequestDataBinding;				// required
		m_defResponseDataBinding = defResponseDataBinding;				// null OK
		m_defRestRequestDataBinding = defRestRequestDataBinding;		// required
		m_defRestResponseDataBinding = defRestResponseDataBinding;		// required
		m_defTransportName = defTransportName;
		m_defTransport = defTransport;
		m_g11nOptions = g11nOptions;
		m_messageProtocolName = config.getMessageProtocol();			// null OK
		m_responseTransport = config.getResponseTransport();			// null OK
		m_appLevelNumRetries = config.getAppLevelNumRetries();			// null OK
		m_serviceVersion = serviceVersion;								// null OK
		m_useCase = config.getInvocationUseCase();						// null OK
		m_consumerId = config.getConsumerId();                          // null OK
		m_defServiceLocationURL = defServiceLocationURL;				// null OK
		m_retryHandler = retryHandler;
		m_customErrorResponseAdapter = customErrorResponseAdapter;		// null OK
		m_autoMarkdownStateFactory = autoMarkdownStateFactory;			// null OK
		m_urlPathInfo = urlPathInfo;
		m_cacheProviderClass = cacheProviderClass;
		m_disableCacheOnLocal = config.isCacheDisabledOnLocal();
		m_skipCacheOnError = config.isSkipCacheOnError();
	}

	/* (non-Javadoc)
	 * @see org.ebayopensource.turmeric.runtime.common.impl.service.ServiceDesc#getServiceId()
	 */
	@Override
	public ClientServiceId getServiceId() {
		return (ClientServiceId)super.getServiceId();
	}

	/**
	 * @return
	 */
	public String getClientName() {
		return m_clientName;
	}

	/**
	 * Get the transport instance for the specified name.
	 * @param name the name of the transport
	 * @return the transport
	 */
	public Transport getTransport(String name) {
		return m_transports.get(name);
	}

	/**
	 * @return
	 */
	public DataBindingDesc getDefRequestDataBinding() {
		return m_defRequestDataBinding;
	}

	/**
	 * @return
	 */
	public DataBindingDesc getDefResponseDataBinding() {
		return m_defResponseDataBinding;
	}

	public DataBindingDesc getDefRestRequestDataBinding() {
		return m_defRestRequestDataBinding;
	}

	public DataBindingDesc getDefRestResponseDataBinding() {
		return m_defRestResponseDataBinding;
	}

	/**
	 * @return
	 */
	public String getDefTransportName() {
		return m_defTransportName;
	}

	/**
	 * @return
	 */
	public Transport getDefTransport() {
		return m_defTransport;
	}

	/**
	 * @return
	 */
	public URL getDefServiceLocationURL() {
		return m_defServiceLocationURL;
	}

	/**
	 * @return
	 */
	public G11nOptions getG11nOptions() {
		return m_g11nOptions;
	}

	/**
	 * @return
	 */
	public String getMessageProtocolName() {
		return m_messageProtocolName;
	}

	/**
	 * @return
	 */
	public String getResponseTransport() {
		return m_responseTransport;
	}

	/**
	 * The application retry feature allows selective retry of certain configured errors, a
	 * configured number of times per request.  Maximum total try count will be retry count plus one.
	 * @return the configured number of application retries to attempt; may be overridden by a value
	 * in ServiceInvokerOptions.
	 */
	public Integer getAppLevelNumRetries() {
		return m_appLevelNumRetries;
	}

	/**
	 * @return the service version in use by this client, the version that will be specified in invocation
	 * requests.
	 */
	public String getServiceVersion() {
		return m_serviceVersion;
	}

	/**
	 * @return the configured use case that will be passed in client requests.  May be overridden by a value
	 * in ServiceInvokerOptions.
	 */
	public String getUseCase() {
		return m_useCase;
	}

	/**
	 * @return the configured consumerId that will be passed in client requests.  May be overridden by a value
	 * in ServiceInvokerOptions.
	 */
	public String getConsumerId() {
		return m_consumerId;
	}

	/**
	 * @return
	 * @throws ServiceException
	 */
	@SuppressWarnings("unchecked")
	public Class getProxyClass() throws ServiceException {
		if (m_proxyClass == null) {
			Class intfClass = getServiceInterfaceClass();
			if (intfClass == null) {
				throw new ServiceException(ErrorDataFactory.createErrorData(ErrorConstants.SVC_FACTORY_UNDEFINED_INTF_CLASS_NAME,
						ErrorConstants.ERRORDOMAIN));
			}
			String className = ServiceNameUtils.getServiceProxyClassName(getAdminName(), intfClass.getName());
			m_proxyClass = ReflectionUtils.loadClass(className, intfClass, getClassLoader());
		}
		return m_proxyClass;
	}

	public ApplicationRetryHandler getRetryHandler() {
		return m_retryHandler;
	}

	public ErrorResponseAdapter getCustomErrorResponseAdapter() {
		return m_customErrorResponseAdapter;
	}

	public AutoMarkdownStateFactory getAutoMarkdownStateFactory() {
		return m_autoMarkdownStateFactory;
	}

	public String getUrlPathInfo() {
		return m_urlPathInfo;
	}

	public CacheProvider getCacheProviderClass() {
		return m_cacheProviderClass;
	}

	public Boolean isCacheDisabledOnLocal() {
		return m_disableCacheOnLocal;
	}

	public Boolean isSkipCacheOnError() {
		return m_skipCacheOnError;
	}
}


text:
shared :string_to_a do |cmd|
  describe "String##{cmd}" do
    it "returns an empty array for empty strings" do
      "".send(cmd).should == []
    end

    it "returns an array containing the string for non-empty strings" do
      "hello".send(cmd).should == ["hello"]
    end
  end
end


text:
<?php
/**
 * The generic item of Grand Central
 *
 * @author	Sylvain Frigui <sf@hands.agency>
 * @access	public
 * @link		http://grandcentral.fr
 */
class itemConst extends _items
{
/**
 * Fill the object with all his attributes
 *
 * @param	array 	attributes array
 * @access  public
 */
	public function database_set($data)
	{
		parent::database_set($data);
		registry::set($this->get_env(), 'const', $this['key']->get(), $this['title']);
	}
/**
 * Translate a constant text
 *
 * @param	string 	string to translate
 * @access  public
 */
	public static function t($string)
	{
		if (empty($string)) return '';
		$key = mb_strtoupper(mb_substr($string, 0, 64));
		// var
		$lang = i(env, current)['version']['lang']->get();
		// recherche de la traduction
		$const = registry::get(env, 'const', $key);
		if (!empty($const))
		{
			return $const;
		}
		// ajout
		else
		{
			$const = i('const');
			$const['title'][$lang] = $string;
			$const['key'] = $key;
			$const->save();
			registry::set($const->get_env(), 'const', $const['key']->get(), $const['title']);
			return $const['title'][$lang];
		}
	}
}
?>


text:
require 'test/test_helper'
gem 'resque'
require 'resque'

class ResquePaperclipTest < Test::Unit::TestCase
  def setup
    super

    # Make sure that we just test Resque in here
    Object.send(:remove_const, :Delayed) if defined? Delayed

    Resque.remove_queue(:paperclip)
    reset_dummy
  end

  def test_enqueue_job_if_source_changed
    @dummy.stubs(:image_changed?).returns(true)

    original_job_count = Resque.size(:paperclip)
    @dummy.enqueue_job_for_image

    assert_equal original_job_count + 1, Resque.size(:paperclip)
  end

  def test_perform_job
    Paperclip::Attachment.any_instance.expects(:reprocess!)

    @dummy.save!
    ResquePaperclipJob.perform(@dummy.class.name, @dummy.id, :image)
  end

  def test_after_callback_is_functional
    @dummy_class.send(:define_method, :done_processing) { puts 'done' }
    @dummy_class.after_image_post_process :done_processing
    Dummy.any_instance.expects(:done_processing)

    @dummy.save!
    ResquePaperclipJob.perform(@dummy.class.name, @dummy.id, :image)
  end

  def test_processing_column_kept_intact
    @dummy = reset_dummy(true)

    @dummy.stubs(:image_changed?).returns(true)
    Paperclip::Attachment.any_instance.stubs(:reprocess!).raises(StandardError.new('oops'))

    @dummy.save!
    assert @dummy.image_processing?

    worker = Resque::Worker.new(:paperclip)
    worker.process

    assert @dummy.reload.image_processing?
  end
end


text:
layout: doc
title: "Server Configuration"
description:
modified:
excerpt:
tags: []
image:
  feature:
  teaser:
  thumb:
toc: true
share: false
---

{% include doc/ServerConfiguration.md %}


text:
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.

#pragma once

#include "SSymbolDebugger.h"
#include "AsyncWork.h"

/**
 *	Async inspection helper class
 */
class FSymbolDebugger_AsyncInspect : public FNonAbandonableTask
{
public:
	/** Constructor */
	FSymbolDebugger_AsyncInspect(const FString& InCrashDumpName, const FString& InEngineVersion, const FString& InChangelist, ICrashDebugHelper* InCrashHelperModule);

	/** Performs work on thread */
	void DoWork();

	/** Returns true if the task should be aborted.  Called from within the task processing code itself via delegate */
	bool ShouldAbort() const
	{
		return AskedToAbortCount.GetValue() > 0;
	}

	FORCEINLINE TStatId GetStatId() const
	{
		RETURN_QUICK_DECLARE_CYCLE_STAT( FSymbolDebugger_AsyncInspect, STATGROUP_ThreadPoolAsyncTasks );
	}

	/** The found name */
	const FString& GetResults_LabelName() const
	{
		return Result_LabelName;
	}

	/** The found engine version */
	const FString& GetResults_EngineVersion() const
	{
		return Result_EngineVersionName;
	}

	/** The found platform name */
	const FString& GetResults_Platform() const
	{
		return Result_PlatformName;
	}

private:

	ICrashDebugHelper* CrashHelperModule;

	/** True if we've been asked to abort work in progress at the next opportunity */
	FThreadSafeCounter AskedToAbortCount;

	/** CrashDump file being inspected */
	FString CrashDumpName;
	/** EngineVersion being inspected */
	FString EngineVersionName;
	/** Changelist being inspected */
	FString ChangelistName;

	/** The found name */
	FString Result_LabelName;
	/** The found engine version */
	FString Result_EngineVersionName;
	/** The found platform name */
	FString Result_PlatformName;
};

/**
 *	Async syncing helper class
 */
class FSymbolDebugger_AsyncSyncFiles : public FNonAbandonableTask
{
public:
	/** Constructor */
	FSymbolDebugger_AsyncSyncFiles(const FString& InSourceControlLabel, const FString& InPlatform, ICrashDebugHelper* InCrashHelperModule);

	/** Performs work on thread */
	void DoWork();

	/** Returns true if the task should be aborted.  Called from within the task processing code itself via delegate */
	bool ShouldAbort() const
	{
		return AskedToAbortCount.GetValue() > 0;
	}

	FORCEINLINE TStatId GetStatId() const
	{
		RETURN_QUICK_DECLARE_CYCLE_STAT( FSymbolDebugger_AsyncSyncFiles, STATGROUP_ThreadPoolAsyncTasks );
	}

	/**
	 *	@return bool	true if succeeded, false if not
	 */
	bool DidSucceed() const
	{
		return bResult_Succeeded;
	}

private:

	ICrashDebugHelper* CrashHelperModule;

	/** True if we've been asked to abort work in progress at the next opportunity */
	FThreadSafeCounter AskedToAbortCount;

	/** Source control label being sunk */
	FString SourceControlLabel;
	/** Platform being sunk */
	FString Platform;

	/** The results */
	bool bResult_Succeeded;
};

/**
 *	Async syncing helper class
 */
class FSymbolDebugger_LaunchDebugger : public FNonAbandonableTask
{
public:
	/** Constructor */
	FSymbolDebugger_LaunchDebugger(const FString& InCrashDumpName);

	/** Performs work on thread */
	void DoWork();

	/** Returns true if the task should be aborted.  Called from within the task processing code itself via delegate */
	bool ShouldAbort() const
	{
		return AskedToAbortCount.GetValue() > 0;
	}

	FORCEINLINE TStatId GetStatId() const
	{
		RETURN_QUICK_DECLARE_CYCLE_STAT( FSymbolDebugger_LaunchDebugger, STATGROUP_ThreadPoolAsyncTasks );
	}

	/**
	 *	@return bool	true if succeeded, false if not
	 */
	bool DidSucceed() const
	{
		return bResult_Succeeded;
	}

private:
	/** True if we've been asked to abort work in progress at the next opportunity */
	FThreadSafeCounter AskedToAbortCount;

	/** CrashDump file */
	FString CrashDumpName;

	/** The results */
	bool bResult_Succeeded;
};

/**
 *	Async inspection helper class
 */
class FSymbolDebugger_ProcessCrashDump : public FNonAbandonableTask
{
public:
	/** Constructor */
	FSymbolDebugger_ProcessCrashDump(const FString& InCrashDumpName, ICrashDebugHelper* InCrashHelperModule);

	/** Performs work on thread */
	void DoWork();

	/** Returns true if the task should be aborted.  Called from within the task processing code itself via delegate */
	bool ShouldAbort() const
	{
		return AskedToAbortCount.GetValue() > 0;
	}

	FORCEINLINE TStatId GetStatId() const
	{
		RETURN_QUICK_DECLARE_CYCLE_STAT( FSymbolDebugger_ProcessCrashDump, STATGROUP_ThreadPoolAsyncTasks );
	}

	/** The found name */
	const FString& GetResults_LabelName() const
	{
		return Result_LabelName;
	}

	/** The found engine version */
	const FString& GetResults_EngineVersion() const
	{
		return Result_EngineVersionName;
	}

	/** The found platform name */
	const FString& GetResults_Platform() const
	{
		return Result_PlatformName;
	}

	/**
	 *	@return bool	true if succeeded, false if not
	 */
	bool DidSucceed() const
	{
		return bResult_Succeeded;
	}

private:

	ICrashDebugHelper* CrashHelperModule;

	/** True if we've been asked to abort work in progress at the next opportunity */
	FThreadSafeCounter AskedToAbortCount;

	/** CrashDump file being inspected */
	FString CrashDumpName;

	/** The results */
	bool bResult_Succeeded;
	/** The found name */
	FString Result_LabelName;
	/** The found engine version */
	FString Result_EngineVersionName;
	/** The found platform name */
	FString Result_PlatformName;
};

/**
 *	A helper class for performing the various operations required by the application
 */
class FSymbolDebugger : public TSharedFromThis<FSymbolDebugger>
{
public:
	/** Constructor */
	FSymbolDebugger();

	/** Get the current method being used */
	SSymbolDebugger::ESymbolDebuggerMethods GetCurrentMethod() const
	{
		return CurrentMethod;
	}

	/** Set the current method */
	bool SetCurrentMethod(SSymbolDebugger::ESymbolDebuggerMethods InNewMethod);

	/** Get the current method text */
	FString GetMethodText() const;

	/** Set the method text */
	bool SetMethodText(const FString& InNewMethodText);

	/** Select a crash dump file via the file open dialog */
	bool OnFileOpen(TSharedRef<SWidget> ParentWidget);

	/** Get the current action being performed */
	SSymbolDebugger::ESymbolDebuggerActions GetCurrentAction() const
	{
		return CurrentAction;
	}

	/**
	 *	Get the give TextField name
	 *
	 *	@param	InTextField			The textField of interest
	 *
	 *	@return	FString				The name
	 */
	FString GetTextField(SSymbolDebugger::ESymbolDebuggerTextFields InTextField);

	/**
	 *	Set the give TextField name
	 *
	 *	@param	InTextField			The textField of interest
	 *	@param	InNewName			The new name
	 *
	 *	@return	bool				true if successful, false if not
	 */
	bool SetTextField(SSymbolDebugger::ESymbolDebuggerTextFields InTextField,const FString& InNewName);

	/**
	 *	Is the given textfield enabled?
	 *
	 *	@param	InTextField			The textField of interest
	 *
	 *	@return	bool				true if enabled, false if not
	 */
	bool IsTextFieldEnabled(SSymbolDebugger::ESymbolDebuggerTextFields InTextField);

	/**
	 *	Is the given action enabled?
	 *
	 *	@param	InAction			The action to perform
	 *
	 *	@return	bool				true if enabled, false if not
	 */
	bool IsActionEnabled(SSymbolDebugger::ESymbolDebuggerActions InAction);

	/**
	 *	Handle the given action
	 *
	 *	@param	InAction			The action to perform
	 *
	 *	@return	bool				true if successful, false if not
	 */
	bool OnAction(SSymbolDebugger::ESymbolDebuggerActions InAction);

	/**
	 *	Get the status text to display
	 *
	 *	@return	FString		The status text
	 */
	FString GetStatusText() const;

	/**
	 *	Has the given action completed?
	 *
	 *	@param	InAction						The action of interest
	 *
	 *	@return	ESymbolDebuggerActionResults	The Results of the action
	 */
	SSymbolDebugger::ESymbolDebuggerActionResults ActionHasCompleted(SSymbolDebugger::ESymbolDebuggerActions InAction);

	/**
	 *	Tick the helper
	 */
	void Tick();

protected:
	/**
	 *	Inspect to determine the info for syncing required debugging files.
	 *
	 *	@return	bool		true if successful, false if not
	 */
	bool OnInspect();

	/**
	 *	Sync the required files for debugging.
	 *
	 *	@return	bool		true if successful, false if not
	 */
	bool OnSync();

	/**
	 *	Launch the debugger
	 *
	 *	@return	bool		true if successful, false if not
	 */
	bool OnDebug();

	/**
	 *	Process the crash dump - inspect, sync and launch the debugger
	 *
	 *	@return	bool		true if successful, false if not
	 */
	bool OnProcess();

	/**
	 *	Inspect the given CrashDump to determine the info for syncing required debugging files.
	 *
	 *	@param	InCrashDumpName		The full path of the crashdump file
	 *
	 *	@return	bool				true if successful, false if not
	 */
	bool InspectCrashDump(const FString& InCrashDumpName);

	/**
	 *	Inspect the given EngineVersion to determine the info for syncing required debugging files.
	 *
	 *	@param	InEngineVersion		The engine version
	 *
	 *	@return	bool				true if successful, false if not
	 */
	bool InspectEngineVersion(const FString& InEngineVersion);

	/**
	 *	Inspect the given Changelist to determine the info for syncing required debugging files.
	 *
	 *	@param	InChangelist		The changelist
	 *
	 *	@return	bool				true if successful, false if not
	 */
	bool InspectChangelist(const FString& InChangelist);

	/**
	 *	Sync the required debugging files from the given label for the given platform
	 *
	 *	@param	InLabelName			The label
	 *	@param	InPlatform			The platform
	 *
	 *	@return	bool				true if successful, false if not
	 */
	bool SyncFiles(const FString& InLabelName, const FString& InPlatform);

	/**
	 *	Launch the debugger for the given crash dump
	 *
	 *	@param	InCrashDumpName		The full path of the crashdump file
	 *
	 *	@return	bool				true if successful, false if not
	 */
	bool DebugCrashDump(const FString& InCrashDumpName);

	/**
	 *	Inspect, sync and launch the debugger for the given crash dump
	 *
	 *	@param	InCrashDumpName		The full path of the crashdump file
	 *
	 *	@return	bool				true if successful, false if not
	 */
	bool ProcessCrashDump(const FString& InCrashDumpName);

	/** The current method for symbol handling */
	SSymbolDebugger::ESymbolDebuggerMethods CurrentMethod;
	/** The current action being performed */
	SSymbolDebugger::ESymbolDebuggerActions CurrentAction;
	/** The last action completed */
	SSymbolDebugger::ESymbolDebuggerActions LastAction;

	/** The current settings */
	/** The name of the crash dump file */
	FString CrashDumpName;
	/** The name of the platform */
	FString PlatformName;
	/** The name of the source control label */
	FString SourceControlLabelName;
	/** The engine version */
	FString EngineVersionName;
	/** The changelist */
	FString ChangelistName;
	/** The symbol store */
	FString SymbolStoreName;
	/** The remote debug IP addr */
	FString RemoteDebugIPName;
	/** The depot name */
	FString DepotName;

	/** Async task for inspecting */
	TSharedPtr<FAsyncTask<class FSymbolDebugger_AsyncInspect> > InspectionTask;

	/** Async task for syncing */
	TSharedPtr<FAsyncTask<class FSymbolDebugger_AsyncSyncFiles> > SyncTask;
	/** The results from syncing */
	bool bSyncSucceeded;

	/** Async task for launching the debugger */
	TSharedPtr<FAsyncTask<class FSymbolDebugger_LaunchDebugger> > LaunchDebuggerTask;
	/** The results from launching the debugger */
	bool bLaunchDebugSucceeded;

	/** Async task for processing a crash dump */
	TSharedPtr<FAsyncTask<class FSymbolDebugger_ProcessCrashDump> > ProcessCrashDumpTask;
	/** The results from processing the crash dump */
	bool bProcessCrashDumpSucceeded;

	ICrashDebugHelper* CrashHelperModule;
};