text:
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Providers;
using MediaBrowser.Model.Serialization;
using MoreLinq;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading;
using System.Threading.Tasks;

namespace MediaBrowser.Plugins.Lastfm.Providers
{
    public class LastfmAlbumProvider : IRemoteMetadataProvider<MusicAlbum, AlbumInfo>, IHasOrder
    {
        private readonly IJsonSerializer _json;
        private readonly IHttpClient _httpClient;

        private readonly IServerConfigurationManager _config;
        private readonly ILogger _logger;

        public LastfmAlbumProvider(IHttpClient httpClient, IJsonSerializer json, IServerConfigurationManager config, ILogger logger)
        {
            _httpClient = httpClient;
            _json = json;
            _config = config;
            _logger = logger;
        }

        public async Task<IEnumerable<RemoteSearchResult>> GetSearchResults(AlbumInfo searchInfo, CancellationToken cancellationToken)
        {
            return new List<RemoteSearchResult>();
        }

        public async Task<MetadataResult<MusicAlbum>> GetMetadata(AlbumInfo id, CancellationToken cancellationToken)
        {
            var result = new MetadataResult<MusicAlbum>();

            var lastFmData = await GetAlbumResult(id, cancellationToken).ConfigureAwait(false);

            if (lastFmData != null && lastFmData.album != null)
            {
                result.HasMetadata = true;
                result.Item = new MusicAlbum();
                ProcessAlbumData(result.Item, lastFmData.album);
            }

            return result;
        }

        private async Task<LastfmGetAlbumResult> GetAlbumResult(AlbumInfo item, CancellationToken cancellationToken)
        {
            // Try album release Id
            var id = item.GetReleaseId();
            if (!string.IsNullOrEmpty(id))
            {
                var result = await GetAlbumResult(id, cancellationToken).ConfigureAwait(false);

                if (result != null && result.album != null)
                {
                    return result;
                }
            }

            // Try album release group Id
            id = item.GetReleaseGroupId();
            if (!string.IsNullOrEmpty(id))
            {
                var result = await GetAlbumResult(id, cancellationToken).ConfigureAwait(false);

                if (result != null && result.album != null)
                {
                    return result;
                }
            }

            var albumArtist = item.GetAlbumArtist();
            // Get each song, distinct by the combination of AlbumArtist and Album
            var songs = item.SongInfos.DistinctBy(i => (i.AlbumArtists.FirstOrDefault() ?? string.Empty) + (i.Album ?? string.Empty), StringComparer.OrdinalIgnoreCase).ToList();

            foreach (var song in songs.Where(song => !string.IsNullOrEmpty(song.Album) && !string.IsNullOrEmpty(song.AlbumArtists.FirstOrDefault())))
            {
                var result = await GetAlbumResult(song.AlbumArtists.FirstOrDefault(), song.Album, cancellationToken).ConfigureAwait(false);

                if (result != null && result.album != null)
                {
                    return result;
                }
            }

            if (string.IsNullOrEmpty(albumArtist))
            {
                return null;
            }

            return await GetAlbumResult(albumArtist, item.Name, cancellationToken);
        }

        private async Task<LastfmGetAlbumResult> GetAlbumResult(string artist, string album, CancellationToken cancellationToken)
        {
            // Get albu info using artist and album name
            var url = LastfmArtistProvider.RootUrl + string.Format("method=album.getInfo&artist={0}&album={1}&api_key={2}&format=json", UrlEncode(artist), UrlEncode(album), LastfmArtistProvider.ApiKey);

            using (var json = await _httpClient.Get(new HttpRequestOptions
            {
                Url = url,
                ResourcePool = LastfmArtistProvider.LastfmResourcePool,
                CancellationToken = cancellationToken,
                EnableHttpCompression = false

            }).ConfigureAwait(false))
            {
                using (var reader = new StreamReader(json))
                {
                    var jsonText = await reader.ReadToEndAsync().ConfigureAwait(false);

                    // Fix their bad json
                    jsonText = jsonText.Replace("\"#text\"", "\"url\"");

                    return _json.DeserializeFromString<LastfmGetAlbumResult>(jsonText);
                }
            }
        }

        private async Task<LastfmGetAlbumResult> GetAlbumResult(string musicbraizId, CancellationToken cancellationToken)
        {
            // Get albu info using artist and album name
            var url = LastfmArtistProvider.RootUrl + string.Format("method=album.getInfo&mbid={0}&api_key={1}&format=json", musicbraizId, LastfmArtistProvider.ApiKey);

            using (var json = await _httpClient.Get(new HttpRequestOptions
            {
                Url = url,
                ResourcePool = LastfmArtistProvider.LastfmResourcePool,
                CancellationToken = cancellationToken,
                EnableHttpCompression = false

            }).ConfigureAwait(false))
            {
                return _json.DeserializeFromStream<LastfmGetAlbumResult>(json);
            }
        }

        private void ProcessAlbumData(MusicAlbum item, LastfmAlbum data)
        {
            var overview = data.wiki != null ? data.wiki.content : null;

            if (!item.LockedFields.Contains(MetadataFields.Overview))
            {
                item.Overview = overview;
            }

            // Only grab the date here if the album doesn't already have one, since id3 tags are preferred
            DateTime release;

            if (DateTime.TryParse(data.releasedate, out release))
            {
                // Lastfm sends back null as sometimes 1901, other times 0
                if (release.Year > 1901)
                {
                    if (!item.PremiereDate.HasValue)
                    {
                        item.PremiereDate = release;
                    }

                    if (!item.ProductionYear.HasValue)
                    {
                        item.ProductionYear = release.Year;
                    }
                }
            }

            string imageSize;
            var url = LastfmHelper.GetImageUrl(data, out imageSize);

            var musicBrainzId = item.GetProviderId(MetadataProviders.MusicBrainzAlbum) ??
                item.GetProviderId(MetadataProviders.MusicBrainzReleaseGroup);

            if (!string.IsNullOrEmpty(musicBrainzId) && !string.IsNullOrEmpty(url))
            {
                LastfmHelper.SaveImageInfo(_config.ApplicationPaths, _logger, musicBrainzId, url, imageSize);
            }
        }

        /// <summary>
        /// Encodes an URL.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <returns>System.String.</returns>
        private string UrlEncode(string name)
        {
            return WebUtility.UrlEncode(name);
        }

        public string Name
        {
            get { return "last.fm"; }
        }

        public int Order
        {
            get
            {
                // After fanart & audiodb
                return 2;
            }
        }

        public Task<HttpResponseInfo> GetImageResponse(string url, CancellationToken cancellationToken)
        {
            throw new NotImplementedException();
        }
    }

    #region Result Objects

    public class LastfmStats
    {
        public string listeners { get; set; }
        public string playcount { get; set; }
    }

    public class LastfmTag
    {
        public string name { get; set; }
        public string url { get; set; }
    }

    public class LastfmTags
    {
        public List<LastfmTag> tag { get; set; }
    }

    public class LastfmFormationInfo
    {
        public string yearfrom { get; set; }
        public string yearto { get; set; }
    }

    public class LastFmBio
    {
        public string published { get; set; }
        public string summary { get; set; }
        public string content { get; set; }
        public string placeformed { get; set; }
        public string yearformed { get; set; }
        public List<LastfmFormationInfo> formationlist { get; set; }
    }

    public class LastFmImage
    {
        public string url { get; set; }
        public string size { get; set; }
    }

    public class LastfmArtist : IHasLastFmImages
    {
        public string name { get; set; }
        public string mbid { get; set; }
        public string url { get; set; }
        public string streamable { get; set; }
        public string ontour { get; set; }
        public LastfmStats stats { get; set; }
        public List<LastfmArtist> similar { get; set; }
        public LastfmTags tags { get; set; }
        public LastFmBio bio { get; set; }
        public List<LastFmImage> image { get; set; }
    }

    public class LastfmAlbum : IHasLastFmImages
    {
        public string name { get; set; }
        public string artist { get; set; }
        public string id { get; set; }
        public string mbid { get; set; }
        public string releasedate { get; set; }
        public int listeners { get; set; }
        public int playcount { get; set; }
        public LastfmTags toptags { get; set; }
        public LastFmBio wiki { get; set; }
        public List<LastFmImage> image { get; set; }
    }

    public interface IHasLastFmImages
    {
        List<LastFmImage> image { get; set; }
    }

    public class LastfmGetAlbumResult
    {
        public LastfmAlbum album { get; set; }
    }

    public class LastfmGetArtistResult
    {
        public LastfmArtist artist { get; set; }
    }

    public class Artistmatches
    {
        public List<LastfmArtist> artist { get; set; }
    }

    public class LastfmArtistSearchResult
    {
        public Artistmatches artistmatches { get; set; }
    }

    public class LastfmArtistSearchResults
    {
        public LastfmArtistSearchResult results { get; set; }
    }

    #endregion
}


text:
// .NAME vtkOStreamWrapper - Wrapper for C++ ostream.  Internal VTK use only.
// .SECTION Description
// Provides a wrapper around the C++ ostream so that VTK source files
// need not include the full C++ streams library.  This is intended to
// prevent cluttering of the translation unit and speed up
// compilation.  Experimentation has revealed between 10% and 60% less
// time for compilation depending on the platform.  This wrapper is
// used by the macros in vtkSetGet.h.

#ifndef vtkOStreamWrapper_h
#define vtkOStreamWrapper_h

#include "vtkCommonCoreModule.h"

#ifndef __VTK_SYSTEM_INCLUDES__INSIDE
Do_not_include_vtkOStreamWrapper_directly__vtkSystemIncludes_includes_it;
#endif

class vtkIndent;
class vtkObjectBase;
class vtkLargeInteger;
class vtkSmartPointerBase;
// workaround clang bug, needs export on forward declaration
#ifdef __clang__
class VTKCOMMONCORE_EXPORT vtkStdString;
#else
class vtkStdString;
#endif

class VTKCOMMONCORE_EXPORT vtkOStreamWrapper
{
  class std_string;
public:
  // Description:
  // Construct class to reference a real ostream.  All methods and
  // operators will be forwarded.
  vtkOStreamWrapper(ostream& os);
  vtkOStreamWrapper(vtkOStreamWrapper& r);

  // Description:
  virtual ~vtkOStreamWrapper();

  // Description:
  // Type for a fake endl.
  struct EndlType {};

  // Description:
  // Forward this output operator to the real ostream.
  vtkOStreamWrapper& operator << (const EndlType&);
  vtkOStreamWrapper& operator << (const vtkIndent&);
  vtkOStreamWrapper& operator << (vtkObjectBase&);
  vtkOStreamWrapper& operator << (const vtkLargeInteger&);
  vtkOStreamWrapper& operator << (const vtkSmartPointerBase&);
  vtkOStreamWrapper& operator << (const vtkStdString&);
  vtkOStreamWrapper& operator << (const char*);
  vtkOStreamWrapper& operator << (void*);
  vtkOStreamWrapper& operator << (char);
  vtkOStreamWrapper& operator << (short);
  vtkOStreamWrapper& operator << (int);
  vtkOStreamWrapper& operator << (long);
  vtkOStreamWrapper& operator << (long long);
  vtkOStreamWrapper& operator << (unsigned char);
  vtkOStreamWrapper& operator << (unsigned short);
  vtkOStreamWrapper& operator << (unsigned int);
  vtkOStreamWrapper& operator << (unsigned long);
  vtkOStreamWrapper& operator << (unsigned long long);
  vtkOStreamWrapper& operator << (float);
  vtkOStreamWrapper& operator << (double);
  vtkOStreamWrapper& operator << (bool);

  // Work-around for IBM Visual Age bug in overload resolution.
#if defined(__IBMCPP__)
  vtkOStreamWrapper& WriteInternal(const char*);
  vtkOStreamWrapper& WriteInternal(void*);
  template <typename T>
  vtkOStreamWrapper& operator << (T* p)
    {
    return this->WriteInternal(p);
    }
#endif

  vtkOStreamWrapper& operator << (void (*)(void*));
  vtkOStreamWrapper& operator << (void* (*)(void*));
  vtkOStreamWrapper& operator << (int (*)(void*));
  vtkOStreamWrapper& operator << (int* (*)(void*));
  vtkOStreamWrapper& operator << (float* (*)(void*));
  vtkOStreamWrapper& operator << (const char* (*)(void*));
  vtkOStreamWrapper& operator << (void (*)(void*, int*));

  // Accept std::string without a declaration.
  template <template <typename, typename, typename> class S>
  vtkOStreamWrapper& operator << (const
    S< char, std::char_traits<char>, std::allocator<char> >& s)
    {
    return *this << reinterpret_cast<std_string const&>(s);
    }

  // Description:
  // Forward the write method to the real stream.
  vtkOStreamWrapper& write(const char*, unsigned long);

  // Description:
  // Get a reference to the real ostream.
  ostream& GetOStream();

  // Description:
  // Allow conversion to the real ostream type.  This allows an
  // instance of vtkOStreamWrapper to look like ostream when passing to a
  // function argument.
  operator ostream&();

  // Description:
  // Forward conversion to bool to the real ostream.
  operator int();

  // Description:
  // Forward the flush method to the real ostream.
  void flush();

  // Description:
  // Implementation detail to allow macros to provide an endl that may
  // or may not be used.
  static void UseEndl(const EndlType&) {}
protected:
  // Reference to the real ostream.
  ostream& ostr;
private:
  vtkOStreamWrapper& operator=(const vtkOStreamWrapper& r); // Not Implemented.
  vtkOStreamWrapper& operator << (std_string const&);
};

#endif
// VTK-HeaderTest-Exclude: vtkOStreamWrapper.h

redpajama_set_name: RedPajamaGithub


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Realms extends CI_Controller {

	function __construct()
    {
        // Call the Model constructor
        parent::__construct();
    }

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see http://codeigniter.com/user_guide/general/urls.html
	 */

	public function index()
	{
		$this->load->view('header');
		$this->load->view('region_select');
		$this->load->view('footer');
	}

	public function eu()
	{
		$this->_regionRequest('eu');
	}

	public function us()
	{
		$this->_regionRequest('us');
	}

	private function _regionRequest($region)
	{
		if( $this->uri->segment(3) != false ) {
			$this->_realmSelect($region, $this->uri->segment(3) );
		} else {
			$this->_realmList($region);
		}
	}

	private function _realmList($region)
	{
		$data['region'] = $region;
		$this->load->model('realm');
		$data['realms'] = $this->realm->getRealmList($region);
		$this->load->view('header');
		$this->load->view('realmList', $data);
		$this->load->view('footer');
	}

	private function _realmSelect($region, $slug)
	{
		$this->session->set_userdata('region', $region);
		$this->session->set_userdata('slug', $slug);
		$this->load->helper('url');
		redirect('/auctions');
	}
}


text:
#pragma once

#include <ATen/ATenGeneral.h> // for AT_API
#include <ATen/optional.h>

#include <cstdint>
#include <cstdio>
#include <exception>
#include <functional>
#include <memory>
#include <sstream>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <vector>

#include <stdarg.h>

#if !defined(_WIN32)
#include <cxxabi.h>
#include <execinfo.h>
#endif // !defined(_WIN32)

#if defined(_MSC_VER) && _MSC_VER <= 1900
#define __func__ __FUNCTION__
#endif

namespace at {
namespace detail {

// TODO: This backtrace retrieval can be implemented on Windows via the Windows
// API using `CaptureStackBackTrace` and `SymFromAddr`.
// https://stackoverflow.com/questions/5693192/win32-backtrace-from-c-code
// https://stackoverflow.com/questions/26398064/counterpart-to-glibcs-backtrace-and-backtrace-symbols-on-windows
// https://msdn.microsoft.com/en-us/library/windows/desktop/bb204633%28v=vs.85%29.aspx.
#if !defined(_WIN32)
struct FrameInformation {
  /// If available, the demangled name of the function at this frame, else
  /// whatever (possibly mangled) name we got from `backtrace()`.
  std::string function_name;
  /// This is a number in hexadecimal form (e.g. "0xdead") representing the
  /// offset into the function's machine code at which the function's body
  /// starts, i.e. skipping the "prologue" that handles stack manipulation and
  /// other calling convention things.
  std::string offset_into_function;
  /// NOTE: In debugger parlance, the "object file" refers to the ELF file that
  /// the symbol originates from, i.e. either an executable or a library.
  std::string object_file;
};

inline at::optional<FrameInformation> parse_frame_information(
    const std::string& frame_string) {
  FrameInformation frame;

  // This is the function name in the CXX ABI mangled format, e.g. something
  // like _Z1gv. Reference:
  // https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling
  std::string mangled_function_name;

#if defined(__GLIBCXX__)
  // In GLIBCXX, `frame_string` follows the pattern
  // `<object-file>(<mangled-function-name>+<offset-into-function>)
  // [<return-address>]`

  auto function_name_start = frame_string.find("(");
  if (function_name_start == std::string::npos) {
    return at::nullopt;
  }
  function_name_start += 1;

  auto offset_start = frame_string.find('+', function_name_start);
  if (offset_start == std::string::npos) {
    return at::nullopt;
  }
  offset_start += 1;

  const auto offset_end = frame_string.find(')', offset_start);
  if (offset_end == std::string::npos) {
    return at::nullopt;
  }

  frame.object_file = frame_string.substr(0, function_name_start - 1);
  frame.offset_into_function =
      frame_string.substr(offset_start, offset_end - offset_start);

  // NOTE: We don't need to parse the return address because
  // we already have it from the call to `backtrace()`.

  mangled_function_name = frame_string.substr(
      function_name_start, (offset_start - 1) - function_name_start);
#elif defined(_LIBCPP_VERSION)
  // In LIBCXX, The pattern is
  // `<frame number> <object-file> <return-address> <mangled-function-name> +
  // <offset-into-function>`
  std::string skip;
  std::istringstream input_stream(frame_string);
  // operator>>() does not fail -- if the input stream is corrupted, the
  // strings will simply be empty.
  input_stream >> skip >> frame.object_file >> skip >> mangled_function_name >>
      skip >> frame.offset_into_function;
#else
#warning Unknown standard library, backtraces may have incomplete debug information
  return at::nullopt;
#endif // defined(__GLIBCXX__)

  // Some system-level functions don't have sufficient debug information, so
  // we'll display them as "<unknown function>". They'll still have a return
  // address and other pieces of information.
  if (mangled_function_name.empty()) {
    frame.function_name = "<unknown function>";
    return frame;
  }

  int status = -1;
  // This function will demangle the mangled function name into a more human
  // readable format, e.g. _Z1gv -> g().
  // More information:
  // https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/libsupc%2B%2B/cxxabi.h
  // NOTE: `__cxa_demangle` returns a malloc'd string that we have to free
  // ourselves.
  std::unique_ptr<char, std::function<void(char*)>> demangled_function_name(
      abi::__cxa_demangle(
          mangled_function_name.c_str(),
          /*__output_buffer=*/nullptr,
          /*__length=*/0,
          &status),
      /*deleter=*/free);

  // Demangling may fail, for example when the name does not follow the
  // standard C++ (Itanium ABI) mangling scheme. This is the case for `main`
  // or `clone` for example, so the mangled name is a fine default.
  if (status == 0) {
    frame.function_name = demangled_function_name.get();
  } else {
    frame.function_name = mangled_function_name;
  }

  return frame;
}

inline std::string get_backtrace(
    size_t frames_to_skip = 0,
    size_t maximum_number_of_frames = 64) {
  // We always skip this frame (backtrace).
  frames_to_skip += 1;

  std::vector<void*> callstack(
      frames_to_skip + maximum_number_of_frames, nullptr);
  // backtrace() gives us a list of return addresses in the current call stack.
  // NOTE: As per man (3) backtrace it can never fail
  // (http://man7.org/linux/man-pages/man3/backtrace.3.html).
  auto number_of_frames = ::backtrace(callstack.data(), callstack.size());

  // Skip as many frames as requested. This is not efficient, but the sizes here
  // are small and it makes the code nicer and safer.
  for (; frames_to_skip > 0 && number_of_frames > 0;
       --frames_to_skip, --number_of_frames) {
    callstack.erase(callstack.begin());
  }

  // `number_of_frames` is strictly less than the current capacity of
  // `callstack`, so this is just a pointer subtraction and makes the subsequent
  // code safer.
  callstack.resize(number_of_frames);

  // `backtrace_symbols` takes the return addresses obtained from `backtrace()`
  // and fetches string representations of each stack. Unfortunately it doesn't
  // return a struct of individual pieces of information but a concatenated
  // string, so we'll have to parse the string after. NOTE: The array returned
  // by `backtrace_symbols` is malloc'd and must be manually freed, but not the
  // strings inside the array.
  std::unique_ptr<char*, std::function<void(char**)>> raw_symbols(
      ::backtrace_symbols(callstack.data(), callstack.size()),
      /*deleter=*/free);
  const std::vector<std::string> symbols(
      raw_symbols.get(), raw_symbols.get() + callstack.size());

  // The backtrace string goes into here.
  std::ostringstream stream;

  for (size_t frame_number = 0; frame_number < callstack.size();
       ++frame_number) {
    const auto frame = parse_frame_information(symbols[frame_number]);

    // frame #<number>:
    stream << "frame #" << frame_number << ": ";

    if (!frame.has_value()) {
      // In the edge-case where we couldn't parse the frame string, we can just
      // use it directly (it may have a different format).
      stream << symbols[frame_number] << "\n";
    } else {
      // <function_name> + <offset> (<return-address> in <object-file>)
      stream << frame->function_name << " + " << frame->offset_into_function
             << " (" << callstack[frame_number] << " in " << frame->object_file
             << ")\n";
    }
  }

  return stream.str();
}
#endif // !defined(_WIN32)

/// A tiny implementation of static `all_of`.
template <bool...>
struct pack;
template <bool... values>
struct all_of : std::is_same<pack<values..., true>, pack<true, values...>> {};

/// A printf wrapper that returns an std::string.
inline std::string format(const char* format_string, ...) {
  static constexpr size_t kMaximumStringLength = 4096;
  char buffer[kMaximumStringLength];

  va_list format_args;
  va_start(format_args, format_string);
  vsnprintf(buffer, sizeof(buffer), format_string, format_args);
  va_end(format_args);

  return buffer;
}

/// Represents a location in source code (for debugging).
struct SourceLocation {
  std::string toString() const {
    return format("%s at %s:%d", function, file, line);
  }

  const char* function;
  const char* file;
  uint32_t line;
};
} // namespace detail

/// The primary ATen error class.
/// Provides a complete error message with source location information via
/// `what()`, and a more concise message via `what_without_backtrace()`. Should
/// primarily be used with the `AT_ERROR` macro.
struct AT_API Error : public std::exception {
  template <typename... FormatArgs>
  Error(
      detail::SourceLocation source_location,
      const char* format_string,
      FormatArgs&&... format_args)
      : what_without_backtrace_(detail::format(
            format_string,
            std::forward<FormatArgs>(format_args)...)),
        what_(what_without_backtrace_) {
    // NOTE: A "literal type"
    // (http://en.cppreference.com/w/cpp/concept/LiteralType) could also be a
    // constexpr struct, so it's not 100% guaranteed that the `printf` call
    // inside `format` is safe, but it will catch 99.9% of all errors we'll run
    // into, such as passing `std::string`.
    static_assert(
        detail::all_of<std::is_literal_type<FormatArgs>::value...>::value,
        "format arguments must be literal types!");
    what_ += " (" + source_location.toString() + ")\n";
#if !defined(_WIN32)
    // Skip this constructor's frame.
    what_ += detail::get_backtrace(/*frames_to_skip=*/1);
#endif // !defined(_WIN32)
  }

  /// Returns the complete error message, including the source location.
  const char* what() const noexcept override {
    return what_.c_str();
  }

  /// Returns only the error message string, without source location.
  const char* what_without_backtrace() const noexcept {
    return what_without_backtrace_.c_str();
  }

 private:
  std::string what_without_backtrace_;
  std::string what_;
};
} // namespace at

#define AT_ERROR(...) \
  throw at::Error({__func__, __FILE__, __LINE__}, __VA_ARGS__)

#define AT_ASSERT(cond, ...) \
  if (!(cond)) {             \
    AT_ERROR(__VA_ARGS__);   \
  }


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string-array name="emailAddressTypes">
        <item>Domicile</item>
        <item>Bureau</item>
        <item>Autre</item>
        <item>Personnalisée</item>
    </string-array>
    <string-array name="imProtocols">
        <item>AIM</item>
        <item>Windows Live</item>
        <item>Yahoo</item>
        <item>Skype</item>
        <item>QQ</item>
        <item>Google Talk</item>
        <item>ICQ</item>
        <item>Jabber</item>
    </string-array>
    <string-array name="organizationTypes">
        <item>Bureau</item>
        <item>Autre</item>
        <item>Personnalisée</item>
    </string-array>
    <string-array name="phoneTypes">
        <item>Domicile</item>
        <item>Mobile</item>
        <item>Bureau</item>
        <item>Télécopie bureau</item>
        <item>Télécopie domicile</item>
        <item>"Récepteur d'appel"</item>
        <item>Autre</item>
        <item>Personnalisé</item>
    </string-array>
    <string-array name="postalAddressTypes">
        <item>Domicile</item>
        <item>Bureau</item>
        <item>Autre</item>
        <item>Personnalisée</item>
    </string-array>
    <string-array name="imAddressTypes">
        <item>Domicile</item>
        <item>Bureau</item>
        <item>Autre</item>
        <item>Personnalisé</item>
    </string-array>
</resources>


text:
99.downto(1) do |bottles|
  puts "#{bottles} bottles of beer on the wall, #{bottles} bottles of beer."
  puts "Take one down and pass it around, #{(bottles > 1) ? bottles-1 : 'no more'} bottles of beer on the wall."
end

puts "No more bottles of beer on the wall, no more bottles of beer."
puts "Go to the store and buy some more, 99 bottles of beer on the wall."


text:
//
// ISegment.cs
//
// Author:
//       Mike Krüger <mkrueger@xamarin.com>
//
// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

using System;

//from namespace MonoDevelop.Core.Text
namespace LayoutFarm.TreeCollection
{
    /// <summary>
    /// An (Offset,Length)-pair.
    /// </summary>
    public interface ISegment
    {
        /// <summary>
        /// Gets the start offset of the segment.
        /// </summary>
        int Offset { get; }

        /// <summary>
        /// Gets the length of the segment.
        /// </summary>
        /// <remarks>For line segments (IDocumentLine), the length does not include the line delimeter.</remarks>
        int Length { get; }

        /// <summary>
        /// Gets the end offset of the segment.
        /// </summary>
        /// <remarks>EndOffset = Offset + Length;</remarks>
        int EndOffset { get; }
    }

    /// <summary>
	/// An (Offset, Length) pair representing a text span.
	/// </summary>
	public struct TextSegment : IEquatable<TextSegment>, ISegment
    {
        public static readonly TextSegment Invalid = new TextSegment(-1, 0);

        readonly int _offset;

        /// <summary>
        ///  Gets the start offset of the segment.
        /// </summary>
        /// <value>
        /// The offset.
        /// </value>
        public int Offset => _offset;

        readonly int _length;

        /// <summary>
        /// Gets the length of the segment.
        /// </summary>
        /// <value>
        /// The length.
        /// </value>
        public int Length => _length;

        /// <summary>
        /// Gets the end offset of the segment.
        /// </summary>
        /// <remarks>
        /// EndOffset = Offset + Length;
        /// </remarks>
        /// <value>
        /// The end offset.
        /// </value>
        public int EndOffset => Offset + Length;

        /// <summary>
        /// Gets a value indicating whether this instance is empty.
        /// </summary>
        /// <value>
        /// <c>true</c> if this instance is empty; otherwise, <c>false</c>.
        /// </value>
        public bool IsEmpty => Length == 0;

        /// <summary>
        /// Gets a value indicating whether this instance is invalid.
        /// </summary>
        /// <value>
        /// <c>true</c> if this instance is invalid; otherwise, <c>false</c>.
        /// </value>
        public bool IsInvalid => Offset < 0;

        /// <summary>
        /// Initializes a new instance of the <see cref="TextSegment"/> struct.
        /// </summary>
        /// <param name='offset'>
        /// The offset of the segment.
        /// </param>
        /// <param name='length'>
        /// The length of the segment.
        /// </param>
        public TextSegment(int offset, int length)
        {
            _offset = offset;
            _length = length;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="TextSegment"/> struct.
        /// </summary>
        public TextSegment(ISegment segment) : this(segment.Offset, segment.Length)
        {
        }

        public static bool operator ==(TextSegment left, TextSegment right)
        {
            return Equals(left, right);
        }

        public static bool operator !=(TextSegment left, TextSegment right)
        {
            return !Equals(left, right);
        }

        public static bool Equals(TextSegment left, TextSegment right)
        {
            return left.Offset == right.Offset && left.Length == right.Length;
        }

        /// <summary>
        /// Determines whether this instance is inside the specified offset.
        /// </summary>
        /// <returns>
        /// <c>true</c> if this instance is inside the specified offset (upper bound inclusive); otherwise, <c>false</c>.
        /// </returns>
        /// <param name='offset'>
        /// The offset offset.
        /// </param>
        public bool IsInside(int offset)
        {
            return Offset <= offset && offset <= EndOffset;
        }

        /// <summary>
        /// Determines whether the specified <see cref="TextSegment"/> is equal to the current <see cref="TextSegment"/>.
        /// </summary>
        /// <param name='other'>
        /// The <see cref="TextSegment"/> to compare with the current <see cref="TextSegment"/>.
        /// </param>
        /// <returns>
        /// <c>true</c> if the specified <see cref="TextSegment"/> is equal to the current
        /// <see cref="TextSegment"/>; otherwise, <c>false</c>.
        /// </returns>
        public bool Equals(TextSegment other)
        {
            return Equals(this, other);
        }

        /// <summary>
        /// Determines whether the specified <see cref="System.Object"/> is equal to the current <see cref="TextSegment"/>.
        /// </summary>
        /// <param name='obj'>
        /// The <see cref="System.Object"/> to compare with the current <see cref="TextSegment"/>.
        /// </param>
        /// <returns>
        /// <c>true</c> if the specified <see cref="System.Object"/> is equal to the current
        /// <see cref="TextSegment"/>; otherwise, <c>false</c>.
        /// </returns>
        public override bool Equals(object obj)
        {
            var otherSegment = obj as ISegment;
            if (otherSegment == null)
                return false;
            return Offset == otherSegment.Offset && _length == otherSegment.Length;
        }

        /// <summary>
        /// Serves as a hash function for a <see cref="TextSegment"/> object.
        /// </summary>
        /// <returns>
        /// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a hash table.
        /// </returns>
        public override int GetHashCode()
        {
            return Offset ^ Length;
        }

        public static TextSegment FromBounds(int startOffset, int endOffset)
        {
            if (startOffset > endOffset)
                throw new ArgumentOutOfRangeException("endOffset", "endOffset < startOffset");
            return new TextSegment(startOffset, endOffset - startOffset);
        }

        /// <summary>
        /// Returns a <see cref="System.String"/> that represents the current <see cref="TextSegment"/>.
        /// </summary>
        /// <returns>
        /// A <see cref="System.String"/> that represents the current <see cref="TextSegment"/>.
        /// </returns>
        public override string ToString()
        {
            return string.Format("[TextSegment: Offset={0}, Length={1}]", Offset, Length);
        }
    }

    /// <summary>
    /// An abstract implementation of the ISegment (Offset, Length) pair representing a text span.
    /// </summary>
    public abstract class AbstractSegment : ISegment
    {
        readonly int _offset;

        /// <summary>
        ///  Gets the start offset of the segment.
        /// </summary>
        /// <value>
        /// The offset.
        /// </value>
        public int Offset => _offset;

        readonly int _length;

        /// <summary>
        /// Gets the length of the segment.
        /// </summary>
        /// <value>
        /// The length.
        /// </value>
        public int Length => _length;

        /// <summary>
        /// Gets the end offset of the segment.
        /// </summary>
        /// <remarks>
        /// EndOffset = Offset + Length;
        /// </remarks>
        /// <value>
        /// The end offset.
        /// </value>
        public int EndOffset => Offset + Length;

        /// <summary>
        /// Gets a value indicating whether this instance is empty.
        /// </summary>
        /// <value>
        /// <c>true</c> if this instance is empty; otherwise, <c>false</c>.
        /// </value>
        public bool IsEmpty => Length == 0;

        /// <summary>
        /// Gets a value indicating whether this instance is invalid.
        /// </summary>
        /// <value>
        /// <c>true</c> if this instance is invalid; otherwise, <c>false</c>.
        /// </value>
        public bool IsInvalid => Offset < 0;

        /// <summary>
        /// Initializes a new instance of the <see cref="TextSegment"/> struct.
        /// </summary>
        /// <param name='offset'>
        /// The offset of the segment.
        /// </param>
        /// <param name='length'>
        /// The length of the segment.
        /// </param>
        protected AbstractSegment(int offset, int length)
        {
            if (length < 0)
                throw new System.ArgumentOutOfRangeException(nameof(length), "was " + length);
            _offset = offset;
            _length = length;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="TextSegment"/> struct.
        /// </summary>
        protected AbstractSegment(ISegment segment)
        {
            if (segment == null)
                throw new ArgumentNullException("segment");
            _offset = segment.Offset;
            _length = segment.Length;
        }

        public override string ToString()
        {
            return string.Format("[AbstractSegment: Offset={0}, Length={1}]", Offset, Length);
        }
    }

    /// <summary>
	/// Extension methods for <see cref="ISegment"/>.
	/// </summary>
	public static class ISegmentExtensions
    {
        /// <summary>
        /// Gets whether <paramref name="segment"/> fully contains the specified segment.
        /// </summary>
        /// <remarks>
        /// Use <c>segment.Contains(offset, 0)</c> to detect whether a segment (end inclusive) contains offset;
        /// use <c>segment.Contains(offset, 1)</c> to detect whether a segment (end exclusive) contains offset.
        /// </remarks>
        public static bool Contains(this ISegment segment, int offset, int length)
        {
            if (segment == null)
                throw new ArgumentNullException("segment");
            return segment.Offset <= offset && offset + length <= segment.EndOffset;
        }

        /// <summary>
        /// Gets whether <paramref name="segment"/> fully contains the specified segment.
        /// </summary>
        public static bool Contains(this ISegment segment, ISegment span)
        {
            if (segment == null)
                throw new ArgumentNullException("segment");
            if (span == null)
                throw new ArgumentNullException("span");
            return segment.Offset <= span.Offset && span.EndOffset <= segment.EndOffset;
        }

        /// <summary>
        /// Gets whether the offset is within the <paramref name="segment"/>.
        /// </summary>
        public static bool Contains(this ISegment segment, int offset)
        {
            if (segment == null)
                throw new ArgumentNullException("segment");
            return unchecked((uint)(offset - segment.Offset) < (uint)segment.Length);
        }

        /// <summary>
        /// Gets whether the offset is within the <paramref name="segment"/>.
        /// </summary>
        public static bool IsInside(this ISegment segment, int offset)
        {
            if (segment == null)
                throw new ArgumentNullException("segment");
            return unchecked((uint)(offset - segment.Offset) <= (uint)segment.Length);
        }

        /// <summary>
        /// Determines whether <paramref name="other"/> overlaps this span. Two spans are considered to overlap
        /// if they have positions in common and neither is empty. Empty spans do not overlap with any
        /// other span.
        /// </summary>
        public static bool OverlapsWith(this ISegment segment, ISegment other)
        {
            int overlapStart = Math.Max(segment.Offset, other.Offset);
            int overlapEnd = Math.Min(segment.EndOffset, other.EndOffset);
            return overlapStart < overlapEnd;
        }

        //public static ISegment AdjustSegment(this ISegment segment, TextChangeEventArgs args)
        //{
        //    if (segment == null)
        //        throw new ArgumentNullException("segment");
        //    var newStartOffset = args.GetNewOffset(segment.Offset);
        //    var newEndOffset = args.GetNewOffset(segment.EndOffset);
        //    return new TextSegment(newStartOffset, newEndOffset - newStartOffset);
        //}

        //public static IEnumerable<ISegment> AdjustSegments(this IEnumerable<ISegment> segments, TextChangeEventArgs args)
        //{
        //    if (segments == null)
        //        throw new ArgumentNullException("segments");
        //    foreach (var segment in segments)
        //    {
        //        yield return segment.AdjustSegment(args);
        //    }
        //}

        public static bool IsInvalid(this ISegment segment)
        {
            if (segment == null)
                throw new ArgumentNullException(nameof(segment));
            return segment.Offset < 0;
        }
    }
}


text:
package org.apache.camel.component.hazelcast.seda;

import java.util.concurrent.BlockingQueue;

import com.hazelcast.core.HazelcastInstance;
import org.apache.camel.Consumer;
import org.apache.camel.Endpoint;
import org.apache.camel.Processor;
import org.apache.camel.Producer;
import org.apache.camel.component.hazelcast.HazelcastCommand;
import org.apache.camel.component.hazelcast.HazelcastDefaultComponent;
import org.apache.camel.component.hazelcast.HazelcastDefaultEndpoint;
import org.apache.camel.spi.UriEndpoint;
import org.apache.camel.util.ObjectHelper;

/**
 * The hazelcast-seda component is used to access Hazelcast {@link BlockingQueue}.
 */
@UriEndpoint(firstVersion = "2.7.0", scheme = "hazelcast-seda", title = "Hazelcast SEDA", syntax = "hazelcast-seda:cacheName", label = "cache,datagrid")
public class HazelcastSedaEndpoint extends HazelcastDefaultEndpoint {

    private final BlockingQueue<Object> queue;
    private final HazelcastSedaConfiguration configuration;

    public HazelcastSedaEndpoint(final HazelcastInstance hazelcastInstance, final String uri, final HazelcastDefaultComponent component, final HazelcastSedaConfiguration configuration) {
        super(hazelcastInstance, uri, component);
        this.queue = hazelcastInstance.getQueue(configuration.getQueueName());
        this.configuration = configuration;
        if (ObjectHelper.isEmpty(configuration.getQueueName())) {
            throw new IllegalArgumentException("Queue name is missing.");
        }
        setCommand(HazelcastCommand.seda);
    }

    public Producer createProducer() throws Exception {
        return new HazelcastSedaProducer(this, getQueue());
    }

    public Consumer createConsumer(final Processor processor) throws Exception {
        HazelcastSedaConsumer answer = new HazelcastSedaConsumer(this, processor);
        configureConsumer(answer);
        return answer;
    }

    public BlockingQueue<Object> getQueue() {
        return queue;
    }

    public HazelcastSedaConfiguration getConfiguration() {
        return configuration;
    }

    public boolean isSingleton() {
        return true;
    }

}


text:
package io.getlime.security.powerauth.app.tppengine.controller;

import io.getlime.core.rest.model.base.request.ObjectRequest;
import io.getlime.core.rest.model.base.response.ObjectResponse;
import io.getlime.core.rest.model.base.response.Response;
import io.getlime.security.powerauth.app.tppengine.errorhandling.exception.TppAppNotFoundException;
import io.getlime.security.powerauth.app.tppengine.errorhandling.exception.TppNotFoundException;
import io.getlime.security.powerauth.app.tppengine.errorhandling.exception.UnableToCreateAppException;
import io.getlime.security.powerauth.app.tppengine.model.request.CreateTppAppRequest;
import io.getlime.security.powerauth.app.tppengine.model.response.TppAppDetailResponse;
import io.getlime.security.powerauth.app.tppengine.model.validator.CreateTppAppRequestValidator;
import io.getlime.security.powerauth.app.tppengine.service.TppService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Controller for lookup and registration of TPP service providers
 *
 * @author Petr Dvorak, petr@wultra.com
 */
@RestController
@RequestMapping("tpp")
public class TppRegistryController {

    private final TppService tppService;

    @Autowired
    public TppRegistryController(TppService tppService) {
        this.tppService = tppService;
    }

    @RequestMapping(value = "app", method = RequestMethod.GET)
    public ObjectResponse<TppAppDetailResponse> fetchAppInfoFromClientId(
            @RequestParam("clientId") String clientId,
            @RequestParam(value = "tppLicense", required = false) String tppLicense) throws TppAppNotFoundException, TppNotFoundException {
        if (tppLicense != null) {
            final TppAppDetailResponse response = tppService.fetchAppDetailByClientId(clientId, tppLicense);
            return new ObjectResponse<>(response);
        } else {
            final TppAppDetailResponse response = tppService.fetchAppDetailByClientId(clientId);
            return new ObjectResponse<>(response);
        }
    }

    @RequestMapping(value = "app/list", method = RequestMethod.GET)
    public ObjectResponse<List<TppAppDetailResponse>> getAppList(@RequestParam("tppLicense") String tppLicense) throws TppNotFoundException {
        final List<TppAppDetailResponse> response = tppService.fetchAppListByTppLicense(tppLicense);
        if (response != null) {
            return new ObjectResponse<>(response);
        } else {
            throw new TppNotFoundException("tpp.notFound", tppLicense);
        }
    }

    @RequestMapping(value = "app", method = RequestMethod.POST)
    public ObjectResponse<TppAppDetailResponse> createApp(@RequestBody ObjectRequest<CreateTppAppRequest> request) throws UnableToCreateAppException {
        final CreateTppAppRequest requestObject = request.getRequestObject();
        final List<String> errors = CreateTppAppRequestValidator.validate(requestObject);
        if (errors != null) { // request was not valid
            throw new UnableToCreateAppException(errors);
        }
        final TppAppDetailResponse tppAppDetailResponse = tppService.createApp(requestObject);
        return new ObjectResponse<>(tppAppDetailResponse);
    }

    @RequestMapping(value = "app", method = RequestMethod.PUT)
    public ObjectResponse<TppAppDetailResponse> updateApp(
            @RequestParam("clientId") String clientId,
            @RequestBody ObjectRequest<CreateTppAppRequest> request) throws UnableToCreateAppException, TppNotFoundException, TppAppNotFoundException {
        final CreateTppAppRequest requestObject = request.getRequestObject();
        final List<String> errors = CreateTppAppRequestValidator.validate(requestObject);
        if (errors != null) { // request was not valid
            throw new UnableToCreateAppException(errors);
        }
        final TppAppDetailResponse tppAppDetailResponse = tppService.updateApp(clientId, requestObject);
        return new ObjectResponse<>(tppAppDetailResponse);
    }

    @RequestMapping(value = "app/renewSecret", method = RequestMethod.POST)
    public ObjectResponse<TppAppDetailResponse> updateApp(
            @RequestParam("clientId") String clientId,
            @RequestParam("tppLicense") String tppLicense) throws UnableToCreateAppException, TppNotFoundException, TppAppNotFoundException {
        final TppAppDetailResponse tppAppDetailResponse = tppService.renewAppSecret(clientId, tppLicense);
        return new ObjectResponse<>(tppAppDetailResponse);
    }

    @RequestMapping(value = "app", method = RequestMethod.DELETE)
    public Response deleteApp(
            @RequestParam("clientId") String clientId,
            @RequestParam("tppLicense") String tppLicense) throws TppNotFoundException, TppAppNotFoundException {
        tppService.deleteApp(clientId, tppLicense);
        return new Response();
    }

}


text:
CREATE TABLE IF NOT EXISTS `bx_organizations_scores` (
  `object_id` int(11) NOT NULL default '0',
  `count_up` int(11) NOT NULL default '0',
  `count_down` int(11) NOT NULL default '0',
  UNIQUE KEY `object_id` (`object_id`)
);

CREATE TABLE IF NOT EXISTS `bx_organizations_scores_track` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `object_id` int(11) NOT NULL default '0',
  `author_id` int(11) NOT NULL default '0',
  `author_nip` int(11) unsigned NOT NULL default '0',
  `type` varchar(8) NOT NULL default '',
  `date` int(11) NOT NULL default '0',
  PRIMARY KEY (`id`),
  KEY `vote` (`object_id`, `author_nip`)
);

-- FORMS
DELETE FROM `sys_form_inputs` WHERE `object`='bx_organization' AND `name`='profile_ip';
INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES
('bx_organization', 'bx_organizations', 'profile_ip', '', '', 0, 'text', '_bx_orgs_form_profile_input_sys_profile_ip', '_bx_orgs_form_profile_input_profile_ip', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0);

DELETE FROM `sys_form_display_inputs` WHERE `display_name`='bx_organization_view' AND `input_name`='profile_ip';
INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
('bx_organization_view', 'profile_ip', 192, 1, 5);


text:
package system.web.file.temp;

import java.io.File;
import system.web.WebContext;
import system.web.file.FileConfig;

/**
 *
 * @author wangchunzi
 */
public class IniPath {

    public void iniPath(FileConfig fc) {
        iniTool(fc.path_save_real);
        iniTool(fc.path_temp_real);
    }

    private void iniTool(String path) {
        if (null == path || path.isEmpty()) {
            return;
        }

        if (WebContext.getWebContext().islinux) {
            path = path.replace("//", "/");
            path = path.endsWith("/") ? path.substring(0, path.length() - 1) : path;
        } else {
            path = path.replace("/", "\\").replace("\\\\", "\\");
            path = path.endsWith("\\") ? path.substring(0, path.length() - 1) : path;
        }

        File file = new File(path);
        if (!file.exists()) {
            file.mkdirs();
        }

    }

}


text:
This directory hosts community contributed analyzers. They are not maintained
by the core Timesketch development team. Code in `/contrib/` directories won't
be taken into account in any end-to-end tests run by the core Timesketch
development team; it's up to contributors to make sure that their code is
properly end-to-end tested.

### For developers

If you require a dependency that is not part of the core Timesketch system
you need to add it to the `contrib_requirements.txt` file in this directory.

In order to support extra dependencies you need to catch any import errors
in your code. For example:

```python
has_required_deps = True
try:
    from google.cloud import bigquery
except ImportError:
    has_required_deps = False

... <your analyzer code here> ...

# Only register the module if all dependencies can be imported
if has_required_deps:
    manager.AnalysisManager.register_analyzer(TestContrib)
```


text:
<menu
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context="de.jeanpierrehotz.drawyaownwallpapers.ChangeSettingsActivity">

    <item
        android:id="@+id/menu_changesettings_selectsetting"
        android:orderInCategory="100"
        android:title="@string/contextMenu_selectSetting"
        app:showAsAction="never"/>

</menu>


text:
package com.gs.collections.impl.lazy;

import java.util.Iterator;

import com.gs.collections.api.block.predicate.Predicate;
import com.gs.collections.api.block.predicate.Predicate2;
import com.gs.collections.api.block.procedure.Procedure;
import com.gs.collections.api.block.procedure.Procedure2;
import com.gs.collections.api.block.procedure.primitive.ObjectIntProcedure;
import com.gs.collections.impl.block.factory.Predicates;
import com.gs.collections.impl.block.procedure.IfObjectIntProcedure;
import com.gs.collections.impl.block.procedure.IfProcedure;
import com.gs.collections.impl.block.procedure.IfProcedureWith;
import com.gs.collections.impl.lazy.iterator.SelectInstancesOfIterator;
import com.gs.collections.impl.utility.Iterate;
import net.jcip.annotations.Immutable;

/**
 * A SelectIterable is an iterable that filters a source iterable for instances of a Class as it iterates.
 */
@Immutable
public class SelectInstancesOfIterable<T>
        extends AbstractLazyIterable<T>
{
    private final Iterable<?> adapted;
    private final Class<T> clazz;

    public SelectInstancesOfIterable(Iterable<?> newAdapted, Class<T> clazz)
    {
        this.adapted = newAdapted;
        this.clazz = clazz;
    }

    public void each(Procedure<? super T> procedure)
    {
        Iterate.forEach((Iterable<T>) this.adapted, new IfProcedure<T>(Predicates.instanceOf(this.clazz), procedure));
    }

    @Override
    public void forEachWithIndex(ObjectIntProcedure<? super T> objectIntProcedure)
    {
        Iterate.forEach((Iterable<T>) this.adapted, new IfObjectIntProcedure<T>(Predicates.instanceOf(this.clazz), objectIntProcedure));
    }

    @Override
    public <P> void forEachWith(Procedure2<? super T, ? super P> procedure, P parameter)
    {
        Iterate.forEachWith((Iterable<T>) this.adapted, new IfProcedureWith<T, P>(Predicates.instanceOf(this.clazz), procedure), parameter);
    }

    @Override
    public T getFirst()
    {
        return this.clazz.cast(Iterate.detect(this.adapted, Predicates.instanceOf(this.clazz)));
    }

    @Override
    public boolean anySatisfy(Predicate<? super T> predicate)
    {
        return Iterate.anySatisfy((Iterable<T>) this.adapted, Predicates.and(Predicates.instanceOf(this.clazz), predicate));
    }

    @Override
    public <P> boolean anySatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter)
    {
        return this.anySatisfy(Predicates.bind(predicate, parameter));
    }

    @Override
    public boolean allSatisfy(Predicate<? super T> predicate)
    {
        return Iterate.allSatisfy((Iterable<T>) this.adapted, new AllSatisfyPredicate<T>(Predicates.instanceOf(this.clazz), predicate));
    }

    @Override
    public <P> boolean allSatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter)
    {
        return this.allSatisfy(Predicates.bind(predicate, parameter));
    }

    @Override
    public boolean noneSatisfy(Predicate<? super T> predicate)
    {
        return Iterate.noneSatisfy((Iterable<T>) this.adapted, new AllSatisfyPredicate<T>(Predicates.instanceOf(this.clazz), predicate));
    }

    @Override
    public <P> boolean noneSatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter)
    {
        return this.noneSatisfy(Predicates.bind(predicate, parameter));
    }

    @Override
    public T detect(Predicate<? super T> predicate)
    {
        return Iterate.detect((Iterable<T>) this.adapted, Predicates.and(Predicates.instanceOf(this.clazz), predicate));
    }

    public Iterator<T> iterator()
    {
        return new SelectInstancesOfIterator<T>(this.adapted, this.clazz);
    }
}


text:
package com.hazelcast.client.impl.protocol.codec;

import com.hazelcast.client.impl.protocol.ClientMessage;
import com.hazelcast.client.impl.protocol.Generated;
import com.hazelcast.client.impl.protocol.codec.builtin.*;
import com.hazelcast.client.impl.protocol.codec.custom.*;

import javax.annotation.Nullable;

import static com.hazelcast.client.impl.protocol.ClientMessage.*;
import static com.hazelcast.client.impl.protocol.codec.builtin.FixedSizeTypesCodec.*;

/*
 * This file is auto-generated by the Hazelcast Client Protocol Code Generator.
 * To change this file, edit the templates or the protocol
 * definitions on the https://github.com/hazelcast/hazelcast-client-protocol
 * and regenerate it.
 */

/**
 * Atomically sets the given value
 */
@Generated("a38383a91d55b4f5430dd28568d68d4d")
public final class AtomicRefSetCodec {
    //hex: 0x0A0500
    public static final int REQUEST_MESSAGE_TYPE = 656640;
    //hex: 0x0A0501
    public static final int RESPONSE_MESSAGE_TYPE = 656641;
    private static final int REQUEST_RETURN_OLD_VALUE_FIELD_OFFSET = PARTITION_ID_FIELD_OFFSET + INT_SIZE_IN_BYTES;
    private static final int REQUEST_INITIAL_FRAME_SIZE = REQUEST_RETURN_OLD_VALUE_FIELD_OFFSET + BOOLEAN_SIZE_IN_BYTES;
    private static final int RESPONSE_INITIAL_FRAME_SIZE = RESPONSE_BACKUP_ACKS_FIELD_OFFSET + BYTE_SIZE_IN_BYTES;

    private AtomicRefSetCodec() {
    }

    @edu.umd.cs.findbugs.annotations.SuppressFBWarnings({"URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD"})
    public static class RequestParameters {

        /**
         * CP group id of this IAtomicReference instance.
         */
        public com.hazelcast.cp.internal.RaftGroupId groupId;

        /**
         * Name of this IAtomicReference instance.
         */
        public java.lang.String name;

        /**
         * The value to set
         */
        public @Nullable com.hazelcast.internal.serialization.Data newValue;

        /**
         * Denotes whether the old value is returned or not
         */
        public boolean returnOldValue;
    }

    public static ClientMessage encodeRequest(com.hazelcast.cp.internal.RaftGroupId groupId, java.lang.String name, @Nullable com.hazelcast.internal.serialization.Data newValue, boolean returnOldValue) {
        ClientMessage clientMessage = ClientMessage.createForEncode();
        clientMessage.setRetryable(false);
        clientMessage.setOperationName("AtomicRef.Set");
        ClientMessage.Frame initialFrame = new ClientMessage.Frame(new byte[REQUEST_INITIAL_FRAME_SIZE], UNFRAGMENTED_MESSAGE);
        encodeInt(initialFrame.content, TYPE_FIELD_OFFSET, REQUEST_MESSAGE_TYPE);
        encodeInt(initialFrame.content, PARTITION_ID_FIELD_OFFSET, -1);
        encodeBoolean(initialFrame.content, REQUEST_RETURN_OLD_VALUE_FIELD_OFFSET, returnOldValue);
        clientMessage.add(initialFrame);
        RaftGroupIdCodec.encode(clientMessage, groupId);
        StringCodec.encode(clientMessage, name);
        CodecUtil.encodeNullable(clientMessage, newValue, DataCodec::encode);
        return clientMessage;
    }

    public static AtomicRefSetCodec.RequestParameters decodeRequest(ClientMessage clientMessage) {
        ClientMessage.ForwardFrameIterator iterator = clientMessage.frameIterator();
        RequestParameters request = new RequestParameters();
        ClientMessage.Frame initialFrame = iterator.next();
        request.returnOldValue = decodeBoolean(initialFrame.content, REQUEST_RETURN_OLD_VALUE_FIELD_OFFSET);
        request.groupId = RaftGroupIdCodec.decode(iterator);
        request.name = StringCodec.decode(iterator);
        request.newValue = CodecUtil.decodeNullable(iterator, DataCodec::decode);
        return request;
    }

    public static ClientMessage encodeResponse(@Nullable com.hazelcast.internal.serialization.Data response) {
        ClientMessage clientMessage = ClientMessage.createForEncode();
        ClientMessage.Frame initialFrame = new ClientMessage.Frame(new byte[RESPONSE_INITIAL_FRAME_SIZE], UNFRAGMENTED_MESSAGE);
        encodeInt(initialFrame.content, TYPE_FIELD_OFFSET, RESPONSE_MESSAGE_TYPE);
        clientMessage.add(initialFrame);

        CodecUtil.encodeNullable(clientMessage, response, DataCodec::encode);
        return clientMessage;
    }

    /**
    * the old value or null, depending on
    * the {
    */
    public static com.hazelcast.internal.serialization.Data decodeResponse(ClientMessage clientMessage) {
        ClientMessage.ForwardFrameIterator iterator = clientMessage.frameIterator();
        //empty initial frame
        iterator.next();
        return CodecUtil.decodeNullable(iterator, DataCodec::decode);
    }

}


text:
---
uid: SolidEdgeAssembly.AssemblyFeaturesSweptProtrusion.Delete
summary: Deletes the referenced object.
remarks:
---


text:
package org.apache.drill.common.expression;

import java.util.Iterator;

import org.apache.drill.common.expression.visitors.ExprVisitor;
import org.apache.drill.common.types.TypeProtos;
import org.apache.drill.common.types.TypeProtos.DataMode;
import org.apache.drill.common.types.TypeProtos.MajorType;

import com.google.common.collect.Iterators;

public class TypedNullConstant extends LogicalExpressionBase {

    private final MajorType type;

    public TypedNullConstant(MajorType type) {
      super(null);
      this.type = TypeProtos.MajorType.newBuilder().mergeFrom(type).setMode(DataMode.OPTIONAL).build();
    }

    @Override
    public MajorType getMajorType() {
      return this.type;
    }

    @Override
    public <T, V, E extends Exception> T accept(ExprVisitor<T, V, E> visitor, V value) throws E {
      return visitor.visitNullConstant(this, value);
    }

    @Override
    public Iterator<LogicalExpression> iterator() {
      return Iterators.emptyIterator();
    }

    @Override
    public int getSelfCost() {
      return 0;  // TODO
    }

    @Override
    public int getCumulativeCost() {
      return 0; // TODO
    }

}