text:
RSpec.configure do |config|
  # rspec-expectations config goes here. You can use an alternate
  # assertion/expectation library such as wrong or the stdlib/minitest
  # assertions if you prefer.
  config.expect_with :rspec do |expectations|
    # This option will default to `true` in RSpec 4. It makes the `description`
    # and `failure_message` of custom matchers include text for helper methods
    # defined using `chain`, e.g.:
    #     be_bigger_than(2).and_smaller_than(4).description
    #     # => "be bigger than 2 and smaller than 4"
    # ...rather than:
    #     # => "be bigger than 2"
    expectations.include_chain_clauses_in_custom_matcher_descriptions = true
  end

  # rspec-mocks config goes here. You can use an alternate test double
  # library (such as bogus or mocha) by changing the `mock_with` option here.
  config.mock_with :rspec do |mocks|
    # Prevents you from mocking or stubbing a method that does not exist on
    # a real object. This is generally recommended, and will default to
    # `true` in RSpec 4.
    mocks.verify_partial_doubles = true
  end
  config.shared_context_metadata_behavior = :apply_to_host_groups
  config.filter_run_when_matching :focus
  config.disable_monkey_patching!

  if config.files_to_run.one?
    config.default_formatter = "doc"
  end

  # Run specs in random order to surface order dependencies. If you find an
  # order dependency and want to debug it, you can fix the order by providing
  # the seed, which is printed after each run.
  #     --seed 1234
  config.order = :random

  # Seed global randomization in this process using the `--seed` CLI option.
  # Setting this allows you to use `--seed` to deterministically reproduce
  # test failures related to randomization by passing the same `--seed` value
  # as the one that triggered the failure.
  Kernel.srand config.seed
end


text:
import http from 'http';
import world from './world.js';

let webServer;

function hooks() {
  this.registerHandler('BeforeFeatures', function(event, callback) {
    if (process.env.TEST_WEBSERVER) {
      console.log('Starting local test server');
      startLocalWebServer();
    }

    callback();
  });

  this.registerHandler('AfterFeatures', function(event, callback) {
    world().getDriver().quit().then(callback);
  });

};

function startLocalWebServer() {
  let finalhandler = require('finalhandler');
  let serveStatic = require('serve-static');

  let serve = serveStatic(process.env.TEST_WEBSERVER);

  webServer = http.createServer(function(req, res) {
    let done = finalhandler(req, res);
    serve(req, res, done);
  });

  webServer.listen(8080);
}

module.exports = hooks;

redpajama_set_name: RedPajamaGithub


text:
package in.twizmwaz.cardinal.module.modules.filter.parsers;

import in.twizmwaz.cardinal.module.modules.filter.FilterParser;
import org.bukkit.Material;
import org.jdom2.Element;

public class ItemFilterParser extends FilterParser {

    private Material material;

    public ItemFilterParser(final Element element) {
        super(element);
        material = Material.matchMaterial(element.getChild("item").getText());
    }

    public Material getMaterial() {
        return material;
    }
}


text:
namespace winrt::SDKTemplate::implementation
{
    struct Scenario4_CharacterGrouping : Scenario4_CharacterGroupingT<Scenario4_CharacterGrouping>
    {
        Scenario4_CharacterGrouping();

        void GetGroups_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);
        void AssignGroup_Click(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& e);

    private:
        SDKTemplate::MainPage rootPage{ MainPage::Current() };
        Windows::Globalization::Collation::CharacterGroupings ActiveGroupings{ nullptr };
        std::map<hstring, Windows::UI::Xaml::UIElement> Groups;
        static constexpr wchar_t GlobeString[] = L"\U0001F310";

        void AddGroup(hstring const& label, Windows::UI::Xaml::UIElement const& element);
    };
}

namespace winrt::SDKTemplate::factory_implementation
{
    struct Scenario4_CharacterGrouping : Scenario4_CharacterGroupingT<Scenario4_CharacterGrouping, implementation::Scenario4_CharacterGrouping>
    {
    };
}


text:
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">

  <title>cocos.audio.SDL.error</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />

      Trees

      Indices

          cocos . audio . SDL . error

        Toggle frames

Module cocos.audio.SDL.error

Error detection and error handling functions.

Classes

        SDL_Exception

Exception raised for all SDL errors.

        SDL_NotImplementedError

Exception raised when the available SDL library predates the
requested function.

Variables

        __package__ = 'cocos.audio.SDL'

      Trees

      Indices

          cocos . audio . SDL . error

        Toggle frames

    Generated by Epydoc 3.0beta1 on Sun Aug 12 20:39:17 2012

      http://epydoc.sourceforge.net


text:
package org.jf.dexlib2.iface.debug;

import java.io.Serializable;

/**
 * This class represents a generic debug item.
 *
 * The specific sub-types of this class correspond to the various debug opcodes specified in the debug_info_item type
 * in the dex file specification.
 */
public interface DebugItem extends Serializable {
    /**
     * The type of this debug item.
     *
     * The returned integer will be one of the DebugItemType.* constants.
     *
     * @return The type of this debug item.
     */
    int getDebugItemType();

    /**
     * @return The code address
     */
    int getCodeAddress();
}


text:
extern "C" {
  void* _ReturnAddress();
}
#endif

#include "base/location.h"
#include "base/stringprintf.h"
#include "base/strings/string_number_conversions.h"

namespace tracked_objects {

Location::Location(const char* function_name,
                   const char* file_name,
                   int line_number,
                   const void* program_counter)
    : function_name_(function_name),
      file_name_(file_name),
      line_number_(line_number),
      program_counter_(program_counter) {
}

Location::Location()
    : function_name_("Unknown"),
      file_name_("Unknown"),
      line_number_(-1),
      program_counter_(NULL) {
}

std::string Location::ToString() const {
  return std::string(function_name_) + "@" + file_name_ + ":" +
      base::IntToString(line_number_);
}

void Location::Write(bool display_filename, bool display_function_name,
                     std::string* output) const {
  base::StringAppendF(output, "%s[%d] ",
      display_filename ? file_name_ : "line",
      line_number_);

  if (display_function_name) {
    WriteFunctionName(output);
    output->push_back(' ');
  }
}

void Location::WriteFunctionName(std::string* output) const {
  // Translate "<" to "<" for HTML safety.
  // TODO(jar): Support ASCII or html for logging in ASCII.
  for (const char *p = function_name_; *p; p++) {
    switch (*p) {
      case '<':
        output->append("<");
        break;

      case '>':
        output->append(">");
        break;

      default:
        output->push_back(*p);
        break;
    }
  }
}

//------------------------------------------------------------------------------
LocationSnapshot::LocationSnapshot() : line_number(-1) {
}

LocationSnapshot::LocationSnapshot(
    const tracked_objects::Location& location)
    : file_name(location.file_name()),
      function_name(location.function_name()),
      line_number(location.line_number()) {
}

LocationSnapshot::~LocationSnapshot() {
}

//------------------------------------------------------------------------------
#if defined(COMPILER_MSVC)
__declspec(noinline)
#endif
BASE_EXPORT const void* GetProgramCounter() {
#if defined(COMPILER_MSVC)
  return _ReturnAddress();
#elif defined(COMPILER_GCC)
  return __builtin_extract_return_addr(__builtin_return_address(0));
#endif  // COMPILER_GCC

  return NULL;
}

}  // namespace tracked_objects


text:
#ifndef __StreamSerialiser_H__
#define __StreamSerialiser_H__

#include "OgrePrerequisites.h"
#include "OgreCommon.h"
#include "OgreDataStream.h"
#include "OgreHeaderPrefix.h"

namespace Ogre
{
    /** \addtogroup Core
    *  @{
    */
    /** \addtogroup Resources
    *  @{
    */

    /** Utility class providing helper methods for reading / writing
        structured data held in a DataStream.
    @remarks
        The structure of a file read / written by this class is a series of
        'chunks'. A chunk-based format has the advantage of being extensible later,
        and it's robust, in that a reader can skip chunks that they are not
        able (or willing) to process.
    @par
        Chunks are contained serially in the file, but they can also be
        nested in order both to provide context, and to group chunks together for
        potential skipping.
    @par
        The data format of a chunk is as follows:
        -# Chunk ID (32-bit uint). This can be any number unique in a context, except the numbers 0x0000, 0x0001 and 0x1000, which are reserved for Ogre's use
        -# Chunk version (16-bit uint). Chunks can change over time so this version number reflects that
        -# Length (32-bit uint). The length of the chunk data section, including nested chunks. Note that
            this length excludes this header, but includes the header of any nested chunks.
        -# Checksum (32-bit uint). Checksum value generated from the above - basically lets us check this is a valid chunk.
        -# Chunk data
        The 'Chunk data' section will contain chunk-specific data, which may include
        other nested chunks.
    */
    class _OgreExport StreamSerialiser : public StreamAlloc
    {
    public:
        /// The endianness of files
        enum Endian
        {
            /// Automatically determine endianness
            ENDIAN_AUTO,
            /// Use big endian (0x1000 is serialised as 0x10 0x00)
            ENDIAN_BIG,
            /// Use little endian (0x1000 is serialised as 0x00 0x10)
            ENDIAN_LITTLE
        };

        /// The storage format of Real values
        enum RealStorageFormat
        {
            /// Real is stored as float, reducing precision if you're using OGRE_DOUBLE_PRECISION
            REAL_FLOAT,
            /// Real as stored as double, not useful unless you're using OGRE_DOUBLE_PRECISION
            REAL_DOUBLE
        };

        /// Definition of a chunk of data in a file
        struct Chunk : public StreamAlloc
        {
            /// Identifier of the chunk (for example from makeIdentifier)  (stored)
            uint32 id;
            /// Version of the chunk (stored)
            uint16 version;
            /// Length of the chunk data in bytes, excluding the header of this chunk (stored)
            uint32 length;
            /// Location of the chunk (header) in bytes from the start of a stream (derived)
            uint32 offset;

            Chunk() : id(0), version(1), length(0), offset(0) {}
        };

        /** Constructor.
        @param stream The stream on which you will read / write data.
        @param endianMode The endian mode in which to read / writedata. If left at
            the default, when writing the endian mode will be the native platform mode,
            and when reading it's expected that the first chunk encountered will be
            the header chunk, which will determine the endian mode.
        @param autoHeader If true, the first write or read to this stream will
            automatically read / write the header too. This is required if you
            set endianMode to ENDIAN_AUTO, but if you manually set the endian mode,
            then you can skip writing / reading the header if you wish, if for example
            this stream is midway through a file which has already included header
            information.
        @param realFormat Set the format you want to write reals in. Only useful for files that
            you're writing (since when reading this is picked up from the file),
            and can only be changed if autoHeader is true, since real format is stored in the header.
            Defaults to float unless you're using OGRE_DOUBLE_PRECISION.
        */
        StreamSerialiser(const DataStreamPtr& stream, Endian endianMode = ENDIAN_AUTO,
            bool autoHeader = true,
#if OGRE_DOUBLE_PRECISION
            RealStorageFormat realFormat = REAL_DOUBLE
#else
            RealStorageFormat realFormat = REAL_FLOAT
#endif
            );
        virtual ~StreamSerialiser();

        /** Get the endian mode.
        @remarks
            If the result is ENDIAN_AUTO, this mode will change when the first piece of
            data is read / written.
        */
        virtual Endian getEndian() const { return mEndian; }

        /** Pack a 4-character code into a 32-bit identifier.
        @remarks
            You can use this to generate id's for your chunks based on friendlier
            4-character codes rather than assigning numerical IDs, if you like.
        @param code String to pack - must be 4 characters and '\0'
        */
        static uint32 makeIdentifier(const char (&code)[5]);

        /** Report the current depth of the chunk nesting, whether reading or writing.
        @remarks
            Returns how many levels of nested chunks are currently being processed,
            either writing or reading. In order to tidily finish, you must call
            read/writeChunkEnd this many times.
        */
        size_t getCurrentChunkDepth() const { return mChunkStack.size(); }

        /** Get the ID of the chunk that's currently being read/written, if any.
        @return The id of the current chunk being read / written (at the tightest
            level of nesting), or zero if no chunk is being processed.
        */
        uint32 getCurrentChunkID() const;

        /** Get the current byte position relative to the start of the data section
            of the last chunk that was read or written.
        @return the offset. Note that a return value of 0 means that either the
            position is at the start of the chunk data section (ie right after the
            header), or that no chunk is currently active. Use getCurrentChunkID
            or getCurrentChunkDepth to determine if a chunk is active.
        */
        size_t getOffsetFromChunkStart() const;

        /** Reads the start of the next chunk in the file.
        @remarks
            Files are serialised in a chunk-based manner, meaning that each section
            of data is prepended by a chunk header. After reading this chunk header,
            the next set of data is available directly afterwards.
        @note
            When you have finished with this chunk, you should call readChunkEnd.
            This will perform a bit of validation and clear the chunk from
            the stack.
        @return The Chunk that comes next
        */
        virtual const Chunk* readChunkBegin();

        /** Reads the start of the next chunk so long as it's of a given ID and version.
        @remarks
            This method operates like readChunkBegin, except it checks the ID and
            version.
        @param id The ID you're expecting. If the next chunk isn't of this ID, then
            the chunk read is undone and the method returns null.
        @param maxVersion The maximum version you're able to process. If the ID is correct
            but the version exceeds what is passed in here, the chunk is skipped over,
            the problem logged and null is returned.
        @param msg Descriptive text added to the log if versions are not compatible
        @return The chunk if it passes the validation.
        */
        virtual const Chunk* readChunkBegin(uint32 id, uint16 maxVersion, const String& msg = BLANKSTRING);

        /** Call this to 'rewind' the stream to just before the start of the current
            chunk.
        @remarks
            The most common case of wanting to use this is if you'd calledReadChunkBegin(),
            but the chunk you read wasn't one you wanted to process, and rather than
            skipping over it (which readChunkEnd() would do), you want to backtrack
            and give something else an opportunity to read it.
        @param id The id of the chunk that you were reading (for validation purposes)
        */
        virtual void undoReadChunk(uint32 id);

        /** Call this to 'peek' at the next chunk ID without permanently moving the stream pointer. */
        virtual uint32 peekNextChunkID();

        /** Finish the reading of a chunk.
        @remarks
            You can call this method at any point after calling readChunkBegin, even
            if you didn't read all the rest of the data in the chunk. If you did
            not read to the end of a chunk, this method will automatically skip
            over the remainder of the chunk and position the stream just after it.
        @param id The id of the chunk that you were reading (for validation purposes)
        */
        virtual void readChunkEnd(uint32 id);

        /** Return whether the current data pointer is at the end of the current chunk.
        @param id The id of the chunk that you were reading (for validation purposes)
        */
        virtual bool isEndOfChunk(uint32 id);

        /// Reports whether the stream is at the end of file
        virtual bool eof() const;

        /** Get the definition of the current chunk being read (if any). */
        virtual const Chunk* getCurrentChunk() const;

        /** Begin writing a new chunk.
        @remarks
            This starts the process of writing a new chunk to the stream. This will
            write the chunk header for you, and store a pointer so that the
            class can automatically go back and fill in the size for you later
            should you need it to. If you have already begun a chunk without ending
            it, then this method will start a nested chunk within it. Once written,
            you can then start writing chunk-specific data into your stream.
        @note If this is the first chunk in the file
        @param id The identifier of the new chunk. Any value that's unique in the
            file context is valid, except for the numbers 0x0001 and 0x1000 which are reserved
            for internal header identification use.
        @param version The version of the chunk you're writing
        */
        virtual void writeChunkBegin(uint32 id, uint16 version = 1);
        /** End writing a chunk.
        @param id The identifier of the chunk - this is really just a safety check,
            since you can only end the chunk you most recently started.
        */
        virtual void writeChunkEnd(uint32 id);

        /** Write arbitrary data to a stream.
        @param buf Pointer to bytes
        @param size The size of each element to write; each will be endian-flipped if
            necessary
        @param count The number of elements to write
        */
        virtual void writeData(const void* buf, size_t size, size_t count);

        /** Catch-all method to write primitive types. */
        template <typename T>
        void write(const T* pT, size_t count = 1)
        {
            writeData(pT, sizeof(T), count);
        }

        // Special-case Real since we need to deal with single/double precision
        virtual void write(const Real* val, size_t count = 1);

        virtual void write(const Vector2* vec, size_t count = 1);
        virtual void write(const Vector3* vec, size_t count = 1);
        virtual void write(const Vector4* vec, size_t count = 1);
        virtual void write(const Quaternion* q, size_t count = 1);
        virtual void write(const Matrix3* m, size_t count = 1);
        virtual void write(const Matrix4* m, size_t count = 1);
        virtual void write(const String* string);
        virtual void write(const AxisAlignedBox* aabb, size_t count = 1);
        virtual void write(const Sphere* sphere, size_t count = 1);
        virtual void write(const Plane* plane, size_t count = 1);
        virtual void write(const Ray* ray, size_t count = 1);
        virtual void write(const Radian* angle, size_t count = 1);
        virtual void write(const Node* node, size_t count = 1);
        virtual void write(const bool* boolean, size_t count = 1);

        /** Read arbitrary data from a stream.
        @param buf Pointer to bytes
        @param size The size of each element to read; each will be endian-flipped if
        necessary
        @param count The number of elements to read
        */
        virtual void readData(void* buf, size_t size, size_t count);

        /** Catch-all method to read primitive types. */
        template <typename T>
        void read(T* pT, size_t count = 1)
        {
            readData(pT, sizeof(T), count);
        }

        // Special case Real, single/double-precision issues
        virtual void read(Real* val, size_t count = 1);

        /// read a Vector3
        virtual void read(Vector2* vec, size_t count = 1);
        virtual void read(Vector3* vec, size_t count = 1);
        virtual void read(Vector4* vec, size_t count = 1);
        virtual void read(Quaternion* q, size_t count = 1);
        virtual void read(Matrix3* m, size_t count = 1);
        virtual void read(Matrix4* m, size_t count = 1);
        virtual void read(String* string);
        virtual void read(AxisAlignedBox* aabb, size_t count = 1);
        virtual void read(Sphere* sphere, size_t count = 1);
        virtual void read(Plane* plane, size_t count = 1);
        virtual void read(Ray* ray, size_t count = 1);
        virtual void read(Radian* angle, size_t count = 1);
        virtual void read(Node* node, size_t count = 1);
        virtual void read(bool* val, size_t count = 1);

        /** Start (un)compressing data
        @param avail_in Available bytes for uncompressing
        */
        virtual void startDeflate(size_t avail_in = 0);
        /** Stop (un)compressing data
        */
        virtual void stopDeflate();
    protected:
        DataStreamPtr mStream;
        DataStreamPtr mOriginalStream;
        Endian mEndian;
        bool mFlipEndian;
        bool mReadWriteHeader;
        RealStorageFormat mRealFormat;
        typedef deque<Chunk*>::type ChunkStack;
        /// Current list of open chunks
        ChunkStack mChunkStack;

        static uint32 HEADER_ID;
        static uint32 REVERSE_HEADER_ID;
        static uint32 CHUNK_HEADER_SIZE;

        virtual Chunk* readChunkImpl();
        virtual void writeChunkImpl(uint32 id, uint16 version);
        virtual void readHeader();
        virtual void writeHeader();
        virtual uint32 calculateChecksum(Chunk* c);
        virtual void checkStream(bool failOnEof = false,
            bool validateReadable = false, bool validateWriteable = false) const;

        virtual void determineEndianness();
        virtual Chunk* popChunk(uint id);

        virtual void writeFloatsAsDoubles(const float* val, size_t count);
        virtual void writeDoublesAsFloats(const double* val, size_t count);
        virtual void readFloatsAsDoubles(double* val, size_t count);
        virtual void readDoublesAsFloats(float* val, size_t count);
        template <typename T, typename U>
        void writeConverted(const T* src, U typeToWrite, size_t count)
        {
            U* tmp = OGRE_ALLOC_T(U, count, MEMCATEGORY_GENERAL);
            U* pDst = tmp;
            const T* pSrc = src;
            for (size_t i = 0; i < count; ++i)
                *pDst++ = static_cast<U>(*pSrc++);

            writeData(tmp, sizeof(U), count);

            OGRE_FREE(tmp, MEMCATEGORY_GENERAL);
        }
        template <typename T, typename U>
        void readConverted(T* dst, U typeToRead, size_t count)
        {
            U* tmp = OGRE_ALLOC_T(U, count, MEMCATEGORY_GENERAL);
            readData(tmp, sizeof(U), count);

            T* pDst = dst;
            const U* pSrc = tmp;
            for (size_t i = 0; i < count; ++i)
                *pDst++ = static_cast<T>(*pSrc++);

            OGRE_FREE(tmp, MEMCATEGORY_GENERAL);
        }

    };
    /** @} */
    /** @} */
}

#include "OgreHeaderSuffix.h"

#endif


text:
@interface PodsDummy_Redux : NSObject
@end
@implementation PodsDummy_Redux
@end


text:
/* desktop.css */
@import url("bootstrap.css");
@import url("commonstyles.css");


text:
#define SHEDIT_DEBUG_REPAINT false

#ifndef _DEBUG
#define NDEBUG       //disables asserts (iff this header is included before the assert header)
#endif

#define DOUBLE_BUFFERED
#define FULL_WIDTH_PAINT
#define TAB_WIDTH 2
//define DRAW_POS
#define ALLOW_TABS

#define KEEP_VIS_TOP 4
#define KEEP_VIS_BOTTOM 4

#define MARGINS 50  //for horizontal adjustment

#define PARSEINADVANCE 1000
#define PARSEINONEGO 100

#define DEFONTSIZE 10

//define QUICKDRAW    //single, non-transparent pass vs double pass - should be much faster, but cuts off the rightmost pixel columns of some words
#define FORCELOOKAHEAD true

#define MAX_SCROLL_STEP 12
#define Y_OFF 0
#define X_OFF 2

#define FIXSCREENTOP

//NOTICE: what is not (un)set as default is NOT guaranteed to work


text:
package commonStubs

var TimeZone string

func init() {

	TimeZone = `
package model

import (
	"errors"
	"time"
)

// TimeZoneValidLocation returns true if the given string can be found as a
// timezone location in the timezone.Locations array.
func TimeZoneValidLocation(s string) bool {
	for _, zone := range TimeZoneLocations {
		if zone.Location == s {
			return true
		}
	}
	return false
}

// TimeZoneOffset returns the abbreviated name of the zone of l (such as "CET")
// and its offset in seconds east of UTC. The location should be valid IANA
// timezone location.
func TimeZoneOffset(loc string) (zone string, offset int, err error) {
	l, err := time.LoadLocation(loc)
	if err != nil {
		return zone, offset, err
	}
	zone, offset = time.Now().In(l).Zone()
	return zone, offset, nil
}

// TimeZoneCountry returns all timezones with given country name.
// If none is found, returns an error.
func TimeZoneCountry(c string) ([]Timezone, error) {
	var z []Timezone
	for _, zone := range TimeZoneLocations {
		if zone.Country == c {
			z = append(z, zone)
		}
	}
	if len(z) == 0 {
		return z, errors.New("no timezones found")
	}
	return z, nil
}

// TimeZoneCode returns all timezones with given country code.
// If none is found, returns an error.
func TimeZoneCode(c string) ([]Timezone, error) {
	var z []Timezone
	for _, zone := range TimeZoneLocations {
		if zone.Code == c {
			z = append(z, zone)
		}
	}
	if len(z) == 0 {
		return z, errors.New("no timezones found")
	}
	return z, nil
}
`
}


text:
require 'fog/core/collection'
require 'fog/openstack/models/image/image'

module Fog
  module Image
    class OpenStack
      class Images < Fog::Collection
        model Fog::Image::OpenStack::Image

        def all
          load(service.list_public_images_detailed.body['images'])
        end

        def details(attribute=nil, query=nil)
          load(service.list_public_images_detailed(attribute, query).body['images'])
        end

        def find_by_id(id)
          all.find {|image| image.id == id}
        end
        alias_method :get, :find_by_id

        def public
          images = load(service.list_public_images_detailed.body['images'])
          images.delete_if{|image| image.is_public == false}
        end

        def private
          images = load(service.list_public_images_detailed.body['images'])
          images.delete_if{|image| image.is_public}
        end

        def destroy(id)
          image = self.find_by_id(id)
          image.destroy
        end

        def method_missing(method_sym, *arguments, &block)
          if method_sym.to_s =~ /^find_by_(.*)$/
            load(service.list_public_images_detailed($1 ,arguments.first).body['images'])
          else
            super
          end
        end

        def find_by_size_min(size)
          find_attribute(__method__, size)
        end

        def find_by_size_max(size)
          find_attribute(__method__, size)
        end

        def find_attribute(attribute,value)
          attribute = attribute.to_s.gsub("find_by_", "")
          load(service.list_public_images_detailed(attribute , value).body['images'])
        end
      end
    end
  end
end


text:
using content::BrowserThread;

namespace safe_browsing {

ThreatDetailsRedirectsCollector::ThreatDetailsRedirectsCollector(
    const base::WeakPtr<history::HistoryService>& history_service)
    : has_started_(false), history_service_(history_service) {
  DCHECK_CURRENTLY_ON(BrowserThread::UI);

  if (history_service) {
    history_service_observation_.Observe(history_service.get());
  }
}

void ThreatDetailsRedirectsCollector::StartHistoryCollection(
    const std::vector<GURL>& urls,
    base::OnceClosure callback) {
  DVLOG(1) << "Num of urls to check in history service: " << urls.size();
  has_started_ = true;
  callback_ = std::move(callback);

  if (urls.size() == 0) {
    AllDone();
    return;
  }

  content::GetUIThreadTaskRunner({})->PostTask(
      FROM_HERE,
      base::BindOnce(&ThreatDetailsRedirectsCollector::StartGetRedirects, this,
                     urls));
}

bool ThreatDetailsRedirectsCollector::HasStarted() const {
  return has_started_;
}

const std::vector<RedirectChain>&
ThreatDetailsRedirectsCollector::GetCollectedUrls() const {
  return redirects_urls_;
}

ThreatDetailsRedirectsCollector::~ThreatDetailsRedirectsCollector() {}

void ThreatDetailsRedirectsCollector::StartGetRedirects(
    const std::vector<GURL>& urls) {
  // History access from profile needs to happen in UI thread
  DCHECK_CURRENTLY_ON(BrowserThread::UI);
  for (size_t i = 0; i < urls.size(); ++i) {
    urls_.push_back(urls[i]);
  }
  urls_it_ = urls_.begin();
  GetRedirects(*urls_it_);
}

void ThreatDetailsRedirectsCollector::GetRedirects(const GURL& url) {
  DCHECK_CURRENTLY_ON(BrowserThread::UI);

  if (!history_service_) {
    AllDone();
    return;
  }

  history_service_->QueryRedirectsTo(
      url,
      base::BindOnce(&ThreatDetailsRedirectsCollector::OnGotQueryRedirectsTo,
                     base::Unretained(this), url),
      &request_tracker_);
}

void ThreatDetailsRedirectsCollector::OnGotQueryRedirectsTo(
    const GURL& url,
    history::RedirectList redirect_list) {
  if (!redirect_list.empty()) {
    std::vector<GURL> urllist;
    urllist.push_back(url);
    urllist.insert(urllist.end(), redirect_list.begin(), redirect_list.end());
    redirects_urls_.push_back(urllist);
  }

  // Proceed to next url
  ++urls_it_;

  if (urls_it_ == urls_.end()) {
    AllDone();
    return;
  }

  GetRedirects(*urls_it_);
}

void ThreatDetailsRedirectsCollector::AllDone() {
  DVLOG(1) << "AllDone";
  content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE, std::move(callback_));
}

void ThreatDetailsRedirectsCollector::HistoryServiceBeingDeleted(
    history::HistoryService* history_service) {
  DCHECK(history_service_observation_.IsObservingSource(history_service));
  history_service_observation_.Reset();
  history_service_.reset();
}

}  // namespace safe_browsing


text:
/**
 *
 * This class is used for managing the drop zone for each container.
 *
 * @private
 *
 */
Ext.define('Ext.pivot.plugin.configurator.DropZone', {
    extend: 'Ext.dd.DropZone',

    proxyOffsets: [-4, -9],
    configPanelCls:     Ext.baseCSSPrefix + 'pivot-grid-config-container-body',
    configColumnCls:    Ext.baseCSSPrefix + 'pivot-grid-config-column',

    constructor: function(panel){
        this.panel = panel;
        this.ddGroup = this.getDDGroup();
        this.callParent([panel.id]);
    },

    disable: function() {
        this.disabled = true;
    },

    enable: function() {
        this.disabled = false;
    },

    getDDGroup: function() {
        // return the column header dd group so we can allow column droping inside the grouping panel
        return 'configurator-' + this.panel.up('gridpanel').id;
    },

    getTargetFromEvent : function(e){
        return e.getTarget('.' + this.configColumnCls) || e.getTarget('.' + this.configPanelCls);
    },

    getTopIndicator: function() {
        if (!this.topIndicator) {
            this.self.prototype.topIndicator = Ext.DomHelper.append(Ext.getBody(), {
                cls: 'col-move-top ' + Ext.baseCSSPrefix + 'col-move-top',
                html: " "
            }, true);
            this.self.prototype.indicatorXOffset = Math.floor((this.topIndicator.dom.offsetWidth + 1) / 2);
        }
        return this.topIndicator;
    },

    getBottomIndicator: function() {
        if (!this.bottomIndicator) {
            this.self.prototype.bottomIndicator = Ext.DomHelper.append(Ext.getBody(), {
                cls: 'col-move-bottom ' + Ext.baseCSSPrefix + 'col-move-bottom',
                html: " "
            }, true);
        }
        return this.bottomIndicator;
    },

    getLocation: function(e, t) {
        var x      = e.getXY()[0],
            target = Ext.getCmp(t.id),
            region,
            pos;

        if(target instanceof Ext.pivot.plugin.configurator.Container){
            // that means that the column is dragged above the grouping panel so find out if there are any columns already
            if(target.items.getCount() > 0){
                // now fetch the position of the last item
                region = Ext.fly(target.items.last().el).getRegion();
            }else{
                region = new Ext.util.Region(0, 1000000, 0, 0);
            }
        }else{
            region = Ext.fly(t).getRegion();
        }

        if ((region.right - x) <= (region.right - region.left) / 2) {
            pos = "after";
        } else {
            pos = "before";
        }
        return {
            pos: pos,
            header: Ext.getCmp(t.id),
            node: t
        };
    },

    positionIndicator: function(data, node, e){
        var me = this,
            dragHeader   = data.header,
            dropLocation = me.getLocation(e, node),
            targetHeader = dropLocation.header,
            pos          = dropLocation.pos,
            nextHd,
            prevHd,
            topIndicator, bottomIndicator, topAnchor, bottomAnchor,
            topXY, bottomXY, headerCtEl, minX, maxX,
            allDropZones, ln, i, dropZone;

        // Avoid expensive CQ lookups and DOM calculations if dropPosition has not changed
        if (targetHeader === me.lastTargetHeader && pos === me.lastDropPos) {
            return;
        }
        nextHd       = dragHeader.nextSibling('gridcolumn:not([hidden])');
        prevHd       = dragHeader.previousSibling('gridcolumn:not([hidden])');
        me.lastTargetHeader = targetHeader;
        me.lastDropPos = pos;

        data.dropLocation = dropLocation;

        if ((dragHeader !== targetHeader) &&
            ((pos === "before" && nextHd !== targetHeader) ||
            (pos === "after" && prevHd !== targetHeader)) &&
            !targetHeader.isDescendantOf(dragHeader)) {

            // As we move in between different DropZones that are in the same
            // group (such as the case when in a locked grid), invalidateDrop
            // on the other dropZones.
            allDropZones = Ext.dd.DragDropManager.getRelated(me);
            ln = allDropZones.length;
            i  = 0;

            for (; i < ln; i++) {
                dropZone = allDropZones[i];
                if (dropZone !== me && dropZone.invalidateDrop) {
                    dropZone.invalidateDrop();
                }
            }

            me.valid = true;
            topIndicator = me.getTopIndicator();
            bottomIndicator = me.getBottomIndicator();
            if (pos === 'before') {
                topAnchor = 'bc-tl';
                bottomAnchor = 'tc-bl';
            } else {
                topAnchor = 'bc-tr';
                bottomAnchor = 'tc-br';
            }

            // Calculate arrow positions. Offset them to align exactly with column border line
            if(targetHeader instanceof Ext.pivot.plugin.configurator.Container && targetHeader.items.getCount() > 0){
                // if dropping zone is the container then align the rows to the last column item
                topXY = topIndicator.getAlignToXY(targetHeader.items.last().el, topAnchor);
                bottomXY = bottomIndicator.getAlignToXY(targetHeader.items.last().el, bottomAnchor);
            }else{
                topXY = topIndicator.getAlignToXY(targetHeader.el, topAnchor);
                bottomXY = bottomIndicator.getAlignToXY(targetHeader.el, bottomAnchor);
            }

            // constrain the indicators to the viewable section
            headerCtEl = me.panel.el;
            minX = headerCtEl.getX() - me.indicatorXOffset;
            maxX = headerCtEl.getX() + headerCtEl.getWidth();

            topXY[0] = Ext.Number.constrain(topXY[0], minX, maxX);
            bottomXY[0] = Ext.Number.constrain(bottomXY[0], minX, maxX);

            // position and show indicators
            topIndicator.setXY(topXY);
            bottomIndicator.setXY(bottomXY);
            topIndicator.show();
            bottomIndicator.show();

            // invalidate drop operation and hide indicators
        } else {
            me.invalidateDrop();
        }
    },

    invalidateDrop: function() {
        this.valid = false;
        this.hideIndicators();
    },

    onNodeOver: function(node, dragZone, e, data) {
        var me = this,
            from = data.header,
            doPosition,
            to,
            fromPanel,
            toPanel;

        doPosition = true;
        if (data.header.el.dom === node) {
            doPosition = false;
        }

        if (doPosition) {
            me.positionIndicator(data, node, e);
        } else {
            me.valid = false;
        }
        return me.valid ? me.dropAllowed : me.dropNotAllowed;
    },

    hideIndicators: function() {
        var me = this;

        me.getTopIndicator().hide();
        me.getBottomIndicator().hide();
        me.lastTargetHeader = me.lastDropPos = null;

    },

    onNodeOut: function() {
        this.hideIndicators();
    },

    onNodeDrop: function(node, dragZone, e, data) {
        //debugger;
        var me = this,
            dragColumn = data.header,
            dropLocation = data.dropLocation,
            newCol, pos, newPos;

        if (me.valid && dropLocation){
            /*
             there are 2 possibilities here:
             1. a new grid column should be added to the grouping panel
             2. an existing group column changes its position
             */

            if(dragZone.id != me.panel.id){
                pos = me.panel.getColumnPosition(dropLocation.header, dropLocation.pos);
                newCol = dragColumn.serialize();

                // the field has to be removed from the dragZone
                if(!me.panel.isAgg){
                    dragZone.panel.remove(dragColumn);
                }

                me.panel.addColumn(newCol.dimension, pos, true);
            }else{
                // 2nd possibility
                me.panel.moveColumn(dragColumn.id, dropLocation.header instanceof Ext.pivot.plugin.configurator.Container ? dropLocation.header.items.last().id : dropLocation.header.id, dropLocation.pos);
            }

        }

    }
});


text:
<?xml version="1.0" encoding="utf-8"?><!--
Copyright 2011 Alex Levine

This file is part of MTG Familiar.

MTG Familiar is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

MTG Familiar is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with MTG Familiar.  If not, see <http://www.gnu.org/licenses/>.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:gravity="center_vertical"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:gravity="center"
        android:orientation="horizontal">

        <TextView
            style="@style/text.medium"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:gravity="center"
            android:text="@string/timer_how_long" />

        <com.codetroopers.betterpickers.hmspicker.HmsPicker
            android:id="@+id/rt_time_picker"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_margin="5dp"
            android:gravity="center_vertical" />

    </LinearLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="?attr/colorPrimary_attr" />

    <Button
        android:id="@+id/rt_action_button"
        style="?android:attr/buttonBarButtonStyle"
        android:layout_width="match_parent"
        android:layout_height="48dp"
        android:text="@string/timer_start"
        android:textStyle="bold" />
</LinearLayout>


text:
package org.apache.hadoop.hive.ql.plan;

import java.io.Serializable;
import java.util.Map;

import org.apache.hadoop.hive.ql.plan.Explain.Level;

/**
 * CreateTableLikeDesc.
 *
 */
@Explain(displayName = "Create Table", explainLevels = { Level.USER, Level.DEFAULT, Level.EXTENDED })
public class CreateTableLikeDesc extends DDLDesc implements Serializable {
  private static final long serialVersionUID = 1L;
  String tableName;
  boolean isExternal;
  String defaultInputFormat;
  String defaultOutputFormat;
  String defaultSerName;
  Map<String, String> defaultSerdeProps;
  String location;
  Map<String, String> tblProps;
  boolean ifNotExists;
  String likeTableName;
  boolean isTemporary = false;
  boolean isUserStorageFormat = false;

  public CreateTableLikeDesc() {
  }

  public CreateTableLikeDesc(String tableName, boolean isExternal, boolean isTemporary,
      String defaultInputFormat, String defaultOutputFormat, String location,
      String defaultSerName, Map<String, String> defaultSerdeProps, Map<String, String> tblProps,
      boolean ifNotExists, String likeTableName, boolean isUserStorageFormat) {
    this.tableName = tableName;
    this.isExternal = isExternal;
    this.isTemporary = isTemporary;
    this.defaultInputFormat=defaultInputFormat;
    this.defaultOutputFormat=defaultOutputFormat;
    this.defaultSerName=defaultSerName;
    this.defaultSerdeProps=defaultSerdeProps;
    this.location = location;
    this.tblProps = tblProps;
    this.ifNotExists = ifNotExists;
    this.likeTableName = likeTableName;
    this.isUserStorageFormat = isUserStorageFormat;
  }

  @Explain(displayName = "if not exists", displayOnlyOnTrue = true)
  public boolean getIfNotExists() {
    return ifNotExists;
  }

  public void setIfNotExists(boolean ifNotExists) {
    this.ifNotExists = ifNotExists;
  }

  @Explain(displayName = "name", explainLevels = { Level.USER, Level.DEFAULT, Level.EXTENDED })
  public String getTableName() {
    return tableName;
  }

  public void setTableName(String tableName) {
    this.tableName = tableName;
  }

  @Explain(displayName = "default input format")
  public String getDefaultInputFormat() {
    return defaultInputFormat;
  }

  public void setInputFormat(String inputFormat) {
    this.defaultInputFormat = inputFormat;
  }

  @Explain(displayName = "default output format")
  public String getDefaultOutputFormat() {
    return defaultOutputFormat;
  }

  public void setOutputFormat(String outputFormat) {
    this.defaultOutputFormat = outputFormat;
  }

  @Explain(displayName = "location")
  public String getLocation() {
    return location;
  }

  public void setLocation(String location) {
    this.location = location;
  }

  @Explain(displayName = "isExternal", displayOnlyOnTrue = true)
  public boolean isExternal() {
    return isExternal;
  }

  public void setExternal(boolean isExternal) {
    this.isExternal = isExternal;
  }

  /**
   * @return the default serDeName
   */
  @Explain(displayName = "default serde name")
  public String getDefaultSerName() {
    return defaultSerName;
  }

  /**
   * @param serName
   *          the serName to set
   */
  public void setDefaultSerName(String serName) {
    this.defaultSerName = serName;
  }

  /**
   * @return the default serDe properties
   */
  @Explain(displayName = "serde properties")
  public Map<String, String> getDefaultSerdeProps() {
    return defaultSerdeProps;
  }

  /**
   * @param serdeProps
   *          the default serde properties to set
   */
  public void setDefaultSerdeProps(Map<String, String> serdeProps) {
    this.defaultSerdeProps = serdeProps;
  }

  @Explain(displayName = "like")
  public String getLikeTableName() {
    return likeTableName;
  }

  public void setLikeTableName(String likeTableName) {
    this.likeTableName = likeTableName;
  }

  /**
   * @return the table properties
   */
  @Explain(displayName = "table properties")
  public Map<String, String> getTblProps() {
    return tblProps;
  }

  /**
   * @param tblProps
   *          the table properties to set
   */
  public void setTblProps(Map<String, String> tblProps) {
    this.tblProps = tblProps;
  }

  /**
   * @return the isTemporary
   */
  @Explain(displayName = "isTemporary", displayOnlyOnTrue = true)
  public boolean isTemporary() {
    return isTemporary;
  }

  /**
   * @param isTemporary table is Temporary or not.
   */
  public void setTemporary(boolean isTemporary) {
    this.isTemporary = isTemporary;
  }

  /**
   * True if user has specified storage format in query
   * @return boolean
   */
  public boolean isUserStorageFormat() {
    return this.isUserStorageFormat;
  }
}


text:
```bash
git clone git@github.com:Ibrasau/csgoanime-scrapper.git
cd csgoanime-scrapper
node ./scrapper.js
```
Scrapped *.webm files will appear in ./scrapped directory.

To do:
1. getopt for an interval
2. fix async webms fetching (interruption may create defective file)


text:
'use strict';

angular.module("main")
    .service("MainManager",['$resource',function($resource){
        return $resource("/api/:what/:where",{},{
            getPolylines: {method: 'GET',isArray: true,params: {what: 'polylines'}},
            savePolylines: {method: "POST",isArray: false, params: {what: 'polylines',where: 'saves'}},
            saveWeight: {method: "POST", isArray: false, params: {what: 'saves', where: 'weights'}}
        });
    }]);


text:
package com.facebook.imagepipeline.memory;

import android.util.Log;
import com.facebook.common.internal.Preconditions;
import java.io.Closeable;
import java.nio.ByteBuffer;
import javax.annotation.Nullable;

/**
 * Wrapper around chunk using a direct ByteBuffer in native memory. A direct ByteBuffer is composed
 * of a Java {@link ByteBuffer} object allocated on the Java heap and the underlying buffer which is
 * in native memory.
 *
 * <p>The buffer in native memory will be released when the Java object gets garbage collected.
 */
public class BufferMemoryChunk implements MemoryChunk, Closeable {
  private static final String TAG = "BufferMemoryChunk";

  /** Internal representation of the chunk */
  private ByteBuffer mBuffer;

  /** Size of the ByteBuffer */
  private final int mSize;

  /** Unique identifier of the chunk */
  private final long mId;

  public BufferMemoryChunk(final int size) {
    mBuffer = ByteBuffer.allocateDirect(size);
    mSize = size;
    mId = System.identityHashCode(this);
  }

  @Override
  public synchronized void close() {
    mBuffer = null;
  }

  @Override
  public synchronized boolean isClosed() {
    return mBuffer == null;
  }

  @Override
  public int getSize() {
    return mSize;
  }

  @Override
  public synchronized int write(
      final int memoryOffset, final byte[] byteArray, final int byteArrayOffset, final int count) {
    Preconditions.checkNotNull(byteArray);
    Preconditions.checkState(!isClosed());
    final int actualCount = MemoryChunkUtil.adjustByteCount(memoryOffset, count, mSize);
    MemoryChunkUtil.checkBounds(
        memoryOffset, byteArray.length, byteArrayOffset, actualCount, mSize);
    mBuffer.position(memoryOffset);
    mBuffer.put(byteArray, byteArrayOffset, actualCount);
    return actualCount;
  }

  @Override
  public synchronized int read(
      final int memoryOffset, final byte[] byteArray, final int byteArrayOffset, final int count) {
    Preconditions.checkNotNull(byteArray);
    Preconditions.checkState(!isClosed());
    final int actualCount = MemoryChunkUtil.adjustByteCount(memoryOffset, count, mSize);
    MemoryChunkUtil.checkBounds(
        memoryOffset, byteArray.length, byteArrayOffset, actualCount, mSize);
    mBuffer.position(memoryOffset);
    mBuffer.get(byteArray, byteArrayOffset, actualCount);
    return actualCount;
  }

  @Override
  public synchronized byte read(final int offset) {
    Preconditions.checkState(!isClosed());
    Preconditions.checkArgument(offset >= 0);
    Preconditions.checkArgument(offset < mSize);
    return mBuffer.get(offset);
  }

  @Override
  public void copy(
      final int offset, final MemoryChunk other, final int otherOffset, final int count) {
    Preconditions.checkNotNull(other);
    // This implementation acquires locks on this and other objects and then delegates to
    // doCopy which does actual copy. In order to avoid deadlocks we have to establish some linear
    // order on all BufferMemoryChunks and acquire locks according to this order. In order
    // to do that, we use unique ids.
    // So we have to address 3 cases:

    // Case 1: other buffer equals this buffer, id comparison
    if (other.getUniqueId() == getUniqueId()) {
      // we do not allow copying to the same address
      // lets log warning and not copy
      Log.w(
          TAG,
          "Copying from BufferMemoryChunk "
              + Long.toHexString(getUniqueId())
              + " to BufferMemoryChunk "
              + Long.toHexString(other.getUniqueId())
              + " which are the same ");
      Preconditions.checkArgument(false);
    }

    // Case 2: Other memory chunk id < this memory chunk id
    if (other.getUniqueId() < getUniqueId()) {
      synchronized (other) {
        synchronized (this) {
          doCopy(offset, other, otherOffset, count);
        }
      }
      return;
    }

    // Case 3: Other memory chunk id > this memory chunk id
    synchronized (this) {
      synchronized (other) {
        doCopy(offset, other, otherOffset, count);
      }
    }
  }

  @Override
  public long getNativePtr() {
    throw new UnsupportedOperationException("Cannot get the pointer of a BufferMemoryChunk");
  }

  @Override
  @Nullable
  public synchronized ByteBuffer getByteBuffer() {
    return mBuffer;
  }

  @Override
  public long getUniqueId() {
    return mId;
  }

  /**
   * This does actual copy. It should be called only when we hold locks on both this and other
   * objects
   */
  private void doCopy(
      final int offset, final MemoryChunk other, final int otherOffset, final int count) {
    if (!(other instanceof BufferMemoryChunk)) {
      throw new IllegalArgumentException("Cannot copy two incompatible MemoryChunks");
    }
    Preconditions.checkState(!isClosed());
    Preconditions.checkState(!other.isClosed());
    MemoryChunkUtil.checkBounds(offset, other.getSize(), otherOffset, count, mSize);
    mBuffer.position(offset);
    // ByteBuffer can't be null at this point
    other.getByteBuffer().position(otherOffset);
    // Recover the necessary part to be copied as a byte array.
    // This requires a copy, for now there is not a more efficient alternative.
    byte[] b = new byte[count];
    mBuffer.get(b, 0, count);
    other.getByteBuffer().put(b, 0, count);
  }
}


text:
package com.siyeh.ig.controlflow;

import com.intellij.psi.*;
import com.intellij.psi.tree.IElementType;
import com.siyeh.HardcodedMethodConstants;
import com.siyeh.InspectionGadgetsBundle;
import com.siyeh.ig.BaseInspection;
import com.siyeh.ig.BaseInspectionVisitor;
import com.siyeh.ig.psiutils.ComparisonUtils;
import com.siyeh.ig.psiutils.ExpressionUtils;
import org.jetbrains.annotations.NotNull;

public class PointlessIndexOfComparisonInspection extends BaseInspection {

    @Override
    @NotNull
    public String getDisplayName() {
        return InspectionGadgetsBundle.message(
                "pointless.indexof.comparison.display.name");
    }

    @Override
    @NotNull
    protected String buildErrorString(Object... infos) {
        final PsiBinaryExpression expression = (PsiBinaryExpression)infos[0];
        final PsiExpression lhs = expression.getLOperand();
        final PsiJavaToken sign = expression.getOperationSign();
        final boolean value;
        if (lhs instanceof PsiMethodCallExpression) {
            value = createContainsExpressionValue(sign, false);
        } else {
            value = createContainsExpressionValue(sign, true);
        }
        if (value) {
            return InspectionGadgetsBundle.message(
                    "pointless.indexof.comparison.always.true.problem.descriptor");
        } else {
            return InspectionGadgetsBundle.message(
                    "pointless.indexof.comparison.always.false.problem.descriptor");
        }
    }

    static boolean createContainsExpressionValue(
            @NotNull PsiJavaToken sign, boolean flipped) {
        final IElementType tokenType = sign.getTokenType();
        if (tokenType.equals(JavaTokenType.EQEQ)) {
            return false;
        }
        if (tokenType.equals(JavaTokenType.NE)) {
            return true;
        }
        if (flipped) {
            if (tokenType.equals(JavaTokenType.GT) ||
                    tokenType.equals(JavaTokenType.GE)) {
                return false;
            }
        } else {
            if (tokenType.equals(JavaTokenType.LT) ||
                    tokenType.equals(JavaTokenType.LE)) {
                return false;
            }
        }
        return true;
    }

    @Override
    public BaseInspectionVisitor buildVisitor() {
        return new PointlessIndexOfComparisonVisitor();
    }

    private static class PointlessIndexOfComparisonVisitor
            extends BaseInspectionVisitor {

        @Override public void visitBinaryExpression(
                PsiBinaryExpression expression) {
            super.visitBinaryExpression(expression);
            final PsiExpression rhs = expression.getROperand();
            if (rhs == null) {
                return;
            }
            if (!ComparisonUtils.isComparison(expression)) {
                return;
            }
            final PsiExpression lhs = expression.getLOperand();
            if (lhs instanceof PsiMethodCallExpression) {
                final PsiJavaToken sign = expression.getOperationSign();
                if (isPointLess(lhs, sign, rhs, false)) {
                    registerError(expression, expression);
                }
            } else if (rhs instanceof PsiMethodCallExpression) {
                final PsiJavaToken sign = expression.getOperationSign();
                if (isPointLess(rhs, sign, lhs, true)) {
                    registerError(expression, expression);
                }
            }
        }

        private static boolean isPointLess(PsiExpression lhs, PsiJavaToken sign,
                                           PsiExpression rhs, boolean flipped) {
            final PsiMethodCallExpression callExpression =
                    (PsiMethodCallExpression)lhs;
            if (!isIndexOfCall(callExpression)) {
                return false;
            }
            final Object object =
                    ExpressionUtils.computeConstantExpression(rhs);
            if (!(object instanceof Integer)) {
                return false;
            }
            final Integer integer = (Integer)object;
            final int constant = integer.intValue();
            final IElementType tokenType = sign.getTokenType();
            if (tokenType == null) {
                return false;
            }
            if (flipped) {
                if (constant < 0 && (tokenType.equals(JavaTokenType.GT) ||
                        tokenType.equals(JavaTokenType.LE))) {
                    return true;
                } else if (constant < -1 &&
                        (tokenType.equals(JavaTokenType.GE) ||
                                tokenType.equals(JavaTokenType.LT) ||
                                tokenType.equals(JavaTokenType.NE) ||
                                tokenType.equals(JavaTokenType.EQEQ))) {
                    return true;
                }

            } else {
                if (constant < 0 && (tokenType.equals(JavaTokenType.LT) ||
                        tokenType.equals(JavaTokenType.GE))) {
                    return true;
                } else if (constant < -1 &&
                        (tokenType.equals(JavaTokenType.LE) ||
                                tokenType.equals(JavaTokenType.GT) ||
                                tokenType.equals(JavaTokenType.NE) ||
                                tokenType.equals(JavaTokenType.EQEQ))) {
                    return true;
                }
            }
            return false;
        }

        private static boolean isIndexOfCall(
                @NotNull PsiMethodCallExpression expression) {
            final PsiReferenceExpression methodExpression =
                    expression.getMethodExpression();
            final String methodName = methodExpression.getReferenceName();
            return HardcodedMethodConstants.INDEX_OF.equals(methodName);
        }
    }
}


text:
require 'xommelier/rss'
require 'xommelier/atom'
require 'xommelier/atom/history'

module Xommelier
  module RSS
    class Channel
      may do
        element :id, ns: Atom.xmlns
        element :complete, type: Atom::History::Complete
        element :archive, type: Atom::History::Archive
      end
      element :atom_link, type: Atom::Link, count: :any
    end

    class Item
      element :id, ns: Atom.xmlns, count: :may
      element :atom_link, type: Atom::Link, count: :any
    end
  end
end


text:
<?php
/**
 * Created by PhpStorm.
 * User: Admin
 * Date: 2016/2/19
 * Time: 23:53
 */

namespace common\services;

interface CrudService
{
    public function save($entity);

    public function batchSave(array $entities);

    public function findOne($id);

    public function exists($id);

    public function findAll();

    public function findAllBy(array $ids);

    public function count();

    public function delete();

    public function deleteBy($entity);

    public function batchDelete(array $entities);

    public function deleteAll();
}


text:
#import "MBXSessionService.h"
#import "MBXSessionConnectorProtocol.h"
@implementation MBXSessionService
- (NSString *)loggedUserId{
    return [(NSObject <MBXSessionConnectorProtocol> *)self.connector loggedUserId];
}
- (NSObject *)loggedInUser{
    NSObject __block *user;
    [self.parser processWithData:[(NSObject <MBXSessionConnectorProtocol> *)self.connector loggedInUser] AndCompletion:^(id result) {
        user = result;
    }];
    return  user;
}
- (BOOL)isLoggedIn{
    return  [(NSObject <MBXSessionConnectorProtocol> *)self.connector isLoggedIn];
}
- (void)logout{
    [(NSObject <MBXSessionConnectorProtocol> *)self.connector logout];
}
- (void)authorizeWithData:(id)data Success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    [(NSObject <MBXSessionConnectorProtocol> *)self.connector authorizeWithData:data Success:success failure:failure];
}
- (void)signUpWithData:(id)data Success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    [(NSObject <MBXSessionConnectorProtocol> *)self.connector signUpWithData:data Success:success failure:failure];
}
- (void)checkSessionValidSuccess:(void (^)(BOOL))success failure:(void (^)(NSError *))failure{
    [(NSObject <MBXSessionConnectorProtocol> *) self.connector checkSessionValidSuccess:success failure:failure];
}
@end


text:
set -e

. ${XMLWRAPP_SOURCE_DIR}/scripts/ci/common.sh

autoreconf --symlink --install

CXXFLAGS="-Werror $CXXFLAGS"

case "$HOST" in
    *-mingw*)
        configure_args="--host=$HOST"

        # As long as we don't have any other tests (e.g. written in interpreted
        # language), just setting LOG_COMPILER to Wine is good enough. If we do
        # need to run e.g. Python tests too, we would need a script selecting the
        # right way to run the test depending on its extension as, unfortunately,
        # setting EXE_LOG_COMPILER doesn't work (although PY_LOG_COMPILER does).
        export LOG_COMPILER=wine-development

        # Set up the path to allow the tests to find libstdc++ and libxml2 DLLs.
        export WINEPATH="$(dirname $($HOST-g++ -print-libgcc-file-name));/usr/local/bin"
        ;;
esac

if [ "$TEST_DIST" != 1 ]; then
    configure_args="$configure_args --disable-docs"
fi

./configure CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" $configure_args

# Test building from a distribution archive, rather than from Git sources.
if [ "$TEST_DIST" = 1 ]; then
    # We need bkl in order to build the distribution archives, so get it.
    BKL_VERSION=1.2.6
    BKL_ARCHIVE=bakefile-${BKL_VERSION}-bin.tar.bz2

    wget --no-verbose https://github.com/vslavik/bakefile/releases/download/v${BKL_VERSION}/${BKL_ARCHIVE}

    # We assume we're using GNU tar, which can uncompress .bz2 files on its own.
    tar xf ${BKL_ARCHIVE}

    PATH=$(pwd)/bakefile-${BKL_VERSION}:${PATH}

    make distcheck DISTCHECK_CONFIGURE_FLAGS="$configure_args"

    # No need to build and test again, this is already done by distcheck.
    exit 0
fi

make --keep-going

if ! make check; then
    echo 'Test suite log contents'
    echo '-----------------------'
    cat tests/test-suite.log
    echo '-----------------------'
    exit 1
fi


text:
package com.example

/**
  * Created by johnreed on 6/6/16.
  */
object Utils {
  def shortenTypeSignature(sig: String): String = {
    val splitString = sig.split(".")
    // Warning: Assumes that all packages are lowercase and that the actual type is uppercase.
    val uppercaseStrings = splitString.filter(str => str.length > 0 && str.charAt(0).isUpper)
    uppercaseStrings.reduceLeft( (left, next) => left + "." + next ) // put dots back in
  }
}


text:
#ifndef ML_METADATA_GOOGLE_QUERY_FILTER_QUERY_AST_RESOLVER_H
#define ML_METADATA_GOOGLE_QUERY_FILTER_QUERY_AST_RESOLVER_H

#include "zetasql/public/analyzer.h"
#include "zetasql/public/simple_catalog.h"
#include "absl/status/status.h"
#include "re2/re2.h"

namespace ml_metadata {

// FilterQueryAstResolver parses the MLMD filtering query string and generates
// an AST via ZetaSQL analyzer. It can be instantiated with MLMD nodes types:
// Artifact, Execution and Context.
template <typename T>
class FilterQueryAstResolver {
 public:
  // Constructs an AST resolver for a given query_string. Always use a new AST
  // resolver instance to process a query string, as the temporary types for
  // each query string is not sharable.
  explicit FilterQueryAstResolver(const std::string& query_string);

  // Not copyable or movable
  FilterQueryAstResolver(const FilterQueryAstResolver&) = delete;
  FilterQueryAstResolver& operator=(const FilterQueryAstResolver&) = delete;

  // Processes the user query string and generates an ast.
  // It reads the user query string, creates a list of zetasql types
  // and validates the query.
  // Returns InvalidArgument if the given query is not a boolean expression.
  // Returns InvalidArgument errors if the query string contains symbols that
  // is not supported by the filter query syntax and semantics.
  absl::Status Resolve();

  // Returns the parsed AST of the giving query string. The AST is owned by
  // the instance of FilterQueryAstResolver and it is immutable.
  // The AST can be used with FilterQueryBuilder to generate actual query.
  // Returns nullptr if the Resolve() failed with errors.
  const zetasql::ResolvedExpr* GetAst();

 private:
  // The user query.
  const std::string raw_query_;
  // The type factory to keep the temporary types used in the query.
  zetasql::TypeFactory type_factory_;
  // The analyzer options that bridge the alias and the type.
  zetasql::AnalyzerOptions analyzer_opts_;
  // The simple catalog used by the analyzer for resolving functions.
  zetasql::SimpleCatalog catalog_;
  // The output that holds the resolved query.
  std::unique_ptr<const zetasql::AnalyzerOutput> output_;
};

}  // namespace ml_metadata

#endif  // ML_METADATA_GOOGLE_QUERY_FILTER_QUERY_AST_RESOLVER_H


text:
//*******************************************************************************************//
//                                                                                //
// Download Free Evaluation Version From: https://bytescout.com/download/web-installer       //
//                                                                                //
// Also available as Web API! Get Your Free API Key: https://app.pdf.co/signup               //
//                                                                                //
// Copyright © 2017-2020 ByteScout, Inc. All rights reserved.                                //
// https://www.bytescout.com                                                                 //
// https://pdf.co                                                                            //
//                                                                                //
//*******************************************************************************************//

using System;
using System.IO;
using System.ServiceProcess;
using System.Timers;
using Bytescout.BarCode;

namespace WindowsService1
{
    public partial class Service1 : ServiceBase
    {
	    private Timer _timer = null;

        public Service1()
        {
            InitializeComponent();

            if (!System.Diagnostics.EventLog.SourceExists("MySource"))
            {
                System.Diagnostics.EventLog.CreateEventSource( "MySource", "MyNewLog");
            }

            eventLog1.Source = "MySource";
            eventLog1.Log = "MyNewLog";
        }

        protected override void OnStart(string[] args)
        {
            eventLog1.WriteEntry("In OnStart");

			if (_timer != null)
			{
				_timer.Stop();
				_timer.Elapsed -= Timer_Elapsed;
				_timer.Dispose();
			}

			_timer = new Timer(5000);
			_timer.Elapsed += Timer_Elapsed;
			_timer.Start();
        }

	    protected override void OnStop()
        {
			eventLog1.WriteEntry("In OnStop.");

			if (_timer != null)
			{
				_timer.Stop();
				_timer.Elapsed -= Timer_Elapsed;
				_timer.Dispose();
				_timer = null;
			}
        }

	    void Timer_Elapsed(object sender, ElapsedEventArgs e)
	    {
		    Barcode barcode = null;

		    try
		    {
		    	// Generate sample barcode value by random number
			    Random random = new Random();
				string barcodeValue = "(00)" + random.Next().ToString("000000000000000000");

				// Create Bytescout.BarCode object and setup the barcode
			    barcode = new Barcode("demo", "demo");
			    barcode.Symbology = SymbologyType.GS1_128;
			    barcode.Value = barcodeValue;

			    string outputDirectory = "c:\\barcodes";
		        if (!Directory.Exists(outputDirectory))
		            Directory.CreateDirectory(outputDirectory);

		        string fileName = barcodeValue + ".pdf";
			    string filePath = Path.Combine(outputDirectory, fileName);

                // Save barcode to new PDF file
				barcode.DrawToNewPDF(filePath, 500, 500, 50, 50);

				eventLog1.WriteEntry("Generated " + fileName);

				// Sending email message example:
				/*
				System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
				message.To.Add("luckyperson@online.microsoft.com");
				message.Subject = fileName;
				message.From = new System.Net.Mail.MailAddress("From@online.microsoft.com");
				message.Body = "This is the message body";
				message.Attachments.Add(new System.Net.Mail.Attachment(filePath));

				System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("your_smtp_host");
				smtp.Send(message);
				*/
		    }
			catch (Exception exception)
			{
				eventLog1.WriteEntry(exception.Message);
			}
		    finally
		    {
			    if (barcode != null)
			    {
				    barcode.Dispose();
			    }
		    }
	    }
    }
}


text:
<?php

namespace core;

class Response {

	const JSON = 0;
	const CLI = 1;

	public $valueMap;
	public $type = self::JSON;

	static public function getInstance() {
		return new self();
	}

	public function setData($data) {
		$this->valueMap = $data;
	}

	public function emitType($type) {
		$this->type = $type;
	}

	public function emit() {
		if ($this->type == self::JSON) {
			header('Content-type: text/json; charset=UTF-8');
			$response = json_encode($this->valueMap);
			$response = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $response);
		} else if ($this->type == self::CLI) {
			header('Content-type: text/plain; charset=UTF-8');
			$response = '';
			foreach ($this->valueMap as $var) {
				$response .= $var . PHP_EOL;
			}
		}
		echo $response;
	}

}


text:
package chandu0101.scalajsreact

import chandu0101.scalajsreact.css.AppCSS
import chandu0101.scalajsreact.routing.AppRouter
import japgolly.scalajs.react._
import org.scalajs.dom

import scala.scalajs.js.JSApp
import scala.scalajs.js.annotation.JSExport

object ReactApp extends JSApp {

  @JSExport
  override def main(): Unit = {
    AppCSS.load
    AppRouter.router() render dom.document.body
  }

}


text:
from .nested_keys import set_nested_key, get_nested_key, del_nested_key

def apply_translations(target_dict, translations_list, old_key_first=True):
    if old_key_first:
         translations_list = reversed(translations_list)
    for key_pair in translations_list:
        if old_key_first:
            old_key, new_key = key_pair
        else:
            new_key, old_key = key_pair
        try:
            set_nested_key(new_key, get_nested_key(old_key, target_dict), target_dict)
            del_nested_key(old_key, target_dict)
        except KeyError:
            pass


text:
"""
.. module: lemur.api_keys.views
    :platform: Unix
    :copyright: (c) 2017 by Netflix Inc., see AUTHORS for more
    :license: Apache, see LICENSE for more details.

.. moduleauthor:: Eric Coan <kungfury@instructure.com>

"""
from datetime import datetime

from flask import Blueprint, g
from flask_restful import reqparse, Api

from lemur.api_keys import service
from lemur.auth.service import AuthenticatedResource, create_token
from lemur.auth.permissions import ApiKeyCreatorPermission

from lemur.common.schema import validate_schema
from lemur.common.utils import paginated_parser

from lemur.api_keys.schemas import api_key_input_schema, api_key_revoke_schema, api_key_output_schema, \
    api_keys_output_schema, api_key_described_output_schema, user_api_key_input_schema

mod = Blueprint('api_keys', __name__)
api = Api(mod)

class ApiKeyList(AuthenticatedResource):
    """ Defines the 'api_keys' endpoint """

    def __init__(self):
        super(ApiKeyList, self).__init__()

    @validate_schema(None, api_keys_output_schema)
    def get(self):
        """
        .. http:get:: /keys

           The current list of api keys, that you can see.

           **Example request**:

           .. sourcecode:: http

              GET /keys HTTP/1.1
              Host: example.com
              Accept: application/json, text/javascript

           **Example response**:

           .. sourcecode:: http

              HTTP/1.1 200 OK
              Vary: Accept
              Content-Type: text/javascript

              {
                "items": [
                    {
                      "id": 1,
                      "name": "custom name",
                      "user_id": 1,
                      "ttl": -1,
                      "issued_at": 12,
                      "revoked": false
                    }
                ],
                "total": 1
              }

           :query sortBy: field to sort on
           :query sortDir: asc or desc
           :query page: int default is 1
           :query count: count number. default is 10
           :query user_id: a user to filter by.
           :query id: an access key to filter by.
           :reqheader Authorization: OAuth token to authenticate
           :statuscode 200: no error
           :statuscode 403: unauthenticated
        """
        parser = paginated_parser.copy()
        args = parser.parse_args()
        args['has_permission'] = ApiKeyCreatorPermission().can()
        args['requesting_user_id'] = g.current_user.id
        return service.render(args)

    @validate_schema(api_key_input_schema, api_key_output_schema)
    def post(self, data=None):
        """
        .. http:post:: /keys

           Creates an API Key.

           **Example request**:

           .. sourcecode:: http

              POST /keys HTTP/1.1
              Host: example.com
              Accept: application/json, text/javascript

              {
                "name": "my custom name",
                "user_id": 1,
                "ttl": -1
              }

           **Example response**:

           .. sourcecode:: http

              HTTP/1.1 200 OK
              Vary: Accept
              Content-Type: text/javascript

              {

                "jwt": ""
              }

           :reqheader Authorization: OAuth token to authenticate
           :statuscode 200: no error
           :statuscode 403: unauthenticated
        """
        if not ApiKeyCreatorPermission().can():
            if data['user']['id'] != g.current_user.id:
                return dict(message="You are not authorized to create tokens for: {0}".format(data['user']['username'])), 403

        access_token = service.create(name=data['name'], user_id=data['user']['id'], ttl=data['ttl'],
                                      revoked=False, issued_at=int(datetime.utcnow().timestamp()))
        return dict(jwt=create_token(access_token.user_id, access_token.id, access_token.ttl))

class ApiKeyUserList(AuthenticatedResource):
    """ Defines the 'keys' endpoint on the 'users' endpoint. """

    def __init__(self):
        super(ApiKeyUserList, self).__init__()

    @validate_schema(None, api_keys_output_schema)
    def get(self, user_id):
        """
        .. http:get:: /users/:user_id/keys

           The current list of api keys for a user, that you can see.

           **Example request**:

           .. sourcecode:: http

              GET /users/1/keys HTTP/1.1
              Host: example.com
              Accept: application/json, text/javascript

           **Example response**:

           .. sourcecode:: http

              HTTP/1.1 200 OK
              Vary: Accept
              Content-Type: text/javascript

              {
                "items": [
                    {
                      "id": 1,
                      "name": "custom name",
                      "user_id": 1,
                      "ttl": -1,
                      "issued_at": 12,
                      "revoked": false
                    }
                ],
                "total": 1
              }

           :query sortBy: field to sort on
           :query sortDir: asc or desc
           :query page: int default is 1
           :query count: count number. default is 10
           :query id: an access key to filter by.
           :reqheader Authorization: OAuth token to authenticate
           :statuscode 200: no error
           :statuscode 403: unauthenticated
        """
        parser = paginated_parser.copy()
        args = parser.parse_args()
        args['has_permission'] = ApiKeyCreatorPermission().can()
        args['requesting_user_id'] = g.current_user.id
        args['user_id'] = user_id
        return service.render(args)

    @validate_schema(user_api_key_input_schema, api_key_output_schema)
    def post(self, user_id, data=None):
        """
        .. http:post:: /users/:user_id/keys

           Creates an API Key for a user.

           **Example request**:

           .. sourcecode:: http

              POST /users/1/keys HTTP/1.1
              Host: example.com
              Accept: application/json, text/javascript

              {
                "name": "my custom name"
                "ttl": -1
              }

           **Example response**:

           .. sourcecode:: http

              HTTP/1.1 200 OK
              Vary: Accept
              Content-Type: text/javascript

              {

                "jwt": ""
              }

           :reqheader Authorization: OAuth token to authenticate
           :statuscode 200: no error
           :statuscode 403: unauthenticated
        """
        if not ApiKeyCreatorPermission().can():
            if user_id != g.current_user.id:
                return dict(message="You are not authorized to create tokens for: {0}".format(user_id)), 403

        access_token = service.create(name=data['name'], user_id=user_id, ttl=data['ttl'],
                                      revoked=False, issued_at=int(datetime.utcnow().timestamp()))
        return dict(jwt=create_token(access_token.user_id, access_token.id, access_token.ttl))

class ApiKeys(AuthenticatedResource):
    def __init__(self):
        self.reqparse = reqparse.RequestParser()
        super(ApiKeys, self).__init__()

    @validate_schema(None, api_key_output_schema)
    def get(self, aid):
        """
        .. http:get:: /keys/1

           Fetch one api key

           **Example request**:

           .. sourcecode:: http

              GET /keys/1 HTTP/1.1
              Host: example.com
              Accept: application/json, text/javascript

           **Example response**:

           .. sourcecode:: http

              HTTP/1.1 200 OK
              Vary: Accept
              Content-Type: text/javascript

              {
                  "jwt": ""
              }

           :reqheader Authorization: OAuth token to authenticate
           :statuscode 200: no error
           :statuscode 403: unauthenticated
        """
        access_key = service.get(aid)

        if access_key is None:
            return dict(message="This token does not exist!"), 404

        if access_key.user_id != g.current_user.id:
            if not ApiKeyCreatorPermission().can():
                return dict(message="You are not authorized to view this token!"), 403

        return dict(jwt=create_token(access_key.user_id, access_key.id, access_key.ttl))

    @validate_schema(api_key_revoke_schema, api_key_output_schema)
    def put(self, aid, data=None):
        """
        .. http:put:: /keys/1

           update one api key

           **Example request**:

           .. sourcecode:: http

              PUT /keys/1 HTTP/1.1
              Host: example.com
              Accept: application/json, text/javascript

              {
                  "name": "new_name",
                  "revoked": false,
                  "ttl": -1
              }

           **Example response**:

           .. sourcecode:: http

              HTTP/1.1 200 OK
              Vary: Accept
              Content-Type: text/javascript

              {
                  "jwt": ""
              }

           :reqheader Authorization: OAuth token to authenticate
           :statuscode 200: no error
           :statuscode 403: unauthenticated
        """
        access_key = service.get(aid)
        if access_key is None:
            return dict(message="This token does not exist!"), 404

        if access_key.user_id != g.current_user.id:
            if not ApiKeyCreatorPermission().can():
                return dict(message="You are not authorized to update this token!"), 403

        service.update(access_key, name=data['name'], revoked=data['revoked'], ttl=data['ttl'])
        return dict(jwt=create_token(access_key.user_id, access_key.id, access_key.ttl))

    def delete(self, aid):
        """
        .. http:delete:: /keys/1

           deletes one api key

           **Example request**:

           .. sourcecode:: http

              DELETE /keys/1 HTTP/1.1
              Host: example.com
              Accept: application/json, text/javascript

           **Example response**:

           .. sourcecode:: http

              HTTP/1.1 200 OK
              Vary: Accept
              Content-Type: text/javascript

              {
                  "result": true
              }

           :reqheader Authorization: OAuth token to authenticate
           :statuscode 200: no error
           :statuscode 403: unauthenticated
        """
        access_key = service.get(aid)
        if access_key is None:
            return dict(message="This token does not exist!"), 404

        if access_key.user_id != g.current_user.id:
            if not ApiKeyCreatorPermission().can():
                return dict(message="You are not authorized to delete this token!"), 403

        service.delete(access_key)
        return {'result': True}

class UserApiKeys(AuthenticatedResource):
    def __init__(self):
        self.reqparse = reqparse.RequestParser()
        super(UserApiKeys, self).__init__()

    @validate_schema(None, api_key_output_schema)
    def get(self, uid, aid):
        """
        .. http:get:: /users/1/keys/1

           Fetch one api key

           **Example request**:

           .. sourcecode:: http

              GET /users/1/api_keys/1 HTTP/1.1
              Host: example.com
              Accept: application/json, text/javascript

           **Example response**:

           .. sourcecode:: http

              HTTP/1.1 200 OK
              Vary: Accept
              Content-Type: text/javascript

              {
                  "jwt": ""
              }

           :reqheader Authorization: OAuth token to authenticate
           :statuscode 200: no error
           :statuscode 403: unauthenticated
        """
        if uid != g.current_user.id:
            if not ApiKeyCreatorPermission().can():
                return dict(message="You are not authorized to view this token!"), 403

        access_key = service.get(aid)

        if access_key is None:
            return dict(message="This token does not exist!"), 404

        if access_key.user_id != uid:
            return dict(message="You are not authorized to view this token!"), 403

        return dict(jwt=create_token(access_key.user_id, access_key.id, access_key.ttl))

    @validate_schema(api_key_revoke_schema, api_key_output_schema)
    def put(self, uid, aid, data=None):
        """
        .. http:put:: /users/1/keys/1

           update one api key

           **Example request**:

           .. sourcecode:: http

              PUT /users/1/keys/1 HTTP/1.1
              Host: example.com
              Accept: application/json, text/javascript

              {
                  "name": "new_name",
                  "revoked": false,
                  "ttl": -1
              }

           **Example response**:

           .. sourcecode:: http

              HTTP/1.1 200 OK
              Vary: Accept
              Content-Type: text/javascript

              {
                  "jwt": ""
              }

           :reqheader Authorization: OAuth token to authenticate
           :statuscode 200: no error
           :statuscode 403: unauthenticated
        """
        if uid != g.current_user.id:
            if not ApiKeyCreatorPermission().can():
                return dict(message="You are not authorized to view this token!"), 403

        access_key = service.get(aid)
        if access_key is None:
            return dict(message="This token does not exist!"), 404

        if access_key.user_id != uid:
            return dict(message="You are not authorized to update this token!"), 403

        service.update(access_key, name=data['name'], revoked=data['revoked'], ttl=data['ttl'])
        return dict(jwt=create_token(access_key.user_id, access_key.id, access_key.ttl))

    def delete(self, uid, aid):
        """
        .. http:delete:: /users/1/keys/1

           deletes one api key

           **Example request**:

           .. sourcecode:: http

              DELETE /users/1/keys/1 HTTP/1.1
              Host: example.com
              Accept: application/json, text/javascript

           **Example response**:

           .. sourcecode:: http

              HTTP/1.1 200 OK
              Vary: Accept
              Content-Type: text/javascript

              {
                  "result": true
              }

           :reqheader Authorization: OAuth token to authenticate
           :statuscode 200: no error
           :statuscode 403: unauthenticated
        """
        if uid != g.current_user.id:
            if not ApiKeyCreatorPermission().can():
                return dict(message="You are not authorized to view this token!"), 403

        access_key = service.get(aid)
        if access_key is None:
            return dict(message="This token does not exist!"), 404

        if access_key.user_id != uid:
            return dict(message="You are not authorized to delete this token!"), 403

        service.delete(access_key)
        return {'result': True}

class ApiKeysDescribed(AuthenticatedResource):
    def __init__(self):
        self.reqparse = reqparse.RequestParser()
        super(ApiKeysDescribed, self).__init__()

    @validate_schema(None, api_key_described_output_schema)
    def get(self, aid):
        """
        .. http:get:: /keys/1/described

           Fetch one api key

           **Example request**:

           .. sourcecode:: http

              GET /keys/1 HTTP/1.1
              Host: example.com
              Accept: application/json, text/javascript

           **Example response**:

           .. sourcecode:: http

              HTTP/1.1 200 OK
              Vary: Accept
              Content-Type: text/javascript

              {
                  "id": 2,
                  "name": "hoi",
                  "user_id": 2,
                  "ttl": -1,
                  "issued_at": 1222222,
                  "revoked": false
              }

           :reqheader Authorization: OAuth token to authenticate
           :statuscode 200: no error
           :statuscode 403: unauthenticated
        """
        access_key = service.get(aid)
        if access_key is None:
            return dict(message="This token does not exist!"), 404

        if access_key.user_id != g.current_user.id:
            if not ApiKeyCreatorPermission().can():
                return dict(message="You are not authorized to view this token!"), 403

        return access_key

api.add_resource(ApiKeyList, '/keys', endpoint='api_keys')
api.add_resource(ApiKeys, '/keys/<int:aid>', endpoint='api_key')
api.add_resource(ApiKeysDescribed, '/keys/<int:aid>/described', endpoint='api_key_described')
api.add_resource(ApiKeyUserList, '/users/<int:user_id>/keys', endpoint='user_api_keys')
api.add_resource(UserApiKeys, '/users/<int:uid>/keys/<int:aid>', endpoint='user_api_key')


text:
<!DOCTYPE html>

		<title>three.js webgl - shaders - sky sun shader</title>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
		<link type="text/css" rel="stylesheet" href="main.css">

three.js webgl - sky + sun shader


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.desktopvirtualization.generated;

import com.azure.core.util.Context;
import com.azure.resourcemanager.desktopvirtualization.models.SendMessage;

/** Samples for UserSessions SendMessage. */
public final class UserSessionsSendMessageSamples {
    /*
     * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/UserSession_SendMessage_Post.json
     */
    /**
     * Sample code: UserSession_SendMessage_Post.
     *
     * @param manager Entry point to DesktopVirtualizationManager.
     */
    public static void userSessionSendMessagePost(
        com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) {
        manager
            .userSessions()
            .sendMessageWithResponse(
                "resourceGroup1",
                "hostPool1",
                "sessionHost1.microsoft.com",
                "1",
                new SendMessage().withMessageTitle("title").withMessageBody("body"),
                Context.NONE);
    }
}


text:
hadoop jar WorkGen.jar org.apache.hadoop.examples.WorkGen -conf /usr/lib/hadoop-0.20.2/conf/workGenKeyValue_conf.xsl -r 1 inputPath-job-22.txt workGenOutputTest-22 1.5258789E-5 1.0 >> workGenLogs/job-22.txt 2>> workGenLogs/job-22.txt
hadoop dfs -rmr workGenOutputTest-22
# inputSize 67108864


text:
#nullable enable
using SkiaSharp;
using static System.Math;

namespace Core2D.Modules.Renderer.SkiaSharp;

public static class MatrixHelper
{
    public static SKMatrix ToSKMatrix(double m11, double m12, double m21, double m22, double m31, double m32)
    {
        return new SKMatrix
        {
            ScaleX = (float)m11,
            SkewX = (float)m21,
            TransX = (float)m31,
            SkewY = (float)m12,
            ScaleY = (float)m22,
            TransY = (float)m32,
            Persp0 = 0,
            Persp1 = 0,
            Persp2 = 1
        };
    }

    public static SKMatrix Multiply(SKMatrix value1, SKMatrix value2)
    {
        return ToSKMatrix(
            (value1.ScaleX * value2.ScaleX) + (value1.SkewY * value2.SkewX),
            (value1.ScaleX * value2.SkewY) + (value1.SkewY * value2.ScaleY),
            (value1.SkewX * value2.ScaleX) + (value1.ScaleY * value2.SkewX),
            (value1.SkewX * value2.SkewY) + (value1.ScaleY * value2.ScaleY),
            (value1.TransX * value2.ScaleX) + (value1.TransY * value2.SkewX) + value2.TransX,
            (value1.TransX * value2.SkewY) + (value1.TransY * value2.ScaleY) + value2.TransY);
    }

    public static readonly SKMatrix Identity = ToSKMatrix(1.0, 0.0, 0.0, 1.0, 0.0, 0.0);

    public static SKMatrix Translate(double offsetX, double offsetY)
    {
        return ToSKMatrix(1.0, 0.0, 0.0, 1.0, offsetX, offsetY);
    }

    public static SKMatrix TranslatePrepend(SKMatrix matrix, double offsetX, double offsetY)
    {
        return Multiply(Translate(offsetX, offsetY), matrix);
    }

    public static SKMatrix Scale(double scaleX, double scaleY)
    {
        return ToSKMatrix(scaleX, 0, 0, scaleY, 0.0, 0.0);
    }

    public static SKMatrix ScaleAt(double scaleX, double scaleY, double centerX, double centerY)
    {
        return ToSKMatrix(scaleX, 0, 0, scaleY, centerX - scaleX * centerX, centerY - scaleY * centerY);
    }

    public static SKMatrix ScaleAtPrepend(SKMatrix matrix, double scaleX, double scaleY, double centerX, double centerY)
    {
        return Multiply(ScaleAt(scaleX, scaleY, centerX, centerY), matrix);
    }

    public static SKMatrix Skew(float angleX, float angleY)
    {
        return ToSKMatrix(1.0, Tan(angleX), Tan(angleY), 1.0, 0.0, 0.0);
    }

    public static SKMatrix Rotation(double radians)
    {
        double cos = Cos(radians);
        double sin = Sin(radians);
        return ToSKMatrix(cos, sin, -sin, cos, 0, 0);
    }

    public static SKMatrix Rotation(double angle, double centerX, double centerY)
    {
        return Multiply(
            Multiply(
                Translate(-centerX, -centerY),
                Rotation(angle)),
            Translate(centerX, centerY));
    }

    public static SKMatrix Rotation(double angle, SKPoint center)
    {
        return Multiply(
            Multiply(
                Translate(-center.X, -center.Y),
                Rotation(angle)),
            Translate(center.X, center.Y));
    }

    public static SKPoint TransformPoint(SKMatrix matrix, SKPoint point)
    {
        return new SKPoint(
            (point.X * matrix.ScaleX) + (point.Y * matrix.SkewX) + matrix.TransX,
            (point.X * matrix.SkewY) + (point.Y * matrix.ScaleY) + matrix.TransY);
    }
}


text:
package io.honeyqa.client.eventpath;

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

import io.honeyqa.client.collector.DateCollector;
import io.honeyqa.client.data.HoneyQAData;

/**
 * @author JeongSeungsu
 * @since 2013. 8. 12.오후 4:49:57
 */
public class EventPathManager {

    static List<EventPath> EventList = new ArrayList<EventPath>();

    // 이러면 걍 스태틱 된다네?
    private static int MaxEventPath = 10;

    private static EventPath ErrorEventPaths[] = new EventPath[MaxEventPath];
    private static int ErrorEventPathsCounter = 0;

    static synchronized public void CreateEventPath(int Step, String label) {
        StackTraceElement[] stackTrace = new Exception().getStackTrace();

        EventPath eventpath = new EventPath(DateCollector.GetDateYYMMDDHHMMSS(HoneyQAData.APP_CONTEXT),
                stackTrace[Step].getClassName(),
                stackTrace[Step].getMethodName(),
                label,
                stackTrace[Step].getLineNumber());

        ShiftErrorEventPath();
        ErrorEventPaths[MaxEventPath - 1] = eventpath;
        ErrorEventPathsCounter++;

        EventList.add(eventpath);
    }

    static private void ShiftErrorEventPath() {
        for (int i = 0; i < MaxEventPath - 1; i++)
            ErrorEventPaths[i] = ErrorEventPaths[i + 1];
    }

    static public List<EventPath> getEventPath() {
        return EventList;
    }

    static public List<EventPath> GetErrorEventPath() {
        List<EventPath> erroreventpaths = new ArrayList<EventPath>();
        // MaxEventPath : 10
        int MaxCounter = ErrorEventPathsCounter;
        if (MaxCounter >= MaxEventPath)
            MaxCounter = MaxEventPath;

        for (int i = MaxEventPath - MaxCounter; i < MaxEventPath; i++) {
            erroreventpaths.add(ErrorEventPaths[i]);
        }

        return erroreventpaths;
    }

    static public int GetErrorEventPathCounter() {
        return ErrorEventPathsCounter;
    }

    static public void ClearEvent() {
        EventList.clear();
    }

    static public List<EventPath> GetNumberofEventPath(int number) {
        int listsize = EventList.size();
        int startnum = listsize - number;
        List<EventPath> numeventpath = new ArrayList<EventPath>();
        if (startnum < 0)
            startnum = 0;

        for (int i = startnum; i < listsize; i++) {
            numeventpath.add(EventList.get(i));
        }
        return numeventpath;
    }

}


text:
// MetaTM Project
// File Name: stconfig.cc
//
// Description: configuration parameters for staller
//
// Operating Systems & Architecture Group
// University of Texas at Austin - Department of Computer Sciences
// Copyright 2008. All Rights Reserved.
// See LICENSE file for license terms.

#include "stconfig.h"

stconfig::stconfig() {
  defaults();
}
void stconfig::defaults() {
  stall_time = DEF_STALL_TIME;
  seed = DEF_SEED;
  stress_test = DEF_STRESS_TEST;
  stress_range = DEF_STRESS_RANGE;
  perturb_range = 4;
  cache_perturb = 0;
  frontbus_bandwidth_limit_bpc = FB_BW_bc;
  frontbus_busy_penalty_factor = FB_BUSY_PENALTY_FACTOR;
  frontbus_check_interval = STALL_CHECK_INTERVAL;
  frontbus_stat_size = BW_STAT_SIZE;
  frontbus_stat_interval = STALLER_STAT_INTERVAL;
  bw_ts_index = 0;
};

/*
 * Local variables:
 *  c-indent-level: 3
 *  c-basic-offset: 3
 *  indent-tabs-mode: nil
 *  tab-width: 3
 * End:
 *
 * vim: ts=3 sw=3 expandtab
 */