text:
/**
 *     This code was auto-generated by a Codezu.
 *
 *     Changes to this file may cause incorrect behavior and will be lost if
 *     the code is regenerated.
 */
package com.mozu.api.contracts.location;

import java.util.List;
import java.util.HashMap;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.joda.time.DateTime;
import java.io.IOException;
import java.lang.ClassNotFoundException;
import com.mozu.api.contracts.core.Address;
import com.mozu.api.contracts.location.LocationAttribute;
import com.mozu.api.contracts.core.AuditInfo;
import com.mozu.api.contracts.location.FulfillmentType;
import com.mozu.api.contracts.location.Coordinates;
import com.mozu.api.contracts.location.LocationType;
import com.mozu.api.contracts.location.RegularHours;
import com.mozu.api.contracts.location.ShippingOriginContact;

/**
 *	Properties of a physical location a tenant uses to manage inventory and fulfills orders, provide store finder functionality, or both.
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class Location implements Serializable
{
	// Default Serial Version UID
	private static final long serialVersionUID = 1L;

	/**
	 * Allow fullfillment with no (or less) stock
	 */
	protected  Boolean allowFulfillmentWithNoStock;

	public Boolean getAllowFulfillmentWithNoStock() {
		return this.allowFulfillmentWithNoStock;
	}

	public void setAllowFulfillmentWithNoStock(Boolean allowFulfillmentWithNoStock) {
		this.allowFulfillmentWithNoStock = allowFulfillmentWithNoStock;
	}

	protected  String code;

	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	protected  String description;

	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	protected  String fax;

	public String getFax() {
		return this.fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	/**
	 * Locations is disabled (soft delete)
	 */
	protected  Boolean isDisabled;

	public Boolean getIsDisabled() {
		return this.isDisabled;
	}

	public void setIsDisabled(Boolean isDisabled) {
		this.isDisabled = isDisabled;
	}

	protected  String name;

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	protected  String note;

	public String getNote() {
		return this.note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	protected  String phone;

	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	protected  Boolean supportsInventory;

	public Boolean getSupportsInventory() {
		return this.supportsInventory;
	}

	public void setSupportsInventory(Boolean supportsInventory) {
		this.supportsInventory = supportsInventory;
	}

	protected List<String> tags;
	public List<String> getTags() {
		return this.tags;
	}
	public void setTags(List<String> tags) {
		this.tags = tags;
	}

	protected  Address address;

	public Address getAddress() {
		return this.address;
	}

	public void setAddress(Address address) {
		this.address = address;
	}

	/**
	 * Collection of attributes that may be paged list or a list, depending on the usage per object and API type.
	 */
	protected List<LocationAttribute> attributes;
	public List<LocationAttribute> getAttributes() {
		return this.attributes;
	}
	public void setAttributes(List<LocationAttribute> attributes) {
		this.attributes = attributes;
	}

	protected  AuditInfo auditInfo;

	public AuditInfo getAuditInfo() {
		return this.auditInfo;
	}

	public void setAuditInfo(AuditInfo auditInfo) {
		this.auditInfo = auditInfo;
	}

	protected List<FulfillmentType> fulfillmentTypes;
	public List<FulfillmentType> getFulfillmentTypes() {
		return this.fulfillmentTypes;
	}
	public void setFulfillmentTypes(List<FulfillmentType> fulfillmentTypes) {
		this.fulfillmentTypes = fulfillmentTypes;
	}

	protected  Coordinates geo;

	public Coordinates getGeo() {
		return this.geo;
	}

	public void setGeo(Coordinates geo) {
		this.geo = geo;
	}

	protected List<LocationType> locationTypes;
	public List<LocationType> getLocationTypes() {
		return this.locationTypes;
	}
	public void setLocationTypes(List<LocationType> locationTypes) {
		this.locationTypes = locationTypes;
	}

	protected  RegularHours regularHours;

	public RegularHours getRegularHours() {
		return this.regularHours;
	}

	public void setRegularHours(RegularHours regularHours) {
		this.regularHours = regularHours;
	}

	/**
	 * Properties of a fulfillment contact for the shipping origin address associated with a location.
	 */
	protected  ShippingOriginContact shippingOriginContact;

	public ShippingOriginContact getShippingOriginContact() {
		return this.shippingOriginContact;
	}

	public void setShippingOriginContact(ShippingOriginContact shippingOriginContact) {
		this.shippingOriginContact = shippingOriginContact;
	}

}


text:
require 'spec_helper'

describe Savon::Resolver do

  subject(:resolver) { Savon::Resolver.new(http_test_client) }

  let(:http_test_client) {
    Class.new {

      def get(url)
        "raw_response for #{url}"
      end

    }.new
  }

  it 'resolves remote files using a simple HTTP client interface' do
    url = 'http://example.com?wsdl'

    xml = resolver.resolve(url)
    expect(xml).to eq("raw_response for #{url}")
  end

  it 'resolves local files' do
    fixture = fixture('wsdl/authentication')

    xml = resolver.resolve(fixture)
    expect(xml).to eq(File.read(fixture))
  end

  it 'simply returns any raw input' do
    string = '<xml/>'

    xml = resolver.resolve(string)
    expect(xml).to eq(string)
  end

end

redpajama_set_name: RedPajamaGithub


text:
#ifndef LIBFFI_TARGET_H
#define LIBFFI_TARGET_H

/* ---- Generic type definitions ----------------------------------------- */

#ifndef LIBFFI_ASM
typedef unsigned long          ffi_arg;
typedef signed long            ffi_sarg;

typedef enum ffi_abi {
  FFI_FIRST_ABI = 0,
  FFI_SYSV,
  FFI_DEFAULT_ABI = FFI_SYSV,
  FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
} ffi_abi;
#endif

#define FFI_CLOSURES 1
#define FFI_TRAMPOLINE_SIZE 16
#define FFI_NATIVE_RAW_API 0

#endif


text:
import os
import sys

def add_root_to_path ():
    """adds trex_control_plane root dir to script path, up to `depth` parent dirs"""
    root_dirname = 'trex_control_plane'
    file_path    = os.path.dirname(os.path.realpath(__file__))

    components = file_path.split(os.sep)
    sys.path.append( str.join(os.sep, components[:components.index(root_dirname)+1]) )
    return

add_root_to_path()


text:
<?php

namespace Surume\Channel;

use Surume\Channel\Extra\Response;
use Surume\Channel\Request\RequestHelperTrait;
use Surume\Channel\Response\ResponseHelperTrait;
use Surume\Event\EventEmitter;
use Surume\Event\EventHandler;
use Surume\Loop\LoopInterface;
use Surume\Loop\Timer\TimerInterface;
use Surume\Support\GeneratorSupport;
use Surume\Support\StringSupport;
use Surume\Support\TimeSupport;
use Surume\Throwable\LazyException;
use Surume\Throwable\Exception\System\TaskIncompleteException;
use Surume\Throwable\Exception;
use Surume\Throwable\Exception\Logic\InstantiationException;
use Surume\Throwable\Exception\Logic\Resource\ResourceUndefinedException;
use Surume\Throwable\Exception\LogicException;

class ChannelBase extends EventEmitter implements ChannelBaseInterface
{
    use RequestHelperTrait;
    use ResponseHelperTrait;

    /**
     * @var string
     */
    protected $name;

    /**
     * @var ChannelModelInterface
     */
    protected $model;

    /**
     * @var ChannelRouterCompositeInterface
     */
    protected $router;

    /**
     * @var ChannelEncoderInterface
     */
    protected $encoder;

    /**
     * @var LoopInterface
     */
    protected $loop;

    /**
     * @var EventHandler[]
     */
    protected $handlers;

    /**
     * @var string
     */
    protected $uniqid;

    /**
     * @var int
     */
    protected $counter;

    /**
     * @var TimerInterface
     */
    protected $reqsHelperTimer;

    /**
     * @var TimerInterface
     */
    protected $repsHelperTimer;

    /**
     * @param string $name
     * @param ChannelModelInterface $model
     * @param ChannelRouterCompositeInterface $router
     * @param ChannelEncoderInterface $encoder
     * @param LoopInterface $loop
     * @throws InstantiationException
     */
    public function __construct($name, ChannelModelInterface $model, ChannelRouterCompositeInterface $router, ChannelEncoderInterface $encoder, LoopInterface $loop)
    {
        parent::__construct($loop);

        try
        {
            $router->bus('input');
            $router->bus('output');
        }
        catch (Exception $ex)
        {
            throw new InstantiationException("Could not construct Surume\\Channel\\Channel due to Router wrong configuration.");
        }

        $this->name = $name;
        $this->model = $model;
        $this->router = $router;
        $this->encoder = $encoder;
        $this->loop = $loop;
        $this->handlers = [];
        $this->uniqid = GeneratorSupport::genId($this->name);
        $this->counter = 0;
        $this->reqsHelperTimer = null;
        $this->repsHelperTimer = null;
        $this->handledRepsTimeout = 10e3;

        $this->registerEvents();
        $this->registerPeriodicTimers();
    }

    /**
     *
     */
    public function __destruct()
    {
        $this->unregisterEvents();
        $this->unregisterPeriodicTimers();

        unset($this->name);
        unset($this->model);
        unset($this->router);
        unset($this->encoder);
        unset($this->loop);
        unset($this->handlers);
        unset($this->uniqid);
        unset($this->counter);
        unset($this->reqsHelperTimer);
        unset($this->repsHelperTimer);
        unset($this->reqs);
        unset($this->reps);
        unset($this->handledReps);
        unset($this->handledRepsTimeout);

        parent::__destruct();
    }

    /**
     * @param LoopInterface $loop
     */
    public function setLoop(LoopInterface $loop)
    {
        $this->loop = $loop;
    }

    /**
     * @return LoopInterface
     */
    public function getLoop()
    {
        return $this->loop;
    }

    /**
     * @param LoopInterface|null $loop
     * @return LoopInterface
     */
    public function loop(LoopInterface $loop = null)
    {
        if ($loop !== null)
        {
            $this->loop = $loop;
        }

        return $this->loop;
    }

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

    /**
     * @return ChannelModelInterface|null
     */
    public function model()
    {
        return $this->model;
    }

    /**
     * @return ChannelRouterCompositeInterface
     */
    public function router()
    {
        return $this->router;
    }

    /**
     * @return ChannelRouterBaseInterface|ChannelRouterCompositeInterface
     * @throws ResourceUndefinedException
     */
    public function input()
    {
        return $this->router->bus('input');
    }

    /**
     * @return ChannelRouterBaseInterface|ChannelRouterCompositeInterface
     * @throws ResourceUndefinedException
     */
    public function output()
    {
        return $this->router->bus('output');
    }

    /**
     * @param string|string[]|null $message
     * @return ChannelProtocolInterface
     */
    public function createProtocol($message = null)
    {
        if ($message === null)
        {
            $message = '';
        }
        else if (!is_array($message))
        {
            $message = (string) $message;
        }

        return new ChannelProtocol(
            '',
            $this->genId(),
            '',
            $this->name,
            $message,
            '',
            $this->now()
        );
    }

    /**
     * @handle start
     * @param callable $handler
     * @return EventHandler
     */
    public function onStart(callable $handler)
    {
        return $this->on('start', $handler);
    }

    /**
     * @handle stop
     * @param callable $handler
     * @return EventHandler
     */
    public function onStop(callable $handler)
    {
        return $this->on('stop', $handler);
    }

    /**
     * @handle connect
     * @param callable $handler
     * @return EventHandler
     */
    public function onConnect(callable $handler)
    {
        return $this->on('connect', $handler);
    }

    /**
     * @handle disconnect
     * @param callable $handler
     * @return EventHandler
     */
    public function onDisconnect(callable $handler)
    {
        return $this->on('disconnect', $handler);
    }

    /**
     * @handle receive
     * @param callable $handler
     * @return EventHandler
     */
    public function onInput(callable $handler)
    {
        return $this->on('input', $handler);
    }

    /**
     * @handle send
     * @param callable $handler
     * @return EventHandler
     */
    public function onOutput(callable $handler)
    {
        return $this->on('output', $handler);
    }

    /**
     *
     */
    public function start()
    {
        $this->model->start();
    }

    /**
     *
     */
    public function stop()
    {
        $this->model->stop();
    }

    /**
     * @param string|string[] $name
     * @param string|string[]|ChannelProtocolInterface $message
     * @param int $flags
     * @param callable|null $success
     * @param callable|null $failure
     * @param callable|null $cancel
     * @param float $timeout
     * @return mixed|mixed[]
     */
    public function send($name, $message, $flags = Channel::MODE_DEFAULT, callable $success = null, callable $failure = null, callable $cancel = null, $timeout = 0.0)
    {
        if ($success !== null || $failure !== null || $cancel !== null)
        {
            return $this->sendRequest($name, $message, $flags, $success, $failure, $cancel, $timeout);
        }

        return $this->sendAsync($name, $message, $flags);
    }

    /**
     * @param string|string[] $name
     * @param string|string[]|ChannelProtocolInterface $message
     * @param int $flags
     * @param callable|null $success
     * @param callable|null $failure
     * @param callable|null $cancel
     * @param float $timeout
     * @return ChannelRequest|ChannelRequest[]|null|null[]|bool|bool[]
     */
    public function push($name, $message, $flags = Channel::MODE_DEFAULT, callable $success = null, callable $failure = null, callable $cancel = null, $timeout = 0.0)
    {
        if ($success !== null || $failure !== null || $cancel !== null)
        {
            return $this->pushRequest($name, $message, $flags, $success, $failure, $cancel, $timeout);
        }

        return $this->pushAsync($name, $message, $flags);
    }

    /**
     * @param string|string[] $name
     * @param string|string[]|ChannelProtocolInterface $message
     * @param int $flags
     * @return bool|bool[]
     */
    public function sendAsync($name, $message, $flags = Channel::MODE_DEFAULT)
    {
        $protocol = $this->createMessageProtocol($message);
        $names = (array) $name;
        $handlers = [];

        foreach ($names as $name)
        {
            $handlers[] = $this->handleSendAsync($name, $protocol, $flags);
        }

        return !isset($handlers[0]) || isset($handlers[1]) ? $handlers : $handlers[0];
    }

    /**
     * @param string|string[] $name
     * @param string|string[]|ChannelProtocolInterface $message
     * @param int $flags
     * @return bool|bool[]
     */
    public function pushAsync($name, $message, $flags = Channel::MODE_DEFAULT)
    {
        $protocol = $this->createMessageProtocol($message);
        $names = (array) $name;
        $handlers = [];

        foreach ($names as $name)
        {
            $handlers[] = $this->handlePushAsync($name, $protocol, $flags);
        }

        return !isset($handlers[0]) || isset($handlers[1]) ? $handlers : $handlers[0];
    }

    /**
     * @param string|string[] $name
     * @param string|string[]|ChannelProtocolInterface $message
     * @param int $flags
     * @param callable|null $success
     * @param callable|null $failure
     * @param callable|null $cancel
     * @param float $timeout
     * @return bool|bool[]
     */
    public function sendRequest($name, $message, $flags = Channel::MODE_DEFAULT, callable $success = null, callable $failure = null, callable $cancel = null, $timeout = 0.0)
    {
        $protocol = $this->createMessageProtocol($message);
        $names = (array) $name;
        $handlers = [];

        foreach ($names as $name)
        {
            $handlers[] = $this->handleSendRequest($name, $protocol, $flags, $success, $failure, $cancel, $timeout);
        }

        return !isset($handlers[0]) || isset($handlers[1]) ? $handlers : $handlers[0];
    }

    /**
     * @param string|string[] $name
     * @param string|string[]|ChannelProtocolInterface $message
     * @param int $flags
     * @param callable|null $success
     * @param callable|null $failure
     * @param callable|null $cancel
     * @param float $timeout
     * @return ChannelRequest|ChannelRequest[]|null|null[]
     */
    public function pushRequest($name, $message, $flags = Channel::MODE_DEFAULT, callable $success = null, callable $failure = null, callable $cancel = null, $timeout = 0.0)
    {
        $protocol = $this->createMessageProtocol($message);
        $names = (array) $name;
        $handlers = [];

        foreach ($names as $name)
        {
            $handlers[] = $this->handlePushRequest($name, $protocol, $flags, $success, $failure, $cancel, $timeout);
        }

        return !isset($handlers[0]) || isset($handlers[1]) ? $handlers : $handlers[0];
    }

    /**
     * @param string $sender
     * @param ChannelProtocolInterface $protocol
     */
    public function receive($sender, ChannelProtocolInterface $protocol)
    {
        if ($this->handleReceiveRequest($protocol))
        {
            return;
        }

        if ($this->handleReceiveResponse($protocol) || $this->input()->handle($sender, $protocol))
        {
            $this->emit('input', [ $sender, $protocol ]);
        }
    }

    /**
     * @param string $sender
     * @param ChannelProtocolInterface $protocol
     */
    public function pull($sender, ChannelProtocolInterface $protocol)
    {
        $this->emit('input', [ $sender, $protocol ]);
    }

    /**
     * @param string|string[]|null $name
     * @return bool|bool[]
     */
    public function isConnected($name = null)
    {
        if (is_array($name))
        {
            $statuses = [];

            foreach ($name as $singleName)
            {
                $statuses[] = $this->model->isConnected($singleName);
            }

            return $statuses;
        }

        return $this->model->isConnected($name);
    }

    /**
     * @return string[]
     */
    public function getConnected()
    {
        return $this->model->getConnected();
    }

    /**
     * @param string|string[] $name
     * @return string[]
     */
    public function matchConnected($name)
    {
        return StringSupport::find($name, $this->getConnected());
    }

    /**
     * @return string
     */
    protected function genId()
    {
        return $this->uniqid . $this->nextCounter();
    }

    /**
     * @return float
     */
    protected function now()
    {
        return TimeSupport::now();
    }

    /**
     * @return string
     */
    protected function nextCounter()
    {
        if (++$this->counter > 2e9)
        {
            $this->counter = 0;
        }

        return (string) $this->counter;
    }

    /**
     * @param string|string[] $message
     * @return ChannelProtocolInterface
     */
    protected function createMessageProtocol($message)
    {
        if (!($message instanceof ChannelProtocolInterface))
        {
            $message = $this->createProtocol($message);
        }
        else
        {
            if ($message->getPid() === '')
            {
                $message->setPid($this->genId());
            }
            if ($message->getOrigin() === '')
            {
                $message->setOrigin($this->name());
            }
            if ($message->getTimestamp() == 0)
            {
                $message->setTimestamp($this->now());
            }
        }

        return $message;
    }

    /**
     * @param string $name
     * @param ChannelProtocolInterface $message
     * @param int $flags
     * @return bool
     */
    protected function handleSendAsync($name, $message, $flags = Channel::MODE_DEFAULT)
    {
        if ($message->getType() === '')
        {
            $message->setType(Channel::TYPE_SND);
        }
        if ($message->getDestination() === '')
        {
            $message->setDestination($name);
        }

        return $this->output()->handle($name, $message, $flags);
    }

    /**
     * @param string $name
     * @param ChannelProtocolInterface $message
     * @param int $flags
     * @return bool
     */
    protected function handlePushAsync($name, $message, $flags = Channel::MODE_DEFAULT)
    {
        if ($message->getType() === '')
        {
            $message->setType(Channel::TYPE_SND);
        }
        if ($message->getDestination() === '')
        {
            $message->setDestination($name);
        }

        $status = $this->model->unicast(
            $name,
            $this->encoder->with($message)->encode(),
            $flags
        );

        if ($status)
        {
            $this->resolveOrRejectResponse($message->getPid(), $message->getException());
            $this->emit('output', [ $name, $message ]);
        }

        return $status;
    }

    /**
     * @param string|string[] $name
     * @param ChannelProtocolInterface $message
     * @param int $flags
     * @param callable|null $success
     * @param callable|null $failure
     * @param callable|null $cancel
     * @param float $timeout
     * @return bool
     */
    protected function handleSendRequest($name, $message, $flags = Channel::MODE_DEFAULT, callable $success = null, callable $failure = null, callable $cancel = null, $timeout = 0.0)
    {
        if ($message->getType() === '')
        {
            $message->setType(Channel::TYPE_REQ);
        }
        if ($message->getDestination() === '')
        {
            $message->setDestination($name);
        }

        return $this->output()->handle($name, $message, $flags, $success, $failure, $cancel, $timeout);
    }

    /**
     * @param string|string[] $name
     * @param ChannelProtocolInterface $message
     * @param int $flags
     * @param callable|null $success
     * @param callable|null $failure
     * @param callable|null $cancel
     * @param float $timeout
     * @return ChannelRequest|null
     */
    protected function handlePushRequest($name, $message, $flags = Channel::MODE_DEFAULT, callable $success = null, callable $failure = null, callable $cancel = null, $timeout = 0.0)
    {
        if ($message->getType() === '')
        {
            $message->setType(Channel::TYPE_REQ);
        }
        if ($message->getDestination() === '')
        {
            $message->setDestination($name);
        }

        $status = $this->model->unicast(
            $name,
            $this->encoder->with($message)->encode(),
            $flags
        );

        if (!$status)
        {
            if ($cancel !== null)
            {
                $cancel(new LogicException('Request could not be sent.'));
            }

            return null;
        }

        $pid = $message->getPid();
        $request = $this->createRequest($pid, $success, $failure, $cancel, $timeout);
        $this->addRequest($pid, $request);

        $this->emit('output', [ $name, $message ]);

        return $request;
    }

    /**
     * @internal
     * @param string $sender
     * @param string[] $multipartMessage
     */
    public function handleReceive($sender, $multipartMessage)
    {
        $protocol = $this->encoder
            ->with(new ChannelProtocol())
            ->decode(implode('', $multipartMessage));

        if ($this->handleReceiveRequest($protocol))
        {
            return;
        }

        if ($this->handleReceiveResponse($protocol) || $this->input()->handle($sender, $protocol))
        {
            $this->emit('input', [ $sender, $protocol ]);
        }
    }

    /**
     * @param ChannelProtocolInterface
     * @return bool
     */
    protected function handleReceiveRequest(ChannelProtocolInterface $protocol)
    {
        if ($protocol->getType() === Channel::TYPE_REQ && $protocol->getDestination() === $this->name())
        {
            $pid = $protocol->getPid();
            $timestamp = $protocol->getTimestamp();
            $now = $this->now();

            if ($timestamp <= $now || $this->existsResponse($pid))
            {
                return true;
            }

            $timestamp -= 5e3;
            $this->addResponse($pid, $this->createResponse($pid, $protocol->getOrigin(), $timestamp, $timestamp - $now));
        }

        return false;
    }

    /**
     * @param ChannelProtocolInterface $protocol
     * @return bool
     */
    protected function handleReceiveResponse(ChannelProtocolInterface $protocol)
    {
        $pid = $protocol->getPid();

        if (!$this->existsRequest($pid))
        {
            return false;
        }

        $message = $protocol->getMessage();
        $exception = $protocol->getException();

        if ($exception === '')
        {
            $this->resolveRequest($pid, $message);
        }
        else if ($exception === 'Surume\Throwable\Exception\System\TaskIncompleteException')
        {
            $this->cancelRequest($pid, new LazyException([ $exception, $message ]));
        }
        else
        {
            $this->rejectRequest($pid, new LazyException([ $exception, $message ]));
        }

        return true;
    }

    /**
     *
     */
    private function registerPeriodicTimers()
    {
        $this->reqsHelperTimer = $this->loop->addPeriodicTimer(0.1, function() {
            $this->expireRequests();
        });
        $this->repsHelperTimer = $this->loop->addPeriodicTimer(0.1, function() {
            $this->expireResponses();
            $unfinished = $this->unfinishedResponses();

            foreach ($unfinished as $response)
            {
                $protocol = new ChannelProtocol('', $response->pid(), '', $response->alias(), '', '', $this->now());
                $response = new Response($this, $protocol, new TaskIncompleteException("Task unfinished."));
                $response->call();
            }
        });
    }

    /**
     *
     */
    private function unregisterPeriodicTimers()
    {
        $this->reqsHelperTimer->cancel();
        $this->repsHelperTimer->cancel();
    }

    /**
     *
     */
    private function registerEvents()
    {
        $this->handlers = $this->model->copyEvents($this, [ 'start', 'stop', 'connect', 'disconnect' ]);
        $this->handlers[] = $this->model->on('recv', [ $this, 'handleReceive' ]);
    }

    /**
     *
     */
    private function unregisterEvents()
    {
        foreach ($this->handlers as $handler)
        {
            $handler->cancel();
        }
    }
}


text:
<!DOCTYPE html>

	<meta charset="UTF-8">
	<title>Autenticação de usuário</title>
	<link rel="stylesheet" href="<?=base_url()?>assets/css/bootstrap.css">

		<?php if ($retorno == 1) { ?>

Usuário logado com sucesso

		<?php } else { ?>

Usuário ou senha inválida

		<?php } ?>


text:
title: "RTL - Right To Left"
---

RTL is used for displaying languages that go from Right to Left, eg Hebrew and Arabic. To get AG Grid to display in RTL format, set the property `enableRtl=true`.

## Simple Example

Below shows a simple example of a grid using RTL. To make it look better we should really be using an RTL language, however none of us in AG Grid knows any RTL languages, so we are sticking with English.

<grid-example title='RTL Simple' name='rtl-simple' type='generated'></grid-example>

## Complex Example

Below shows a more complex example. It's the same example as used on the AG Grid main demo page. To demonstrate all the edge cases of RTL, the tool panel and pinned areas are shown. This example is using AG Grid Enterprise - hence the tool panel and context menu's are active.

<grid-example title='RTL Complex' name='rtl-complex' type='vanilla' options='{ "enterprise": true }'></grid-example>

## How it Works

If you are creating your own theme, knowing how the RTL is implemented will be useful.

### CSS Styling

The following CSS classes are added to the grid when RTL is on and off:

- **ag-rtl**: Added when RTL is ON. It sets the style `'direction=rtl'`.
- **ag-ltr**: Added when RTL is OFF. It sets the style `'direction=ltr'`.

You can see these classes by inspecting the DOM of AG Grid. A lot of the layout of the grid is reversed with this simple CSS class change.

Themes then also use these styles for adding different values based on whether RTL is used or NOT. For example, the following is used inside the provided themes:

```css
// selection checkbox gets 4px padding to the RIGHT when LTR
.ag-ltr .ag-selection-checkbox {
    padding-right 4px;
}

// selection checkbox gets 4px padding to the LEFT when RTL
.ag-rtl .ag-selection-checkbox {
    padding-left 4px;
}
```

## Pinning and Scroll Bars

Under normal operation, when columns are pinned to the right, the vertical scroll will appear alongside the right pinned panel. For RTL the scroll will appear on the left pinned panel when left pinning columns.

##  Layout of Columns

The grid normally lays the columns out from left to right. When doing RTL the columns go from the right to the left. If the grid was using normal HTML layout, then the columns would all reverse by themselves, however the grid used Column Visualisation, so it needs to know exactly where each column is. Hence there is a lot of math logic inside AG Grid that is tied with the scrolling. Not only is the scrolling inverted, all the maths logic is inverted also. All of this is taken care of for you inside AG Grid. Once `enableRtl=true` is set, the grid will know to use the RTL varient of all the calculations.


text:
package gw.lang.reflect;

import gw.lang.reflect.java.GosuTypes;

/**
 */
public interface IDynamicType extends IType, IPlaceholder {
  String PKG = "dynamic";
  String RNAME = "Dynamic";
  String QNAME = PKG +'.'+ RNAME;

  static IDynamicType instance() {
    return (IDynamicType)GosuTypes.DYNAMIC();
  }
}


text:
using Org.Apache.Reef.Driver.Context;
using Org.Apache.Reef.Driver.Evaluator;
using Org.Apache.Reef.Utilities;
using Org.Apache.Reef.Utilities.Logging;
using Org.Apache.Reef.Tang.Formats;
using Org.Apache.Reef.Tang.Interface;
using System;
using System.Runtime.Serialization;

namespace Org.Apache.Reef.Driver.Bridge
{
    [DataContract]
    internal class ActiveContext : IActiveContext
    {
        private static readonly Logger LOGGER = Logger.GetLogger(typeof(ActiveContext));

        private readonly AvroConfigurationSerializer _serializer;

        public ActiveContext(IActiveContextClr2Java clr2Java)
        {
            InstanceId = Guid.NewGuid().ToString("N");
            Clr2Java = clr2Java;
            _serializer = new AvroConfigurationSerializer();
        }

        [DataMember]
        public string InstanceId { get; set; }

        public string Id
        {
            get
            {
                return Clr2Java.GetId();
            }

            set
            {
            }
        }

        public string EvaluatorId
        {
            get
            {
                return Clr2Java.GetEvaluatorId();
            }

            set
            {
            }
        }

        public Optional<string> ParentId { get; set; }

        public IEvaluatorDescriptor EvaluatorDescriptor
        {
            get
            {
                return Clr2Java.GetEvaluatorDescriptor();
            }

            set
            {
            }
        }

        private IActiveContextClr2Java Clr2Java { get; set; }

        public void SubmitTask(IConfiguration taskConfiguration)
        {
            LOGGER.Log(Level.Info, "ActiveContext::SubmitTask");
            string task = _serializer.ToString(taskConfiguration);
            LOGGER.Log(Level.Info, "serialized taskConfiguration: " + task);
            Clr2Java.SubmitTask(task);
        }

        public void Dispose()
        {
            LOGGER.Log(Level.Info, "ActiveContext::Dispose");
            Clr2Java.Close();
        }

        public void SubmitContext(IConfiguration contextConfiguration)
        {
            throw new NotImplementedException();
        }

        public void SubmitContextAndService(IConfiguration contextConfiguration, IConfiguration serviceConfiguration)
        {
            throw new NotImplementedException();
        }

        public void SendMessage(byte[] message)
        {
            throw new NotImplementedException();
        }
    }
}


text:
using FlightNode.Common.Exceptions;
using Xunit;

namespace FlightNode.Common.UnitTests.Exceptions
{
    public class DatabaseExceptionContentTests
    {
        [Fact]
        public void ConfirmGetAndSetForId()
        {
            var expected = 2234;

            var system = new DatabaseExceptionContent();

            system.Id = expected;

            var actual = system.Id;

            Assert.Equal(expected, actual);
        }

        [Fact]
        public void ConfirmGetAndSetForIdAsNull()
        {
            var system = new DatabaseExceptionContent();

            system.Id = null;

            Assert.Null(system.Id);
        }

        [Fact]
        public void ConfirmGetAndSetForAction()
        {
            var expected = "2234";

            var system = new DatabaseExceptionContent();

            system.Action = expected;

            var actual = system.Action;

            Assert.Equal(expected, actual);
        }

        [Fact]
        public void ConfirmGetAndSetForModelType()
        {
            var expected = this.GetType();

            var system = new DatabaseExceptionContent();

            system.ModelType = expected;

            var actual = system.ModelType;

            Assert.Equal(expected, actual);
        }

        [Fact]
        public void ConfirmGetAndSetForDescription()
        {
            var expected = "2234";

            var system = new DatabaseExceptionContent();

            system.Description = expected;

            var actual = system.Description;

            Assert.Equal(expected, actual);
        }
    }
}


text:
<!DOCTYPE html>

  <meta charset="utf-8" />

  <title>
  Category → JavaScript

   | Il y a du thé renversé au bord de la table !
</title>

  <meta name="author" content="David Teller" />
  <meta name="description" content="Aventure! Excitement! Random ramblings by David Teller!" />

  <meta name="twitter:card" content="summary" />
  <meta name="twitter:site" content="@ImYoric" />
  <meta name="twitter:title" content="Il y a du thé renversé au bord de la table !" />
  <meta name="twitter:description" content="Aventure! Excitement! Random ramblings by David Teller!" />
  <meta name="twitter:image" content="https://yoric.github.io/img/avatar.jpg" />

  <meta property="og:type" content="website" />
  <meta property="og:title" content="Il y a du thé renversé au bord de la table !" />
  <meta property="og:description" content="Aventure! Excitement! Random ramblings by David Teller!" />
  <meta property="og:url" content="https://yoric.github.io/categories/javascript/" />
  <meta property="og:image" content="https://yoric.github.io/img/avatar.jpg" />

<meta name="generator" content="Hugo 0.75.1" />

<link rel="canonical" href="https://yoric.github.io/categories/javascript/" />
<link rel="alternative" href="https://yoric.github.io/index.xml" title="Il y a du thé renversé au bord de la table !" type="application/atom+xml" />

<meta name="renderer" content="webkit" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta name="format-detection" content="telephone=no,email=no,adress=no" />
<meta http-equiv="Cache-Control" content="no-transform" />

<meta name="robots" content="index,follow" />
<meta name="referrer" content="origin-when-cross-origin" />

<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="apple-mobile-web-app-title" content="Il y a du thé renversé au bord de la table !" />
<meta name="msapplication-tooltip" content="Il y a du thé renversé au bord de la table !" />
<meta name='msapplication-navbutton-color' content="#5fbf5e" />
<meta name="msapplication-TileColor" content="#5fbf5e" />
<meta name="msapplication-TileImage" content="/img/tile-image-windows.png" />
<link rel="icon" href="https://yoric.github.io/img/favicon.ico" />
<link rel="icon" type="image/png" sizes="16x16" href="https://yoric.github.io/img/favicon-16x16.png" />
<link rel="icon" type="image/png" sizes="32x32" href="https://yoric.github.io/img/favicon-32x32.png" />
<link rel="icon" sizes="192x192" href="https://yoric.github.io/img/touch-icon-android.png" />
<link rel="apple-touch-icon" href="https://yoric.github.io/img/touch-icon-apple.png" />
<link rel="mask-icon" href="https://yoric.github.io/img/safari-pinned-tab.svg" color="#5fbf5e" />

<link rel="stylesheet" href="//cdn.bootcss.com/video.js/6.2.8/alt/video-js-cdn.min.css" />

<link rel="stylesheet" href="https://yoric.github.io/css/bundle.css" />

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css">

Il y a du thé renversé au bord de la table !

Aventure! Excitement! Random ramblings by David Teller!

  <button class="menu-toggle" type="button">

  </button>

Main Menu

            Home

            About

            Categories

            Tags

Social Networks

Posts List

The BinAST diaries - Compression, part 1

@David Teller · Feb 28, 2019 · 7 min read

If you have been following the work on the JavaScript Binary AST, you probably realized that we haven't been communicating much recently. Sorry about that, we've been busy iterating on it!
In this blog entry, I'd like to talk to you about our current main focus: file compression.

    Read More →

JavaScript Binary AST diaries - How to replace proving with validating for fun and profit

@David Teller · Feb 23, 2018 · 8 min read

In this entry, I'd like to discuss one of the most interesting and unusual aspects of the Binary AST: how we gain performance by turning proof-building into validation, and why this is very good news for performance (and maybe not so good news for file size).

    Read More →

Binary AST - Motivations and Design Decisions - Part 1

@Kannan Vijayan, Mike Hoye · Sep 7, 2017 · 14 min read

"The key to making programs fast is to make them do practically nothing." - Mike Haertel, creator of GNU Grep.
Binary AST - "Binary Abstract Syntax Tree" - is Mozilla's proposal for specifying a binary-encoded syntax for JS with the intent of allowing browsers and other JS-executing environments to parse and load code as much as 80% faster than standard minified JS.
It has recently cleared Stage 1 of the TC39 standards process, and while the final byte-level format isn't completely nailed down, we're confident that the final implementation will deliver the impressive performance improvements promised by the prototype.

    Read More →

JavaScript Binary AST Engineering Newsletter #1

@David Teller · Aug 18, 2017 · 4 min read

Hey, all cool kids have exciting Engineering Newsletters these days, so it's high time the JavaScript Binary AST got one!
Summary JavaScript Binary AST is a joint project between Mozilla and Facebook to rethink how JavaScript source code is stored/transmitted/parsed. We expect that this project will help visibly speed up the loading of large codebases of JS applications and will have a large impact on the JS development community, including both web developers, Node developers, add-on developers and ourselves.

    Read More →

Towards a JavaScript Binary AST

@David Teller · Aug 3, 2017 · 11 min read

In this blog post, I would like to introduce the JavaScript Binary AST, an ongoing project that we hope will help make webpages load faster, along with a number of other benefits.
A little background Over the years, JavaScript has grown from one of the slowest scripting languages available to a high-performance powerhouse, fast enough that it can run desktop, server, mobile and even embedded applications, whether through web browsers or other environments.

    Read More →

© 2017-2020 Il y a du thé renversé au bord de la table !

Powered by Hugo with theme Nuo.


text:
from qqweibo.auth import OAuthHandler
from qqweibo.api import API
from qqweibo.parsers import (ModelParser, JSONParser, XMLRawParser,
                             XMLDomParser, XMLETreeParser)
from qqweibo.error import QWeiboError
from qqweibo.cache import MemoryCache, FileCache

__all__ = ['OAuthHandler', 'API', 'QWeiboError', 'version',
           'XMLRawParser', 'XMLDomParser', 'XMLETreeParser',
           'ModelParser', 'JSONParser',
           'MemoryCache', 'FileCache']

version = '0.3.9'


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;

namespace Nether.Data.Identity
{
    [DebuggerDisplay("User ({UserId})")]
    public class User
    {
        public string UserId { get; set; }
        public bool IsActive { get; set; }
        public string Role { get; set; }

        public ICollection<Login> Logins { get; set; }
    }
}


text:
require 'pathname'

Puppet::Type.newtype(:dsc_spuserprofilesyncconnection) do
  require Pathname.new(__FILE__).dirname + '../../' + 'puppet/type/base_dsc'
  require Pathname.new(__FILE__).dirname + '../../puppet_x/puppetlabs/dsc_type_helpers'

  @doc = %q{
    The DSC SPUserProfileSyncConnection resource type.
    Automatically generated from
    'SharePointDsc/DSCResources/MSFT_SPUserProfileSyncConnection/MSFT_SPUserProfileSyncConnection.schema.mof'

    To learn more about PowerShell Desired State Configuration, please
    visit https://technet.microsoft.com/en-us/library/dn249912.aspx.

    For more information about built-in DSC Resources, please visit
    https://technet.microsoft.com/en-us/library/dn249921.aspx.

    For more information about xDsc Resources, please visit
    https://github.com/PowerShell/DscResources.
  }

  validate do
      fail('dsc_name is a required attribute') if self[:dsc_name].nil?
    end

  def dscmeta_resource_friendly_name; 'SPUserProfileSyncConnection' end
  def dscmeta_resource_name; 'MSFT_SPUserProfileSyncConnection' end
  def dscmeta_module_name; 'SharePointDsc' end
  def dscmeta_module_version; '1.4.0.0' end

  newparam(:name, :namevar => true ) do
  end

  ensurable do
    newvalue(:exists?) { provider.exists? }
    newvalue(:present) { provider.create }
    defaultto { :present }
  end

  # Name:         PsDscRunAsCredential
  # Type:         MSFT_Credential
  # IsMandatory:  False
  # Values:       None
  newparam(:dsc_psdscrunascredential) do
    def mof_type; 'MSFT_Credential' end
    def mof_is_embedded?; true end
    desc "PsDscRunAsCredential"
    validate do |value|
      unless value.kind_of?(Hash)
        fail("Invalid value '#{value}'. Should be a hash")
      end
      PuppetX::Dsc::TypeHelpers.validate_MSFT_Credential("Credential", value)
    end
  end

  # Name:         Name
  # Type:         string
  # IsMandatory:  True
  # Values:       None
  newparam(:dsc_name) do
    def mof_type; 'string' end
    def mof_is_embedded?; false end
    desc "Name - The name of the connection"
    isrequired
    validate do |value|
      unless value.kind_of?(String)
        fail("Invalid value '#{value}'. Should be a string")
      end
    end
  end

  # Name:         Forest
  # Type:         string
  # IsMandatory:  False
  # Values:       None
  newparam(:dsc_forest) do
    def mof_type; 'string' end
    def mof_is_embedded?; false end
    desc "Forest - The name of the AD forest to read from"
    validate do |value|
      unless value.kind_of?(String)
        fail("Invalid value '#{value}'. Should be a string")
      end
    end
  end

  # Name:         UserProfileService
  # Type:         string
  # IsMandatory:  False
  # Values:       None
  newparam(:dsc_userprofileservice) do
    def mof_type; 'string' end
    def mof_is_embedded?; false end
    desc "UserProfileService - The name of the user profile service that this connection is attached to"
    validate do |value|
      unless value.kind_of?(String)
        fail("Invalid value '#{value}'. Should be a string")
      end
    end
  end

  # Name:         ConnectionCredentials
  # Type:         MSFT_Credential
  # IsMandatory:  False
  # Values:       None
  newparam(:dsc_connectioncredentials) do
    def mof_type; 'MSFT_Credential' end
    def mof_is_embedded?; true end
    desc "ConnectionCredentials - The credentials to connect to Active Directory with"
    validate do |value|
      unless value.kind_of?(Hash)
        fail("Invalid value '#{value}'. Should be a hash")
      end
      PuppetX::Dsc::TypeHelpers.validate_MSFT_Credential("ConnectionCredentials", value)
    end
  end

  # Name:         IncludedOUs
  # Type:         string[]
  # IsMandatory:  False
  # Values:       None
  newparam(:dsc_includedous, :array_matching => :all) do
    def mof_type; 'string[]' end
    def mof_is_embedded?; false end
    desc "IncludedOUs - A listo f the OUs to import users from"
    validate do |value|
      unless value.kind_of?(Array) || value.kind_of?(String)
        fail("Invalid value '#{value}'. Should be a string or an array of strings")
      end
    end
    munge do |value|
      Array(value)
    end
  end

  # Name:         ExcludedOUs
  # Type:         string[]
  # IsMandatory:  False
  # Values:       None
  newparam(:dsc_excludedous, :array_matching => :all) do
    def mof_type; 'string[]' end
    def mof_is_embedded?; false end
    desc "ExcludedOUs - A list of the OUs to ignore users from"
    validate do |value|
      unless value.kind_of?(Array) || value.kind_of?(String)
        fail("Invalid value '#{value}'. Should be a string or an array of strings")
      end
    end
    munge do |value|
      Array(value)
    end
  end

  # Name:         Server
  # Type:         string
  # IsMandatory:  False
  # Values:       None
  newparam(:dsc_server) do
    def mof_type; 'string' end
    def mof_is_embedded?; false end
    desc "Server - The specific AD server to connect to"
    validate do |value|
      unless value.kind_of?(String)
        fail("Invalid value '#{value}'. Should be a string")
      end
    end
  end

  # Name:         UseSSL
  # Type:         boolean
  # IsMandatory:  False
  # Values:       None
  newparam(:dsc_usessl) do
    def mof_type; 'boolean' end
    def mof_is_embedded?; false end
    desc "UseSSL - Should SSL be used for the connection"
    validate do |value|
    end
    newvalues(true, false)
    munge do |value|
      PuppetX::Dsc::TypeHelpers.munge_boolean(value.to_s)
    end
  end

  # Name:         Force
  # Type:         boolean
  # IsMandatory:  False
  # Values:       None
  newparam(:dsc_force) do
    def mof_type; 'boolean' end
    def mof_is_embedded?; false end
    desc "Force - Set to true to run the set method on every call to this resource"
    validate do |value|
    end
    newvalues(true, false)
    munge do |value|
      PuppetX::Dsc::TypeHelpers.munge_boolean(value.to_s)
    end
  end

  # Name:         ConnectionType
  # Type:         string
  # IsMandatory:  False
  # Values:       ["ActiveDirectory", "BusinessDataCatalog"]
  newparam(:dsc_connectiontype) do
    def mof_type; 'string' end
    def mof_is_embedded?; false end
    desc "ConnectionType - The type of the connection - currently only Active Directory is supported Valid values are ActiveDirectory, BusinessDataCatalog."
    validate do |value|
      unless value.kind_of?(String)
        fail("Invalid value '#{value}'. Should be a string")
      end
      unless ['ActiveDirectory', 'activedirectory', 'BusinessDataCatalog', 'businessdatacatalog'].include?(value)
        fail("Invalid value '#{value}'. Valid values are ActiveDirectory, BusinessDataCatalog")
      end
    end
  end

  # Name:         InstallAccount
  # Type:         MSFT_Credential
  # IsMandatory:  False
  # Values:       None
  newparam(:dsc_installaccount) do
    def mof_type; 'MSFT_Credential' end
    def mof_is_embedded?; true end
    desc "InstallAccount - POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5"
    validate do |value|
      unless value.kind_of?(Hash)
        fail("Invalid value '#{value}'. Should be a hash")
      end
      PuppetX::Dsc::TypeHelpers.validate_MSFT_Credential("InstallAccount", value)
    end
  end

  def builddepends
    pending_relations = super()
    PuppetX::Dsc::TypeHelpers.ensure_reboot_relationship(self, pending_relations)
  end
end

Puppet::Type.type(:dsc_spuserprofilesyncconnection).provide :powershell, :parent => Puppet::Type.type(:base_dsc).provider(:powershell) do
  confine :true => (Gem::Version.new(Facter.value(:powershell_version)) >= Gem::Version.new('5.0.10240.16384'))
  defaultfor :operatingsystem => :windows

  mk_resource_methods
end


text:
'use strict';
// Flags: --expose_gc

const common = require('../common');
const assert = require('assert');
const tick = require('../common/tick');

const { createHook, AsyncResource } = require('async_hooks');

// Test priority of destroy hook relative to nextTick,... and
// verify a microtask is scheduled in case a lot items are queued

const resType = 'MyResource';
let activeId = -1;
createHook({
  init(id, type) {
    if (type === resType) {
      assert.strictEqual(activeId, -1);
      activeId = id;
    }
  },
  destroy(id) {
    if (activeId === id) {
      activeId = -1;
    }
  }
}).enable();

function testNextTick() {
  assert.strictEqual(activeId, -1);
  const res = new AsyncResource(resType);
  assert.strictEqual(activeId, res.asyncId());
  res.emitDestroy();
  // nextTick has higher prio than emit destroy
  process.nextTick(common.mustCall(() =>
    assert.strictEqual(activeId, res.asyncId()))
  );
}

function testQueueMicrotask() {
  assert.strictEqual(activeId, -1);
  const res = new AsyncResource(resType);
  assert.strictEqual(activeId, res.asyncId());
  res.emitDestroy();
  // queueMicrotask has higher prio than emit destroy
  queueMicrotask(common.mustCall(() =>
    assert.strictEqual(activeId, res.asyncId()))
  );
}

function testImmediate() {
  assert.strictEqual(activeId, -1);
  const res = new AsyncResource(resType);
  assert.strictEqual(activeId, res.asyncId());
  res.emitDestroy();
  setImmediate(common.mustCall(() =>
    assert.strictEqual(activeId, -1))
  );
}

function testPromise() {
  assert.strictEqual(activeId, -1);
  const res = new AsyncResource(resType);
  assert.strictEqual(activeId, res.asyncId());
  res.emitDestroy();
  // Promise has higher prio than emit destroy
  Promise.resolve().then(common.mustCall(() =>
    assert.strictEqual(activeId, res.asyncId()))
  );
}

async function testAwait() {
  assert.strictEqual(activeId, -1);
  const res = new AsyncResource(resType);
  assert.strictEqual(activeId, res.asyncId());
  res.emitDestroy();

  for (let i = 0; i < 5000; i++) {
    await Promise.resolve();
  }
  global.gc();
  await Promise.resolve();
  // Limit to trigger a microtask not yet reached
  assert.strictEqual(activeId, res.asyncId());
  for (let i = 0; i < 5000; i++) {
    await Promise.resolve();
  }
  global.gc();
  await Promise.resolve();
  assert.strictEqual(activeId, -1);
}

testNextTick();
tick(2, testQueueMicrotask);
tick(4, testImmediate);
tick(6, testPromise);
tick(8, () => testAwait().then(common.mustCall()));


text:
import logging
import sys

from telemetry import all_page_interactions # pylint: disable=W0611
from telemetry import browser_finder
from telemetry import browser_options
from telemetry import discover
from telemetry import multi_page_benchmark
from telemetry import page_runner
from telemetry import page_set
from telemetry import page_test
from telemetry import wpr_modes

class RecordPage(page_test.PageTest):
  def __init__(self, benchmarks):
    # This class overwrites PageTest.Run, so that the test method name is not
    # really used (except for throwing an exception if it doesn't exist).
    super(RecordPage, self).__init__('Run')
    self._interaction_names = set(
        [benchmark().interaction_name_to_run
         for benchmark in benchmarks.values()
         if benchmark().interaction_name_to_run])

  def CanRunForPage(self, page):
    return not not self._InteractionsForPage(page)

  def CustomizeBrowserOptionsForPage(self, page, options):
    for interaction in self._InteractionsForPage(page):
      interaction.CustomizeBrowserOptions(options)

  def Run(self, options, page, tab, results):
    # Run the interactions for all benchmarks. Reload the page between
    # interactions.
    should_reload = False
    for interaction in self._InteractionsForPage(page):
      if should_reload:
        tab.page.Navigate(page.url)
        tab.WaitForDocumentReadyStateToBeComplete()
      interaction.PerformInteraction(page, tab)
      should_reload = True

  def _InteractionsForPage(self, page):
    interactions = []
    for interaction_name in self._interaction_names:
      if not hasattr(page, interaction_name):
        continue
      interaction_data = getattr(page, interaction_name)
      interactions.append(all_page_interactions.FindClassWithName(
          interaction_data['action'])(interaction_data))
    return interactions

def Main(benchmark_dir):
  benchmarks = discover.Discover(benchmark_dir, '',
                                 multi_page_benchmark.MultiPageBenchmark)
  options = browser_options.BrowserOptions()
  parser = options.CreateParser('%prog <page_set>')

  recorder = RecordPage(benchmarks)
  recorder.AddCommandLineOptions(parser)

  _, args = parser.parse_args()

  if len(args) != 1:
    parser.print_usage()
    sys.exit(1)

  ps = page_set.PageSet.FromFile(args[0])

  options.wpr_mode = wpr_modes.WPR_RECORD
  recorder.CustomizeBrowserOptions(options)
  possible_browser = browser_finder.FindBrowser(options)
  if not possible_browser:
    print >> sys.stderr, """No browser found.\n
Use --browser=list to figure out which are available.\n"""
    sys.exit(1)
  results = page_test.PageTestResults()
  with page_runner.PageRunner(ps) as runner:
    runner.Run(options, possible_browser, recorder, results)

  if len(results.page_failures):
    logging.warning('Failed pages: %s', '\n'.join(
        [failure['page'].url for failure in results.page_failures]))

  if len(results.skipped_pages):
    logging.warning('Skipped pages: %s', '\n'.join(
        [skipped['page'].url for skipped in results.skipped_pages]))
  return min(255, len(results.page_failures))


text:
div, img, i, span {
  position: relative;
  float: left;
  display: block;
}


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

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"
><TITLE
>Qtc.Enums.Gui.QDockWidget</TITLE
><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css"
>

Qtc.Enums.Gui.QDockWidget

type DockWidgetFeature

type DockWidgetFeatures

eDockWidgetClosable

fDockWidgetClosable

eDockWidgetMovable

fDockWidgetMovable

eDockWidgetFloatable

fDockWidgetFloatable

eDockWidgetVerticalTitleBar

fDockWidgetVerticalTitleBar

eDockWidgetFeatureMask

fDockWidgetFeatureMask

eAllDockWidgetFeatures

fAllDockWidgetFeatures

eNoDockWidgetFeatures

fNoDockWidgetFeatures

fReserved


text:
TOML
====

Original repository: https://github.com/uiri/toml

See also https://github.com/mojombo/toml

Python module which parses and emits TOML.

Released under the MIT license.

Passes https://github.com/avakar/toml-test (fork of https://github.com/BurntSushi/toml-test )

See http://j.xqz.ca/toml-status for up to date test results.

Current Version of the Specification
------------------------------------

https://github.com/mojombo/toml/blob/v0.4.0/README.md

QUICK GUIDE
-----------

``pip install toml``

toml.loads --- takes a string to be parsed as toml and returns the corresponding dictionary

toml.dumps --- takes a dictionary and returns a string which is the contents of the corresponding toml file.

There are other functions which I use to dump and load various fragments of toml but dumps and loads will cover most usage.

Example usage:

.. code:: python

  import toml

  with open("conf.toml") as conffile:
      config = toml.loads(conffile.read())
  # do stuff with config here
  . . .


text:
using System;
using System.Globalization;
using System.Runtime.CompilerServices;

namespace YAF.Lucene.Net.Codecs.Lucene3x
{

    using SegmentInfo = YAF.Lucene.Net.Index.SegmentInfo;

    /// <summary>
    /// Lucene3x ReadOnly <see cref="SegmentInfoFormat"/> implementation.
    /// <para/>
    /// @lucene.experimental
    /// </summary>
    [Obsolete("(4.0) this is only used to read indexes created before 4.0.")]
    public class Lucene3xSegmentInfoFormat : SegmentInfoFormat
    {
        private readonly SegmentInfoReader reader = new Lucene3xSegmentInfoReader();

        /// <summary>
        /// This format adds optional per-segment String
        /// diagnostics storage, and switches userData to Map.
        /// </summary>
        public static readonly int FORMAT_DIAGNOSTICS = -9;

        /// <summary>
        /// Each segment records whether it has term vectors. </summary>
        public static readonly int FORMAT_HAS_VECTORS = -10;

        /// <summary>
        /// Each segment records the Lucene version that created it. </summary>
        public static readonly int FORMAT_3_1 = -11;

        /// <summary>
        /// Extension used for saving each SegmentInfo, once a 3.x
        /// index is first committed to with 4.0.
        /// </summary>
        public static readonly string UPGRADED_SI_EXTENSION = "si";

        public static readonly string UPGRADED_SI_CODEC_NAME = "Lucene3xSegmentInfo";
        public static readonly int UPGRADED_SI_VERSION_START = 0;
        public static readonly int UPGRADED_SI_VERSION_CURRENT = UPGRADED_SI_VERSION_START;

        public override SegmentInfoReader SegmentInfoReader => reader;

        public override SegmentInfoWriter SegmentInfoWriter => throw UnsupportedOperationException.Create("this codec can only be used for reading");

        // only for backwards compat
        public static readonly string DS_OFFSET_KEY = typeof(Lucene3xSegmentInfoFormat).Name + ".dsoffset";

        public static readonly string DS_NAME_KEY = typeof(Lucene3xSegmentInfoFormat).Name + ".dsname";
        public static readonly string DS_COMPOUND_KEY = typeof(Lucene3xSegmentInfoFormat).Name + ".dscompound";
        public static readonly string NORMGEN_KEY = typeof(Lucene3xSegmentInfoFormat).Name + ".normgen";
        public static readonly string NORMGEN_PREFIX = typeof(Lucene3xSegmentInfoFormat).Name + ".normfield";

        /// <returns> If this segment shares stored fields & vectors, this
        ///         offset is where in that file this segment's docs begin.  </returns>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static int GetDocStoreOffset(SegmentInfo si)
        {
            string v = si.GetAttribute(DS_OFFSET_KEY);
            return v is null ? -1 : Convert.ToInt32(v, CultureInfo.InvariantCulture);
        }

        /// <returns> Name used to derive fields/vectors file we share with other segments. </returns>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static string GetDocStoreSegment(SegmentInfo si)
        {
            string v = si.GetAttribute(DS_NAME_KEY);
            return v ?? si.Name;
        }

        /// <returns> Whether doc store files are stored in compound file (*.cfx). </returns>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static bool GetDocStoreIsCompoundFile(SegmentInfo si)
        {
            string v = si.GetAttribute(DS_COMPOUND_KEY);
            return v is null ? false : Convert.ToBoolean(v, CultureInfo.InvariantCulture);
        }
    }
}


text:
/**
 * Settings.h
 * Somantics
 *
 * Created by Marek Bereza on 06/06/2011.
 *
 */
#pragma once
#include "ofMain.h"
#include <map>
class Settings {
private:
	Settings();
public:
	static Settings *getInstance() {
		static Settings *instance = NULL;
		if(instance==NULL) {
			instance = new Settings();
		}
		return instance;
	}

	void reset();
	void save();
	void load();

	map<string, float> settings;
private:
	void setDefaultValues();
	string path;
};


text:
describe('chosen attributes', function() {

  var element;

  it('should inherit class customclass from select', function() {
    var customClass = 'customclass';
    var chosenContainer;
    var select = function(inheritSelectClasses, customClass) {
      return '<select chosen inherit-select-classes="' + inheritSelectClasses + '" class="' + customClass + '" ng-model="currentLanguage"><option></option></select>';
    };

    //inherit-select-classes = true
    element = $compile(select(true, customClass))($scope);
    $scope.$apply();
    chosenContainer = element.next();
    expect(chosenContainer.hasClass(customClass)).toBe(true);

    //inherit-select-classes = false
    element = $compile(select(false, customClass))($scope);
    $scope.$apply();
    chosenContainer = element.next();
    expect(chosenContainer.hasClass(customClass)).toBe(false);
  });

});


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace AzureAD.RedisCacheUserProfile.Models
{
    [Serializable]
    public class UserProfile
    {
        public string odatametadata { get; set; }
        public string odatatype { get; set; }
        public string objectType { get; set; }
        public string objectId { get; set; }
        public object deletionTimestamp { get; set; }
        public bool accountEnabled { get; set; }
        public object[] assignedLicenses { get; set; }
        public object[] assignedPlans { get; set; }
        public object city { get; set; }
        public object companyName { get; set; }
        public object country { get; set; }
        public object creationType { get; set; }
        public object department { get; set; }
        public object dirSyncEnabled { get; set; }
        public string displayName { get; set; }
        public object facsimileTelephoneNumber { get; set; }
        public string givenName { get; set; }
        public object immutableId { get; set; }
        public object jobTitle { get; set; }
        public object lastDirSyncTime { get; set; }
        public object mail { get; set; }
        public string mailNickname { get; set; }
        public object mobile { get; set; }
        public object onPremisesSecurityIdentifier { get; set; }
        public object[] otherMails { get; set; }
        public string passwordPolicies { get; set; }
        public object passwordProfile { get; set; }
        public object physicalDeliveryOfficeName { get; set; }
        public object postalCode { get; set; }
        public object preferredLanguage { get; set; }
        public object[] provisionedPlans { get; set; }
        public object[] provisioningErrors { get; set; }
        public object[] proxyAddresses { get; set; }
        public object sipProxyAddress { get; set; }
        public object state { get; set; }
        public object streetAddress { get; set; }
        public string surname { get; set; }
        public object telephoneNumber { get; set; }
        public object usageLocation { get; set; }
        public string userPrincipalName { get; set; }
        public string userType { get; set; }
        public string extension_33e037a7b1aa42ab96936c22d01ca338_Compania { get; set; }
    }
}


text:
import numpy as np
import json
from mpi4py import MPI
from pySDC.core.Hooks import hooks

class monitor_and_dump(hooks):
    def __init__(self):
        """
        Initialization of Allen-Cahn monitoring
        """
        super(monitor_and_dump, self).__init__()

        self.init_radius = None
        self.ndim = None

        self.comm = None
        self.rank = None
        self.size = None
        self.amode = MPI.MODE_WRONLY | MPI.MODE_CREATE
        self.time_step = None

    def pre_run(self, step, level_number):
        """
        Overwrite standard pre run hook

        Args:
            step (pySDC.Step.step): the current step
            level_number (int): the current level number
        """
        super(monitor_and_dump, self).pre_run(step, level_number)
        L = step.levels[0]

        # get space-communicator and data
        self.comm = L.prob.pm.comm
        if self.comm is not None:
            self.rank = self.comm.Get_rank()
            self.size = self.comm.Get_size()
        else:
            self.rank = 0
            self.size = 1

        # go back to real space
        tmp_u = L.prob.pm.create(type='complex', value=L.u[0].values)
        tmp_u = np.ascontiguousarray(tmp_u.c2r().value)

        # compute numerical radius
        self.ndim = len(tmp_u.shape)
        v_local = tmp_u[tmp_u > 2 * L.prob.params.eps].sum()
        if self.comm is not None:
            v_global = self.comm.allreduce(sendobj=v_local, op=MPI.SUM)
        else:
            v_global = v_local
        if self.ndim == 3:
            radius = (v_global / (np.pi * 4.0 / 3.0)) ** (1.0 / 3.0) * L.prob.dx
        elif self.ndim == 2:
            radius = np.sqrt(v_global / np.pi) * L.prob.dx
        else:
            raise NotImplementedError('Can use this only for 2 or 3D problems')

        # c_local = np.count_nonzero(L.u[0].values > 0.5)
        # if self.comm is not None:
        #     c_global = self.comm.allreduce(sendobj=c_local, op=MPI.SUM)
        # else:
        #     c_global = c_local
        # if self.ndim == 3:
        #     radius = (c_global / (np.pi * 4.0 / 3.0)) ** (1.0/3.0) * L.prob.dx
        # elif self.ndim == 2:
        #     radius = np.sqrt(c_global / np.pi) * L.prob.dx
        # else:
        #     raise NotImplementedError('Can use this only for 2 or 3D problems')

        self.init_radius = L.prob.params.radius

        # write to stats
        if L.time == 0.0:
            self.add_to_stats(
                process=step.status.slot,
                time=L.time,
                level=-1,
                iter=step.status.iter,
                sweep=L.status.sweep,
                type='computed_radius',
                value=radius,
            )
            self.add_to_stats(
                process=step.status.slot,
                time=L.time,
                level=-1,
                iter=step.status.iter,
                sweep=L.status.sweep,
                type='exact_radius',
                value=self.init_radius,
            )

        # compute local offset for I/O
        nbytes_local = tmp_u.nbytes
        if self.comm is not None:
            nbytes_global = self.comm.allgather(nbytes_local)
        else:
            nbytes_global = [nbytes_local]
        local_offset = sum(nbytes_global[: self.rank])

        # dump initial data
        fname = f"./data/{L.prob.params.name}_{0:08d}"
        fh = MPI.File.Open(self.comm, fname + ".dat", self.amode)
        fh.Write_at_all(local_offset, tmp_u)
        fh.Close()

        # write json description
        if self.rank == 0 and step.status.slot == 0:
            json_obj = dict()
            json_obj['type'] = 'dataset'
            json_obj['datatype'] = str(tmp_u.dtype)
            json_obj['endian'] = str(tmp_u.dtype.byteorder)
            json_obj['time'] = L.time
            json_obj['space_comm_size'] = self.size
            json_obj['time_comm_size'] = step.status.time_size
            json_obj['shape'] = L.prob.params.nvars
            json_obj['elementsize'] = tmp_u.dtype.itemsize

            with open(fname + '.json', 'w') as fp:
                json.dump(json_obj, fp)

        # set step count
        self.time_step = 1

    def post_step(self, step, level_number):
        """
        Overwrite standard post step hook

        Args:
            step (pySDC.Step.step): the current step
            level_number (int): the current level number
        """
        super(monitor_and_dump, self).post_step(step, level_number)

        # some abbreviations
        L = step.levels[0]

        # go back to real space
        tmp_u = L.prob.pm.create(type='complex', value=L.uend.values)
        tmp_u = np.ascontiguousarray(tmp_u.c2r().value)

        # compute numerical radius
        v_local = tmp_u[tmp_u > 2 * L.prob.params.eps].sum()
        if self.comm is not None:
            v_global = self.comm.allreduce(sendobj=v_local, op=MPI.SUM)
        else:
            v_global = v_local
        if self.ndim == 3:
            radius = (v_global / (np.pi * 4.0 / 3.0)) ** (1.0 / 3.0) * L.prob.dx
        elif self.ndim == 2:
            radius = np.sqrt(v_global / np.pi) * L.prob.dx
        else:
            raise NotImplementedError('Can use this only for 2 or 3D problems')

        # c_local = np.count_nonzero(L.uend.values > 0.5)
        # if self.comm is not None:
        #     c_global = self.comm.allreduce(sendobj=c_local, op=MPI.SUM)
        # else:
        #     c_global = c_local
        # if self.ndim == 3:
        #     radius = (c_global / (np.pi * 4.0 / 3.0)) ** (1.0 / 3.0) * L.prob.dx
        # elif self.ndim == 2:
        #     radius = np.sqrt(c_global / np.pi) * L.prob.dx
        # else:
        #     raise NotImplementedError('Can use this only for 2 or 3D problems')

        # compute exact radius
        exact_radius = np.sqrt(max(self.init_radius**2 - 2.0 * (self.ndim - 1) * (L.time + L.dt), 0))

        # write to stats
        self.add_to_stats(
            process=step.status.slot,
            time=L.time + L.dt,
            level=-1,
            iter=step.status.iter,
            sweep=L.status.sweep,
            type='computed_radius',
            value=radius,
        )
        self.add_to_stats(
            process=step.status.slot,
            time=L.time + L.dt,
            level=-1,
            iter=step.status.iter,
            sweep=L.status.sweep,
            type='exact_radius',
            value=exact_radius,
        )

        # compute local offset for I/O
        nbytes_local = tmp_u.nbytes
        if self.comm is not None:
            nbytes_global = self.comm.allgather(nbytes_local)
        else:
            nbytes_global = [nbytes_local]
        local_offset = sum(nbytes_global[: self.rank])

        #  dump initial data
        fname = f"./data/{L.prob.params.name}_{self.time_step + step.status.slot:08d}"
        fh = MPI.File.Open(self.comm, fname + ".dat", self.amode)
        fh.Write_at_all(local_offset, tmp_u)
        fh.Close()

        # write json description
        if self.rank == 0:
            json_obj = dict()
            json_obj['type'] = 'dataset'
            json_obj['datatype'] = str(tmp_u.dtype)
            json_obj['endian'] = str(tmp_u.dtype.byteorder)
            json_obj['time'] = L.time + L.dt
            json_obj['space_comm_size'] = self.size
            json_obj['time_comm_size'] = step.status.time_size
            json_obj['shape'] = L.prob.params.nvars
            json_obj['elementsize'] = tmp_u.dtype.itemsize

            with open(fname + '.json', 'w') as fp:
                json.dump(json_obj, fp)

        # update step count
        self.time_step += step.status.time_size


text:
<!DOCTYPE html>

<title>Luracast Restler  Annotations</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="examples/resources/highlight.css">
<link rel="stylesheet" type="text/css" href="examples/resources/style.css"/>

 Home

 Start

 Examples

 Support

 Source

 Update

 Connect

            Quick Start

Features

Branches

Installation

Getting Started

Change Log

Annotations

@url

@access

@smart-auto...

@class

@cache

@expires

@throttle

@status

@header

@param

@throws

@return

@var

Param

@from

@type

@choice

@min & @max

@fix

Supported Annotations

You may use the following php doc comments to annotate your API methods.
All tags except @url, @param and @var can also be defined at the class
level so that they will be applied for all the api methods. You can override
them at method level individually when needed.

@url

Syntax:

@url GET|POST|PUT|PATCH|DELETE custom/{dynamic}/route

Example:

@url POST authors/{id}/books

Overrides auto routes and creates manual routes. Use as many as you need to map
the same method to multiple routes.

@access

Syntax:

@access private|public|protected|hybrid

Example:

@access protected

Access control for api methods. PHPDoc only supports private and public,
Restler adds protected for api that needs authentication, hybrid for api that
enhances resulting data for authenticated users.

@smart-auto-routing

Syntax:

@smart-auto-routing true|false

Example:

@smart-auto-routing false

Smart auto routing is enabled by default. Avoids creating multiple routes that
can increase the ambiguity when set to true. when a method parameter is optional
it is not mapped to the url and should only be used in request body or as a
query string like /resource?id=value.

When a parameter is required and is scalar, it will be mapped as part of the
url like /resource/{id}

@class

Syntax:

@class ClassName {@propertyName value}

Example:

@class AccessControl {@requires user} {@level 5}

Sets property of the specified class with specified value when the class is
instantiated by Restler. Property can also be a static property.

@cache

Syntax:

@cache headerCacheControlValue

Example:

@cache max-age={expires}, must-revalidate

Specify value to set CacheControl Header, it can use @expires value as shown
in the example

@expires

Syntax:

@expires numberOfSeconds

Example:

@expires 30

When set to zero the content will expire immediately.  Alternatively you can
specify the number of seconds the content will expire for client side and proxy
caching

@throttle

Syntax:

@throttle numberOfMilliSeconds

Example:

@throttle 3000

Sets the time in milliseconds for bandwidth throttling, which will become the
minimum response time for each API request.

@status

Syntax:

@status httpStatusCode

Example:

@status 201

Sets the HTTP Status code for the successful response.

@header

Syntax:

@header httpHeader

Example:

@header Link: <meta.rdf>; rel=meta

Sets or overrides the specific HTTP Header.

@param

Syntax:

@param [type] Name [Description] {@name value}

Example:

@param int $num1 increment value {@min 5} {@max 100}

Standard @param comment that sets the type and description of a parameter.
Supported child attributes are documented in detail under @param

@throws

Syntax:

@throws httpStatusCode [Reason]

Example:

@throws 404 No Author for specified id

Documents possible error responses for the API call.

@return

Syntax:

@return type [Description]

Example:

@return Author an instance of iValueObject

Documents the structure of success response, user defined classes must extend
iValueObject.

@var

Syntax:

@var [type] [Description] {@name value}

Example:

@var int policy age {@min 18} {@max 100}

When an api method is returning or having one of the parameters as an instance
of a custom class @var comments can be used with properties of that class.
They will be used for validation and documentation. Supported child attributes
are same as that of @param so they are documented under @param


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" href="/assets/ico/favicon.ico">

    <title>Leobardo Campos - Resume</title>

    <link href="/assets/css/bootstrap.css" rel="stylesheet">

    <link href="/assets/css/style.css" rel="stylesheet">
    <link href="/assets/css/font-awesome.min.css" rel="stylesheet">
    <link rel="stylesheet" href="/css/main.css">
      <link rel="alternate" type="application/rss+xml" title="Leobardo Campos" href="http://localhost:4000/feed.xml">

      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
        Toggle navigation

      </button>
      Leobardo Campos

Home

Work Experience

Publications

Education

Resume

Resume

        <! -- SINGLE POST -->

            <! -- Blog Post  -->

Resume

<csmall>Apr 1, 2016. | By: </csmall>

<! --/col-lg-8 -->

Subscribe

Subscribe to this blog via RSS.

Categories

Recent Posts

Popular Tags

<! --/row -->

<! --/container -->

About

This is a website based in several free jekyll templates available to publicize the trajectory of Leobardo Campos.

Contact

                        Leobardo Campos

                        leo.campos.macias@gmail.com

<! --/row -->

<! --/container -->

<! --/footerwrap -->


text:
package org.apache.metamodel.data;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;

import org.apache.metamodel.MetaModelException;

/**
 * Row publisher implementation used by {@link RowPublisherDataSet}.
 */
class RowPublisherImpl implements RowPublisher {

	public static final int BUFFER_SIZE = 20;

	private final RowPublisherDataSet _dataSet;
	private final BlockingQueue<Row> _queue;
	private final AtomicBoolean _finished;
	private final AtomicInteger _rowCount;
	private volatile Row _currentRow;
	private volatile Exception _error;

	public RowPublisherImpl(RowPublisherDataSet dataSet) {
		_dataSet = dataSet;
		_queue = new ArrayBlockingQueue<Row>(BUFFER_SIZE);
		_finished = new AtomicBoolean(false);
		_rowCount = new AtomicInteger();
	}

	@Override
	public boolean publish(Row row) {
		if (_finished.get()) {
			return false;
		}
		while (!offer(row)) {
			if (_finished.get()) {
				return false;
			}
			// wait one more cycle
		}
		int rowCount = _rowCount.incrementAndGet();
		if (_dataSet.getMaxRows() > 0 && rowCount >= _dataSet.getMaxRows()) {
			finished();
			return false;
		}
		return true;
	}

	private boolean offer(Row row) {
		try {
			return _queue.offer(row, 1000, TimeUnit.MICROSECONDS);
		} catch (InterruptedException e) {
			// do nothing
			return false;
		}
	}

	@Override
	public boolean publish(Object[] values) {
		Row row = new DefaultRow(_dataSet.getHeader(), values);
		return publish(row);
	}

	@Override
	public boolean publish(Object[] values, Style[] styles) {
		Row row = new DefaultRow(_dataSet.getHeader(), values, styles);
		return publish(row);
	}

	@Override
	public void finished() {
		_finished.set(true);
	}

	public boolean next() {
		if (_queue.isEmpty() && _finished.get()) {
			return false;
		}
		try {
			_currentRow = _queue.poll(1000, TimeUnit.MILLISECONDS);
		} catch (InterruptedException e) {
			// do nothing
		}
		if (_currentRow != null) {
			return true;
		}
		if (_error != null) {
			if (_error instanceof RuntimeException) {
				throw (RuntimeException) _error;
			}
			throw new MetaModelException(_error);
		}
		// "busy" (1 second) wait
		return next();
	}

	public Row getRow() {
		return _currentRow;
	}

	public void failed(Exception error) {
		_error = error;
	}
}


text:
using OrbisBot.TaskAbstracts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OrbisBot.TaskPermissions;
using Discord;
using OrbisBot.Events;

namespace OrbisBot.Tasks.EventTasks
{
    class DevRemoveEventTask : TaskAbstract
    {
        public DevRemoveEventTask(CommandChannelTaskPermission permission) : base(permission)
        {
        }

        public override string AboutText()
        {
            return "Remove a task of that name or ID from any channel";
        }

        public override bool CheckArgs(string[] args)
        {
            return args.Length == 2;
        }

        public override string CommandText()
        {
            return "dev-events-remove";
        }

        public override string TaskComponent(string[] args, MessageEventArgs messageSource)
        {
            long id;

            EventForm eventObj;

            if (long.TryParse(args[1], out id))
            {
                //first, validate that if this event belongs to the channel
                eventObj = Context.Instance.EventManager.EventDAOAccessor.FindEventById(id);

                if (eventObj == null)
                {
                    return $"Cannot find event with the ID of {id}";
                }
            }
            else
            {
                return "This command can only remove events by an ID number";
            }

            //this is an ID, we can just delete directly
            Context.Instance.EventManager.RemoveEvent(eventObj);

            return $"Event {eventObj.EventName} has been removed";
        }

        public override string UsageText()
        {
            return "(ID)";
        }
    }
}


text:
    You have been unsubscribed.
    Click here to unsubscribe.


text:
package org.myrobotlab.service;

import org.myrobotlab.framework.Service;
import org.myrobotlab.kinematics.IKEngine;
import org.myrobotlab.logging.Level;
import org.myrobotlab.logging.LoggerFactory;
import org.myrobotlab.logging.LoggingFactory;
import org.slf4j.Logger;

/**
 *
 * InverseKinematics provides basic 2D inverse kinematics features. This class
 * will be replaced with the DH parameter based InverseKinematics3D service.
 *
 */
public class InverseKinematics extends Service {

  protected IKEngine ikEngine;

  private static final long serialVersionUID = 1L;

  public final static Logger log = LoggerFactory.getLogger(InverseKinematics.class.getCanonicalName());

  public static void main(String[] args) {
    LoggingFactory.init(Level.INFO);
    InverseKinematics inversekinematics = (InverseKinematics) Runtime.start("inversekinematics", "InverseKinematics");// new
                                                                                // InverseKinematics("inversekinematics");
    inversekinematics.setDOF(3);
    inversekinematics.setStructure(0, 100);
    inversekinematics.setStructure(1, 100);
    inversekinematics.setStructure(2, 100);
    inversekinematics.setPoint(200, 200, 200);
    inversekinematics.compute();

    Runtime.createAndStart("gui", "SwingGui");
    /*
     * SwingGui gui = new SwingGui("gui"); gui.startService();
     */
  }

  public InverseKinematics(String n, String id) {
    super(n, id);
  }

  public void compute() {
    ikEngine.calculate();
    ikEngine.getBaseAngle();
    ikEngine.getArmAngles();

  }

  public double getArmAngles(int i) {
    double[] b = ikEngine.getArmAngles();
    return b[i];
  }

  public double getBaseAngle() {
    double b = ikEngine.getBaseAngle();
    return b;
  }

  public void setDOF(int dof) {
    ikEngine = new IKEngine(dof);
    ikEngine.setMode(dof);
  }

  public void setPoint(double x, double y, double z) {
    ikEngine.setGoal(x, y, z);
  }

  public void setPoint(float x, float y, float z) {
    ikEngine.setGoal(x, y, z);
  }

  public void setPoint(int x, int y, int z) {
    ikEngine.setGoal(x, y, z);
  }

  public void setStructure(int nlink, double length) {
    ikEngine.setLinkLength(nlink, length);
  }

}


text:
using System.Collections.Generic;

namespace Abp.EntityHistory
{
    internal class EntityHistorySelectorList : List<NamedTypeSelector>, IEntityHistorySelectorList
    {
        public bool RemoveByName(string name)
        {
            return RemoveAll(s => s.Name == name) > 0;
        }
    }
}


text:
<!DOCTYPE html>

    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Ameno</title>
    <meta name="description" content="" />
    <meta name="keywords" content="" />

    <meta name="author" content="Ameno" />
    <link rel="shortcut icon" href="../favicon.ico">
    <link rel="stylesheet" type="text/css" href="css/animate.css">
    <link rel="stylesheet" type="text/css" href="css/styles.css" />

            daybreak
            &#1601&#1580&#1585

59

59

23

Tommorrow:

The day after:

near future:

            high-noon
            &#1592&#1607&#1585

59

59

23

Tommorrow:

The day after:

near future:

            Mid-Afternoon
            &#1593&#1589&#1585

59

59

23

Tommorrow:

The day after:

near future:

            Sunset
            &#1605&#1594&#1585&#1576

59

59

23

Tommorrow:

The day after:

near future:

            Evening
            &#1571&#1588&#1609

59

59

23

Tommorrow:

The day after:

near future:


text:
require 'spec_helper'

module Relation
  describe TreeManager do

  end
end


text:
package de.hub.clickwatch.specificmodels.brn.lease_tab_leases.impl;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;

import de.hub.clickwatch.model.impl.HandlerImpl;
import de.hub.clickwatch.specificmodels.brn.lease_tab_leases.Dhcpleases;
import de.hub.clickwatch.specificmodels.brn.lease_tab_leases.Lease_tab_leasesPackage;
import de.hub.clickwatch.specificmodels.brn.lease_tab_leases.Leases;

/**
 *
 * An implementation of the model object 'Leases'.
 *
 *

 * The following features are implemented:
 *

 *
{@link de.hub.clickwatch.specificmodels.brn.lease_tab_leases.impl.LeasesImpl#getDhcpleases Dhcpleases}

 *

 *

 *
 * @generated
 */
public class LeasesImpl extends HandlerImpl implements Leases {
    /**
     * The cached value of the '{@link #getDhcpleases() Dhcpleases}' containment reference.
     *
     *
     * @see #getDhcpleases()
     * @generated
     * @ordered
     */
    protected Dhcpleases dhcpleases;

    /**
     *
     *
     * @generated
     */
    protected LeasesImpl() {
        super();
    }

    /**
     *
     *
     * @generated
     */
    @Override
    protected EClass eStaticClass() {
        return Lease_tab_leasesPackage.Literals.LEASES;
    }

    /**
     *
     *
     * @generated
     */
    public Dhcpleases getDhcpleases() {
        return dhcpleases;
    }

    /**
     *
     *
     * @generated
     */
    public NotificationChain basicSetDhcpleases(Dhcpleases newDhcpleases, NotificationChain msgs) {
        Dhcpleases oldDhcpleases = dhcpleases;
        dhcpleases = newDhcpleases;
        if (eNotificationRequired()) {
            ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Lease_tab_leasesPackage.LEASES__DHCPLEASES, oldDhcpleases, newDhcpleases);
            if (msgs == null) msgs = notification; else msgs.add(notification);
        }
        return msgs;
    }

    /**
     *
     *
     * @generated
     */
    public void setDhcpleases(Dhcpleases newDhcpleases) {
        if (newDhcpleases != dhcpleases) {
            NotificationChain msgs = null;
            if (dhcpleases != null)
                msgs = ((InternalEObject)dhcpleases).eInverseRemove(this, Lease_tab_leasesPackage.DHCPLEASES__ECONTAINER_DHCPLEASES, Dhcpleases.class, msgs);
            if (newDhcpleases != null)
                msgs = ((InternalEObject)newDhcpleases).eInverseAdd(this, Lease_tab_leasesPackage.DHCPLEASES__ECONTAINER_DHCPLEASES, Dhcpleases.class, msgs);
            msgs = basicSetDhcpleases(newDhcpleases, msgs);
            if (msgs != null) msgs.dispatch();
        }
        else if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, Lease_tab_leasesPackage.LEASES__DHCPLEASES, newDhcpleases, newDhcpleases));
    }

    /**
     *
     *
     * @generated
     */
    @Override
    public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
        switch (featureID) {
            case Lease_tab_leasesPackage.LEASES__DHCPLEASES:
                if (dhcpleases != null)
                    msgs = ((InternalEObject)dhcpleases).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - Lease_tab_leasesPackage.LEASES__DHCPLEASES, null, msgs);
                return basicSetDhcpleases((Dhcpleases)otherEnd, msgs);
        }
        return super.eInverseAdd(otherEnd, featureID, msgs);
    }

    /**
     *
     *
     * @generated
     */
    @Override
    public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
        switch (featureID) {
            case Lease_tab_leasesPackage.LEASES__DHCPLEASES:
                return basicSetDhcpleases(null, msgs);
        }
        return super.eInverseRemove(otherEnd, featureID, msgs);
    }

    /**
     *
     *
     * @generated
     */
    @Override
    public Object eGet(int featureID, boolean resolve, boolean coreType) {
        switch (featureID) {
            case Lease_tab_leasesPackage.LEASES__DHCPLEASES:
                return getDhcpleases();
        }
        return super.eGet(featureID, resolve, coreType);
    }

    /**
     *
     *
     * @generated
     */
    @Override
    public void eSet(int featureID, Object newValue) {
        switch (featureID) {
            case Lease_tab_leasesPackage.LEASES__DHCPLEASES:
                setDhcpleases((Dhcpleases)newValue);
                return;
        }
        super.eSet(featureID, newValue);
    }

    /**
     *
     *
     * @generated
     */
    @Override
    public void eUnset(int featureID) {
        switch (featureID) {
            case Lease_tab_leasesPackage.LEASES__DHCPLEASES:
                setDhcpleases((Dhcpleases)null);
                return;
        }
        super.eUnset(featureID);
    }

    /**
     *
     *
     * @generated
     */
    @Override
    public boolean eIsSet(int featureID) {
        switch (featureID) {
            case Lease_tab_leasesPackage.LEASES__DHCPLEASES:
                return dhcpleases != null;
        }
        return super.eIsSet(featureID);
    }

} //LeasesImpl


text:
<?php

namespace App\Model\Table;

use Cake\Database\Schema\TableSchema;
use Tools\Model\Table\Table;

class DataTable extends Table {

	/**
	 * @param \Cake\Database\Schema\TableSchema $schema
	 *
	 * @return \Cake\Database\Schema\TableSchema
	 */
	protected function _initializeSchema(TableSchema $schema) {
		$schema->setColumnType('data_json', 'json');
		$schema->setColumnType('data_array', 'array');

		return $schema;
	}

}


text:
import { initialize } from '../src/index';
import { DOM, PLATFORM } from 'aurelia-pal';
import { JSDOM } from 'jsdom';

initialize();

describe('NodeJs Dom', () => {
  it('should create a template from valid markup', () => {
    expect(() => DOM.createTemplateFromMarkup('<template>this is valid!</template>')).toBeDefined();
  });

  it('should throw an error when creating a template from text-only markup', () => {
    expect(() => DOM.createTemplateFromMarkup('throw an error!')).toThrow();
  });

  it('should throw an error when creating a template from markup where <template> is not the root element', () => {
    expect(() => DOM.createTemplateFromMarkup('
throw an error!
')).toThrow();
  });

  it('createElement is defined and creates valid element', () => {
    expect(DOM.createElement).toBeDefined();
  });

  it('createElement creates valid element', () => {
    let elmt = DOM.createElement("div");
    expect(elmt).not.toBeNull();
    expect(elmt.tagName).toBe("DIV");
  });

  it('createTextNode is defined', () => {
    expect(DOM.createTextNode).toBeDefined();
  });

  it('createTextNode creates valid text node', () => {
    let elmt = DOM.createTextNode("choo-choo!");

    expect(elmt).not.toBeNull();
    expect(elmt.textContent).toBe("choo-choo!");
  });

  it('adoptNode is defined', () => {
    expect(DOM.adoptNode).toBeDefined();
  });

  it('adoptNode returns adopted', () => {
    let external = new JSDOM(undefined, {}).window.document.createElement("DIV");
    let adopted = DOM.adoptNode(external);

    expect(adopted.nodeName).toBe("DIV");
  });

  it('appendNode is defined and appends node to other', () => {
    expect(DOM.appendNode).toBeDefined();
  });

  it('activeElement is defined', () => {
    expect(DOM.activeElement).toBeDefined();
  });

  it('createAttribute is defined', () => {
    expect(DOM.createAttribute).toBeDefined();
  });

  it('createMutationObserver is defined', () => {
    expect(DOM.createMutationObserver).toBeDefined();
  });

  it('createDocumentFragment is defined', () => {
    expect(DOM.createDocumentFragment).toBeDefined();
  });

  it('createTemplateFromMarkup is defined', () => {
    expect(DOM.createTemplateFromMarkup).toBeDefined();
  });

  it('createTemplateFromMarkup is defined', () => {
    expect(DOM.createMutationObserver).toBeDefined();
  });

  it('addEventListener is defined', () => {
    expect(DOM.addEventListener).toBeDefined();
  });

  it('addEventListener recieves custom events', () => {
    let elmt = DOM.createElement("div");
    var wasCalled = false;

    let event = DOM.createCustomEvent("Foo", { bubbles: true, cancelable: false, detail: {} });

    elmt.addEventListener("Foo", () => { wasCalled = true; }, true);
    elmt.dispatchEvent(event);

    expect(wasCalled).toBeTruthy();
  });

  it('removeEventListener is defined', () => {
    expect(DOM.removeEventListener).toBeDefined();
  });

  it('dispatchEvent is defined', () => {
    expect(DOM.dispatchEvent).toBeDefined();
  });

  it('NodeList is defined', () => {
    expect(PLATFORM.global.NodeList).toBeDefined();
  });
});


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2018.06.05 at 08:50:12 PM SAMT
//

package ru.fsrar.wegais.clientref_v2;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 * Ссылка на организацию
 *
 *
Java class for OrgItemType complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="OrgItemType">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <all>
 *         <element name="ID" type="{http://fsrar.ru/WEGAIS/Common}NoEmptyString50"/>
 *       </all>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "OrgItemType", propOrder = {

})
public class OrgItemType {

    @XmlElement(name = "ID", required = true)
    protected String id;

    /**
     * Gets the value of the id property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getID() {
        return id;
    }

    /**
     * Sets the value of the id property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setID(String value) {
        this.id = value;
    }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
    <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
    <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
        <group>
            <file>file:/D:/xampp/htdocs/vertexDezign/app/Http/Controllers/HomeController.php</file>
            <file>file:/D:/xampp/htdocs/vertexDezign/config/database.php</file>
            <file>file:/D:/xampp/htdocs/vertexDezign/database/migrations/2015_05_22_135522_create_news_table.php</file>
            <file>file:/D:/xampp/htdocs/vertexDezign/config/app.php</file>
            <file>file:/D:/xampp/htdocs/vertexDezign/app/User.php</file>
            <file>file:/D:/xampp/htdocs/vertexDezign/database/migrations/2014_10_12_000000_create_users_table.php</file>
            <file>file:/D:/xampp/htdocs/vertexDezign/database/migrations/2014_10_12_100000_create_password_resets_table.php</file>
        </group>
    </open-files>
</project-private>


text:
layout: post
date:	2012-09-07 21:54:00
title:  Just some flowers...
tags: [archived-posts]
categories: archives
permalink: /:categories/:year/:month/:day/:title/
---
On the visit to the Pais' farmhouse, I enjoyed the various flowers they had in their garden. Here are a few...

Passion Flower (Passiflora):

<lj-cut text="more flowers">

</lj-cut>


text:
package gov.nist.javax.sip;

import javax.sip.ClientTransaction;
import javax.sip.Dialog;
import javax.sip.ResponseEvent;
import javax.sip.message.Response;

/**
 * Extension for ResponseEvent.
 *
 * @since v2.0
 */
public class ResponseEventExt extends ResponseEvent {
    private ClientTransactionExt  m_originalTransaction;
    public ResponseEventExt(Object source, ClientTransactionExt clientTransaction,
            Dialog dialog,  Response response) {
        super(source,clientTransaction,dialog,response);
        m_originalTransaction = clientTransaction;
    }

    /**
     * Return true if this is a forked response.
     *
     * @return true if the response event is for a forked response.
     */
    public boolean isForkedResponse() {
        return super.getClientTransaction() == null && m_originalTransaction != null;
    }

    /**
     * Set the original transaction for a forked response.
     *
     * @param originalTransaction - the original transaction for which this response event is a fork.
     */
    public void setOriginalTransaction(ClientTransactionExt originalTransaction ) {
        m_originalTransaction = originalTransaction;
    }

    /**
     * Get the original transaction for which this is a forked response.
     * Note that this transaction can be in a TERMINATED state.
     *
     * @return the original clientTx for which this is a forked response.
     */
    public ClientTransactionExt getOriginalTransaction() {
        return this.m_originalTransaction;
    }

}


text:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Turret : Enemy {

    public Player player;

    public Turret(int health, int damage, float shootSpeed, float speed, GameObject body) : base(health, damage, shootSpeed, speed, body)
    {

        health = 500;
        damage = 5;
        shootSpeed = 0.5f;
        speed = 0;

    }

    public override void takeDamage(Projectil projectil)
    {
        throw new System.NotImplementedException();
    }

    // Use this for initialization
    void Start () {
        invokeProjectil();
	}

	// Update is called once per frame
	void Update () {

        transform.LookAt(player.transform.position);
    }

}