text:
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008-2017. All Rights Reserved.                        */
/* Open Source Software - may be modified and shared by FRC teams. The code   */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project.                                                               */
/*----------------------------------------------------------------------------*/

package edu.wpi.first.wpilibj;

import edu.wpi.first.wpilibj.hal.PowerJNI;

public class ControllerPower {
  /**
   * Get the input voltage to the robot controller.
   *
   * @return The controller input voltage value in Volts
   */
  public static double getInputVoltage() {
    return PowerJNI.getVinVoltage();
  }

  /**
   * Get the input current to the robot controller.
   *
   * @return The controller input current value in Amps
   */
  public static double getInputCurrent() {
    return PowerJNI.getVinCurrent();
  }

  /**
   * Get the voltage of the 3.3V rail.
   *
   * @return The controller 3.3V rail voltage value in Volts
   */
  public static double getVoltage3V3() {
    return PowerJNI.getUserVoltage3V3();
  }

  /**
   * Get the current output of the 3.3V rail.
   *
   * @return The controller 3.3V rail output current value in Volts
   */
  public static double getCurrent3V3() {
    return PowerJNI.getUserCurrent3V3();
  }

  /**
   * Get the enabled state of the 3.3V rail. The rail may be disabled due to a controller brownout,
   * a short circuit on the rail, or controller over-voltage.
   *
   * @return The controller 3.3V rail enabled value
   */
  public static boolean getEnabled3V3() {
    return PowerJNI.getUserActive3V3();
  }

  /**
   * Get the count of the total current faults on the 3.3V rail since the controller has booted.
   *
   * @return The number of faults
   */
  public static int getFaultCount3V3() {
    return PowerJNI.getUserCurrentFaults3V3();
  }

  /**
   * Get the voltage of the 5V rail.
   *
   * @return The controller 5V rail voltage value in Volts
   */
  public static double getVoltage5V() {
    return PowerJNI.getUserVoltage5V();
  }

  /**
   * Get the current output of the 5V rail.
   *
   * @return The controller 5V rail output current value in Amps
   */
  public static double getCurrent5V() {
    return PowerJNI.getUserCurrent5V();
  }

  /**
   * Get the enabled state of the 5V rail. The rail may be disabled due to a controller brownout, a
   * short circuit on the rail, or controller over-voltage.
   *
   * @return The controller 5V rail enabled value
   */
  public static boolean getEnabled5V() {
    return PowerJNI.getUserActive5V();
  }

  /**
   * Get the count of the total current faults on the 5V rail since the controller has booted.
   *
   * @return The number of faults
   */
  public static int getFaultCount5V() {
    return PowerJNI.getUserCurrentFaults5V();
  }

  /**
   * Get the voltage of the 6V rail.
   *
   * @return The controller 6V rail voltage value in Volts
   */
  public static double getVoltage6V() {
    return PowerJNI.getUserVoltage6V();
  }

  /**
   * Get the current output of the 6V rail.
   *
   * @return The controller 6V rail output current value in Amps
   */
  public static double getCurrent6V() {
    return PowerJNI.getUserCurrent6V();
  }

  /**
   * Get the enabled state of the 6V rail. The rail may be disabled due to a controller brownout, a
   * short circuit on the rail, or controller over-voltage.
   *
   * @return The controller 6V rail enabled value
   */
  public static boolean getEnabled6V() {
    return PowerJNI.getUserActive6V();
  }

  /**
   * Get the count of the total current faults on the 6V rail since the controller has booted.
   *
   * @return The number of faults
   */
  public static int getFaultCount6V() {
    return PowerJNI.getUserCurrentFaults6V();
  }
}

redpajama_set_name: RedPajamaGithub


text: require 'sensu-plugins-megaraid/version'


text:
title: About
layout: page
---
![Profile Image]({{ site.url }}/{{ site.picture }})

Experienced Data Scientist with more than 2 years experience across industries.Currently working as Data Scientist at noodle.ai operating from SanFransisco and Bengaluru.Formerly worked as Data Science Analyst at American Express.I graduated from IIT Kharagpur, pursuing Bachelor's of technology in Electrical  Engineering and a minor in Electronics and Electrical Communication Engineering.

Skills

Software Frameworks

Keras

Tensorflow

Spark

OpenCV

Languages

Python

Matlab

C

Lua

Shell

Version Control

Git

Web Technologies

HTML

PHP

CSS

Javascript

Mobile Applications

Android Application Development

Projects

See Here


text:
from heat.db import api as db_api
from heat.common import exception
from heat.common import identifier
from heat.openstack.common import log as logging

logger = logging.getLogger(__name__)

class Event(object):
    '''Class representing a Resource state change.'''

    def __init__(self, context, stack, resource,
                 new_state, reason,
                 physical_resource_id, resource_properties,
                 timestamp=None, id=None):
        '''
        Initialise from a context, stack, resource, event information and
        current resource data. The timestamp and database ID may also be
        initialised if the event is already in the database.
        '''
        self.context = context
        self.resource = resource
        self.stack = stack
        self.new_state = new_state
        self.reason = reason
        self.physical_resource_id = physical_resource_id
        try:
            self.resource_properties = dict(resource_properties)
        except ValueError as ex:
            self.resource_properties = {'Error': str(ex)}
        self.timestamp = timestamp
        self.id = id

    @classmethod
    def load(cls, context, event_id):
        '''Retrieve an Event from the database'''
        from heat.engine import parser

        ev = db_api.event_get(context, event_id)
        if ev is None:
            message = 'No event exists with id "%s"' % str(event_id)
            raise exception.NotFound(message)

        stack = parser.Stack.load(context, ev.stack_id)
        resource = stack[ev.logical_resource_id]

        event = cls(context, stack, resource,
                    ev.name, ev.resource_status_reason,
                    ev.physical_resource_id, ev.resource_properties,
                    ev.created_at, ev.id)

        return event

    def store(self):
        '''Store the Event in the database'''
        ev = {
            'logical_resource_id': self.resource.name,
            'physical_resource_id': self.physical_resource_id,
            'stack_id': self.stack.id,
            'stack_name': self.stack.name,
            'resource_status': self.new_state,
            'name': self.new_state,
            'resource_status_reason': self.reason,
            'resource_type': self.resource.type(),
            'resource_properties': self.resource_properties,
        }

        if self.timestamp is not None:
            ev['created_at'] = self.timestamp

        if self.id is not None:
            logger.warning('Duplicating event')

        new_ev = db_api.event_create(self.context, ev)
        self.id = new_ev.id
        return self.id

    def identifier(self):
        '''Return a unique identifier for the event'''
        if self.id is None:
            return None

        return identifier.EventIdentifier(event_id=str(self.id),
                                          **self.resource.identifier())


text:
'use strict';

const assert = require('assert');
const request = require('request');
const app = require('../../../src/app');

describe('invoices service', function () {
  let credentials = {
    username: 'admin@smsc.io',
    password: 'admin',
  };

  let accessToken = '';

  it('registered the invoices service', () => {
    assert.ok(app.service('invoices'));
  });

  it('authentication', (done) => {
    request.post({
      url: 'http://localhost:3030/authentication',
      form: { username: credentials.username, password: credentials.password }
    }, function (err, httpResponse, body) {
      assert.equal(201, httpResponse.statusCode);
      assert.ok(JSON.parse(body).accessToken);
      accessToken = JSON.parse(body).accessToken;
      done(err);
    });
  });

  it('shows the invoices data', (done) => {
    request.get({
      url: 'http://localhost:3030/invoices',
      headers: {
        'Authorization': accessToken,
      }
    }, function (err, httpResponse, body) {
      assert.equal(200, httpResponse.statusCode);
      done(err);
    });
  });
});


text:
// ==========================================================================
//                 SeqAn - The Library for Sequence Analysis
// ==========================================================================
// Copyright (c) 2006-2016, Knut Reinert, FU Berlin
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
//     * Redistributions of source code must retain the above copyright
//       notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above copyright
//       notice, this list of conditions and the following disclaimer in the
//       documentation and/or other materials provided with the distribution.
//     * Neither the name of Knut Reinert or the FU Berlin nor the names of
//       its contributors may be used to endorse or promote products derived
//       from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
// DAMAGE.
//
// ==========================================================================
// Author: Manuel Holtgrewe <manuel.holtgrewe@fu-berlin.de>
// ==========================================================================
// Interface functions for banded local alignment.
// ==========================================================================

#ifndef SEQAN_INCLUDE_SEQAN_ALIGN_LOCAL_ALIGNMENT_BANDED_H_
#define SEQAN_INCLUDE_SEQAN_ALIGN_LOCAL_ALIGNMENT_BANDED_H_

namespace seqan {

// ============================================================================
// Forwards
// ============================================================================

// ============================================================================
// Tags, Classes, Enums
// ============================================================================

// ============================================================================
// Metafunctions
// ============================================================================

// ============================================================================
// Functions
// ============================================================================

// ----------------------------------------------------------------------------
// Function localAlignment()                                    [banded, Align]
// ----------------------------------------------------------------------------

template <typename TSequence, typename TAlignSpec, typename TScoreValue, typename TScoreSpec, typename TTag>
TScoreValue localAlignment(Align<TSequence, TAlignSpec> & align,
                           Score<TScoreValue, TScoreSpec> const & scoringScheme,
                           int lowerDiag,
                           int upperDiag,
                           TTag const & tag)
{
    typedef Align<TSequence, TAlignSpec> TAlign;
    typedef typename Size<TAlign>::Type TSize;
    typedef typename Position<TAlign>::Type TPosition;
    typedef TraceSegment_<TPosition, TSize> TTraceSegment;
    typedef AlignConfig2<DPLocal, DPBandConfig<BandOn>, FreeEndGaps_<> > TAlignConfig2;

    SEQAN_ASSERT_EQ(length(rows(align)), 2u);

    String<TTraceSegment> trace;
    DPScoutState_<Default> dpScoutState;
    TScoreValue res = _setUpAndRunAlignment(trace, dpScoutState, source(row(align, 0)), source(row(align, 1)),
                                            scoringScheme, TAlignConfig2(lowerDiag, upperDiag), tag);

    _adaptTraceSegmentsTo(row(align, 0), row(align, 1), trace);
    return res;
}

template <typename TSequence, typename TAlignSpec, typename TScoreValue, typename TScoreSpec>
TScoreValue localAlignment(Align<TSequence, TAlignSpec> & align,
                           Score<TScoreValue, TScoreSpec> const & scoringScheme,
                           int lowerDiag,
                           int upperDiag)
{
    SEQAN_ASSERT(length(rows(align)) == 2u);
    if (_usesAffineGaps(scoringScheme, source(row(align, 0)), source(row(align, 1))))
        return localAlignment(align, scoringScheme, lowerDiag, upperDiag, AffineGaps());
    else
        return localAlignment(align, scoringScheme, lowerDiag, upperDiag, LinearGaps());
}

// ----------------------------------------------------------------------------
// Function localAlignment()                                     [banded, Gaps]
// ----------------------------------------------------------------------------

template <typename TSequenceH, typename TGapsSpecH, typename TSequenceV, typename TGapsSpecV,
          typename TScoreValue, typename TScoreSpec, typename TTag>
TScoreValue localAlignment(Gaps<TSequenceH, TGapsSpecH> & gapsH,
                           Gaps<TSequenceV, TGapsSpecV> & gapsV,
                           Score<TScoreValue, TScoreSpec> const & scoringScheme,
                           int lowerDiag,
                           int upperDiag,
                           TTag const & tag)
{
    typedef typename Size<TSequenceH>::Type TSize;
    typedef typename Position<TSequenceH>::Type TPosition;
    typedef TraceSegment_<TPosition, TSize> TTraceSegment;
    typedef AlignConfig2<DPLocal, DPBandConfig<BandOn>, FreeEndGaps_<> > TAlignConfig2;

    String<TTraceSegment> trace;
    DPScoutState_<Default> dpScoutState;
    TScoreValue res = _setUpAndRunAlignment(trace, dpScoutState, source(gapsH), source(gapsV), scoringScheme,
                                            TAlignConfig2(lowerDiag, upperDiag), tag);
    _adaptTraceSegmentsTo(gapsH, gapsV, trace);
    return res;
}

template <typename TSequenceH, typename TGapsSpecH, typename TSequenceV, typename TGapsSpecV,
          typename TScoreValue, typename TScoreSpec>
TScoreValue localAlignment(Gaps<TSequenceH, TGapsSpecH> & gapsH,
                           Gaps<TSequenceV, TGapsSpecV> & gapsV,
                           Score<TScoreValue, TScoreSpec> const & scoringScheme,
                           int lowerDiag,
                           int upperDiag)
{
    if (_usesAffineGaps(scoringScheme, source(gapsH), source(gapsV)))
        return localAlignment(gapsH, gapsV, scoringScheme, lowerDiag, upperDiag, AffineGaps());
    else
        return localAlignment(gapsH, gapsV, scoringScheme, lowerDiag, upperDiag, LinearGaps());
}

// ----------------------------------------------------------------------------
// Function localAlignment()                      [banded, Graph<Alignment<> >]
// ----------------------------------------------------------------------------

template <typename TStringSet, typename TCargo, typename TGraphSpec, typename TScoreValue, typename TScoreSpec,
          typename TTag>
TScoreValue localAlignment(Graph<Alignment<TStringSet, TCargo, TGraphSpec> > & alignmentGraph,
                           Score<TScoreValue, TScoreSpec> const & scoringScheme,
                           int lowerDiag,
                           int upperDiag,
                           TTag const & tag)
{
    typedef Graph<Alignment<TStringSet, TCargo, TGraphSpec> > TGraph;
    typedef typename Size<TGraph>::Type TSize;
    typedef typename Position<TGraph>::Type TPosition;
    typedef TraceSegment_<TPosition, TSize> TTraceSegment;
    typedef AlignConfig2<DPLocal, DPBandConfig<BandOn>, FreeEndGaps_<> > TAlignConfig2;

    String<TTraceSegment> trace;
    DPScoutState_<Default> dpScoutState;
    TScoreValue res = _setUpAndRunAlignment(trace, dpScoutState, value(stringSet(alignmentGraph), 0),
                                            value(stringSet(alignmentGraph), 1), scoringScheme,
                                            TAlignConfig2(lowerDiag, upperDiag), tag);

    _adaptTraceSegmentsTo(alignmentGraph, positionToId(stringSet(alignmentGraph), 0),
                          positionToId(stringSet(alignmentGraph), 1), trace);
    return res;
}

template <typename TStringSet, typename TCargo, typename TGraphSpec,
          typename TScoreValue, typename TScoreSpec>
TScoreValue localAlignment(Graph<Alignment<TStringSet, TCargo, TGraphSpec> > & alignmentGraph,
                           Score<TScoreValue, TScoreSpec> const & scoringScheme,
                           int lowerDiag,
                           int upperDiag)
{
    SEQAN_ASSERT(length(stringSet(alignmentGraph)) == 2u);

    if (_usesAffineGaps(scoringScheme, stringSet(alignmentGraph)[0], stringSet(alignmentGraph)[1]))
        return localAlignment(alignmentGraph, scoringScheme, lowerDiag, upperDiag, AffineGaps());
    else
        return localAlignment(alignmentGraph, scoringScheme, lowerDiag, upperDiag, LinearGaps());
}

// ----------------------------------------------------------------------------
// Function localAlignment()                      [banded, String<Fragment<> >]
// ----------------------------------------------------------------------------

// Full interface.
template <typename TSize, typename TFragmentSpec, typename TStringSpec, typename TSequence, typename TStringSetSpec,
          typename TScoreValue, typename TScoreSpec, typename TTag>
TScoreValue localAlignment(String<Fragment<TSize, TFragmentSpec>, TStringSpec> & fragmentString,
                           StringSet<TSequence, TStringSetSpec> const & strings,
                           Score<TScoreValue, TScoreSpec> const & scoringScheme,
                           int lowerDiag,
                           int upperDiag,
                           TTag const & tag)
{
    typedef String<Fragment<TSize, TFragmentSpec>, TStringSpec> TFragments;
    typedef typename Position<TFragments>::Type TPosition;
    typedef TraceSegment_<TPosition, TSize> TTraceSegment;
    typedef AlignConfig2<DPLocal, DPBandConfig<BandOn>, FreeEndGaps_<> > TAlignConfig2;

    String<TTraceSegment> trace;
    DPScoutState_<Default> dpScoutState;
    TScoreValue res = _setUpAndRunAlignment(trace, dpScoutState, value(strings, 0), value(strings, 1), scoringScheme,
                                            TAlignConfig2(lowerDiag, upperDiag), tag);
    _adaptTraceSegmentsTo(fragmentString, positionToId(strings, 0), positionToId(strings, 1), trace);
    return res;
}

template <typename TSize, typename TFragmentSpec, typename TStringSpec,
          typename TSequence, typename TStringSetSpec,
          typename TScoreValue, typename TScoreSpec>
TScoreValue localAlignment(String<Fragment<TSize, TFragmentSpec>, TStringSpec> & fragmentString,
                           StringSet<TSequence, TStringSetSpec> const & strings,
                           Score<TScoreValue, TScoreSpec> const & scoringScheme,
                           int lowerDiag,
                           int upperDiag)
{
    SEQAN_ASSERT(length(strings) == 2u);

    if (_usesAffineGaps(scoringScheme, strings[0], strings[1]))
        return localAlignment(fragmentString, strings, scoringScheme, lowerDiag, upperDiag, AffineGaps());
    else
        return localAlignment(fragmentString, strings, scoringScheme, lowerDiag, upperDiag, LinearGaps());
}

// ============================================================================
// Many-vs-Many align interfaces.
// ============================================================================

// ----------------------------------------------------------------------------
// Function localAlignment()               [banded, SIMD version, GapsH, GapsV]
// ----------------------------------------------------------------------------

template <typename TGapSequenceH, typename TSetSpecH,
          typename TGapSequenceV, typename TSetSpecV,
          typename TScoreValue, typename TScoreSpec,
          typename TAlgoTag>
inline auto
localAlignment(StringSet<TGapSequenceH, TSetSpecH> & gapSeqSetH,
               StringSet<TGapSequenceV, TSetSpecV> & gapSeqSetV,
               Score<TScoreValue, TScoreSpec> const & scoringScheme,
               int const lowerDiag,
               int const upperDiag,
               TAlgoTag const & /*algoTag*/)
{
    typedef AlignConfig2<DPLocal, DPBandConfig<BandOn>, FreeEndGaps_<> >    TAlignConfig2;
    typedef typename SubstituteAlgoTag_<TAlgoTag>::Type                     TGapModel;

    return _alignWrapper(gapSeqSetH, gapSeqSetV, scoringScheme, TAlignConfig2(lowerDiag, upperDiag), TGapModel());
}

// ----------------------------------------------------------------------------
// Function localAlignment()           [banded, SIMD version, StringSet<Align>]
// ----------------------------------------------------------------------------

template <typename TSequence, typename TAlignSpec, typename TSetSpec,
          typename TScoreValue, typename TScoreSpec,
          typename TAlgoTag>
inline String<TScoreValue>
localAlignment(StringSet<Align<TSequence, TAlignSpec>, TSetSpec> & alignSet,
               Score<TScoreValue, TScoreSpec> const & scoringScheme,
               int const lowerDiag,
               int const upperDiag,
               TAlgoTag const & algoTag)
{
    typedef Align<TSequence, TAlignSpec>    TAlign;
    typedef typename Row<TAlign>::Type      TGapSequence;

    StringSet<TGapSequence, Dependent<> > gapSetH;
    StringSet<TGapSequence, Dependent<> > gapSetV;
    reserve(gapSetH, length(alignSet));
    reserve(gapSetV, length(alignSet));

    for (auto & align : alignSet)
    {
        appendValue(gapSetH, row(align, 0));
        appendValue(gapSetV, row(align, 1));
    }

    return localAlignment(gapSetH, gapSetV, scoringScheme, lowerDiag, upperDiag, algoTag);
}

template <typename TSequence, typename TAlignSpec,
          typename TScoreValue, typename TScoreSpec>
String<TScoreValue> localAlignment(StringSet<Align<TSequence, TAlignSpec> > & align,
                                   Score<TScoreValue, TScoreSpec> const & scoringScheme,
                                   int lowerDiag, int upperDiag)
{
   if (_usesAffineGaps(scoringScheme, source(row(align[0], 0)), source(row(align[0], 1))))
        return localAlignment(align, scoringScheme, lowerDiag, upperDiag, AffineGaps());
   else
        return localAlignment(align, scoringScheme, lowerDiag, upperDiag, LinearGaps());
}

}  // namespace seqan

#endif  // #ifndef SEQAN_INCLUDE_SEQAN_ALIGN_LOCAL_ALIGNMENT_BANDED_H_


text:
/*
 * $Id: NodeCounterGenerator.java 468649 2006-10-28 07:00:55Z minchau $
 */

package org.apache.xalan.xsltc.compiler.util;

import org.apache.bcel.generic.ALOAD;
import org.apache.bcel.generic.Instruction;
import org.apache.xalan.xsltc.compiler.Stylesheet;

/**
 * This class implements auxiliary classes needed to compile
 * patterns in <tt>xsl:number</tt>. These classes inherit from
 * {Any,Single,Multiple}NodeCounter and override the
 * <tt>matchFrom</tt> and <tt>matchCount</tt> methods.
 * @author Jacek Ambroziak
 * @author Santiago Pericas-Geertsen
 */
public final class NodeCounterGenerator extends ClassGenerator {
    private Instruction _aloadTranslet;

    public NodeCounterGenerator(String className,
				String superClassName,
			        String fileName,
			        int accessFlags,
				String[] interfaces,
			        Stylesheet stylesheet) {
	super(className, superClassName, fileName,
	      accessFlags, interfaces, stylesheet);
    }

    /**
     * Set the index of the register where "this" (the pointer to
     * the translet) is stored.
     */
    public void setTransletIndex(int index) {
	_aloadTranslet = new ALOAD(index);
    }

    /**
     * The index of the translet pointer within the execution of
     * matchFrom or matchCount.
     * Overridden from ClassGenerator.
     */
    public Instruction loadTranslet() {
	return _aloadTranslet;
    }

    /**
     * Returns <tt>true</tt> since this class is external to the
     * translet.
     */
    public boolean isExternal() {
	return true;
    }
}


text:
module Onfleet
  class OnfleetError < StandardError
    attr_accessor :code, :name
  end
end


text:
module Scorm2004
  module Manifest
    class TimeLimitAction
      include VisitorPattern
      include TextNode

      VOCABULARY = [
        'exit,message',
        'exit,no message',
        'continue,message',
        'continue,no message'
      ]

      private

      def do_visit
        unless VOCABULARY.include?(content)
          error("Invalid <adlcp:timeLimitAction> token: #{content}")
        end
      end
    end
  end
end


text:
package com.ftfl.historicalplaces.splash;

import java.util.Timer;
import java.util.TimerTask;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

import com.ftfl.historicalplaces.AddHistoricalActivity;
import com.ftfl.historicalplaces.HistoricalListActivity;
import com.ftfl.historicalplaces.database.Historical;
import com.ftfl.historicalplaces.database.HistoricalDataSource;
import com.ftfl.mylastvisiting.R;

public class SplashActivity extends Activity {
	HistoricalDataSource mDataSource = null;
	Historical mShoppingComplex = null;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_splash);
		mDataSource = new HistoricalDataSource(this);

		new Timer().schedule(new TimerTask() {
			public void run() {
				SplashActivity.this.runOnUiThread(new Runnable() {
					public void run() {

						if (mDataSource.isEmpty()) {
							startActivity(new Intent(SplashActivity.this,
									AddHistoricalActivity.class));
						} else {
							startActivity(new Intent(SplashActivity.this,
									HistoricalListActivity.class));

						}

						finish();
					}
				});
			}
		}, 2000);
	}

}


text:
<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "page_for_title".
 *
 * @property integer $id
 * @property string $title
 */
class PageForTitle extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'page_for_title';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['title'], 'required'],
            [['title'], 'string', 'max' => 255]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'title' => 'Title',
        ];
    }

    public static function getName($id){
        $title = PageForTitle::find()->where(['id'=>$id])->one();
        return $title->title;
    }
}


text:
'use strict';

/**
 * Pattern rule
 *
 */
class PatternRuleInfo {
  /**
   * Create a PatternRuleInfo.
   * @property {uuid} [id] The pattern ID.
   * @property {string} [pattern] The pattern text.
   * @property {string} [intent] The intent's name where the pattern belongs
   * to.
   */
  constructor() {
  }

  /**
   * Defines the metadata of PatternRuleInfo
   *
   * @returns {object} metadata of PatternRuleInfo
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'PatternRuleInfo',
      type: {
        name: 'Composite',
        className: 'PatternRuleInfo',
        modelProperties: {
          id: {
            required: false,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          pattern: {
            required: false,
            serializedName: 'pattern',
            type: {
              name: 'String'
            }
          },
          intent: {
            required: false,
            serializedName: 'intent',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = PatternRuleInfo;


text:
package org.immutables.fixture.jackson;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.immutables.value.Value;

@Value.Immutable
@Value.Style(get = {"get*", "is*"}, init = "set*", forceJacksonPropertyNames = false)
@JsonDeserialize(as = ImmutableKeywordNames.class)
public interface KeywordNames {
  long getLong();

  boolean isDefault();

  default void use() {
    ImmutableKeywordNames names = ImmutableKeywordNames.builder()
        .setDefault(true)
        .setLong(1L)
        .build();

    names.getLong();
    names.isDefault();
  }
}


text:
@implementation ASPOSEWTextAndLink

+ (JSONKeyMapper*)keyMapper {
    NSDictionary *map = @{@"Text" : @"text",
                          @"link" : @"link"};

    return [[JSONKeyMapper alloc] initWithDictionary:map];
}

@end


text:
using System;
using System.Text;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using static CommandInterface.Utility.NameConverter;

namespace CommandInterfaceTest
{
    [TestClass]
    public class NameConverterTest
    {
        [TestMethod]
        public void TestFileNameToCommandName()
        {
            Assert.AreEqual("test-script", ConvertToCommandName("TestScript.cs"));
            Assert.AreEqual("test-script2", ConvertToCommandName("TestScript2.cs"));
        }

        [TestMethod]
        public void TestCommandNameToFileName()
        {
            Assert.AreEqual("TestScript.cs", ConvertToFileName("test-script"));
            Assert.AreEqual("TestScript2.cs", ConvertToFileName("test-script2"));
        }
    }
}


text:
"""
Fusion-io Driver for the ioControl Hybrid storage subsystem
"""

import copy
import hashlib
import json
import random
import uuid

from oslo.config import cfg
import requests

from cinder import exception
from cinder.i18n import _
from cinder.openstack.common import log as logging
from cinder.openstack.common import loopingcall
from cinder.openstack.common import units
from cinder.volume.drivers.san.san import SanISCSIDriver
from cinder.volume import qos_specs
from cinder.volume import volume_types

LOG = logging.getLogger(__name__)

fusionio_iocontrol_opts = [
    cfg.IntOpt('fusionio_iocontrol_targetdelay',
               default=5,
               help='amount of time wait for iSCSI target to come online'),
    cfg.IntOpt('fusionio_iocontrol_retry',
               default=3,
               help='number of retries for GET operations'),
    cfg.BoolOpt('fusionio_iocontrol_verify_cert',
                default=True,
                help='verify the array certificate on each transaction'), ]

CONF = cfg.CONF
CONF.register_opts(fusionio_iocontrol_opts)

class FIOconnection(object):
    """Connection class for connection to ioControl array."""

    APIVERSION = '1.1'

    def _complete_uri(self, suburi=None, ver='1', loc='en'):
        uri = "https://" + self.array_addr + "/API/"
        if ver is not None:
            uri = uri + ver + "/"
        if loc is not None:
            uri = uri + loc + "/"
        if suburi is not None:
            uri = uri + suburi
        return uri

    def __init__(self, array_addr, array_login, array_passwd, retry, verify):
        self.client = "client=openstack"
        self.defhdrs = {"User-Agent": "OpenStack-agent",
                        "Content-Type": "application/json"}
        self.array_addr = array_addr
        self.array_login = array_login
        self.hashpass = hashlib.md5()
        self.hashpass.update(array_passwd)
        self.login_content = ("username=" + array_login + "&hash=" +
                              self.hashpass.hexdigest())
        self.retry = retry
        self.verify = verify
        # check the version of the API on the array. We only support 1.1
        # for now.
        resp = requests.get(url=("https://" + array_addr + "/AUTH/Version"),
                            headers=self.defhdrs, verify=self.verify)
        resp.raise_for_status()
        dictresp = resp.json()
        if dictresp["Version"] != self.APIVERSION:
            msg = _("FIO ioControl API version not supported")
            raise exception.VolumeDriverException(message=msg)
        LOG.debug('FIO Connection initialized to %s' % array_addr)

    def _create_session(self):
        # get the session id
        res = requests.post(url=("https://" + self.array_addr +
                                 "/AUTH/SESSION"),
                            data=self.client,
                            headers=self.defhdrs,
                            verify=self.verify)
        res.raise_for_status()
        result = res.json()
        session_key = result["id"]
        hdrs = copy.deepcopy(self.defhdrs)
        hdrs["Cookie"] = "session=" + session_key
        # Authenticate the session
        res = requests.put(url=("https://" + self.array_addr +
                                "/AUTH/SESSION/" + session_key),
                           data=self.login_content,
                           headers=self.defhdrs,
                           verify=self.verify)
        try:
            res.raise_for_status()
        except requests.exceptions:
            self._delete_session(hdrs)
            raise
        result = res.json()
        if result["Status"] != 1:
            # Authentication error delete the session ID
            self._delete_session(hdrs)
            msg = (_('FIO ioControl Authentication Error: %s') % (result))
            raise exception.VolumeDriverException(message=msg)
        return hdrs

    def _delete_session(self, hdrs):
        session = hdrs["Cookie"].split('=')[1]
        requests.delete(url=("https://" + self.array_addr +
                             "/AUTH/SESSION/" + session),
                        headers=self.defhdrs,
                        verify=self.verify)

    def get(self, suburl):
        session_hdrs = self._create_session()
        trynum = 0
        try:
            while (trynum < self.retry):
                trynum += 1
                res = requests.get(url=self._complete_uri(suburl),
                                   headers=session_hdrs,
                                   verify=self.verify)
                res.raise_for_status()
                # work around a bug whereby bad json is returned by the array
                try:
                    jres = res.json()
                    break
                except Exception:
                    if (trynum == self.retry):
                        # this shouldn't happen, but check for it
                        msg = (_('FIO ioControl persistent json Error.'))
                        raise exception.VolumeDriverException(message=msg)
                    pass
        finally:
            # deal with the bad result here
            self._delete_session(session_hdrs)
        return jres

    def put(self, suburl, content=None):
        session_hdrs = self._create_session()
        try:
            result = requests.put(url=self._complete_uri(suburl),
                                  data=json.dumps(content,
                                                  sort_keys=True),
                                  headers=session_hdrs,
                                  verify=self.verify)
            result.raise_for_status()
        finally:
            self._delete_session(session_hdrs)
        return

    def post(self, suburl, content=None):
        session_hdrs = self._create_session()
        try:
            result = requests.post(url=self._complete_uri(suburl),
                                   data=json.dumps(content,
                                                   sort_keys=True),
                                   headers=session_hdrs,
                                   verify=self.verify)
            result.raise_for_status()
        finally:
            self._delete_session(session_hdrs)
        return

    def delete(self, suburl,):
        session_hdrs = self._create_session()
        try:
            result = requests.delete(url=self._complete_uri(suburl),
                                     headers=session_hdrs,
                                     verify=self.verify)
            result.raise_for_status()
        finally:
            self._delete_session(session_hdrs)
        return

class FIOioControlDriver(SanISCSIDriver):
    """Fusion-io ioControl iSCSI volume driver."""

    VERSION = '1.0.0'

    def __init__(self, *args, **kwargs):
        super(FIOioControlDriver, self).__init__(*args, **kwargs)
        LOG.debug('FIO __init__ w/ %s' % kwargs)
        self.configuration.append_config_values(fusionio_iocontrol_opts)
        self.fio_qos_dict = {}

    def _get_volume_by_name(self, name):
        result = self.conn.get("TierStore/Volumes/by-id/")
        vol = [x for x in result
               if x['Name'] == name]
        if len(vol) == 1:
            return vol[0]
        elif len(vol) == 0:
            raise exception.VolumeNotFound(name)
        else:
            msg = (_("FIO _get_volume_by_name Error: %(name)s, %(len)s") %
                   {'name': name,
                    'len': len(vol)})
            raise exception.VolumeDriverException(msg)

    def _get_acl_by_name(self, name):
        result = self.conn.get("TierStore/ACLGroup/by-id/")
        acl = [x for x in result
               if x['GroupName'] == name]
        if len(acl) == 1:
            return acl[0]
        elif len(acl) == 0:
            return []
        else:
            msg = (_("FIO _get_acl_by_name Error: %(name)s, %(len)s") %
                   {'name': name,
                    'len': len(acl), })
            raise exception.VolumeDriverException(message=msg)

    def _get_snapshot_by_name(self, name):
        result = self.conn.get("TierStore/Snapshots/by-id/")
        snap = [x for x in result
                if x['Name'] == name]
        if len(snap) == 1:
            return snap[0]
        elif len(snap) == 0:
            raise exception.SnapshotNotFound(name)
        else:
            msg = (_("FIO _get_snapshot_by_name Error: %(name)s, %(len)s") %
                   {'name': name,
                    'len': len(snap), })
            raise exception.VolumeDriverException(message=msg)

    def _set_qos_presets(self, volume):
        valid_presets = self.fio_qos_dict.keys()

        presets = [i.value for i in volume.get('volume_metadata')
                   if i.key == 'fio-qos' and i.value in valid_presets]
        if len(presets) > 0:
            if len(presets) > 1:
                LOG.warning(_('More than one valid preset was '
                              'detected, using %s') % presets[0])
            return self.fio_qos_dict[presets[0]]

    def _set_qos_by_volume_type(self, type_id):
        valid_presets = self.fio_qos_dict.keys()
        volume_type = volume_types.get_volume_type(ctxt=None,
                                                   id=type_id)
        qos_specs_id = volume_type.get('qos_specs_id')
        specs = volume_type.get('extra_specs')
        if qos_specs_id is not None:
            kvs = qos_specs.get_qos_specs(ctxt=None,
                                          id=qos_specs_id)['specs']
        else:
            kvs = specs
        for key, value in kvs.iteritems():
            if ':' in key:
                fields = key.split(':')
                key = fields[1]
            if 'fio-qos' in key:
                if value in valid_presets:
                    return self.fio_qos_dict[value]

    def do_setup(self, context):
        LOG.debug('FIO do_setup() called')
        required_flags = ['san_ip',
                          'san_login',
                          'san_password', ]
        for flag in required_flags:
            if not getattr(self.configuration, flag, None):
                raise exception.InvalidInput(reason=_('%s is not set') % flag)
        if not (self.configuration.san_ip and
                self.configuration.san_login and
                self.configuration.san_password):
            raise exception.InvalidInput(
                reason=_('All of '
                         'san_ip '
                         'san_login '
                         'san_password '
                         'must be set'))
        self.conn = FIOconnection(self.configuration.san_ip,
                                  self.configuration.san_login,
                                  self.configuration.san_password,
                                  self.configuration.fusionio_iocontrol_retry,
                                  (self.configuration.
                                   fusionio_iocontrol_verify_cert))
        result = self.conn.get("TierStore/Policies/by-id/")
        for x in result:
            self.fio_qos_dict[x['Name']] = x['id']

    def check_for_setup_error(self):
        pass

    def create_volume(self, volume):
        LOG.debug('FIO create_volume() called: %s' % (volume['id']))
        # Roughly we pick the less full pool.
        # Someday change the default the policy to be configurable
        qos = self.fio_qos_dict['Policy 5']
        result = self.conn.get("TierStore/Pools/by-id/")
        poola = result[0]['PagingTotalMB'] - result[0]['ExportedVolumeMB']
        poolb = result[1]['PagingTotalMB'] - result[1]['ExportedVolumeMB']
        if poola >= poolb:
            pool = result[0]['id']
        else:
            pool = result[1]['id']
        if volume.get('volume_metadata')is not None:
            qos = self._set_qos_presets(volume)

        type_id = volume['volume_type_id']
        if type_id is not None:
            qos = self._set_qos_by_volume_type(type_id)

        cmd = {"Size": int(volume['size']) * units.Gi,
               "PolicyUUID": qos,
               "PoolUUID": pool,
               "Name": volume['id'], }
        self.conn.post("TierStore/Volumes/by-id/", cmd)
        LOG.debug(('FIO create_vol(%(id)s) on %(pool)s vals %(poola)s '
                   '%(poolb)s') %
                  {'id': volume['id'],
                   'pool': pool,
                   'poola': poola,
                   'poolb': poolb})

    def delete_volume(self, volume):
        LOG.debug('FIO delete_volume() volID %s' % (volume['id']))
        vol = self._get_volume_by_name(volume['id'])
        self.conn.delete("TierStore/Volumes/by-id/" + vol['id'])

    def ensure_export(self, context, volume):
        pass

    def create_export(self, context, volume):
        pass

    def remove_export(self, context, volume):
        pass

    def initialize_connection(self, volume, connector):
        LOG.debug('FIO init_connection() w/ %(id)s and %(conn)s' %
                  {'id': volume['id'],
                   'conn': connector['initiator']})
        # setup the access group each initiator will go in a unique access
        # group.
        # TODO(ebalduf) implement w/ CHAP
        volumedata = self._get_volume_by_name(volume['id'])
        cmd = {"GroupName": connector['initiator'],
               "InitiatorList": [connector['initiator']]}
        self.conn.post("TierStore/ACLGroup/by-id/", cmd)

        acl = self._get_acl_by_name(connector['initiator'])
        if acl is not []:
            cmd = {"AclGroupList": [str(acl['id'])], }
            self.conn.put("TierStore/Volumes/by-id/" + volumedata['id'], cmd)
        else:
            # this should never happen, but check for it in case
            msg = _('FIO: ACL does not exist!')
            raise exception.VolumeDriverException(message=msg)
        # handle the fact that the Application of the ACL to the volume
        # is asynchronous.  In the future we'll add a call back to the API

        def _wait_routine():
            # unfortunately, the array API at this time doesn't have any
            # way to poll.  In the future we will add that ability and
            # this routine is where were will poll for ready.
            if self._looping_count == 0:
                self._looping_count += 1
            else:
                raise loopingcall.LoopingCallDone()

        # time.sleep(self.configuration.fusionio_iocontrol_targetdelay)
        self._looping_count = 0
        timer = loopingcall.FixedIntervalLoopingCall(_wait_routine)
        timer.start(
            interval=self.configuration.fusionio_iocontrol_targetdelay).wait()
        volumedata = self._get_volume_by_name(volume['id'])

        properties = {}
        properties['target_discovered'] = False
        properties['target_iqn'] = volumedata['IQN']
        properties['target_lun'] = 0
        properties['volume_id'] = volume['id']

        result = self.conn.get("System/Network/by-id/")

        # probably way too complicated, but pick a random network interface
        # on the controller this LUN is owned by
        networksinfo = [x for x in result
                        if x['OperationalState'] == 'up'
                        if x['IsManagementPort'] is not True
                        if x['IsReplicationPort'] is not True
                        if x['ControllerUID'] ==
                        volumedata['CurrentOwnerUUID']]
        LOG.debug('NetworkInfo %s' % (networksinfo))
        if len(networksinfo):
            ipaddr = (networksinfo[random.randint(0, len(networksinfo) - 1)]
                      ['NetworkAddress'])
        else:
            msg = _('No usable Networks found: %s') % (result)
            raise exception.VolumeDriverException(message=msg)
        properties['target_portal'] = unicode('%s:%s' % (ipaddr, '3260'))

        auth = volume['provider_auth']
        if auth:
            (auth_method, auth_username, auth_secret) = auth.split()

            properties['auth_method'] = auth_method
            properties['auth_username'] = auth_username
            properties['auth_password'] = auth_secret

        LOG.debug('Result from initialize connection: %s' % properties)
        return {
            'driver_volume_type': 'iscsi',
            'data': properties,
        }

    def create_snapshot(self, snapshot):
        LOG.debug(('FIO create_snapshot() vol ID: %(volID)s snapID '
                   '%(snapID)s') %
                  {'volID': snapshot['volume_id'],
                   'snapID': snapshot['id']})
        vol = self._get_volume_by_name(snapshot['volume_id'])
        cmd = {"VolumeUUID": vol['id'],
               "Name": snapshot['id'], }
        self.conn.post("TierStore/Snapshots/by-id/", cmd)

    def delete_snapshot(self, snapshot):
        LOG.debug('FIO delete_snapshot() SnapID: %s' % (snapshot['id']))
        snap = self._get_snapshot_by_name(snapshot['id'])
        self.conn.delete("TierStore/Snapshots/by-id/" + snap['id'])

    def create_volume_from_snapshot(self, volume, snapshot):
        LOG.debug('FIO create_volume_from_snapshot()  w/ %s' %
                  volume['id'])

        qos = self.fio_qos_dict['Policy 5']
        if volume.get('volume_metadata')is not None:
            qos = self._set_qos_presets(volume)

        type_id = volume['volume_type_id']
        if type_id is not None:
            qos = self._set_qos_by_volume_type(type_id)
        snap = self._get_snapshot_by_name(snapshot['id'])
        cmd = {"ParentLayerId": snap['id'],
               "Name": volume['id'],
               "PolicyUUID": qos}
        self.conn.put("TierStore/Snapshots/functions/CloneSnapshot", cmd)

    def _delete_acl_by_name(self, name):
        aclname = self._get_acl_by_name(name)
        if aclname is []:
            return
        result = self.conn.get("TierStore/Volumes/by-id/")
        inuse = False
        for vol in result:
            for acl in vol['AclGroupList']:
                if int(acl) == aclname['id']:
                    inuse = True
                    break
            if inuse:
                break
        if not inuse:
            result = self.conn.delete("TierStore/ACLGroup/by-id/" +
                                      str(aclname['id']))

    def terminate_connection(self, volume, connector, **kwargs):
        LOG.debug('FIO terminate_connection() w/ %(id)s %(conn)s ' %
                  {'id': volume['id'],
                   'conn': connector['initiator']})
        vol = self._get_volume_by_name(volume['id'])
        acl = self._get_acl_by_name("Deny Access")
        if acl is []:
            msg = _('FIO: ACL does not exist!')
            raise exception.VolumeDriverException(message=msg)
        cmd = {"AclGroupList": [str(acl['id'])], }
        self.conn.put("TierStore/Volumes/by-id/" + vol['id'], cmd)
        self._delete_acl_by_name(connector['initiator'])

    def create_cloned_volume(self, volume, src_vref):
        LOG.debug('FIO create_cloned_volume() w/ %(id)s %(src)s' %
                  {'id': volume['id'],
                   'src': src_vref})
        qos = self.fio_qos_dict['Policy 5']
        # take a snapshot of the volume (use random UUID for name)
        snapshotname = str(uuid.uuid4())
        vol = self._get_volume_by_name(src_vref['id'])
        cmd = {"VolumeUUID": vol['id'],
               "Name": snapshotname, }
        self.conn.post("TierStore/Snapshots/by-id/", cmd)

        # create a volume from the snapshot with the new name.
        # Rollback = Delete the snapshot if needed.
        if volume.get('volume_metadata')is not None:
            qos = self._set_qos_presets(volume)

        type_id = volume['volume_type_id']
        if type_id is not None:
            qos = self._set_qos_by_volume_type(type_id)

        snap = self._get_snapshot_by_name(snapshotname)
        cmd = {"ParentLayerId": snap['id'],
               "Name": volume['id'],
               "PolicyUUID": qos, }
        try:
            # watch for any issues here, and if there are, clean up the
            # snapshot and re-raise
            self.conn.put("TierStore/Snapshots/functions/CloneSnapshot", cmd)
        except Exception:
            snap = self._get_snapshot_by_name(snapshotname)
            self.conn.delete("TierStore/Snapshots/by-id/" + snap['id'])
            raise

    def get_volume_stats(self, refresh=False):
        """Retrieve status info from volume group."""
        LOG.debug("FIO Updating volume status")
        if refresh:
            result = self.conn.get("TierStore/Pools/by-id/")
            data = {}
            backend_name = self.configuration.safe_get('volume_backend_name')
            data["volume_backend_name"] = (backend_name
                                           or self.__class__.__name__)
            data["vendor_name"] = 'Fusion-io Inc'
            data["driver_version"] = self.VERSION
            data["storage_protocol"] = 'iSCSI'
            data['total_capacity_gb'] = (result[0]['PagingTotalMB'] +
                                         result[1]['PagingTotalMB'])
            data['free_capacity_gb'] = (max((result[0]['PagingTotalMB'] -
                                             result[0]['ExportedVolumeMB']),
                                            (result[1]['PagingTotalMB'] -
                                             result[1]['ExportedVolumeMB'])))
            data['reserved_percentage'] = 10
            data['QoS_support'] = True
            self._stats = data

        LOG.debug('Result from status: %s' % data)
        return self._stats

    def extend_volume(self, volume, new_size):
        LOG.debug("FIO extend_volume %(id)s to %(size)s" %
                  {'id': volume['id'],
                   'size': new_size})
        cmd = {"Size": int(new_size) * units.Gi}
        vol = self._get_volume_by_name(volume['id'])
        self.conn.put("TierStore/Volumes/by-id/" + vol['id'], cmd)


text:
import subprocess

import aiostream
import pytest

from vdirsyncer.storage.filesystem import FilesystemStorage
from vdirsyncer.vobject import Item

from . import StorageTests

class TestFilesystemStorage(StorageTests):
    storage_class = FilesystemStorage

    @pytest.fixture
    def get_storage_args(self, tmpdir):
        async def inner(collection="test"):
            rv = {"path": str(tmpdir), "fileext": ".txt", "collection": collection}
            if collection is not None:
                rv = await self.storage_class.create_collection(**rv)
            return rv

        return inner

    def test_is_not_directory(self, tmpdir):
        with pytest.raises(OSError):
            f = tmpdir.join("hue")
            f.write("stub")
            self.storage_class(str(tmpdir) + "/hue", ".txt")

    @pytest.mark.asyncio
    async def test_broken_data(self, tmpdir):
        s = self.storage_class(str(tmpdir), ".txt")

        class BrokenItem:
            raw = "Ц, Ш, Л, ж, Д, З, Ю".encode()
            uid = "jeezus"
            ident = uid

        with pytest.raises(TypeError):
            await s.upload(BrokenItem)
        assert not tmpdir.listdir()

    @pytest.mark.asyncio
    async def test_ident_with_slash(self, tmpdir):
        s = self.storage_class(str(tmpdir), ".txt")
        await s.upload(Item("UID:a/b/c"))
        (item_file,) = tmpdir.listdir()
        assert "/" not in item_file.basename and item_file.isfile()

    @pytest.mark.asyncio
    async def test_ignore_tmp_files(self, tmpdir):
        """Test that files with .tmp suffix beside .ics files are ignored."""
        s = self.storage_class(str(tmpdir), ".ics")
        await s.upload(Item("UID:xyzxyz"))
        (item_file,) = tmpdir.listdir()
        item_file.copy(item_file.new(ext="tmp"))
        assert len(tmpdir.listdir()) == 2
        assert len(await aiostream.stream.list(s.list())) == 1

    @pytest.mark.asyncio
    async def test_ignore_tmp_files_empty_fileext(self, tmpdir):
        """Test that files with .tmp suffix are ignored with empty fileext."""
        s = self.storage_class(str(tmpdir), "")
        await s.upload(Item("UID:xyzxyz"))
        (item_file,) = tmpdir.listdir()
        item_file.copy(item_file.new(ext="tmp"))
        assert len(tmpdir.listdir()) == 2
        # assert False, tmpdir.listdir() # enable to see the created filename
        assert len(await aiostream.stream.list(s.list())) == 1

    @pytest.mark.asyncio
    async def test_ignore_files_typical_backup(self, tmpdir):
        """Test file-name ignorance with typical backup ending ~."""
        ignorext = "~"  # without dot

        storage = self.storage_class(str(tmpdir), "", fileignoreext=ignorext)
        await storage.upload(Item("UID:xyzxyz"))
        (item_file,) = tmpdir.listdir()
        item_file.copy(item_file.new(basename=item_file.basename + ignorext))

        assert len(tmpdir.listdir()) == 2
        assert len(await aiostream.stream.list(storage.list())) == 1

    @pytest.mark.asyncio
    async def test_too_long_uid(self, tmpdir):
        storage = self.storage_class(str(tmpdir), ".txt")
        item = Item("UID:" + "hue" * 600)

        href, etag = await storage.upload(item)
        assert item.uid not in href

    @pytest.mark.asyncio
    async def test_post_hook_inactive(self, tmpdir, monkeypatch):
        def check_call_mock(*args, **kwargs):
            raise AssertionError()

        monkeypatch.setattr(subprocess, "call", check_call_mock)

        s = self.storage_class(str(tmpdir), ".txt", post_hook=None)
        await s.upload(Item("UID:a/b/c"))

    @pytest.mark.asyncio
    async def test_post_hook_active(self, tmpdir, monkeypatch):
        calls = []
        exe = "foo"

        def check_call_mock(call, *args, **kwargs):
            calls.append(True)
            assert len(call) == 2
            assert call[0] == exe

        monkeypatch.setattr(subprocess, "call", check_call_mock)

        s = self.storage_class(str(tmpdir), ".txt", post_hook=exe)
        await s.upload(Item("UID:a/b/c"))
        assert calls

    @pytest.mark.asyncio
    async def test_ignore_git_dirs(self, tmpdir):
        tmpdir.mkdir(".git").mkdir("foo")
        tmpdir.mkdir("a")
        tmpdir.mkdir("b")

        expected = {"a", "b"}
        actual = {
            c["collection"] async for c in self.storage_class.discover(str(tmpdir))
        }
        assert actual == expected


text:
from wwn.access_token import get_access_token
from wwn.access_token import authorization_url
from wwn.camera import fetch_snapshot_url


text:
// Copyright 2014 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.

#include "ash/display/display_util.h"

#include <algorithm>
#include <utility>

#include "ash/common/system/system_notifier.h"
#include "ash/common/wm_shell.h"
#include "ash/display/extended_mouse_warp_controller.h"
#include "ash/display/null_mouse_warp_controller.h"
#include "ash/display/unified_mouse_warp_controller.h"
#include "ash/host/ash_window_tree_host.h"
#include "ash/public/interfaces/new_window.mojom.h"
#include "ash/shell.h"
#include "base/strings/string_number_conversions.h"
#include "grit/ash_resources.h"
#include "ui/aura/env.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/display/display.h"
#include "ui/display/manager/display_manager.h"
#include "ui/display/manager/managed_display_info.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size_conversions.h"
#include "ui/message_center/message_center.h"
#include "ui/message_center/notification.h"
#include "ui/message_center/notification_delegate.h"
#include "ui/message_center/notification_list.h"
#include "ui/wm/core/coordinate_conversion.h"

#if defined(OS_CHROMEOS)
#include "base/sys_info.h"
#endif

namespace ash {
namespace {

const char kDisplayErrorNotificationId[] = "chrome://settings/display/error";

// A notification delegate that will start the feedback app when the notication
// is clicked.
class DisplayErrorNotificationDelegate
    : public message_center::NotificationDelegate {
 public:
  DisplayErrorNotificationDelegate() = default;

  // message_center::NotificationDelegate:
  bool HasClickedListener() override { return true; }

  void Click() override {
    WmShell::Get()->new_window_client()->OpenFeedbackPage();
  }

 private:
  // Private destructor since NotificationDelegate is ref-counted.
  ~DisplayErrorNotificationDelegate() override = default;

  DISALLOW_COPY_AND_ASSIGN(DisplayErrorNotificationDelegate);
};

void ConvertPointFromScreenToNative(aura::WindowTreeHost* host,
                                    gfx::Point* point) {
  ::wm::ConvertPointFromScreen(host->window(), point);
  host->ConvertPointToNativeScreen(point);
}

}  // namespace

std::unique_ptr<MouseWarpController> CreateMouseWarpController(
    display::DisplayManager* manager,
    aura::Window* drag_source) {
  if (manager->IsInUnifiedMode() && manager->num_connected_displays() >= 2)
    return base::MakeUnique<UnifiedMouseWarpController>();
  // Extra check for |num_connected_displays()| is for SystemDisplayApiTest
  // that injects MockScreen.
  if (manager->GetNumDisplays() < 2 || manager->num_connected_displays() < 2)
    return base::MakeUnique<NullMouseWarpController>();
  return base::MakeUnique<ExtendedMouseWarpController>(drag_source);
}

gfx::Rect GetNativeEdgeBounds(AshWindowTreeHost* ash_host,
                              const gfx::Rect& bounds_in_screen) {
  aura::WindowTreeHost* host = ash_host->AsWindowTreeHost();
  gfx::Rect native_bounds = host->GetBounds();
  native_bounds.Inset(ash_host->GetHostInsets());
  gfx::Point start_in_native = bounds_in_screen.origin();
  gfx::Point end_in_native = bounds_in_screen.bottom_right();

  ConvertPointFromScreenToNative(host, &start_in_native);
  ConvertPointFromScreenToNative(host, &end_in_native);

  if (std::abs(start_in_native.x() - end_in_native.x()) <
      std::abs(start_in_native.y() - end_in_native.y())) {
    // vertical in native
    int x = std::abs(native_bounds.x() - start_in_native.x()) <
                    std::abs(native_bounds.right() - start_in_native.x())
                ? native_bounds.x()
                : native_bounds.right() - 1;
    return gfx::Rect(x, std::min(start_in_native.y(), end_in_native.y()), 1,
                     std::abs(end_in_native.y() - start_in_native.y()));
  } else {
    // horizontal in native
    int y = std::abs(native_bounds.y() - start_in_native.y()) <
                    std::abs(native_bounds.bottom() - start_in_native.y())
                ? native_bounds.y()
                : native_bounds.bottom() - 1;
    return gfx::Rect(std::min(start_in_native.x(), end_in_native.x()), y,
                     std::abs(end_in_native.x() - start_in_native.x()), 1);
  }
}

// Moves the cursor to the point inside the root that is closest to
// the point_in_screen, which is outside of the root window.
void MoveCursorTo(AshWindowTreeHost* ash_host,
                  const gfx::Point& point_in_screen,
                  bool update_last_location_now) {
  aura::WindowTreeHost* host = ash_host->AsWindowTreeHost();
  gfx::Point point_in_native = point_in_screen;
  ::wm::ConvertPointFromScreen(host->window(), &point_in_native);
  host->ConvertPointToNativeScreen(&point_in_native);

  // now fit the point inside the native bounds.
  gfx::Rect native_bounds = host->GetBounds();
  gfx::Point native_origin = native_bounds.origin();
  native_bounds.Inset(ash_host->GetHostInsets());
  // Shrink further so that the mouse doesn't warp on the
  // edge. The right/bottom needs to be shrink by 2 to subtract
  // the 1 px from width/height value.
  native_bounds.Inset(1, 1, 2, 2);

  // Ensure that |point_in_native| is inside the |native_bounds|.
  point_in_native.SetToMax(native_bounds.origin());
  point_in_native.SetToMin(native_bounds.bottom_right());

  gfx::Point point_in_host = point_in_native;

  point_in_host.Offset(-native_origin.x(), -native_origin.y());
  host->MoveCursorToHostLocation(point_in_host);

  if (update_last_location_now) {
    gfx::Point new_point_in_screen;
    if (Shell::GetInstance()->display_manager()->IsInUnifiedMode()) {
      new_point_in_screen = point_in_host;
      // First convert to the unified host.
      host->ConvertPointFromHost(&new_point_in_screen);
      // Then convert to the unified screen.
      Shell::GetPrimaryRootWindow()->GetHost()->ConvertPointFromHost(
          &new_point_in_screen);
    } else {
      new_point_in_screen = point_in_native;
      host->ConvertPointFromNativeScreen(&new_point_in_screen);
      ::wm::ConvertPointToScreen(host->window(), &new_point_in_screen);
    }
    aura::Env::GetInstance()->set_last_mouse_location(new_point_in_screen);
  }
}

#if defined(OS_CHROMEOS)
void ShowDisplayErrorNotification(int message_id) {
  // Always remove the notification to make sure the notification appears
  // as a popup in any situation.
  message_center::MessageCenter::Get()->RemoveNotification(
      kDisplayErrorNotificationId, false /* by_user */);

  ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
  std::unique_ptr<message_center::Notification> notification(
      new message_center::Notification(
          message_center::NOTIFICATION_TYPE_SIMPLE, kDisplayErrorNotificationId,
          base::string16(),  // title
          l10n_util::GetStringUTF16(message_id),
          bundle.GetImageNamed(IDR_AURA_NOTIFICATION_DISPLAY),
          base::string16(),  // display_source
          GURL(), message_center::NotifierId(
                      message_center::NotifierId::SYSTEM_COMPONENT,
                      system_notifier::kNotifierDisplayError),
          message_center::RichNotificationData(),
          new DisplayErrorNotificationDelegate));
  message_center::MessageCenter::Get()->AddNotification(
      std::move(notification));
}
#endif

base::string16 GetDisplayErrorNotificationMessageForTest() {
  message_center::NotificationList::Notifications notifications =
      message_center::MessageCenter::Get()->GetVisibleNotifications();
  for (auto* const notification : notifications) {
    if (notification->id() == kDisplayErrorNotificationId)
      return notification->message();
  }
  return base::string16();
}

}  // namespace ash


text:
package org.apache.drill.exec.util;

import org.junit.Test;

import java.util.ArrayList;
import java.util.List;

import static org.junit.Assert.assertEquals;

public class TestApproximateStringMatcher {
    @Test
    public void testStringMatcher() {
        List<String> names = new ArrayList<>();
        names.add("a");
        names.add("little");
        names.add("sql");
        names.add("for");
        names.add("your");
        names.add("nosql");

        String name = "squeal";
        String bestMatch = ApproximateStringMatcher.getBestMatch(names, name);

        assertEquals("sql", bestMatch);
    }
}


text:
// @declaration: true

// An enum declaration that specifies a const modifier is a constant enum declaration.
// In a constant enum declaration, all members must have constant values and
// it is an error for a member declaration to specify an expression that isn't classified as a constant enum expression.

// Error : not a constant enum expression

const CONST = 9000 % 2;
const enum D {
    d = 10,
    e = 199 * Math.floor(Math.random() * 1000),
    f = d - (100 * Math.floor(Math.random() % 8))
    g = CONST,
}


text:
/* eslint-env node */
const fs = require('fs');
const glob = require('glob');
const util = require('./util');
const argv = require('minimist')(process.argv.slice(2));
const prompt = require('inquirer').createPromptModule();

argv._.forEach(arg => {
    const tokens = arg.split('=');
    argv[tokens[0]] = tokens[1] || true;
});

const allFiles = [];

if (argv.h || argv.help) {
    console.log(`
        usage:

        prefix.js [-p{refix}=your_great_new_prefix]

        example:

        prefix.js // will prompt for a prefix to replace the current one with
        prefix.js -p=xyz // will replace any existing prefix with xyz

    `);
} else {
    readAllFiles().then(startProcess);
}

function startProcess() {

    const currentPrefix = findExistingPrefix();
    getPrefix().then(prefix => replacePrefix(currentPrefix, prefix));

}

function findExistingPrefix() {

    // find existing prefix
    let currentPrefix;

    allFiles.filter(({file}) => ~file.indexOf('uikit.css')).some(({file, data}) => {

        const res = data.match(new RegExp(`(${util.validClassName.source})-grid`));
        currentPrefix = res && res[1];
        return currentPrefix;

    });
    return currentPrefix;

}

function getPrefix() {

    const prefixFromInput = argv.p || argv.prefix;
    if (!prefixFromInput) {
        return prompt({
            name: 'prefix',
            message: 'enter a prefix',
            validate: (val, res) => val.length && val.match(util.validClassName) ? !!(res.prefix = val) : 'invalid prefix'
        })
        .then(res => res.prefix);
    } else if (util.validClassName.test(prefixFromInput)) {
        return Promise.resolve(prefixFromInput);
    } else {
        throw 'illegal prefix: ' + prefixFromInput;
    }
}

function replacePrefix(from, to) {

    if (from === to) {
        console.log('already prefixed with: ' + from);
    } else {
        allFiles.forEach(({file, data, replace}) => {
            data = replace(data, from, to);
            fs.writeFileSync(file, data);
        });
    }
}

function readAllFiles(prefix) {

    const globs = [];

    globs.push(new Promise(res =>
        glob('dist/**/*.css', (err, files) => {
            const reads = [];
            files.forEach(file =>
                reads.push(util.read(file, data =>
                    allFiles.push({
                        file,
                        data,
                        replace: (data, needle, replace) => data.replace(new RegExp(`${needle}-` + /([a-z\d-]+)/.source, 'g'), `${replace}-$1`)
                    })
                ))
            );
            Promise.all(reads).then(res);
        }
        )
    ));

    globs.push(new Promise(res =>
        glob('dist/**/*.js', (err, files) => {
            const reads = [];
            files.forEach(file =>
                reads.push(util.read(file, data =>
                    allFiles.push({
                        file,
                        data,
                        replace: (data, needle, replace) => data.replace(new RegExp(`${needle}-`, 'g'), `${replace}-`).replace(new RegExp(`(${needle})?UIkit`, 'g'), `${replace === 'uk' ? '' : replace}UIkit`)
                    })
                ))
            );
            Promise.all(reads).then(res);
        }
        )
    ));

    return Promise.all(globs);
}


text:
package io.shardingsphere.core.yaml.sharding.strategy;

/**
 * Sharding strategy configuration for yaml.
 *
 * @author zhangliang
 */
public interface YamlShardingStrategyConfiguration {
}


text:
import styles from './main.sass';
import * as classNames from 'classnames';

class App {
    private theme: string;
    constructor(theme: string) {
        this.theme = theme;
    }

    render() {
        // as a style tag (using webpack's css-loader)
        const tpl = `<div style="${styles.toString()}"></div>`;
        // or as scoped unique classes, also latest typescript versions allow prop access using dot like styles.darkUI instead of styles['darkUI']
        return `
            <div class="${classNames((this.theme === 'dark') ?
                styles.darkUI :
                styles.lightUI.toString())}">
            </div>
        `;
    }
}


text:
drop table IF EXISTS edge;
create table edge(src int, dest int);
insert into edge values(1,2);
insert into edge values(1,3);
insert into edge values(3,4);
insert into edge values(2,4);
insert into edge values(4,5);
select * from edge;


text:
title: Use Arrow Functions to Write Concise Anonymous Functions
localeTitle: Utilice las funciones de flecha para escribir funciones anónimas concisas
---
## Utilice las funciones de flecha para escribir funciones anónimas concisas

Una vez más, ES6 se trata de hacer que JavaScript sea más elegante y, para algunos, más legible.

Las funciones anónimas, como se indicó, pueden crearse cuando está seguro de que la función no se llamará por su nombre en ningún otro lugar.

## Sugerencia 1:

Deshágase de la palabra clave de `function` y conecte esta flecha `=>` .

## Sugerencia 2:

¿Te deshiciste de la palabra clave `var` ?

## Alerta de Spoiler - ¡Solución por delante!

## Solución

```javascript
const magic = () => {
  "use strict";
  return new Date();
 };
```

Mientras te deshagas de la palabra clave `var` , eres bueno.


text:
<?xml version="1.0" encoding="utf-8"?>
<MapData>
<Details>
<FileName>[067]T06_M01_B05.rmd</FileName>
<FileType>Red Stone Scenario File 6.1 beta</FileType>
<MapName>鉄鉱山 B5</MapName>
<SysWidth>100</SysWidth>
<SysHeight>100</SysHeight>
<TgaWidth>200</TgaWidth>
<TgaHeight>100</TgaHeight>
<MapType>1</MapType>
<isPremiumMap>0</isPremiumMap>
<isPvPMap>0</isPvPMap>
<MapView_Lv>0</MapView_Lv>
<isLocationStrage>1</isLocationStrage>
<P_SubElement1>0</P_SubElement1>
<P_SubElement2>0</P_SubElement2>
<P_SubElement3>0</P_SubElement3>
<P_SubElement4>0</P_SubElement4>
<P_SubElement5>0</P_SubElement5>
<P_SubElement6>0</P_SubElement6>
<M_AddElement1>0</M_AddElement1>
<M_AddElement2>0</M_AddElement2>
<M_AddElement3>0</M_AddElement3>
<M_AddElement4>0</M_AddElement4>
<M_AddElement5>0</M_AddElement5>
<M_AddElement6>0</M_AddElement6>
</Details>
<CharacterData>
<Character id="cUid0">
<CharacterUID>0</CharacterUID>
<CharacterName>ロックゴーレム</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>4</InternalID>
<PopSpeed>25</PopSpeed>
<PopPoint_X>163.59</PopPoint_X>
<PopPoint_Y>71.53</PopPoint_Y>
</Character>
<Character id="cUid1">
<CharacterUID>1</CharacterUID>
<CharacterName>ロックゴーレム</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>4</InternalID>
<PopSpeed>25</PopSpeed>
<PopPoint_X>174.28</PopPoint_X>
<PopPoint_Y>81.84</PopPoint_Y>
</Character>
<Character id="cUid2">
<CharacterUID>2</CharacterUID>
<CharacterName>ロックゴーレム</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>4</InternalID>
<PopSpeed>25</PopSpeed>
<PopPoint_X>163.03</PopPoint_X>
<PopPoint_Y>34.34</PopPoint_Y>
</Character>
<Character id="cUid3">
<CharacterUID>3</CharacterUID>
<CharacterName>ロックゴーレム</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>4</InternalID>
<PopSpeed>25</PopSpeed>
<PopPoint_X>165.97</PopPoint_X>
<PopPoint_Y>48.00</PopPoint_Y>
</Character>
<Character id="cUid4">
<CharacterUID>4</CharacterUID>
<CharacterName>ロックゴーレム</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>4</InternalID>
<PopSpeed>20</PopSpeed>
<PopPoint_X>68.25</PopPoint_X>
<PopPoint_Y>78.81</PopPoint_Y>
</Character>
<Character id="cUid5">
<CharacterUID>5</CharacterUID>
<CharacterName>鷲狂戦士</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>1</InternalID>
<PopSpeed>20</PopSpeed>
<PopPoint_X>154.50</PopPoint_X>
<PopPoint_Y>24.75</PopPoint_Y>
</Character>
<Character id="cUid6">
<CharacterUID>6</CharacterUID>
<CharacterName>イリュージョン</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>2</InternalID>
<PopSpeed>20</PopSpeed>
<PopPoint_X>167.44</PopPoint_X>
<PopPoint_Y>26.50</PopPoint_Y>
</Character>
<Character id="cUid7">
<CharacterUID>7</CharacterUID>
<CharacterName>イリュージョン</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>2</InternalID>
<PopSpeed>20</PopSpeed>
<PopPoint_X>174.19</PopPoint_X>
<PopPoint_Y>31.06</PopPoint_Y>
</Character>
<Character id="cUid8">
<CharacterUID>8</CharacterUID>
<CharacterName>イリュージョン</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>2</InternalID>
<PopSpeed>20</PopSpeed>
<PopPoint_X>167.00</PopPoint_X>
<PopPoint_Y>41.50</PopPoint_Y>
</Character>
<Character id="cUid9">
<CharacterUID>9</CharacterUID>
<CharacterName>ロックゴーレム</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>4</InternalID>
<PopSpeed>25</PopSpeed>
<PopPoint_X>140.56</PopPoint_X>
<PopPoint_Y>56.81</PopPoint_Y>
</Character>
<Character id="cUid10">
<CharacterUID>10</CharacterUID>
<CharacterName>ロックゴーレム</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>4</InternalID>
<PopSpeed>25</PopSpeed>
<PopPoint_X>149.03</PopPoint_X>
<PopPoint_Y>60.66</PopPoint_Y>
</Character>
<Character id="cUid11">
<CharacterUID>11</CharacterUID>
<CharacterName>鷲狂戦士</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>1</InternalID>
<PopSpeed>20</PopSpeed>
<PopPoint_X>131.88</PopPoint_X>
<PopPoint_Y>70.28</PopPoint_Y>
</Character>
<Character id="cUid12">
<CharacterUID>12</CharacterUID>
<CharacterName>鷲狂戦士</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>1</InternalID>
<PopSpeed>20</PopSpeed>
<PopPoint_X>102.88</PopPoint_X>
<PopPoint_Y>80.50</PopPoint_Y>
</Character>
<Character id="cUid13">
<CharacterUID>13</CharacterUID>
<CharacterName>鷲狂戦士</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>1</InternalID>
<PopSpeed>20</PopSpeed>
<PopPoint_X>108.53</PopPoint_X>
<PopPoint_Y>87.63</PopPoint_Y>
</Character>
<Character id="cUid14">
<CharacterUID>14</CharacterUID>
<CharacterName>イリュージョン</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>2</InternalID>
<PopSpeed>20</PopSpeed>
<PopPoint_X>121.69</PopPoint_X>
<PopPoint_Y>73.81</PopPoint_Y>
</Character>
<Character id="cUid15">
<CharacterUID>15</CharacterUID>
<CharacterName>イリュージョン</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>2</InternalID>
<PopSpeed>12</PopSpeed>
<PopPoint_X>39.50</PopPoint_X>
<PopPoint_Y>80.81</PopPoint_Y>
</Character>
<Character id="cUid16">
<CharacterUID>16</CharacterUID>
<CharacterName>イリュージョン</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>2</InternalID>
<PopSpeed>12</PopSpeed>
<PopPoint_X>56.91</PopPoint_X>
<PopPoint_Y>75.75</PopPoint_Y>
</Character>
<Character id="cUid17">
<CharacterUID>17</CharacterUID>
<CharacterName>ロックゴーレム</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>4</InternalID>
<PopSpeed>20</PopSpeed>
<PopPoint_X>62.53</PopPoint_X>
<PopPoint_Y>79.78</PopPoint_Y>
</Character>
<Character id="cUid18">
<CharacterUID>18</CharacterUID>
<CharacterName>ロックゴーレム</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>4</InternalID>
<PopSpeed>20</PopSpeed>
<PopPoint_X>48.19</PopPoint_X>
<PopPoint_Y>80.72</PopPoint_Y>
</Character>
<Character id="cUid19">
<CharacterUID>19</CharacterUID>
<CharacterName>ロックゴーレム</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>4</InternalID>
<PopSpeed>25</PopSpeed>
<PopPoint_X>13.84</PopPoint_X>
<PopPoint_Y>78.59</PopPoint_Y>
</Character>
<Character id="cUid20">
<CharacterUID>20</CharacterUID>
<CharacterName>イリュージョン</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>2</InternalID>
<PopSpeed>20</PopSpeed>
<PopPoint_X>17.50</PopPoint_X>
<PopPoint_Y>70.69</PopPoint_Y>
</Character>
<Character id="cUid21">
<CharacterUID>21</CharacterUID>
<CharacterName>ロックゴーレム</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>4</InternalID>
<PopSpeed>25</PopSpeed>
<PopPoint_X>19.88</PopPoint_X>
<PopPoint_Y>58.91</PopPoint_Y>
</Character>
<Character id="cUid22">
<CharacterUID>22</CharacterUID>
<CharacterName>ロックゴーレム</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>4</InternalID>
<PopSpeed>25</PopSpeed>
<PopPoint_X>26.50</PopPoint_X>
<PopPoint_Y>52.56</PopPoint_Y>
</Character>
<Character id="cUid23">
<CharacterUID>23</CharacterUID>
<CharacterName>鷲狂戦士</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>1</InternalID>
<PopSpeed>15</PopSpeed>
<PopPoint_X>46.47</PopPoint_X>
<PopPoint_Y>53.38</PopPoint_Y>
</Character>
<Character id="cUid24">
<CharacterUID>24</CharacterUID>
<CharacterName>鷲狂戦士</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>1</InternalID>
<PopSpeed>15</PopSpeed>
<PopPoint_X>49.31</PopPoint_X>
<PopPoint_Y>66.97</PopPoint_Y>
</Character>
<Character id="cUid25">
<CharacterUID>25</CharacterUID>
<CharacterName>鷲狂戦士</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>1</InternalID>
<PopSpeed>15</PopSpeed>
<PopPoint_X>60.34</PopPoint_X>
<PopPoint_Y>62.66</PopPoint_Y>
</Character>
<Character id="cUid26">
<CharacterUID>26</CharacterUID>
<CharacterName>鷲狂戦士</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>1</InternalID>
<PopSpeed>15</PopSpeed>
<PopPoint_X>64.75</PopPoint_X>
<PopPoint_Y>53.66</PopPoint_Y>
</Character>
<Character id="cUid27">
<CharacterUID>27</CharacterUID>
<CharacterName>イリュージョン</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>2</InternalID>
<PopSpeed>12</PopSpeed>
<PopPoint_X>57.63</PopPoint_X>
<PopPoint_Y>56.66</PopPoint_Y>
</Character>
<Character id="cUid28">
<CharacterUID>28</CharacterUID>
<CharacterName>イリュージョン</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>2</InternalID>
<PopSpeed>12</PopSpeed>
<PopPoint_X>50.66</PopPoint_X>
<PopPoint_Y>62.50</PopPoint_Y>
</Character>
<Character id="cUid29">
<CharacterUID>29</CharacterUID>
<CharacterName>イリュージョン</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>2</InternalID>
<PopSpeed>20</PopSpeed>
<PopPoint_X>11.88</PopPoint_X>
<PopPoint_Y>61.78</PopPoint_Y>
</Character>
<Character id="cUid30">
<CharacterUID>30</CharacterUID>
<CharacterName>イリュージョン</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>2</InternalID>
<PopSpeed>12</PopSpeed>
<PopPoint_X>51.25</PopPoint_X>
<PopPoint_Y>75.03</PopPoint_Y>
</Character>
<Character id="cUid31">
<CharacterUID>31</CharacterUID>
<CharacterName>鷲狂戦士</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>1</InternalID>
<PopSpeed>20</PopSpeed>
<PopPoint_X>99.34</PopPoint_X>
<PopPoint_Y>44.72</PopPoint_Y>
</Character>
<Character id="cUid32">
<CharacterUID>32</CharacterUID>
<CharacterName>鷲狂戦士</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>1</InternalID>
<PopSpeed>20</PopSpeed>
<PopPoint_X>110.88</PopPoint_X>
<PopPoint_Y>48.81</PopPoint_Y>
</Character>
<Character id="cUid33">
<CharacterUID>33</CharacterUID>
<CharacterName>鷲狂戦士</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>1</InternalID>
<PopSpeed>20</PopSpeed>
<PopPoint_X>124.75</PopPoint_X>
<PopPoint_Y>32.06</PopPoint_Y>
</Character>
<Character id="cUid34">
<CharacterUID>34</CharacterUID>
<CharacterName>イリュージョン</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>2</InternalID>
<PopSpeed>20</PopSpeed>
<PopPoint_X>108.41</PopPoint_X>
<PopPoint_Y>34.66</PopPoint_Y>
</Character>
<Character id="cUid35">
<CharacterUID>35</CharacterUID>
<CharacterName>イリュージョン</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>2</InternalID>
<PopSpeed>20</PopSpeed>
<PopPoint_X>117.03</PopPoint_X>
<PopPoint_Y>39.91</PopPoint_Y>
</Character>
<Character id="cUid36">
<CharacterUID>36</CharacterUID>
<CharacterName>イリュージョン</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>2</InternalID>
<PopSpeed>20</PopSpeed>
<PopPoint_X>60.88</PopPoint_X>
<PopPoint_Y>20.03</PopPoint_Y>
</Character>
<Character id="cUid37">
<CharacterUID>37</CharacterUID>
<CharacterName>イリュージョン</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>2</InternalID>
<PopSpeed>20</PopSpeed>
<PopPoint_X>81.41</PopPoint_X>
<PopPoint_Y>20.91</PopPoint_Y>
</Character>
<Character id="cUid38">
<CharacterUID>38</CharacterUID>
<CharacterName>鷲狂戦士</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>1</InternalID>
<PopSpeed>20</PopSpeed>
<PopPoint_X>75.41</PopPoint_X>
<PopPoint_Y>16.63</PopPoint_Y>
</Character>
<Character id="cUid39">
<CharacterUID>39</CharacterUID>
<CharacterName>鷲狂戦士</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>1</InternalID>
<PopSpeed>20</PopSpeed>
<PopPoint_X>63.13</PopPoint_X>
<PopPoint_Y>27.34</PopPoint_Y>
</Character>
<Character id="cUid40">
<CharacterUID>40</CharacterUID>
<CharacterName>コロッサス</CharacterName>
<CharacterType>2</CharacterType>
<InternalID>0</InternalID>
<PopSpeed>600</PopSpeed>
<PopPoint_X>55.13</PopPoint_X>
<PopPoint_Y>68.88</PopPoint_Y>
</Character>
<Character id="cUid109">
<CharacterUID>109</CharacterUID>
<CharacterName>鉱員</CharacterName>
<CharacterType>1</CharacterType>
<InternalID>3</InternalID>
<PopSpeed>20</PopSpeed>
<PopPoint_X>7.66</PopPoint_X>
<PopPoint_Y>14.81</PopPoint_Y>
</Character>
<Character id="cUid110">
<CharacterUID>110</CharacterUID>
<CharacterName>鉱員</CharacterName>
<CharacterType>1</CharacterType>
<InternalID>3</InternalID>
<PopSpeed>20</PopSpeed>
<PopPoint_X>136.94</PopPoint_X>
<PopPoint_Y>12.41</PopPoint_Y>
</Character>
</CharacterData>
<AreaData>
<Area id="aUid0">
<AreaUID>0</AreaUID>
<AreaName>_필드 전체</AreaName>
<AreaType>0</AreaType>
<AccessMap></AccessMap>
<AccessMapName></AccessMapName>
<AreaPos_X>0.00</AreaPos_X>
<AreaPos_X2>0.00</AreaPos_X2>
<AreaPos_Y>0.00</AreaPos_Y>
<AreaPos_Y2>0.00</AreaPos_Y2>
<AreaExpansion>
</AreaExpansion>
</Area>
<Area id="aUid1">
<AreaUID>1</AreaUID>
<AreaName>_화면</AreaName>
<AreaType>0</AreaType>
<AccessMap></AccessMap>
<AccessMapName></AccessMapName>
<AreaPos_X>0.00</AreaPos_X>
<AreaPos_X2>0.00</AreaPos_X2>
<AreaPos_Y>0.00</AreaPos_Y>
<AreaPos_Y2>0.00</AreaPos_Y2>
<AreaExpansion>
</AreaExpansion>
</Area>
<Area id="aUid2">
<AreaUID>2</AreaUID>
<AreaName>폐광4층과연결쨈</AreaName>
<AreaType>3</AreaType>
<AccessMap>[040]M12_M01_B04.rmd</AccessMap>
<AccessMapName>廃坑 B4</AccessMapName>
<AreaPos_X>2.28</AreaPos_X>
<AreaPos_X2>5.56</AreaPos_X2>
<AreaPos_Y>16.63</AreaPos_Y>
<AreaPos_Y2>19.09</AreaPos_Y2>
<AreaExpansion>
</AreaExpansion>
</Area>
<Area id="aUid3">
<AreaUID>3</AreaUID>
<AreaName>B4로</AreaName>
<AreaType>3</AreaType>
<AccessMap>[066]T06_M01_B04.rmd</AccessMap>
<AccessMapName>鉄鉱山 B4</AccessMapName>
<AreaPos_X>192.84</AreaPos_X>
<AreaPos_X2>197.19</AreaPos_X2>
<AreaPos_Y>52.66</AreaPos_Y>
<AreaPos_Y2>55.41</AreaPos_Y2>
<AreaExpansion>
</AreaExpansion>
</Area>
<Area id="aUid4">
<AreaUID>4</AreaUID>
<AreaName>Area 3</AreaName>
<AreaType>4</AreaType>
<AccessMap></AccessMap>
<AccessMapName></AccessMapName>
<AreaPos_X>56.25</AreaPos_X>
<AreaPos_X2>83.69</AreaPos_X2>
<AreaPos_Y>13.25</AreaPos_Y>
<AreaPos_Y2>30.84</AreaPos_Y2>
<AreaExpansion>
</AreaExpansion>
</Area>
<Area id="aUid5">
<AreaUID>5</AreaUID>
<AreaName>Area 4</AreaName>
<AreaType>4</AreaType>
<AccessMap></AccessMap>
<AccessMapName></AccessMapName>
<AreaPos_X>9.63</AreaPos_X>
<AreaPos_X2>29.94</AreaPos_X2>
<AreaPos_Y>51.00</AreaPos_Y>
<AreaPos_Y2>62.81</AreaPos_Y2>
<AreaExpansion>
</AreaExpansion>
</Area>
<Area id="aUid6">
<AreaUID>6</AreaUID>
<AreaName>Area 5</AreaName>
<AreaType>4</AreaType>
<AccessMap></AccessMap>
<AccessMapName></AccessMapName>
<AreaPos_X>10.88</AreaPos_X>
<AreaPos_X2>21.81</AreaPos_X2>
<AreaPos_Y>64.25</AreaPos_Y>
<AreaPos_Y2>80.88</AreaPos_Y2>
<AreaExpansion>
</AreaExpansion>
</Area>
<Area id="aUid7">
<AreaUID>7</AreaUID>
<AreaName>Area 6</AreaName>
<AreaType>4</AreaType>
<AccessMap></AccessMap>
<AccessMapName></AccessMapName>
<AreaPos_X>41.41</AreaPos_X>
<AreaPos_X2>69.50</AreaPos_X2>
<AreaPos_Y>48.59</AreaPos_Y>
<AreaPos_Y2>57.44</AreaPos_Y2>
<AreaExpansion>
</AreaExpansion>
</Area>
<Area id="aUid8">
<AreaUID>8</AreaUID>
<AreaName>Area 7</AreaName>
<AreaType>4</AreaType>
<AccessMap></AccessMap>
<AccessMapName></AccessMapName>
<AreaPos_X>42.09</AreaPos_X>
<AreaPos_X2>70.00</AreaPos_X2>
<AreaPos_Y>57.94</AreaPos_Y>
<AreaPos_Y2>69.38</AreaPos_Y2>
<AreaExpansion>
</AreaExpansion>
</Area>
<Area id="aUid9">
<AreaUID>9</AreaUID>
<AreaName>Area 8</AreaName>
<AreaType>4</AreaType>
<AccessMap></AccessMap>
<AccessMapName></AccessMapName>
<AreaPos_X>37.91</AreaPos_X>
<AreaPos_X2>53.88</AreaPos_X2>
<AreaPos_Y>70.72</AreaPos_Y>
<AreaPos_Y2>82.56</AreaPos_Y2>
<AreaExpansion>
</AreaExpansion>
</Area>
<Area id="aUid10">
<AreaUID>10</AreaUID>
<AreaName>Area 9</AreaName>
<AreaType>4</AreaType>
<AccessMap></AccessMap>
<AccessMapName></AccessMapName>
<AreaPos_X>160.69</AreaPos_X>
<AreaPos_X2>179.41</AreaPos_X2>
<AreaPos_Y>67.31</AreaPos_Y>
<AreaPos_Y2>85.22</AreaPos_Y2>
<AreaExpansion>
</AreaExpansion>
</Area>
<Area id="aUid11">
<AreaUID>11</AreaUID>
<AreaName>Area 10</AreaName>
<AreaType>4</AreaType>
<AccessMap></AccessMap>
<AccessMapName></AccessMapName>
<AreaPos_X>158.38</AreaPos_X>
<AreaPos_X2>180.00</AreaPos_X2>
<AreaPos_Y>37.63</AreaPos_Y>
<AreaPos_Y2>50.56</AreaPos_Y2>
<AreaExpansion>
</AreaExpansion>
</Area>
<Area id="aUid12">
<AreaUID>12</AreaUID>
<AreaName>Area 11</AreaName>
<AreaType>4</AreaType>
<AccessMap></AccessMap>
<AccessMapName></AccessMapName>
<AreaPos_X>151.81</AreaPos_X>
<AreaPos_X2>179.56</AreaPos_X2>
<AreaPos_Y>23.16</AreaPos_Y>
<AreaPos_Y2>36.59</AreaPos_Y2>
<AreaExpansion>
</AreaExpansion>
</Area>
<Area id="aUid13">
<AreaUID>13</AreaUID>
<AreaName>Area 12</AreaName>
<AreaType>4</AreaType>
<AccessMap></AccessMap>
<AccessMapName></AccessMapName>
<AreaPos_X>54.13</AreaPos_X>
<AreaPos_X2>71.50</AreaPos_X2>
<AreaPos_Y>70.75</AreaPos_Y>
<AreaPos_Y2>82.47</AreaPos_Y2>
<AreaExpansion>
</AreaExpansion>
</Area>
<Area id="aUid14">
<AreaUID>14</AreaUID>
<AreaName>Area13</AreaName>
<AreaType>4</AreaType>
<AccessMap></AccessMap>
<AccessMapName></AccessMapName>
<AreaPos_X>104.66</AreaPos_X>
<AreaPos_X2>129.63</AreaPos_X2>
<AreaPos_Y>29.41</AreaPos_Y>
<AreaPos_Y2>40.88</AreaPos_Y2>
<AreaExpansion>
</AreaExpansion>
</Area>
<Area id="aUid15">
<AreaUID>15</AreaUID>
<AreaName>Area 14</AreaName>
<AreaType>4</AreaType>
<AccessMap></AccessMap>
<AccessMapName></AccessMapName>
<AreaPos_X>132.22</AreaPos_X>
<AreaPos_X2>156.41</AreaPos_X2>
<AreaPos_Y>51.75</AreaPos_Y>
<AreaPos_Y2>63.19</AreaPos_Y2>
<AreaExpansion>
</AreaExpansion>
</Area>
<Area id="aUid16">
<AreaUID>16</AreaUID>
<AreaName>Area 15</AreaName>
<AreaType>4</AreaType>
<AccessMap></AccessMap>
<AccessMapName></AccessMapName>
<AreaPos_X>115.91</AreaPos_X>
<AreaPos_X2>140.84</AreaPos_X2>
<AreaPos_Y>65.94</AreaPos_Y>
<AreaPos_Y2>78.91</AreaPos_Y2>
<AreaExpansion>
</AreaExpansion>
</Area>
<Area id="aUid17">
<AreaUID>17</AreaUID>
<AreaName>엘리베이터</AreaName>
<AreaType>3</AreaType>
<AccessMap>[063]T06_M01_B01.rmd</AccessMap>
<AccessMapName>鉄鉱山 B1</AccessMapName>
<AreaPos_X>138.09</AreaPos_X>
<AreaPos_X2>141.72</AreaPos_X2>
<AreaPos_Y>7.16</AreaPos_Y>
<AreaPos_Y2>9.22</AreaPos_Y2>
<AreaExpansion>
</AreaExpansion>
</Area>
<Area id="aUid18">
<AreaUID>18</AreaUID>
<AreaName>보물상자00</AreaName>
<AreaType>13</AreaType>
<AccessMap></AccessMap>
<AccessMapName></AccessMapName>
<AreaPos_X>96.00</AreaPos_X>
<AreaPos_X2>98.03</AreaPos_X2>
<AreaPos_Y>19.88</AreaPos_Y>
<AreaPos_Y2>20.97</AreaPos_Y2>
<AreaExpansion>
</AreaExpansion>
</Area>
<Area id="aUid19">
<AreaUID>19</AreaUID>
<AreaName>보물상자01</AreaName>
<AreaType>13</AreaType>
<AccessMap></AccessMap>
<AccessMapName></AccessMapName>
<AreaPos_X>12.16</AreaPos_X>
<AreaPos_X2>13.94</AreaPos_X2>
<AreaPos_Y>88.66</AreaPos_Y>
<AreaPos_Y2>89.84</AreaPos_Y2>
<AreaExpansion>
</AreaExpansion>
</Area>
<Area id="aUid20">
<AreaUID>20</AreaUID>
<AreaName>보물상자02</AreaName>
<AreaType>13</AreaType>
<AccessMap></AccessMap>
<AccessMapName></AccessMapName>
<AreaPos_X>100.16</AreaPos_X>
<AreaPos_X2>102.06</AreaPos_X2>
<AreaPos_Y>75.00</AreaPos_Y>
<AreaPos_Y2>75.91</AreaPos_Y2>
<AreaExpansion>
</AreaExpansion>
</Area>
<Area id="aUid21">
<AreaUID>21</AreaUID>
<AreaName>보물상자03</AreaName>
<AreaType>13</AreaType>
<AccessMap></AccessMap>
<AccessMapName></AccessMapName>
<AreaPos_X>180.06</AreaPos_X>
<AreaPos_X2>182.06</AreaPos_X2>
<AreaPos_Y>38.00</AreaPos_Y>
<AreaPos_Y2>39.19</AreaPos_Y2>
<AreaExpansion>
</AreaExpansion>
</Area>
<Area id="aUid22">
<AreaUID>22</AreaUID>
<AreaName>보물상자04</AreaName>
<AreaType>13</AreaType>
<AccessMap></AccessMap>
<AccessMapName></AccessMapName>
<AreaPos_X>162.13</AreaPos_X>
<AreaPos_X2>164.53</AreaPos_X2>
<AreaPos_Y>90.16</AreaPos_Y>
<AreaPos_Y2>91.03</AreaPos_Y2>
<AreaExpansion>
</AreaExpansion>
</Area>
<Area id="aUid23">
<AreaUID>23</AreaUID>
<AreaName>Area 22</AreaName>
<AreaType>4</AreaType>
<AccessMap></AccessMap>
<AccessMapName></AccessMapName>
<AreaPos_X>97.22</AreaPos_X>
<AreaPos_X2>115.53</AreaPos_X2>
<AreaPos_Y>76.03</AreaPos_Y>
<AreaPos_Y2>91.53</AreaPos_Y2>
<AreaExpansion>
</AreaExpansion>
</Area>
<Area id="aUid24">
<AreaUID>24</AreaUID>
<AreaName>Area 23</AreaName>
<AreaType>4</AreaType>
<AccessMap></AccessMap>
<AccessMapName></AccessMapName>
<AreaPos_X>96.25</AreaPos_X>
<AreaPos_X2>116.13</AreaPos_X2>
<AreaPos_Y>41.66</AreaPos_Y>
<AreaPos_Y2>52.38</AreaPos_Y2>
<AreaExpansion>
</AreaExpansion>
</Area>
<Area id="aUid25">
<AreaUID>25</AreaUID>
<AreaName>콜로의 활동범위</AreaName>
<AreaType>4</AreaType>
<AccessMap></AccessMap>
<AccessMapName></AccessMapName>
<AreaPos_X>20.25</AreaPos_X>
<AreaPos_X2>84.88</AreaPos_X2>
<AreaPos_Y>46.88</AreaPos_Y>
<AreaPos_Y2>88.00</AreaPos_Y2>
<AreaExpansion>
</AreaExpansion>
</Area>
</AreaData>
</MapData>


text:
require 'spec_helper'

describe Alchemist::Rituals::Result do

  let(:block)  { Proc.new { |user| user.name } }
  let(:finder) { Alchemist::Rituals::Result.new(&block) }

  describe "#call" do

    let(:user) { double(name: 'Timothy') }

    it "invokes the block given and returns the appropriate result" do
      expect(finder.call(user)).to eq("Timothy")
    end

  end

end


text:
include ApplicationHelper

class SearchController < ApplicationController
  before_action :authenticate_user!

  def index
    if (params[:query]  && !params[:query].empty?) || (params[:xquery] && !params[:xquery].empty?)
      @data = params[:query]
      @data ||= params[:xquery]
      @data = params[:xquery] if @data.empty?
      @searchType = params[:searchType]
      @searchType = 'Text' if !@searchType || @searchType.empty?
      query = current_user.queries.create(content: @data, searchType: @searchType, parentQuery_id: params[:parent]) if params[:parent] && params[:commit] == "Nested Search"
      query = current_user.queries.create(content: @data, searchType: @searchType) if !params[:parent] || params[:commit] == "New Search"
      @queries = getNestQueries(query, [])
      @searchTime = Time.now
      @basexQuery = QueryBasex.new(@queries, @searchType, nil, nil).call
      @parentID = query.id
      @resultsCount = @basexQuery.count / 4 if @basexQuery
      @searchTime = Time.now - @searchTime
    elsif params[:path]
      @file = QueryBasex.new(nil, nil, params[:path], nil).display
    end
  end

  def getNestQueries(query, queries)
    queries << query.content
    queries << query.searchType
    return queries unless query.parentQuery_id
    getNestQueries(Query.find(query.parentQuery_id), queries)
  end

  def create
    if params[:mode] == 'download'
      queries = getNestQueries(current_user.queries.last, [])
      file = QueryBasex.new(queries, params[:searchType], nil, nil).bulkDownload
      send_file file.path, type: 'application/zip', disposition: 'attachment', filename: 'search-results.zip'
      file.close
    elsif params[:mode] == 'delete'
      QueryBasex.new(nil, nil, params[:path], nil).delete
      redirect_to controller: 'browse', mode: 'display', path: params[:path].rpartition('/').first
    else
      @file = QueryBasex.new(nil, nil, params[:path], nil).display
      send_data @file, filename: "#{params[:path].split('/').last}"
    end
  end
end


text:
<html><body>Checks whether conversion method call (toInt, toString, etc) is redundant, i.e. whether the type of expression is the same as the converter method result type.
</body></html>


text:
Gatling is a load test tool.
It officially supports HTTP, WebSocket, Server-Sent-Events and JMS.

## Motivation

* Finding fancy GUIs not that convenient for describing load tests, what you want is a friendly expressive DSL?
* Wanting something more convenient than huge XML dumps to store in your source version control system?
* Fed up with having to host a farm of injecting servers because your tool uses blocking IO and one-thread-per-user architecture?

Gatling is for you!

## Underlying technologies

Gatling is developed in Scala and built upon :

* [Netty](https://netty.io) for non blocking HTTP
* [Akka](https://akka.io) for virtual users orchestration
...

## Questions, help?

Read the [documentation](https://gatling.io/docs/current/).

Join the [Gatling Community Forum](https://community.gatling.io).

Found a real bug? Raise an [issue](https://github.com/gatling/gatling/issues).

## Partners

<img alt="Takima" src="https://raw.githubusercontent.com/gatling/gatling/main/images/logo-takima-1-nom-bas.png" width="80">
![Highsoft AS](https://raw.githubusercontent.com/gatling/gatling/main/images/highsoft_logo.png)