text:
<?php

class CustomerDetailsCheckoutComponent extends CheckoutComponent
{
    protected $requiredfields = array(
        'FirstName',
        'Surname',
        'Email',
    );

    public function getFormFields(Order $order)
    {
        $fields = FieldList::create(
            $firstname = TextField::create('FirstName', _t('CheckoutField.FIRSTNAME', 'First Name')),
            $surname = TextField::create('Surname', _t('CheckoutField.SURNAME', 'Surname')),
            $email = EmailField::create('Email', _t('CheckoutField.EMAIL', 'Email'))
        );

        return $fields;
    }

    public function validateData(Order $order, array $data)
    {
        //all fields are required
    }

    public function getData(Order $order)
    {
        if ($order->FirstName || $order->Surname || $order->Email) {
            return array(
                'FirstName' => $order->FirstName,
                'Surname'   => $order->Surname,
                'Email'     => $order->Email,
            );
        }
        if ($member = Member::currentUser()) {
            return array(
                'FirstName' => $member->FirstName,
                'Surname'   => $member->Surname,
                'Email'     => $member->Email,
            );
        }
        return array();
    }

    public function setData(Order $order, array $data)
    {
        $order->update($data);
        $order->write();
    }
}

redpajama_set_name: RedPajamaGithub


text:
namespace ui {

EventFactoryOzone::EventFactoryOzone() {}

EventFactoryOzone::~EventFactoryOzone() {
  for (unsigned i = 0; i < fd_controllers_.size(); i++) {
    fd_controllers_[i]->StopWatchingFileDescriptor();
  }
}

void EventFactoryOzone::CreateEvdevWatchers() {
  // The number of devices in the directory is unknown without reading
  // the contents of the directory. Further, with hot-plugging,  the entries
  // might decrease during the execution of this loop. So exciting from the
  // loop on the first failure of open below is both cheaper and more
  // reliable.
  for (int id = 0; true; id++) {
    std::string path = base::StringPrintf("/dev/input/event%d", id);
    int fd = open(path.c_str(), O_RDONLY | O_NONBLOCK);
    if (fd < 0)
      break;
    size_t evtype = 0;
    COMPILE_ASSERT(sizeof(evtype) * 8 >= EV_MAX, evtype_wide_enough);
    if (ioctl(fd, EVIOCGBIT(0, sizeof(evtype)), &evtype) == -1) {
      DLOG(ERROR) << "failed ioctl EVIOCGBIT 0" << path;
      close(fd);
      continue;
    }

    EventConverterOzone* watcher = NULL;
    // TODO(rjkroege) Add more device types. Support hot-plugging.
    if (evtype & (1 << EV_ABS))
      watcher = new TouchEventConverterOzone(fd, id);
    else if (evtype & (1 << EV_KEY))
      watcher = new KeyEventConverterOzone();

    if (watcher) {
      base::MessagePumpLibevent::FileDescriptorWatcher* controller =
          new base::MessagePumpLibevent::FileDescriptorWatcher();
      base::MessagePumpOzone::Current()->WatchFileDescriptor(
          fd, true, base::MessagePumpLibevent::WATCH_READ, controller, watcher);
      evdev_watchers_.push_back(watcher);
      fd_controllers_.push_back(controller);
    } else {
      close(fd);
    }
  }
}

}  // namespace ui


text:
@import KZAsserts;
#import "TWArrayTableViewDataSource.h"
#import "NSMutableArray+TWMoveRow.h"

@interface TWArrayTableViewDataSource ()

@property (strong, nonatomic) NSMutableArray *array;
@property (weak, nonatomic) UITableView *tableView;
@property (strong, nonatomic) NSString *cellDequeueIdentifier;

@end

@implementation TWArrayTableViewDataSource

- (instancetype)initWithArray:(NSArray *)array tableView:(UITableView *)tableView attachToTableView:(BOOL)attachToTableView cellNibName:(NSString *)cellNibName
{
  AssertTrueOrReturnNil(cellNibName);

  if (self = [super init]) {
    [self initializeWithArray:array tableView:tableView attachToTableView:attachToTableView];

    _cellDequeueIdentifier = @"cell";

    UINib *tableViewCellNib = [UINib nibWithNibName:cellNibName bundle:[NSBundle mainBundle]];
    [_tableView registerNib:tableViewCellNib forCellReuseIdentifier:_cellDequeueIdentifier];
  }
  return self;
}

- (instancetype)initWithArray:(NSArray *)array tableView:(UITableView *)tableView attachToTableView:(BOOL)attachToTableView cellDequeueIdentifier:(NSString *)cellDequeueIdentifier
{
  AssertTrueOrReturnNil(cellDequeueIdentifier.length);

  if (self = [super init]) {
    [self initializeWithArray:array tableView:tableView attachToTableView:attachToTableView];
    _cellDequeueIdentifier = cellDequeueIdentifier;
  }
  return self;
}

- (void)initializeWithArray:(NSArray *)array tableView:(UITableView *)tableView attachToTableView:(BOOL)attachToTableView
{
    AssertTrueOrReturn(array);
    AssertTrueOrReturn(tableView);

    _array = [array mutableCopy];
    _tableView = tableView;

    if (attachToTableView) {
        [self attachDataSourceToTableView];
    }
}

- (void)attachDataSourceToTableView {
    _tableView.dataSource = self;
}

- (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath
{
  if (self.configureCellBlock) {
    self.configureCellBlock(cell, indexPath);
  }
}

#pragma mark - UITableViewDataSource

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
  return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
  return self.array.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return [self cellForRowAtIndexPath:indexPath];
}

- (UITableViewCell *)cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:self.cellDequeueIdentifier];
    [self configureCell:cell atIndexPath:indexPath];
    return cell;
}

#pragma mark - deleting objects

- (void)removeObject:(id)object
{
  AssertTrueOrReturn(object);
  AssertTrueOrReturn([self.array containsObject:object]);
  [self.array removeObject:object];
}

- (void)removeObjectAtIndex:(NSUInteger)index
{
  AssertTrueOrReturn(self.array.count > index);
  [self.array removeObjectAtIndex:index];
}

#pragma mark - retrieving objects

- (id)objectAtIndexPath:(NSIndexPath *)indexPath
{
  AssertTrueOrReturnNil(self.array.count > indexPath.row);
  return self.array[indexPath.row];
}

- (NSInteger)objectCount
{
  return self.array.count;
}

- (NSArray *)allSteps
{
  return [self.array copy];
}

- (NSString *)cellDequeueIdentifier
{
  AssertTrueOrReturnNil(_cellDequeueIdentifier.length);
  return _cellDequeueIdentifier;
}

#pragma mark - moving cells

- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
{
  return YES;
}

- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
{
  [self.array moveObjectFromIndexPath:fromIndexPath toIndexPath:toIndexPath];
}

@end


text:
console.log('----------------------------------------');
console.log('Task 5 output: Third bit value ');
console.log('----------------------------------------');

function checkThirdBit(num) {
    return (num >> 3) & 1;
}

console.log("5: " + checkThirdBit(5));
console.log("8: " + checkThirdBit(8));
console.log("0: " + checkThirdBit(0));
console.log("15: " + checkThirdBit(15));
console.log("5343: " + checkThirdBit(5343));
console.log("62241: " + checkThirdBit(62241));


text: - patched critical issue when omdb info isn't found


text:
package skinny.mailer

import com.typesafe.config.Config

/**
  * Configuration for SkinnyMailer.
  */
trait SkinnyMailerConfigApi extends SkinnyMailerConfigBase {

  def toCaseClass: SkinnyMailerConfig = SkinnyMailerConfig(
    debug = this.debug,
    mimeVersion = this.mimeVersion,
    charset = this.charset,
    contentType = this.contentType,
    defaultFrom = this.defaultFrom,
    transportProtocol = this.transportProtocol,
    smtp = this.smtp.toCaseClass
  )

  /**
    * Debug mode if true.
    */
  def debug: Boolean = loadedConfig.flatMap(c => opt(c.getBoolean("debug"))).getOrElse(false)

  /**
    * MIME version.
    */
  def mimeVersion: String = loadedConfig.flatMap(c => opt(c.getString("mimeVersion"))).getOrElse("1.0")

  /**
    * Charset.
    */
  def charset: String = loadedConfig.flatMap(c => opt(c.getString("charset"))).getOrElse("UTF-8")

  /**
    * Content-Type header (default: text/plain)
    */
  def contentType: String = loadedConfig.flatMap(c => opt(c.getString("contentType"))).getOrElse("text/plain")

  /**
    * From header default value.
    */
  def defaultFrom: Option[String] = loadedConfig.flatMap(c => opt(c.getString("from")))

  /**
    * Transport protocol.
    */
  def transportProtocol: String =
    loadedConfig.flatMap(c => opt(c.getString("transport.protocol"))).getOrElse("logging")

  // refs self
  private val self: SkinnyMailerConfigApi = this

  /**
    * SMTP configuration.
    */
  val smtp: SkinnyMailerSmtpConfigApi = new SkinnyMailerSmtpConfigApi {
    override def name: String                      = self.name
    override def skinnyEnv: String                 = self.skinnyEnv
    override lazy val loadedConfig: Option[Config] = self.loadedConfig
  }

}


text:
const jestConfig = require('../jest');

it('exports a valid config', () => {
  expect(jestConfig).toBeTruthy();
});


text:
package org.apache.tez.dag.app.rm;

import org.apache.tez.dag.app.dag.TaskAttempt;
import org.apache.tez.serviceplugins.api.TaskScheduler.SchedulerTaskState;

public class AMSchedulerEventTAStateUpdated extends AMSchedulerEvent {

  private final TaskAttempt taskAttempt;
  private final SchedulerTaskState state;

  public AMSchedulerEventTAStateUpdated(TaskAttempt taskAttempt, SchedulerTaskState state,
                                        int schedulerId) {
    super(AMSchedulerEventType.S_TA_STATE_UPDATED, schedulerId);
    this.taskAttempt = taskAttempt;
    this.state = state;
  }

  public TaskAttempt getTaskAttempt() {
    return taskAttempt;
  }

  public SchedulerTaskState getState() {
    return state;
  }
}


text:
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using Org.Apache.REEF.Common.Tasks;
using Org.Apache.REEF.Driver;
using Org.Apache.REEF.Driver.Context;
using Org.Apache.REEF.Driver.Evaluator;
using Org.Apache.REEF.Network.Group.Config;
using Org.Apache.REEF.Network.Group.Driver;
using Org.Apache.REEF.Network.Group.Driver.Impl;
using Org.Apache.REEF.Network.Group.Operators;
using Org.Apache.REEF.Network.Group.Pipelining.Impl;
using Org.Apache.REEF.Network.Group.Topology;
using Org.Apache.REEF.Tang.Annotations;
using Org.Apache.REEF.Tang.Implementations.Configuration;
using Org.Apache.REEF.Tang.Implementations.Tang;
using Org.Apache.REEF.Tang.Interface;
using Org.Apache.REEF.Tang.Util;
using Org.Apache.REEF.Utilities.Logging;
using Org.Apache.REEF.Wake.Remote.Parameters;
using Org.Apache.REEF.Wake.StreamingCodec.CommonStreamingCodecs;

namespace Org.Apache.REEF.Network.Examples.GroupCommunication.BroadcastReduceDriverAndTasks
{
    public class BroadcastReduceDriver :
        IObserver<IAllocatedEvaluator>,
        IObserver<IActiveContext>,
        IObserver<IFailedEvaluator>,
        IObserver<IDriverStarted>
    {
        private static readonly Logger LOGGER = Logger.GetLogger(typeof(BroadcastReduceDriver));

        private readonly int _numEvaluators;
        private readonly int _numIterations;

        private readonly IGroupCommDriver _groupCommDriver;
        private readonly ICommunicationGroupDriver _commGroup;
        private readonly TaskStarter _groupCommTaskStarter;
        private readonly IConfiguration _tcpPortProviderConfig;
        private readonly IConfiguration _codecConfig;
        private readonly IEvaluatorRequestor _evaluatorRequestor;

        [Inject]
        public BroadcastReduceDriver(
            [Parameter(typeof(GroupTestConfig.NumEvaluators))] int numEvaluators,
            [Parameter(typeof(GroupTestConfig.NumIterations))] int numIterations,
            [Parameter(typeof(GroupTestConfig.StartingPort))] int startingPort,
            [Parameter(typeof(GroupTestConfig.PortRange))] int portRange,
            GroupCommDriver groupCommDriver,
            IEvaluatorRequestor evaluatorRequestor)
        {
            _numEvaluators = numEvaluators;
            _numIterations = numIterations;
            _groupCommDriver = groupCommDriver;
            _evaluatorRequestor = evaluatorRequestor;

            _tcpPortProviderConfig = TangFactory.GetTang().NewConfigurationBuilder()
                .BindNamedParameter<TcpPortRangeStart, int>(GenericType<TcpPortRangeStart>.Class,
                    startingPort.ToString(CultureInfo.InvariantCulture))
                .BindNamedParameter<TcpPortRangeCount, int>(GenericType<TcpPortRangeCount>.Class,
                    portRange.ToString(CultureInfo.InvariantCulture))
                .Build();

            _codecConfig = StreamingCodecConfiguration<int>.Conf
                .Set(StreamingCodecConfiguration<int>.Codec, GenericType<IntStreamingCodec>.Class)
                .Build();

            IConfiguration reduceFunctionConfig = ReduceFunctionConfiguration<int>.Conf
                .Set(ReduceFunctionConfiguration<int>.ReduceFunction, GenericType<SumFunction>.Class)
                .Build();

            IConfiguration dataConverterConfig = PipelineDataConverterConfiguration<int>.Conf
                .Set(PipelineDataConverterConfiguration<int>.DataConverter, GenericType<DefaultPipelineDataConverter<int>>.Class)
                .Build();

            _commGroup = _groupCommDriver.DefaultGroup
                    .AddBroadcast<int>(
                        GroupTestConstants.BroadcastOperatorName,
                        GroupTestConstants.MasterTaskId,
                        TopologyTypes.Tree,
                        dataConverterConfig)
                    .AddReduce<int>(
                        GroupTestConstants.ReduceOperatorName,
                        GroupTestConstants.MasterTaskId,
                        TopologyTypes.Tree,
                        reduceFunctionConfig,
                        dataConverterConfig)
                    .Build();

            _groupCommTaskStarter = new TaskStarter(_groupCommDriver, numEvaluators);
        }

        public void OnNext(IAllocatedEvaluator allocatedEvaluator)
        {
            IConfiguration contextConf = _groupCommDriver.GetContextConfiguration();
            IConfiguration serviceConf = _groupCommDriver.GetServiceConfiguration();
            serviceConf = Configurations.Merge(serviceConf, _tcpPortProviderConfig, _codecConfig);
            allocatedEvaluator.SubmitContextAndService(contextConf, serviceConf);
        }

        public void OnNext(IActiveContext activeContext)
        {
            IConfiguration serviceConfig = _groupCommDriver.GetServiceConfiguration();

            if (_groupCommDriver.IsMasterTaskContext(activeContext))
            {
                // Configure Master Task
                IConfiguration partialTaskConf = TangFactory.GetTang().NewConfigurationBuilder(
                    TaskConfiguration.ConfigurationModule
                        .Set(TaskConfiguration.Identifier, GroupTestConstants.MasterTaskId)
                        .Set(TaskConfiguration.Task, GenericType<MasterTask>.Class)
                        .Build())
                    .BindNamedParameter<GroupTestConfig.NumEvaluators, int>(
                        GenericType<GroupTestConfig.NumEvaluators>.Class,
                        _numEvaluators.ToString(CultureInfo.InvariantCulture))
                    .BindNamedParameter<GroupTestConfig.NumIterations, int>(
                        GenericType<GroupTestConfig.NumIterations>.Class,
                        _numIterations.ToString(CultureInfo.InvariantCulture))
                    .Build();

                _commGroup.AddTask(GroupTestConstants.MasterTaskId);
                _groupCommTaskStarter.QueueTask(partialTaskConf, activeContext);
            }
            else
            {
                // Configure Slave Task
                string slaveTaskId = "SlaveTask-" + activeContext.Id;
                IConfiguration partialTaskConf = TangFactory.GetTang().NewConfigurationBuilder(
                    TaskConfiguration.ConfigurationModule
                        .Set(TaskConfiguration.Identifier, slaveTaskId)
                        .Set(TaskConfiguration.Task, GenericType<SlaveTask>.Class)
                        .Build())
                    .BindNamedParameter<GroupTestConfig.NumEvaluators, int>(
                        GenericType<GroupTestConfig.NumEvaluators>.Class,
                        _numEvaluators.ToString(CultureInfo.InvariantCulture))
                    .BindNamedParameter<GroupTestConfig.NumIterations, int>(
                        GenericType<GroupTestConfig.NumIterations>.Class,
                        _numIterations.ToString(CultureInfo.InvariantCulture))
                    .Build();

                _commGroup.AddTask(slaveTaskId);
                _groupCommTaskStarter.QueueTask(partialTaskConf, activeContext);
            }
        }

        public void OnNext(IFailedEvaluator value)
        {
        }

        public void OnNext(IDriverStarted value)
        {
            var request =
                _evaluatorRequestor.NewBuilder()
                    .SetNumber(_numEvaluators)
                    .SetMegabytes(512)
                    .SetCores(2)
                    .SetRackName("WonderlandRack")
                    .SetEvaluatorBatchId("BroadcastEvaluator")
                    .Build();
            _evaluatorRequestor.Submit(request);
        }

        public void OnError(Exception error)
        {
            throw error;
        }

        public void OnCompleted()
        {
        }

        private class SumFunction : IReduceFunction<int>
        {
            [Inject]
            public SumFunction()
            {
            }

            public int Reduce(IEnumerable<int> elements)
            {
                return elements.Sum();
            }
        }
    }
}


text:
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.chrome.browser.customtabs;

import android.content.Context;
import android.support.test.filters.SmallTest;
import android.test.InstrumentationTestCase;
import android.test.UiThreadTest;

/** Tests for RequestThrottler.
 *
 * Note: tests are @UiThreadTest because RequestThrottler is not thread-safe.
 */
public class RequestThrottlerTest extends InstrumentationTestCase {
    private static final int UID = 1234;
    private static final int UID2 = 12345;
    private static final String URL = "https://www.google.com";
    private static final String URL2 = "https://www.chromium.org";

    private Context mContext;

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        mContext = getInstrumentation().getTargetContext();
        RequestThrottler.purgeAllEntriesForTesting(mContext);
    }

    @Override
    protected void tearDown() throws Exception {
        super.tearDown();
        RequestThrottler.purgeAllEntriesForTesting(mContext);
    }

    /** Tests that a client starts not banned. */
    @SmallTest
    @UiThreadTest
    public void testIsInitiallyNotBanned() {
        assertTrue(RequestThrottler.getForUid(mContext, UID).isPrerenderingAllowed());
    }

    /** Tests that a misbehaving client gets banned. */
    @SmallTest
    @UiThreadTest
    public void testBansUid() {
        RequestThrottler throttler = RequestThrottler.getForUid(mContext, UID);
        assertTrue(throttler.isPrerenderingAllowed());
        for (int i = 0; i < 100; i++) throttler.registerPrerenderRequest(URL);
        assertFalse(throttler.isPrerenderingAllowed());
    }

    /** Tests that the URL needs to match to avoid getting banned. */
    @SmallTest
    @UiThreadTest
    public void testBanningMatchesUrls() {
        RequestThrottler throttler = RequestThrottler.getForUid(mContext, UID);
        assertTrue(throttler.isPrerenderingAllowed());
        for (int i = 0; i < 100; i++) {
            throttler.registerPrerenderRequest(URL);
            throttler.registerPrerenderRequest(URL);
            throttler.registerSuccess(URL2);
        }
        assertFalse(throttler.isPrerenderingAllowed());
    }

    /** Tests that a client can send a lot of requests, as long as they are matched by successes. */
    @SmallTest
    @UiThreadTest
    public void testDontBanAccurateClients() {
        RequestThrottler throttler = RequestThrottler.getForUid(mContext, UID);
        assertTrue(throttler.isPrerenderingAllowed());
        for (int i = 0; i < 100; i++) {
            throttler.registerPrerenderRequest(URL);
            throttler.registerSuccess(URL);
        }
        assertTrue(throttler.isPrerenderingAllowed());
    }

    /** Tests that partially accurate clients are not banned. */
    @SmallTest
    @UiThreadTest
    public void testDontBanPartiallyAccurateClients() {
        RequestThrottler throttler = RequestThrottler.getForUid(mContext, UID);
        assertTrue(throttler.isPrerenderingAllowed());
        for (int j = 0; j < 10; j++) {
            throttler.registerPrerenderRequest(URL);
            throttler.registerPrerenderRequest(URL);
            throttler.registerSuccess(URL2);
            throttler.registerSuccess(URL);
            assertTrue(throttler.isPrerenderingAllowed());
        }
    }

    /** Tests that banning a UID doesn't ban another one. */
    @SmallTest
    @UiThreadTest
    public void testThrottlingBanIsByUid() {
        RequestThrottler throttler = RequestThrottler.getForUid(mContext, UID);
        assertTrue(throttler.isPrerenderingAllowed());
        for (int i = 0; i < 100; i++) throttler.registerPrerenderRequest(URL);
        assertFalse(throttler.isPrerenderingAllowed());
        assertTrue(RequestThrottler.getForUid(mContext, UID2).isPrerenderingAllowed());
    }
}


text:
ARIA state and property values must be valid.

## Rule Details

Examples of **incorrect** code for this rule:

```js
html` <span aria-hidden="yes">foo</span> `;
```

Examples of **correct** code for this rule:

```js
html` <span aria-hidden="true">foo</span> `;
```

## Further Reading

- [WCAG 4.1.2](https://www.w3.org/WAI/WCAG21/Understanding/name-role-value)
- [ARIA Spec, States and Properties](https://www.w3.org/TR/wai-aria/#states_and_properties)
- [Chrome Audit Rules, AX_ARIA_04](https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_04)


text:
So you've graduated from The Iron Yard and you're looking to connect with other graduates out in the wide world of developers.  The Forge is your place.  You can come here to view the directory of TIY graduates in your area.  Your campus director has already set up your account, go ahead an edit your profile and start connecting with fellow Alumni.

### Version
This app was created in Ruby version 2.2.2 with Rails 4.2.1

### System dependencies

* PostgreSQL
* Rails 12 Factor
* Devise
* Paperclip
* AWS-SDK
* Bootstrap
* [American Date](https://github.com/jeremyevans/ruby-american_date)
* MailGun
* AutoHTML
* Magnific-Popup-Rails

(Here's a link to the database structure in an [ERD](https://www.lucidchart.com/invitations/accept/cb495000-71f1-48af-81f5-3f7e0bf90b38))


text:
package ln

type Ray struct {
	Origin, Direction Vector
}

func (r Ray) Position(t float64) Vector {
	return r.Origin.Add(r.Direction.MulScalar(t))
}


text:
package org.diirt.service.pva.rpcservice;

import org.diirt.service.Service;

/**
 * A pvmanager rpcservice for calling pvAccess RPC services.
 *
 * @author dkumar
 */
public class RPCService extends Service {

  private final RPCServiceDescription rpcServiceDescription;

  /**
   * Creates a new PVA RPC rpcservice from the given rpcservice description.
   *
   * @param serviceDescription
   */
  public RPCService(RPCServiceDescription serviceDescription) {
    super(serviceDescription.createServiceDescription());
    this.rpcServiceDescription = serviceDescription;
  }

  /**
   * Get RPC rpcservice description
   * @return RPCServiceDescription
   */
  public RPCServiceDescription getRPCServiceDescription() {
    return this.rpcServiceDescription;
  }
}


text:
import six
import sys
import socket
import logging
import multiprocessing

import bucky.cfg as cfg

try:
    from setproctitle import setproctitle
except ImportError:
    def setproctitle(title):
        pass

log = logging.getLogger(__name__)

class UDPServer(multiprocessing.Process):
    def __init__(self, ip, port):
        super(UDPServer, self).__init__()
        self.daemon = True
        addrinfo = socket.getaddrinfo(ip, port, socket.AF_UNSPEC, socket.SOCK_DGRAM)
        af, socktype, proto, canonname, addr = addrinfo[0]
        ip, port = addr[:2]
        self.ip = ip
        self.port = port
        self.sock = socket.socket(af, socket.SOCK_DGRAM)
        self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
        try:
            self.sock.bind((ip, port))
            log.info("Bound socket socket %s:%s", ip, port)
        except Exception:
            log.exception("Error binding socket %s:%s.", ip, port)
            sys.exit(1)

        self.sock_recvfrom = self.sock.recvfrom
        if cfg.debug:
            # When in debug mode replace the send and recvfrom functions to include
            # debug logging. In production mode these calls have quite a lot of overhead
            # for statements that will never do anything.
            import functools

            def debugsend(f):
                @functools.wraps(f)
                def wrapper(*args, **kwargs):
                    log.debug("Sending UDP packet to %s:%s", self.ip, self.port)
                    return f(*args, **kwargs)
                return wrapper
            self.send = debugsend(self.send)

            def debugrecvfrom(*args, **kwargs):
                data, addr = self.sock.recvfrom(65535)
                log.debug("Received UDP packet from %s:%s" % addr)
                return data, addr
            self.sock_recvfrom = debugrecvfrom

    def run(self):
        setproctitle("bucky: %s" % self.__class__.__name__)
        recvfrom = self.sock_recvfrom
        while True:
            try:
                data, addr = recvfrom(65535)
            except (IOError, KeyboardInterrupt):
                continue
            addr = addr[:2]  # for compatibility with longer ipv6 tuples
            if data == b'EXIT':
                break
            if not self.handle(data, addr):
                break
        try:
            self.pre_shutdown()
        except Exception:
            log.exception("Failed pre_shutdown method for %s",
                          self.__class__.__name__)

    def handle(self, data, addr):
        raise NotImplementedError()

    def pre_shutdown(self):
        """ Pre shutdown hook """
        pass

    def close(self):
        self.send('EXIT')

    if six.PY3:
        def send(self, data):
            sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
            if not isinstance(data, bytes):
                data = data.encode()
            sock.sendto(data, 0, (self.ip, self.port))
    else:
        def send(self, data):
            sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
            sock.sendto(data, 0, (self.ip, self.port))


text:
package model.job;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import model.job.result.ResultType;
import model.request.PiazzaJobRequest;
import model.status.StatusUpdate;

import org.joda.time.DateTime;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Defines a Job in the Piazza system.
 *
 * A Job is uniquely identified by a Job Id. This is the primary key used for lookup in the Jobs collection.
 *
 * Additional Metadata is also stored with a job, such as who submitted the job, what their API key is, and when the Job
 * was submitted.
 *
 * Job Status and Progress are also tracked and can be reliably used to determine what the current status of the job is
 * as it passes throughout the Piazza system.
 *
 * @author Patrick.Doody
 *
 */
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class Job implements Serializable {
	private static final long serialVersionUID = 1L;

	private String jobId;
	private PiazzaJobType jobType;
	@JsonIgnore
	private DateTime createdOn;
	private String createdBy;
	private String status;
	private JobProgress progress = new JobProgress();
	private List<JobProgress> history = new ArrayList<>();
	private ResultType result;

	public Job() {
		// Empty constructor required by Jackson
	}

	public Job(PiazzaJobRequest request, String jobId) {
		this.jobId = jobId;
		this.jobType = request.jobType;
		this.createdBy = request.createdBy;
		this.status = StatusUpdate.STATUS_SUBMITTED;
		this.createdOn = new DateTime();
	}

	public String getJobId() {
		return jobId;
	}

	public void setJobId(String jobId) {
		this.jobId = jobId;
	}

	@JsonProperty("createdOn")
	public String getCreatedOnString() {
		if (createdOn != null) {
			// Defaults to ISO8601
			return createdOn.toString();
		} else {
			return null;
		}
	}

	@JsonProperty("createdOn")
	public void setCreatedOnString(String createdOn) {
		if (createdOn != null) {
			this.createdOn = new DateTime(createdOn);
		} else {
			this.createdOn = null;
		}
	}

	public PiazzaJobType getJobType() {
		return jobType;
	}

	public ResultType getResult() {
		return result;
	}

	public String getCreatedBy() {
		return createdBy;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public JobProgress getProgress() {
		return progress;
	}

	public void setProgress(JobProgress progress) {
		this.progress = progress;
	}

	public void setJobType(PiazzaJobType jobType) {
		this.jobType = jobType;
	}

	public void setResult(ResultType result) {
		this.result = result;
	}

	public List<JobProgress> getHistory() {
		return history;
	}

	public void setHistory(List<JobProgress> history) {
		this.history = history;
	}
}


text:
from __future__ import print_function

def register_processor(num):
    def inner(func):
        processors[num] = func
        return func
    return inner
processors = {}

@register_processor(3)
def process_msg3(fname):
    with open(fname, 'r') as infile:
        info = []
        for lineno, line in enumerate(infile):
            parts = line.split('  ')
            try:
                var_name, desc, typ, units = parts[:4]
                size_hw = parts[-1]
                if '-' in size_hw:
                    start, end = map(int, size_hw.split('-'))
                    size = (end - start + 1) * 2
                else:
                    size = 2

                assert size >= 2
                fmt = fix_type(typ, size)

                var_name = fix_var_name(var_name)
                full_desc = fix_desc(desc, units)

                info.append({'name': var_name, 'desc': full_desc, 'fmt': fmt})

                if ignored_item(info[-1]) and var_name != 'Spare':
                    print('WARNING: %s has type %s. Setting as Spare' %
                          (var_name, typ))

            except (ValueError, AssertionError):
                print('%d > %s' % (lineno + 1, ':'.join(parts)))
                raise
        return info

@register_processor(18)
def process_msg18(fname):
    with open(fname, 'r') as infile:
        info = []
        for lineno, line in enumerate(infile):
            parts = line.split('  ')
            try:
                if len(parts) == 8:
                    parts = parts[:6] + [parts[6] + parts[7]]

                var_name, desc, typ, units, rng, prec, byte_range = parts
                start, end = map(int, byte_range.split('-'))
                size = end - start + 1
                assert size >= 4
                fmt = fix_type(typ, size,
                               additional=[('See Note (5)', ('{size}s', 1172))])

                if ' ' in var_name:
                    print('WARNING: space in %s' % var_name)
                if not desc:
                    print('WARNING: null description for %s' % var_name)

                var_name = fix_var_name(var_name)
                full_desc = fix_desc(desc, units)

                info.append({'name': var_name, 'desc': full_desc, 'fmt': fmt})

                if (ignored_item(info[-1]) and var_name != 'SPARE' and
                        'SPARE' not in full_desc):
                    print('WARNING: %s has type %s. Setting as SPARE' % (var_name, typ))

            except (ValueError, AssertionError):
                print('%d > %s' % (lineno + 1, ':'.join(parts)))
                raise
        return info

types = [('Real*4', ('f', 4)), ('Integer*4', ('L', 4)), ('SInteger*4', ('l', 4)),
         ('Integer*2', ('H', 2)),
         ('', lambda s: ('{size}x', s)), ('N/A', lambda s: ('{size}x', s)),
         (lambda t: t.startswith('String'), lambda s: ('{size}s', s))]

def fix_type(typ, size, additional=None):
    if additional is not None:
        myTypes = types + additional
    else:
        myTypes = types

    for t, info in myTypes:
        if callable(t):
            matches = t(typ)
        else:
            matches = t == typ

        if matches:
            if callable(info):
                fmtStr, trueSize = info(size)
            else:
                fmtStr, trueSize = info
            assert size == trueSize, ('Got size %d instead of %d for %s'
                                      % (size, trueSize, typ))
            return fmtStr.format(size=size)
    else:
        raise ValueError('No type match! (%s)' % typ)

def fix_var_name(var_name):
    name = var_name.strip()
    for char in '(). /#,':
        name = name.replace(char, '_')
    name = name.replace('+', 'pos_')
    name = name.replace('-', 'neg_')
    if name.endswith('_'):
        name = name[:-1]
    return name

def fix_desc(desc, units=None):
    full_desc = desc.strip()
    if units and units != 'N/A':
        if full_desc:
            full_desc += ' (' + units + ')'
        else:
            full_desc = units
    return full_desc

def ignored_item(item):
    return item['name'].upper() == 'SPARE' or 'x' in item['fmt']

def need_desc(item):
    return item['desc'] and not ignored_item(item)

def field_name(item):
    return '"%s"' % item['name'] if not ignored_item(item) else None

def field_fmt(item):
    return '"%s"' % item['fmt'] if '"' not in item['fmt'] else item['fmt']

def write_file(fname, info):
    with open(fname, 'w') as outfile:
        # File header
        outfile.write('# Copyright (c) 2008-2015 MetPy Developers.\n')
        outfile.write('# Distributed under the terms of the BSD 3-Clause License.\n')
        outfile.write('# SPDX-License-Identifier: BSD-3-Clause\n\n')
        outfile.write('# flake8: noqa\n')
        outfile.write('# Generated file -- do not modify\n')

        # Variable descriptions
        outfile.write('descriptions = {')
        outdata = ',\n                '.join('"{name}": "{desc}"'.format(
            **i) for i in info if need_desc(i))
        outfile.write(outdata)
        outfile.write('}\n\n')

        # Now the struct format
        outfile.write('fields = [')
        outdata = ',\n          '.join('({fname}, "{fmt}")'.format(
            fname=field_name(i), **i) for i in info)
        outfile.write(outdata)
        outfile.write(']\n')

if __name__ == '__main__':
    import os.path

    for num in [18, 3]:
        fname = 'msg%d.spec' % num
        print('Processing {}...'.format(fname))
        info = processors[num](fname)
        fname = os.path.splitext(fname)[0] + '.py'
        write_file(fname, info)


text:
import fs = require('fs');
import env = require('vs/base/common/platform');

let defaultTerminalLinux = 'xterm';
if (env.isLinux) {
	if (fs.existsSync('/etc/debian_version')) {
		defaultTerminalLinux = 'x-terminal-emulator';
	} else if (process.env.DESKTOP_SESSION === 'gnome' || process.env.DESKTOP_SESSION === 'gnome-classic') {
		defaultTerminalLinux = 'gnome-terminal';
	} else if (process.env.COLORTERM) {
		defaultTerminalLinux = process.env.COLORTERM;
	} else if (process.env.TERM) {
		defaultTerminalLinux = process.env.TERM;
	}
}

export const DEFAULT_TERMINAL_LINUX = defaultTerminalLinux;

export const DEFAULT_TERMINAL_OSX = 'Terminal.app';

export const DEFAULT_TERMINAL_WINDOWS = 'cmd';

export interface ITerminalConfiguration {
	terminal: {
		external: {
			linuxExec: string,
			osxExec: string,
			windowsExec: string
		}
	};
}


text:
using PetClinic.Data.DomainObjects.Enums;
using PetClinic.Data.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PetClinic.Data.Service
{
    public interface IPetClinicService
    {

        OwnerViewModel GetOwnerById(int id);

        OwnerDetailsViewModel GetOwnerDetailsById(int id);

        IEnumerable<OwnerViewModel> GetOwners();

        PetViewModel GetPetById(int id);

        IEnumerable<PetViewModel> GetPets();
        IEnumerable<PetViewModel> GetPetsFiltered(int ownerId, int typeId);

        ExaminationViewModel GetExaminationById(int id);
        IEnumerable<ExaminationViewModel> GetExaminations();
        IEnumerable<ExaminationViewModel> GetExaminationsByDate(DateTime date);

        int EditExamination(int id, string diagnosis, bool isSick);

        int CreateOwner(string name);

        int EditOwner(int id, string name);

        int CreatePet(string name, int ownerId);

        int CreateCat(string name, int ownerId, string breed, int age, int genderType, int numberOfHoursSpentSleeping, string favouriteFood);
        int CreateDog(string name, int ownerId, string breed, int age, int genderType, string favouriteFood, string favouriteGame, bool isAggressive);
        int CreateBird(string name, int ownerId, string breed, int age, int genderType, int? partnerId);

    }
}


text:
package com.component.socket.server;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.UnknownHostException;

import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;

/**
 * An end-to-end testing class that connects to the server and executes simple commands.
 *
 * @author Colin Lam
 */
public class SSLSocketListenerClient {

    public static void main(String[] args) throws IOException {

        /*
         * What is myCliTruststore?
         * Good question. myCliTrustStore is Sun's implementation of the "keystore" concept. See
         * http://docs.oracle.com/javase/1.4.2/docs/guide/security/jsse/JSSERefGuide.html#Stores
         * for more information.
         *
         * Brief summary:
         * myCliTruststore holds the public certificate to this server's SSL certificate. As such,
         * it should be widely distributed. In fact, if this client doesn't have access to this
         * truststore, it will not allow connections to the server. This is because the truststore,
         * as its name implies, dicates what certificates should be trusted. The private key is
         * packed as part of "SSLSocketListner", in mySrvKeystore. Go check that out for more info.
         *
         */
        System.setProperty("javax.net.ssl.trustStore", "C:\\Users\\Colin\\STS Workspace\\TaxiAppServer\\resource\\mySrvKeystore");

        SSLSocket sslSocket = null;
        PrintWriter out = null;
        BufferedReader in = null;

        try {
            SSLSocketFactory sslSocketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
            sslSocket = (SSLSocket) sslSocketFactory.createSocket("qcnet.no-ip.info", 18366);
            out = new PrintWriter(sslSocket.getOutputStream(), true);
            in = new BufferedReader(new InputStreamReader(sslSocket.getInputStream()));
        } catch (UnknownHostException e) {
            System.err.println("Don't know about host: localhost.");
            System.exit(1);
        } catch (IOException e) {
            System.err.println("Couldn't get I/O for the connection to: localhost.");
            System.exit(1);
        }

        BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
        String fromServer;
        String fromUser;

        fromUser = stdIn.readLine();
        out.println(fromUser);

        while ((fromServer = in.readLine()) != null) {
            System.out.println(fromServer);

            fromUser = stdIn.readLine();
            out.println(fromUser);
        }

        out.close();
        in.close();
        stdIn.close();
        sslSocket.close();
    }
}


text:
#ifndef RUN_GEMM_KERNEL_TEST_HPP
#define RUN_GEMM_KERNEL_TEST_HPP

#include "GEMMKernelTest.hpp"
#include <gtest/gtest.h>

/* Generates the specific test parameters
 * that will be used in the GEMM gtests.
 * Uses testing components as specified
 * in the GEMMKernelTest interface.
 */
template <typename DeviceBackend>
struct RunGEMMKernelTestParams
{
    // The interface we are creating input params for
    using TestInterface = GEMMKernelTest<DeviceBackend>;

    // Extract test interface components
    using ContractionProblem  = typename TestInterface::ContractionProblem;
    using ContractionSolution = typename TestInterface::ContractionSolution;
    using MemoryPageAlignment = typename TestInterface::MemoryPageAlignment;
    using SolutionAdapter     = typename TestInterface::SolutionAdapter;
    using SolutionLibrary     = typename TestInterface::SolutionLibrary;

    // Test input params
    using ProblemParams  = typename TestInterface::ProblemParams;
    using SolutionParams = typename TestInterface::SolutionParams;

    // Runtime input generation
    static std::vector<std::shared_ptr<TestInterface>> TypedTests();
    static std::vector<ProblemParams>                  TestProblems();
    static std::vector<ProblemParams>                  TestProblemsExtended();
    static std::vector<SolutionParams>                 TestLibraries();
    static std::vector<MemoryPageAlignment>            TestMemoryAlignments();

private:
    static std::vector<SolutionParams> TestLibraries_Impl();
};

/* Testing harness:
*  This ensures each test receives each
*  combination of inputs.
*  Tests for different backends can
*  be defined in each their own backend
*  ecosystems.
*  See hip/RunGEMMKernel_test.cpp or
*  ocl/RunGEMMKernel_test.cpp
*/
template <typename DeviceBackend>
struct RunGEMMKernelTest
    : public ::testing::TestWithParam<
          std::tuple<std::shared_ptr<GEMMKernelTest<DeviceBackend>>,
                     typename GEMMKernelTest<DeviceBackend>::ProblemParams,
                     typename GEMMKernelTest<DeviceBackend>::SolutionParams,
                     typename GEMMKernelTest<DeviceBackend>::MemoryPageAlignment>>
{
    using Base = ::testing::TestWithParam<
        std::tuple<std::shared_ptr<GEMMKernelTest<DeviceBackend>>,
                   typename GEMMKernelTest<DeviceBackend>::ProblemParams,
                   typename GEMMKernelTest<DeviceBackend>::SolutionParams,
                   typename GEMMKernelTest<DeviceBackend>::MemoryPageAlignment>>;
    void SetUp() override;
    void TearDown() override;
};

#include "RunGEMMKernelTest_impl.hpp"

#endif // RUN_GEMM_KERNEL_TEST_HPP


text:
/**
 * @module ol/reproj/common
 */

/**
 * Default maximum allowed threshold  (in pixels) for reprojection
 * triangulation.
 * @type {number}
 */
export var ERROR_THRESHOLD = 0.5;

/**
 * Enable automatic reprojection of raster sources. Default is `true`.
 * TODO: decide if we want to expose this as a build flag or remove it
 * @type {boolean}
 */
export var ENABLE_RASTER_REPROJECTION = true;

//# sourceMappingURL=common.js.map


text:
\documentclass[parskip=half, twocolumn, 13pt]{scrartcl}
\renewcommand*{\familydefault}{\ttdefault}
\usepackage{fontmfizz}

\begin{document}
\section*{fontmfizz}
\mfThreedprint \quad \char`\\mfThreedprint \\
\mfAlpinelinux \quad \char`\\mfAlpinelinux \\
\mfAngular \quad \char`\\mfAngular \\
\mfAngularAlt \quad \char`\\mfAngularAlt \\
\mfAntenna \quad \char`\\mfAntenna \\
\mfApache \quad \char`\\mfApache \\
\mfArchlinux \quad \char`\\mfArchlinux \\
\mfAws \quad \char`\\mfAws \\
\mfAzure \quad \char`\\mfAzure \\
\mfBackbone \quad \char`\\mfBackbone \\
\mfBlackberry \quad \char`\\mfBlackberry \\
\mfBomb \quad \char`\\mfBomb \\
\mfBootstrap \quad \char`\\mfBootstrap \\
\mfC \quad \char`\\mfC \\
\mfCassandra \quad \char`\\mfCassandra \\
\mfCentos \quad \char`\\mfCentos \\
\mfClojure \quad \char`\\mfClojure \\
\mfCodeigniter \quad \char`\\mfCodeigniter \\
\mfCodepen \quad \char`\\mfCodepen \\
\mfCoffeeBean \quad \char`\\mfCoffeeBean \\
\mfCplusplus \quad \char`\\mfCplusplus \\
\mfCsharp \quad \char`\\mfCsharp \\
\mfCss \quad \char`\\mfCss \\
\mfCssthree \quad \char`\\mfCssthree \\
\mfCssthreeAlt \quad \char`\\mfCssthreeAlt \\
\mfDthree \quad \char`\\mfDthree \\
\mfDatabase \quad \char`\\mfDatabase \\
\mfDatabaseAlt \quad \char`\\mfDatabaseAlt \\
\mfDatabaseAlttwo \quad \char`\\mfDatabaseAlttwo \\
\mfDebian \quad \char`\\mfDebian \\
\mfDocker \quad \char`\\mfDocker \\
\mfDreamhost \quad \char`\\mfDreamhost \\
\mfElixir \quad \char`\\mfElixir \\
\mfElm \quad \char`\\mfElm \\
\mfErlang \quad \char`\\mfErlang \\
\mfExherbo \quad \char`\\mfExherbo \\
\mfFedora \quad \char`\\mfFedora \\
\mfFireAlt \quad \char`\\mfFireAlt \\
\mfFreebsd \quad \char`\\mfFreebsd \\
\mfFreecodecamp \quad \char`\\mfFreecodecamp \\
\mfGentoo \quad \char`\\mfGentoo \\
\mfGhost \quad \char`\\mfGhost \\
\mfGit \quad \char`\\mfGit \\
\mfGnome \quad \char`\\mfGnome \\
\mfGo \quad \char`\\mfGo \\
\mfGoAlt \quad \char`\\mfGoAlt \\
\mfGoogle \quad \char`\\mfGoogle \\
\mfGoogleAlt \quad \char`\\mfGoogleAlt \\
\mfGoogleCode \quad \char`\\mfGoogleCode \\
\mfGoogleDevelopers \quad \char`\\mfGoogleDevelopers \\
\mfGradle \quad \char`\\mfGradle \\
\mfGrails \quad \char`\\mfGrails \\
\mfGrailsAlt \quad \char`\\mfGrailsAlt \\
\mfGrunt \quad \char`\\mfGrunt \\
\mfGulp \quad \char`\\mfGulp \\
\mfGulpAlt \quad \char`\\mfGulpAlt \\
\mfHadoop \quad \char`\\mfHadoop \\
\mfHaskell \quad \char`\\mfHaskell \\
\mfHeroku \quad \char`\\mfHeroku \\
\mfHtml \quad \char`\\mfHtml \\
\mfHtmlfive \quad \char`\\mfHtmlfive \\
\mfHtmlfiveAlt \quad \char`\\mfHtmlfiveAlt \\
\mfIphone \quad \char`\\mfIphone \\
\mfJava \quad \char`\\mfJava \\
\mfJavaBold \quad \char`\\mfJavaBold \\
\mfJavaDuke \quad \char`\\mfJavaDuke \\
\mfJavascript \quad \char`\\mfJavascript \\
\mfJavascriptAlt \quad \char`\\mfJavascriptAlt \\
\mfJetty \quad \char`\\mfJetty \\
\mfJquery \quad \char`\\mfJquery \\
\mfKde \quad \char`\\mfKde \\
\mfLaravel \quad \char`\\mfLaravel \\
\mfLineGraph \quad \char`\\mfLineGraph \\
\mfLinuxMint \quad \char`\\mfLinuxMint \\
\mfLooking \quad \char`\\mfLooking \\
\mfMagento \quad \char`\\mfMagento \\
\mfMariadb \quad \char`\\mfMariadb \\
\mfMaven \quad \char`\\mfMaven \\
\mfMicroscope \quad \char`\\mfMicroscope \\
\mfMobileDevice \quad \char`\\mfMobileDevice \\
\mfMobilePhoneAlt \quad \char`\\mfMobilePhoneAlt \\
\mfMobilePhoneBroadcast \quad \char`\\mfMobilePhoneBroadcast \\
\mfMongodb \quad \char`\\mfMongodb \\
\mfMssql \quad \char`\\mfMssql \\
\mfMysql \quad \char`\\mfMysql \\
\mfMysqlAlt \quad \char`\\mfMysqlAlt \\
\mfNetbsd \quad \char`\\mfNetbsd \\
\mfNginx \quad \char`\\mfNginx \\
\mfNginxAlt \quad \char`\\mfNginxAlt \\
\mfNginxAlttwo \quad \char`\\mfNginxAlttwo \\
\mfNodejs \quad \char`\\mfNodejs \\
\mfNpm \quad \char`\\mfNpm \\
\mfObjc \quad \char`\\mfObjc \\
\mfOpenshift \quad \char`\\mfOpenshift \\
\mfOracle \quad \char`\\mfOracle \\
\mfOracleAlt \quad \char`\\mfOracleAlt \\
\mfOsx \quad \char`\\mfOsx \\
\mfPerl \quad \char`\\mfPerl \\
\mfPhoneAlt \quad \char`\\mfPhoneAlt \\
\mfPhoneGap \quad \char`\\mfPhoneGap \\
\mfPhoneRetro \quad \char`\\mfPhoneRetro \\
\mfPhp \quad \char`\\mfPhp \\
\mfPhpAlt \quad \char`\\mfPhpAlt \\
\mfPlayframework \quad \char`\\mfPlayframework \\
\mfPlayframeworkAlt \quad \char`\\mfPlayframeworkAlt \\
\mfPlone \quad \char`\\mfPlone \\
\mfPostgres \quad \char`\\mfPostgres \\
\mfPostgresAlt \quad \char`\\mfPostgresAlt \\
\mfPython \quad \char`\\mfPython \\
\mfRaspberrypi \quad \char`\\mfRaspberrypi \\
\mfReactjs \quad \char`\\mfReactjs \\
\mfRedhat \quad \char`\\mfRedhat \\
\mfRedis \quad \char`\\mfRedis \\
\mfRuby \quad \char`\\mfRuby \\
\mfRubyOnRails \quad \char`\\mfRubyOnRails \\
\mfRubyOnRailsAlt \quad \char`\\mfRubyOnRailsAlt \\
\mfRust \quad \char`\\mfRust \\
\mfSass \quad \char`\\mfSass \\
\mfSatellite \quad \char`\\mfSatellite \\
\mfScala \quad \char`\\mfScala \\
\mfScalaAlt \quad \char`\\mfScalaAlt \\
\mfScript \quad \char`\\mfScript \\
\mfScriptAlt \quad \char`\\mfScriptAlt \\
\mfShell \quad \char`\\mfShell \\
\mfSitefinity \quad \char`\\mfSitefinity \\
\mfSolaris \quad \char`\\mfSolaris \\
\mfSplatter \quad \char`\\mfSplatter \\
\mfSpring \quad \char`\\mfSpring \\
\mfSuse \quad \char`\\mfSuse \\
\mfSvg \quad \char`\\mfSvg \\
\mfSymfony \quad \char`\\mfSymfony \\
\mfTomcat \quad \char`\\mfTomcat \\
\mfUbuntu \quad \char`\\mfUbuntu \\
\mfUnity \quad \char`\\mfUnity \\
\mfWireless \quad \char`\\mfWireless \\
\mfWordpress \quad \char`\\mfWordpress \\
\mfXeleven \quad \char`\\mfXeleven \\

\end{document}


text:
import { createAction, handleActions } from 'redux-actions';
import { Map } from 'immutable';

/* Actions */
const SORTER_SET = 'main/SORTER_SET';

/* action creators */
export const setSorter = createAction(SORTER_SET);

/* initialState */
const initialState = Map({
    sorter: Map({
        value: 'recent'
    }),
});

/* reducers */
export default handleActions({
    [SORTER_SET]: (state, action) => {
        const value = action.payload;
        return state.setIn(['sorter', 'value'], value)
    }
}, initialState);


text:
package com.querydsl.hazelcast.domain;

import java.io.Serializable;
import java.util.Date;

import com.querydsl.core.annotations.QueryEntity;

@QueryEntity
public class User implements Serializable {

    private static final long serialVersionUID = 217581286697526118L;

    public enum Gender {
        MALE, FEMALE
    }

    private String id;

    private String firstName;

    private String lastName;

    private Date created;

    private Gender gender;

    private int age;

    private String details;

    public User() {
    }

    public User(String firstName, String lastName, int age, Date created) {
        super();
        this.firstName = firstName;
        this.lastName = lastName;
        this.created = created;
        this.age = age;
    }

    @Override
    public String toString() {
        return "TestUser [id=" + id + ", firstName=" + firstName + ", lastName=" + lastName + "]";
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Gender getGender() {
        return gender;
    }

    public void setGender(Gender gender) {
        this.gender = gender;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((id == null) ? 0 : id.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        User other = (User) obj;
        if (id == null) {
            if (other.id != null) {
                return false;
            }
        } else if (!id.equals(other.id)) {
            return false;
        }
        return true;
    }

    public String getDetails() {
        return details;
    }

    public void setDetails(String details) {
        this.details = details;
    }

}


text:
#ifndef __INCLUDE_NUTTX_SPAWN_H
#define __INCLUDE_NUTTX_SPAWN_H

/****************************************************************************
 * Included Files
 ****************************************************************************/

#include <nuttx/config.h>

#include <spawn.h>

/****************************************************************************
 * Pre-processor Definitions
 ****************************************************************************/

/****************************************************************************
 * Type Definitions
 ****************************************************************************/
/* This enumerator identifies a file action */

enum spawn_file_actions_e
{
  SPAWN_FILE_ACTION_NONE = 0,
  SPAWN_FILE_ACTION_CLOSE,
  SPAWN_FILE_ACTION_DUP2,
  SPAWN_FILE_ACTION_OPEN
};

/* posix_spawn_file_actions_addclose(), posix_spawn_file_actions_adddup2(),
 * and posix_spawn_file_actions_addopen() will allocate memory and append
 * a new file action to an instance of posix_spawn_file_actions_t.  The
 * internal representation of these structures are defined below:
 */

struct spawn_general_file_action_s
{
  FAR struct spawn_general_file_action_s *flink;  /* Supports a singly linked list */
  enum spawn_file_actions_e action;               /* A member of enum spawn_file_actions_e */
};

struct spawn_close_file_action_s
{
  FAR struct spawn_general_file_action_s *flink;  /* Supports a singly linked list */
  enum spawn_file_actions_e action;               /* SPAWN_FILE_ACTION_CLOSE */
  int fd;                                         /* The file descriptor to close */
};

struct spawn_dup2_file_action_s
{
  FAR struct spawn_general_file_action_s *flink;  /* Supports a singly linked list */
  enum spawn_file_actions_e action;               /* SPAWN_FILE_ACTION_DUP2 */
  int fd1;                                        /* The first file descriptor for dup2() */
  int fd2;                                        /* The second file descriptor for dup2() */
};

struct spawn_open_file_action_s
{
  FAR struct spawn_general_file_action_s *flink;  /* Supports a singly linked list */
  enum spawn_file_actions_e action;               /* SPAWN_FILE_ACTION_OPEN */
  int fd;                                         /* The file descriptor after opening */
  int oflags;                                     /* Open flags */
  mode_t mode;                                    /* File creation mode */
  char path[1];                                   /* Start of the path to be
                                                   * opened */
};

#define SIZEOF_OPEN_FILE_ACTION_S(n) \
  (sizeof(struct spawn_open_file_action_s) + (n))

/****************************************************************************
 * Public Function Prototypes
 ****************************************************************************/

#ifdef __cplusplus
extern "C"
{
#endif

void add_file_action(FAR posix_spawn_file_actions_t *file_action,
                     FAR struct spawn_general_file_action_s *entry);

#ifdef __cplusplus
}
#endif

#endif /* __INCLUDE_NUTTX_SPAWN_H */


text: This blog is to give news and updates to the zolag web site.


text:
using System.Linq;
using FluentAssertions;
using NUnit.Framework;

namespace AutoGrid.Tests
{
    [TestFixture]
    public class GridLengthStringParserTests
    {
        [Test]
        public void CanHandleSingleStar()
        {
            var g = GridLengthParser.FromString("*").ToArray();
            g.Count().Should().Be(1);
            g.Single().IsStar.Should().BeTrue();
            g.Single().Value.Should().BeInRange(0.99, 1.01);
        }

        [Test]
        public void CanHandleTenStar()
        {
            var g = GridLengthParser.FromString("10*").ToArray();
            g.Count().Should().Be(1);
            g.Single().IsStar.Should().BeTrue();
            g.Single().Value.Should().BeInRange(9.99, 10.01);
        }

        [Test]
        public void CanHandleAuto()
        {
            var g = GridLengthParser.FromString("auto").ToArray();
            g.Count().Should().Be(1);
            g.Single().IsAuto.Should().BeTrue();
        }

        [Test]
        public void CanHandlePixel()
        {
            var g = GridLengthParser.FromString("10").ToArray();
            g.Count().Should().Be(1);
            g.Single().IsAbsolute.Should().BeTrue();
            g.Single().Value.Should().BeInRange(9.99, 10.01);
        }

        [Test]
        public void CanHandleMultiple()
        {
            var g = GridLengthParser.FromString("10,5*,auto,*").ToArray();
            g.Count().Should().Be(4);
            g[0].IsAbsolute.Should().BeTrue("10");
            g[0].Value.Should().BeInRange(9.99, 10.01);

            g[1].IsStar.Should().BeTrue("5*");
            g[1].Value.Should().BeInRange(4.99, 5.01);

            g[2].IsAuto.Should().BeTrue("auto");

            g[3].IsStar.Should().BeTrue("*");
            g[3].Value.Should().BeInRange(0.99, 1.01);
        }

    }
}


text:
from openturns import *

TESTPREAMBLE()
RandomGenerator.SetSeed(0)

try:
    # Instanciate one distribution object
    dim = 3
    R = CorrelationMatrix(dim)
    for i in range(dim - 1):
        R[i, i + 1] = 0.25
    copula = SklarCopula(
        Distribution(Normal([1.0, 2.0, 3.0], [2.0, 3.0, 1.0], R)))
    copulaRef = NormalCopula(R)
    print "Copula ", repr(copula)
    print "Copula ", copula
    print "Mean      =", repr(copula.getMean())
    print "Mean (ref)=", repr(copulaRef.getMean())
    print "Covariance      =", repr(copula.getCovariance())
    print "Covariance (ref)=", repr(copulaRef.getCovariance())

    # Is this copula an elliptical distribution?
    print "Elliptical distribution= ", copula.isElliptical()

    # Is this copula elliptical ?
    print "Elliptical copula= ", copula.hasEllipticalCopula()

    # Is this copula independent ?
    print "Independent copula= ", copula.hasIndependentCopula()

    # Test for realization of distribution
    oneRealization = copula.getRealization()
    print "oneRealization=", repr(oneRealization)

    # Test for sampling
    size = 10
    oneSample = copula.getSample(size)
    print "oneSample=", repr(oneSample)

   # Test for sampling
    size = 1000
    anotherSample = copula.getSample(size)
    print "anotherSample mean=", repr(anotherSample.computeMean())
    print "anotherSample covariance=", repr(anotherSample.computeCovariance())

    # Define a point
    point = NumericalPoint(dim, 0.2)

    # Show PDF and CDF of point
    pointPDF = copula.computePDF(point)
    pointCDF = copula.computeCDF(point)
    pointPDFRef = copulaRef.computePDF(point)
    pointCDFRef = copulaRef.computeCDF(point)
    print "Point = ", repr(point), " pdf      =%.6f" % pointPDF, " cdf      =%.6f" % pointCDF
    print "Point = ", repr(point), " pdf (ref)=%.6f" % pointPDFRef, " cdf (ref)=%.6f" % pointCDFRef

    # Get 50% quantile
    quantile = copula.computeQuantile(0.5)
    quantileRef = copulaRef.computeQuantile(0.5)
    print "Quantile      =", repr(quantile)
    print "Quantile (ref)=", repr(quantileRef)
    print "CDF(quantile)=%.6f" % copula.computeCDF(quantile)

    # Extract the marginals
    for i in range(dim):
        margin = copula.getMarginal(i)
        marginRef = copulaRef.getMarginal(i)
        print "margin=", repr(margin)
        print "margin PDF      =%.6f" % margin.computePDF(NumericalPoint(1, 0.25))
        print "margin PDF (ref)=%.6f" % marginRef.computePDF(NumericalPoint(1, 0.25))
        print "margin CDF      =%.6f" % margin.computeCDF(NumericalPoint(1, 0.25))
        print "margin CDF (ref)=%.6f" % marginRef.computeCDF(NumericalPoint(1, 0.25))
        print "margin quantile      =", repr(margin.computeQuantile(0.95))
        print "margin quantile (ref)=", repr(marginRef.computeQuantile(0.95))
        print "margin realization=", repr(margin.getRealization())

    # Extract a 2-D marginal
    indices = Indices(2, 0)
    indices[0] = 1
    indices[1] = 0
    print "indices=", repr(indices)
    margin = copula.getMarginal(indices)
    marginRef = copulaRef.getMarginal(indices)
    print "margin=", repr(margin)
    print "margin PDF      =%.6f" % margin.computePDF(NumericalPoint(2, 0.25))
    print "margin PDF (ref)=%.6f" % marginRef.computePDF(NumericalPoint(2, 0.25))
    print "margin CDF      =%.6f" % margin.computeCDF(NumericalPoint(2, 0.25))
    print "margin CDF (ref)=%.6f" % marginRef.computeCDF(NumericalPoint(2, 0.25))
    print "margin quantile      =", repr(margin.computeQuantile(0.95))
    print "margin quantile (ref)=", repr(marginRef.computeQuantile(0.95))
    print "margin realization=", repr(margin.getRealization())

except:
    import sys
    print "t_SklarCopula.py", sys.exc_type, sys.exc_value


text:
<?php
namespace Framework\Router;

use Framework\Core as Core;

class Exception extends Core\Exception
{
}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/menu_buttons"
    android:background="#80000000"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <RelativeLayout
        android:id="@+id/container_textos_itens"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_above="@+id/container_audios_itens"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true">

        <android.support.design.widget.FloatingActionButton
            android:id="@+id/floating_fling_textos_item"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:fabSize="mini"
            android:contentDescription="@string/fling_fab_description"
            app:backgroundTint="@android:color/white"
            android:src="@drawable/ic_filtro_texto"
            android:layout_centerVertical="true"
            android:layout_alignParentRight="true"
            android:layout_alignParentEnd="true"
            android:layout_marginBottom="@dimen/fab_menu_items_distance"
            android:layout_marginRight="@dimen/fab_margin_right"
            android:layout_marginEnd="@dimen/fab_margin_right"
            android:scaleType="center"/>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/txt_view_menu_textos"
            android:text="@string/fab_menu_textos"
            android:textSize="@dimen/texto_fab_menu_itens"
            android:textColor="@android:color/white"
            android:layout_marginRight="@dimen/texto_para_fab_margin"
            android:layout_marginEnd="@dimen/texto_para_fab_margin"
            android:layout_centerVertical="true"
            android:layout_toLeftOf="@+id/floating_fling_textos_item"
            android:layout_toStartOf="@+id/floating_fling_textos_item" />

    </RelativeLayout>

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_above="@+id/container_videos_itens"
        android:id="@+id/container_audios_itens"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true">

        <android.support.design.widget.FloatingActionButton
            android:id="@+id/floating_fling_audios_item"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:fabSize="mini"
            android:contentDescription="@string/fling_fab_description"
            app:backgroundTint="@android:color/white"
            android:src="@drawable/ic_filtro_audio"
            android:layout_centerVertical="true"
            android:layout_marginBottom="@dimen/fab_menu_items_distance"
            android:layout_marginRight="@dimen/fab_margin_right"
            android:layout_marginEnd="@dimen/fab_margin_right"
            android:layout_alignParentRight="true"
            android:layout_alignParentEnd="true"
            android:scaleType="center"/>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/txt_view_menu_audios"
            android:text="@string/fab_menu_audios"
            android:textSize="@dimen/texto_fab_menu_itens"
            android:textColor="@android:color/white"
            android:layout_marginRight="@dimen/texto_para_fab_margin"
            android:layout_marginEnd="@dimen/texto_para_fab_margin"
            android:layout_centerVertical="true"
            android:layout_toLeftOf="@+id/floating_fling_audios_item"
            android:layout_toStartOf="@+id/floating_fling_audios_item" />

    </RelativeLayout>

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/container_videos_itens"
        android:layout_above="@+id/container_imagens_itens"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true">

        <android.support.design.widget.FloatingActionButton
            android:id="@+id/floating_fling_videos_item"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:fabSize="mini"
            android:contentDescription="@string/fling_fab_description"
            app:backgroundTint="@android:color/white"
            android:src="@drawable/ic_filtro_video"
            android:layout_centerVertical="true"
            android:layout_marginBottom="@dimen/fab_menu_items_distance"
            android:layout_marginRight="@dimen/fab_margin_right"
            android:layout_marginEnd="@dimen/fab_margin_right"
            android:layout_alignParentRight="true"
            android:layout_alignParentEnd="true"
            android:scaleType="center"/>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/txt_view_menu_videos"
            android:text="@string/fab_menu_videos"
            android:textSize="@dimen/texto_fab_menu_itens"
            android:textColor="@android:color/white"
            android:layout_marginRight="@dimen/texto_para_fab_margin"
            android:layout_marginEnd="@dimen/texto_para_fab_margin"
            android:layout_centerVertical="true"
            android:layout_toLeftOf="@+id/floating_fling_videos_item"
            android:layout_toStartOf="@+id/floating_fling_videos_item" />

    </RelativeLayout>

    <RelativeLayout
        android:id="@+id/container_imagens_itens"

        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_above="@+id/floating_fling_root_item"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true">

        <android.support.design.widget.FloatingActionButton
            android:id="@+id/floating_fling_imagens_item"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:fabSize="mini"
            android:contentDescription="@string/fling_fab_description"
            app:backgroundTint="@android:color/white"
            android:src="@drawable/ic_filtro_image"
            android:layout_centerVertical="true"
            android:layout_marginBottom="@dimen/fab_menu_items_distance"
            android:layout_marginRight="@dimen/fab_margin_right"
            android:layout_marginEnd="@dimen/fab_margin_right"
            android:layout_alignParentRight="true"
            android:layout_alignParentEnd="true"
            android:scaleType="center"/>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/txt_view_menu_imagens"
            android:text="@string/fab_menu_imagens"
            android:textSize="@dimen/texto_fab_menu_itens"
            android:textColor="@android:color/white"
            android:layout_marginRight="@dimen/texto_para_fab_margin"
            android:layout_marginEnd="@dimen/texto_para_fab_margin"
            android:layout_centerVertical="true"
            android:layout_toLeftOf="@+id/floating_fling_imagens_item"
            android:layout_toStartOf="@+id/floating_fling_imagens_item" />

    </RelativeLayout>

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/floating_fling_root_item"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:contentDescription="@string/fling_fab_description"
        android:src="@android:drawable/ic_input_add"
        app:backgroundTint="@color/acervo_remoto_primary"
        android:layout_marginStart="@dimen/fab_principal_margin"
        android:layout_marginEnd="@dimen/fab_principal_margin"
        android:layout_marginBottom="@dimen/fab_principal_margin"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true" />

</RelativeLayout>


text:
package org.apache.hadoop.hive.ql.exec.vector;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import java.sql.Timestamp;

import org.junit.Test;
import org.apache.hadoop.hive.ql.exec.vector.expressions.IdentityExpression;
import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression;
import org.apache.hadoop.hive.ql.exec.vector.util.FakeVectorRowBatchFromObjectIterables;
import org.apache.hadoop.hive.ql.exec.vector.wrapper.VectorHashKeyWrapperBase;
import org.apache.hadoop.hive.ql.exec.vector.wrapper.VectorHashKeyWrapperBatch;
import org.apache.hadoop.hive.ql.metadata.HiveException;
import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo;
import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory;

/**
 * Unit test for VectorHashKeyWrapperBatch class.
 */
public class TestVectorHashKeyWrapperBatch {

  // Specific test for HIVE-18744 --
  // Tests Timestamp assignment.
  @Test
  public void testVectorHashKeyWrapperBatch() throws HiveException {

    VectorExpression[] keyExpressions =
        new VectorExpression[] { new IdentityExpression(0) };
    TypeInfo[] typeInfos =
        new TypeInfo[] {TypeInfoFactory.timestampTypeInfo};
    VectorHashKeyWrapperBatch vhkwb =
        VectorHashKeyWrapperBatch.compileKeyWrapperBatch(
            keyExpressions,
            typeInfos);

    VectorizedRowBatch batch = new VectorizedRowBatch(1);
    batch.selectedInUse = false;
    batch.size = 10;
    TimestampColumnVector timestampColVector = new TimestampColumnVector(batch.DEFAULT_SIZE);;
    batch.cols[0] = timestampColVector;
    timestampColVector.reset();
    // Cause Timestamp object to be replaced (in buggy code) with ZERO_TIMESTAMP.
    timestampColVector.noNulls = false;
    timestampColVector.isNull[0] = true;
    Timestamp scratch = new Timestamp(2039);
    Timestamp ts0 = new Timestamp(2039);
    scratch.setTime(ts0.getTime());
    scratch.setNanos(ts0.getNanos());
    timestampColVector.set(1, scratch);
    Timestamp ts1 = new Timestamp(33222);
    scratch.setTime(ts1.getTime());
    scratch.setNanos(ts1.getNanos());
    timestampColVector.set(2, scratch);
    batch.size = 3;

    vhkwb.evaluateBatch(batch);
    VectorHashKeyWrapperBase[] vhkwArray = vhkwb.getVectorHashKeyWrappers();
    VectorHashKeyWrapperBase vhk = vhkwArray[0];
    assertTrue(vhk.isNull(0));
    vhk = vhkwArray[1];
    assertFalse(vhk.isNull(0));
    assertEquals(vhk.getTimestamp(0), ts0);
    vhk = vhkwArray[2];
    assertFalse(vhk.isNull(0));
    assertEquals(vhk.getTimestamp(0), ts1);
  }
}


text:
DrawableShape::DrawableShape()
    : strokeType (0.0f),
      mainFill (Colours::black),
      strokeFill (Colours::black)
{
}

DrawableShape::DrawableShape (const DrawableShape& other)
    : Drawable (other),
      strokeType (other.strokeType),
      dashLengths (other.dashLengths),
      mainFill (other.mainFill),
      strokeFill (other.strokeFill)
{
}

DrawableShape::~DrawableShape()
{
}

//==============================================================================
class DrawableShape::RelativePositioner  : public RelativeCoordinatePositionerBase
{
public:
    RelativePositioner (DrawableShape& comp, const DrawableShape::RelativeFillType& f, bool isMain)
        : RelativeCoordinatePositionerBase (comp),
          owner (comp),
          fill (f),
          isMainFill (isMain)
    {
    }

    bool registerCoordinates() override
    {
        bool ok = addPoint (fill.gradientPoint1);
        ok = addPoint (fill.gradientPoint2) && ok;
        return addPoint (fill.gradientPoint3) && ok;
    }

    void applyToComponentBounds() override
    {
        ComponentScope scope (owner);
        if (isMainFill ? owner.mainFill.recalculateCoords (&scope)
                       : owner.strokeFill.recalculateCoords (&scope))
            owner.repaint();
    }

    void applyNewBounds (const Rectangle<int>&) override
    {
        jassertfalse; // drawables can't be resized directly!
    }

private:
    DrawableShape& owner;
    const DrawableShape::RelativeFillType fill;
    const bool isMainFill;

    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (RelativePositioner)
};

void DrawableShape::setFill (const FillType& newFill)
{
    setFill (RelativeFillType (newFill));
}

void DrawableShape::setStrokeFill (const FillType& newFill)
{
    setStrokeFill (RelativeFillType (newFill));
}

void DrawableShape::setFillInternal (RelativeFillType& fill, const RelativeFillType& newFill,
                                     ScopedPointer<RelativeCoordinatePositionerBase>& pos)
{
    if (fill != newFill)
    {
        fill = newFill;
        pos = nullptr;

        if (fill.isDynamic())
        {
            pos = new RelativePositioner (*this, fill, true);
            pos->apply();
        }
        else
        {
            fill.recalculateCoords (nullptr);
        }

        repaint();
    }
}

void DrawableShape::setFill (const RelativeFillType& newFill)
{
    setFillInternal (mainFill, newFill, mainFillPositioner);
}

void DrawableShape::setStrokeFill (const RelativeFillType& newFill)
{
    setFillInternal (strokeFill, newFill, strokeFillPositioner);
}

void DrawableShape::setStrokeType (const PathStrokeType& newStrokeType)
{
    if (strokeType != newStrokeType)
    {
        strokeType = newStrokeType;
        strokeChanged();
    }
}

void DrawableShape::setDashLengths (const Array<float>& newDashLengths)
{
    if (dashLengths != newDashLengths)
    {
        dashLengths = newDashLengths;
        strokeChanged();
    }
}

void DrawableShape::setStrokeThickness (const float newThickness)
{
    setStrokeType (PathStrokeType (newThickness, strokeType.getJointStyle(), strokeType.getEndStyle()));
}

bool DrawableShape::isStrokeVisible() const noexcept
{
    return strokeType.getStrokeThickness() > 0.0f && ! strokeFill.fill.isInvisible();
}

void DrawableShape::refreshFillTypes (const FillAndStrokeState& newState, ComponentBuilder::ImageProvider* imageProvider)
{
    setFill (newState.getFill (FillAndStrokeState::fill, imageProvider));
    setStrokeFill (newState.getFill (FillAndStrokeState::stroke, imageProvider));
}

void DrawableShape::writeTo (FillAndStrokeState& state, ComponentBuilder::ImageProvider* imageProvider, UndoManager* undoManager) const
{
    state.setFill (FillAndStrokeState::fill, mainFill, imageProvider, undoManager);
    state.setFill (FillAndStrokeState::stroke, strokeFill, imageProvider, undoManager);
    state.setStrokeType (strokeType, undoManager);
}

//==============================================================================
void DrawableShape::paint (Graphics& g)
{
    transformContextToCorrectOrigin (g);

    g.setFillType (mainFill.fill);
    g.fillPath (path);

    if (isStrokeVisible())
    {
        g.setFillType (strokeFill.fill);
        g.fillPath (strokePath);
    }
}

void DrawableShape::pathChanged()
{
    strokeChanged();
}

void DrawableShape::strokeChanged()
{
    strokePath.clear();
    const float extraAccuracy = 4.0f;

    if (dashLengths.isEmpty())
        strokeType.createStrokedPath (strokePath, path, AffineTransform(), extraAccuracy);
    else
        strokeType.createDashedStroke (strokePath, path, dashLengths.getRawDataPointer(),
                                       dashLengths.size(), AffineTransform(), extraAccuracy);

    setBoundsToEnclose (getDrawableBounds());
    repaint();
}

Rectangle<float> DrawableShape::getDrawableBounds() const
{
    if (isStrokeVisible())
        return strokePath.getBounds();

    return path.getBounds();
}

bool DrawableShape::hitTest (int x, int y)
{
    bool allowsClicksOnThisComponent, allowsClicksOnChildComponents;
    getInterceptsMouseClicks (allowsClicksOnThisComponent, allowsClicksOnChildComponents);

    if (! allowsClicksOnThisComponent)
        return false;

    const float globalX = (float) (x - originRelativeToComponent.x);
    const float globalY = (float) (y - originRelativeToComponent.y);

    return path.contains (globalX, globalY)
            || (isStrokeVisible() && strokePath.contains (globalX, globalY));
}

//==============================================================================
DrawableShape::RelativeFillType::RelativeFillType()
{
}

DrawableShape::RelativeFillType::RelativeFillType (const FillType& fill_)
    : fill (fill_)
{
    if (fill.isGradient())
    {
        const ColourGradient& g = *fill.gradient;

        gradientPoint1 = g.point1.transformedBy (fill.transform);
        gradientPoint2 = g.point2.transformedBy (fill.transform);
        gradientPoint3 = Point<float> (g.point1.x + g.point2.y - g.point1.y,
                                       g.point1.y + g.point1.x - g.point2.x)
                            .transformedBy (fill.transform);
        fill.transform = AffineTransform();
    }
}

DrawableShape::RelativeFillType::RelativeFillType (const RelativeFillType& other)
    : fill (other.fill),
      gradientPoint1 (other.gradientPoint1),
      gradientPoint2 (other.gradientPoint2),
      gradientPoint3 (other.gradientPoint3)
{
}

DrawableShape::RelativeFillType& DrawableShape::RelativeFillType::operator= (const RelativeFillType& other)
{
    fill = other.fill;
    gradientPoint1 = other.gradientPoint1;
    gradientPoint2 = other.gradientPoint2;
    gradientPoint3 = other.gradientPoint3;
    return *this;
}

bool DrawableShape::RelativeFillType::operator== (const RelativeFillType& other) const
{
    return fill == other.fill
        && ((! fill.isGradient())
             || (gradientPoint1 == other.gradientPoint1
                 && gradientPoint2 == other.gradientPoint2
                 && gradientPoint3 == other.gradientPoint3));
}

bool DrawableShape::RelativeFillType::operator!= (const RelativeFillType& other) const
{
    return ! operator== (other);
}

bool DrawableShape::RelativeFillType::recalculateCoords (Expression::Scope* scope)
{
    if (fill.isGradient())
    {
        const Point<float> g1 (gradientPoint1.resolve (scope));
        const Point<float> g2 (gradientPoint2.resolve (scope));
        AffineTransform t;

        ColourGradient& g = *fill.gradient;

        if (g.isRadial)
        {
            const Point<float> g3 (gradientPoint3.resolve (scope));
            const Point<float> g3Source (g1.x + g2.y - g1.y,
                                         g1.y + g1.x - g2.x);

            t = AffineTransform::fromTargetPoints (g1.x, g1.y, g1.x, g1.y,
                                                   g2.x, g2.y, g2.x, g2.y,
                                                   g3Source.x, g3Source.y, g3.x, g3.y);
        }

        if (g.point1 != g1 || g.point2 != g2 || fill.transform != t)
        {
            g.point1 = g1;
            g.point2 = g2;
            fill.transform = t;
            return true;
        }
    }

    return false;
}

bool DrawableShape::RelativeFillType::isDynamic() const
{
    return gradientPoint1.isDynamic() || gradientPoint2.isDynamic() || gradientPoint3.isDynamic();
}

void DrawableShape::RelativeFillType::writeTo (ValueTree& v, ComponentBuilder::ImageProvider* imageProvider, UndoManager* undoManager) const
{
    if (fill.isColour())
    {
        v.setProperty (FillAndStrokeState::type, "solid", undoManager);
        v.setProperty (FillAndStrokeState::colour, String::toHexString ((int) fill.colour.getARGB()), undoManager);
    }
    else if (fill.isGradient())
    {
        v.setProperty (FillAndStrokeState::type, "gradient", undoManager);
        v.setProperty (FillAndStrokeState::gradientPoint1, gradientPoint1.toString(), undoManager);
        v.setProperty (FillAndStrokeState::gradientPoint2, gradientPoint2.toString(), undoManager);
        v.setProperty (FillAndStrokeState::gradientPoint3, gradientPoint3.toString(), undoManager);

        const ColourGradient& cg = *fill.gradient;
        v.setProperty (FillAndStrokeState::radial, cg.isRadial, undoManager);

        String s;
        for (int i = 0; i < cg.getNumColours(); ++i)
            s << ' ' << cg.getColourPosition (i)
              << ' ' << String::toHexString ((int) cg.getColour(i).getARGB());

        v.setProperty (FillAndStrokeState::colours, s.trimStart(), undoManager);
    }
    else if (fill.isTiledImage())
    {
        v.setProperty (FillAndStrokeState::type, "image", undoManager);

        if (imageProvider != nullptr)
            v.setProperty (FillAndStrokeState::imageId, imageProvider->getIdentifierForImage (fill.image), undoManager);

        if (fill.getOpacity() < 1.0f)
            v.setProperty (FillAndStrokeState::imageOpacity, fill.getOpacity(), undoManager);
        else
            v.removeProperty (FillAndStrokeState::imageOpacity, undoManager);
    }
    else
    {
        jassertfalse;
    }
}

bool DrawableShape::RelativeFillType::readFrom (const ValueTree& v, ComponentBuilder::ImageProvider* imageProvider)
{
    const String newType (v [FillAndStrokeState::type].toString());

    if (newType == "solid")
    {
        const String colourString (v [FillAndStrokeState::colour].toString());
        fill.setColour (colourString.isEmpty() ? Colours::black
                                               : Colour::fromString (colourString));
        return true;
    }
    else if (newType == "gradient")
    {
        ColourGradient g;
        g.isRadial = v [FillAndStrokeState::radial];

        StringArray colourSteps;
        colourSteps.addTokens (v [FillAndStrokeState::colours].toString(), false);

        for (int i = 0; i < colourSteps.size() / 2; ++i)
            g.addColour (colourSteps[i * 2].getDoubleValue(),
                         Colour::fromString (colourSteps[i * 2 + 1]));

        fill.setGradient (g);

        gradientPoint1 = RelativePoint (v [FillAndStrokeState::gradientPoint1]);
        gradientPoint2 = RelativePoint (v [FillAndStrokeState::gradientPoint2]);
        gradientPoint3 = RelativePoint (v [FillAndStrokeState::gradientPoint3]);
        return true;
    }
    else if (newType == "image")
    {
        Image im;
        if (imageProvider != nullptr)
            im = imageProvider->getImageForIdentifier (v [FillAndStrokeState::imageId]);

        fill.setTiledImage (im, AffineTransform());
        fill.setOpacity ((float) v.getProperty (FillAndStrokeState::imageOpacity, 1.0f));
        return true;
    }

    jassertfalse;
    return false;
}

//==============================================================================
const Identifier DrawableShape::FillAndStrokeState::type ("type");
const Identifier DrawableShape::FillAndStrokeState::colour ("colour");
const Identifier DrawableShape::FillAndStrokeState::colours ("colours");
const Identifier DrawableShape::FillAndStrokeState::fill ("Fill");
const Identifier DrawableShape::FillAndStrokeState::stroke ("Stroke");
const Identifier DrawableShape::FillAndStrokeState::path ("Path");
const Identifier DrawableShape::FillAndStrokeState::jointStyle ("jointStyle");
const Identifier DrawableShape::FillAndStrokeState::capStyle ("capStyle");
const Identifier DrawableShape::FillAndStrokeState::strokeWidth ("strokeWidth");
const Identifier DrawableShape::FillAndStrokeState::gradientPoint1 ("point1");
const Identifier DrawableShape::FillAndStrokeState::gradientPoint2 ("point2");
const Identifier DrawableShape::FillAndStrokeState::gradientPoint3 ("point3");
const Identifier DrawableShape::FillAndStrokeState::radial ("radial");
const Identifier DrawableShape::FillAndStrokeState::imageId ("imageId");
const Identifier DrawableShape::FillAndStrokeState::imageOpacity ("imageOpacity");

DrawableShape::FillAndStrokeState::FillAndStrokeState (const ValueTree& state_)
    : Drawable::ValueTreeWrapperBase (state_)
{
}

DrawableShape::RelativeFillType DrawableShape::FillAndStrokeState::getFill (const Identifier& fillOrStrokeType, ComponentBuilder::ImageProvider* imageProvider) const
{
    DrawableShape::RelativeFillType f;
    f.readFrom (state.getChildWithName (fillOrStrokeType), imageProvider);
    return f;
}

ValueTree DrawableShape::FillAndStrokeState::getFillState (const Identifier& fillOrStrokeType)
{
    ValueTree v (state.getChildWithName (fillOrStrokeType));
    if (v.isValid())
        return v;

    setFill (fillOrStrokeType, FillType (Colours::black), nullptr, nullptr);
    return getFillState (fillOrStrokeType);
}

void DrawableShape::FillAndStrokeState::setFill (const Identifier& fillOrStrokeType, const RelativeFillType& newFill,
                                                 ComponentBuilder::ImageProvider* imageProvider, UndoManager* undoManager)
{
    ValueTree v (state.getOrCreateChildWithName (fillOrStrokeType, undoManager));
    newFill.writeTo (v, imageProvider, undoManager);
}

PathStrokeType DrawableShape::FillAndStrokeState::getStrokeType() const
{
    const String jointStyleString (state [jointStyle].toString());
    const String capStyleString (state [capStyle].toString());

    return PathStrokeType (state [strokeWidth],
                           jointStyleString == "curved" ? PathStrokeType::curved
                                                        : (jointStyleString == "bevel" ? PathStrokeType::beveled
                                                                                : PathStrokeType::mitered),
                           capStyleString == "square" ? PathStrokeType::square
                                                      : (capStyleString == "round" ? PathStrokeType::rounded
                                                                                : PathStrokeType::butt));
}

void DrawableShape::FillAndStrokeState::setStrokeType (const PathStrokeType& newStrokeType, UndoManager* undoManager)
{
    state.setProperty (strokeWidth, (double) newStrokeType.getStrokeThickness(), undoManager);
    state.setProperty (jointStyle, newStrokeType.getJointStyle() == PathStrokeType::mitered
                                     ? "miter" : (newStrokeType.getJointStyle() == PathStrokeType::curved ? "curved" : "bevel"), undoManager);
    state.setProperty (capStyle, newStrokeType.getEndStyle() == PathStrokeType::butt
                                     ? "butt" : (newStrokeType.getEndStyle() == PathStrokeType::square ? "square" : "round"), undoManager);
}

static bool replaceColourInFill (DrawableShape::RelativeFillType& fill, Colour original, Colour replacement)
{
    if (fill.fill.colour == original && fill.fill.isColour())
    {
        fill = FillType (replacement);
        return true;
    }

    return false;
}

bool DrawableShape::replaceColour (Colour original, Colour replacement)
{
    bool changed1 = replaceColourInFill (mainFill,   original, replacement);
    bool changed2 = replaceColourInFill (strokeFill, original, replacement);
    return changed1 || changed2;
}