text:
// CLASS HEADER
#include <dali/internal/event/animation/path-constrainer-impl.h>

//EXTRENAL INCLUDES
#include <cstring> // for strcmp

// INTERNAL INCLUDES
#include <dali/internal/event/common/property-helper.h>
#include <dali/public-api/animation/constraint.h>
#include <dali/public-api/object/property-array.h>
#include <dali/public-api/object/type-registry.h>

namespace Dali
{
namespace Internal
{
namespace
{
// Properties
//              Name             Type   writable animatable constraint-input  enum for index-checking
DALI_PROPERTY_TABLE_BEGIN
DALI_PROPERTY("forward", VECTOR3, true, false, false, Dali::PathConstrainer::Property::FORWARD)
DALI_PROPERTY("points", ARRAY, true, false, false, Dali::PathConstrainer::Property::POINTS)
DALI_PROPERTY("controlPoints", ARRAY, true, false, false, Dali::PathConstrainer::Property::CONTROL_POINTS)
DALI_PROPERTY_TABLE_END(DEFAULT_OBJECT_PROPERTY_START_INDEX, PathConstrainerDefaultProperties)

BaseHandle Create()
{
  return Dali::PathConstrainer::New();
}

TypeRegistration mType(typeid(Dali::PathConstrainer), typeid(Dali::Handle), Create, PathConstrainerDefaultProperties);

} //Unnamed namespace

PathConstrainer* PathConstrainer::New()
{
  return new PathConstrainer();
}

PathConstrainer::PathConstrainer()
: Constrainer(),
  mPath(Path::New())
{
}

PathConstrainer::~PathConstrainer() = default;

Property::Value PathConstrainer::GetDefaultProperty(Property::Index index) const
{
  if(index == Dali::PathConstrainer::Property::FORWARD)
  {
    return Property::Value(mForward);
  }
  else
  {
    if(index == Dali::PathConstrainer::Property::POINTS)
    {
      Property::Value              value(Property::ARRAY);
      Property::Array*             array      = value.GetArray();
      const Dali::Vector<Vector3>& point      = mPath->GetPoints();
      Property::Array::SizeType    pointCount = static_cast<Property::Array::SizeType>(point.Size());

      if(array)
      {
        array->Reserve(pointCount);
        for(Property::Array::SizeType i = 0; i < pointCount; ++i)
        {
          array->PushBack(point[i]);
        }
      }
      return value;
    }
    else if(index == Dali::PathConstrainer::Property::CONTROL_POINTS)
    {
      Property::Value              value(Property::ARRAY);
      Property::Array*             array      = value.GetArray();
      const Dali::Vector<Vector3>& point      = mPath->GetControlPoints();
      Property::Array::SizeType    pointCount = static_cast<Property::Array::SizeType>(point.Size());

      if(array)
      {
        array->Reserve(pointCount);
        for(Property::Array::SizeType i = 0; i < pointCount; ++i)
        {
          array->PushBack(point[i]);
        }
      }
      return value;
    }
  }

  return Property::Value();
}

Property::Value PathConstrainer::GetDefaultPropertyCurrentValue(Property::Index index) const
{
  return GetDefaultProperty(index); // Event-side only properties
}

void PathConstrainer::SetDefaultProperty(Property::Index index, const Property::Value& propertyValue)
{
  if(index == Dali::PathConstrainer::Property::FORWARD)
  {
    propertyValue.Get(mForward);
  }
  else if(index == Dali::PathConstrainer::Property::POINTS)
  {
    const Property::Array* array = propertyValue.GetArray();
    mPath->ClearPoints();
    if(array)
    {
      for(Property::Array::SizeType i = 0, count = array->Count(); i < count; ++i)
      {
        Vector3 point;
        array->GetElementAt(i).Get(point);
        mPath->AddPoint(point);
      }
    }
  }
  else if(index == Dali::PathConstrainer::Property::CONTROL_POINTS)
  {
    const Property::Array* array = propertyValue.GetArray();
    mPath->ClearControlPoints();
    if(array)
    {
      for(Property::Array::SizeType i = 0, count = array->Count(); i < count; ++i)
      {
        Vector3 point;
        array->GetElementAt(i).Get(point);
        mPath->AddControlPoint(point);
      }
    }
  }
}

void PathConstrainer::Apply(Property target, Property source, const Vector2& range, const Vector2& wrap)
{
  Dali::Property::Type propertyType = target.object.GetPropertyType(target.propertyIndex);
  if(propertyType == Dali::Property::VECTOR3)
  {
    // If property type is Vector3, constrain its value to the position of the path
    Dali::Constraint constraint = Dali::Constraint::New<Vector3>(target.object, target.propertyIndex, PathConstraintFunctor(mPath, range, wrap));
    constraint.AddSource(Dali::Source(source.object, source.propertyIndex));

    constraint.SetTag(static_cast<uint32_t>(reinterpret_cast<uintptr_t>(this))); // taking 32bits of this as tag
    constraint.SetRemoveAction(Dali::Constraint::DISCARD);
    constraint.Apply();
  }
  else if(propertyType == Dali::Property::ROTATION)
  {
    // If property type is Rotation, constrain its value to align the forward vector to the tangent of the path
    Dali::Constraint constraint = Dali::Constraint::New<Quaternion>(target.object, target.propertyIndex, PathConstraintFunctor(mPath, range, mForward, wrap));
    constraint.AddSource(Dali::Source(source.object, source.propertyIndex));

    constraint.SetTag(static_cast<uint32_t>(reinterpret_cast<uintptr_t>(this))); // taking 32bits of this as tag
    constraint.SetRemoveAction(Dali::Constraint::DISCARD);
    constraint.Apply();
  }

  //Start observing the object
  Observe(target.object);
}

} // namespace Internal

} // namespace Dali


text:
#include <gtest/gtest.h>

#include "gazebo/common/Time.hh"
#include "gazebo/util/Diagnostics.hh"

using namespace gazebo;

TEST(DiagnosticsTest, Diagnostics)
{
#ifdef ENABLE_DIAGNOSTICS
  util::DiagnosticManager *mgr = util::DiagnosticManager::Instance();
  EXPECT_TRUE(mgr != NULL);

  common::Time prev = common::Time::GetWallTime();
  {
    mgr->StartTimer("test");
    mgr->StopTimer("test");
    EXPECT_STREQ("test", mgr->GetLabel(0).c_str());
    EXPECT_EQ(1, mgr->GetTimerCount());
  }
  common::Time after = common::Time::GetWallTime();

  EXPECT_TRUE(mgr->GetTime(0) == mgr->GetTime("test"));
  EXPECT_TRUE(mgr->GetTime(0) <= after - prev);
#endif
}

/////////////////////////////////////////////////
int main(int argc, char **argv)
{
  ::testing::InitGoogleTest(&argc, argv);
  return RUN_ALL_TESTS();
}

redpajama_set_name: RedPajamaGithub


text:
	@class AnimatedHighlight.story
]]

local require = require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).load(script)

local Maid = require("Maid")
local AnimatedHighlightGroup = require("AnimatedHighlightGroup")
local RxSelectionUtils = require("RxSelectionUtils")

return function(_target)
	local maid = Maid.new()

	local animatedHighlightGroup = AnimatedHighlightGroup.new()
	animatedHighlightGroup:SetDefaultFillColor(Color3.new(0.5, 1, 0.5))
	animatedHighlightGroup:SetDefaultSpeed(20)
	animatedHighlightGroup:SetDefaultHighlightDepthMode(Enum.HighlightDepthMode.Occluded)
	maid:GiveTask(animatedHighlightGroup)

	maid:GiveTask(RxSelectionUtils.observeAdorneesBrio():Subscribe(function(brio)
		if brio:IsDead() then
			return
		end

		local adorneeMaid = brio:ToMaid()
		local adornee = brio:GetValue()

		animatedHighlightGroup:Highlight(adornee)

		adorneeMaid:GiveTask(function()
			if animatedHighlightGroup.Destroy then
				animatedHighlightGroup:Erase(adornee)
			end
		end)
	end))

	return function()
		maid:DoCleaning()
	end
end


text:
#import "TGMenuItem.h"

#define TGButtonsMenuItemType ((int)0x415CD6D3)

@interface TGButtonsMenuItem : TGMenuItem

@property (nonatomic, strong) NSArray *buttons;

@end


text:
package org.pac4j.play;

import java.util.HashMap;
import java.util.Map;

import org.pac4j.core.context.BaseResponseContext;

import org.pac4j.play.store.DataStore;
import play.api.mvc.RequestHeader;
import play.core.j.JavaHelpers$;
import play.mvc.Http;
import play.mvc.Http.Request;
import play.mvc.Http.Response;
import play.mvc.Http.Session;
import play.mvc.Http.Context;

/**
 *
This class is the web context for Play (used both for Java and Scala).

 *
"Session objects" are managed by the defined {@link DataStore}.

 *
"Request attributes" are saved/restored to/from the context.

 *
 * @author Jerome Leleu
 * @since 1.1.0
 */
public class PlayWebContext extends BaseResponseContext {

    protected final Context context;

    protected final Request request;

    protected final Response response;

    protected final Session session;

    protected final DataStore dataStore;

    public PlayWebContext(final Context context, final DataStore dataStore) {
        this.context = context;
        this.request = context.request();
        this.response = context.response();
        this.session = context.session();
        this.dataStore = dataStore;
    }

    public PlayWebContext(final RequestHeader requestHeader, final DataStore dataStore) {
        this(JavaHelpers$.MODULE$.createJavaContext(requestHeader), dataStore);
    }

    /**
     * Get the Java session.
     *
     * @return the Java session
     */
    public Session getJavaSession() {
        return session;
    }

    /**
     * Get the Java request.
     *
     * @return the Java request
     */
    public Request getJavaRequest() {
        return request;
    }

    /**
     * Get the Java context.
     *
     * @return the Java context.
     */
    public Context getJavaContext() {
        return this.context;
    }

    /**
     * Return the session storage.
     *
     * @return the session storage
     */
    public DataStore getDataStore() {
        return this.dataStore;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String getRequestHeader(final String name) {
        return request.getHeader(name);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String getRequestMethod() {
        return request.method();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String getRequestParameter(final String name) {
        final Map<String, String[]> parameters = getRequestParameters();
        final String[] values = parameters.get(name);
        if (values != null && values.length > 0) {
            return values[0];
        }
        return null;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Map<String, String[]> getRequestParameters() {
        final Http.RequestBody body = request.body();
        final Map<String, String[]> formParameters;
        if (body != null) {
            formParameters = body.asFormUrlEncoded();
        } else {
            formParameters = new HashMap<String, String[]>();
        }
        final Map<String, String[]> urlParameters = request.queryString();
        final Map<String, String[]> parameters = new HashMap<String, String[]>();
        if (formParameters != null) {
            parameters.putAll(formParameters);
        }
        if (urlParameters != null) {
            parameters.putAll(urlParameters);
        }
        return parameters;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Object getSessionAttribute(final String key) {
        return dataStore.get(this, key);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void setSessionAttribute(final String key, final Object value) {
        dataStore.set(this, key, value);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void setResponseHeader(final String name, final String value) {
        response.setHeader(name, value);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String getServerName() {
        String[] split = request.host().split(":");
        return split[0];
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int getServerPort() {
        String[] split = request.host().split(":");
        String portStr = (split.length > 1) ? split[1] : "80";
        return Integer.valueOf(portStr);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String getScheme() {
        if (request.secure()) {
            return "https";
        } else {
            return "http";
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String getFullRequestURL() {
        return getScheme() + "://" + request.host() + request.uri();
    }

    /**
     * {@inheritDoc}
     */
    public String getRemoteAddr() {
        return request.remoteAddress();
    }

    /**
     * {@inheritDoc}
     */
    public Object getRequestAttribute(String name) {
        return context.args.get(name);
    }

    /**
     * {@inheritDoc}
     */
    public void setRequestAttribute(String name, Object value) {
        context.args.put(name, value);
    }

    /**
     * {@inheritDoc}
     */
    public void invalidateSession() {
        dataStore.invalidate(this);
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Orleans;
using Orleans.Core;
using Orleans.LogConsistency;
using Orleans.MultiCluster;
using Orleans.Runtime;
using Orleans.SystemTargetInterfaces;
using Orleans.GrainDirectory;

namespace Orleans.Runtime.LogConsistency
{
    /// <summary>
    /// Functionality for use by log view adaptors that run distributed protocols.
    /// This class allows access to these services to providers that cannot see runtime-internals.
    /// It also stores grain-specific information like the grain reference, and caches
    /// </summary>
    internal class ProtocolServices : ILogConsistencyProtocolServices
    {

        public GrainReference GrainReference { get { return grain.GrainReference; } }

        private Logger log;

        public IMultiClusterRegistrationStrategy RegistrationStrategy { get; private set; }

        private Grain grain;   // links to the grain that owns this service object

        // pseudo-configuration to use if there is no actual multicluster network
        private static MultiClusterConfiguration PseudoMultiClusterConfiguration;

        internal ProtocolServices(Grain gr, Logger log, IMultiClusterRegistrationStrategy strategy)
        {
            this.grain = gr;
            this.log = log;
            this.RegistrationStrategy = strategy;

            if (!Silo.CurrentSilo.HasMultiClusterNetwork)
            {
                // we are creating a default multi-cluster configuration containing exactly one cluster, this one.
               PseudoMultiClusterConfiguration = new MultiClusterConfiguration(
                   DateTime.UtcNow, new string[] { Silo.CurrentSilo.ClusterId }.ToList());
            }
        }

        public async Task<ILogConsistencyProtocolMessage> SendMessage(ILogConsistencyProtocolMessage payload, string clusterId)
        {
            var silo = Silo.CurrentSilo;
            var mycluster = silo.ClusterId;
            var oracle = silo.LocalMultiClusterOracle;

            log?.Verbose3("SendMessage {0}->{1}: {2}", mycluster, clusterId, payload);

            // send the message to ourself if we are the destination cluster
            if (mycluster == clusterId)
            {
                var g = (ILogConsistencyProtocolParticipant)grain;
                // we are on the same scheduler, so we can call the method directly
                return await g.OnProtocolMessageReceived(payload);
            }

            // cannot send to remote instance if there is only one instance
            if (RegistrationStrategy.Equals(GlobalSingleInstanceRegistration.Singleton))
            {
                throw new ProtocolTransportException("cannot send protocol message to remote instance because there is only one global instance");
            }

            if (PseudoMultiClusterConfiguration != null)
                throw new ProtocolTransportException("no such cluster");

            if (log != null && log.IsVerbose3)
            {
                var gws = oracle.GetGateways();
                log.Verbose3("Available Gateways:\n{0}", string.Join("\n", gws.Select((gw) => gw.ToString())));
            }

            var clusterGateway = oracle.GetRandomClusterGateway(clusterId);

            if (clusterGateway == null)
                throw new ProtocolTransportException("no active gateways found for cluster");

            var repAgent = InsideRuntimeClient.Current.InternalGrainFactory.GetSystemTarget<ILogConsistencyProtocolGateway>(Constants.ProtocolGatewayId, clusterGateway);

            // test hook
            var filter = (oracle as MultiClusterNetwork.MultiClusterOracle).ProtocolMessageFilterForTesting;
            if (filter != null && !filter(payload))
                return null;

            try
            {
                var retMessage = await repAgent.RelayMessage(GrainReference.GrainId, payload);
                return retMessage;
            }
            catch (Exception e)
            {
                throw new ProtocolTransportException("failed sending message to cluster", e);
            }
        }

        public bool MultiClusterEnabled
        {
            get
            {
                return (PseudoMultiClusterConfiguration == null);
            }
        }

        public string MyClusterId
        {
            get
            {
                return Silo.CurrentSilo.ClusterId;
            }
        }

        public MultiClusterConfiguration MultiClusterConfiguration
        {
            get
            {
                return PseudoMultiClusterConfiguration ?? Silo.CurrentSilo.LocalMultiClusterOracle.GetMultiClusterConfiguration();
            }
        }

        public IEnumerable<string> GetRemoteInstances()
        {
            if (PseudoMultiClusterConfiguration == null
                && RegistrationStrategy != ClusterLocalRegistration.Singleton)
            {
                var myclusterid = Silo.CurrentSilo.ClusterId;

                foreach (var cluster in Silo.CurrentSilo.LocalMultiClusterOracle.GetMultiClusterConfiguration().Clusters)
                {
                    if (cluster != myclusterid)
                        yield return cluster;
                }
            }
        }

        public void SubscribeToMultiClusterConfigurationChanges()
        {
            if (PseudoMultiClusterConfiguration == null)
            {
                // subscribe this grain to configuration change events
                Silo.CurrentSilo.LocalMultiClusterOracle.SubscribeToMultiClusterConfigurationEvents(GrainReference);
            }
        }

        public void UnsubscribeFromMultiClusterConfigurationChanges()
        {
            if (PseudoMultiClusterConfiguration == null)
            {
                // unsubscribe this grain from configuration change events
                Silo.CurrentSilo.LocalMultiClusterOracle.UnSubscribeFromMultiClusterConfigurationEvents(GrainReference);
            }

        }

        public IEnumerable<string> ActiveClusters
        {
            get
            {
                if (PseudoMultiClusterConfiguration != null)
                    return PseudoMultiClusterConfiguration.Clusters;
                else
                    return Silo.CurrentSilo.LocalMultiClusterOracle.GetActiveClusters();
            }
        }

        public void ProtocolError(string msg, bool throwexception)
        {

            log?.Error((int)(throwexception ? ErrorCode.LogConsistency_ProtocolFatalError : ErrorCode.LogConsistency_ProtocolError),
                string.Format("{0}{1} Protocol Error: {2}",
                    grain.GrainReference,
                    PseudoMultiClusterConfiguration == null ? "" : (" " + Silo.CurrentSilo.ClusterId),
                    msg));

            if (!throwexception)
                return;

            if (PseudoMultiClusterConfiguration != null)
                throw new OrleansException(string.Format("{0} (grain={1})", msg, grain.GrainReference));
            else
                throw new OrleansException(string.Format("{0} (grain={1}, cluster={2})", msg, grain.GrainReference, Silo.CurrentSilo.ClusterId));
        }

        public void CaughtException(string where, Exception e)
        {
            log?.Error((int)ErrorCode.LogConsistency_CaughtException,
               string.Format("{0}{1} Exception Caught at {2}",
                   grain.GrainReference,
                   PseudoMultiClusterConfiguration == null ? "" : (" " + Silo.CurrentSilo.ClusterId),
                   where),e);
        }

        public void CaughtUserCodeException(string callback, string where, Exception e)
        {
            log?.Warn((int)ErrorCode.LogConsistency_UserCodeException,
                string.Format("{0}{1} Exception caught in user code for {2}, called from {3}",
                   grain.GrainReference,
                   PseudoMultiClusterConfiguration == null ? "" : (" " + Silo.CurrentSilo.ClusterId),
                   callback,
                   where), e);
        }

        public void Log(Severity severity, string format, params object[] args)
        {
            if (log != null && log.SeverityLevel >= severity)
            {
                var msg = string.Format("{0}{1} {2}",
                        grain.GrainReference,
                        PseudoMultiClusterConfiguration != null ? "" : (" " + Silo.CurrentSilo.ClusterId),
                        string.Format(format, args));
                log.Log(0, severity, msg, EmptyObjectArray, null);
            }
        }

        private static readonly object[] EmptyObjectArray = new object[0];
    }

}


text:
from .messaging_pyx import Context, Poller, SubSocket, PubSocket  # pylint: disable=no-name-in-module, import-error
from .messaging_pyx import MultiplePublishersError, MessagingError  # pylint: disable=no-name-in-module, import-error
import capnp

from typing import Optional, List, Union

from cereal import log
from cereal.services import service_list

assert MultiplePublishersError
assert MessagingError

# sec_since_boot is faster, but allow to run standalone too
try:
  from common.realtime import sec_since_boot
except ImportError:
  import time
  sec_since_boot = time.time
  print("Warning, using python time.time() instead of faster sec_since_boot")

context = Context()

def new_message(service: Optional[str] = None, size: Optional[int] = None) -> capnp.lib.capnp._DynamicStructBuilder:
  dat = log.Event.new_message()
  dat.logMonoTime = int(sec_since_boot() * 1e9)
  dat.valid = True
  if service is not None:
    if size is None:
      dat.init(service)
    else:
      dat.init(service, size)
  return dat

def pub_sock(endpoint: str) -> PubSocket:
  sock = PubSocket()
  sock.connect(context, endpoint)
  return sock

def sub_sock(endpoint: str, poller: Optional[Poller] = None, addr: str = "127.0.0.1",
             conflate: bool = False, timeout: Optional[int] = None) -> SubSocket:
  sock = SubSocket()
  sock.connect(context, endpoint, addr.encode('utf8'), conflate)

  if timeout is not None:
    sock.setTimeout(timeout)

  if poller is not None:
    poller.registerSocket(sock)
  return sock

def drain_sock_raw(sock: SubSocket, wait_for_one: bool = False) -> List[bytes]:
  """Receive all message currently available on the queue"""
  ret: List[bytes] = []
  while 1:
    if wait_for_one and len(ret) == 0:
      dat = sock.receive()
    else:
      dat = sock.receive(non_blocking=True)

    if dat is None:
      break

    ret.append(dat)

  return ret

def drain_sock(sock: SubSocket, wait_for_one: bool = False) -> List[capnp.lib.capnp._DynamicStructReader]:
  """Receive all message currently available on the queue"""
  ret: List[capnp.lib.capnp._DynamicStructReader] = []
  while 1:
    if wait_for_one and len(ret) == 0:
      dat = sock.receive()
    else:
      dat = sock.receive(non_blocking=True)

    if dat is None:  # Timeout hit
      break

    dat = log.Event.from_bytes(dat)
    ret.append(dat)

  return ret

# TODO: print when we drop packets?
def recv_sock(sock: SubSocket, wait: bool = False) -> Union[None, capnp.lib.capnp._DynamicStructReader]:
  """Same as drain sock, but only returns latest message. Consider using conflate instead."""
  dat = None

  while 1:
    if wait and dat is None:
      rcv = sock.receive()
    else:
      rcv = sock.receive(non_blocking=True)

    if rcv is None:  # Timeout hit
      break

    dat = rcv

  if dat is not None:
    dat = log.Event.from_bytes(dat)

  return dat

def recv_one(sock: SubSocket) -> Union[None, capnp.lib.capnp._DynamicStructReader]:
  dat = sock.receive()
  if dat is not None:
    dat = log.Event.from_bytes(dat)
  return dat

def recv_one_or_none(sock: SubSocket) -> Union[None, capnp.lib.capnp._DynamicStructReader]:
  dat = sock.receive(non_blocking=True)
  if dat is not None:
    dat = log.Event.from_bytes(dat)
  return dat

def recv_one_retry(sock: SubSocket) -> capnp.lib.capnp._DynamicStructReader:
  """Keep receiving until we get a message"""
  while True:
    dat = sock.receive()
    if dat is not None:
      return log.Event.from_bytes(dat)

class SubMaster():
  def __init__(self, services: List[str], poll: Optional[List[str]] = None,
               ignore_alive: Optional[List[str]] = None, addr:str ="127.0.0.1"):
    self.frame = -1
    self.updated = {s: False for s in services}
    self.rcv_time = {s: 0. for s in services}
    self.rcv_frame = {s: 0 for s in services}
    self.alive = {s: False for s in services}
    self.sock = {}
    self.freq = {}
    self.data = {}
    self.valid = {}
    self.logMonoTime = {}

    self.poller = Poller()
    self.non_polled_services = [s for s in services if poll is not None and
                                len(poll) and s not in poll]

    if ignore_alive is not None:
      self.ignore_alive = ignore_alive
    else:
      self.ignore_alive = []

    for s in services:
      if addr is not None:
        p = self.poller if s not in self.non_polled_services else None
        self.sock[s] = sub_sock(s, poller=p, addr=addr, conflate=True)
      self.freq[s] = service_list[s].frequency

      try:
        data = new_message(s)
      except capnp.lib.capnp.KjException:  # pylint: disable=c-extension-no-member
        data = new_message(s, 0) # lists

      self.data[s] = getattr(data, s)
      self.logMonoTime[s] = 0
      self.valid[s] = data.valid

  def __getitem__(self, s: str) -> capnp.lib.capnp._DynamicStructReader:
    return self.data[s]

  def update(self, timeout: int = 1000) -> None:
    msgs = []
    for sock in self.poller.poll(timeout):
      msgs.append(recv_one_or_none(sock))

    # non-blocking receive for non-polled sockets
    for s in self.non_polled_services:
      msgs.append(recv_one_or_none(self.sock[s]))
    self.update_msgs(sec_since_boot(), msgs)

  def update_msgs(self, cur_time: float, msgs: List[capnp.lib.capnp._DynamicStructReader]) -> None:
    self.frame += 1
    self.updated = dict.fromkeys(self.updated, False)
    for msg in msgs:
      if msg is None:
        continue

      s = msg.which()
      self.updated[s] = True
      self.rcv_time[s] = cur_time
      self.rcv_frame[s] = self.frame
      self.data[s] = getattr(msg, s)
      self.logMonoTime[s] = msg.logMonoTime
      self.valid[s] = msg.valid

    for s in self.data:
      # arbitrary small number to avoid float comparison. If freq is 0, we can skip the check
      if self.freq[s] > 1e-5:
        # alive if delay is within 10x the expected frequency
        self.alive[s] = (cur_time - self.rcv_time[s]) < (10. / self.freq[s])
      else:
        self.alive[s] = True

  def all_alive(self, service_list=None) -> bool:
    if service_list is None:  # check all
      service_list = self.alive.keys()
    return all(self.alive[s] for s in service_list if s not in self.ignore_alive)

  def all_valid(self, service_list=None) -> bool:
    if service_list is None:  # check all
      service_list = self.valid.keys()
    return all(self.valid[s] for s in service_list)

  def all_alive_and_valid(self, service_list=None) -> bool:
    if service_list is None:  # check all
      service_list = self.alive.keys()
    return self.all_alive(service_list=service_list) and self.all_valid(service_list=service_list)

class PubMaster():
  def __init__(self, services: List[str]):
    self.sock = {}
    for s in services:
      self.sock[s] = pub_sock(s)

  def send(self, s: str, dat: Union[bytes, capnp.lib.capnp._DynamicStructBuilder]) -> None:
    if not isinstance(dat, bytes):
      dat = dat.to_bytes()
    self.sock[s].send(dat)


text:
<?xml version='1.0' encoding='UTF-8' standalone='no'?>

<title>AppStore::Templates::QuizPage class Reference</title>
<para>Inheritance diagram for AppStore::Templates::QuizPage</para>
<para>

        <title>Inheritance graph</title>
        <mediaobject>
            <imageobject>
                <imagedata width="50%" align="center" valign="middle" scalefit="1" fileref="../../d9/d3b/class_app_store_1_1_templates_1_1_quiz_page__inherit__graph.png"></imagedata>
            </imageobject>
        </mediaobject>

</para>
<para>Collaboration diagram for AppStore::Templates::QuizPage</para>
<para>

        <title>Collaboration graph</title>
        <mediaobject>
            <imageobject>
                <imagedata width="50%" align="center" valign="middle" scalefit="1" fileref="../../d0/d0e/class_app_store_1_1_templates_1_1_quiz_page__coll__graph.png"></imagedata>
            </imageobject>
        </mediaobject>

</para>

            <title>Private Attributes</title>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>global::Windows.UI.Xaml.Controls.Grid LayoutRoot</para>
                    </listitem>
                </itemizedlist>
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>global::Windows.UI.Xaml.Controls.Grid ContentRoot</para>
                    </listitem>
                </itemizedlist>
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>global::Windows.UI.Xaml.Controls.StackPanel QuestionContent</para>
                    </listitem>
                </itemizedlist>
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>global::Windows.UI.Xaml.Controls.TextBlock QuestionNumber</para>
                    </listitem>
                </itemizedlist>
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>global::Windows.UI.Xaml.Controls.TextBlock Question</para>
                    </listitem>
                </itemizedlist>
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>global::Windows.UI.Xaml.Controls.RadioButton Option1</para>
                    </listitem>
                </itemizedlist>
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>global::Windows.UI.Xaml.Controls.RadioButton Option2</para>
                    </listitem>
                </itemizedlist>
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>global::Windows.UI.Xaml.Controls.RadioButton Option3</para>
                    </listitem>
                </itemizedlist>
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>global::Windows.UI.Xaml.Controls.RadioButton Option4</para>
                    </listitem>
                </itemizedlist>
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>global::Windows.UI.Xaml.Controls.Button Skip</para>
                    </listitem>
                </itemizedlist>
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>global::Windows.UI.Xaml.Controls.Button Next</para>
                    </listitem>
                </itemizedlist>
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>global::Windows.UI.Xaml.Controls.TextBlock pageTitle</para>
                    </listitem>
                </itemizedlist>
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>bool _contentLoaded</para>
                    </listitem>
                </itemizedlist>
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>NavigationHelper navigationHelper</para>
                    </listitem>
                </itemizedlist>
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>ObservableDictionary defaultViewModel</para>
                    </listitem>
                </itemizedlist>
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>Models.QuizModel quiz</para>
                    </listitem>
                </itemizedlist>
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>int iQuestionIndex</para>
                    </listitem>
                </itemizedlist>
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>int iCurrentCorrectAnswer</para>
                    </listitem>
                </itemizedlist>
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>int iNumberofQuestions</para>
                    </listitem>
                </itemizedlist>
            </para>

            <title></title>
            <para>
                <itemizedlist>
                    <listitem>
                    </listitem>
                </itemizedlist>
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                    </listitem>
                </itemizedlist>
            </para>

            <title></title>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>void <link linkend="d6/de3/class_app_store_1_1_templates_1_1_quiz_page_1a7469138fbae2361bb746dfe9682970d8">Connect</link> (
int connectionId, object target)</para>
                    </listitem>
                </itemizedlist>
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>void <link linkend="d6/de3/class_app_store_1_1_templates_1_1_quiz_page_1a97c18d9042860e89deb3b5ce9997b050">InitializeComponent</link> (
)</para>
                    </listitem>
                </itemizedlist>
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>void <link linkend="d6/de3/class_app_store_1_1_templates_1_1_quiz_page_1a7469138fbae2361bb746dfe9682970d8">Connect</link> (
int connectionId, object target)</para>
                    </listitem>
                </itemizedlist>
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>void <link linkend="d6/de3/class_app_store_1_1_templates_1_1_quiz_page_1a97c18d9042860e89deb3b5ce9997b050">InitializeComponent</link> (
)</para>
                    </listitem>
                </itemizedlist>
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <para> <link linkend="d6/de3/class_app_store_1_1_templates_1_1_quiz_page_1a165b94ab5c05a08acfde5dba20eb6c6e">QuizPage</link> (
)<para><emphasis><summary>
Public Construtor to the QuizPage.</emphasis></para>
</para>
                    </listitem>
                </itemizedlist>
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>void <link linkend="d6/de3/class_app_store_1_1_templates_1_1_quiz_page_1a1fcaa90e0ac2a6f9942b15c535eb3a0c">populateQuestion</link> (
int index)<para><emphasis><summary>
It populates the question with the index passed into the current view.</emphasis></para>
</para>
                    </listitem>
                </itemizedlist>
            </para>

            <title></title>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>void <link linkend="d6/de3/class_app_store_1_1_templates_1_1_quiz_page_1a0fe259e30ee8473f65baafdf133e9af6">NavigationHelper_LoadState</link> (
object sender, <link linkend="d4/df7/class_app_store_1_1_common_1_1_load_state_event_args">LoadStateEventArgs</link> e)<para><emphasis><summary>
Populates the page with content passed during navigation.</emphasis></para>
</para>
                    </listitem>
                </itemizedlist>
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>void <link linkend="d6/de3/class_app_store_1_1_templates_1_1_quiz_page_1a0df3a65f441e2efe4e25d42ca1058c7a">NavigationHelper_SaveState</link> (
object sender, <link linkend="dd/d31/class_app_store_1_1_common_1_1_save_state_event_args">SaveStateEventArgs</link> e)<para><emphasis><summary>
Preserves state associated with this page in case the application is suspended or the
page is discarded from the navigation cache.</emphasis></para>
</para>
                    </listitem>
                </itemizedlist>
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>void <link linkend="d6/de3/class_app_store_1_1_templates_1_1_quiz_page_1aa9129a64d82d9c7f3c26fa7f8507fe9e">Options_Checked</link> (
object sender, RoutedEventArgs e)<para><emphasis><summary>
Executed when any of the options are checked.</emphasis></para>
</para>
                    </listitem>
                </itemizedlist>
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>void <link linkend="d6/de3/class_app_store_1_1_templates_1_1_quiz_page_1a76eeef3263685813cba3d3f81e1153ed">Next_Click</link> (
object sender, RoutedEventArgs e)<para><emphasis><summary>
Executed when the Next Button is tapped.</emphasis></para>
</para>
                    </listitem>
                </itemizedlist>
            </para>

            <title></title>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>override void <link linkend="d6/de3/class_app_store_1_1_templates_1_1_quiz_page_1aa8cafba9787bf2121392435ee129b6ca">OnNavigatedTo</link> (
NavigationEventArgs e)<para><emphasis><summary>
The methods provided in this section are simply used to allow
NavigationHelper to respond to the page's navigation methods.</emphasis></para>
</para>
                    </listitem>
                </itemizedlist>
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>override void <link linkend="d6/de3/class_app_store_1_1_templates_1_1_quiz_page_1afa1960ed3aa03a22a5ddb6a1fc150716">OnNavigatedFrom</link> (
NavigationEventArgs e)<para><emphasis><summary>
The methods provided in this section are simply used to allow
NavigationHelper to respond to the page's navigation methods.</emphasis></para>
</para>
                    </listitem>
                </itemizedlist>
            </para>

    <simplesect>

<para>This page deals with the Quiz-App template. </para>
    </simplesect>
        <simplesect>
            <title>Detailed Description</title>
                <para>Definition at line 16 of file QuizPage.g.cs</para>
                <para>The Documentation for this struct was generated from the following file: </para>
                <para><itemizedlist><listitem><para>QuizPage.g.cs</para></listitem></itemizedlist></para>
        </simplesect>

            <title>Member Data Documentation</title>

                <title>void AppStore.Templates.QuizPage.Connect (int connectionId, object target)</title> <emphasis></emphasis>

                <title>void AppStore.Templates.QuizPage.InitializeComponent ()</title> <emphasis></emphasis>

                <title>void AppStore.Templates.QuizPage.Connect (int connectionId, object target)</title> <emphasis></emphasis>

                <title>void AppStore.Templates.QuizPage.InitializeComponent ()</title> <emphasis></emphasis>

                <title>AppStore.Templates.QuizPage.QuizPage ()</title> <emphasis><summary>
Public Construtor to the QuizPage.</emphasis>

<para>Populates the views pertaining to this page. </para>

                <title>void AppStore.Templates.QuizPage.populateQuestion (int index)</title> <emphasis><summary>
It populates the question with the index passed into the current view.</emphasis>

<para>
                <formalpara>
                    <title/>

                        <title>Parameters                        </title>
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>

                            <row>
                                <entry>index</entry>
                                <entry>
<para>The index of the question which will be populated in the current view.</para>
</entry>
                            </row>

                        </tgroup>

                </formalpara>
                </para>

                <title>void AppStore.Templates.QuizPage.NavigationHelper_LoadState (object sender, LoadStateEventArgs e)</title> <emphasis><summary>
Populates the page with content passed during navigation.</emphasis>

<para>Any saved state is also provided when recreating a page from a prior session. </para>

<para>
                <formalpara>
                    <title/>

                        <title>Parameters                        </title>
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>

                            <row>
                                <entry>sender</entry>
                                <entry>
<para>The source of the event; typically <link linkend="d6/de3/class_app_store_1_1_templates_1_1_quiz_page_1a9691892e3a359dbca254751b6c19602b">NavigationHelper</link> </para>
</entry>
                            </row>
                            <row>
                                <entry>e</entry>
                                <entry>
<para>Event data that provides both the navigation parameter passed to Frame.Navigate(Type, Object) when this page was initially requested and a dictionary of state preserved by this page during an earlier session. The state will be null the first time a page is visited.</para>
</entry>
                            </row>

                        </tgroup>

                </formalpara>
                </para>

                <title>void AppStore.Templates.QuizPage.NavigationHelper_SaveState (object sender, SaveStateEventArgs e)</title> <emphasis><summary>
Preserves state associated with this page in case the application is suspended or the
page is discarded from the navigation cache.</emphasis>

<para>Values must conform to the serialization requirements of SuspensionManager.SessionState. </para>

<para>
                <formalpara>
                    <title/>

                        <title>Parameters                        </title>
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>

                            <row>
                                <entry>sender</entry>
                                <entry>
<para>The source of the event; typically <link linkend="d6/de3/class_app_store_1_1_templates_1_1_quiz_page_1a9691892e3a359dbca254751b6c19602b">NavigationHelper</link></para>
</entry>
                            </row>
                            <row>
                                <entry>e</entry>
                                <entry>
<para>Event data that provides an empty dictionary to be populated with serializable state.</para>
</entry>
                            </row>

                        </tgroup>

                </formalpara>
                </para>

                <title>void AppStore.Templates.QuizPage.Options_Checked (object sender, RoutedEventArgs e)</title> <emphasis><summary>
Executed when any of the options are checked.</emphasis>

<para>
                <formalpara>
                    <title/>

                        <title>Parameters                        </title>
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>

                            <row>
                                <entry>sender</entry>
                                <entry>
<para>Object Sender is a parameter called Sender that contains a reference to the control/object that raised the event.</para>
</entry>
                            </row>
                            <row>
                                <entry>e</entry>
                                <entry>
<para>RoutedEventArgs e is a parameter called e that contains the event data, see the RoutedEventArgs MSDN page for more information.</para>
</entry>
                            </row>

                        </tgroup>

                </formalpara>
                </para>

                <title>void AppStore.Templates.QuizPage.Next_Click (object sender, RoutedEventArgs e)</title> <emphasis><summary>
Executed when the Next Button is tapped.</emphasis>

<para>It populates the next question in the current view. </para>

<para>
                <formalpara>
                    <title/>

                        <title>Parameters                        </title>
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>

                            <row>
                                <entry>sender</entry>
                                <entry>
<para>Object Sender is a parameter called Sender that contains a reference to the control/object that raised the event.</para>
</entry>
                            </row>
                            <row>
                                <entry>e</entry>
                                <entry>
<para>RoutedEventArgs e is a parameter called e that contains the event data, see the RoutedEventArgs MSDN page for more information.</para>
</entry>
                            </row>

                        </tgroup>

                </formalpara>
                </para>

                <title>override void AppStore.Templates.QuizPage.OnNavigatedTo (NavigationEventArgs e)</title> <emphasis><summary>
The methods provided in this section are simply used to allow
NavigationHelper to respond to the page's navigation methods.</emphasis>

<para><link linkend="db/d2f/class_page">Page</link> specific logic should be placed in event handlers for the NavigationHelper.LoadState and NavigationHelper.SaveState. The navigation parameter is available in the LoadState method in addition to page state preserved during an earlier session. </para>

<para>
                <formalpara>
                    <title/>

                        <title>Parameters                        </title>
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>

                            <row>
                                <entry>e</entry>
                                <entry>
<para>Provides data for navigation methods and event handlers that cannot cancel the navigation request.</para>
</entry>
                            </row>

                        </tgroup>

                </formalpara>
                </para>

                <title>override void AppStore.Templates.QuizPage.OnNavigatedFrom (NavigationEventArgs e)</title> <emphasis><summary>
The methods provided in this section are simply used to allow
NavigationHelper to respond to the page's navigation methods.</emphasis>

<para><link linkend="db/d2f/class_page">Page</link> specific logic should be placed in event handlers for the NavigationHelper.LoadState and NavigationHelper.SaveState. The navigation parameter is available in the LoadState method in addition to page state preserved during an earlier session. </para>

<para>
                <formalpara>
                    <title/>

                        <title>Parameters                        </title>
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>

                            <row>
                                <entry>e</entry>
                                <entry>
<para>Provides data for navigation methods and event handlers that cannot cancel the navigation request.</para>
</entry>
                            </row>

                        </tgroup>

                </formalpara>
                </para>


text:
package nl.esciencecenter.qtm.solr.tagger.utils;

public class TagItem {

	private Integer start = null;
	private Integer end = null;
	private String uuid = null;
	private String icd10 = null;
	private String term = null;
	private String prefterm = null;
	private String matchtext = null;

	public Integer getStart() {
		return start;
	}

	public void setStart(Integer start) {
		this.start = start;
	}

	public Integer getEnd() {
		return end;
	}

	public void setEnd(Integer end) {
		this.end = end;
	}

	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public String getIcd10() {
		return icd10;
	}

	public void setIcd10(String icd10) {
		this.icd10 = icd10;
	}

	public String getTerm() {
		return term;
	}

	public void setTerm(String term) {
		this.term = term;
	}

	public String getPrefTerm() {
		return prefterm;
	}
	public void setPrefTerm(String prefterm) {
		this.prefterm = prefterm;
	}

	public String getMatchText() {
		return matchtext;
	}

	public void setMatchText(String matchtext) {
		this.matchtext = matchtext;
	}

	@Override
	public String toString() {
		return icd10 + ":" + start + ":" + end;
	}

}


text:
import 'babel/polyfill';
import MessageNode from './MessageNode'

class MessageRouteInspector extends React.Component {
  rebuildHierarchy(messages) {
    var root = null;

    this.props.route.messages.map((message) => {
      if(root === null) {
        root = message;
        root.parent = root;
        root.children = [];
      } else {
        root.children.push(message);
        message.parent = root;
        root = message;
        root.children = [];
      }
      for(var i = message.closeBranchCount; i > 0; i--) {
        root = root.parent
      }
    });
    return root;
  }

  render() {
    console.log('render MessageRouteInspector');
    var hierarchy = this.rebuildHierarchy(this.props.route.messages);
    return (

          <MessageNode message={hierarchy} />

    )
  }
}

export default Relay.createContainer(MessageRouteInspector, {
  fragments: {
    route: () => Relay.QL`
      fragment on MessageRoute {
        messages {
          id,
          name,
          type,
          closeBranchCount
        }
      }
    `
  }
});


text:
import React, {Component, PropTypes} from 'react';
import {View, Text, ActivityIndicator, StyleSheet} from 'react-native';
import {Link} from 'react-router';
import MarkdownContent from '../components/MarkdownContent';

export default class TimeboxPage extends Component {
  static contextTypes = {
    app: PropTypes.object.isRequired,
    isAuthorized: PropTypes.bool.isRequired,
  };

  state = {
    timebox: undefined,
    isLoading: false,
  };

  detachTimeboxListener = null;

  componentDidMount() {
    setTimeout(() => {
      this.setState(({timebox}) => ({
        isLoading: timebox === undefined,
      }));
    }, 200);

    const db = this.context.app.database();
    const ref = db.ref('timebox');
    const listener = ref.on('value', (snapshot) => {
      this.setState({
        timebox: snapshot.val(),
        isLoading: false,
      });
    });

    this.detachTimeboxListener = () => ref.off('value', listener);
  }

  componentWillUnmount() {
    this.detachTimeboxListener();
  }

  render() {
    const {styles} = TimeboxPage;
    const {isAuthorized} = this.context;
    const {timebox, isLoading} = this.state;

    if (isLoading) {
      return (
        <ActivityIndicator color='black'/>
      );
    }

    if (!timebox) {
      return (
        <Text style={styles.noTimeboxedItem}>
          There's no agenda item in the timebox.{' '}
          (<Link to='/agenda'>View Agenda</Link>)
        </Text>
      );
    }

    const durationMinutes = timebox.duration / (1000 * 60);

    return (
      <View style={styles.container}>
        <Text
          style={styles.heading}
          accessibilityRole='heading'
        >
          Current Timeboxed Agenda Item:{' '}
          (<Link to='/agenda' key={0}>
            {isAuthorized ? 'Change' : 'View Agenda'}
          </Link>)
        </Text>
        <View style={styles.timebox}>
          <View style={styles.timeboxLabel}>
            <MarkdownContent
              style={styles.timeboxLabelMarkdown}
              content={timebox.label}
              links={timebox.links}
            />
          </View>
          <Text
            style={styles.timeboxDuration}
            selectable={false}
            accessibilityLabel={`${durationMinutes} minutes`}
          >
            {durationMinutes}m
          </Text>
        </View>
      </View>
    );
  }

  static styles = StyleSheet.create({
    container: {},
    heading: {
      color: 'rgba(0, 0, 0, 0.6)',
    },
    noTimeboxedItem: {
      fontStyle: 'italic',
    },
    timebox: {
      flexDirection: 'row',
    },
    timeboxLabel: {
      order: 2,
      flexShrink: 1,
    },
    timeboxLabelMarkdown: {
      marginVertical: 0,
      fontSize: '3rem',
    },
    timeboxDuration: {
      order: 1,
      fontSize: '3rem',
      marginRight: '1rem',
      color: 'rgba(0, 0, 0, 0.6)',
    },
  });
}


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

<title>TransitionSystem.State (Jason - AgentSpeak Java Interpreter)</title>
<meta name="date" content="2013-12-12">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Enum Constants |

Field |

Method

Detail:

Enum Constants |

Field |

Method

jason.asSemantics

Enum TransitionSystem.State

<map id="G" name="G">
<area shape="rect" id="node1_0" href="./TransitionSystem.State.html" title="jason.asSemantics.TransitionSystem.State" alt="" coords="15,11,121,237"/>
<area shape="rect" id="node1" href="./TransitionSystem.State.html" title="<TABLE>" alt="" coords="5,6,131,242"/>
</map>

java.lang.Object

java.lang.Enum<TransitionSystem.State>

jason.asSemantics.TransitionSystem.State

All Implemented Interfaces:

java.io.Serializable, java.lang.Comparable<TransitionSystem.State>

Enclosing class:

TransitionSystem

public static enum TransitionSystem.State
extends java.lang.Enum<TransitionSystem.State>

Enum Constant Summary

Enum Constants

Enum Constant and Description

AddIM

ApplPl

ClrInt

ExecInt

FindOp

ProcAct

RelPl

SelAppl

SelEv

SelInt

StartRC

Method Summary

Methods

Modifier and Type
Method and Description

static TransitionSystem.State
valueOf(java.lang.String name)

Returns the enum constant of this type with the specified name.

static TransitionSystem.State[]
values()

Returns an array containing the constants of this enum type, in
the order they are declared.

Methods inherited from class java.lang.Enum

clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

Methods inherited from class java.lang.Object

getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

StartRC

public static final TransitionSystem.State StartRC

SelEv

public static final TransitionSystem.State SelEv

RelPl

public static final TransitionSystem.State RelPl

ApplPl

public static final TransitionSystem.State ApplPl

SelAppl

public static final TransitionSystem.State SelAppl

FindOp

public static final TransitionSystem.State FindOp

AddIM

public static final TransitionSystem.State AddIM

ProcAct

public static final TransitionSystem.State ProcAct

SelInt

public static final TransitionSystem.State SelInt

ExecInt

public static final TransitionSystem.State ExecInt

ClrInt

public static final TransitionSystem.State ClrInt

Method Detail

values

public static TransitionSystem.State[] values()

Returns an array containing the constants of this enum type, in
the order they are declared.  This method may be used to iterate
over the constants as follows:

for (TransitionSystem.State c : TransitionSystem.State.values())
    System.out.println(c);

Returns:

an array containing the constants of this enum type, in
the order they are declared

valueOf

public static TransitionSystem.State valueOf(java.lang.String name)

Returns the enum constant of this type with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this type.  (Extraneous whitespace characters are
not permitted.)

Parameters:

name - the name of the enum constant to be returned.

Returns:

the enum constant with the specified name

Throws:

java.lang.IllegalArgumentException - if this enum type has no constant
with the specified name

java.lang.NullPointerException - if the argument is null

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Enum Constants |

Field |

Method

Detail:

Enum Constants |

Field |

Method


text:
from subprocess import Popen, PIPE
import sys

#def main():
request_body = '\1\0\0\0'

# launch backend service passing the payload size as first param
process_res = Popen(['./mobility_server', 'exchange', '4', 'ACCL-TEST-APPLICATION'], stdout=PIPE, stdin=PIPE)

# send the buffer to the backend service
out, err = process_res.communicate(request_body)

if process_res.returncode == 0:
    print out
    sys.exit(0)
else:
    print "ERROR"
    sys.exit(1)


text:
package io.horizondb.model.schema;

import io.horizondb.io.Buffer;
import io.horizondb.io.buffers.Buffers;

import java.io.IOException;

import org.junit.Test;

import static org.junit.Assert.assertEquals;

/**
 * @author Benjamin
 *
 */
public class BlockPositionTest {

    @Test
    public void testGetParser() throws IOException {

        BlockPosition position = new BlockPosition(1024, 32);

        Buffer buffer = Buffers.allocate(100);
        position.writeTo(buffer);

        BlockPosition deserializedDefinition = BlockPosition.getParser().parseFrom(buffer);
        assertEquals(position, deserializedDefinition);
    }

    @Test
    public void testParseFrom() throws IOException {

        BlockPosition position = new BlockPosition(1024, 32);

        Buffer buffer = Buffers.allocate(100);
        position.writeTo(buffer);

        BlockPosition deserializedDefinition = BlockPosition.parseFrom(buffer);
        assertEquals(position, deserializedDefinition);
    }

    @Test
    public void testComputeSerializedSize() throws IOException {

        BlockPosition position = new BlockPosition(1024, 32);

        Buffer buffer = Buffers.allocate(100);
        position.writeTo(buffer);

        assertEquals(buffer.readableBytes(), position.computeSerializedSize());
    }

}


text:
using Cumulus.MessageContracts;

namespace Cumulus.StressTests.ThroughputTests.MessageContracts
{
    public class BazCommand : IBusCommand
    {
    }
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>io.trane</groupId>
		<artifactId>ndbc</artifactId>
		<version>0.1.4-SNAPSHOT</version>
	</parent>
	<artifactId>ndbc-postgres</artifactId>
	<packaging>jar</packaging>

	<name>ndbc-postgres</name>

	<dependencies>
		<dependency>
			<groupId>io.trane</groupId>
			<artifactId>ndbc-core</artifactId>
			<version>0.1.4-SNAPSHOT</version>
		</dependency>
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<version>1.2.3</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.12</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.pitest</groupId>
				<artifactId>pitest-maven</artifactId>
				<version>1.1.11</version>
				<configuration>
					<targetClasses>
						<param>io.trane*</param>
					</targetClasses>
					<targetTests>
						<param>io.trane*</param>
					</targetTests>
					<threads>8</threads>
					<exportLineCoverage>true</exportLineCoverage>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>


text:
describe "OracleEnhancedAdapter schema dump" do
  include SchemaSpecHelper

  before(:all) do
    ActiveRecord::Base.establish_connection(CONNECTION_PARAMS)
    @conn = ActiveRecord::Base.connection
    @oracle11g_or_higher = !! @conn.select_value(
      "select * from product_component_version where product like 'Oracle%' and to_number(substr(version,1,2)) >= 11")
  end

  def standard_dump(options = {})
    stream = StringIO.new
    ActiveRecord::SchemaDumper.ignore_tables = options[:ignore_tables] || []
    ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, stream)
    stream.string
  end

  def create_test_posts_table(options = {})
    options.merge! force: true
    schema_define do
      create_table :test_posts, options do |t|
        t.string :title
        t.timestamps null: true
      end
      add_index :test_posts, :title
    end
  end

  def drop_test_posts_table
    schema_define do
      drop_table :test_posts
    end
  rescue
    nil
  end

  describe "tables" do
    after(:each) do
      drop_test_posts_table
    end

    it "should not include ignored table names in schema dump" do
      create_test_posts_table
      expect(standard_dump(ignore_tables: %w(test_posts))).not_to match(/create_table "test_posts"/)
    end

    it "should not include ignored table regexes in schema dump" do
      create_test_posts_table
      expect(standard_dump(ignore_tables: [ /test_posts/i ])).not_to match(/create_table "test_posts"/)
    end

  end

  describe "dumping default values" do
    before :each do
      schema_define do
        create_table "test_defaults", force: true do |t|
          t.string "regular", default: "c"
          t.string "special_c", default: "\n"
        end
      end
    end

    after(:each) do
      schema_define do
        drop_table "test_defaults"
      end
    end

    it "should be able to dump default values using special characters" do
      expect(standard_dump).to match(/t.string \"special_c\", default: "\\n"/)
    end
  end

  describe "table with non-default primary key" do
    after(:each) do
      drop_test_posts_table
    end

    it "should include non-default primary key in schema dump" do
      create_test_posts_table(primary_key: "post_id")
      expect(standard_dump).to match(/create_table "test_posts", primary_key: "post_id"/)
    end

  end

  describe "table with ntext columns" do
    before :each do
      schema_define do
        create_table "test_ntexts", force: true do |t|
          t.ntext :ntext_column
        end
      end
    end

    after(:each) do
      schema_define do
        drop_table "test_ntexts"
      end
    end

    it "should be able to dump ntext columns" do
      expect(standard_dump).to match(/t.ntext \"ntext_column\"/)
    end
  end

  describe "table with primary key trigger" do

    after(:each) do
      drop_test_posts_table
      @conn.clear_prefetch_primary_key
    end

    it "should include primary key trigger in schema dump" do
      create_test_posts_table(primary_key_trigger: true)
      expect(standard_dump).to match(/create_table "test_posts".*add_primary_key_trigger "test_posts"/m)
    end

    it "should include primary key trigger with non-default primary key in schema dump" do
      create_test_posts_table(primary_key_trigger: true, primary_key: "post_id")
      expect(standard_dump).to match(/create_table "test_posts", primary_key: "post_id".*add_primary_key_trigger "test_posts", primary_key: "post_id"/m)
    end

  end

  describe "foreign key constraints" do
    before(:all) do
      schema_define do
        create_table :test_posts, force: true do |t|
          t.string :title
        end
        create_table :test_comments, force: true do |t|
          t.string :body, limit: 4000
          t.references :test_post
        end
      end
    end

    after(:each) do
      schema_define do
        remove_foreign_key :test_comments, :test_posts rescue nil
        remove_foreign_key :test_comments, name: "comments_posts_baz_fooz_fk" rescue nil
      end
    end
    after(:all) do
      schema_define do
        drop_table :test_comments rescue nil
        drop_table :test_posts rescue nil
      end
    end

    it "should include foreign key in schema dump" do
      schema_define do
        add_foreign_key :test_comments, :test_posts
      end
      expect(standard_dump).to match(/add_foreign_key "test_comments", "test_posts"/)
    end

    it "should include foreign key with delete dependency in schema dump" do
      schema_define do
        add_foreign_key :test_comments, :test_posts, on_delete: :cascade
      end
      expect(standard_dump).to match(/add_foreign_key "test_comments", "test_posts", on_delete: :cascade/)
    end

    it "should include foreign key with nullify dependency in schema dump" do
      schema_define do
        add_foreign_key :test_comments, :test_posts, on_delete: :nullify
      end
      expect(standard_dump).to match(/add_foreign_key "test_comments", "test_posts", on_delete: :nullify/)
    end

    it "should not include foreign keys on ignored table names in schema dump" do
      schema_define do
        add_foreign_key :test_comments, :test_posts
      end
      expect(standard_dump(ignore_tables: %w(test_comments))).not_to match(/add_foreign_key "test_comments"/)
    end

    it "should not include foreign keys on ignored table regexes in schema dump" do
      schema_define do
        add_foreign_key :test_comments, :test_posts
      end
      expect(standard_dump(ignore_tables: [ /test_comments/i ])).not_to match(/add_foreign_key "test_comments"/)
    end

    it "should include foreign keys referencing ignored table names in schema dump" do
      schema_define do
        add_foreign_key :test_comments, :test_posts
      end
      expect(standard_dump(ignore_tables: %w(test_posts))).to match(/add_foreign_key "test_comments"/)
    end

    it "should include foreign keys referencing ignored table regexes in schema dump" do
      schema_define do
        add_foreign_key :test_comments, :test_posts
      end
      expect(standard_dump(ignore_tables: [ /test_posts/i ])).to match(/add_foreign_key "test_comments"/)
    end

    it "should include foreign keys following all tables" do
      # if foreign keys precede declaration of all tables
      # it can cause problems when using db:test rake tasks
      schema_define do
        add_foreign_key :test_comments, :test_posts
      end
      dump = standard_dump
      expect(dump.rindex("create_table")).to be < dump.index("add_foreign_key")
    end

    it "should include primary_key when reference column name is not 'id'" do
      schema_define do
        create_table :test_posts, force: true, primary_key: "baz_id" do |t|
          t.string :title
        end
        create_table :test_comments, force: true do |t|
          t.string :body, limit: 4000
          t.integer :baz_id
        end
      end

      @conn.execute <<-SQL
        ALTER TABLE TEST_COMMENTS
        ADD CONSTRAINT TEST_COMMENTS_BAZ_ID_FK FOREIGN KEY (baz_id) REFERENCES test_posts(baz_id)
      SQL

      expect(standard_dump).to match(/add_foreign_key "test_comments", "test_posts", column: "baz_id", primary_key: "baz_id", name: "test_comments_baz_id_fk"/)
    end

  end

  describe "synonyms" do
    after(:each) do
      schema_define do
        remove_synonym :test_synonym
      end
    end

    it "should include synonym to other schema table in schema dump" do
      schema_define do
        add_synonym :test_synonym, "schema_name.table_name", force: true
      end
      expect(standard_dump).to match(/add_synonym "test_synonym", "schema_name.table_name", force: true/)
    end

    it "should include synonym to other database table in schema dump" do
      schema_define do
        add_synonym :test_synonym, "table_name@link_name", force: true
      end
      expect(standard_dump).to match(/add_synonym "test_synonym", "table_name@link_name(\.[-A-Za-z0-9_]+)*", force: true/)
    end

    it "should not include ignored table names in schema dump" do
      schema_define do
        add_synonym :test_synonym, "schema_name.table_name", force: true
      end
      expect(standard_dump(ignore_tables: %w(test_synonym))).not_to match(/add_synonym "test_synonym"/)
    end

    it "should not include ignored table regexes in schema dump" do
      schema_define do
        add_synonym :test_synonym, "schema_name.table_name", force: true
      end
      expect(standard_dump(ignore_tables: [ /test_synonym/i ])).not_to match(/add_synonym "test_synonym"/)
    end

    it "should include synonyms to ignored table regexes in schema dump" do
      schema_define do
        add_synonym :test_synonym, "schema_name.table_name", force: true
      end
      expect(standard_dump(ignore_tables: [ /table_name/i ])).to match(/add_synonym "test_synonym"/)
    end

  end

  describe "temporary tables" do
    after(:each) do
      drop_test_posts_table
    end

    it "should include temporary options" do
      create_test_posts_table(temporary: true)
      expect(standard_dump).to match(/create_table "test_posts", temporary: true/)
    end
  end

  describe "indexes" do
    after(:each) do
      drop_test_posts_table
    end

    it "should not specify default tablespace in add index" do
      create_test_posts_table
      expect(standard_dump).to match(/t\.index \["title"\], name: "index_test_posts_on_title"$/)
    end

    it "should specify non-default tablespace in add index" do
      tablespace_name = @conn.default_tablespace
      allow(@conn).to receive(:default_tablespace).and_return("dummy")
      create_test_posts_table
      expect(standard_dump).to match(/t\.index \["title"\], name: "index_test_posts_on_title", tablespace: "#{tablespace_name}"$/)
    end

    it "should create and dump function-based indexes" do
      create_test_posts_table
      @conn.add_index :test_posts, "NVL(created_at, updated_at)", name: "index_test_posts_cr_upd_at"
      expect(standard_dump).to match(/t\.index \["NVL\(\\"CREATED_AT\\",\\"UPDATED_AT\\"\)"\], name: "index_test_posts_cr_upd_at"$/)
    end

  end

  describe "materialized views" do
    after(:each) do
      @conn.execute "DROP MATERIALIZED VIEW test_posts_mv" rescue nil
      drop_test_posts_table
    end

    it "should not include materialized views in schema dump" do
      create_test_posts_table
      @conn.execute "CREATE MATERIALIZED VIEW test_posts_mv AS SELECT * FROM test_posts"
      expect(standard_dump).not_to match(/create_table "test_posts_mv"/)
    end
  end

  describe "virtual columns" do
    before(:all) do
      skip "Not supported in this database version" unless @oracle11g_or_higher
      schema_define do
        create_table :test_names, force: true do |t|
          t.string :first_name
          t.string :last_name
          t.virtual :full_name,       as: "first_name || ', ' || last_name"
          t.virtual :short_name,      as: "COALESCE(first_name, last_name)", type: :string, limit: 300
          t.virtual :abbrev_name,     as: "SUBSTR(first_name,1,50) || ' ' || SUBSTR(last_name,1,1) || '.'", type: "VARCHAR(100)"
          t.virtual :name_ratio,      as: "(LENGTH(first_name)*10/LENGTH(last_name)*10)"
          t.column :full_name_length, :virtual, as: "length(first_name || ', ' || last_name)", type: :integer
          t.virtual :field_with_leading_space, as: "' ' || first_name || ' '", limit: 300, type: :string
        end
      end
    end

    before(:each) do
      if @oracle11g_or_higher
        class ::TestName < ActiveRecord::Base
          self.table_name = "test_names"
        end
      end
    end

    after(:all) do
      if @oracle11g_or_higher
        schema_define do
          drop_table :test_names
        end
      end
    end

    it "should dump correctly" do
      expect(standard_dump).to match(/t\.virtual "full_name",(\s*)type: :string,(\s*)limit: 512,(\s*)as: "\\"FIRST_NAME\\"\|\|', '\|\|\\"LAST_NAME\\""/)
      expect(standard_dump).to match(/t\.virtual "short_name",(\s*)type: :string,(\s*)limit: 300,(\s*)as:(.*)/)
      expect(standard_dump).to match(/t\.virtual "full_name_length",(\s*)type: :integer,(\s*)precision: 38,(\s*)as:(.*)/)
      expect(standard_dump).to match(/t\.virtual "name_ratio",(\s*)as:(.*)\"$/) # no :type
      expect(standard_dump).to match(/t\.virtual "abbrev_name",(\s*)type: :string,(\s*)limit: 100,(\s*)as:(.*)/)
      expect(standard_dump).to match(/t\.virtual "field_with_leading_space",(\s*)type: :string,(\s*)limit: 300,(\s*)as: "' '\|\|\\"FIRST_NAME\\"\|\|' '"/)
    end

    context "with column cache" do
      before(:all) do
        @old_cache = ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter.cache_columns
        ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter.cache_columns = true
      end
      after(:all) do
        ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter.cache_columns = @old_cache
      end
      it "should not change column defaults after several dumps" do
        col = TestName.columns.detect { |c| c.name == "full_name" }
        expect(col).not_to be_nil
        expect(col.virtual_column_data_default).not_to match(/:as/)

        standard_dump
        expect(col.virtual_column_data_default).not_to match(/:as/)

        standard_dump
        expect(col.virtual_column_data_default).not_to match(/:as/)
      end
    end

    context "with index on virtual column" do
      before(:all) do
        if @oracle11g_or_higher
          schema_define do
            add_index "test_names", "field_with_leading_space", name: "index_on_virtual_col"
          end
        end
      end
      after(:all) do
        if @oracle11g_or_higher
          schema_define do
            remove_index "test_names", name: "index_on_virtual_col"
          end
        end
      end
      it "should dump correctly" do
        expect(standard_dump).not_to match(/t\.index .+FIRST_NAME.+$/)
        expect(standard_dump).to     match(/t\.index .+field_with_leading_space.+$/)
      end
    end
  end

  describe ":float datatype" do
    before(:each) do
      schema_define do
        create_table :test_floats, force: true do |t|
          t.float :hourly_rate
        end
      end
    end

    after(:each) do
      schema_define do
        drop_table :test_floats
      end
    end

    it "should dump float type correctly" do
      expect(standard_dump).to match(/t\.float "hourly_rate"$/)
    end
  end

  describe "table comments" do
    before(:each) do
      schema_define do
        create_table :test_table_comments, comment: "this is a \"table comment\"!", force: true do |t|
          t.string :blah
        end
      end
    end

    after(:each) do
      schema_define do
        drop_table :test_table_comments
      end
    end

    it "should dump table comments" do
      expect(standard_dump).to match(/comment: "this is a \\"table comment\\"!"/)
    end
  end

  describe "column comments" do
    before(:each) do
      schema_define do
        create_table :test_column_comments, force: true do |t|
          t.string :blah, comment: "this is a \"column comment\"!"
        end
      end
    end

    after(:each) do
      schema_define do
        drop_table :test_column_comments
      end
    end

    it "should dump column comments" do
      expect(standard_dump).to match(/comment: "this is a \\"column comment\\"!"/)
    end
  end

  describe "schema.rb format" do
    before do
      create_test_posts_table

      schema_define do
        create_table :test_comments, force: true do |t|
          t.string :title
        end

        add_index :test_comments, :title
      end
    end

    it "should be only one blank line between create_table methods in schema dump" do
      expect(standard_dump).to match(/end\n\n  create_table/)
    end

    after do
      schema_define do
        drop_table :test_comments rescue nil
      end

      drop_test_posts_table
    end
  end
end


text:
/**
 * @file ethernet.h
 * @brief Provides useful functions for build Ethernet frames and manage related addresses.
 */

#ifndef SPARK_ETHERNET_H
#define SPARK_ETHERNET_H

#include <stdbool.h>
#include "datatype.h"

#define ETHHWASIZE      6       // Ethernet addr byte len
#define ETHSTRLEN       18      // Mac address string size
#define ETHSTRHLFLEN    9       // Mac address string half size

#define ETHFRAME        1514    // (Dst + Src + Type) + ETHMAXPAYL
#define ETHHDRSIZE      14      // Ethernet header size
#define ETHMINPAYL      46      // Ethernet min payload
#define ETHMAXPAYL      1500    // Ethernet max payload

#define ETHTYPE_PUP     0x0200
#define ETHTYPE_IP      0x0800
#define ETHTYPE_IPV6    0x86DD
#define ETHTYPE_ARP     0x0806
#define ETHTYPE_RARP    0x8035
#define ETHTYPE_MPLSU   0x8847 // MPLS unicast
#define ETHTYPE_MPLSM   0x8848 // MPLS multicast

/// @brief This structure represents an Ethernet frame.
struct EthHeader {
    /// @brief Destination hardware address.
    unsigned char dhwaddr[ETHHWASIZE];
    /// @brief Source hardware address.
    unsigned char shwaddr[ETHHWASIZE];
    /// @brief Ethernet type.
    unsigned short eth_type;
    /// @brief Ethernet payload.
    unsigned char data[];
}__attribute__((packed));

/**
 * @brief Compare two mac address.
 * @param mac1 Pointer to netaddr_mac structure contains first mac address.
 * @param mac2 Pointer to netaddr_mac structure contains seconds mac address.
 * @return Function returns true if mac1 is equals to mac2, false otherwise.
 */
bool eth_equals(const struct netaddr_mac *mac1, const struct netaddr_mac *mac2);

/**
 * @brief Checks if is a broadcast mac address.
 * @param mac Pointer to netaddr_mac structure contains mac address.
 * @return Function returns true if is a broadcast mac address, false otherwise.
 */
bool eth_isbcast(const struct netaddr_mac *mac);

/**
 * @brief Checks if is a empty mac address (All byte are zero!).
 * @param mac Pointer to netaddr_mac structure contains mac address.
 * @return Function returns true if is a empty mac address, false otherwise.
 */
bool eth_isempty(const struct netaddr_mac *mac);

/**
 * @brief Parse string contains a mac address in the form `XX:XX:XX:XX:XX:XX`.
 * @param hwstr String contains mac address in the form `XX:XX:XX:XX:XX:XX`.
 * @param __OUT__mac Pointer to netaddr_mac structure.
 * @param bcast Allow broadcast addresses.
 * @return Function returns true if the address has been converted, false otherwise.
 */
bool eth_parse_addr(const char *hwstr, struct netaddr_mac *mac, bool bcast);

/**
 * @brief Obtains mac address in the form `XX:XX:XX:XX:XX:XX`.
 * @param __IN__mac Pointer to netaddr_mac structure contains mac address.
 * @param _static Not allocate new memory, the result will be saved in a static bufer.
 * @return Function returns string contains mac address.
 */
char *eth_getstr(const struct netaddr_mac *mac, bool _static);

/**
 * @brief Obtains mac address in the form `XX:XX:XX:XX:XX:XX`.
 * @param __IN__mac Pointer to netaddr_mac structure contains mac address.
 * @param __OUT__macstr Pointer to string of dimension ETHSTRLEN.
 * @return Function returns string contains mac address.
 */
char *eth_getstr_r(const struct netaddr_mac *mac, char *macstr);

/**
 * @brief Obtains mac address serial(S) `VV:VV:VV:SS:SS:SS`.
 * @param __IN__mac Pointer to netaddr_mac structure contains mac address.
 * @param _static Not allocate new memory, the result will be saved in a static bufer.
 * @return Function returns string contains serial.
 */
char *eth_getstr_serial(const struct netaddr_mac *mac, bool _static);

/**
 * @brief Obtains mac address serial(S) `VV:VV:VV:SS:SS:SS`.
 * @param __IN__mac Pointer to netaddr_mac structure contains mac address.
 * @param __OUT__sstr Pointer to string of dimension ETHSTRHLFLEN.
 * @return Function returns string contains serial.
 */
char *eth_getstr_serial_r(const struct netaddr_mac *mac, char *sstr);

/**
 * @brief Obtains mac address vendor(V) `VV:VV:VV:SS:SS:SS`.
 * @param __IN__mac Pointer to netaddr_mac structure contains mac address.
 * @param _static Not allocate new memory, the result will be saved in a static bufer.
 * @return Function returns string contains vendor.
 */
char *eth_getstr_vendor(const struct netaddr_mac *mac, bool _static);

/**
 * @brief Obtains mac address vendor(V) `VV:VV:VV:SS:SS:SS`.
 * @param __IN__mac Pointer to netaddr_mac structure contains mac address.
 * @param __OUT__vstr Pointer to string of dimension ETHSTRHLFLEN.
 * @return Function returns string contains vendor.
 */
char *eth_getstr_vendor_r(const struct netaddr_mac *mac, char *vstr);

/**
 * @brief Built a new Ethernet frames.
 *
 * If `payload` is not NULL, the functions copies all byte from payload bufer in the new Ethernet frame.
 * @param __IN__src Pointer to netaddr_mac structure contains source mac address.
 * @param __IN__dst Pointer to netaddr_mac structure contains destination mac address.
 * @param type Ethernet frame type.
 * @param paysize Lenght of paylod.
 * @param payload Ethernet payload.
 * @return On success returns the pointer to new Ethernet frame of size equal to paysize + ETHHDRSIZE, otherwise return NULL.
 */
struct EthHeader *eth_build_packet(const struct netaddr_mac *src, const struct netaddr_mac *dst, unsigned short type,
                                   unsigned short paysize, const unsigned char *payload);

/**
 * @brief Injects Ethernet header into a bufer pointed by `buf`.
 * @param __OUT__buf Pointer to remote bufer.
 * @param __IN__src Pointer to netaddr_mac structure contains source mac address.
 * @param __IN__dst Pointer to netaddr_mac structure contains destination mac address.
 * @param type Ethernet frame type.
 * @return The function returns the pointer to Ethernet frame.
 */
struct EthHeader *eth_inject_header(unsigned char *buf, const struct netaddr_mac *src, const struct netaddr_mac *dst,
                                    unsigned short type);

/**
 * @brief Builds broadcast mac address.
 * @param __OUT__mac Pointer to netaddr_mac structure.
 */
void eth_bcast(struct netaddr_mac *mac);

/**
 * @brief Builds multicast mac address.
 * @param __OUT__mac Pointer to netaddr_mac structure.
 * @param __IN__ip Pointer to netaddr_ip structure.
 */
void eth_multi(struct netaddr_mac *mac, const struct netaddr_ip *ip);

/**
 * @brief Obtains a random mac address.
 *
 * The mac address returned is never a broadcast or multicast address!
 * @param __OUT__mac Pointer to netaddr_mac structure.
 */
void eth_rndaddr(struct netaddr_mac *mac);

#endif


text:
namespace ke
{

    /// <summary>
    /// A class that measures time elapsed from a previous point in time.
    /// </summary>
    class StopWatch
    {
    public:
        using DurationType          = ke::Time;
        using DurationInternalType  = std::chrono::nanoseconds;
        using ClockType             = std::chrono::high_resolution_clock;
        using TimePointType         = ClockType::time_point;

    private:
        TimePointType m_TimePoint;

    public:
        /// <summary>
        /// Construct a stop watch and begin the timer.
        /// </summary>
        StopWatch(void)
            : m_TimePoint(ClockType::now()) {}

        /// <summary>
        /// Get the elapsed time.
        /// </summary>
        /// <returns>The elapsed time.</returns>
        inline DurationType elapsed(void)
        {
            const auto elapsed = std::chrono::duration_cast<DurationInternalType>(ClockType::now() - m_TimePoint);
            return ke::Time::nanoseconds(elapsed.count());
        }

        /// <summary>
        /// Get the elapsed time since the last time the stop watch was restarted.
        /// </summary>
        /// <returns>The elapsed time.</returns>
        inline DurationType getElapsed(void)
        {
            return elapsed();
        }

        /// <summary>
        /// Restart the stopwatch. Next time elapsed() is called it will be measured from this point in time.
        /// </summary>
        inline void restart(void)
        {
            m_TimePoint = ClockType::now();
        }
    }; // ElapsedTimer class

}


text:
class BinaryReaderWriterTest: public CppUnit::TestCase
{
public:
	BinaryReaderWriterTest(const std::string& name);
	~BinaryReaderWriterTest();

	void testNative();
	void testBigEndian();
	void testLittleEndian();
	void write(Poco::BinaryWriter& writer);
	void read(Poco::BinaryReader& reader);

	void setUp();
	void tearDown();

	static CppUnit::Test* suite();

private:
};

#endif // BinaryReaderWriterTest_INCLUDED


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

<TITLE>
ImageIOWriter (Slick Util - LWJGL Utilities extracted from Slick)
</TITLE>

<META NAME="date" CONTENT="2012-08-26">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.newdawn.slick.imageout

Class ImageIOWriter

java.lang.Object
  org.newdawn.slick.imageout.ImageIOWriter

All Implemented Interfaces:
ImageWriter

public class ImageIOWriter
extends java.lang.Object
implements ImageWriter

A utility to write a Slick image out using ImageIO

Author:

Jon

Constructor Summary

ImageIOWriter()

Method Summary

 void
saveImage(Image image,
          java.lang.String format,
          java.io.OutputStream output,
          boolean hasAlpha)

          Save an Image to an given location

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ImageIOWriter

public ImageIOWriter()

Method Detail

saveImage

public void saveImage(Image image,
                      java.lang.String format,
                      java.io.OutputStream output,
                      boolean hasAlpha)
               throws java.io.IOException

Description copied from interface: ImageWriter

Save an Image to an given location

Specified by:
saveImage in interface ImageWriter

Parameters:
image - The image to be written
format - The format that this writer is expected to be produced in
output - The output stream to which the image data should be written
hasAlpha - True if we should write alpha information to the file

Throws:

java.io.IOException - Indicates a failure to write out the image to the specified location
See Also:
ImageWriter.saveImage(org.newdawn.slick.Image,
 java.lang.String, java.io.OutputStream, boolean)

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006 New Dawn Software. All Rights Reserved.


text:
Sometimes you need use this package with some framework, or web requests, so,
for more comfortable and no unexpected messages, you like to suppress logs about connection, send, messages...

before use any methods.

```php
use Psr\Log\NullLogger;
use Thruway\Logging\Logger;

Logger::set(new NullLogger());
```


text:
import java.io.*;
import java.util.*;
import java.math.BigInteger;

public class Solution {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        BigInteger a = new BigInteger(in.next());
        BigInteger b = new BigInteger(in.next());

        System.out.println(a.add(b));
        System.out.println(a.multiply(b));
    }
}


text:
import Component from '@ember/component';
import { copy } from '@ember/object/internals';
import { inject } from '@ember/service';
import commitStats from '../data/commit-stats';

export default Component.extend({
  dynamicChart: inject('dynamic-chart'),

  init() {
    this._super(...arguments);

    this.chartOptions = {
      chart: {
        type: 'line'
      },
      title: {
        text: 'Repo commits'
      },
      xAxis: {
        type: 'category',
        title: {
          text: 'Week'
        }
      },
      yAxis: {
        title: {
          text: '# of Commits'
        }
      }
    };

    this.chartData = copy(commitStats, true);
  },

  actions: {
    updateSeriesData() {
      const newChartData = this.get('dynamicChart').updateSeriesData(commitStats, 2, 52);
      this.set('chartData', newChartData);
    },

    fullUpdateToSeries() {
      const newChartData = this.get('dynamicChart').updateSeriesData(commitStats, 2, 52);

      // updated currentTime attribute causes series.update() to be used instead of series.setData()
      newChartData.forEach((series) => {
        series.currentTime = Date.now();
      });

      this.set('chartData', newChartData);
    },

    setSeriesCount(numSeries) {
      const newChartData = this.get('dynamicChart').updateSeriesCount(commitStats, numSeries);
      this.set('chartData', newChartData);
    }
  }
});


text:
class AppDelegate
  attr_accessor :window, :outline
  attr_accessor :treeController

  # NSOutlineView
  def applicationDidFinishLaunching(a_notification)
    # Insert code here to initialize your application
    data = {"name"  => "root",
             "child" => [
              {"name" => "Group 1"},
              {"name" => "Group 2"}]
    }
    @treeController.setContent(data)
    outline.expandItem(nil, expandChildren:true)
    outline.selectRowIndexes(NSIndexSet.indexSetWithIndex(2), byExtendingSelection:false)
  end

  def outlineView(outlineView,
                  isGroupItem:item)
    return false if outlineView.parentForItem(item)
    return true
  end

  def outlineView(outlineView,
                  shouldSelectItem:item)
    return false unless outlineView.parentForItem(item)
    return true
  end

end


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 5//EN>
<html lang="ru">
<head>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
    <style>
        p {
            margin-top: 0.1em;
            margin-bottom: 0.1em;
        }
    </style>
    <title>Подождите...</title>
</head>
<body>
    <script>
        $(document).ready(function(){
            // сохраняем текст для сопроводительной штуки
            window.localStorage.setItem('text','{{text|safe}}')
            // document.body.innerHTML=window.localStorage.getItem('text')
            // открываем новое окно, где штука появится
            window.open("/test/cashless_maintenance/", "windowName");
            // загружаем сюда список счетов
            window.location = "/all_bills/"
        })
    </script>
</body>
</html>


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>Uses of Interface com.github.sarxos.webcam.WebcamDiscoverySupport (Webcam Capture 0.3.10 API - 2014-09-23T20:02:30Z)</title>
<meta name="date" content="2014-09-23">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Bartosz Firyn (SarXos)

Prev

Next

Frames

No Frames

All Classes

Uses of Interface
com.github.sarxos.webcam.WebcamDiscoverySupport

Packages that use WebcamDiscoverySupport

Package
Description

com.github.sarxos.webcam.ds.buildin

com.github.sarxos.webcam.ds.dummy

Uses of WebcamDiscoverySupport in com.github.sarxos.webcam.ds.buildin

Classes in com.github.sarxos.webcam.ds.buildin that implement WebcamDiscoverySupport

Modifier and Type
Class and Description

class
WebcamDefaultDriver

Default build-in webcam driver based on natives from OpenIMAJ framework.

Uses of WebcamDiscoverySupport in com.github.sarxos.webcam.ds.dummy

Classes in com.github.sarxos.webcam.ds.dummy that implement WebcamDiscoverySupport

Modifier and Type
Class and Description

class
WebcamDummyDriver

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Bartosz Firyn (SarXos)

Prev

Next

Frames

No Frames

All Classes

Copyright © 2012-2014 Bartosz Firyn (SarXos). All Rights Reserved.


text:
REM jscar - JalaTion Run script
java -cp %SCALATION_CLASSES% %1


text:
FROM msoap/shell2http

# may be install some alpine packages:
# RUN apk add --no-cache ...

EXPOSE 8080
CMD ["/date", "date"]