text:
using base::TimeDelta;

namespace net {

// TODO(willchan): Base this off RTT instead of statically setting it. Note we
// choose a timeout that is different from the backup connect job timer so they
// don't synchronize.
const int TransportConnectJob::kIPv6FallbackTimerInMs = 300;

namespace {

bool AddressListStartsWithIPv6AndHasAnIPv4Addr(const AddressList& addrlist) {
  const struct addrinfo* ai = addrlist.head();
  if (ai->ai_family != AF_INET6)
    return false;

  ai = ai->ai_next;
  while (ai) {
    if (ai->ai_family != AF_INET6)
      return true;
    ai = ai->ai_next;
  }

  return false;
}

bool AddressListOnlyContainsIPv6Addresses(const AddressList& addrlist) {
  DCHECK(addrlist.head());
  for (const struct addrinfo* ai = addrlist.head(); ai; ai = ai->ai_next) {
    if (ai->ai_family != AF_INET6)
      return false;
  }

  return true;
}

}  // namespace

TransportSocketParams::TransportSocketParams(
    const HostPortPair& host_port_pair,
    RequestPriority priority,
    const GURL& referrer,
    bool disable_resolver_cache,
    bool ignore_limits)
    : destination_(host_port_pair), ignore_limits_(ignore_limits)
#ifdef ANDROID
    , valid_uid_(false), calling_uid_(0)
#endif
    {
  Initialize(priority, referrer, disable_resolver_cache);
}

TransportSocketParams::~TransportSocketParams() {}

void TransportSocketParams::Initialize(RequestPriority priority,
                                       const GURL& referrer,
                                       bool disable_resolver_cache) {
  // The referrer is used by the DNS prefetch system to correlate resolutions
  // with the page that triggered them. It doesn't impact the actual addresses
  // that we resolve to.
  destination_.set_referrer(referrer);
  destination_.set_priority(priority);
  if (disable_resolver_cache)
    destination_.set_allow_cached_response(false);
}

#ifdef ANDROID
bool TransportSocketParams::getUID(uid_t *uid) const {
  if (!valid_uid_) {
    return false;
  }
  *uid = calling_uid_;
  return true;
}

void TransportSocketParams::setUID(uid_t uid) {
  valid_uid_ = true;
  calling_uid_ = uid;
}
#endif

// TransportConnectJobs will time out after this many seconds.  Note this is
// the total time, including both host resolution and TCP connect() times.
//
// TODO(eroman): The use of this constant needs to be re-evaluated. The time
// needed for TCPClientSocketXXX::Connect() can be arbitrarily long, since
// the address list may contain many alternatives, and most of those may
// timeout. Even worse, the per-connect timeout threshold varies greatly
// between systems (anywhere from 20 seconds to 190 seconds).
// See comment #12 at http://crbug.com/23364 for specifics.
static const int kTransportConnectJobTimeoutInSeconds = 240;  // 4 minutes.

TransportConnectJob::TransportConnectJob(
    const std::string& group_name,
    const scoped_refptr<TransportSocketParams>& params,
    base::TimeDelta timeout_duration,
    ClientSocketFactory* client_socket_factory,
    HostResolver* host_resolver,
    Delegate* delegate,
    NetLog* net_log)
    : ConnectJob(group_name, timeout_duration, delegate,
                 BoundNetLog::Make(net_log, NetLog::SOURCE_CONNECT_JOB)),
      params_(params),
      client_socket_factory_(client_socket_factory),
      ALLOW_THIS_IN_INITIALIZER_LIST(
          callback_(this,
                    &TransportConnectJob::OnIOComplete)),
      resolver_(host_resolver),
      ALLOW_THIS_IN_INITIALIZER_LIST(
          fallback_callback_(
              this,
              &TransportConnectJob::DoIPv6FallbackTransportConnectComplete)) {}

TransportConnectJob::~TransportConnectJob() {
  // We don't worry about cancelling the host resolution and TCP connect, since
  // ~SingleRequestHostResolver and ~ClientSocket will take care of it.
}

LoadState TransportConnectJob::GetLoadState() const {
  switch (next_state_) {
    case STATE_RESOLVE_HOST:
    case STATE_RESOLVE_HOST_COMPLETE:
      return LOAD_STATE_RESOLVING_HOST;
    case STATE_TRANSPORT_CONNECT:
    case STATE_TRANSPORT_CONNECT_COMPLETE:
      return LOAD_STATE_CONNECTING;
    default:
      NOTREACHED();
      return LOAD_STATE_IDLE;
  }
}

// static
void TransportConnectJob::MakeAddrListStartWithIPv4(AddressList* addrlist) {
  if (addrlist->head()->ai_family != AF_INET6)
    return;
  bool has_ipv4 = false;
  for (const struct addrinfo* ai = addrlist->head(); ai; ai = ai->ai_next) {
    if (ai->ai_family != AF_INET6) {
      has_ipv4 = true;
      break;
    }
  }
  if (!has_ipv4)
    return;

  struct addrinfo* head = CreateCopyOfAddrinfo(addrlist->head(), true);
  struct addrinfo* tail = head;
  while (tail->ai_next)
    tail = tail->ai_next;
  char* canonname = head->ai_canonname;
  head->ai_canonname = NULL;
  while (head->ai_family == AF_INET6) {
    tail->ai_next = head;
    tail = head;
    head = head->ai_next;
    tail->ai_next = NULL;
  }
  head->ai_canonname = canonname;

  addrlist->Copy(head, true);
  FreeCopyOfAddrinfo(head);
}

void TransportConnectJob::OnIOComplete(int result) {
  int rv = DoLoop(result);
  if (rv != ERR_IO_PENDING)
    NotifyDelegateOfCompletion(rv);  // Deletes |this|
}

int TransportConnectJob::DoLoop(int result) {
  DCHECK_NE(next_state_, STATE_NONE);

  int rv = result;
  do {
    State state = next_state_;
    next_state_ = STATE_NONE;
    switch (state) {
      case STATE_RESOLVE_HOST:
        DCHECK_EQ(OK, rv);
        rv = DoResolveHost();
        break;
      case STATE_RESOLVE_HOST_COMPLETE:
        rv = DoResolveHostComplete(rv);
        break;
      case STATE_TRANSPORT_CONNECT:
        DCHECK_EQ(OK, rv);
        rv = DoTransportConnect();
        break;
      case STATE_TRANSPORT_CONNECT_COMPLETE:
        rv = DoTransportConnectComplete(rv);
        break;
      default:
        NOTREACHED();
        rv = ERR_FAILED;
        break;
    }
  } while (rv != ERR_IO_PENDING && next_state_ != STATE_NONE);

  return rv;
}

int TransportConnectJob::DoResolveHost() {
  next_state_ = STATE_RESOLVE_HOST_COMPLETE;
  return resolver_.Resolve(params_->destination(), &addresses_, &callback_,
                           net_log());
}

int TransportConnectJob::DoResolveHostComplete(int result) {
  if (result == OK)
    next_state_ = STATE_TRANSPORT_CONNECT;
  return result;
}

int TransportConnectJob::DoTransportConnect() {
  next_state_ = STATE_TRANSPORT_CONNECT_COMPLETE;
  transport_socket_.reset(client_socket_factory_->CreateTransportClientSocket(
        addresses_, net_log().net_log(), net_log().source()));
  connect_start_time_ = base::TimeTicks::Now();

#ifdef ANDROID
  uid_t calling_uid = 0;
  bool valid_uid = params_->getUID(&calling_uid);
#endif

  int rv = transport_socket_->Connect(&callback_
#ifdef ANDROID
                                      , params_->ignore_limits()
                                      , valid_uid
                                      , calling_uid
#endif
                                      );
  if (rv == ERR_IO_PENDING &&
      AddressListStartsWithIPv6AndHasAnIPv4Addr(addresses_)) {
    fallback_timer_.Start(
        base::TimeDelta::FromMilliseconds(kIPv6FallbackTimerInMs),
        this, &TransportConnectJob::DoIPv6FallbackTransportConnect);
  }
  return rv;
}

int TransportConnectJob::DoTransportConnectComplete(int result) {
  if (result == OK) {
    bool is_ipv4 = addresses_.head()->ai_family != AF_INET6;
    DCHECK(connect_start_time_ != base::TimeTicks());
    DCHECK(start_time_ != base::TimeTicks());
    base::TimeTicks now = base::TimeTicks::Now();
    base::TimeDelta total_duration = now - start_time_;
    UMA_HISTOGRAM_CUSTOM_TIMES(
        "Net.DNS_Resolution_And_TCP_Connection_Latency2",
        total_duration,
        base::TimeDelta::FromMilliseconds(1),
        base::TimeDelta::FromMinutes(10),
        100);

    base::TimeDelta connect_duration = now - connect_start_time_;
    UMA_HISTOGRAM_CUSTOM_TIMES("Net.TCP_Connection_Latency",
        connect_duration,
        base::TimeDelta::FromMilliseconds(1),
        base::TimeDelta::FromMinutes(10),
        100);

    if (is_ipv4) {
      UMA_HISTOGRAM_CUSTOM_TIMES("Net.TCP_Connection_Latency_IPv4_No_Race",
                                 connect_duration,
                                 base::TimeDelta::FromMilliseconds(1),
                                 base::TimeDelta::FromMinutes(10),
                                 100);
    } else {
      if (AddressListOnlyContainsIPv6Addresses(addresses_)) {
        UMA_HISTOGRAM_CUSTOM_TIMES("Net.TCP_Connection_Latency_IPv6_Solo",
                                   connect_duration,
                                   base::TimeDelta::FromMilliseconds(1),
                                   base::TimeDelta::FromMinutes(10),
                                   100);
      } else {
        UMA_HISTOGRAM_CUSTOM_TIMES("Net.TCP_Connection_Latency_IPv6_Raceable",
                                   connect_duration,
                                   base::TimeDelta::FromMilliseconds(1),
                                   base::TimeDelta::FromMinutes(10),
                                   100);
      }
    }
    set_socket(transport_socket_.release());
    fallback_timer_.Stop();
  } else {
    // Be a bit paranoid and kill off the fallback members to prevent reuse.
    fallback_transport_socket_.reset();
    fallback_addresses_.reset();
  }

  return result;
}

void TransportConnectJob::DoIPv6FallbackTransportConnect() {
  // The timer should only fire while we're waiting for the main connect to
  // succeed.
  if (next_state_ != STATE_TRANSPORT_CONNECT_COMPLETE) {
    NOTREACHED();
    return;
  }

  DCHECK(!fallback_transport_socket_.get());
  DCHECK(!fallback_addresses_.get());

  fallback_addresses_.reset(new AddressList(addresses_));
  MakeAddrListStartWithIPv4(fallback_addresses_.get());
  fallback_transport_socket_.reset(
      client_socket_factory_->CreateTransportClientSocket(
          *fallback_addresses_, net_log().net_log(), net_log().source()));
  fallback_connect_start_time_ = base::TimeTicks::Now();

#ifdef ANDROID
  uid_t calling_uid = 0;
  bool valid_uid = params_->getUID(&calling_uid);
#endif

  int rv = fallback_transport_socket_->Connect(&fallback_callback_
#ifdef ANDROID
                                               , params_->ignore_limits()
                                               , valid_uid
                                               , calling_uid
#endif
                                              );
  if (rv != ERR_IO_PENDING)
    DoIPv6FallbackTransportConnectComplete(rv);
}

void TransportConnectJob::DoIPv6FallbackTransportConnectComplete(int result) {
  // This should only happen when we're waiting for the main connect to succeed.
  if (next_state_ != STATE_TRANSPORT_CONNECT_COMPLETE) {
    NOTREACHED();
    return;
  }

  DCHECK_NE(ERR_IO_PENDING, result);
  DCHECK(fallback_transport_socket_.get());
  DCHECK(fallback_addresses_.get());

  if (result == OK) {
    DCHECK(fallback_connect_start_time_ != base::TimeTicks());
    DCHECK(start_time_ != base::TimeTicks());
    base::TimeTicks now = base::TimeTicks::Now();
    base::TimeDelta total_duration = now - start_time_;
    UMA_HISTOGRAM_CUSTOM_TIMES(
        "Net.DNS_Resolution_And_TCP_Connection_Latency2",
        total_duration,
        base::TimeDelta::FromMilliseconds(1),
        base::TimeDelta::FromMinutes(10),
        100);

    base::TimeDelta connect_duration = now - fallback_connect_start_time_;
    UMA_HISTOGRAM_CUSTOM_TIMES("Net.TCP_Connection_Latency",
        connect_duration,
        base::TimeDelta::FromMilliseconds(1),
        base::TimeDelta::FromMinutes(10),
        100);

    UMA_HISTOGRAM_CUSTOM_TIMES("Net.TCP_Connection_Latency_IPv4_Wins_Race",
        connect_duration,
        base::TimeDelta::FromMilliseconds(1),
        base::TimeDelta::FromMinutes(10),
        100);
    set_socket(fallback_transport_socket_.release());
    next_state_ = STATE_NONE;
    transport_socket_.reset();
  } else {
    // Be a bit paranoid and kill off the fallback members to prevent reuse.
    fallback_transport_socket_.reset();
    fallback_addresses_.reset();
  }
  NotifyDelegateOfCompletion(result);  // Deletes |this|
}

int TransportConnectJob::ConnectInternal() {
  next_state_ = STATE_RESOLVE_HOST;
  start_time_ = base::TimeTicks::Now();
  return DoLoop(OK);
}

ConnectJob*
    TransportClientSocketPool::TransportConnectJobFactory::NewConnectJob(
    const std::string& group_name,
    const PoolBase::Request& request,
    ConnectJob::Delegate* delegate) const {
  return new TransportConnectJob(group_name,
                                 request.params(),
                                 ConnectionTimeout(),
                                 client_socket_factory_,
                                 host_resolver_,
                                 delegate,
                                 net_log_);
}

base::TimeDelta
    TransportClientSocketPool::TransportConnectJobFactory::ConnectionTimeout()
    const {
  return base::TimeDelta::FromSeconds(kTransportConnectJobTimeoutInSeconds);
}

TransportClientSocketPool::TransportClientSocketPool(
    int max_sockets,
    int max_sockets_per_group,
    ClientSocketPoolHistograms* histograms,
    HostResolver* host_resolver,
    ClientSocketFactory* client_socket_factory,
    NetLog* net_log,
    HttpNetworkSession *network_session)
    : base_(max_sockets, max_sockets_per_group, histograms,
            base::TimeDelta::FromSeconds(
                ClientSocketPool::unused_idle_socket_timeout()),
            base::TimeDelta::FromSeconds(kUsedIdleSocketTimeout),
            new TransportConnectJobFactory(client_socket_factory,
                                     host_resolver, net_log),
            network_session) {
  base_.EnableConnectBackupJobs();
}

TransportClientSocketPool::~TransportClientSocketPool() {}

int TransportClientSocketPool::RequestSocket(
    const std::string& group_name,
    const void* params,
    RequestPriority priority,
    ClientSocketHandle* handle,
    CompletionCallback* callback,
    const BoundNetLog& net_log) {
  const scoped_refptr<TransportSocketParams>* casted_params =
      static_cast<const scoped_refptr<TransportSocketParams>*>(params);

  if (net_log.IsLoggingAllEvents()) {
    // TODO(eroman): Split out the host and port parameters.
    net_log.AddEvent(
        NetLog::TYPE_TCP_CLIENT_SOCKET_POOL_REQUESTED_SOCKET,
        make_scoped_refptr(new NetLogStringParameter(
            "host_and_port",
            casted_params->get()->destination().host_port_pair().ToString())));
  }

  return base_.RequestSocket(group_name, *casted_params, priority, handle,
                             callback, net_log);
}

void TransportClientSocketPool::RequestSockets(
    const std::string& group_name,
    const void* params,
    int num_sockets,
    const BoundNetLog& net_log) {
  const scoped_refptr<TransportSocketParams>* casted_params =
      static_cast<const scoped_refptr<TransportSocketParams>*>(params);

  if (net_log.IsLoggingAllEvents()) {
    // TODO(eroman): Split out the host and port parameters.
    net_log.AddEvent(
        NetLog::TYPE_TCP_CLIENT_SOCKET_POOL_REQUESTED_SOCKETS,
        make_scoped_refptr(new NetLogStringParameter(
            "host_and_port",
            casted_params->get()->destination().host_port_pair().ToString())));
  }

  base_.RequestSockets(group_name, *casted_params, num_sockets, net_log);
}

void TransportClientSocketPool::CancelRequest(
    const std::string& group_name,
    ClientSocketHandle* handle) {
  base_.CancelRequest(group_name, handle);
}

void TransportClientSocketPool::ReleaseSocket(
    const std::string& group_name,
    ClientSocket* socket,
    int id) {
  base_.ReleaseSocket(group_name, socket, id);
}

void TransportClientSocketPool::Flush() {
  base_.Flush();
}

void TransportClientSocketPool::CloseIdleSockets() {
  base_.CloseIdleSockets();
}

int TransportClientSocketPool::IdleSocketCount() const {
  return base_.idle_socket_count();
}

int TransportClientSocketPool::IdleSocketCountInGroup(
    const std::string& group_name) const {
  return base_.IdleSocketCountInGroup(group_name);
}

LoadState TransportClientSocketPool::GetLoadState(
    const std::string& group_name, const ClientSocketHandle* handle) const {
  return base_.GetLoadState(group_name, handle);
}

DictionaryValue* TransportClientSocketPool::GetInfoAsValue(
    const std::string& name,
    const std::string& type,
    bool include_nested_pools) const {
  return base_.GetInfoAsValue(name, type);
}

base::TimeDelta TransportClientSocketPool::ConnectionTimeout() const {
  return base_.ConnectionTimeout();
}

ClientSocketPoolHistograms* TransportClientSocketPool::histograms() const {
  return base_.histograms();
}

}  // namespace net


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>com.example.bot.spring.webapplication.controller (sample-spring-boot-kitchensink 1.9.0-SNAPSHOT API)</title>
<meta name="date" content="2017-11-20">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

com.example.bot.spring.webapplication.controller

Classes

GreetingController

LoginController

redpajama_set_name: RedPajamaGithub


text:
#import "SoomlaEncryptor.h"
#import "SoomlaConfig.h"
#import <CommonCrypto/CommonCryptor.h>
#import "FBEncryptorAES.h"
#import "Soomla.h"
#import "SoomlaUtils.h"

@implementation SoomlaEncryptor

/*
 * The encryption key is comprised of the SOOMLA secret and a unique global identifier for the specific application.
 * NOTE: change the custom secret in SoomlaConfig.h.
 */
+ (NSString*)key
{
    NSString* sec = SOOMLA_SECRET;
    if (!sec || [sec length]==0) {
        LogError(@"SOOMLA SoomlaEncryptor", @"SOOMLA sercet not provided. This is serious and can lead to multiple errors!");
    }
    return [sec stringByAppendingString:[SoomlaUtils deviceId]];
}

+ (NSString *)encryptString:(NSString *)data{
    @synchronized(self) {
        return [FBEncryptorAES encryptBase64String:data
                                         keyString:[self key]
                                     separateLines:NO];
    }
}

+ (NSString *)decryptToString:(NSString *)data{
    @synchronized(self) {
        return [FBEncryptorAES decryptBase64String:data
                                         keyString:[self key]];
    }
}

+ (NSString *)encryptNumber:(NSNumber *)data{
    @synchronized(self) {
        return [self encryptString:[data stringValue]];
    }
}

+ (NSNumber *)decryptToNumber:(NSString *)data{
    @synchronized(self) {
        data = [self decryptToString:data];
        NSNumberFormatter * f = [[NSNumberFormatter alloc] init];
        [f setNumberStyle:NSNumberFormatterDecimalStyle];
        return [f numberFromString:data];
    }
}

+ (NSString *)encryptBoolean:(BOOL)data{
    @synchronized(self) {
        return [self encryptString:[[NSNumber numberWithBool:data] stringValue]];
    }
}

+ (BOOL)decryptToBoolean:(NSString *)data{
    @synchronized(self) {
        data = [self decryptToString:data];
        NSNumber *res = [NSNumber numberWithInt:[data intValue]];
        return [res boolValue];
    }
}

@end


text:
<!DOCTYPE html>

    <title>CongressViz [Beta]</title>
    <link rel="stylesheet" href="vendor/material-design-lite/material.min.css"></script>
    <link rel="stylesheet" href="style/style.css"></script>

          CongressViz [Beta]

CongressViz [Beta]

Information Interfaces Group

GVU Center

Georgia Tech


text: export * from './SideNav'


text:
<?php
use Functions\Functions;
?>
<?php
    if($message)
        echo Functions::displayFormMsg($message);
?>

Profile: <?php echo $user['username']; ?>

Rank: <?php echo $user['title']; ?>

<?php
    $userForm =
    [
        "firstname" => ["label" => "First Name", "type" => "text", "required" => true],
        "lastname" => ["label" => "Last Name", "type" => "text", "required" => true],
        "email" => ["label" => "Email", "type" => "email", "required" => true]
    ];
    echo Functions::genForm("userForm", "POST", "/admin/users?$user[username]", $userForm, $user);
?>

Change Password

<?php
    $chngPass =
    [
        "currPass" => ["label" => "Current Password", "type" => "password", "required" => true],
        "newPass" => ["label" => "New Password", "type" => "password", "required" => true],
        "confPass" => ["label" => "Confirm Password", "type" => "password", "required" => true]
    ];
    echo Functions::genForm("chngPassword", "POST", "/admin/users?$user[username]", $chngPass);
?>


text:
package modules

import (
	"regexp"
	"time"

	"github.com/pajbot/pajbot2/pkg"
	mbase "github.com/pajbot/pajbot2/pkg/modules/base"
	"github.com/pajbot/pajbot2/pkg/twitchactions"
	xurls "mvdan.cc/xurls/v2"
)

func init() {
	Register("link_filter", func() pkg.ModuleSpec {
		const regexpModifier = `(\b|$)`
		relaxedRegexpStr := xurls.Relaxed().String()
		strictRegexpStr := xurls.Strict().String()

		relaxedRegexp := regexp.MustCompile(relaxedRegexpStr + regexpModifier)
		relaxedRegexp.Longest()
		strictRegexp := regexp.MustCompile(strictRegexpStr + regexpModifier)
		strictRegexp.Longest()

		return &Spec{
			id:   "link_filter",
			name: "Link filter",
			maker: func(b *mbase.Base) pkg.Module {
				return newLinkFilter(b, relaxedRegexp, strictRegexp)
			},
		}
	})
}

type LinkFilter struct {
	mbase.Base

	relaxedRegexp *regexp.Regexp
	strictRegexp  *regexp.Regexp
}

func newLinkFilter(b *mbase.Base, relaxedRegexp, strictRegexp *regexp.Regexp) pkg.Module {
	return &LinkFilter{
		Base: *b,

		relaxedRegexp: relaxedRegexp,
		strictRegexp:  strictRegexp,
	}
}

func (m *LinkFilter) checkMessage(text string) bool {
	links := m.relaxedRegexp.FindAllString(text, -1)
	return len(links) > 0
}

func (m LinkFilter) OnMessage(event pkg.MessageEvent) pkg.Actions {
	if event.User.IsModerator() {
		return nil
	}

	if event.User.IsVIP() {
		return nil
	}

	if m.checkMessage(event.Message.GetText()) {
		actions := &twitchactions.Actions{}
		actions.Timeout(event.User, 180*time.Second).SetReason("No links allowed")
		return actions
	}

	return nil
}


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

   <!-- <declare-styleable name="BaseTheme">
        <attr name="actionBarIconColor" format="color" />
        <attr name="actionBarInsetStart" format="dimension" />
        <attr name="spinnerBarInsetStart" format="dimension" />
        <attr name="popupItemBackground" format="reference" />
        <attr name="photoItemForeground" format="reference" />
        <attr name="photoItemForegroundBorderless" format="reference" />
    </declare-styleable>-->
</resources>


text:
package com.phloc.commons.io.file;

import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

/**
 * Test class for class {@link EFileIOOperation}.
 *
 * @author Philip Helger
 */
public final class EFileIOOperationTest
{
  @Test
  public void testAll ()
  {
    for (final EFileIOOperation eOp : EFileIOOperation.values ())
    {
      assertTrue (eOp.getParamCount () >= 0);
      assertSame (eOp, EFileIOOperation.valueOf (eOp.name ()));
    }
  }
}


text:
class Comment < ActiveRecord::Base
  belongs_to :commentable, polymorphic: true
  belongs_to :commenter, class_name: "User"
end


text:
//
//  PROGRAM.cpp
//
//  Created by Douglas Scott on 1/19/20.
//
/*
 p0 = output start time
 p1 = output duration
 p2 = MIDI channel
 p3 = Patch number (integer)
*/

#include "PROGRAM.h"
#include "RTMIDIOutput.h"
#include <ugens.h>
#include <rt.h>
#include <stdio.h>
#include <string.h>

PROGRAM::PROGRAM() : MIDIBase(), _patchNumber(0)
{
}

PROGRAM::~PROGRAM()
{
}

int PROGRAM::init(double p[], int n_args)
{
    if (MIDIBase::init(p, n_args) < 0) {
        return DONT_SCHEDULE;
    }
    _patchNumber = (int)(p[3]);

    if (_patchNumber < 0) {
        rtcmix_warn("PROGRAM", "Patch number limited to 0");
        _patchNumber = 0;
    }
    else if (_patchNumber > 127) {
        rtcmix_warn("PROGRAM", "Patch number limited to 127");
        _patchNumber = 127;
    }
    return nSamps();
}

void PROGRAM::doStart(FRAMETYPE frameOffset)
{
//    printf("Sending MIDI program number %d\n", _patchNumber);
    long timestamp = (1000.0 * frameOffset) / SR;
    _outputPort->sendProgramChange(timestamp, _midiChannel, _patchNumber);
}

// Called at the control rate to update parameters like amplitude, pan, etc.

void PROGRAM::doupdate(FRAMETYPE currentFrame)
{
}

Instrument *makePROGRAM()
{
    PROGRAM *inst = new PROGRAM();
    inst->set_bus_config("PROGRAM");

    return inst;
}


text:
using System;
using RtmpSharp.IO;

namespace LegendaryClient.Logic.Riot.Team
{
    [Serializable]
    [SerializedName("com.riotgames.team.stats.TeamStatDetail")]
    public class TeamStatDetail
    {
        [SerializedName("maxRating")]
        public Int32 MaxRating { get; set; }

        [SerializedName("teamIdString")]
        public String TeamIdString { get; set; }

        [SerializedName("seedRating")]
        public Int32 SeedRating { get; set; }

        [SerializedName("losses")]
        public Int32 Losses { get; set; }

        [SerializedName("rating")]
        public Int32 Rating { get; set; }

        [SerializedName("teamStatTypeString")]
        public String TeamStatTypeString { get; set; }

        [SerializedName("averageGamesPlayed")]
        public Int32 AverageGamesPlayed { get; set; }

        [SerializedName("teamId")]
        public TeamId TeamId { get; set; }

        [SerializedName("wins")]
        public Int32 Wins { get; set; }

        [SerializedName("teamStatType")]
        public String TeamStatType { get; set; }
    }
}


text:
/**
 * Licensed under Apache License v2. See LICENSE for more information.
 */
package org.inaetics.wiring.discovery.etcd;

import static org.inaetics.wiring.base.ServiceUtil.getConfigStringValue;
import static org.inaetics.wiring.discovery.DiscoveryUtil.createNodeListenerServiceProperties;

import java.util.Dictionary;
import java.util.Hashtable;
import java.util.Properties;

import org.apache.felix.dm.Component;
import org.apache.felix.dm.DependencyActivatorBase;
import org.apache.felix.dm.DependencyManager;
import org.inaetics.wiring.WiringEndpointEventListener;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
import org.osgi.service.cm.ConfigurationException;
import org.osgi.service.cm.ManagedService;
import org.osgi.service.log.LogService;

/**
 * @author Amdatu Project Team
 *
 */
public class Activator extends DependencyActivatorBase implements EtcdDiscoveryConfiguration, ManagedService {

    public static final String CONFIG_PID = "org.inaetics.wiring.discovery.etcd";
    public static final String CONFIG_ZONE = CONFIG_PID + ".zone";
    public static final String CONFIG_NODE = CONFIG_PID + ".node";

    public static final String CONFIG_CONNECTURL_KEY = CONFIG_PID + ".connecturl";
    public static final String CONFIG_ROOTPATH_KEY = CONFIG_PID + ".rootpath";

    private volatile BundleContext m_context;
    private volatile DependencyManager m_manager;

    private volatile Component m_configuration;
    private volatile Component m_discovery;

    private volatile String m_zone;
    private volatile String m_node;

    private volatile String m_connectUrl;
    private volatile String m_rootPath;

    @Override
    public void init(BundleContext context, DependencyManager manager) throws Exception {

        m_context = context;
        m_manager = manager;

        String zone = getConfiguredZone(null);
        String node = getConfiguredNode(null);

        String connectUrl = getConfiguredConnectUrl(null);
        String rootPath = getConfiguredRootPath(null);

        m_zone = zone;
        m_node = node;
        m_connectUrl = connectUrl;
        m_rootPath = rootPath;

        if (!"".equals(m_connectUrl)) {
            registerDiscoveryService();
        }
        registerConfigurationService();
    }

    @Override
    public void destroy(BundleContext context, DependencyManager manager) throws Exception {

        unregisterConfigurationService();
        unregisterDiscoveryService();
    }

    @Override
    public void updated(Dictionary<String, ?> properties) throws ConfigurationException {

        try {
            String zone = getConfiguredZone(properties);
            String node = getConfiguredNode(properties);
            String connectUrl = getConfiguredConnectUrl(properties);
            String rootPath = getConfiguredRootPath(properties);

            if (!zone.equals(m_zone) || !node.equals(m_node)
            		|| !m_connectUrl.equals(connectUrl) || !m_rootPath.equals(rootPath)) {

            	m_zone = zone;
            	m_node = node;
		        m_connectUrl = connectUrl;
	            m_rootPath = rootPath;

	            unregisterDiscoveryService();

	            if (!"".equals(m_connectUrl)) {
	            	registerDiscoveryService();
	            }
            }
        }
        catch (Exception e) {
            throw new ConfigurationException("unknown", e.getMessage(), e);
        }
    }

    private void registerDiscoveryService() {

        Properties properties = createNodeListenerServiceProperties(m_manager.getBundleContext(),
		    EtcdNodeDiscovery.DISCOVERY_TYPE);

        EtcdNodeDiscovery discovery =
            new EtcdNodeDiscovery(this);

        Component component = createComponent()
            .setInterface(new String[] { WiringEndpointEventListener.class.getName() },
                properties)
            .setImplementation(discovery)
            .add(createServiceDependency()
                .setService(WiringEndpointEventListener.class)
                .setCallbacks("eventListenerAdded", "eventListenerModified", "eventListenerRemoved")
                .setRequired(false))
            .add(createServiceDependency()
                .setService(LogService.class)
                .setRequired(false));

        m_discovery = component;
        m_manager.add(m_discovery);
    }

    private void unregisterDiscoveryService() {

        Component component = m_discovery;
        m_discovery = null;
        if (component != null) {
            m_manager.remove(component);
        }
    }

    private void registerConfigurationService() {

        Dictionary<String, Object> properties = new Hashtable<String, Object>();
        properties.put(Constants.SERVICE_PID, CONFIG_PID);

        Component component = createComponent()
            .setInterface(ManagedService.class.getName(), properties)
            .setImplementation(this)
            .setAutoConfig(BundleContext.class, false)
            .setAutoConfig(DependencyManager.class, false)
            .setAutoConfig(Component.class, false);

        m_configuration = component;
        m_manager.add(component);
    }

    private void unregisterConfigurationService() {

        Component component = m_configuration;
        m_configuration = null;
        if (component != null) {
            m_manager.remove(component);
        }
    }

    private String getConfiguredZone(Dictionary<String, ?> properties) throws ConfigurationException {
        return getConfigStringValue(m_context, CONFIG_ZONE, properties, "");
    }

    private String getConfiguredNode(Dictionary<String, ?> properties) throws ConfigurationException {
        return getConfigStringValue(m_context, CONFIG_NODE, properties, "");
    }

    private String getConfiguredConnectUrl(Dictionary<String, ?> properties) throws ConfigurationException {
        return getConfigStringValue(m_context, CONFIG_CONNECTURL_KEY, properties, "");
    }

    private String getConfiguredRootPath(Dictionary<String, ?> properties) throws ConfigurationException {
        return getConfigStringValue(m_context, CONFIG_ROOTPATH_KEY, properties, "/");
    }

    @Override
    public String getConnectUrl() {
        return m_connectUrl;
    }

    @Override
    public String getRootPath() {
        return m_rootPath;
    }

	@Override
	public String getZone() {
		return m_zone;
	}

    @Override
    public String getNode() {
        return m_node;
    }

}


text:
var logout = function () {
    jagg.post("/site/blocks/user/login/ajax/login.jag", {action:"logout"}, function (result) {
        if (!result.error) {
            var current = window.location.pathname;
            if (current.indexOf(".jag") >= 0) {
                location.href = "login.jag";
            } else {
                location.href = 'site/pages/login.jag';
            }
        } else {
            jagg.message({content:result.message,type:"error"});
        }
    }, "json");
};
$(document).ready(function(){
    $('#userInfoMenu').prev().click(function(){
        if($('#userInfoMenu').is(':visible')){
            $('#userInfoMenu').hide();
        }else{
            $('#userInfoMenu').show();
        }
    });
    $('html').click(function() {
        if($('#userInfoMenu').is(':visible')){
            $('#userInfoMenu').hide();
        }
    });

    $('#userMenu').click(function(event) {
        event.stopPropagation();
    });
});


text:
layout: post
status: publish
published: true
title: How to list size of all tables of a mysql database
author:
  display_name: davidmataro
  login: admin
  email: jo@davidmataro.com
  url: http://www.davidmataro.com
author_login: admin
author_email: jo@davidmataro.com
author_url: http://www.davidmataro.com
wordpress_id: 563
wordpress_url: http://www.davidmataro.com/?p=563
date: !binary |-
  MjAxNC0wOS0yMyAxNToyOTo0NyArMDAwMA==
date_gmt: !binary |-
  MjAxNC0wOS0yMyAxMzoyOTo0NyArMDAwMA==
tags:
- mysql
comments: []
---

List the size of all tables for a mysql database:

SELECT table_name AS "Table",  round(((data_length + index_length) / 1024 / 1024), 2) as TEST   FROM information_schema.TABLES  WHERE table_schema = "cellercandani"  order by TEST;


text:
namespace ouro {

	class test_services;

	namespace tests {

		void TESTadapter(test_services& _Services);
		void TESTcamera(test_services& _Services);
		void TESTcpu(test_services& _Services);
		void TESTdebugger(test_services& _Services);
		void TESTfilesystem(test_services& _Services);
		void TESTfilesystem_monitor();
		void TESTprocess_heap();
		#if defined(_WIN32) || defined(_WIN64)
			void TESTwin_crt_leak_tracker(test_services& _Services);
			void TESTwin_registry();
		#endif

	}
}

#endif


text:
// Copyright 2014, Yahoo! Inc.
// Copyrights licensed under the Mit License. See the accompanying LICENSE file for terms.

var AbstractServer = require('../abstractServer');
var Promise = require('promise');

/**
 * @class ExternalServer
 * @extends AbstractServer
 *
 * @constructor
 */
var ExternalServer = AbstractServer.extend(

	{
		/**
		 * Startup driver
		 *
		 * @method setup
		 * @param {object} capabilities
		 * @return {Promise}
		 */
		setup: function (capabilities) {
			// Do nothing since the driver should be already available from outside
			return Promise.resolve();
		},

		/**
		 * Shutdown driver
		 *
		 * @method tearDown
		 * @return {Promise}
		 */
		tearDown: function () {
			return Promise.resolve();
		},

		/**
		 * Gets the url to the web-driver instance
		 *
		 * @method getUrl
		 * @return {string}
		 */
		getUrl: function () {
			return null;
		},

		/**
		 * Augmenting capabilities supplied to the driver
		 *
		 * @method augmentCapabilities
		 * @param {object} capabilities
		 * @return {object}
		 */
		augmentCapabilities: function (capabilities) {
			return capabilities;
		}
	});

module.exports = ExternalServer;


text:
<?php

    require_once 'core/init.php';
    $session->start();
    $Result = "";
    if ($Result = $session->check('Email') AND $Result == "TRUE")
    {
       header("location: ".$baseurl->get()."");
    }
?>

<!DOCTYPE html>

	<title>iCiShort - Masuk</title>
	<link rel="stylesheet" type="text/css" href="<?php echo $baseurl->get(); ?>assets/css/font.css">
    <link rel="stylesheet" type="text/css" href="<?php echo $baseurl->get(); ?>assets/css/style.css">

   <link rel="stylesheet" type="text/css" href="<?php echo $baseurl->get(); ?>assets/plugin/sweetalert/sweetalert.css">

   <?php

      if (isset($_POST['keyUpsjsZqwIB']))
      {

         $LoginData  = array
                       (
                          "Email"       => $securityf->Data($_POST['Email']),
                          "Katasandi"   => $securityf->Data($_POST['Katasandi'])
                       );

         if ($validation->empty_field($LoginData['Email']) == "TRUE")
         {
            echo "";
         }
         else if ($validation->empty_field($LoginData['Katasandi']) == "TRUE")
         {
            echo "";
         }
         else if ($Result = $login->check_email($LoginData['Email']) AND $Result == "TRUE")
         {
            if ($Result = $login->check_password($LoginData['Katasandi']) AND $Result == "TRUE")
            {
               $session->give('Email', $LoginData['Email']);
               header("location: ".$baseurl->get()."");
            }
            else
            {
               echo "";
            }
         }
         else
         {
            echo "";
         }
      }

   ?>
   iCiShort

      <form name="Form-Masuk-iCiShort" method="POST">
       <input type="email" class="FormMskInputText" placeholder="Email" name="Email">
     	   <input type="password" class="FormMskInputText" placeholder="Katasandi" name="Katasandi">

          <button type="submit" id="mskButton" style="text-align: center" name="keyUpsjsZqwIB">Masuk</button>

2017 - iCiShort


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

  class Login extends CI_Controller{
    public function __construct(){
      parent::__construct();
      $this->load->library('session');
      $this->load->helper('form');
      $this->load->helper('url');
      $this->load->helper('html');
      $this->load->database();
      $this->load->library('form_validation');
      $this->load->model('login_model');
    }

    public function index(){
      $username = $this->input->post('username');
      $password = $this->input->post('password');

      $data['current_user'] = $this->login_model->get_user($username, $password);

      $this->form_validation->set_rules('username', 'Username', "trim|required");
      $this->form_validation->set_rules('password', 'Password', "trim|required");

      if ($this->form_validation->run() === FALSE){

        $this->load->view('templates/header');
        $this->load->view('login/login');
        $this->load->view('templates/footer');

      } else {

          if ($this->input->post('btn_login') == 'belépés'){

              $user_result = $this->login_model->get_user($username, $password);
              if (isset($user_result)) {
                $sessiondata = array(
                  'username' => $username,
                  'email' => $data['current_user']->email,
                  'phone_number' => $data['current_user']->phone_number,
                  'first_name' => $data['current_user']->first_name,
                  'last_name' => $data['current_user']->last_name,
                  'loginuser' => TRUE
                );

                $this->session->set_userdata($sessiondata);
                redirect("clinics/index");
              } else {
                $this->session->set_flashdata('message', '
 Invalid username and password!
');
                redirect('login/error');
              }
            } else {
              redirect('login/error');
            }
          }
      }

    public function error(){
      $this->load->view('templates/header');
      $this->load->view('login/login');
      $this->load->view('login/error');
      $this->load->view('templates/footer');
    }

    public function logout(){
      $data = array(
        'username' => '',
        'loginuser' => FALSE
      );
      //$this->session->unset_userdata($data);
      $this->session->sess_destroy();
      redirect('login/index');

    }

}
 ?>


text:
package context

import (
	stdctx "context"
	"sync"
	"sync/atomic"
	"testing"
	"time"

	"github.com/m3db/m3x/resource"

	"github.com/opentracing/opentracing-go"
	"github.com/opentracing/opentracing-go/mocktracer"
	"github.com/stretchr/testify/assert"
)

func TestRegisterFinalizerWithChild(t *testing.T) {
	xCtx := NewContext().(*ctx)
	assert.Nil(t, xCtx.parentCtx())

	childCtx := xCtx.newChildContext().(*ctx)
	assert.NotNil(t, childCtx.parentCtx())

	var (
		wg          sync.WaitGroup
		childClosed = false
	)

	wg.Add(1)
	childCtx.RegisterFinalizer(resource.FinalizerFn(func() {
		childClosed = true
		wg.Done()
	}))

	assert.Equal(t, 0, len(childCtx.finalizeables))

	childCtx.Close()
	wg.Wait()

	// validate closing childCtx, closes the parent
	assert.True(t, xCtx.IsClosed())
	assert.True(t, childClosed)
}

func TestRegisterFinalizer(t *testing.T) {
	var (
		wg     sync.WaitGroup
		closed = false
		ctx    = NewContext().(*ctx)
	)

	wg.Add(1)
	ctx.RegisterFinalizer(resource.FinalizerFn(func() {
		closed = true
		wg.Done()
	}))

	assert.Equal(t, 1, len(ctx.finalizeables))

	ctx.Close()
	wg.Wait()

	assert.Equal(t, true, closed)
}

func TestRegisterCloserWithChild(t *testing.T) {
	xCtx := NewContext().(*ctx)
	assert.Nil(t, xCtx.parentCtx())

	childCtx := xCtx.newChildContext().(*ctx)
	assert.NotNil(t, childCtx.parentCtx())

	var (
		wg          sync.WaitGroup
		childClosed = false
	)

	wg.Add(1)
	childCtx.RegisterCloser(resource.CloserFn(func() {
		childClosed = true
		wg.Done()
	}))

	assert.Equal(t, 0, len(childCtx.finalizeables))

	childCtx.Close()
	wg.Wait()

	// validate closing childCtx, closes the parent
	assert.True(t, xCtx.IsClosed())
	assert.True(t, childClosed)
}

func TestRegisterCloser(t *testing.T) {
	var (
		wg     sync.WaitGroup
		closed = false
		ctx    = NewContext().(*ctx)
	)

	wg.Add(1)
	ctx.RegisterCloser(resource.CloserFn(func() {
		closed = true
		wg.Done()
	}))

	assert.Equal(t, 1, len(ctx.finalizeables))

	ctx.Close()
	wg.Wait()

	assert.Equal(t, true, closed)
}

func TestDoesNotRegisterFinalizerWhenClosed(t *testing.T) {
	ctx := NewContext().(*ctx)
	ctx.Close()
	ctx.RegisterFinalizer(resource.FinalizerFn(func() {}))

	assert.Equal(t, 0, len(ctx.finalizeables))
}

func TestDoesNotCloseTwice(t *testing.T) {
	ctx := NewContext().(*ctx)

	var closed int32
	ctx.RegisterFinalizer(resource.FinalizerFn(func() {
		atomic.AddInt32(&closed, 1)
	}))

	ctx.Close()
	ctx.Close()

	// Give some time for a bug to occur.
	time.Sleep(100 * time.Millisecond)

	assert.Equal(t, int32(1), atomic.LoadInt32(&closed))
}

func TestDependsOnNoCloserAllocation(t *testing.T) {
	ctx := NewContext().(*ctx)
	ctx.DependsOn(NewContext())
	assert.Nil(t, ctx.finalizeables)
}

func TestDependsOn(t *testing.T) {
	ctx := NewContext().(*ctx)
	testDependsOn(t, ctx)
}

func TestDependsOnWithReset(t *testing.T) {
	ctx := NewContext().(*ctx)

	testDependsOn(t, ctx)

	// Reset and test works again.
	ctx.Reset()

	testDependsOn(t, ctx)
}

func testDependsOn(t *testing.T, c *ctx) {
	var wg sync.WaitGroup
	var closed int32

	other := NewContext().(*ctx)

	wg.Add(1)
	c.RegisterFinalizer(resource.FinalizerFn(func() {
		atomic.AddInt32(&closed, 1)
		wg.Done()
	}))

	c.DependsOn(other)
	c.Close()

	// Give some time for a bug to occur.
	time.Sleep(100 * time.Millisecond)

	// Ensure still not closed
	assert.Equal(t, int32(0), atomic.LoadInt32(&closed))

	// Now close the context ctx is dependent on.
	other.BlockingClose()

	wg.Wait()

	// Ensure closed now.
	assert.Equal(t, int32(1), atomic.LoadInt32(&closed))
}

func TestDependsOnWithChild(t *testing.T) {
	var (
		c     = NewContext().(*ctx)
		child = c.newChildContext().(*ctx)
		other = NewContext().(*ctx)

		wg     sync.WaitGroup
		closed int32
	)

	wg.Add(1)
	c.RegisterFinalizer(resource.FinalizerFn(func() {
		atomic.AddInt32(&closed, 1)
		wg.Done()
	}))

	child.DependsOn(other)
	child.Close()

	// Give some time for a bug to occur.
	time.Sleep(100 * time.Millisecond)

	// Ensure still not closed even though child ctx has been closed
	assert.Equal(t, int32(0), atomic.LoadInt32(&closed))

	// Now close the context ctx is dependent on.
	other.BlockingClose()

	wg.Wait()

	// Ensure closed now.
	assert.Equal(t, int32(1), atomic.LoadInt32(&closed))
	assert.True(t, c.IsClosed())
}

func TestTraceSpan(t *testing.T) {
	var (
		xCtx  = NewContext()
		goCtx = stdctx.Background()
		sp    opentracing.Span
		spCtx Context
		ok    bool
	)

	// use a mock tracer to ensure sampling rate is set to 1.
	mktr := mocktracer.New()
	sp = mktr.StartSpan("test_op")
	defer sp.Finish()

	spGoCtx := opentracing.ContextWithSpan(goCtx, sp)

	xCtx.SetGoContext(spGoCtx)
	spCtx, sp, ok = xCtx.StartTraceSpan("test_op_2")
	assert.True(t, ok)
	assert.NotNil(t, sp)
	defer sp.Finish()

	childCtx := spCtx.(*ctx)
	assert.NotNil(t, childCtx.parentCtx())
}

func TestGoContext(t *testing.T) {
	goCtx := stdctx.Background()
	xCtx := NewContext()

	var (
		exists    bool
		returnCtx stdctx.Context
	)

	returnCtx, exists = xCtx.GoContext()
	assert.False(t, exists)
	assert.Nil(t, returnCtx)

	xCtx.SetGoContext(goCtx)

	returnCtx, exists = xCtx.GoContext()
	assert.True(t, exists)
	assert.Equal(t, goCtx, returnCtx)

	xCtx.Reset()
	returnCtx, exists = xCtx.GoContext()
	assert.False(t, exists)
	assert.Nil(t, returnCtx)
}


text:
@implementation UILabel (VSExpandleLabel)

-(void) getUILabelFromX:(CGFloat)x AndY:(CGFloat)y AndWidth:(CGFloat)width AndHeight:(CGFloat)height AndText:(NSString*)text AndTextFont:(CGFloat)textFont AndTextIsBold:(BOOL)textIsBold AndTextColor:(UIColor*)textColor AndBackgroundColor:(UIColor*)backgroundColor AndCornerRadius:(CGFloat)cornerRadius
{
    //UILabel设置[尺寸和位置]
    self.frame = CGRectMake(x, y, width, height);

    //UILabel设置[文本内容]
    if(text != nil)
    {
        self.text = text;
    }

    //UILabel设置[文本字体大小以及是否加粗]
    if (textFont !=0 )
    {

        if(textIsBold ==YES)
        {
            self.font = [UIFont fontWithName:@"Helvetica-Bold" size:textFont];
        }
        else
        {
            self.font = [UIFont systemFontOfSize:textFont];
        }

    }else {
        self.font = [UIFont systemFontOfSize:14.0f];
    }

    //UILabel设置[字体颜色]
    if(textColor != nil)
    {
        self.textColor = textColor;
    }
    //UILabel设置[背景颜色]
    if(backgroundColor != nil)
    {
        self.backgroundColor = backgroundColor;
    }
    //UILabel设置[边框圆角半径]
    if(cornerRadius != 0)
    {
        self.layer.cornerRadius = cornerRadius;
        self.clipsToBounds = YES;
    }
    //如果文本框尺寸不够,自动调节字体大小来满足文本框要求
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    NSInteger LanguageFlag = [defaults integerForKey:@"currentLang"];
    if (LanguageFlag == 0 || LanguageFlag == 4) {

    }else {
        self.numberOfLines = 0;
        self.adjustsFontSizeToFitWidth = YES;
    }

}

@end


text:
// Qt includes
#include <QDebug>
#include <QMouseEvent>

// CTK includes
#include "ctkLogger.h"
#include "ctkVTKChartView.h"

// VTK includes
#include <vtkAxis.h>
#include <vtkChartXY.h>
#include <vtkContext2D.h>
#include <vtkContextMouseEvent.h>
#include <vtkContextScene.h>
#include <vtkContextView.h>
#include <vtkGenericOpenGLRenderWindow.h>
#include <vtkOpenGLContextDevice2D.h>
#include <vtkPlot.h>
#include <vtkRenderWindow.h>
#include <vtkRenderer.h>
#include <vtkVersion.h>

//----------------------------------------------------------------------------
static ctkLogger logger("org.commontk.visualization.vtk.widgets.ctkVTKChartView");
//----------------------------------------------------------------------------

class ctkVTKChartViewPrivate
{
  Q_DECLARE_PUBLIC(ctkVTKChartView);
protected:
  ctkVTKChartView* const q_ptr;
public:
  ctkVTKChartViewPrivate(ctkVTKChartView& object);
  void init();
  void chartBounds(double* bounds)const;

#ifdef CTK_USE_QVTKOPENGLWIDGET
  vtkSmartPointer<vtkGenericOpenGLRenderWindow> RenderWindow;
#endif
  vtkSmartPointer<vtkContextView> ContextView;
  vtkSmartPointer<vtkChartXY> Chart;
  double UserBounds[8];
  mutable double OldBounds[8];
};

// ----------------------------------------------------------------------------
// ctkVTKChartViewPrivate methods

// ----------------------------------------------------------------------------
ctkVTKChartViewPrivate::ctkVTKChartViewPrivate(ctkVTKChartView& object)
  :q_ptr(&object)
{
  this->ContextView = vtkSmartPointer<vtkContextView>::New();
#ifdef CTK_USE_QVTKOPENGLWIDGET
  this->RenderWindow = vtkSmartPointer<vtkGenericOpenGLRenderWindow>::New();
#endif
  this->Chart = vtkSmartPointer<vtkChartXY>::New();
  this->ContextView->GetScene()->AddItem(this->Chart);
  this->UserBounds[0] = this->UserBounds[2] = this->UserBounds[4] = this->UserBounds[6] = 0.;
  this->UserBounds[1] = this->UserBounds[3] = this->UserBounds[5] = this->UserBounds[7] = -1.;
  this->OldBounds[0] = this->OldBounds[2] = this->OldBounds[4] = this->OldBounds[6] = 0.;
  this->OldBounds[1] = this->OldBounds[3] = this->OldBounds[5] = this->OldBounds[7] = -1.;
}

// ----------------------------------------------------------------------------
void ctkVTKChartViewPrivate::init()
{
  Q_Q(ctkVTKChartView);

#ifdef CTK_USE_QVTKOPENGLWIDGET
# if VTK_MAJOR_VERSION >= 9 || (VTK_MAJOR_VERSION >= 8 && VTK_MINOR_VERSION >= 90)
  q->setRenderWindow(this->RenderWindow);
# else
  q->SetRenderWindow(this->RenderWindow);
# endif
  this->ContextView->SetRenderWindow(this->RenderWindow);
#endif

#if VTK_MAJOR_VERSION >= 9 || (VTK_MAJOR_VERSION >= 8 && VTK_MINOR_VERSION >= 90)
  this->ContextView->SetInteractor(q->interactor());
  q->setRenderWindow(this->ContextView->GetRenderWindow());
#else
  this->ContextView->SetInteractor(q->GetInteractor());
  q->SetRenderWindow(this->ContextView->GetRenderWindow());
#endif

  // low def for now (faster)
  //q->GetRenderWindow()->SetMultiSamples(0);
  //vtkOpenGLContextDevice2D::SafeDownCast(this->ContextView->GetContext()->GetDevice())
  //                                       ->SetStringRendererToQt();
#ifndef Q_WS_X11
# if VTK_MAJOR_VERSION >= 9 || (VTK_MAJOR_VERSION >= 8 && VTK_MINOR_VERSION >= 90)
  q->renderWindow()->SetLineSmoothing(true);
# else
  q->GetRenderWindow()->SetLineSmoothing(true);
# endif
#endif
  this->Chart->SetActionToButton(vtkChart::PAN, vtkContextMouseEvent::MIDDLE_BUTTON);
  this->Chart->SetActionToButton(vtkChart::SELECT, vtkContextMouseEvent::RIGHT_BUTTON);

  q->qvtkConnect(q->chart()->GetAxis(vtkAxis::BOTTOM),vtkCommand::ModifiedEvent,
                    q, SIGNAL(extentChanged()));
  q->qvtkConnect(q->chart()->GetAxis(vtkAxis::LEFT),vtkCommand::ModifiedEvent,
                    q, SIGNAL(extentChanged()));

}

// ----------------------------------------------------------------------------
void ctkVTKChartViewPrivate::chartBounds(double* bounds)const
{
  if (!bounds)
    {
    return;
    }
  Q_Q(const ctkVTKChartView);
  bounds[0] = bounds[2] = bounds[4] = bounds[6] = VTK_DOUBLE_MAX;
  bounds[1] = bounds[3] = bounds[5] = bounds[7] = VTK_DOUBLE_MIN;
  vtkChartXY* chart = q->chart();
  const vtkIdType plotCount = chart->GetNumberOfPlots();
  for (vtkIdType i = 0; i < plotCount; ++i)
    {
    vtkPlot* plot = chart->GetPlot(i);

    int corner = chart->GetPlotCorner(plot);
    double plotBounds[4];
    plot->GetBounds(plotBounds);
    switch (corner)
      {
      // bottom left
      case 0:
        // x
        bounds[2] = bounds[2] > plotBounds[0] ? plotBounds[0] : bounds[2];
        bounds[3] = bounds[3] < plotBounds[1] ? plotBounds[1] : bounds[3];
        // y
        bounds[0] = bounds[0] > plotBounds[2] ? plotBounds[2] : bounds[0];
        bounds[1] = bounds[1] < plotBounds[3] ? plotBounds[3] : bounds[1];
        break;
      // bottom right
      case 1:
        // x
        bounds[2] = bounds[2] > plotBounds[0] ? plotBounds[0] : bounds[2];
        bounds[3] = bounds[3] < plotBounds[1] ? plotBounds[1] : bounds[3];
        // y
        bounds[4] = bounds[4] > plotBounds[2] ? plotBounds[2] : bounds[4];
        bounds[5] = bounds[5] < plotBounds[3] ? plotBounds[3] : bounds[5];
        break;
      // top right
      case 2:
        // x
        bounds[6] = bounds[6] > plotBounds[0] ? plotBounds[0] : bounds[6];
        bounds[7] = bounds[7] < plotBounds[1] ? plotBounds[1] : bounds[7];
        // y
        bounds[4] = bounds[4] > plotBounds[2] ? plotBounds[2] : bounds[4];
        bounds[5] = bounds[5] < plotBounds[3] ? plotBounds[3] : bounds[5];
        break;
      // top left
      case 3:
        // x
        bounds[6] = bounds[6] > plotBounds[0] ? plotBounds[0] : bounds[6];
        bounds[7] = bounds[7] < plotBounds[1] ? plotBounds[1] : bounds[7];
        // y
        bounds[0] = bounds[0] > plotBounds[2] ? plotBounds[2] : bounds[1];
        bounds[1] = bounds[0] < plotBounds[3] ? plotBounds[3] : bounds[1];
        break;
      }
    }
}

// ----------------------------------------------------------------------------
// ctkVTKChartView methods

CTK_GET_CPP(ctkVTKChartView, vtkRenderWindow*, renderWindow, RenderWindow);

// ----------------------------------------------------------------------------
ctkVTKChartView::ctkVTKChartView(QWidget* parentWidget)
  :Superclass(parentWidget)
  , d_ptr(new ctkVTKChartViewPrivate(*this))
{
  Q_D(ctkVTKChartView);
  d->init();
  //this->setAutomaticImageCacheEnabled(true);
}

// ----------------------------------------------------------------------------
ctkVTKChartView::~ctkVTKChartView()
{
}

// ----------------------------------------------------------------------------
void ctkVTKChartView::setTitle(const QString& newTitle)
{
  Q_D(ctkVTKChartView);
  d->Chart->SetTitle(newTitle.toUtf8().data());
}

// ----------------------------------------------------------------------------
QString ctkVTKChartView::title()const
{
  Q_D(const ctkVTKChartView);
  return QString(d->Chart->GetTitle());
}

// ----------------------------------------------------------------------------
vtkChartXY* ctkVTKChartView::chart()const
{
  Q_D(const ctkVTKChartView);
  return d->Chart;
}

// ----------------------------------------------------------------------------
vtkContextScene* ctkVTKChartView::scene()const
{
  Q_D(const ctkVTKChartView);
  return d->ContextView->GetScene();
}

// ----------------------------------------------------------------------------
void ctkVTKChartView::addPlot(vtkPlot* plot)
{
  Q_D(ctkVTKChartView);
  d->Chart->AddPlot(plot);
  emit this->plotAdded(plot);
  this->onChartUpdated();
}

// ----------------------------------------------------------------------------
void ctkVTKChartView::removePlot(vtkPlot* plot)
{
  Q_D(ctkVTKChartView);
  vtkIdType index = this->plotIndex(plot);
  if (index == vtkIdType(-1))
    {
    return;
    }
  d->Chart->RemovePlot(index);
  emit this->plotRemoved(plot);
  this->onChartUpdated();
}

// ----------------------------------------------------------------------------
void ctkVTKChartView::removeAllPlots()
{
  Q_D(ctkVTKChartView);
  while(d->Chart->GetNumberOfPlots() > 0)
    {
    this->removePlot(d->Chart->GetPlot(0));
    }
}

// ----------------------------------------------------------------------------
vtkIdType ctkVTKChartView::plotIndex(vtkPlot* plot)
{
  Q_D(ctkVTKChartView);
  // GetPlotIndex is missing from vtkChart API
  for (vtkIdType i = 0; i < d->Chart->GetNumberOfPlots(); ++i)
    {
    if (plot == d->Chart->GetPlot(i))
      {
      return i;
      }
    }
  return -1;
}

// ----------------------------------------------------------------------------
void ctkVTKChartView::onChartUpdated()
{
  Q_D(ctkVTKChartView);
  double oldBounds[8];
  memcpy(oldBounds, d->OldBounds, 8 * sizeof(double));
  double newBounds[8];
  this->chartBounds(newBounds);
  if (oldBounds[0] != newBounds[0] ||
      oldBounds[1] != newBounds[1] ||
      oldBounds[2] != newBounds[2] ||
      oldBounds[3] != newBounds[3] ||
      oldBounds[4] != newBounds[4] ||
      oldBounds[5] != newBounds[5] ||
      oldBounds[6] != newBounds[6] ||
      oldBounds[7] != newBounds[7])
    {
    emit boundsChanged();
    }
}

// ----------------------------------------------------------------------------
void ctkVTKChartView::chartExtent(double* extent)const
{
  if (!extent)
    {
    return;
    }
  extent[0] = extent[2] = extent[4] = extent[6] = VTK_DOUBLE_MAX;
  extent[1] = extent[3] = extent[5] = extent[7] = VTK_DOUBLE_MIN;
  vtkChartXY* chart = this->chart();
  vtkAxis* axis = chart->GetAxis(vtkAxis::BOTTOM);
  extent[0] = qMin(axis->GetMinimum(), extent[0]);
  extent[1] = qMax(axis->GetMaximum(), extent[1]);
  axis = chart->GetAxis(vtkAxis::LEFT);
  extent[2] = qMin(axis->GetMinimum(), extent[2]);
  extent[3] = qMax(axis->GetMaximum(), extent[3]);
  axis = chart->GetAxis(vtkAxis::TOP);
  extent[4] = qMin(axis->GetMinimum(), extent[4]);
  extent[5] = qMax(axis->GetMaximum(), extent[5]);
  axis = chart->GetAxis(vtkAxis::RIGHT);
  extent[6] = qMin(axis->GetMinimum(), extent[6]);
  extent[7] = qMax(axis->GetMaximum(), extent[7]);
}

// ----------------------------------------------------------------------------
void ctkVTKChartView::setChartUserExtent(double* userExtent)
{
  if (!userExtent)
    {
    qCritical() << Q_FUNC_INFO << ": Invalid user extent";
    return;
    }
  vtkChartXY* chart = this->chart();
  vtkAxis* axis = chart->GetAxis(vtkAxis::BOTTOM);
  axis->SetRange(userExtent[0], userExtent[1]);
  axis = chart->GetAxis(vtkAxis::LEFT);
  axis->SetRange(userExtent[2], userExtent[3]);
  axis = chart->GetAxis(vtkAxis::TOP);
  axis->SetRange(userExtent[4], userExtent[5]);
  axis = chart->GetAxis(vtkAxis::RIGHT);
  axis->SetRange(userExtent[6], userExtent[7]);
}

// ----------------------------------------------------------------------------
void ctkVTKChartView::chartBounds(double* bounds)const
{
  Q_D(const ctkVTKChartView);
  if (d->UserBounds[1] < d->UserBounds[0])
    {
    // Invalid user bounds, return the real chart bounds
    d->chartBounds(bounds);
    }
  else
    {
    this->chartUserBounds(bounds);
    }
  memcpy(d->OldBounds, bounds, 8 * sizeof(double));
}

// ----------------------------------------------------------------------------
void ctkVTKChartView::setChartUserBounds(double* userBounds)
{
  Q_D(ctkVTKChartView);
  for (int i= 0; i < 8; ++i)
    {
    d->UserBounds[i] = userBounds[i];
    }
  this->onChartUpdated();
}

// ----------------------------------------------------------------------------
void ctkVTKChartView::chartUserBounds(double* bounds)const
{
  Q_D(const ctkVTKChartView);
  for (int i= 0; i < 8; ++i)
    {
    bounds[i] = d->UserBounds[i];
    }
}

// ----------------------------------------------------------------------------
void ctkVTKChartView::setAxesToChartBounds()
{
  vtkChartXY* chart = this->chart();
  double bounds[8];
  this->chartBounds(bounds);
  for (int i = 0; i < chart->GetNumberOfAxes(); ++i)
    {
    if (bounds[2*i] != VTK_DOUBLE_MAX)
      {
      chart->GetAxis(i)->SetRange(bounds[2*i], bounds[2*i+1]);
      }
    }
}

// ----------------------------------------------------------------------------
void ctkVTKChartView::boundAxesToChartBounds()
{
  vtkChartXY* chart = this->chart();
  double bounds[8];
  this->chartBounds(bounds);
  for (int i = 0; i < chart->GetNumberOfAxes(); ++i)
    {
    if (bounds[2*i] != VTK_DOUBLE_MAX)
      {
      chart->GetAxis(i)->SetMinimumLimit(bounds[2*i]);
      chart->GetAxis(i)->SetMaximumLimit(bounds[2*i + 1]);
      }
    }
}

// ----------------------------------------------------------------------------
void ctkVTKChartView::chartBoundsToPlotBounds(double bounds[8], double plotBounds[4])const
{
  plotBounds[0] = bounds[vtkAxis::BOTTOM*2];
  plotBounds[1] = bounds[vtkAxis::BOTTOM*2 + 1];
  plotBounds[2] = bounds[vtkAxis::LEFT*2];
  plotBounds[3] = bounds[vtkAxis::LEFT*2+1];
}

// ----------------------------------------------------------------------------
void ctkVTKChartView::mouseDoubleClickEvent(QMouseEvent* event)
{
  if (event->button() == Qt::MidButton)
    {
    this->setAxesToChartBounds();
    }
  this->Superclass::mouseDoubleClickEvent(event);
}


text:
package org.apache.qpid.protonj2.test.driver.codec.transport;

import java.util.List;
import java.util.Map;

import org.apache.qpid.protonj2.test.driver.codec.messaging.Source;
import org.apache.qpid.protonj2.test.driver.codec.messaging.Target;
import org.apache.qpid.protonj2.test.driver.codec.primitives.Binary;
import org.apache.qpid.protonj2.test.driver.codec.primitives.DescribedType;
import org.apache.qpid.protonj2.test.driver.codec.primitives.Symbol;
import org.apache.qpid.protonj2.test.driver.codec.primitives.UnsignedByte;
import org.apache.qpid.protonj2.test.driver.codec.primitives.UnsignedInteger;
import org.apache.qpid.protonj2.test.driver.codec.primitives.UnsignedLong;
import org.apache.qpid.protonj2.test.driver.codec.transactions.Coordinator;

import io.netty.buffer.ByteBuf;

public class Attach extends PerformativeDescribedType {

    public static final Symbol DESCRIPTOR_SYMBOL = Symbol.valueOf("amqp:attach:list");
    public static final UnsignedLong DESCRIPTOR_CODE = UnsignedLong.valueOf(0x0000000000000012L);

    /**
     * Enumeration which maps to fields in the Attach Performative
     */
    public enum Field {
        NAME,
        HANDLE,
        ROLE,
        SND_SETTLE_MODE,
        RCV_SETTLE_MODE,
        SOURCE,
        TARGET,
        UNSETTLED,
        INCOMPLETE_UNSETTLED,
        INITIAL_DELIVERY_COUNT,
        MAX_MESSAGE_SIZE,
        OFFERED_CAPABILITIES,
        DESIRED_CAPABILITIES,
        PROPERTIES
    }

    public Attach() {
        super(Field.values().length);
    }

    @SuppressWarnings("unchecked")
    public Attach(Object described) {
        super(Field.values().length, (List<Object>) described);
    }

    public Attach(List<Object> described) {
        super(Field.values().length, described);
    }

    @Override
    public Symbol getDescriptor() {
        return DESCRIPTOR_SYMBOL;
    }

    public Attach setName(String o) {
        getList().set(Field.NAME.ordinal(), o);
        return this;
    }

    public String getName() {
        return (String) getList().get(Field.NAME.ordinal());
    }

    public Attach setHandle(UnsignedInteger o) {
        getList().set(Field.HANDLE.ordinal(), o);
        return this;
    }

    public UnsignedInteger getHandle() {
        return (UnsignedInteger) getList().get(Field.HANDLE.ordinal());
    }

    public Attach setRole(Boolean o) {
        getList().set(Field.ROLE.ordinal(), o);
        return this;
    }

    public Attach setRole(boolean o) {
        getList().set(Field.ROLE.ordinal(), o);
        return this;
    }

    public Attach setRole(Role role) {
        getList().set(Field.ROLE.ordinal(), role.getValue());
        return this;
    }

    public Boolean getRole() {
        return (Boolean) getList().get(Field.ROLE.ordinal());
    }

    public Attach setSenderSettleMode(byte o) {
        getList().set(Field.SND_SETTLE_MODE.ordinal(), UnsignedByte.valueOf(o));
        return this;
    }

    public Attach setSenderSettleMode(UnsignedByte o) {
        getList().set(Field.SND_SETTLE_MODE.ordinal(), o);
        return this;
    }

    public Attach setSenderSettleMode(SenderSettleMode o) {
        getList().set(Field.SND_SETTLE_MODE.ordinal(), o.getValue());
        return this;
    }

    public UnsignedByte getSenderSettleMode() {
        return (UnsignedByte) getList().get(Field.SND_SETTLE_MODE.ordinal());
    }

    public Attach setReceiverSettleMode(byte o) {
        getList().set(Field.RCV_SETTLE_MODE.ordinal(), UnsignedByte.valueOf(o));
        return this;
    }

    public Attach setReceiverSettleMode(UnsignedByte o) {
        getList().set(Field.RCV_SETTLE_MODE.ordinal(), o);
        return this;
    }

    public Attach setReceiverSettleMode(ReceiverSettleMode o) {
        getList().set(Field.RCV_SETTLE_MODE.ordinal(), o.getValue());
        return this;
    }

    public UnsignedByte getReceiverSettleMode() {
        return (UnsignedByte) getList().get(Field.RCV_SETTLE_MODE.ordinal());
    }

    public Attach setSource(Source o) {
        getList().set(Field.SOURCE.ordinal(), o);
        return this;
    }

    public Source getSource() {
        return (Source) getList().get(Field.SOURCE.ordinal());
    }

    public Attach setTarget(Target o) {
        getList().set(Field.TARGET.ordinal(), o);
        return this;
    }

    public Attach setTarget(Coordinator o) {
        getList().set(Field.TARGET.ordinal(), o);
        return this;
    }

    public Object getTarget() {
        return getList().get(Field.TARGET.ordinal());
    }

    public Attach setUnsettled(Map<Binary, DescribedType> o) {
        getList().set(Field.UNSETTLED.ordinal(), o);
        return this;
    }

    @SuppressWarnings("unchecked")
    public Map<Binary, DescribedType> getUnsettled() {
        return (Map<Binary, DescribedType>) getList().get(Field.UNSETTLED.ordinal());
    }

    public Attach setIncompleteUnsettled(Boolean o) {
        getList().set(Field.INCOMPLETE_UNSETTLED.ordinal(), o);
        return this;
    }

    public Boolean getIncompleteUnsettled() {
        return (Boolean) getList().get(Field.INCOMPLETE_UNSETTLED.ordinal());
    }

    public Attach setInitialDeliveryCount(UnsignedInteger o) {
        getList().set(Field.INITIAL_DELIVERY_COUNT.ordinal(), o);
        return this;
    }

    public UnsignedInteger getInitialDeliveryCount() {
        return (UnsignedInteger) getList().get(Field.INITIAL_DELIVERY_COUNT.ordinal());
    }

    public Attach setMaxMessageSize(UnsignedLong o) {
        getList().set(Field.MAX_MESSAGE_SIZE.ordinal(), o);
        return this;
    }

    public UnsignedLong getMaxMessageSize() {
        return (UnsignedLong) getList().get(Field.MAX_MESSAGE_SIZE.ordinal());
    }

    public Attach setOfferedCapabilities(Symbol[] o) {
        getList().set(Field.OFFERED_CAPABILITIES.ordinal(), o);
        return this;
    }

    public Symbol[] getOfferedCapabilities() {
        return (Symbol[]) getList().get(Field.OFFERED_CAPABILITIES.ordinal());
    }

    public Attach setDesiredCapabilities(Symbol[] o) {
        getList().set(Field.DESIRED_CAPABILITIES.ordinal(), o);
        return this;
    }

    public Symbol[] getDesiredCapabilities() {
        return (Symbol[]) getList().get(Field.DESIRED_CAPABILITIES.ordinal());
    }

    public Attach setProperties(Map<Symbol, Object> o) {
        getList().set(Field.PROPERTIES.ordinal(), o);
        return this;
    }

    @SuppressWarnings("unchecked")
    public Map<Symbol, Object> getProperties() {
        return (Map<Symbol, Object>) getList().get(Field.PROPERTIES.ordinal());
    }

    @Override
    public PerformativeType getPerformativeType() {
        return PerformativeType.ATTACH;
    }

    @Override
    public <E> void invoke(PerformativeHandler<E> handler, ByteBuf payload, int channel, E context) {
        handler.handleAttach(this, payload, channel, context);
    }

    @Override
    public Object getFieldValueOrSpecDefault(int index) {
        Object result = getFieldValue(index);
        if (result == null) {
            Field field = Field.values()[index];
            switch (field) {
                case SND_SETTLE_MODE:
                    result = SenderSettleMode.MIXED;
                    break;
                case RCV_SETTLE_MODE:
                    result = ReceiverSettleMode.FIRST;
                    break;
                case INCOMPLETE_UNSETTLED:
                    result = Boolean.FALSE;
                default:
                    break;
            }
        }
        return result;
    }
}


text:
<?php

namespace Imper86\AllegroApi\Soap\Wsdl;

class PharmacyRecipientDataStruct
{

    /**
     * @var string $recipientFirstName
     */
    protected $recipientFirstName = null;

    /**
     * @var string $recipientLastName
     */
    protected $recipientLastName = null;

    /**
     * @var string $recipientAddress
     */
    protected $recipientAddress = null;

    /**
     * @var string $recipientPostcode
     */
    protected $recipientPostcode = null;

    /**
     * @var string $recipientCity
     */
    protected $recipientCity = null;

    public function __construct()
    {

    }

    /**
     * @return string
     */
    public function getRecipientFirstName()
    {
      return $this->recipientFirstName;
    }

    /**
     * @param string $recipientFirstName
     * @return \Imper86\AllegroApi\Soap\Wsdl\PharmacyRecipientDataStruct
     */
    public function setRecipientFirstName($recipientFirstName)
    {
      $this->recipientFirstName = $recipientFirstName;
      return $this;
    }

    /**
     * @return string
     */
    public function getRecipientLastName()
    {
      return $this->recipientLastName;
    }

    /**
     * @param string $recipientLastName
     * @return \Imper86\AllegroApi\Soap\Wsdl\PharmacyRecipientDataStruct
     */
    public function setRecipientLastName($recipientLastName)
    {
      $this->recipientLastName = $recipientLastName;
      return $this;
    }

    /**
     * @return string
     */
    public function getRecipientAddress()
    {
      return $this->recipientAddress;
    }

    /**
     * @param string $recipientAddress
     * @return \Imper86\AllegroApi\Soap\Wsdl\PharmacyRecipientDataStruct
     */
    public function setRecipientAddress($recipientAddress)
    {
      $this->recipientAddress = $recipientAddress;
      return $this;
    }

    /**
     * @return string
     */
    public function getRecipientPostcode()
    {
      return $this->recipientPostcode;
    }

    /**
     * @param string $recipientPostcode
     * @return \Imper86\AllegroApi\Soap\Wsdl\PharmacyRecipientDataStruct
     */
    public function setRecipientPostcode($recipientPostcode)
    {
      $this->recipientPostcode = $recipientPostcode;
      return $this;
    }

    /**
     * @return string
     */
    public function getRecipientCity()
    {
      return $this->recipientCity;
    }

    /**
     * @param string $recipientCity
     * @return \Imper86\AllegroApi\Soap\Wsdl\PharmacyRecipientDataStruct
     */
    public function setRecipientCity($recipientCity)
    {
      $this->recipientCity = $recipientCity;
      return $this;
    }

}


text:
package com.amazonaws.services.glacier.model;

import java.io.Serializable;

import com.amazonaws.AmazonWebServiceRequest;

/**
 * Container for the parameters to the {@link com.amazonaws.services.glacier.AmazonGlacier#abortVaultLock(AbortVaultLockRequest) AbortVaultLock operation}.
 *

 * This operation aborts the vault locking process if the vault lock is
 * not in the Locked state. If the vault lock is in the
 * Locked state when this operation is requested, the
 * operation returns an AccessDeniedException error.
 * Aborting the vault locking process removes the vault lock policy from
 * the specified vault.
 *

 *

 * A vault lock is put into the InProgress state by calling
 * InitiateVaultLock. A vault lock is put into the Locked
 * state by calling CompleteVaultLock. You can get the state of a vault
 * lock by calling GetVaultLock. For more information about the vault
 * locking process, see
 *  Amazon Glacier Vault Lock  . For more information about vault lock policies, see  Amazon Glacier Access Control with Vault Lock Policies
 * .
 *

 *

 * This operation is idempotent. You can successfully invoke this
 * operation multiple times, if the vault lock is in the
 * InProgress state or if there is no policy associated with
 * the vault.
 *

 *
 * @see com.amazonaws.services.glacier.AmazonGlacier#abortVaultLock(AbortVaultLockRequest)
 */
public class AbortVaultLockRequest extends AmazonWebServiceRequest implements Serializable, Cloneable {

    /**
     * The AccountId value is the AWS account ID. This value
     * must match the AWS account ID associated with the credentials used to
     * sign the request. You can either specify an AWS account ID or
     * optionally a single '-' (hyphen), in which case Amazon
     * Glacier uses the AWS account ID associated with the credentials used
     * to sign the request. If you specify your account ID, do not include
     * any hyphens ('-') in the ID.
     */
    private String accountId;

    /**
     * The name of the vault.
     */
    private String vaultName;

    /**
     * The AccountId value is the AWS account ID. This value
     * must match the AWS account ID associated with the credentials used to
     * sign the request. You can either specify an AWS account ID or
     * optionally a single '-' (hyphen), in which case Amazon
     * Glacier uses the AWS account ID associated with the credentials used
     * to sign the request. If you specify your account ID, do not include
     * any hyphens ('-') in the ID.
     *
     * @return The AccountId value is the AWS account ID. This value
     *         must match the AWS account ID associated with the credentials used to
     *         sign the request. You can either specify an AWS account ID or
     *         optionally a single '-' (hyphen), in which case Amazon
     *         Glacier uses the AWS account ID associated with the credentials used
     *         to sign the request. If you specify your account ID, do not include
     *         any hyphens ('-') in the ID.
     */
    public String getAccountId() {
        return accountId;
    }

    /**
     * The AccountId value is the AWS account ID. This value
     * must match the AWS account ID associated with the credentials used to
     * sign the request. You can either specify an AWS account ID or
     * optionally a single '-' (hyphen), in which case Amazon
     * Glacier uses the AWS account ID associated with the credentials used
     * to sign the request. If you specify your account ID, do not include
     * any hyphens ('-') in the ID.
     *
     * @param accountId The AccountId value is the AWS account ID. This value
     *         must match the AWS account ID associated with the credentials used to
     *         sign the request. You can either specify an AWS account ID or
     *         optionally a single '-' (hyphen), in which case Amazon
     *         Glacier uses the AWS account ID associated with the credentials used
     *         to sign the request. If you specify your account ID, do not include
     *         any hyphens ('-') in the ID.
     */
    public void setAccountId(String accountId) {
        this.accountId = accountId;
    }

    /**
     * The AccountId value is the AWS account ID. This value
     * must match the AWS account ID associated with the credentials used to
     * sign the request. You can either specify an AWS account ID or
     * optionally a single '-' (hyphen), in which case Amazon
     * Glacier uses the AWS account ID associated with the credentials used
     * to sign the request. If you specify your account ID, do not include
     * any hyphens ('-') in the ID.
     *

     * Returns a reference to this object so that method calls can be chained together.
     *
     * @param accountId The AccountId value is the AWS account ID. This value
     *         must match the AWS account ID associated with the credentials used to
     *         sign the request. You can either specify an AWS account ID or
     *         optionally a single '-' (hyphen), in which case Amazon
     *         Glacier uses the AWS account ID associated with the credentials used
     *         to sign the request. If you specify your account ID, do not include
     *         any hyphens ('-') in the ID.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public AbortVaultLockRequest withAccountId(String accountId) {
        this.accountId = accountId;
        return this;
    }

    /**
     * The name of the vault.
     *
     * @return The name of the vault.
     */
    public String getVaultName() {
        return vaultName;
    }

    /**
     * The name of the vault.
     *
     * @param vaultName The name of the vault.
     */
    public void setVaultName(String vaultName) {
        this.vaultName = vaultName;
    }

    /**
     * The name of the vault.
     *

     * Returns a reference to this object so that method calls can be chained together.
     *
     * @param vaultName The name of the vault.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public AbortVaultLockRequest withVaultName(String vaultName) {
        this.vaultName = vaultName;
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and
     * debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getAccountId() != null) sb.append("AccountId: " + getAccountId() + ",");
        if (getVaultName() != null) sb.append("VaultName: " + getVaultName() );
        sb.append("}");
        return sb.toString();
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getAccountId() == null) ? 0 : getAccountId().hashCode());
        hashCode = prime * hashCode + ((getVaultName() == null) ? 0 : getVaultName().hashCode());
        return hashCode;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null) return false;

        if (obj instanceof AbortVaultLockRequest == false) return false;
        AbortVaultLockRequest other = (AbortVaultLockRequest)obj;

        if (other.getAccountId() == null ^ this.getAccountId() == null) return false;
        if (other.getAccountId() != null && other.getAccountId().equals(this.getAccountId()) == false) return false;
        if (other.getVaultName() == null ^ this.getVaultName() == null) return false;
        if (other.getVaultName() != null && other.getVaultName().equals(this.getVaultName()) == false) return false;
        return true;
    }

    @Override
    public AbortVaultLockRequest clone() {

            return (AbortVaultLockRequest) super.clone();
    }

}


text:
// Copyright (C) 2007-2013, GoodData(R) Corporation. All rights reserved.
import {
    isPlainObject,
    isFunction,
    has,
    set,
    merge,
    result
} from 'lodash';

import * as config from './config';
import fetch from './utils/fetch';

/**
 * Ajax wrapper around GDC authentication mechanisms, SST and TT token handling and polling.
 * Inteface is same as original jQuery.ajax.

 * If token is expired, current request is "paused", token is refreshed and request is retried and result.
 * is transparently returned to original call.

 * Additionally polling is handled. Only final result of polling returned.
 * @module xhr
 * @class xhr
 */

const DEFAULT_POLL_DELAY = 1000;

let tokenRequest;
let commonXhrSettings = {};

/**
 * Back compatible method for setting common XHR settings
 *
 * Usually in our apps we used beforeSend ajax callback to set the X-GDC-REQUEST header with unique ID.
 *
 * @param settings object XHR settings as
 */
export function ajaxSetup(settings) {
    commonXhrSettings = Object.assign({}, commonXhrSettings, settings);
}

function simulateBeforeSend(settings) {
    const xhr = {
        setRequestHeader(key, value) {
            set(settings, ['headers', key], value);
        }
    };

    if (isFunction(settings.beforeSend)) {
        settings.beforeSend(xhr);
    }
}

function enrichSettingWithCustomDomain(originalUrl, originalSettings, domain) {
    let url = originalUrl;
    const settings = originalSettings;
    if (domain) {
        // protect url to be prepended with domain on retry
        if (originalUrl.indexOf(domain) === -1) {
            url = domain + originalUrl;
        }
        settings.mode = 'cors';
        settings.credentials = 'include';
    }

    return { url, settings };
}

function continueAfterTokenRequest(url, settings) {
    return tokenRequest.then((response) => {
        if (!response.ok) {
            const err = new Error('Unauthorized');
            err.response = response;
            throw err;
        }
        tokenRequest = null;

        return ajax(url, settings); // eslint-disable-line no-use-before-define
    }, (reason) => {
        tokenRequest = null;
        return reason;
    });
}

function createSettings(customSettings) {
    const settings = Object.assign({}, commonXhrSettings, customSettings);

    settings.headers = {
        Accept: 'application/json; charset=utf-8',
        'Content-Type': 'application/json'
    };

    settings.pollDelay = (settings.pollDelay !== undefined) ? settings.pollDelay : DEFAULT_POLL_DELAY;

    // TODO jquery compat - add to warnings
    settings.body = (settings.data) ? settings.data : settings.body;
    settings.mode = 'same-origin';
    settings.credentials = 'same-origin';

    if (isPlainObject(settings.body)) {
        settings.body = JSON.stringify(settings.body);
    }

    return settings;
}

function handleUnauthorized(originalUrl, originalSettings) {
    if (!tokenRequest) {
        // Create only single token request for any number of waiting request.
        // If token request exist, just listen for it's end.
        const { url, settings } = enrichSettingWithCustomDomain('/gdc/account/token', createSettings({}), config.domain);

        tokenRequest = fetch(url, settings).then((response) => {
            // tokenRequest = null;
            // TODO jquery compat - allow to attach unauthorized callback and call it if attached
            // if ((xhrObj.status === 401) && (isFunction(req.unauthorized))) {
            //     req.unauthorized(xhrObj, textStatus, err, deferred);
            //     return;
            // }
            // unauthorized handler is not defined or not http 401
            // unauthorized when retrieving token -> not logged
            if (response.status === 401) {
                const err = new Error('Unauthorized');
                err.response = response;
                throw err;
            }

            return response;
        });
    }
    return continueAfterTokenRequest(originalUrl, originalSettings);
}

function isLoginRequest(url) {
    return url.indexOf('/gdc/account/login') !== -1;
}

/**
 * @param {Response} response
 * @return {Promise} promise which resolves to result JSON ()
 */
export const parseJSON = response => response.json();

/**
 * @param {Response} response see https://developer.mozilla.org/en-US/docs/Web/API/Response
 * @return {Response} or {Error}
 */
const checkStatus = (response) => {
    if (response.status >= 200 && response.status < 399) {
        return response;
    }

    if (response instanceof Error && has(response, 'response')) {
        throw response;
    }

    const error = new Error(response.statusText);
    error.response = response;
    throw error;
};

export function handlePolling(url, settings, sendRequest) {
    const pollingDelay = result(settings, 'pollDelay');

    return new Promise((resolve, reject) => {
        setTimeout(() => {
            sendRequest(url, settings).then(resolve, reject);
        }, pollingDelay);
    });
}

export function ajax(originalUrl, tempSettings = {}) {
    const firstSettings = createSettings(tempSettings);
    const { url, settings } = enrichSettingWithCustomDomain(originalUrl, firstSettings, config.domain);

    simulateBeforeSend(settings);

    if (tokenRequest) {
        return continueAfterTokenRequest(url, settings);
    }

    return fetch(url, settings).then((response) => {
        // If response.status id 401 and it was a login request there is no need
        // to cycle back for token - login does not need token and this meand you
        // are not authorized
        if (response.status === 401) {
            if (isLoginRequest(url)) {
                const err = new Error('Unauthorized');
                err.response = response;
                throw err;
            }

            return handleUnauthorized(url, settings);
        }

        if (response.status === 202 && !settings.dontPollOnResult) {
            // if the response is 202 and Location header is not empty, let's poll on the new Location
            let finalUrl = url;
            const finalSettings = settings;
            if (response.headers.has('Location')) {
                finalUrl = response.headers.get('Location');
            }
            finalSettings.method = 'GET';
            delete finalSettings.data;
            delete finalSettings.body;
            return handlePolling(finalUrl, finalSettings, ajax);
        }
        return response;
    }).then(checkStatus);
}

function xhrMethod(method) {
    return function methodFn(url, settings) {
        const opts = merge({ method }, settings);

        return ajax(url, opts);
    };
}

/**
 * Wrapper for xhr.ajax method GET
 * @method get
 */
export const get = (url, settings) => {
    const opts = merge({ method: 'GET' }, settings);

    return ajax(url, opts).then(parseJSON);
};

/**
 * Wrapper for xhr.ajax method POST
 * @method post
 */
export const post = xhrMethod('POST');

/**
 * Wrapper for xhr.ajax method PUT
 * @method put
 */
export const put = xhrMethod('PUT');

/**
 * Wrapper for xhr.ajax method DELETE
 * @method delete
 */
export const del = xhrMethod('DELETE');


text:
var JSBus;
(function (JSBus) {
    var LocalStorageQueue = (function () {
        function LocalStorageQueue(name) {
            this.name = name;
            if(!LocalStorageQueue.hasStorage) {
                throw new Error("Local storage is not enabled in this browser.");
            }
        }
        Object.defineProperty(LocalStorageQueue.prototype, "queue", {
            get: function () {
                var items = JSON.parse(localStorage.getItem(this.name));
                return items || [];
            },
            set: function (q) {
                if(!q) {
                    return;
                }
                localStorage.setItem(this.name, JSON.stringify(q));
            },
            enumerable: true,
            configurable: true
        });
        LocalStorageQueue.prototype.add = function (id, message, operationDate) {
            var q = this.queue, m = new MessageContainer(id, message);
            if(operationDate) {
                m.lastOperationAt = operationDate.getTime();
            }
            q.push(m);
            this.queue = q;
        };
        LocalStorageQueue.prototype.remove = function (id) {
            var matching = this.removeWhenMatches(function (m) {
                return m.id == id;
            });
            return matching.length ? matching[0] : null;
        };
        LocalStorageQueue.prototype.all = function () {
            var q = this.queue;
            return q.map(this.removeMessageContainer);
        };
        LocalStorageQueue.prototype.removeWhereLastOperationOlderThan = function (ms) {
            var cutOff = Date.now() - ms;
            return this.removeWhenMatches(function (m) {
                return m.lastOperationAt < cutOff;
            });
        };
        LocalStorageQueue.prototype.removeWhenMatches = function (operator) {
            var q = this.queue, matching = [];
            var len = q.length;
            while(len--) {
                if(operator(q[len])) {
                    matching.push(q[len]);
                    q.splice(len, 1);
                }
            }
            if(matching.length) {
                this.queue = q;
            }
            return matching.map(this.removeMessageContainer);
        };
        LocalStorageQueue.prototype.removeMessageContainer = function (m) {
            return m.message;
        };
        LocalStorageQueue.hasStorage = function hasStorage() {
            try  {
                var m = "a";
                localStorage.setItem(m, m);
                localStorage.removeItem(m);
                return true;
            } catch (e) {
                return false;
            }
        };
        return LocalStorageQueue;
    })();
    JSBus.LocalStorageQueue = LocalStorageQueue;
    var MessageContainer = (function () {
        function MessageContainer(id, message) {
            this.id = id;
            this.message = message;
            this.timestamp = new Date();
        }
        return MessageContainer;
    })();
})(JSBus || (JSBus = {}));
//@ sourceMappingURL=LocalStorageQueue.js.map


text:
package com.jetbrains.python.run;

import java.io.File;

import org.jdom.Element;
import javax.annotation.Nonnull;
import com.intellij.execution.ExecutionException;
import com.intellij.execution.Executor;
import com.intellij.execution.configurations.ConfigurationFactory;
import com.intellij.execution.configurations.RefactoringListenerProvider;
import com.intellij.execution.configurations.RunConfiguration;
import com.intellij.execution.configurations.RunProfileState;
import com.intellij.execution.configurations.RuntimeConfigurationException;
import com.intellij.execution.runners.ExecutionEnvironment;
import com.intellij.openapi.options.SettingsEditor;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.JDOMExternalizerUtil;
import com.intellij.openapi.util.WriteExternalException;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.refactoring.listeners.RefactoringElementAdapter;
import com.intellij.refactoring.listeners.RefactoringElementListener;
import com.jetbrains.python.PyBundle;

/**
 * @author yole
 */
public class PythonRunConfiguration extends AbstractPythonRunConfiguration implements AbstractPythonRunConfigurationParams, PythonRunConfigurationParams, RefactoringListenerProvider
{
	public static final String SCRIPT_NAME = "SCRIPT_NAME";
	public static final String PARAMETERS = "PARAMETERS";
	public static final String MULTIPROCESS = "MULTIPROCESS";
	public static final String SHOW_COMMAND_LINE = "SHOW_COMMAND_LINE";
	private String myScriptName;
	private String myScriptParameters;
	private boolean myShowCommandLineAfterwards = false;

	protected PythonRunConfiguration(Project project, ConfigurationFactory configurationFactory)
	{
		super(project, configurationFactory);
		setUnbufferedEnv();
	}

	@Override
	protected SettingsEditor<? extends RunConfiguration> createConfigurationEditor()
	{
		return new PythonRunConfigurationEditor(this);
	}

	public RunProfileState getState(@Nonnull final Executor executor, @Nonnull final ExecutionEnvironment env) throws ExecutionException
	{
		return new PythonScriptCommandLineState(this, env);
	}

	public void checkConfiguration() throws RuntimeConfigurationException
	{
		super.checkConfiguration();

		if(StringUtil.isEmptyOrSpaces(myScriptName))
		{
			throw new RuntimeConfigurationException(PyBundle.message("runcfg.unittest.no_script_name"));
		}
	}

	public String suggestedName()
	{
		final String scriptName = getScriptName();
		if(scriptName == null)
		{
			return null;
		}
		String name = new File(scriptName).getName();
		if(name.endsWith(".py"))
		{
			return name.substring(0, name.length() - 3);
		}
		return name;
	}

	public String getScriptName()
	{
		return myScriptName;
	}

	public void setScriptName(String scriptName)
	{
		myScriptName = scriptName;
	}

	public String getScriptParameters()
	{
		return myScriptParameters;
	}

	public void setScriptParameters(String scriptParameters)
	{
		myScriptParameters = scriptParameters;
	}

	public boolean showCommandLineAfterwards()
	{
		return myShowCommandLineAfterwards;
	}

	public void setShowCommandLineAfterwards(boolean showCommandLineAfterwards)
	{
		myShowCommandLineAfterwards = showCommandLineAfterwards;
	}

	public void readExternal(Element element)
	{
		super.readExternal(element);
		myScriptName = JDOMExternalizerUtil.readField(element, SCRIPT_NAME);
		myScriptParameters = JDOMExternalizerUtil.readField(element, PARAMETERS);
		myShowCommandLineAfterwards = Boolean.parseBoolean(JDOMExternalizerUtil.readField(element, SHOW_COMMAND_LINE, "false"));
	}

	public void writeExternal(Element element) throws WriteExternalException
	{
		super.writeExternal(element);
		JDOMExternalizerUtil.writeField(element, SCRIPT_NAME, myScriptName);
		JDOMExternalizerUtil.writeField(element, PARAMETERS, myScriptParameters);
		JDOMExternalizerUtil.writeField(element, SHOW_COMMAND_LINE, Boolean.toString(myShowCommandLineAfterwards));
	}

	public AbstractPythonRunConfigurationParams getBaseParams()
	{
		return this;
	}

	public static void copyParams(PythonRunConfigurationParams source, PythonRunConfigurationParams target)
	{
		AbstractPythonRunConfiguration.copyParams(source.getBaseParams(), target.getBaseParams());
		target.setScriptName(source.getScriptName());
		target.setScriptParameters(source.getScriptParameters());
		target.setShowCommandLineAfterwards(source.showCommandLineAfterwards());
	}

	@Override
	public RefactoringElementListener getRefactoringElementListener(PsiElement element)
	{
		if(element instanceof PsiFile)
		{
			VirtualFile virtualFile = ((PsiFile) element).getVirtualFile();
			if(virtualFile != null && Comparing.equal(new File(virtualFile.getPath()).getAbsolutePath(), new File(myScriptName).getAbsolutePath()))
			{
				return new RefactoringElementAdapter()
				{
					@Override
					public void elementRenamedOrMoved(@Nonnull PsiElement newElement)
					{
						VirtualFile virtualFile = ((PsiFile) newElement).getVirtualFile();
						if(virtualFile != null)
						{
							updateScriptName(virtualFile.getPath());
						}
					}

					@Override
					public void undoElementMovedOrRenamed(@Nonnull PsiElement newElement, @Nonnull String oldQualifiedName)
					{
						updateScriptName(oldQualifiedName);
					}

					private void updateScriptName(String path)
					{
						myScriptName = FileUtil.toSystemDependentName(path);
					}
				};
			}
		}
		return null;
	}
}


text:
<?php

namespace Metrol\HTML\Form\Input;

/**
 * URL input type
 */
class URL extends Text
{
  /**
   * Initialize the URL object
   *
   * @param string Name of the field
   */
  public function __construct($fieldName = null)
  {
    parent::__construct($fieldName);

    $this->setInputType('url');
  }
}


text:
#pragma once

#include "palMsaaState.h"

namespace Pal
{

// =====================================================================================================================
// GFXIP-independent msaa state implementation. See IMsaaState documentation for more details.
class MsaaState : public IMsaaState
{
public:
    virtual void Destroy() override { this->~MsaaState(); }

protected:
    MsaaState() {}
    virtual ~MsaaState() {}

private:
    PAL_DISALLOW_COPY_AND_ASSIGN(MsaaState);
};

} // Pal


text:
import { assign, map } from '../-private/helpers';
import { getExecutionContext } from '../-private/execution_context';

/**
 * @public
 *
 * Returns the value of an attribute from the matched element, or an array of
 * values from multiple matched elements.
 *
 * @example
 * // <input placeholder="a value">
 *
 * import { create, attribute } from 'ember-cli-page-object';
 *
 * const page = create({
 *   inputPlaceholder: attribute('placeholder', 'input')
 * });
 *
 * assert.equal(page.inputPlaceholder, 'a value');
 *
 * @example
 *
 * // <input placeholder="a value">
 * // <input placeholder="other value">
 *
 * import { create, attribute } from 'ember-cli-page-object';
 *
 * const page = create({
 *   inputPlaceholders: attribute('placeholder', ':input', { multiple: true })
 * });
 *
 * assert.deepEqual(page.inputPlaceholders, ['a value', 'other value']);
 *
 * @example
 *
 * //
<input>

 * //
<input placeholder="a value">

 * //
<input>

 *
 * import { create, attribute } from 'ember-cli-page-object';
 *
 * const page = create({
 *   inputPlaceholder: attribute('placeholder', ':input', { scope: '.scope' })
 * });
 *
 * assert.equal(page.inputPlaceholder, 'a value');
 *
 * @example
 *
 * //
<input>

 * //
<input placeholder="a value">

 * //
<input>

 *
 * import { create, attribute } from 'ember-cli-page-object';
 *
 * const page = create({
 *   scope: 'scope',
 *   inputPlaceholder: attribute('placeholder', ':input')
 * });
 *
 * assert.equal(page.inputPlaceholder, 'a value');
 *
 * @public
 *
 * @param {string} attributeName - Name of the attribute to get
 * @param {string} selector - CSS selector of the element to check
 * @param {Object} options - Additional options
 * @param {string} options.scope - Nests provided scope within parent's scope
 * @param {boolean} options.resetScope - Override parent's scope
 * @param {number} options.at - Reduce the set of matched elements to the one at the specified index
 * @param {boolean} options.multiple - If set, the function will return an array of values
 * @param {string} options.testContainer - Context where to search elements in the DOM
 * @return {Descriptor}
 *
 * @throws Will throw an error if no element matches selector
 * @throws Will throw an error if multiple elements are matched by selector and multiple option is not set
 */
export function attribute(attributeName, selector, userOptions = {}) {
  return {
    isDescriptor: true,

    get(key) {
      let executionContext = getExecutionContext(this);
      let options = assign({ pageObjectKey: key }, userOptions);

      return executionContext.run((context) => {
        let elements = context.findWithAssert(selector, options);
        let result;

        result = map(elements, function(element) {
          return element.attr(attributeName);
        });

        return options.multiple ? result : result[0];
      });
    }
  };
}


text:
rbscreenshot
============

[![Gem Version](https://badge.fury.io/rb/rbscreenshot.svg)](http://badge.fury.io/rb/rbscreenshot)

Take a screenshot in one line.

Usage
===

1. `brew install phantomjs` if you haven't installed phantomjs yet.

2. `gem install 'rbscreenshot'`

3. require and

```ruby
RbScreenShot.take 'https://github.com/kaiinui/rbscreenshot'
```

gives `./#{timestamp}.png` where `timestamp` is like `1404631139` (`RbScreenShot.take` returns the file name.)

![](https://raw.githubusercontent.com/kaiinui/rbscreenshot/master/SS.png)


text:
package android.support.v4.content;

// Referenced classes of package android.support.v4.content:
//            Loader

public static interface
{

    public abstract void onLoadCanceled(Loader loader);
}