text:
(function() {
	'use strict';

	angular
		.module('localbiz.news')
		.controller('ArticlesController', ArticlesController);

	ArticlesController.$inject = ['$scope', '$state', 'newsService'];

	/* @ngInject */
	function ArticlesController($scope, $state, newsService) {
		var vm = angular.extend(this, {
			articles: [],
			navigate: navigate,
			doRefresh: doRefresh
		});

		// ********************************************************************

		newsService.all(function(data){
			vm.articles = data;
		});

		function navigate(articleId) {
			$state.go('app.article', { articleId: articleId });
		}

		function doRefresh() {
			setTimeout($scope.$broadcast('scroll.refreshComplete'), 16000);
		}
	}
})();


text:
import argparse, json, os
import numpy as np
import h5py
import codecs

parser = argparse.ArgumentParser()
parser.add_argument('--input_txt', default='enwik8')
parser.add_argument('--output_h5', default='enwik8.h5')
parser.add_argument('--output_json', default='enwik8.json')
parser.add_argument('--val_frac', type=float, default=0.05)
parser.add_argument('--test_frac', type=float, default=0.05)
parser.add_argument('--quiet', action='store_true')
parser.add_argument('--encoding', default='bytes')

# parser.add_argument('--input_txt', default='haha.txt')
# parser.add_argument('--output_h5', default='haha.h5')
# parser.add_argument('--output_json', default='haha.json')
# parser.add_argument('--val_frac', type=float, default=0.2)
# parser.add_argument('--test_frac', type=float, default=0.3)
# parser.add_argument('--quiet', action='store_true')
# parser.add_argument('--encoding', default='bytes')

# parser.add_argument('--input_txt', default='tiny-shakespeare.txt')
# parser.add_argument('--output_h5', default='tiny-shakespeare.h5')
# parser.add_argument('--output_json', default='tiny-shakespeare.json')
# parser.add_argument('--val_frac', type=float, default=0.1)
# parser.add_argument('--test_frac', type=float, default=0.1)
# parser.add_argument('--quiet', action='store_true')
# parser.add_argument('--encoding', default='utf-8')
args = parser.parse_args()

if __name__ == '__main__':
  if args.encoding == 'bytes': args.encoding = None

  # First go the file once to see how big it is and to build the vocab
  token_to_idx = {}
  total_size = 0
  with codecs.open(args.input_txt, 'r', args.encoding) as f:
    for line in f:
      total_size += len(line)
      for char in line:
        if char not in token_to_idx:
          token_to_idx[char] = len(token_to_idx) + 1
    lastChar = '\n' # used as the target of the last character
    if lastChar not in token_to_idx:
          token_to_idx[lastChar] = len(token_to_idx) + 1

  # Now we can figure out the split sizes
  val_size = int(args.val_frac * total_size)
  test_size = int(args.test_frac * total_size)
  train_size = total_size - val_size - test_size

  if not args.quiet:
    print 'Total vocabulary size: %d' % len(token_to_idx)
    print 'Total tokens in file: %d' % total_size
    print '  Training size: %d' % train_size
    print '  Val size: %d' % val_size
    print '  Test size: %d' % test_size

  # Choose the datatype based on the vocabulary size
  dtype = np.uint8
  if len(token_to_idx) > 255:
    dtype = np.uint32
  if not args.quiet:
    print 'Using dtype ', dtype

  # Just load data into memory ... we'll have to do something more clever
  # for huge datasets but this should be fine for now
  train = np.zeros(train_size + 1, dtype=dtype)
  val = np.zeros(val_size + 1, dtype=dtype)
  test = np.zeros(test_size + 1, dtype=dtype)
  splits = [train, val, test]

  # Go through the file again and write data to numpy arrays
  split_idx, cur_idx = 0, 0
  with codecs.open(args.input_txt, 'r', args.encoding) as f:
    for line in f:
      for char in line:
        splits[split_idx][cur_idx] = token_to_idx[char]
        cur_idx += 1
        if cur_idx == splits[split_idx].size - 1:
          split_idx += 1
          cur_idx = 0

  # for the target of the last character
  train[train.size - 1] = val[0]
  val[val.size - 1] = test[0]
  test[test.size - 1] = token_to_idx['\n']

  # Write data to HDF5 file
  with h5py.File(args.output_h5, 'w') as f:
    f.create_dataset('train', data=train)
    f.create_dataset('val', data=val)
    f.create_dataset('test', data=test)

  # For 'bytes' encoding, replace non-ascii characters so the json dump
  # doesn't crash
  if args.encoding is None:
    new_token_to_idx = {}
    for token, idx in token_to_idx.iteritems():
      if ord(token) > 127:
        new_token_to_idx['[%d]' % ord(token)] = idx
      else:
        new_token_to_idx[token] = idx
    token_to_idx = new_token_to_idx

  # Dump a JSON file for the vocab
  json_data = {
    'token_to_idx': token_to_idx,
    'idx_to_token': {v: k for k, v in token_to_idx.iteritems()},
  }
  with open(args.output_json, 'w') as f:
    json.dump(json_data, f)

redpajama_set_name: RedPajamaGithub


text:
import type { WebhookType } from '@dg/api/types/WebhookType';
import type { Response } from 'node-fetch';
import { isRecord } from '../../src/api/parsers';

/**
 * Strava's API returns errors like this
 */
type JsonResponseWithErrors = {
  errors?: Array<unknown>;
};

/**
 * Typeguard for checking for an error
 */
const isJsonWithErrors = (
  json: Record<string, unknown> | unknown | undefined,
): json is JsonResponseWithErrors => isRecord(json) && json?.errors !== undefined;

/**
 * Prints out an error for the user for a given webhook if necessary -
 * and returns if it handled the error successfully.
 */
const handledError = async (webhookType: WebhookType, data: Response) => {
  if (data.status >= 200 && data.status < 300) {
    return false;
  }

  const json = await data.json();
  if (!isJsonWithErrors(json)) {
    console.error('🚨 Unknown error', data.status, json);
    return true;
  }
  console.error(`🚨 Error from ${webhookType} (${data.status}):`, json.errors);
  return true;
};

export default handledError;


text:
(function(){

    'use strict';

    angular
        .module('app.<%= moduleName %>', [])
        .config(configuration);

    function configuration($stateProvider){

        // state mapping

    }

}());


text:
namespace mediapipe {

// Describes a rectangle box at an instance of time.
struct TimedBox {
  static const int kNumQuadVertices = 4;
  // Dimensions are in normalized coordinates [0, 1].
  float top = 0;
  float left = 0;
  float bottom = 0;
  float right = 0;
  // Rotation of box w.r.t. center in radians.
  float rotation = 0;
  int64 time_msec = 0;
  // Confidence of the tracked box in range [0, 1].
  float confidence = 0;
  std::vector<Vector2_f> quad_vertices;
  // Aspect ratio (width / height) for the tracked rectangle in physical space.
  float aspect_ratio = -1.0;
  // Whether we want this box to be potentially grouped with other boxes
  // to track together. This is useful for tracking small boxes that lie
  // on a plane. For example, when we detect a plane,
  // track the plane, then all boxes within the plane can share the same
  // homography transform.
  bool request_grouping = false;

  bool operator<(const TimedBox& rhs) const {
    return time_msec < rhs.time_msec;
  }

  // Returns (1.0 - alpha) * lhs + alpha * rhs;
  static TimedBox Blend(const TimedBox& lhs, const TimedBox& rhs, double alpha);

  // Returns lhs * alpha + rhs * beta;
  static TimedBox Blend(const TimedBox& lhs, const TimedBox& rhs, double alpha,
                        double beta);

  std::string ToString() const {
    return absl::StrFormat(
        "top: %.3f left: %.3f bottom: %.3f right: %.3f "
        "rot: %.3f t: %d",
        top, left, bottom, right, rotation, static_cast<int64_t>(time_msec));
  }

  // Returns corners of TimedBox in the requested domain.
  std::array<Vector2_f, 4> Corners(float width, float height) const;

  static TimedBox FromProto(const TimedBoxProto& proto);
  TimedBoxProto ToProto() const;
};

// TimedBox augment with internal states.
struct InternalTimedBox : public TimedBox {
  InternalTimedBox() = default;
  // Convenience constructor.
  InternalTimedBox(const TimedBox& box, const MotionBoxState* state_)
      : TimedBox(box), state(state_) {}

  // Corresponding MotionBoxState a TimedBox.
  std::shared_ptr<const MotionBoxState> state;
};

// Initializes beginning tracking state from a TimedBox.
void MotionBoxStateFromTimedBox(const TimedBox& box, MotionBoxState* state);

// Retrieves box position and time from a tracking state.
void TimedBoxFromMotionBoxState(const MotionBoxState& state, TimedBox* box);

// Downgrade tracking degrees of TrackStepOptions to
// TRACKING_DEGREE_OBJECT_ROTATION_SCALE if originally
// specified TRACKING_DEGREE_OBJECT_PERSPECTIVE, but start pos
// does not contain quad or contains invalid quad.
template <typename T>
void ChangeTrackingDegreesBasedOnStartPos(
    const T& start_pos, TrackStepOptions* track_step_options) {
  if (track_step_options->tracking_degrees() ==
          TrackStepOptions::TRACKING_DEGREE_OBJECT_PERSPECTIVE &&
      (!start_pos.has_quad() || start_pos.quad().vertices_size() != 8)) {
    track_step_options->set_tracking_degrees(
        TrackStepOptions::TRACKING_DEGREE_OBJECT_ROTATION_SCALE);
    VLOG(1) << "Originally specified TRACKING_DEGREE_OBJECT_PERSPECTIVE, but "
               "changed to TRACKING_DEGREE_OBJECT_ROTATION_SCALE";
  }
}

// Set of boxes for a particular checkpoint.
typedef std::deque<InternalTimedBox> PathSegment;

// Stores the PathSegment for each checkpoint time.
typedef std::map<int, PathSegment> Path;

// Returns box at specified time for a specific path segment.
// Returns true on success, otherwise box is left untouched.
// Optionally returns closest known MotionBoxState if state is not null.
bool TimedBoxAtTime(const PathSegment& segment, int64 time_msec, TimedBox* box,
                    MotionBoxState* state = nullptr);

// Tracks timed boxes from cached TrackingDataChunks created by
// FlowPackagerCalculator. For usage see accompanying test.
class BoxTracker {
 public:
  // Initializes a new BoxTracker to work on cached TrackingData from a chunk
  // directory.
  BoxTracker(const std::string& cache_dir, const BoxTrackerOptions& options);

  // Initializes a new BoxTracker to work on the passed TrackingDataChunks.
  // If copy_data is true, BoxTracker will retain its own copy of the data;
  // otherwise the passed pointer need to be valid for the lifetime of the
  // BoxTracker.
  BoxTracker(const std::vector<const TrackingDataChunk*>& tracking_data,
             bool copy_data, const BoxTrackerOptions& options);

  // Add single TrackingDataChunk. This chunk must be correctly aligned with
  // existing chunks. If chunk starting timestamp is larger than next valid
  // chunk timestamp, empty chunks will be added to fill the gap. If copy_data
  // is true, BoxTracker will retain its own copy of the data; otherwise the
  // passed pointers need to be valid for the lifetime of the BoxTracker.
  void AddTrackingDataChunk(const TrackingDataChunk* chunk, bool copy_data);
  // Add new TrackingDataChunks. This method allows to streamline BoxTracker
  // usage. Instead of collecting all tracking chunks and then calling the
  // constructor, it makes possible to pass only minimally required chunks to
  // constructor, and then append new chunks when available.
  // Caller is responsible to guarantee that all chunks that are necessary for
  // tracking are at the disposal of BoxTracker before calling NewBoxTrack, i.e.
  // min_msec and max_msec parameters must be in the range of chunks passed to
  // BoxTracker.
  // Chunks will be added in the order they are specified in tracking_data. Each
  // chunk must be correctly aligned with existing chunks. If chunk starting
  // timestamp is larger than next valid chunk timestamp, empty chunks will be
  // added to fill the gap. If copy_data is true, BoxTracker will retain its own
  // copy of the data; otherwise the passed pointers need to be valid for the
  // lifetime of the BoxTracker.
  void AddTrackingDataChunks(
      const std::vector<const TrackingDataChunk*>& tracking_data,
      bool copy_data);

  // Starts a new track for the specified box until tracking terminates or
  // until track length achieves max_length.
  // Does not block caller, returns immediately.
  // Note: Use positive integers for id, we reserve negative ones for debugging
  // and visualization purposes.
  void NewBoxTrack(const TimedBox& initial_pos, int id, int64 min_msec = 0,
                   int64 max_msec = std::numeric_limits<int64>::max());

  // Returns interval for which the state of the specified box is known.
  // (Returns -1, -1 if id is missing or no tracking has been done).
  std::pair<int64, int64> TrackInterval(int id);

  // Returns box position for requested box at specified time.
  // Returns false if no such box exists.
  // Optional, if record_path_states is enabled in options outputs the
  // corresponding states for the resulting TimedBox. Note, as TimedBoxes are
  // generally interpolated from the underlying data and blended across
  // checkpoints, the returned states are the closest (snapped) known tracking
  // states for the left and right checkpoint path. Therefore the size of states
  // is either two or one (if only one checkpoint exists).
  bool GetTimedPosition(int id, int64 time_msec, TimedBox* result,
                        std::vector<MotionBoxState>* states = nullptr);

  // Returns chunk index for specified time.
  int ChunkIdxFromTime(int64 msec) const {
    return msec / options_.caching_chunk_size_msec();
  }

  // Returns true if any tracking is ongoing for the specified id.
  bool IsTrackingOngoingForId(int id) ABSL_LOCKS_EXCLUDED(status_mutex_);

  // Returns true if any tracking is ongoing.
  bool IsTrackingOngoing() ABSL_LOCKS_EXCLUDED(status_mutex_);

  // Cancels all ongoing tracks. To avoid race conditions all NewBoxTrack's in
  // flight will also be canceled. Future NewBoxTrack's will be canceled.
  // NOTE: To resume execution, you have to call ResumeTracking() before
  //       issuing more NewBoxTrack calls.
  void CancelAllOngoingTracks() ABSL_LOCKS_EXCLUDED(status_mutex_);
  void ResumeTracking() ABSL_LOCKS_EXCLUDED(status_mutex_);

  // Waits for all ongoing tracks to complete.
  // Optionally accepts a timeout in microseconds (== 0 for infinite wait).
  // Returns true on success, false if timeout is reached.
  // NOTE: If WaitForAllOngoingTracks timed out, CancelAllOngoingTracks() must
  // be called before destructing the BoxTracker object or dangeling running
  // threads might try to access invalid data.
  bool WaitForAllOngoingTracks(int timeout_us = 0)
      ABSL_LOCKS_EXCLUDED(status_mutex_);

  // Debug function to obtain raw TrackingData closest to the specified
  // timestamp. This call will read from disk on every invocation so it is
  // expensive.
  // To not interfere with other tracking requests it is recommended that you
  // use a unique id here.
  // Returns true on success.
  bool GetTrackingData(int id, int64 request_time_msec,
                       TrackingData* tracking_data,
                       int* tracking_data_msec = nullptr);

 private:
  // Asynchronous implementation function for box tracking. Schedules forward
  // and backward tracking.
  void NewBoxTrackAsync(const TimedBox& initial_pos, int id, int64 min_msec,
                        int64 max_msec);

  typedef std::pair<const TrackingDataChunk*, bool> AugmentedChunkPtr;
  // Attempts to read chunk at chunk_idx if it exists. Reads from cache
  // directory or from in memory cache.
  // Important: 2nd part of return value indicates if returned tracking data
  // will be owned by the caller (if true). In that case caller is responsible
  // for releasing the returned chunk.
  AugmentedChunkPtr ReadChunk(int id, int checkpoint, int chunk_idx);

  // Attempts to read specified chunk from caching directory. Blocks and waits
  // until chunk is available or internal time out is reached.
  // Returns nullptr if data could not be read.
  std::unique_ptr<TrackingDataChunk> ReadChunkFromCache(int id, int checkpoint,
                                                        int chunk_idx);

  // Waits with timeout for chunkfile to become available. Returns true on
  // success, false if waited till timeout or when canceled.
  bool WaitForChunkFile(int id, int checkpoint, const std::string& chunk_file)
      ABSL_LOCKS_EXCLUDED(status_mutex_);

  // Determines closest index in passed TrackingDataChunk
  int ClosestFrameIndex(int64 msec, const TrackingDataChunk& chunk) const;

  // Adds new TimedBox to specified checkpoint with state.
  void AddBoxResult(const TimedBox& box, int id, int checkpoint,
                    const MotionBoxState& state);

  // Callback can only handle 5 args max.
  // Set own_data to true for args to assume ownership.
  struct TrackingImplArgs {
    TrackingImplArgs(AugmentedChunkPtr chunk_ptr,
                     const MotionBoxState& start_state_, int start_frame_,
                     int chunk_idx_, int id_, int checkpoint_, bool forward_,
                     bool first_call_, int64 min_msec_, int64 max_msec_)
        : start_state(start_state_),
          start_frame(start_frame_),
          chunk_idx(chunk_idx_),
          id(id_),
          checkpoint(checkpoint_),
          forward(forward_),
          first_call(first_call_),
          min_msec(min_msec_),
          max_msec(max_msec_) {
      if (chunk_ptr.second) {
        chunk_data_buffer.reset(chunk_ptr.first);
      }

      chunk_data = chunk_ptr.first;
    }

    TrackingImplArgs(const TrackingImplArgs&) = default;

    // Storage for tracking data.
    std::shared_ptr<const TrackingDataChunk> chunk_data_buffer;

    // Pointer to the actual tracking data. Usually points to the buffer
    // but can also point to external data for performance reasons.
    const TrackingDataChunk* chunk_data;

    MotionBoxState start_state;
    int start_frame;
    int chunk_idx;
    int id;
    int checkpoint;
    bool forward = true;
    bool first_call = true;
    int64 min_msec;  // minimum timestamp to track to
    int64 max_msec;  // maximum timestamp to track to
  };

  // Actual tracking algorithm.
  void TrackingImpl(const TrackingImplArgs& args);

  // Ids are scheduled exclusively, run this method to acquire lock.
  // Returns false if id could not be scheduled (e.g. id got canceled during
  // waiting).
  bool WaitToScheduleId(int id) ABSL_LOCKS_EXCLUDED(status_mutex_);

  // Signals end of scheduling phase. Requires status mutex to be held.
  void DoneSchedulingId(int id) ABSL_EXCLUSIVE_LOCKS_REQUIRED(status_mutex_);

  // Removes all checkpoints within vicinity of new checkpoint.
  void RemoveCloseCheckpoints(int id, int checkpoint)
      ABSL_EXCLUSIVE_LOCKS_REQUIRED(status_mutex_);

  // Removes specific checkpoint.
  void ClearCheckpoint(int id, int checkpoint)
      ABSL_EXCLUSIVE_LOCKS_REQUIRED(status_mutex_);

  // Terminates tracking for specific id and checkpoint.
  void CancelTracking(int id, int checkpoint)
      ABSL_EXCLUSIVE_LOCKS_REQUIRED(status_mutex_);

  // Implementation function for IsTrackingOngoing assuming mutex is already
  // held.
  bool IsTrackingOngoingMutexHeld()
      ABSL_EXCLUSIVE_LOCKS_REQUIRED(status_mutex_);

  // Captures tracking status for each checkpoint
  struct TrackStatus {
    // Indicates that all current tracking processes should be canceled.
    bool canceled = false;

    // Number of tracking requests than are currently ongoing.
    int tracks_ongoing = 0;
  };

 private:
  // Stores computed tracking paths_ for all boxes.
  std::unordered_map<int, Path> paths_ ABSL_GUARDED_BY(path_mutex_);
  absl::Mutex path_mutex_;

  // For each id and each checkpoint stores current tracking status.
  std::unordered_map<int, std::map<int, TrackStatus>> track_status_
      ABSL_GUARDED_BY(status_mutex_);

  // Keeps track which ids are currently processing in NewBoxTrack.
  std::unordered_map<int, bool> new_box_track_ ABSL_GUARDED_BY(status_mutex_);
  absl::Mutex status_mutex_;

  bool canceling_ ABSL_GUARDED_BY(status_mutex_) = false;

  // Use to signal changes to status_condvar_;
  absl::CondVar status_condvar_ ABSL_GUARDED_BY(status_mutex_);

  BoxTrackerOptions options_;

  // Caching directory for TrackingData stored on disk.
  std::string cache_dir_;

  // Pointers to tracking data stored in memory.
  std::vector<const TrackingDataChunk*> tracking_data_;
  // Buffer for tracking data in case we retain a deep copy.
  std::vector<std::unique_ptr<TrackingDataChunk>> tracking_data_buffer_;

  // Workers that run the tracking algorithm.
  std::unique_ptr<ThreadPool> tracking_workers_;
};

}  // namespace mediapipe

#endif  // MEDIAPIPE_UTIL_TRACKING_BOX_TRACKER_H_


text:
            Calendar
            Control panel

 Home

Calendar

	<?php $this->load->view('include/alert') ?>

		    <form role="form" method="post" action="<?= site_url(); ?>events/insert">

			  Date:
			  <input type="date" class="form-control" id="exampleInputEmail1" name="e_date" placeholder="Enter email">

			  Reason:
			  <input type="text" class="form-control" id="exampleInputPassword1" name="e_title" placeholder="Reason">

			  Type:
			  <select class="form-control" id="exampleInputPassword1" name="e_type" placeholder="Type">
			      <option value="#">Select Type</option>
			      <option value="0">Off Day</option>
			      <option value="1">Event</option>
			  </select>

			  Background Color:
			  <input type="color" class="form-control" id="exampleInputPassword1" name="e_bg" placeholder="Background">

			<button type="submit" class="btn btn-primary">Submit</button>

		    </form>


text:
**Descripción breve :** Las pruebas o tests de integración son aquellas pruebas realizadas con el objeto de poner en evidencia defectos en las interfaces e interacciones entre componentes o sistemas integrados.
Estas pruebas verifican la comunicación e intercambio de datos, entre los diferentes módulos de la aplicación o con otras aplicaciones. Sirven para detectar fallos en la forma en la que los diferentes módulos de la aplicación actúan y se integran los unos con los otros.

>Niveles de prueba: pruebas de componentes (pruebas unitarias), pruebas de integración, pruebas de sistema y pruebas de aceptación.

**Descripción detallada :** Las pruebas de integración se ocupan de probar las interfaces entre los componentes, las interacciones con distintas partes de un mismo sistema, como el sistema operativo, el sistema de archivos y el hardware, y las interfaces entre varios sistemas.
Puede haber más de un nivel de pruebas de integración y pueden llevarse a cabo en objetos de prueba de distinto tamaño, según se indica a continuación:

   a. Las pruebas de integración de componentes se ocupan de probar las interacciones entre los componentes de software y se realizan a continuación de las pruebas de componente ([pruebas unitarias](Componentes disciplina/Practicas/Test Unitarios Automatizados)).

   b. Las pruebas de integración de sistemas se ocupan de probar las interacciones entre los distintos sistemas o entre el hardware y el software y pueden realizarse a continuación de las pruebas de sistema. En este caso la organización de desarrollo puede controlar sólo una parte de la interfaz, lo que puede considerarse un riesgo. Los procesos de negocio implementados como flujos de trabajo pueden afectar a una serie de sistemas. Los problemas de plataforma transversales pueden ser importantes.

### Para tener en cuenta :bangbang:

Cuanto más amplio sea el alcance de la integración, más difícil será aislar los fallos de un componente o sistema específico, lo que puede provocar un mayor riesgo y un tiempo adicional de diagnóstico.

Las estrategias de integración sistemáticas pueden basarse en:

* La arquitectura de sistema (tales como de arriba hacia bajo o de abajo hacia arriba)
* Tareas funcionales
* Secuencias de procesamiento de transacciones
* Cualquier otro aspecto del sistema o de los componentes

Con vistas a facilitar el aislamiento de faltas y realizar una detección temprana de los defectos, normalmente la integración será incremental.

Las pruebas de características específicas no funcionales (como el rendimiento) pueden incluirse tanto en las pruebas de integración como en las pruebas funcionales.

En cada fase de integración, los probadores deben concentrarse exclusivamente en la propia integración. Así, por ejemplo, si están integrando el módulo A con el módulo B, deben concentrarse en probar la comunicación entre los módulos, no la funcionalidad del módulo individual, ya que eso ya se hizo durante las pruebas de componente (en una etapa previa). Para ello pueden utilizarse tanto el enfoque funcional como el enfoque estructural.

Idealmente, los testers deben entender la arquitectura y modificar la planificación de la integración en consecuencia. Si las pruebas de integración se planifican antes de construir los componentes o sistemas, dichos componentes pueden construirse en el orden necesario para que las pruebas sean lo más eficientes posible.

Las pruebas de integración se deben realizar en un ambiente de integración donde se encuentren implementados los componentes que se someterán a las pruebas. Por ejemplo, pruebas de interacción con los microservicios o con una base de datos.

**¿Manual o automatizado?**

Las pruebas de integración pueden ser ejecutadas tanto de forma manual como automatizada. La recomendación para una óptima aplicación de esta práctica es que, las ejecuciones sean automatizadas y formen parte de un pipeline y si por algún motivo eso no es posible, que se ejecuten la mayor cantidad posible de pruebas automatizados y de forma manual los que puedan requerir algún tipo de ajuste.

**Categoría :**  CALIDAD

**Alcance de la práctica :** Intra-equipo ( Afecta al equipo el cual no depende de terceros para poder ejecutarla)

**Tipos de herramientas asociadas :**
* Administrador de diseño y seguimiento de ciclo de vida de casos de prueba
* IDE de construcción de scripts automatizados
* Orquestador de ejecuciones automatizadas
* Versionador de código fuente
* Repositorio de código fuente

**Lista de las acciones del Pipeline CI :** :vertical_traffic_light:
* Desplegar los componentes en el entorno de integración
* Configurar las variables requeridas en el ambiente
* Ejecutar el set de pruebas automatizadas

**Focal point :** A designar :interrobang:

**Roadmap :** Inicial

**Activos asociados a la práctica :** :construction:

**Prácticas precedentes :**

* [Gestión Del Repositorio](Componentes disciplina/Practicas/Gestion del Repositorio) :white_check_mark:
* [Análisis Estático de Código](Componentes disciplina/Practicas/Análisis Estático de Código) :white_check_mark:
* [Test Unitarios Automatizados](Componentes disciplina/Practicas/Test Unitarios Automatizados) :white_check_mark:

**Prácticas relacionadas de otras disciplinas :**
* Disciplina de certificación - Automatización de pruebas de sistemas funcionales
* Disciplina de Certificación - Definición de la casuística de pruebas
* Disciplina de Certificación - Gestión de defectos
* Disciplina de Desarrollo – Automatización de pruebas unitarias :construction:
* Disciplina de Desarrollo – Inspección de código :construction:

**Referencias complementarias :**
* Link de acceso al documento ["Foundation Level_Syllabus_(2010)_ES.pdf"](https://devops.movistar.com.ar/gitlab/jaguares/disciplina-devops/-/blob/master/Disciplina_Devops/06.Componentes/Foundation_Level_Syllabus__2010__ES.pdf)

* [Tipos de pruebas](https://www.javiergarzas.com/2014/07/tipos-de-pruebas-10-min.html)

* [Canal de la Disciplina de Certificación - TEAMS](https://teams.microsoft.com/_#/files/Activos%20-%20Archivos%20Disciplina?groupId=8a33aca8-88ce-4e4d-b102-52e98807ab47&threadId=19%3A3e5b858deb5b450c9f0aae7591911b14%40thread.skype&ctx=channel&context=Activos%2520-%2520Archivos%2520Disciplina&rootfolder=%252Fsites%252FDisciplinaCertificacion.TMHMA%252FShared%2520Documents%252FActivos%2520-%2520Archivos%2520Disciplina)

**********************************************************************************************

# :link: [Matriz RASCI Unificada](https://telefonicacorp.sharepoint.com/:x:/s/Squad-DevOps.TMHCR/EWujynncbyxEsJcj9-x5DhIBoTrhgJxpgJ0QKA9d9n6gpQ?e=6MM1N0)

***************************************************************************************************

# Métricas:

***************************************************************************************************

**Versiones del documento :**

| Versión | Fecha entrada en vigencia | Fecha fin de vigencia | Cambios realizados | Responsable de definición de cambios |
| ------ | ------ | ------ | ------ |------ |
| 3.0 | 14/06/2021 |  | Se agrega link hacia matriz RASCI Unificada y se quita la matriz de la página | Sergio Di Carlo |
| 2.0 | 31/03/2021 | 13/06/2021 | Se agrega matriz RASCI de la práctica | Sergio Di Carlo |
| 1.0 | 23/03/2021 | 30/03/2021 | Versión inicial del documento | Sergio Di Carlo |


text:
package com.github.sdedwards.m2e_nar;

import static org.junit.Assert.assertTrue;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
import org.junit.Test;

public class It0001Test extends AbstractTestBuild {

	@Test
	public void build() throws CoreException, InterruptedException {
		final String projectPath = itPath + "/it0001-executable";
		final String buildArtifact = "nar-executable/it0001-executable";

		IProject project = buildProject(projectPath);
		assertTrue(project.exists(Path.fromOSString(buildArtifact)));
	}
}


text:
<?php

/*
 * This file is part of php-cache organization.
 *
 * (c) 2015-2016 Aaron Scherer <aequasi@gmail.com>, Tobias Nyholm <tobias.nyholm@gmail.com>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace Cache\Adapter\Filesystem;

use Cache\Adapter\Common\AbstractCachePool;
use Cache\Adapter\Common\Exception\InvalidArgumentException;
use Cache\Taggable\TaggableItemInterface;
use Cache\Taggable\TaggablePoolInterface;
use Cache\Taggable\TaggablePoolTrait;
use League\Flysystem\FileExistsException;
use League\Flysystem\FileNotFoundException;
use League\Flysystem\Filesystem;
use Psr\Cache\CacheItemInterface;

/**
 * @author Tobias Nyholm <tobias.nyholm@gmail.com>
 */
class FilesystemCachePool extends AbstractCachePool implements TaggablePoolInterface
{
    use TaggablePoolTrait;

    /**
     * @type Filesystem
     */
    private $filesystem;

    /**
     * The folder should not begin nor end with a slash. Example: path/to/cache.
     *
     * @type string
     */
    private $folder;

    /**
     * @param Filesystem $filesystem
     * @param string     $folder
     */
    public function __construct(Filesystem $filesystem, $folder = 'cache')
    {
        $this->folder = $folder;

        $this->filesystem = $filesystem;
        $this->filesystem->createDir($this->folder);
    }

    /**
     * @param string $folder
     */
    public function setFolder($folder)
    {
        $this->folder = $folder;
    }

    /**
     * {@inheritdoc}
     */
    protected function fetchObjectFromCache($key)
    {
        $empty = [false, null, []];
        $file  = $this->getFilePath($key);

        try {
            $data = @unserialize($this->filesystem->read($file));
            if ($data === false) {
                return $empty;
            }
        } catch (FileNotFoundException $e) {
            return $empty;
        }

        if ($data[0] !== null && time() > $data[0]) {
            foreach ($data[2] as $tag) {
                $this->removeListItem($this->getTagKey($tag), $key);
            }
            $this->forceClear($key);

            return $empty;
        }

        return [true, $data[1], $data[2]];
    }

    /**
     * {@inheritdoc}
     */
    protected function clearAllObjectsFromCache()
    {
        $this->filesystem->deleteDir($this->folder);
        $this->filesystem->createDir($this->folder);

        return true;
    }

    /**
     * {@inheritdoc}
     */
    protected function clearOneObjectFromCache($key)
    {
        $this->preRemoveItem($key);

        return $this->forceClear($key);
    }

    /**
     * {@inheritdoc}
     */
    protected function storeItemInCache(CacheItemInterface $item, $ttl)
    {
        $tags = [];
        if ($item instanceof TaggableItemInterface) {
            $tags = $item->getTags();
        }

        $data = serialize(
            [
                ($ttl === null ? null : time() + $ttl),
                $item->get(),
                $tags,
            ]
        );

        $file = $this->getFilePath($item->getKey());
        if ($this->filesystem->has($file)) {
            // Update file if it exists
            return $this->filesystem->update($file, $data);
        }

        try {
            return $this->filesystem->write($file, $data);
        } catch (FileExistsException $e) {
            // To handle issues when/if race conditions occurs, we try to update here.
            return $this->filesystem->update($file, $data);
        }
    }

    /**
     * @param string $key
     *
     * @throws InvalidArgumentException
     *
     * @return string
     */
    private function getFilePath($key)
    {
        if (!preg_match('|^[a-zA-Z0-9_\.! ]+$|', $key)) {
            throw new InvalidArgumentException(sprintf('Invalid key "%s". Valid filenames must match [a-zA-Z0-9_\.! ].', $key));
        }

        return sprintf('%s/%s', $this->folder, $key);
    }

    /**
     * {@inheritdoc}
     */
    public function save(CacheItemInterface $item)
    {
        if ($item instanceof TaggableItemInterface) {
            $this->saveTags($item);
        }

        return parent::save($item);
    }

    /**
     * {@inheritdoc}
     */
    protected function getList($name)
    {
        $file = $this->getFilePath($name);

        if (!$this->filesystem->has($file)) {
            $this->filesystem->write($file, serialize([]));
        }

        return unserialize($this->filesystem->read($file));
    }

    /**
     * {@inheritdoc}
     */
    protected function removeList($name)
    {
        $file = $this->getFilePath($name);
        $this->filesystem->delete($file);
    }

    /**
     * {@inheritdoc}
     */
    protected function appendListItem($name, $key)
    {
        $list   = $this->getList($name);
        $list[] = $key;

        return $this->filesystem->update($this->getFilePath($name), serialize($list));
    }

    /**
     * {@inheritdoc}
     */
    protected function removeListItem($name, $key)
    {
        $list = $this->getList($name);
        foreach ($list as $i => $item) {
            if ($item === $key) {
                unset($list[$i]);
            }
        }

        return $this->filesystem->update($this->getFilePath($name), serialize($list));
    }

    /**
     * @param $key
     *
     * @return bool
     */
    private function forceClear($key)
    {
        try {
            return $this->filesystem->delete($this->getFilePath($key));
        } catch (FileNotFoundException $e) {
            return true;
        }
    }
}


text:
namespace Zh.Framework.Test.DAL
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;
    using System.Data.Entity.Spatial;

    public partial class IM_Msg
    {
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public IM_Msg()
        {
            IM_MsgFileElem = new HashSet<IM_MsgFileElem>();
            IM_MsgCustomElem = new HashSet<IM_MsgCustomElem>();
            IM_MsgFaceElem = new HashSet<IM_MsgFaceElem>();
            IM_MsgImageElem = new HashSet<IM_MsgImageElem>();
            IM_MsgLocationElem = new HashSet<IM_MsgLocationElem>();
            IM_MsgSoundElem = new HashSet<IM_MsgSoundElem>();
            IM_MsgTextElem = new HashSet<IM_MsgTextElem>();
        }

        public int ID { get; set; }

        public DateTime CreatedDate { get; set; }

        [StringLength(32)]
        public string FromAccount { get; set; }

        [StringLength(32)]
        public string ToAccount { get; set; }

        [StringLength(32)]
        public string GroupId { get; set; }

        [StringLength(16)]
        public string ChatType { get; set; }

        [StringLength(32)]
        public string MsgSeq { get; set; }

        [StringLength(32)]
        public string MsgRandom { get; set; }

        public string MsgBody { get; set; }

        public int? LiveVideoId { get; set; }

        public DateTime MsgTimestamp { get; set; }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<IM_MsgFileElem> IM_MsgFileElem { get; set; }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<IM_MsgCustomElem> IM_MsgCustomElem { get; set; }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<IM_MsgFaceElem> IM_MsgFaceElem { get; set; }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<IM_MsgImageElem> IM_MsgImageElem { get; set; }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<IM_MsgLocationElem> IM_MsgLocationElem { get; set; }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<IM_MsgSoundElem> IM_MsgSoundElem { get; set; }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<IM_MsgTextElem> IM_MsgTextElem { get; set; }
    }
}


text:
// This file has been automatically generated, DO NOT EDIT

package org.apache.lucene.util.packed;

/**
 * Efficient sequential read/write of packed integers.
 */
final class BulkOperationPacked8 extends BulkOperationPacked {

  public BulkOperationPacked8() {
    super(8);
    assert blockCount() == 1;
    assert valueCount() == 8;
  }

  @Override
  public void decode(long[] blocks, int blocksOffset, int[] values, int valuesOffset, int iterations) {
    for (int i = 0; i < iterations; ++i) {
      final long block = blocks[blocksOffset++];
      for (int shift = 56; shift >= 0; shift -= 8) {
        values[valuesOffset++] = (int) ((block >>> shift) & 255);
      }
    }
  }

  @Override
  public void decode(byte[] blocks, int blocksOffset, int[] values, int valuesOffset, int iterations) {
    for (int j = 0; j < 8 * iterations; ++j) {
      values[valuesOffset++] = blocks[blocksOffset++] & 0xFF;
    }
  }

  @Override
  public void decode(long[] blocks, int blocksOffset, long[] values, int valuesOffset, int iterations) {
    for (int i = 0; i < iterations; ++i) {
      final long block = blocks[blocksOffset++];
      for (int shift = 56; shift >= 0; shift -= 8) {
        values[valuesOffset++] = (block >>> shift) & 255;
      }
    }
  }

  @Override
  public void decode(byte[] blocks, int blocksOffset, long[] values, int valuesOffset, int iterations) {
    for (int j = 0; j < 8 * iterations; ++j) {
      values[valuesOffset++] = blocks[blocksOffset++] & 0xFF;
    }
  }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="RAY suite" verbose="2">
    <test name = "RAY test">
        <packages>
            <package name = "org.ray.api.test.*" />
            <package name = "org.ray.runtime.*" />
        </packages>
    </test>
    <listeners>
        <listener class-name="org.ray.api.RayAlterSuiteListener" />
        <listener class-name="org.ray.api.TestProgressListener" />
    </listeners>
</suite>


text:
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { Helmet } from "react-helmet";
import t from './_lang.json';

export class ServicesPage extends Component {
  render() {
    let { lang } = this.props;

    return (

        <Helmet>
          <title>{t[lang.id].title}</title>
        </Helmet>

{t[lang.id].title}

    )
  }
}

ServicesPage.propTypes = {
  lang: PropTypes.object.isRequired
};

function mapStateToProps(state) {
  return {
    lang: state.lang
  };
}

export default connect(mapStateToProps)(ServicesPage);


text:
#include <grpc++/channel.h>
#include <grpc++/client_context.h>
#include <grpc++/create_channel.h>
#include <grpc++/server.h>
#include <grpc++/server_builder.h>
#include <grpc++/server_context.h>
#include <grpc++/server_credentials.h>
#include <gtest/gtest.h>

#include "examples/pubsub/publisher.h"
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"

using grpc::Channel;

namespace grpc {
namespace testing {
namespace {

const char kProjectId[] = "project id";
const char kTopic[] = "test topic";
const char kMessageData[] = "test message data";

class PublisherServiceImpl : public tech::pubsub::PublisherService::Service {
 public:
  Status CreateTopic(::grpc::ServerContext* context,
                     const ::tech::pubsub::Topic* request,
                     ::tech::pubsub::Topic* response) GRPC_OVERRIDE {
    EXPECT_EQ(request->name(), kTopic);
    return Status::OK;
  }

  Status Publish(ServerContext* context,
                 const ::tech::pubsub::PublishRequest* request,
                 ::proto2::Empty* response) GRPC_OVERRIDE {
    EXPECT_EQ(request->message().data(), kMessageData);
    return Status::OK;
  }

  Status GetTopic(ServerContext* context,
                  const ::tech::pubsub::GetTopicRequest* request,
                  ::tech::pubsub::Topic* response) GRPC_OVERRIDE {
    EXPECT_EQ(request->topic(), kTopic);
    return Status::OK;
  }

  Status ListTopics(
      ServerContext* context, const ::tech::pubsub::ListTopicsRequest* request,
      ::tech::pubsub::ListTopicsResponse* response) GRPC_OVERRIDE {
    std::ostringstream ss;
    ss << "cloud.googleapis.com/project in (/projects/" << kProjectId << ")";
    EXPECT_EQ(request->query(), ss.str());
    response->add_topic()->set_name(kTopic);
    return Status::OK;
  }

  Status DeleteTopic(ServerContext* context,
                     const ::tech::pubsub::DeleteTopicRequest* request,
                     ::proto2::Empty* response) GRPC_OVERRIDE {
    EXPECT_EQ(request->topic(), kTopic);
    return Status::OK;
  }
};

class PublisherTest : public ::testing::Test {
 protected:
  // Setup a server and a client for PublisherService.
  void SetUp() GRPC_OVERRIDE {
    int port = grpc_pick_unused_port_or_die();
    server_address_ << "localhost:" << port;
    ServerBuilder builder;
    builder.AddListeningPort(server_address_.str(),
                             grpc::InsecureServerCredentials());
    builder.RegisterService(&service_);
    server_ = builder.BuildAndStart();

    channel_ = CreateChannel(server_address_.str(), grpc::InsecureCredentials(),
                             ChannelArguments());

    publisher_.reset(new grpc::examples::pubsub::Publisher(channel_));
  }

  void TearDown() GRPC_OVERRIDE {
    server_->Shutdown();
    publisher_->Shutdown();
  }

  std::ostringstream server_address_;
  std::unique_ptr<Server> server_;
  PublisherServiceImpl service_;

  std::shared_ptr<Channel> channel_;

  std::unique_ptr<grpc::examples::pubsub::Publisher> publisher_;
};

TEST_F(PublisherTest, TestPublisher) {
  EXPECT_TRUE(publisher_->CreateTopic(kTopic).IsOk());

  EXPECT_TRUE(publisher_->Publish(kTopic, kMessageData).IsOk());

  EXPECT_TRUE(publisher_->GetTopic(kTopic).IsOk());

  std::vector<grpc::string> topics;
  EXPECT_TRUE(publisher_->ListTopics(kProjectId, &topics).IsOk());
  EXPECT_EQ(topics.size(), static_cast<size_t>(1));
  EXPECT_EQ(topics[0], kTopic);
}

}  // namespace
}  // namespace testing
}  // namespace grpc

int main(int argc, char** argv) {
  grpc_test_init(argc, argv);
  ::testing::InitGoogleTest(&argc, argv);
  gpr_log(GPR_INFO, "Start test ...");
  int result = RUN_ALL_TESTS();
  return result;
}


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/devtools/cloudtrace/v1/trace.proto

package com.google.devtools.cloudtrace.v1;

public interface GetTraceRequestOrBuilder
    extends
    // @@protoc_insertion_point(interface_extends:google.devtools.cloudtrace.v1.GetTraceRequest)
    com.google.protobuf.MessageOrBuilder {

  /**
   *
   *
   *

   * ID of the Cloud project where the trace data is stored.
   *

   *
   * string project_id = 1;
   */
  java.lang.String getProjectId();
  /**
   *
   *
   *

   * ID of the Cloud project where the trace data is stored.
   *

   *
   * string project_id = 1;
   */
  com.google.protobuf.ByteString getProjectIdBytes();

  /**
   *
   *
   *

   * ID of the trace to return.
   *

   *
   * string trace_id = 2;
   */
  java.lang.String getTraceId();
  /**
   *
   *
   *

   * ID of the trace to return.
   *

   *
   * string trace_id = 2;
   */
  com.google.protobuf.ByteString getTraceIdBytes();
}


text:
 #define _WINNER_SCENE_H_

 class WinnerLayer : public CCLayerColor
 {
	public:

		CREATE_FUNC (WinnerLayer);

		CC_SYNTHESIZE_READONLY ( CCLabelTTF*, m_pLabel, Label );

	protected :

				 WinnerLayer ( );
		virtual ~WinnerLayer ( );

	public:

		KDbool			init ( KDvoid );

		KDvoid			ExplosionAnimation ( CCPoint position, const KDchar* szImgName );

		KDvoid			WinnerDone ( KDvoid );

};

class WinnerScene : public CCScene
{
	public:

		CREATE_FUNC ( WinnerScene );
		CC_SYNTHESIZE_READONLY ( WinnerLayer*, m_pLayer, Layer );

						 WinnerScene ( );
		virtual			~WinnerScene ( );

		KDbool			init ( KDvoid );

};

#endif // _GAME_OVER_SCENE_H_


text:
<?php
namespace lo\shortcodes\bootstrap\widgets;

/**
 * Class Container
 * @package lo\shortcodes\bootstrap\widgets
 * @author Lukyanov Andrey <loveorigami@mail.ru>
 */
class Container extends BootstrapWidget
{
    /** @var bool */
    public $fluid;

    /**
     * init widget
     */
    public function init()
    {
        $this->options = [
            'class' => $this->fluid ? 'container-fluid' : 'container'
        ];
        parent::init();
    }
}


text:
@interface CKUserDetailsViewController : UIViewController

@property (nonatomic, strong) CKIClient *client;
@property (weak, nonatomic) IBOutlet UIImageView *profileImageView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *descriptionLabel;

- (IBAction)logoutUser:(id)sender;
- (IBAction)viewTodoItems:(id)sender;

@end


text:
/*global angular */

app.factory('Config', ['$http', function ($http) {
    $http.get('config.json').then(function (response) {
        angular.extend(this, response.data);
    }.bind(this));
    return this;
}]);

app.factory('Model', [function () {
    function Model(data) {
        // Extend instance with data
        data ? angular.extend(this, data) : null;
    }
    Model.prototype = {
        toString: function () {
            return "Model";
        },
    };
    return Model;
}]);


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Hedwigia 51(4): 319 (1912)

#### Original name
Hexagonia cladophora Berk., 1877

### Remarks
null


text:
using _05.DataBindingHomework.Models.Cars;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace _05.DataBindingHomework.Data
{
    public class CarDb
    {
        public static List<Producer> GetProducers()
        {
            List<Producer> producers = new List<Producer>();

            Producer bmw = new Producer("BMW");

            bmw.Models.Add("320");
            bmw.Models.Add("325");
            bmw.Models.Add("330");
            bmw.Models.Add("530");
            bmw.Models.Add("550");
            bmw.Models.Add("5GT");
            bmw.Models.Add("740");
            bmw.Models.Add("850");
            bmw.Models.Add("Z8");

            producers.Add(bmw);

            Producer mercedes = new Producer("Mercedes");

            mercedes.Models.Add("C200");
            mercedes.Models.Add("C220");
            mercedes.Models.Add("E350");
            mercedes.Models.Add("E400");
            mercedes.Models.Add("GLA220");
            mercedes.Models.Add("S400");
            mercedes.Models.Add("S450");
            mercedes.Models.Add("S500");
            mercedes.Models.Add("SL60AMG");

            producers.Add(mercedes);

            Producer audi = new Producer("Audi");
            audi.Models.Add("A1");
            audi.Models.Add("A2");
            audi.Models.Add("A3");
            audi.Models.Add("A4");
            audi.Models.Add("A5");
            audi.Models.Add("A6");
            audi.Models.Add("A7");
            audi.Models.Add("S5");
            audi.Models.Add("S8");
            audi.Models.Add("TT");

            producers.Add(audi);

            return producers;
        }
        public static List<Extra> GetExtras()
        {
            List<Extra> extars = new List<Extra>();
            extars.Add(new Extra("Auto Start Stop function"));
            extars.Add(new Extra("Bluetooth \\ handsfree система"));
            extars.Add(new Extra("Steptronic, Tiptronic"));
            extars.Add(new Extra("Блокаж на диференциала"));
            extars.Add(new Extra("Бордкомпютър"));
            extars.Add(new Extra("Датчик за светлина"));
            extars.Add(new Extra("Ел.Огледала"));
            extars.Add(new Extra("Ел.Стъкла"));
            extars.Add(new Extra("Ел.регулиране на седалките"));
            extars.Add(new Extra("Ел.усилвател на волана"));
            extars.Add(new Extra("Климатроник"));
            extars.Add(new Extra("Мултифункционален волан"));
            extars.Add(new Extra("Навигация"));
            extars.Add(new Extra("Печка"));
            extars.Add(new Extra("Подгряване на предното стъкло"));
            extars.Add(new Extra("Подгряване на седалките"));
            extars.Add(new Extra("Регулиране на волана"));
            extars.Add(new Extra("Сензор за дъжд"));
            extars.Add(new Extra("Серво усилвател на волана"));
            extars.Add(new Extra("Система за контрол на скоростта -автопилот"));
            extars.Add(new Extra("Филтър за твърди частици"));

            return extars;
        }

        public static string[] GetEngineType()
        {
            string[] engineTypes = { "Дизел", "Бензин", "Хибрид", "Електрически", "Всички типове" };

            return engineTypes;
        }
    }
}


text:
export default Ember.Route.extend({
  model: function() {
    var links = [
        'show-the-box',
        'color-swatches',
        'component-test',
        'helper-test'
        ];

    return links;
  }
});


text:
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

/**
 * file index.php
 * index page to view blogs. if no blog is specified then site wide entries are shown
 * if a blog id is specified then the latest entries from that blog are shown
 */

require_once(dirname(dirname(__FILE__)).'/config.php');
require_once($CFG->dirroot .'/blog/lib.php');
require_once($CFG->dirroot .'/blog/locallib.php');
require_once($CFG->dirroot .'/course/lib.php');
require_once($CFG->dirroot .'/tag/lib.php');
require_once($CFG->dirroot .'/comment/lib.php');

$id       = optional_param('id', null, PARAM_INT);
$start    = optional_param('formstart', 0, PARAM_INT);
$tag      = optional_param('tag', '', PARAM_NOTAGS);
$userid   = optional_param('userid', null, PARAM_INT);
$tagid    = optional_param('tagid', null, PARAM_INT);
$modid    = optional_param('modid', null, PARAM_INT);
$entryid  = optional_param('entryid', null, PARAM_INT);
$groupid  = optional_param('groupid', null, PARAM_INT);
$courseid = optional_param('courseid', null, PARAM_INT);
$search   = optional_param('search', null, PARAM_RAW);

comment::init();

$url_params = compact('id', 'start', 'tag', 'userid', 'tagid', 'modid', 'entryid', 'groupid', 'courseid', 'search');
foreach ($url_params as $var => $val) {
    if (empty($val)) {
        unset($url_params[$var]);
    }
}
$PAGE->set_url('/blog/index.php', $url_params);

// Correct tagid if a text tag is provided as a param.
if (!empty($tag)) {
    if ($tagrec = $DB->get_record('tag', array('name' => $tag))) {
        $tagid = $tagrec->id;
    } else {
        unset($tagid);
    }
}

// Set the userid to the entry author if we have the entry ID.
if ($entryid and !isset($userid)) {
    $entry = new blog_entry($entryid);
    $userid = $entry->userid;
}

if (isset($userid) && empty($courseid)) {
    $context = context_user::instance($userid);
} else if (!empty($courseid) && $courseid != SITEID) {
    $context = context_course::instance($courseid);
} else {
    $context = context_system::instance();
}
$PAGE->set_context($context);

$sitecontext = context_system::instance();

if (isset($userid) && $USER->id == $userid) {
    $blognode = $PAGE->navigation->find('siteblog', null);
    if ($blognode) {
        $blognode->make_inactive();
    }
}

// Check basic permissions.
if ($CFG->bloglevel == BLOG_GLOBAL_LEVEL) {
    // Everybody can see anything - no login required unless site is locked down using forcelogin.
    if ($CFG->forcelogin) {
        require_login();
    }

} else if ($CFG->bloglevel == BLOG_SITE_LEVEL) {
    // Users must log in and can not be guests.
    require_login();
    if (isguestuser()) {
        // They must have entered the url manually.
        print_error('blogdisable', 'blog');
    }

} else if ($CFG->bloglevel == BLOG_USER_LEVEL) {
    // Users can see own blogs only! with the exception of people with special cap.
    require_login();

} else {
    // Weird!
    print_error('blogdisable', 'blog');
}

if (empty($CFG->enableblogs)) {
    print_error('blogdisable', 'blog');
}

// Add courseid if modid or groupid is specified: This is used for navigation and title.
if (!empty($modid) && empty($courseid)) {
    $courseid = $DB->get_field('course_modules', 'course', array('id' => $modid));
}

if (!empty($groupid) && empty($courseid)) {
    $courseid = $DB->get_field('groups', 'courseid', array('id' => $groupid));
}

if (!$userid && has_capability('moodle/blog:view', $sitecontext) && $CFG->bloglevel > BLOG_USER_LEVEL) {
    if ($entryid) {
        if (!$entryobject = $DB->get_record('post', array('id'=>$entryid))) {
            print_error('nosuchentry', 'blog');
        }
        $userid = $entryobject->userid;
    }
} else if (!$userid) {
    $userid = $USER->id;
}

if (!empty($modid)) {
    if ($CFG->bloglevel < BLOG_SITE_LEVEL) {
        print_error(get_string('nocourseblogs', 'blog'));
    }
    if (!$mod = $DB->get_record('course_modules', array('id' => $modid))) {
        print_error(get_string('invalidmodid', 'blog'));
    }
    $courseid = $mod->course;
}

if ((empty($courseid) ? true : $courseid == SITEID) && empty($userid)) {
    if ($CFG->bloglevel < BLOG_SITE_LEVEL) {
        print_error('siteblogdisable', 'blog');
    }
    if (!has_capability('moodle/blog:view', $sitecontext)) {
        print_error('cannotviewsiteblog', 'blog');
    }

    $COURSE = $DB->get_record('course', array('format'=>'site'));
    $courseid = $COURSE->id;
}

if (!empty($courseid)) {
    if (!$course = $DB->get_record('course', array('id'=>$courseid))) {
        print_error('invalidcourseid');
    }

    $courseid = $course->id;
    require_login($course);

    if (!has_capability('moodle/blog:view', $sitecontext)) {
        print_error('cannotviewcourseblog', 'blog');
    }
} else {
    $coursecontext = context_course::instance(SITEID);
}

if (!empty($groupid)) {
    if ($CFG->bloglevel < BLOG_SITE_LEVEL) {
        print_error('groupblogdisable', 'blog');
    }

    if (! $group = groups_get_group($groupid)) {
        print_error(get_string('invalidgroupid', 'blog'));
    }

    if (!$course = $DB->get_record('course', array('id'=>$group->courseid))) {
        print_error('invalidcourseid');
    }

    $coursecontext = context_course::instance($course->id);
    $courseid = $course->id;
    require_login($course);

    if (!has_capability('moodle/blog:view', $sitecontext)) {
        print_error(get_string('cannotviewcourseorgroupblog', 'blog'));
    }

    if (groups_get_course_groupmode($course) == SEPARATEGROUPS && !has_capability('moodle/site:accessallgroups', $coursecontext)) {
        if (!groups_is_member($groupid)) {
            print_error('notmemberofgroup');
        }
    }
}

if (!empty($userid)) {
    if ($CFG->bloglevel < BLOG_USER_LEVEL) {
        print_error('blogdisable', 'blog');
    }

    if (!$user = $DB->get_record('user', array('id'=>$userid))) {
        print_error('invaliduserid');
    }

    if ($user->deleted) {
        echo $OUTPUT->header();
        echo $OUTPUT->heading(get_string('userdeleted'));
        echo $OUTPUT->footer();
        die;
    }

    if ($USER->id == $userid) {
        if (!has_capability('moodle/blog:create', $sitecontext)
          && !has_capability('moodle/blog:view', $sitecontext)) {
            print_error('donothaveblog', 'blog');
        }
    } else {
        if (!has_capability('moodle/blog:view', $sitecontext) || !blog_user_can_view_user_entry($userid)) {
            print_error('cannotviewcourseblog', 'blog');
        }

        $PAGE->navigation->extend_for_user($user);
    }
}

$courseid = (empty($courseid)) ? SITEID : $courseid;

$blogheaders = blog_get_headers();

if ($CFG->enablerssfeeds) {
    $rsscontext = null;
    $filtertype = null;
    $thingid = null;
    list($thingid, $rsscontext, $filtertype) = blog_rss_get_params($blogheaders['filters']);
    if (empty($rsscontext)) {
        $rsscontext = context_system::instance();
    }
    $rsstitle = $blogheaders['heading'];

    // Check we haven't started output by outputting an error message.
    if ($PAGE->state == moodle_page::STATE_BEFORE_HEADER) {
        blog_rss_add_http_header($rsscontext, $rsstitle, $filtertype, $thingid, $tagid);
    }
}

$usernode = $PAGE->navigation->find('user'.$userid, null);
if ($usernode && $courseid != SITEID) {
    $courseblogsnode = $PAGE->navigation->find('courseblogs', null);
    if ($courseblogsnode) {
        $courseblogsnode->remove();
    }
    $blogurl = new moodle_url($PAGE->url);
    $blognode = $usernode->add(get_string('blogscourse', 'blog'), $blogurl);
    $blognode->make_active();
}

if ($courseid != SITEID) {
    $PAGE->set_heading($course->fullname);
    echo $OUTPUT->header();
    if (!empty($user)) {
        $headerinfo = array('heading' => fullname($user), 'user' => $user);
        echo $OUTPUT->context_header($headerinfo, 2);
    }
} else if (isset($userid)) {
    $PAGE->set_heading(fullname($user));
    echo $OUTPUT->header();
} else if ($courseid == SITEID) {
    echo $OUTPUT->header();
}

echo $OUTPUT->heading($blogheaders['heading'], 2);

$bloglisting = new blog_listing($blogheaders['filters']);
$bloglisting->print_entries();

echo $OUTPUT->footer();
$eventparams = array(
    'other' => array('entryid' => $entryid, 'tagid' => $tagid, 'userid' => $userid, 'modid' => $modid, 'groupid' => $groupid,
                     'search' => $search, 'fromstart' => $start)
);
if (!empty($userid)) {
    $eventparams['relateduserid'] = $userid;
}
$eventparams['other']['courseid'] = ($courseid === SITEID) ? 0 : $courseid;
$event = \core\event\blog_entries_viewed::create($eventparams);
$event->trigger();


text:
<?php namespace App\Policies;

use Illuminate\Auth\Access\HandlesAuthorization;
use Session;
use App\Exceptions\Exception;
use Auth;

abstract class Policy
{
    use HandlesAuthorization;

    public $model;
    public $currentUser;

    public function __construct(Auth $auth)
        {
            $this->currentUser = auth()->user();
        }

    public function checkAuthor($model)
        {
            logger()->info(__METHOD__);
            if($this->currentUser->id != $model->user_id)
                {
                    throw new \Exception('User wrong author');
                }
            return true;
        }

    public function checkType($type)
        {
            logger()->info(__METHOD__);
            if($this->currentUser->type != $type)
                {
                    throw new \Exception('User wrong type');
                }
            return true;
        }

    public function checkGroup($group)
        {
            logger()->info(__METHOD__);
            if($this->currentUser->whereHas('join_groups', function($query) use($group) {
                $query->where('group_id', $group->id);
            })->get())
                {
                    throw new \Exception('User wrong type');
                }
            return true;
        }

}


text:
/*==========================================================
 GULP: APP TASKS :: Browser sync to sync with browser
===========================================================*/
var gulp = require('gulp'),
    browserSync = require('browser-sync');

var config = require('./config');

gulp.task('browser-sync', function () {
    browserSync.init([config.build.root + '*/*.*', config.build.root + '**/*.*'],
    {
        server : { baseDir : './build' }
    });
});


text:
namespace blink {

// Suppress warning: global constructors, because struct WrapperTypeInfo is trivial
// and does not depend on another global objects.
#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wglobal-constructors"
#endif

const WrapperTypeInfo V8External::wrapperTypeInfo = { gin::kEmbedderBlink, V8External::domTemplate, V8External::refObject, V8External::derefObject, V8External::trace, nullptr, 0, V8External::preparePrototypeObject, V8External::installConditionallyEnabledProperties, "External", nullptr, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::ObjectClassId, WrapperTypeInfo::InheritFromEventTarget, WrapperTypeInfo::Dependent, WrapperTypeInfo::GarbageCollectedObject };

#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
#pragma clang diagnostic pop
#endif

// This static member must be declared by DEFINE_WRAPPERTYPEINFO in External.h.
// For details, see the comment of DEFINE_WRAPPERTYPEINFO in
// bindings/core/v8/ScriptWrappable.h.
const WrapperTypeInfo& External::s_wrapperTypeInfo = V8External::wrapperTypeInfo;

// not [ActiveScriptWrappable]
// static_assert(
//     !std::is_base_of<ActiveScriptWrappableBase, External>::value,
//     "External inherits from ActiveScriptWrappable<>, but is not specifying "
//     "[ActiveScriptWrappable] extended attribute in the IDL file.  "
//     "Be consistent.");
// static_assert(
//     std::is_same<decltype(&External::hasPendingActivity),
//                  decltype(&ScriptWrappable::hasPendingActivity)>::value,
//     "External is overriding hasPendingActivity(), but is not specifying "
//     "[ActiveScriptWrappable] extended attribute in the IDL file.  "
//     "Be consistent.");

External* V8External::toImpl(v8::Local<v8::Object> object)
{
    return toScriptWrappable(object)->toImpl<External>();
}

namespace ExternalV8Internal {

static void AddSearchProviderMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    External* impl = V8External::toImpl(info.Holder());

    impl->AddSearchProvider();
}

CORE_EXPORT  void AddSearchProviderMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    ExternalV8Internal::AddSearchProviderMethod(info);
}

static void IsSearchProviderInstalledMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    External* impl = V8External::toImpl(info.Holder());
    impl->IsSearchProviderInstalled();
}

CORE_EXPORT  void IsSearchProviderInstalledMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    ExternalV8Internal::IsSearchProviderInstalledMethod(info);
}

} // namespace ExternalV8Internal

const V8DOMConfiguration::MethodConfiguration V8ExternalMethods[] = {
    {"AddSearchProvider", ExternalV8Internal::AddSearchProviderMethodCallback,0, 1, V8DOMConfiguration::ExposedToAllScripts},
    {"IsSearchProviderInstalled", ExternalV8Internal::IsSearchProviderInstalledMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts},
};

static void installV8ExternalTemplate(v8::Local<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate)
{
    // Initialize the interface object's template.
    v8::Local<v8::Signature> defaultSignature;
    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, functionTemplate, "External", v8::Local<v8::FunctionTemplate>(), V8External::internalFieldCount,
        0, 0,
        nullptr, 0,
        V8ExternalMethods, WTF_ARRAY_LENGTH(V8ExternalMethods));
    //functionTemplate->SetCallHandler(V8FileReader::constructorCallback);
    //functionTemplate->SetLength(0);
    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
    ALLOW_UNUSED_LOCAL(instanceTemplate);
    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
    ALLOW_UNUSED_LOCAL(prototypeTemplate);

    // Custom toString template
    functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::from(isolate)->toStringTemplate());
}

v8::Local<v8::FunctionTemplate> V8External::domTemplate(v8::Isolate* isolate)
{
    return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), installV8ExternalTemplate);
}

bool V8External::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolate)
{
    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value);
}

External* V8External::toImplWithTypeCheck(v8::Isolate* isolate, v8::Local<v8::Value> value)
{
    return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(value)) : 0;
}

void V8External::refObject(ScriptWrappable* scriptWrappable)
{
}

void V8External::derefObject(ScriptWrappable* scriptWrappable)
{
}

}  // namespace blink


text:
package com.internetitem.test.web.requestInfo;

import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;

import org.glassfish.hk2.api.Factory;
import org.glassfish.hk2.api.ServiceLocator;
import org.glassfish.jersey.server.internal.inject.AbstractContainerRequestValueFactory;
import org.glassfish.jersey.server.internal.inject.AbstractValueFactoryProvider;
import org.glassfish.jersey.server.internal.inject.MultivaluedParameterExtractorProvider;
import org.glassfish.jersey.server.internal.inject.ParamInjectionResolver;
import org.glassfish.jersey.server.model.Parameter;

public class RequestInfoFactoryProvider extends AbstractValueFactoryProvider {

	@Inject
	private HttpServletRequest request;

	@Inject
	public RequestInfoFactoryProvider(MultivaluedParameterExtractorProvider mpep, ServiceLocator injector) {
		super(mpep, injector, Parameter.Source.UNKNOWN);
	}

	@Override
	protected Factory<?> createValueFactory(Parameter parameter) {
		Class<?> classType = parameter.getRawType();

		if (classType == null || (!classType.equals(RequestInfo.class))) {
			return null;
		}

		return new AbstractContainerRequestValueFactory<RequestInfo>() {
			@Override
			public RequestInfo provide() {
				return new RequestInfo(request.getRemoteUser(), request.getRemoteHost());
			}
		};
	}

	public static class RemoteInfoInjectonResolver extends ParamInjectionResolver<RemoteInfo> {

		public RemoteInfoInjectonResolver() {
			super(RequestInfoFactoryProvider.class);
		}

	}
}


text:
package com.yjl.javabase.thinkinjava.interfaces.interfaceprocessor;

public interface Processor {
  String name();
  Object process(Object input);
} ///:~


text:
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;

namespace MvvmToolkit.Uwp.Controls
{
    public delegate void ListViewEdgeTappedEventHandler(ListView sender, EdgeTappedListViewEventArgs e);

    public class EdgeTappedListView : ListView
    {
        #region IsItemLeftEdgeTapEnabled property

        public static readonly DependencyProperty IsItemLeftEdgeTapEnabledProperty =
            DependencyProperty.Register(
                "IsItemLeftEdgeTapEnabled",
                typeof(bool),
                typeof(EdgeTappedListView),
                new PropertyMetadata(default(bool), IsItemLeftEdgeTapEnabledChanged));

        private static void IsItemLeftEdgeTapEnabledChanged(
            DependencyObject d, DependencyPropertyChangedEventArgs args)
        {
            var listView = (EdgeTappedListView) d;
            var enabled = (bool) args.NewValue;
            if (enabled)
            {
                listView.TryRestoreSelectionMode();
            }
            else
            {
                listView.EnableMultiSelection();
            }
        }

        private bool _isSelectionModeChanging;

        private void EnableMultiSelection()
        {
            SaveSelectionMode();

            _isSelectionModeChanging = true;
            SelectionMode = ListViewSelectionMode.Multiple;
            _isSelectionModeChanging = false;
        }

        private ListViewSelectionMode? _savedSelectionMode;

        private void SaveSelectionMode()
        {
            _savedSelectionMode = SelectionMode;
        }

        private void TryRestoreSelectionMode()
        {
            if (_savedSelectionMode.HasValue)
            {
                SelectionMode = _savedSelectionMode.Value;
                _savedSelectionMode = null;
            }
        }

        public bool IsItemLeftEdgeTapEnabled
        {
            get { return (bool) GetValue(IsItemLeftEdgeTapEnabledProperty); }
            set { SetValue(IsItemLeftEdgeTapEnabledProperty, value); }
        }

        #endregion

        public event ItemClickEventHandler ItemClickOnSingleSelection;
        public event ListViewEdgeTappedEventHandler ItemLeftEdgeTapped;

        private ListViewItem _edgeTappedItem;

        public EdgeTappedListView()
        {
            _edgeTappedItem = null;

            ItemClick += OnItemClick;
            SelectionChanged += OnSelectionChanged;
            ContainerContentChanging += OnContainerContentChanging;
        }

        private void OnItemClick(object sender, ItemClickEventArgs e)
        {
            if (SelectionMode == ListViewSelectionMode.Single)
            {
                ItemClickOnSingleSelection?.Invoke(this, e);
            }
        }

        private void OnSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if ((SelectedItems.Count == 0) && !_isSelectionModeChanging)
            {
                IsItemLeftEdgeTapEnabled = true;
            }
        }

        private void OnContainerContentChanging(
            ListViewBase sender, ContainerContentChangingEventArgs e)
        {
            if (e.InRecycleQueue)
            {
                var lvi = (e.ItemContainer as ListViewItem);
                if (lvi != null)
                {
                    var element = VisualTreeHelper.GetChild(lvi, 0) as UIElement;
                    if (element != null)
                    {
                        element.PointerExited -= OnPointerExited;
                        element.PointerPressed -= OnPointerPressed;
                        element.PointerReleased -= OnPointerReleased;
                        element.PointerCaptureLost -= OnPointerCaptureLost;
                    }
                }
            }
            else if (e.Phase == 0)
            {
                var lvi = (e.ItemContainer as ListViewItem);
                if (lvi != null)
                {
                    var element = VisualTreeHelper.GetChild(lvi, 0) as UIElement;
                    if (element != null)
                    {
                        element.PointerExited += OnPointerExited;
                        element.PointerPressed += OnPointerPressed;
                        element.PointerReleased += OnPointerReleased;
                        element.PointerCaptureLost += OnPointerCaptureLost;
                    }
                }
            }
        }

        void OnPointerExited(object sender, PointerRoutedEventArgs e)
        {
            TryEnableMultiSelection();
        }

        private const double HitTarget = 32;
        void OnPointerPressed(object sender, PointerRoutedEventArgs e)
        {
            if (IsItemLeftEdgeTapEnabled)
            {
                if (e.Pointer.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Touch)
                {
                    var element = (sender as UIElement);
                    if (element != null)
                    {
                        var pointerPoint = e.GetCurrentPoint(element);
                        if (pointerPoint.Position.X <= HitTarget)
                        {
                            _edgeTappedItem = VisualTreeHelper.GetParent(element) as ListViewItem;
                        }
                    }
                }
            }
        }

        void OnPointerReleased(object sender, PointerRoutedEventArgs e)
        {
            TryEnableMultiSelection();
        }

        private void OnPointerCaptureLost(object sender, PointerRoutedEventArgs e)
        {
            TryEnableMultiSelection();
        }

        private void TryEnableMultiSelection()
        {
            if (_edgeTappedItem == null)
            {
                return;
            }

            IsItemLeftEdgeTapEnabled = false;
            ItemLeftEdgeTapped?.Invoke(this, new EdgeTappedListViewEventArgs(_edgeTappedItem));

            _edgeTappedItem = null;
        }
    }
}


text:
module Modelize

  def initialize(hsh = {})
    super(*sort_hash(hsh).values)
  end

  def members
    super
  end

   def inspect
    data = attributes.map { |attr| "#{attr}=#{send(attr).inspect}" }
    "#<#{self.class}: #{data.join(', ')}>"
  end

  alias :attributes :members
  alias :to_s       :inspect

  private

  def sort_hash(hsh)
    attrs = attributes
    array = hsh.map { key = attrs.shift; [ key, hsh[key] ] }
    Hash[array]
  end

end