text:
<?xml version="1.0" encoding="UTF-8"?><!--  Copyright (C) 2007 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
 -->

<resources>
    <string-array name="recurrence_freq">
        <item>"HERHAAL DAAGLIKS"</item>
        <item>"HERHAAL WEEKLIKS"</item>
        <item>"HERHAAL MAANDELIKS"</item>
        <item>"HERHAAL JAARLIKS"</item>
    </string-array>
    <string-array name="repeat_by_nth_sun">
        <item>"op elke eerste Sondag"</item>
        <item>"op elke tweede Sondag"</item>
        <item>"op elke derde Sondag"</item>
        <item>"op elke vierde Sondag"</item>
        <item>"op elke laaste Sondag"</item>
    </string-array>
    <string-array name="repeat_by_nth_mon">
        <item>"op elke eerste Maandag"</item>
        <item>"op elke tweede Maandag"</item>
        <item>"op elke derde Maandag"</item>
        <item>"op elke vierde Maandag"</item>
        <item>"op elke laaste Maandag"</item>
    </string-array>
    <string-array name="repeat_by_nth_tues">
        <item>"op elke eerste Dinsdag"</item>
        <item>"op elke tweede Dinsdag"</item>
        <item>"op elke derde Dinsdag"</item>
        <item>"op elke vierde Dinsdag"</item>
        <item>"op elke laaste Dinsdag"</item>
    </string-array>
    <string-array name="repeat_by_nth_wed">
        <item>"op elke eerste Woensdag"</item>
        <item>"op elke tweede Woensdag"</item>
        <item>"op elke derde Woensdag"</item>
        <item>"op elke vierde Woensdag"</item>
        <item>"op elke laaste Woensdag"</item>
    </string-array>
    <string-array name="repeat_by_nth_thurs">
        <item>"op elke eerste Donderdag"</item>
        <item>"op elke tweede Donderdag"</item>
        <item>"op elke derde Donderdag"</item>
        <item>"op elke vierde Donderdag"</item>
        <item>"op elke laaste Donderdag"</item>
    </string-array>
    <string-array name="repeat_by_nth_fri">
        <item>"op elke eerste Vrydag"</item>
        <item>"op elke tweede Vrydag"</item>
        <item>"op elke derde Vrydag"</item>
        <item>"op elke vierde Vrydag"</item>
        <item>"op elke laaste Vrydag"</item>
    </string-array>
    <string-array name="repeat_by_nth_sat">
        <item>"op elke eerste Saterdag"</item>
        <item>"op elke tweede Saterdag"</item>
        <item>"op elke derde Saterdag"</item>
        <item>"op elke vierde Saterdag"</item>
        <item>"op elke laaste Saterdag"</item>
    </string-array>
</resources>


text:
angular.module('calculator').directive('scrollPosition', function($window) {
  return {
    scope: {
      scroll: '=scrollPosition'
    },
    link: function(scope, element, attrs) {

      var handler = function() {
        scope.scroll = window.scrollY;
      }

      window.addEventListener('scroll', scope.$apply.bind(scope, handler));
      handler();
    }
  };
});

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE HTML>

<link rel="apple-touch-icon" sizes="180x180" href="/assets/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon-16x16.png"><link rel="manifest" href="/assets/site.webmanifest"><link rel="mask-icon" href="/assets/safari-pinned-tab.svg" color="#fc4d50"><link rel="shortcut icon" href="/assets/favicon.ico"><meta name="msapplication-TileColor" content="#ffc40d"><meta name="msapplication-config" content="/assets/browserconfig.xml"><meta name="theme-color" content="#ffffff">
<title>com.google.android.exoplayer2.source Class Hierarchy (ExoPlayer library)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../jquery/jquery-ui.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

All Classes

SEARCH:
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">

JavaScript is disabled on your browser.

Hierarchy For Package com.google.android.exoplayer2.source

Package Hierarchies:

All Packages

Class Hierarchy

java.lang.Object

com.google.android.exoplayer2.source.BaseMediaSource (implements com.google.android.exoplayer2.source.MediaSource)

com.google.android.exoplayer2.source.CompositeMediaSource<T>

com.google.android.exoplayer2.source.ClippingMediaSource

com.google.android.exoplayer2.source.ConcatenatingMediaSource

com.google.android.exoplayer2.source.LoopingMediaSource

com.google.android.exoplayer2.source.MaskingMediaSource

com.google.android.exoplayer2.source.MergingMediaSource

com.google.android.exoplayer2.source.ProgressiveMediaSource

com.google.android.exoplayer2.source.SilenceMediaSource

com.google.android.exoplayer2.source.SingleSampleMediaSource

com.google.android.exoplayer2.source.BundledExtractorsAdapter (implements com.google.android.exoplayer2.source.ProgressiveMediaExtractor)

com.google.android.exoplayer2.source.ClippingMediaPeriod (implements com.google.android.exoplayer2.source.MediaPeriod, com.google.android.exoplayer2.source.MediaPeriod.Callback)

com.google.android.exoplayer2.source.CompositeSequenceableLoader (implements com.google.android.exoplayer2.source.SequenceableLoader)

com.google.android.exoplayer2.source.DefaultCompositeSequenceableLoaderFactory (implements com.google.android.exoplayer2.source.CompositeSequenceableLoaderFactory)

com.google.android.exoplayer2.source.DefaultMediaSourceFactory (implements com.google.android.exoplayer2.source.MediaSourceFactory)

com.google.android.exoplayer2.source.EmptySampleStream (implements com.google.android.exoplayer2.source.SampleStream)

com.google.android.exoplayer2.source.LoadEventInfo

com.google.android.exoplayer2.source.MaskingMediaPeriod (implements com.google.android.exoplayer2.source.MediaPeriod, com.google.android.exoplayer2.source.MediaPeriod.Callback)

com.google.android.exoplayer2.source.MediaLoadData

com.google.android.exoplayer2.source.MediaParserExtractorAdapter (implements com.google.android.exoplayer2.source.ProgressiveMediaExtractor)

com.google.android.exoplayer2.source.MediaPeriodId

com.google.android.exoplayer2.source.MediaSource.MediaPeriodId

com.google.android.exoplayer2.source.MediaSourceEventListener.EventDispatcher

com.google.android.exoplayer2.source.ProgressiveMediaSource.Factory (implements com.google.android.exoplayer2.source.MediaSourceFactory)

com.google.android.exoplayer2.source.SampleQueue (implements com.google.android.exoplayer2.extractor.TrackOutput)

com.google.android.exoplayer2.source.ShuffleOrder.DefaultShuffleOrder (implements com.google.android.exoplayer2.source.ShuffleOrder)

com.google.android.exoplayer2.source.ShuffleOrder.UnshuffledShuffleOrder (implements com.google.android.exoplayer2.source.ShuffleOrder)

com.google.android.exoplayer2.source.SilenceMediaSource.Factory

com.google.android.exoplayer2.source.SingleSampleMediaSource.Factory

java.lang.Throwable (implements java.io.Serializable)

java.lang.Exception

java.io.IOException

com.google.android.exoplayer2.source.BehindLiveWindowException

com.google.android.exoplayer2.source.ClippingMediaSource.IllegalClippingException

com.google.android.exoplayer2.source.MergingMediaSource.IllegalMergeException

com.google.android.exoplayer2.ParserException

com.google.android.exoplayer2.source.UnrecognizedInputFormatException

com.google.android.exoplayer2.Timeline (implements com.google.android.exoplayer2.Bundleable)

com.google.android.exoplayer2.source.ForwardingTimeline

com.google.android.exoplayer2.source.MaskingMediaSource.PlaceholderTimeline

com.google.android.exoplayer2.source.SinglePeriodTimeline

com.google.android.exoplayer2.source.TrackGroup (implements com.google.android.exoplayer2.Bundleable)

com.google.android.exoplayer2.source.TrackGroupArray (implements com.google.android.exoplayer2.Bundleable)

Interface Hierarchy

com.google.android.exoplayer2.source.ads.AdsLoader.Provider

com.google.android.exoplayer2.source.DefaultMediaSourceFactory.AdsLoaderProvider

com.google.android.exoplayer2.source.CompositeSequenceableLoaderFactory

com.google.android.exoplayer2.source.MaskingMediaPeriod.PrepareListener

com.google.android.exoplayer2.source.MediaSource

com.google.android.exoplayer2.source.MediaSource.Factory

com.google.android.exoplayer2.source.MediaSourceFactory

com.google.android.exoplayer2.source.MediaSource.MediaSourceCaller

com.google.android.exoplayer2.source.MediaSourceEventListener

com.google.android.exoplayer2.source.ProgressiveMediaExtractor

com.google.android.exoplayer2.source.ProgressiveMediaExtractor.Factory

com.google.android.exoplayer2.source.SampleQueue.UpstreamFormatChangedListener

com.google.android.exoplayer2.source.SampleStream

com.google.android.exoplayer2.source.SequenceableLoader

com.google.android.exoplayer2.source.MediaPeriod

com.google.android.exoplayer2.source.SequenceableLoader.Callback<T>

com.google.android.exoplayer2.source.MediaPeriod.Callback

com.google.android.exoplayer2.source.ShuffleOrder

Annotation Type Hierarchy

com.google.android.exoplayer2.source.ClippingMediaSource.IllegalClippingException.Reason (implements java.lang.annotation.Annotation)

com.google.android.exoplayer2.source.MergingMediaSource.IllegalMergeException.Reason (implements java.lang.annotation.Annotation)

com.google.android.exoplayer2.source.SampleStream.ReadDataResult (implements java.lang.annotation.Annotation)

com.google.android.exoplayer2.source.SampleStream.ReadFlags (implements java.lang.annotation.Annotation)

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

All Classes

JavaScript is disabled on your browser.


text:
namespace g{namespace Uno{namespace Collections{struct OrderByCompare;}}}

namespace g{
namespace Uno{
namespace Collections{

// internal sealed class OrderByCompare<T> :398
// {
uType* OrderByCompare_typeof();
void OrderByCompare__ctor__fn(OrderByCompare* __this, uDelegate* orderFunction);
void OrderByCompare__Compare_fn(OrderByCompare* __this, void* a, void* b, int* __retval);
void OrderByCompare__New1_fn(uType* __type, uDelegate* orderFunction, OrderByCompare** __retval);

struct OrderByCompare : uObject
{
    uStrong<uDelegate*> _orderFunction;

    void ctor_(uDelegate* orderFunction);
    template<class T>
    int Compare(T a, T b) { int __retval; return OrderByCompare__Compare_fn(this, uConstrain(__type->T(0), a), uConstrain(__type->T(0), b), &__retval), __retval; }
    static OrderByCompare* New1(uType* __type, uDelegate* orderFunction);
};
// }

}}} // ::g::Uno::Collections


text: local local1=1


text:
package se.kb.oai.ore;

import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;

/**
 * An aggregated resource is a resource, that together with other resources, create an {@link Aggregation}.
 * This class has the actual content of a resource and also metadata about it.
 *
 * @author Oskar Grenholm, National Library of Sweden
 */
public class AggregatedResource extends AggregateBase {

    private String mimetype;

    /**
     * Create an AggreagatedResource with the specified id.
     *
     * @param id the id
     * @throws URISyntaxException
     */
    public AggregatedResource(String id) throws URISyntaxException {
        this(new URI(id));
    }

    /**
     * Create an AggreagatedResource with the specified id.
     *
     * @param id the id
     */
    public AggregatedResource(URI id) {
        super(id);
    }

    /**
     * Get the MIME type (if known) for this AggreagatedResource.
     *
     * @return the MIME type, or null if not known
     */
    public String getMimeType() {
        return this.mimetype;
    }

    /**
     * Get an InputStream for the content held in this AggreagatedResource.
     *
     * @return a stream to the content
     * @throws IOException
     */
    public InputStream getContent() throws IOException {
        return this.id.toURL().openStream();
    }

}


text:
package org.codehaus.groovy.classgen.asm.sc.support;

public class Groovy6235Support {
    public int overload(String... args) {
        return args.length;
    }

    public int overload() {
        return overload("foo");
    }
}


text:
ARG BASE_IMAGE=eclipse-temurin:11.0.17_8-jre-alpine
FROM $BASE_IMAGE

ARG APIMAN_VERSION
ARG APIMAN_DISTRO=https://github.com/apiman/apiman/releases/download/$APIMAN_VERSION/apiman-distro-vertx-$APIMAN_VERSION.zip

LABEL org.opencontainers.image.authors="florian.volk@scheer-group.com"
LABEL org.opencontainers.image.licenses="Apache-2.0"
LABEL org.opencontainers.image.url="https://www.apiman.io"
LABEL org.opencontainers.image.source="https://www.github.com/apiman/apiman"
LABEL org.opencontainers.image.title="Apiman Gateway (Vert.x distro)"
LABEL org.opencontainers.image.description="Apiman Gateway (Vert.x distro). Unless you are operating headlessly, you need an Apiman Manager as well."
LABEL org.opencontainers.image.version=$APIMAN_VERSION

EXPOSE 8080 8081

RUN addgroup -S apiman && adduser -S apiman -G apiman && \
    mkdir -p /opt/apiman/logs && \
    chown -R apiman:apiman /home/apiman /opt/apiman/logs && \
    apk update && apk add libarchive-tools && rm -rf /var/cache/apk/*

ADD $APIMAN_DISTRO /tmp/apiman-distro-vertx.zip

RUN bsdtar xvf /tmp/apiman-distro-vertx.zip --strip-components=1 -C /opt/apiman && \
    rm /tmp/apiman-distro-vertx.zip && \
    chmod +x /opt/apiman/apiman-gateway.sh

USER apiman
WORKDIR /opt/apiman
ENTRYPOINT [ "./apiman-gateway.sh" ]
CMD [ "--conf", "configs/conf-es.json"]


text:
import os
import shutil

import fixtures
from oslo.config import cfg

from glance.common import exception
from glance.openstack.common import jsonutils
from glance import store
from glance.store import location
from glance.store import sheepdog
from glance.store import vmware_datastore
from glance.tests import stubs
from glance.tests import utils as test_utils

CONF = cfg.CONF
CONF.import_opt('filesystem_store_datadir', 'glance.store.filesystem')
CONF.import_opt('connection', 'glance.openstack.common.db.sqlalchemy.session',
                group='database')

class StoreClearingUnitTest(test_utils.BaseTestCase):

    def setUp(self):
        super(StoreClearingUnitTest, self).setUp()
        # Ensure stores + locations cleared
        location.SCHEME_TO_CLS_MAP = {}

        self._create_stores()
        self.addCleanup(setattr, location, 'SCHEME_TO_CLS_MAP', dict())

    def _create_stores(self, passing_config=True):
        """Create known stores. Mock out sheepdog's subprocess dependency
        on collie.

        :param passing_config: making store driver passes basic configurations.
        :returns: the number of how many store drivers been loaded.
        """

        def _fun(*args, **kwargs):
            if passing_config:
                return None
            else:
                raise exception.BadStoreConfiguration()

        self.stubs.Set(sheepdog.Store, 'configure', _fun)
        self.stubs.Set(vmware_datastore.Store, 'configure', _fun)
        self.stubs.Set(vmware_datastore.Store, 'configure_add', _fun)
        return store.create_stores()

class IsolatedUnitTest(StoreClearingUnitTest):

    """
    Unit test case that establishes a mock environment within
    a testing directory (in isolation)
    """
    registry = None

    def setUp(self):
        super(IsolatedUnitTest, self).setUp()
        self.test_dir = self.useFixture(fixtures.TempDir()).path
        policy_file = self._copy_data_file('policy.json', self.test_dir)
        self.config(connection='sqlite://',
                    group='database')
        self.config(verbose=False,
                    debug=False,
                    default_store='filesystem',
                    filesystem_store_datadir=os.path.join(self.test_dir),
                    policy_file=policy_file,
                    lock_path=os.path.join(self.test_dir))
        stubs.stub_out_registry_and_store_server(self.stubs,
                                                 self.test_dir,
                                                 registry=self.registry)

    def _copy_data_file(self, file_name, dst_dir):
        src_file_name = os.path.join('glance/tests/etc', file_name)
        shutil.copy(src_file_name, dst_dir)
        dst_file_name = os.path.join(dst_dir, file_name)
        return dst_file_name

    def set_policy_rules(self, rules):
        fap = open(CONF.policy_file, 'w')
        fap.write(jsonutils.dumps(rules))
        fap.close()


text:
package org.spongepowered.api.service.permission.option;

import org.spongepowered.api.service.context.Context;
import org.spongepowered.api.service.permission.Subject;

import java.util.Optional;
import java.util.Set;

public interface OptionSubject extends Subject {
    @Override
    OptionSubjectData getSubjectData();

    @Override
    OptionSubjectData getTransientSubjectData();

    /**
     * Get the value of a given option in the given context.
     *
     * @param contexts The contexts to get the options from
     * @param key The key to get an option by. Case-insensitive.
     * @return The value of the option, if any is present
     */
    Optional<String> getOption(Set<Context> contexts, String key);

    /**
     * Get the value of a given option in the subject's current context
     *
     * @param key The key to get an option by. Case-insensitive.
     * @return The value of the option, if any is present
     */
    Optional<String> getOption(String key);
}


text:
package conntrack_test

import (
	"encoding/binary"
	"fmt"
	"net"
	"time"

	"github.com/projectcalico/felix/bpf"
	"github.com/projectcalico/felix/timeshim/mocktime"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/ginkgo/extensions/table"
	. "github.com/onsi/gomega"

	"github.com/projectcalico/felix/bpf/conntrack"
	"github.com/projectcalico/felix/bpf/mock"
)

var now = mocktime.StartKTime

var (
	ip1        = net.ParseIP("10.0.0.1")
	ip2        = net.ParseIP("10.0.0.2")
	tcpKey     = conntrack.NewKey(conntrack.ProtoTCP, ip1, 1234, ip2, 3456)
	udpKey     = conntrack.NewKey(conntrack.ProtoUDP, ip1, 1234, ip2, 3456)
	icmpKey    = conntrack.NewKey(conntrack.ProtoICMP, ip1, 1234, ip2, 3456)
	genericKey = conntrack.NewKey(253, ip1, 0, ip2, 0)

	timeouts = conntrack.DefaultTimeouts()

	genericJustCreated    = makeValue(now-1, now-1, conntrack.Leg{}, conntrack.Leg{})
	genericAlmostTimedOut = makeValue(now-(20*time.Minute), now-(599*time.Second), conntrack.Leg{Whitelisted: true}, conntrack.Leg{})
	genericTimedOut       = makeValue(now-(20*time.Minute), now-(601*time.Second), conntrack.Leg{Whitelisted: true}, conntrack.Leg{})

	udpJustCreated    = makeValue(now-1, now-1, conntrack.Leg{}, conntrack.Leg{})
	udpAlmostTimedOut = makeValue(now-(2*time.Minute), now-(59*time.Second), conntrack.Leg{Whitelisted: true}, conntrack.Leg{})
	udpTimedOut       = makeValue(now-(2*time.Minute), now-(61*time.Second), conntrack.Leg{Whitelisted: true}, conntrack.Leg{})

	icmpJustCreated    = makeValue(now-1, now-1, conntrack.Leg{}, conntrack.Leg{})
	icmpAlmostTimedOut = makeValue(now-(2*time.Minute), now-(4*time.Second), conntrack.Leg{Whitelisted: true}, conntrack.Leg{})
	icmpTimedOut       = makeValue(now-(2*time.Minute), now-(6*time.Second), conntrack.Leg{Whitelisted: true}, conntrack.Leg{})

	tcpJustCreated        = makeValue(now-1, now-1, conntrack.Leg{SynSeen: true}, conntrack.Leg{})
	tcpHandshakeTimeout   = makeValue(now-22*time.Second, now-21*time.Second, conntrack.Leg{SynSeen: true}, conntrack.Leg{})
	tcpHandshakeTimeout2  = makeValue(now-22*time.Second, now-21*time.Second, conntrack.Leg{SynSeen: true}, conntrack.Leg{SynSeen: true, AckSeen: true})
	tcpEstablished        = makeValue(now-(10*time.Second), now-1, conntrack.Leg{SynSeen: true, AckSeen: true}, conntrack.Leg{SynSeen: true, AckSeen: true})
	tcpEstablishedTimeout = makeValue(now-(3*time.Hour), now-(2*time.Hour), conntrack.Leg{SynSeen: true, AckSeen: true}, conntrack.Leg{SynSeen: true, AckSeen: true})
	tcpSingleFin          = makeValue(now-(3*time.Hour), now-(50*time.Minute), conntrack.Leg{SynSeen: true, AckSeen: true, FinSeen: true}, conntrack.Leg{SynSeen: true, AckSeen: true})
	tcpSingleFinTimeout   = makeValue(now-(3*time.Hour), now-(2*time.Hour), conntrack.Leg{SynSeen: true, AckSeen: true, FinSeen: true}, conntrack.Leg{SynSeen: true, AckSeen: true})
	tcpBothFin            = makeValue(now-(3*time.Hour), now-(29*time.Second), conntrack.Leg{SynSeen: true, AckSeen: true, FinSeen: true}, conntrack.Leg{SynSeen: true, AckSeen: true, FinSeen: true})
	tcpBothFinTimeout     = makeValue(now-(3*time.Hour), now-(31*time.Second), conntrack.Leg{SynSeen: true, AckSeen: true, FinSeen: true}, conntrack.Leg{SynSeen: true, AckSeen: true, FinSeen: true})
)

func makeValue(created time.Duration, lastSeen time.Duration, legA conntrack.Leg, legB conntrack.Leg) conntrack.Value {
	var e conntrack.Value
	binary.LittleEndian.PutUint64(e[:8], uint64(created))
	binary.LittleEndian.PutUint64(e[8:16], uint64(lastSeen))
	binary.LittleEndian.PutUint32(e[28:32], legA.Flags())
	binary.LittleEndian.PutUint32(e[40:44], legB.Flags())
	return e
}

var _ = Describe("BPF Conntrack LivenessCalculator", func() {
	var lc *conntrack.LivenessScanner
	var scanner *conntrack.Scanner
	var ctMap *mock.Map
	var mockTime *mocktime.MockTime

	BeforeEach(func() {
		mockTime = mocktime.New()
		Expect(mockTime.KTimeNanos()).To(BeNumerically("==", now))
		ctMap = mock.NewMockMap(conntrack.MapParams)
		lc = conntrack.NewLivenessScanner(timeouts, false, conntrack.WithTimeShim(mockTime))
		scanner = conntrack.NewScanner(ctMap, lc)
	})

	DescribeTable(
		"expiry tests",
		func(key conntrack.Key, entry conntrack.Value, expExpired bool) {
			By("calculating expiry of normal entry")
			reason, expired := timeouts.EntryExpired(int64(now), key.Proto(), entry)
			Expect(expired).To(Equal(expExpired), fmt.Sprintf("EntryExpired returned unexpected value with reason: %s", reason))
			if expired {
				Expect(reason).ToNot(BeEmpty())
			}

			By("calculating expiry with legs reversed")
			var eReversed conntrack.Value
			copy(eReversed[:], entry[:])
			copy(eReversed[24:32], entry[32:40])
			copy(eReversed[32:40], entry[24:32])
			reason, expired = timeouts.EntryExpired(int64(now), key.Proto(), entry)
			Expect(expired).To(Equal(expExpired), fmt.Sprintf("EntryExpired returned unexpected value (for reversed legs) with reason: %s", reason))
			if expired {
				Expect(reason).ToNot(BeEmpty())
			}

			By("correctly handling the entry as part of a scan")
			err := ctMap.Update(key.AsBytes(), entry[:])
			Expect(err).NotTo(HaveOccurred())

			scanner.Scan()
			_, err = ctMap.Get(key.AsBytes())
			if expExpired {
				Expect(bpf.IsNotExists(err)).To(BeTrue(), "Scan() should have cleaned up entry")
			} else {
				Expect(err).NotTo(HaveOccurred(), "Scan() deleted entry unexpectedly")
			}

			By("always deleting the entry if we fast-forward time")
			err = ctMap.Update(key.AsBytes(), entry[:])
			Expect(err).NotTo(HaveOccurred())
			mockTime.IncrementTime(2 * time.Hour)
			scanner.Scan()
			_, err = ctMap.Get(key.AsBytes())
			Expect(bpf.IsNotExists(err)).To(BeTrue(), "Scan() should have cleaned up entry")
		},
		Entry("TCP just created", tcpKey, tcpJustCreated, false),
		Entry("TCP handshake timeout", tcpKey, tcpHandshakeTimeout, true),
		Entry("TCP handshake timeout on response", tcpKey, tcpHandshakeTimeout2, true),
		Entry("TCP established", tcpKey, tcpEstablished, false),
		Entry("TCP established timed out", tcpKey, tcpEstablishedTimeout, true),
		Entry("TCP single fin", tcpKey, tcpSingleFin, false),
		Entry("TCP single fin timed out", tcpKey, tcpSingleFinTimeout, true),
		Entry("TCP both fin", tcpKey, tcpBothFin, false),
		Entry("TCP both fin timed out", tcpKey, tcpBothFinTimeout, true),

		Entry("UDP just created", udpKey, udpJustCreated, false),
		Entry("UDP almost timed out", udpKey, udpAlmostTimedOut, false),
		Entry("UDP timed out", udpKey, udpTimedOut, true),

		Entry("Generic just created", genericKey, genericJustCreated, false),
		Entry("Generic almost timed out", genericKey, genericAlmostTimedOut, false),
		Entry("Generic timed out", genericKey, genericTimedOut, true),

		Entry("icmp just created", icmpKey, icmpJustCreated, false),
		Entry("icmp almost timed out", icmpKey, icmpAlmostTimedOut, false),
		Entry("icmp timed out", icmpKey, icmpTimedOut, true),
	)
})

type dummyNATChecker struct {
	check func(fIP net.IP, fPort uint16, bIP net.IP, bPort uint16, proto uint8) bool
}

func (d dummyNATChecker) ConntrackFrontendHasBackend(fIP net.IP, fPort uint16, bIP net.IP,
	bPort uint16, proto uint8) bool {

	return d.check(fIP, fPort, bIP, bPort, proto)
}

func (dummyNATChecker) ConntrackScanStart() {}
func (dummyNATChecker) ConntrackScanEnd()   {}

var _ = Describe("BPF Conntrack StaleNATScanner", func() {

	clientIP := net.IPv4(1, 1, 1, 1)
	clientPort := uint16(1111)

	svcIP := net.IPv4(4, 3, 2, 1)
	svcPort := uint16(4321)

	backendIP := net.IPv4(2, 2, 2, 2)
	backendPort := uint16(2222)

	DescribeTable("forward entries",
		func(k conntrack.Key, v conntrack.Value, verdict conntrack.ScanVerdict) {
			staleNATScanner := conntrack.NewStaleNATScanner(dummyNATChecker{
				check: func(fIP net.IP, fPort uint16, bIP net.IP, bPort uint16, proto uint8) bool {
					Expect(proto).To(Equal(uint8(123)))
					Expect(fIP.Equal(svcIP)).To(BeTrue())
					Expect(fPort).To(Equal(svcPort))
					Expect(bIP.Equal(backendIP)).To(BeTrue())
					Expect(bPort).To(Equal(backendPort))
					return false
				},
			},
			)

			Expect(verdict).To(Equal(staleNATScanner.Check(k, v, nil)))
		},
		Entry("keyA - revA",
			conntrack.NewKey(123, clientIP, clientPort, svcIP, svcPort),
			conntrack.NewValueNATForward(0, 0, 0, conntrack.NewKey(123, clientIP, clientPort, backendIP, backendPort)),
			conntrack.ScanVerdictDelete,
		),
		Entry("keyA - revB",
			conntrack.NewKey(123, clientIP, clientPort, svcIP, svcPort),
			conntrack.NewValueNATForward(0, 0, 0, conntrack.NewKey(123, backendIP, backendPort, clientIP, clientPort)),
			conntrack.ScanVerdictDelete,
		),
		Entry("keyB - revA",
			conntrack.NewKey(123, svcIP, svcPort, clientIP, clientPort),
			conntrack.NewValueNATForward(0, 0, 0, conntrack.NewKey(123, clientIP, clientPort, backendIP, backendPort)),
			conntrack.ScanVerdictDelete,
		),
		Entry("keyB - revB",
			conntrack.NewKey(123, svcIP, svcPort, clientIP, clientPort),
			conntrack.NewValueNATForward(0, 0, 0, conntrack.NewKey(123, backendIP, backendPort, clientIP, clientPort)),
			conntrack.ScanVerdictDelete,
		),
		Entry("mismatch key port",
			conntrack.NewKey(123, svcIP, svcPort, clientIP, 54545),
			conntrack.NewValueNATForward(0, 0, 0, conntrack.NewKey(123, backendIP, backendPort, clientIP, clientPort)),
			conntrack.ScanVerdictOK,
		),
		Entry("mismatch key IP",
			conntrack.NewKey(123, svcIP, svcPort, net.IPv4(2, 1, 2, 1), clientPort),
			conntrack.NewValueNATForward(0, 0, 0, conntrack.NewKey(123, backendIP, backendPort, clientIP, clientPort)),
			conntrack.ScanVerdictOK,
		),
		Entry("mismatch rev port",
			conntrack.NewKey(123, svcIP, svcPort, clientIP, clientPort),
			conntrack.NewValueNATForward(0, 0, 0, conntrack.NewKey(123, backendIP, backendPort, clientIP, 12321)),
			conntrack.ScanVerdictOK,
		),
		Entry("mismatch rev IP",
			conntrack.NewKey(123, svcIP, svcPort, clientIP, clientPort),
			conntrack.NewValueNATForward(0, 0, 0, conntrack.NewKey(123, backendIP, backendPort, net.IPv4(3, 2, 2, 3), clientPort)),
			conntrack.ScanVerdictOK,
		),
	)
})


text:
define(['app/model'], function(model){
  var c = canvas.getContext('2d');

  function render(){
    c.clearRect(0, 0, canvas.width, canvas.height);
    c.beginPath();
    var prev = model.last();
    c.moveTo(prev.get('x'), prev.get('y'));
    model.each(function(vertex){
      c.lineTo(vertex.get('x'), vertex.get('y'));
    });
    c.closePath();
    c.fillStyle = 'gray';
    c.fill();
    c.stroke();
    model.each(renderVertex);
  }

  function renderVertex(vertex){
    var x = vertex.get('x'),
        y = vertex.get('y'),
        radius = vertex.radius;
    c.beginPath();
    c.arc(x, y, radius, 0, 2 * Math.PI);
    c.closePath();
    c.fillStyle = 'black';
    c.fill();
  }

  model.on('add', render);
  model.on('remove', render);
  model.on('change', render);
});


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/pubsub/v1/pubsub.proto

namespace Google\Cloud\PubSub\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Configuration for a push delivery endpoint.
 *
 * Generated from protobuf message google.pubsub.v1.PushConfig
 */
class PushConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * A URL locating the endpoint to which messages should be pushed.
     * For example, a Webhook endpoint might use "https://example.com/push".
     *
     * Generated from protobuf field string push_endpoint = 1;
     */
    private $push_endpoint = '';
    /**
     * Endpoint configuration attributes.
     * Every endpoint has a set of API supported attributes that can be used to
     * control different aspects of the message delivery.
     * The currently supported attribute is `x-goog-version`, which you can
     * use to change the format of the pushed message. This attribute
     * indicates the version of the data expected by the endpoint. This
     * controls the shape of the pushed message (i.e., its fields and metadata).
     * The endpoint version is based on the version of the Pub/Sub API.
     * If not present during the `CreateSubscription` call, it will default to
     * the version of the API used to make such call. If not present during a
     * `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
     * calls will always return a valid version, even if the subscription was
     * created without this attribute.
     * The possible values for this attribute are:
     * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
     * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
     *
     * Generated from protobuf field map<string, string> attributes = 2;
     */
    private $attributes;

    public function __construct() {
        \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce();
        parent::__construct();
    }

    /**
     * A URL locating the endpoint to which messages should be pushed.
     * For example, a Webhook endpoint might use "https://example.com/push".
     *
     * Generated from protobuf field string push_endpoint = 1;
     * @return string
     */
    public function getPushEndpoint()
    {
        return $this->push_endpoint;
    }

    /**
     * A URL locating the endpoint to which messages should be pushed.
     * For example, a Webhook endpoint might use "https://example.com/push".
     *
     * Generated from protobuf field string push_endpoint = 1;
     * @param string $var
     * @return $this
     */
    public function setPushEndpoint($var)
    {
        GPBUtil::checkString($var, True);
        $this->push_endpoint = $var;

        return $this;
    }

    /**
     * Endpoint configuration attributes.
     * Every endpoint has a set of API supported attributes that can be used to
     * control different aspects of the message delivery.
     * The currently supported attribute is `x-goog-version`, which you can
     * use to change the format of the pushed message. This attribute
     * indicates the version of the data expected by the endpoint. This
     * controls the shape of the pushed message (i.e., its fields and metadata).
     * The endpoint version is based on the version of the Pub/Sub API.
     * If not present during the `CreateSubscription` call, it will default to
     * the version of the API used to make such call. If not present during a
     * `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
     * calls will always return a valid version, even if the subscription was
     * created without this attribute.
     * The possible values for this attribute are:
     * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
     * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
     *
     * Generated from protobuf field map<string, string> attributes = 2;
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getAttributes()
    {
        return $this->attributes;
    }

    /**
     * Endpoint configuration attributes.
     * Every endpoint has a set of API supported attributes that can be used to
     * control different aspects of the message delivery.
     * The currently supported attribute is `x-goog-version`, which you can
     * use to change the format of the pushed message. This attribute
     * indicates the version of the data expected by the endpoint. This
     * controls the shape of the pushed message (i.e., its fields and metadata).
     * The endpoint version is based on the version of the Pub/Sub API.
     * If not present during the `CreateSubscription` call, it will default to
     * the version of the API used to make such call. If not present during a
     * `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
     * calls will always return a valid version, even if the subscription was
     * created without this attribute.
     * The possible values for this attribute are:
     * * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
     * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
     *
     * Generated from protobuf field map<string, string> attributes = 2;
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setAttributes($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->attributes = $arr;

        return $this;
    }

}


text:
//===============================================================================
// Copyright (c) 2015 eWorkplace Apps.  ALL rights reserved.
// Main Author: Shrey Sharma
// Original DATE: 5/21/2015
//===============================================================================
package com.eworkplaceapps.employeedirectory.employee;

import com.eworkplaceapps.platform.applicationinfo.BaseApplicationInfo;
import com.eworkplaceapps.platform.notification.NotificationEnum;
import com.eworkplaceapps.platform.notification.NotificationInfo;
import com.eworkplaceapps.platform.utils.enums.EDEntityType;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

/**
 * It contains employee application information.
 */
public class EDApplicationInfo extends BaseApplicationInfo {

    /**
     * Defines enum constants for notification event.
     */
    public enum EDEmployeeEventNotification {
        /// The 'Employee Out of Office' notification.
        /// This event occurred when any employee sets its status to 'Out of Office'.
        EMPLOYEE_OUT_OF_OFFICE(1);
        private int id = 0;

        EDEmployeeEventNotification(int id) {
            this.id = id;
        }

        public int getId() {
            return id;
        }
    }

    /// Create the singleton
    static {
        supportedDeliveryTypes = new ArrayList<NotificationEnum.NotificationDeliveryType>();
        supportedLocalNotificationType = new ArrayList<NotificationEnum.LocalNotificationType>();
        notificationInformationList = new ArrayList<NotificationInfo>();
    }

    /// Returns the singleton. Its reaonly property.
    public static List<NotificationInfo> getNotificationInformationList() {
        return notificationInformationList;
    }

    // Begin Local Members
    private static List<NotificationInfo> notificationInformationList;
    private static final UUID APP_ID = UUID.fromString("A8920FC7-4874-4854-BCE1-4C4909C6C824");
    private static final String APP_ABBREVIATION = "ED";
    private static final String APP_NAME = "Employee Directory";
    private static final String APP_VERSION = "1.0.0";
    private static List<NotificationEnum.NotificationDeliveryType> supportedDeliveryTypes;
    private static List<NotificationEnum.LocalNotificationType> supportedLocalNotificationType;

    public static UUID getAppId() {
        return APP_ID;
    }

    public static String getAppAbbreviation() {
        return APP_ABBREVIATION;
    }

    public static String getAppName() {
        return APP_NAME;
    }

    public static String getAppVersion() {
        return APP_VERSION;
    }

    /**
     * Initializes a new instance of the EDApplicationInfo class.
     */
    public EDApplicationInfo() {
        super();
        initializeEDNotificationInformation();
    }

    private void initializeEDNotificationInformation() {
        /// Employee 'Out of Office' event notification.
        NotificationInfo outOfOfficeEventNotification = new NotificationInfo(NotificationEnum.NotificationTypeEnum.EVENT, EDEntityType.EMPLOYEE.getId(), EDEntityType.EMPLOYEE.getId(), EDEmployeeEventNotification.EMPLOYEE_OUT_OF_OFFICE.getId(), EDEntityType.EMPLOYEE.getId(), supportedDeliveryTypes, supportedLocalNotificationType);
        notificationInformationList.add(outOfOfficeEventNotification);
        /// This Week email notification.
        NotificationInfo thisWeekEmailNotification = new NotificationInfo(NotificationEnum.NotificationTypeEnum.CYCLIC, EDEntityType.EMPLOYEE.getId(), EDEntityType.EMPLOYEE.getId(), EmployeeEnums.EDCyclicNotification.WEEKLY_DIGEST.getId(), EDEntityType.NONE.getId(), supportedDeliveryTypes, supportedLocalNotificationType);
        notificationInformationList.add(thisWeekEmailNotification);
        /// Employee 'Ping' Adhoc notification.
        NotificationInfo pingAdhocNotification = new NotificationInfo(NotificationEnum.NotificationTypeEnum.AD_HOC, EDEntityType.EMPLOYEE.getId(),
                EDEntityType.EMPLOYEE.getId(), com.eworkplaceapps.platform.utils.enums.EmployeeEnums.EDAdhocNotification.PING.getId(), EDEntityType.NONE.getId(), supportedDeliveryTypes, supportedLocalNotificationType);
        notificationInformationList.add(pingAdhocNotification);
    }

    public static void setNotificationInformationList(List<NotificationInfo> notificationInformationList) {
        EDApplicationInfo.notificationInformationList = notificationInformationList;
    }

    public static List<NotificationEnum.NotificationDeliveryType> getSupportedDeliveryTypes() {
        return supportedDeliveryTypes;
    }

    public static void setSupportedDeliveryTypes(List<NotificationEnum.NotificationDeliveryType> supportedDeliveryTypes) {
        EDApplicationInfo.supportedDeliveryTypes = supportedDeliveryTypes;
    }

    public static List<NotificationEnum.LocalNotificationType> getSupportedLocalNotificationType() {
        return supportedLocalNotificationType;
    }

    public static void setSupportedLocalNotificationType(List<NotificationEnum.LocalNotificationType> supportedLocalNotificationType) {
        EDApplicationInfo.supportedLocalNotificationType = supportedLocalNotificationType;
    }
}


text:
#include <aws/workdocs/model/ActivityType.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>

using namespace Aws::Utils;

namespace Aws
{
  namespace WorkDocs
  {
    namespace Model
    {
      namespace ActivityTypeMapper
      {

        static const int DOCUMENT_CHECKED_IN_HASH = HashingUtils::HashString("DOCUMENT_CHECKED_IN");
        static const int DOCUMENT_CHECKED_OUT_HASH = HashingUtils::HashString("DOCUMENT_CHECKED_OUT");
        static const int DOCUMENT_RENAMED_HASH = HashingUtils::HashString("DOCUMENT_RENAMED");
        static const int DOCUMENT_VERSION_UPLOADED_HASH = HashingUtils::HashString("DOCUMENT_VERSION_UPLOADED");
        static const int DOCUMENT_VERSION_DELETED_HASH = HashingUtils::HashString("DOCUMENT_VERSION_DELETED");
        static const int DOCUMENT_VERSION_VIEWED_HASH = HashingUtils::HashString("DOCUMENT_VERSION_VIEWED");
        static const int DOCUMENT_VERSION_DOWNLOADED_HASH = HashingUtils::HashString("DOCUMENT_VERSION_DOWNLOADED");
        static const int DOCUMENT_RECYCLED_HASH = HashingUtils::HashString("DOCUMENT_RECYCLED");
        static const int DOCUMENT_RESTORED_HASH = HashingUtils::HashString("DOCUMENT_RESTORED");
        static const int DOCUMENT_REVERTED_HASH = HashingUtils::HashString("DOCUMENT_REVERTED");
        static const int DOCUMENT_SHARED_HASH = HashingUtils::HashString("DOCUMENT_SHARED");
        static const int DOCUMENT_UNSHARED_HASH = HashingUtils::HashString("DOCUMENT_UNSHARED");
        static const int DOCUMENT_SHARE_PERMISSION_CHANGED_HASH = HashingUtils::HashString("DOCUMENT_SHARE_PERMISSION_CHANGED");
        static const int DOCUMENT_SHAREABLE_LINK_CREATED_HASH = HashingUtils::HashString("DOCUMENT_SHAREABLE_LINK_CREATED");
        static const int DOCUMENT_SHAREABLE_LINK_REMOVED_HASH = HashingUtils::HashString("DOCUMENT_SHAREABLE_LINK_REMOVED");
        static const int DOCUMENT_SHAREABLE_LINK_PERMISSION_CHANGED_HASH = HashingUtils::HashString("DOCUMENT_SHAREABLE_LINK_PERMISSION_CHANGED");
        static const int DOCUMENT_MOVED_HASH = HashingUtils::HashString("DOCUMENT_MOVED");
        static const int DOCUMENT_COMMENT_ADDED_HASH = HashingUtils::HashString("DOCUMENT_COMMENT_ADDED");
        static const int DOCUMENT_COMMENT_DELETED_HASH = HashingUtils::HashString("DOCUMENT_COMMENT_DELETED");
        static const int DOCUMENT_ANNOTATION_ADDED_HASH = HashingUtils::HashString("DOCUMENT_ANNOTATION_ADDED");
        static const int DOCUMENT_ANNOTATION_DELETED_HASH = HashingUtils::HashString("DOCUMENT_ANNOTATION_DELETED");
        static const int FOLDER_CREATED_HASH = HashingUtils::HashString("FOLDER_CREATED");
        static const int FOLDER_DELETED_HASH = HashingUtils::HashString("FOLDER_DELETED");
        static const int FOLDER_RENAMED_HASH = HashingUtils::HashString("FOLDER_RENAMED");
        static const int FOLDER_RECYCLED_HASH = HashingUtils::HashString("FOLDER_RECYCLED");
        static const int FOLDER_RESTORED_HASH = HashingUtils::HashString("FOLDER_RESTORED");
        static const int FOLDER_SHARED_HASH = HashingUtils::HashString("FOLDER_SHARED");
        static const int FOLDER_UNSHARED_HASH = HashingUtils::HashString("FOLDER_UNSHARED");
        static const int FOLDER_SHARE_PERMISSION_CHANGED_HASH = HashingUtils::HashString("FOLDER_SHARE_PERMISSION_CHANGED");
        static const int FOLDER_SHAREABLE_LINK_CREATED_HASH = HashingUtils::HashString("FOLDER_SHAREABLE_LINK_CREATED");
        static const int FOLDER_SHAREABLE_LINK_REMOVED_HASH = HashingUtils::HashString("FOLDER_SHAREABLE_LINK_REMOVED");
        static const int FOLDER_SHAREABLE_LINK_PERMISSION_CHANGED_HASH = HashingUtils::HashString("FOLDER_SHAREABLE_LINK_PERMISSION_CHANGED");
        static const int FOLDER_MOVED_HASH = HashingUtils::HashString("FOLDER_MOVED");

        ActivityType GetActivityTypeForName(const Aws::String& name)
        {
          int hashCode = HashingUtils::HashString(name.c_str());
          if (hashCode == DOCUMENT_CHECKED_IN_HASH)
          {
            return ActivityType::DOCUMENT_CHECKED_IN;
          }
          else if (hashCode == DOCUMENT_CHECKED_OUT_HASH)
          {
            return ActivityType::DOCUMENT_CHECKED_OUT;
          }
          else if (hashCode == DOCUMENT_RENAMED_HASH)
          {
            return ActivityType::DOCUMENT_RENAMED;
          }
          else if (hashCode == DOCUMENT_VERSION_UPLOADED_HASH)
          {
            return ActivityType::DOCUMENT_VERSION_UPLOADED;
          }
          else if (hashCode == DOCUMENT_VERSION_DELETED_HASH)
          {
            return ActivityType::DOCUMENT_VERSION_DELETED;
          }
          else if (hashCode == DOCUMENT_VERSION_VIEWED_HASH)
          {
            return ActivityType::DOCUMENT_VERSION_VIEWED;
          }
          else if (hashCode == DOCUMENT_VERSION_DOWNLOADED_HASH)
          {
            return ActivityType::DOCUMENT_VERSION_DOWNLOADED;
          }
          else if (hashCode == DOCUMENT_RECYCLED_HASH)
          {
            return ActivityType::DOCUMENT_RECYCLED;
          }
          else if (hashCode == DOCUMENT_RESTORED_HASH)
          {
            return ActivityType::DOCUMENT_RESTORED;
          }
          else if (hashCode == DOCUMENT_REVERTED_HASH)
          {
            return ActivityType::DOCUMENT_REVERTED;
          }
          else if (hashCode == DOCUMENT_SHARED_HASH)
          {
            return ActivityType::DOCUMENT_SHARED;
          }
          else if (hashCode == DOCUMENT_UNSHARED_HASH)
          {
            return ActivityType::DOCUMENT_UNSHARED;
          }
          else if (hashCode == DOCUMENT_SHARE_PERMISSION_CHANGED_HASH)
          {
            return ActivityType::DOCUMENT_SHARE_PERMISSION_CHANGED;
          }
          else if (hashCode == DOCUMENT_SHAREABLE_LINK_CREATED_HASH)
          {
            return ActivityType::DOCUMENT_SHAREABLE_LINK_CREATED;
          }
          else if (hashCode == DOCUMENT_SHAREABLE_LINK_REMOVED_HASH)
          {
            return ActivityType::DOCUMENT_SHAREABLE_LINK_REMOVED;
          }
          else if (hashCode == DOCUMENT_SHAREABLE_LINK_PERMISSION_CHANGED_HASH)
          {
            return ActivityType::DOCUMENT_SHAREABLE_LINK_PERMISSION_CHANGED;
          }
          else if (hashCode == DOCUMENT_MOVED_HASH)
          {
            return ActivityType::DOCUMENT_MOVED;
          }
          else if (hashCode == DOCUMENT_COMMENT_ADDED_HASH)
          {
            return ActivityType::DOCUMENT_COMMENT_ADDED;
          }
          else if (hashCode == DOCUMENT_COMMENT_DELETED_HASH)
          {
            return ActivityType::DOCUMENT_COMMENT_DELETED;
          }
          else if (hashCode == DOCUMENT_ANNOTATION_ADDED_HASH)
          {
            return ActivityType::DOCUMENT_ANNOTATION_ADDED;
          }
          else if (hashCode == DOCUMENT_ANNOTATION_DELETED_HASH)
          {
            return ActivityType::DOCUMENT_ANNOTATION_DELETED;
          }
          else if (hashCode == FOLDER_CREATED_HASH)
          {
            return ActivityType::FOLDER_CREATED;
          }
          else if (hashCode == FOLDER_DELETED_HASH)
          {
            return ActivityType::FOLDER_DELETED;
          }
          else if (hashCode == FOLDER_RENAMED_HASH)
          {
            return ActivityType::FOLDER_RENAMED;
          }
          else if (hashCode == FOLDER_RECYCLED_HASH)
          {
            return ActivityType::FOLDER_RECYCLED;
          }
          else if (hashCode == FOLDER_RESTORED_HASH)
          {
            return ActivityType::FOLDER_RESTORED;
          }
          else if (hashCode == FOLDER_SHARED_HASH)
          {
            return ActivityType::FOLDER_SHARED;
          }
          else if (hashCode == FOLDER_UNSHARED_HASH)
          {
            return ActivityType::FOLDER_UNSHARED;
          }
          else if (hashCode == FOLDER_SHARE_PERMISSION_CHANGED_HASH)
          {
            return ActivityType::FOLDER_SHARE_PERMISSION_CHANGED;
          }
          else if (hashCode == FOLDER_SHAREABLE_LINK_CREATED_HASH)
          {
            return ActivityType::FOLDER_SHAREABLE_LINK_CREATED;
          }
          else if (hashCode == FOLDER_SHAREABLE_LINK_REMOVED_HASH)
          {
            return ActivityType::FOLDER_SHAREABLE_LINK_REMOVED;
          }
          else if (hashCode == FOLDER_SHAREABLE_LINK_PERMISSION_CHANGED_HASH)
          {
            return ActivityType::FOLDER_SHAREABLE_LINK_PERMISSION_CHANGED;
          }
          else if (hashCode == FOLDER_MOVED_HASH)
          {
            return ActivityType::FOLDER_MOVED;
          }
          EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
          if(overflowContainer)
          {
            overflowContainer->StoreOverflow(hashCode, name);
            return static_cast<ActivityType>(hashCode);
          }

          return ActivityType::NOT_SET;
        }

        Aws::String GetNameForActivityType(ActivityType enumValue)
        {
          switch(enumValue)
          {
          case ActivityType::DOCUMENT_CHECKED_IN:
            return "DOCUMENT_CHECKED_IN";
          case ActivityType::DOCUMENT_CHECKED_OUT:
            return "DOCUMENT_CHECKED_OUT";
          case ActivityType::DOCUMENT_RENAMED:
            return "DOCUMENT_RENAMED";
          case ActivityType::DOCUMENT_VERSION_UPLOADED:
            return "DOCUMENT_VERSION_UPLOADED";
          case ActivityType::DOCUMENT_VERSION_DELETED:
            return "DOCUMENT_VERSION_DELETED";
          case ActivityType::DOCUMENT_VERSION_VIEWED:
            return "DOCUMENT_VERSION_VIEWED";
          case ActivityType::DOCUMENT_VERSION_DOWNLOADED:
            return "DOCUMENT_VERSION_DOWNLOADED";
          case ActivityType::DOCUMENT_RECYCLED:
            return "DOCUMENT_RECYCLED";
          case ActivityType::DOCUMENT_RESTORED:
            return "DOCUMENT_RESTORED";
          case ActivityType::DOCUMENT_REVERTED:
            return "DOCUMENT_REVERTED";
          case ActivityType::DOCUMENT_SHARED:
            return "DOCUMENT_SHARED";
          case ActivityType::DOCUMENT_UNSHARED:
            return "DOCUMENT_UNSHARED";
          case ActivityType::DOCUMENT_SHARE_PERMISSION_CHANGED:
            return "DOCUMENT_SHARE_PERMISSION_CHANGED";
          case ActivityType::DOCUMENT_SHAREABLE_LINK_CREATED:
            return "DOCUMENT_SHAREABLE_LINK_CREATED";
          case ActivityType::DOCUMENT_SHAREABLE_LINK_REMOVED:
            return "DOCUMENT_SHAREABLE_LINK_REMOVED";
          case ActivityType::DOCUMENT_SHAREABLE_LINK_PERMISSION_CHANGED:
            return "DOCUMENT_SHAREABLE_LINK_PERMISSION_CHANGED";
          case ActivityType::DOCUMENT_MOVED:
            return "DOCUMENT_MOVED";
          case ActivityType::DOCUMENT_COMMENT_ADDED:
            return "DOCUMENT_COMMENT_ADDED";
          case ActivityType::DOCUMENT_COMMENT_DELETED:
            return "DOCUMENT_COMMENT_DELETED";
          case ActivityType::DOCUMENT_ANNOTATION_ADDED:
            return "DOCUMENT_ANNOTATION_ADDED";
          case ActivityType::DOCUMENT_ANNOTATION_DELETED:
            return "DOCUMENT_ANNOTATION_DELETED";
          case ActivityType::FOLDER_CREATED:
            return "FOLDER_CREATED";
          case ActivityType::FOLDER_DELETED:
            return "FOLDER_DELETED";
          case ActivityType::FOLDER_RENAMED:
            return "FOLDER_RENAMED";
          case ActivityType::FOLDER_RECYCLED:
            return "FOLDER_RECYCLED";
          case ActivityType::FOLDER_RESTORED:
            return "FOLDER_RESTORED";
          case ActivityType::FOLDER_SHARED:
            return "FOLDER_SHARED";
          case ActivityType::FOLDER_UNSHARED:
            return "FOLDER_UNSHARED";
          case ActivityType::FOLDER_SHARE_PERMISSION_CHANGED:
            return "FOLDER_SHARE_PERMISSION_CHANGED";
          case ActivityType::FOLDER_SHAREABLE_LINK_CREATED:
            return "FOLDER_SHAREABLE_LINK_CREATED";
          case ActivityType::FOLDER_SHAREABLE_LINK_REMOVED:
            return "FOLDER_SHAREABLE_LINK_REMOVED";
          case ActivityType::FOLDER_SHAREABLE_LINK_PERMISSION_CHANGED:
            return "FOLDER_SHAREABLE_LINK_PERMISSION_CHANGED";
          case ActivityType::FOLDER_MOVED:
            return "FOLDER_MOVED";
          default:
            EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
            if(overflowContainer)
            {
              return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
            }

            return {};
          }
        }

      } // namespace ActivityTypeMapper
    } // namespace Model
  } // namespace WorkDocs
} // namespace Aws


text:
#include <stdint.h>
#include <string.h>
#include <stdlib.h>

#include "argon2.h"
#include "core.h"

#include "blake2/blamka-round-ref.h"
#include "blake2/blake2-impl.h"
#include "blake2/blake2.h"

/*
 * Function fills a new memory block and optionally XORs the old block over the new one.
 * @next_block must be initialized.
 * @param prev_block Pointer to the previous block
 * @param ref_block Pointer to the reference block
 * @param next_block Pointer to the block to be constructed
 * @param with_xor Whether to XOR into the new block (1) or just overwrite (0)
 * @pre all block pointers must be valid
 */
static void fill_block(const block *prev_block, const block *ref_block,
                       block *next_block, int with_xor) {
    block blockR, block_tmp;
    unsigned i;

    copy_block(&blockR, ref_block);
    xor_block(&blockR, prev_block);
    copy_block(&block_tmp, &blockR);
    /* Now blockR = ref_block + prev_block and block_tmp = ref_block + prev_block */
    if (with_xor) {
        /* Saving the next block contents for XOR over: */
        xor_block(&block_tmp, next_block);
        /* Now blockR = ref_block + prev_block and
           block_tmp = ref_block + prev_block + next_block */
    }

    /* Apply Blake2 on columns of 64-bit words: (0,1,...,15) , then
       (16,17,..31)... finally (112,113,...127) */
    for (i = 0; i < 8; ++i) {
        BLAKE2_ROUND_NOMSG(
            blockR.v[16 * i], blockR.v[16 * i + 1], blockR.v[16 * i + 2],
            blockR.v[16 * i + 3], blockR.v[16 * i + 4], blockR.v[16 * i + 5],
            blockR.v[16 * i + 6], blockR.v[16 * i + 7], blockR.v[16 * i + 8],
            blockR.v[16 * i + 9], blockR.v[16 * i + 10], blockR.v[16 * i + 11],
            blockR.v[16 * i + 12], blockR.v[16 * i + 13], blockR.v[16 * i + 14],
            blockR.v[16 * i + 15]);
    }

    /* Apply Blake2 on rows of 64-bit words: (0,1,16,17,...112,113), then
       (2,3,18,19,...,114,115).. finally (14,15,30,31,...,126,127) */
    for (i = 0; i < 8; i++) {
        BLAKE2_ROUND_NOMSG(
            blockR.v[2 * i], blockR.v[2 * i + 1], blockR.v[2 * i + 16],
            blockR.v[2 * i + 17], blockR.v[2 * i + 32], blockR.v[2 * i + 33],
            blockR.v[2 * i + 48], blockR.v[2 * i + 49], blockR.v[2 * i + 64],
            blockR.v[2 * i + 65], blockR.v[2 * i + 80], blockR.v[2 * i + 81],
            blockR.v[2 * i + 96], blockR.v[2 * i + 97], blockR.v[2 * i + 112],
            blockR.v[2 * i + 113]);
    }

    copy_block(next_block, &block_tmp);
    xor_block(next_block, &blockR);
}

static void next_addresses(block *address_block, block *input_block,
                           const block *zero_block) {
    input_block->v[6]++;
    fill_block(zero_block, input_block, address_block, 0);
    fill_block(zero_block, address_block, address_block, 0);
}

void fill_segment(const argon2_instance_t *instance,
                  argon2_position_t position) {
    block *ref_block = NULL, *curr_block = NULL;
    block address_block, input_block, zero_block;
    uint64_t pseudo_rand, ref_index, ref_lane;
    uint32_t prev_offset, curr_offset;
    uint32_t starting_index;
    uint32_t i;
    int data_independent_addressing;

    if (instance == NULL) {
        return;
    }

    data_independent_addressing =
        (instance->type == Argon2_i) ||
        (instance->type == Argon2_id && (position.pass == 0) &&
         (position.slice < ARGON2_SYNC_POINTS / 2));

    if (data_independent_addressing) {
        init_block_value(&zero_block, 0);
        init_block_value(&input_block, 0);

        input_block.v[0] = position.pass;
        input_block.v[1] = position.lane;
        input_block.v[2] = position.slice;
        input_block.v[3] = instance->memory_blocks;
        input_block.v[4] = instance->passes;
        input_block.v[5] = instance->type;
    }

    starting_index = 0;

    if ((0 == position.pass) && (0 == position.slice)) {
        starting_index = 2; /* we have already generated the first two blocks */

        /* Don't forget to generate the first block of addresses: */
        if (data_independent_addressing) {
            next_addresses(&address_block, &input_block, &zero_block);
        }
    }

    /* Offset of the current block */
    curr_offset = position.lane * instance->lane_length +
                  position.slice * instance->segment_length + starting_index;

    if (0 == curr_offset % instance->lane_length) {
        /* Last block in this lane */
        prev_offset = curr_offset + instance->lane_length - 1;
    } else {
        /* Previous block */
        prev_offset = curr_offset - 1;
    }

    for (i = starting_index; i < instance->segment_length;
         ++i, ++curr_offset, ++prev_offset) {
        /*1.1 Rotating prev_offset if needed */
        if (curr_offset % instance->lane_length == 1) {
            prev_offset = curr_offset - 1;
        }

        /* 1.2 Computing the index of the reference block */
        /* 1.2.1 Taking pseudo-random value from the previous block */
        if (data_independent_addressing) {
            if (i % ARGON2_ADDRESSES_IN_BLOCK == 0) {
                next_addresses(&address_block, &input_block, &zero_block);
            }
            pseudo_rand = address_block.v[i % ARGON2_ADDRESSES_IN_BLOCK];
        } else {
            pseudo_rand = instance->memory[prev_offset].v[0];
        }

        /* 1.2.2 Computing the lane of the reference block */
        ref_lane = ((pseudo_rand >> 32)) % instance->lanes;

        if ((position.pass == 0) && (position.slice == 0)) {
            /* Can not reference other lanes yet */
            ref_lane = position.lane;
        }

        /* 1.2.3 Computing the number of possible reference block within the
         * lane.
         */
        position.index = i;
        ref_index = index_alpha(instance, &position, pseudo_rand & 0xFFFFFFFF,
                                ref_lane == position.lane);

        /* 2 Creating a new block */
        ref_block =
            instance->memory + instance->lane_length * ref_lane + ref_index;
        curr_block = instance->memory + curr_offset;
        if (ARGON2_VERSION_10 == instance->version) {
            /* version 1.2.1 and earlier: overwrite, not XOR */
            fill_block(instance->memory + prev_offset, ref_block, curr_block, 0);
        } else {
            if(0 == position.pass) {
                fill_block(instance->memory + prev_offset, ref_block,
                           curr_block, 0);
            } else {
                fill_block(instance->memory + prev_offset, ref_block,
                           curr_block, 1);
            }
        }
    }
}


text:
package com.plexobject.handler;

import java.util.Map;

import com.plexobject.service.RequestMethod;
import com.plexobject.service.ServiceConfigDesc;

/**
 * This interface allows integration with other service engines and adapt them
 * to request handler
 *
 * @author shahzad bhatti
 *
 */
public interface RequestHandlerAdapter {
    Map<ServiceConfigDesc, RequestHandler> create(Class<?> serviceClass,
            ServiceConfigDesc desc);

    Map<ServiceConfigDesc, RequestHandler> create(Object service,
            ServiceConfigDesc desc);

    Map<ServiceConfigDesc, RequestHandler> create(Object service, String path,
            RequestMethod method);
}