text:
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListType
from pyangbind.lib.yangtypes import YANGDynClass
from pyangbind.lib.yangtypes import ReferenceType
from pyangbind.lib.base import PybindBase
from collections import OrderedDict
from decimal import Decimal
from bitarray import bitarray
import six

# PY3 support of some PY2 keywords (needs improved)
if six.PY3:
    import builtins as __builtin__

    long = int
elif six.PY2:
    import __builtin__

class state(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance - based on the path /network-instances/network-instance/protocols/protocol/ospfv2/global/mpls/igp-ldp-sync/state. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: Operational state variables relating to LDP/IGP
synchronization
  """
    __slots__ = ("_path_helper", "_extmethods", "__enabled", "__post_session_up_delay")

    _yang_name = "state"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__enabled = YANGDynClass(
            base=YANGBool,
            is_leaf=True,
            yang_name="enabled",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )
        self.__post_session_up_delay = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="post-session-up-delay",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint32",
            is_config=False,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError("cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError("Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "protocols",
                "protocol",
                "ospfv2",
                "global",
                "mpls",
                "igp-ldp-sync",
                "state",
            ]

    def _get_enabled(self):
        """
    Getter method for enabled, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/global/mpls/igp_ldp_sync/state/enabled (boolean)

    YANG Description: When this leaf is set to true, do not utilise this link for
forwarding via the IGP until such time as LDP adjacencies to
the neighbor(s) over the link are established.
    """
        return self.__enabled

    def _set_enabled(self, v, load=False):
        """
    Setter method for enabled, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/global/mpls/igp_ldp_sync/state/enabled (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_enabled is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_enabled() directly.

    YANG Description: When this leaf is set to true, do not utilise this link for
forwarding via the IGP until such time as LDP adjacencies to
the neighbor(s) over the link are established.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                is_leaf=True,
                yang_name="enabled",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="boolean",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """enabled must be of a type compatible with boolean""",
                    "defined-type": "boolean",
                    "generated-type": """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
                }
            )

        self.__enabled = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_enabled(self):
        self.__enabled = YANGDynClass(
            base=YANGBool,
            is_leaf=True,
            yang_name="enabled",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

    def _get_post_session_up_delay(self):
        """
    Getter method for post_session_up_delay, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/global/mpls/igp_ldp_sync/state/post_session_up_delay (uint32)

    YANG Description: This leaf specifies a delay, expressed in units of milliseconds,
between the LDP session to the IGP neighbor being established, and
it being considered synchronized by the IGP.
    """
        return self.__post_session_up_delay

    def _set_post_session_up_delay(self, v, load=False):
        """
    Setter method for post_session_up_delay, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/global/mpls/igp_ldp_sync/state/post_session_up_delay (uint32)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_post_session_up_delay is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_post_session_up_delay() directly.

    YANG Description: This leaf specifies a delay, expressed in units of milliseconds,
between the LDP session to the IGP neighbor being established, and
it being considered synchronized by the IGP.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="post-session-up-delay",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="uint32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """post_session_up_delay must be of a type compatible with uint32""",
                    "defined-type": "uint32",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="post-session-up-delay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint32', is_config=False)""",
                }
            )

        self.__post_session_up_delay = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_post_session_up_delay(self):
        self.__post_session_up_delay = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="post-session-up-delay",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint32",
            is_config=False,
        )

    enabled = __builtin__.property(_get_enabled)
    post_session_up_delay = __builtin__.property(_get_post_session_up_delay)

    _pyangbind_elements = OrderedDict(
        [("enabled", enabled), ("post_session_up_delay", post_session_up_delay)]
    )

class state(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance-l2 - based on the path /network-instances/network-instance/protocols/protocol/ospfv2/global/mpls/igp-ldp-sync/state. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: Operational state variables relating to LDP/IGP
synchronization
  """
    __slots__ = ("_path_helper", "_extmethods", "__enabled", "__post_session_up_delay")

    _yang_name = "state"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__enabled = YANGDynClass(
            base=YANGBool,
            is_leaf=True,
            yang_name="enabled",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )
        self.__post_session_up_delay = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="post-session-up-delay",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint32",
            is_config=False,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError("cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError("Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "protocols",
                "protocol",
                "ospfv2",
                "global",
                "mpls",
                "igp-ldp-sync",
                "state",
            ]

    def _get_enabled(self):
        """
    Getter method for enabled, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/global/mpls/igp_ldp_sync/state/enabled (boolean)

    YANG Description: When this leaf is set to true, do not utilise this link for
forwarding via the IGP until such time as LDP adjacencies to
the neighbor(s) over the link are established.
    """
        return self.__enabled

    def _set_enabled(self, v, load=False):
        """
    Setter method for enabled, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/global/mpls/igp_ldp_sync/state/enabled (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_enabled is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_enabled() directly.

    YANG Description: When this leaf is set to true, do not utilise this link for
forwarding via the IGP until such time as LDP adjacencies to
the neighbor(s) over the link are established.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                is_leaf=True,
                yang_name="enabled",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="boolean",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """enabled must be of a type compatible with boolean""",
                    "defined-type": "boolean",
                    "generated-type": """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
                }
            )

        self.__enabled = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_enabled(self):
        self.__enabled = YANGDynClass(
            base=YANGBool,
            is_leaf=True,
            yang_name="enabled",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

    def _get_post_session_up_delay(self):
        """
    Getter method for post_session_up_delay, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/global/mpls/igp_ldp_sync/state/post_session_up_delay (uint32)

    YANG Description: This leaf specifies a delay, expressed in units of milliseconds,
between the LDP session to the IGP neighbor being established, and
it being considered synchronized by the IGP.
    """
        return self.__post_session_up_delay

    def _set_post_session_up_delay(self, v, load=False):
        """
    Setter method for post_session_up_delay, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/global/mpls/igp_ldp_sync/state/post_session_up_delay (uint32)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_post_session_up_delay is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_post_session_up_delay() directly.

    YANG Description: This leaf specifies a delay, expressed in units of milliseconds,
between the LDP session to the IGP neighbor being established, and
it being considered synchronized by the IGP.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="post-session-up-delay",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="uint32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """post_session_up_delay must be of a type compatible with uint32""",
                    "defined-type": "uint32",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="post-session-up-delay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint32', is_config=False)""",
                }
            )

        self.__post_session_up_delay = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_post_session_up_delay(self):
        self.__post_session_up_delay = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="post-session-up-delay",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint32",
            is_config=False,
        )

    enabled = __builtin__.property(_get_enabled)
    post_session_up_delay = __builtin__.property(_get_post_session_up_delay)

    _pyangbind_elements = OrderedDict(
        [("enabled", enabled), ("post_session_up_delay", post_session_up_delay)]
    )


text:
from django.contrib import admin
# from web.models import *

# class CourseFeedAdmin(admin.ModelAdmin):
#     list_display = ('source', 'crmid', 'language','last_index', 'enabled', 'reviewed')
#     list_filter = ('enabled', 'reviewed')

# class CourseAdmin(admin.ModelAdmin):
# 	list_display = ('source', 'title', 'retrieved')

# admin.site.register(CourseFeed, CourseFeedAdmin)
# admin.site.register(Course, CourseAdmin)

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>ovs all: dpdk_mp Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

ovs all

Main Page

Related Pages

Namespaces

Data Structures

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Data Structures

Data Structure Index

Class Hierarchy

Data Fields

Public Member Functions |
Data Fields

dpdk_mp Struct Reference

Collaboration diagram for dpdk_mp:

<map name="dpdk__mp_coll__map" id="dpdk__mp_coll__map">
</map>
[legend]

Public Member Functions

struct ovs_list list_node 	OVS_GUARDED_BY (dpdk_mutex)

Data Fields

struct rte_mempool * 	mp

int 	mtu

int 	socket_id

int 	refcount

Member Function Documentation

          struct ovs_list list_node dpdk_mp::OVS_GUARDED_BY
          (
          dpdk_mutex
          	)

Field Documentation

          struct rte_mempool* dpdk_mp::mp

          int dpdk_mp::mtu

          int dpdk_mp::refcount

          int dpdk_mp::socket_id

The documentation for this struct was generated from the following file:

/home/vladn/git/ovs/lib/netdev-dpdk.c

dpdk_mp

Generated on Wed Sep 9 2015 19:08:08 for ovs all by

     1.8.9.1


text:
<?xml version="1.0"?>
<doc>
<assembly>
<name>
NCC2015
</name>
</assembly>
<members>
<member name="T:NCC2015.My.Resources.Resources">
<summary>
  A strongly-typed resource class, for looking up localized strings, etc.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.ResourceManager">
<summary>
  Returns the cached ResourceManager instance used by this class.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.Culture">
<summary>
  Overrides the current thread's CurrentUICulture property for all
  resource lookups using this strongly typed resource class.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources._next">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.A_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.acept">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.add_class">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.add_socio">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.administrar">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.B_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.back">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.blank">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.C_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.change_user">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.Circled_Left_2_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.Circled_Left_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.Circled_Right_2_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.Circled_Right_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.classes">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.Clean_48">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.Close_Window_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.Delete_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.Delete_48">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.delete25">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.deleteRow">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.despesas_proveito">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.Euro_32">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.Exit_48">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.ficha_inscricao">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.First_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.forbid">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.Go_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.Groom_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.H_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.Hospital_2_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.Insert_Card_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.invalido">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.Last_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.login">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.logo_lumart">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.logo_ncc">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.M_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.Medal_First_Place_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.Next_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.Nurse_Female_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.Overtime_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.Pacifier_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.pagamentos">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.Parent_Guardian_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.Previous_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.Refresh_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.Remove_User_Male_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.sair">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.Save_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.Save_48">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.Save_the_Children_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.Search_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.timetable_48">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.User_Groups_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.View_Details_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.View_File_24">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="P:NCC2015.My.Resources.Resources.viewTimetable_32">
<summary>
  Looks up a localized resource of type System.Drawing.Bitmap.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet">
<summary>
Represents a strongly typed in-memory cache of data.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.loo_imageDataTable">
<summary>
Represents the strongly named DataTable class.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.loo_medicDataTable">
<summary>
Represents the strongly named DataTable class.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.loo_partnerDataTable">
<summary>
Represents the strongly named DataTable class.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.loo_partner_classDataTable">
<summary>
Represents the strongly named DataTable class.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.loo_partner_timetableDataTable">
<summary>
Represents the strongly named DataTable class.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.loo_userDataTable">
<summary>
Represents the strongly named DataTable class.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.loo_sysDataTable">
<summary>
Represents the strongly named DataTable class.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.partner_infoDataTable">
<summary>
Represents the strongly named DataTable class.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.loo_partner_class1DataTable">
<summary>
Represents the strongly named DataTable class.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.loo_partner_timetable1DataTable">
<summary>
Represents the strongly named DataTable class.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.loo_imageRow">
<summary>
Represents strongly named DataRow class.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.loo_medicRow">
<summary>
Represents strongly named DataRow class.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.loo_partnerRow">
<summary>
Represents strongly named DataRow class.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.loo_partner_classRow">
<summary>
Represents strongly named DataRow class.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.loo_partner_timetableRow">
<summary>
Represents strongly named DataRow class.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.loo_userRow">
<summary>
Represents strongly named DataRow class.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.loo_sysRow">
<summary>
Represents strongly named DataRow class.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.partner_infoRow">
<summary>
Represents strongly named DataRow class.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.loo_partner_class1Row">
<summary>
Represents strongly named DataRow class.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.loo_partner_timetable1Row">
<summary>
Represents strongly named DataRow class.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.loo_imageRowChangeEvent">
<summary>
Row event argument class
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.loo_medicRowChangeEvent">
<summary>
Row event argument class
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.loo_partnerRowChangeEvent">
<summary>
Row event argument class
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.loo_partner_classRowChangeEvent">
<summary>
Row event argument class
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.loo_partner_timetableRowChangeEvent">
<summary>
Row event argument class
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.loo_userRowChangeEvent">
<summary>
Row event argument class
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.loo_sysRowChangeEvent">
<summary>
Row event argument class
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.partner_infoRowChangeEvent">
<summary>
Row event argument class
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.loo_partner_class1RowChangeEvent">
<summary>
Row event argument class
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSet.loo_partner_timetable1RowChangeEvent">
<summary>
Row event argument class
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSetTableAdapters.loo_imageTableAdapter">
<summary>
Represents the connection and commands used to retrieve and save data.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSetTableAdapters.loo_medicTableAdapter">
<summary>
Represents the connection and commands used to retrieve and save data.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSetTableAdapters.loo_partnerTableAdapter">
<summary>
Represents the connection and commands used to retrieve and save data.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSetTableAdapters.loo_partner_classTableAdapter">
<summary>
Represents the connection and commands used to retrieve and save data.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSetTableAdapters.loo_partner_timetableTableAdapter">
<summary>
Represents the connection and commands used to retrieve and save data.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSetTableAdapters.loo_userTableAdapter">
<summary>
Represents the connection and commands used to retrieve and save data.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSetTableAdapters.loo_sysTableAdapter">
<summary>
Represents the connection and commands used to retrieve and save data.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSetTableAdapters.partner_infoTableAdapter">
<summary>
Represents the connection and commands used to retrieve and save data.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSetTableAdapters.loo_partner_class1TableAdapter">
<summary>
Represents the connection and commands used to retrieve and save data.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSetTableAdapters.loo_partner_timetable1TableAdapter">
<summary>
Represents the connection and commands used to retrieve and save data.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSetTableAdapters.TableAdapterManager">
<summary>
TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Hierarchical Update scenarios
</summary>
</member>
<member name="M:NCC2015.ncc_2015DataSetTableAdapters.TableAdapterManager.UpdateUpdatedRows(NCC2015.ncc_2015DataSet,System.Collections.Generic.List{System.Data.DataRow},System.Collections.Generic.List{System.Data.DataRow})">
<summary>
Update rows in top-down order.
</summary>
</member>
<member name="M:NCC2015.ncc_2015DataSetTableAdapters.TableAdapterManager.UpdateInsertedRows(NCC2015.ncc_2015DataSet,System.Collections.Generic.List{System.Data.DataRow})">
<summary>
Insert rows in top-down order.
</summary>
</member>
<member name="M:NCC2015.ncc_2015DataSetTableAdapters.TableAdapterManager.UpdateDeletedRows(NCC2015.ncc_2015DataSet,System.Collections.Generic.List{System.Data.DataRow})">
<summary>
Delete rows in bottom-up order.
</summary>
</member>
<member name="M:NCC2015.ncc_2015DataSetTableAdapters.TableAdapterManager.GetRealUpdatedRows(System.Data.DataRow[],System.Collections.Generic.List{System.Data.DataRow})">
<summary>
Remove inserted rows that become updated rows after calling TableAdapter.Update(inserted rows) first
</summary>
</member>
<member name="M:NCC2015.ncc_2015DataSetTableAdapters.TableAdapterManager.UpdateAll(NCC2015.ncc_2015DataSet)">
<summary>
Update all changes to the dataset.
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSetTableAdapters.TableAdapterManager.UpdateOrderOption">
<summary>
Update Order Option
</summary>
</member>
<member name="T:NCC2015.ncc_2015DataSetTableAdapters.TableAdapterManager.SelfReferenceComparer">
<summary>
Used to sort self-referenced table's rows
</summary>
</member>
</members>
</doc>


text:
package com.touchgraph.graphlayout.interaction;

import  com.touchgraph.graphlayout.*;

import  java.awt.*;
import  java.applet.*;
import  java.awt.event.*;

/** DragNodeUI contains code for dragging nodes.
  *
  *

  * Parts of this code build upon Sun's Graph Layout example.
  * http://java.sun.com/applets/jdk/1.1/demo/GraphLayout/Graph.java
  *

  *
  * @author   Alexander Shapiro
  * @version  1.20
  */
public class DragNodeUI extends TGAbstractDragUI{

   /** Stores the distance between the cursor and the center of the node
     * when dragging occurs so that the cursor remains at the same position
     * on the node otherwise, the cursor jumps to the center of the node.
     */
    public Point dragOffs;

  // ............

    /** Constructor with TGPanel <tt>tgp</tt>.
      */
    public DragNodeUI( TGPanel tgp ) {
        super(tgp);
    }

    public void preActivate() {
        if (dragOffs ==null) dragOffs=new Point(0,0);
    }

    public void preDeactivate() {};

    public void mousePressed( MouseEvent e ) {
        Node mouseOverN = tgPanel.getMouseOverN();
        Point mousePos;

        if (e!=null) mousePos = e.getPoint(); //e can be null if the wrong activate() method was used
        else mousePos= new Point((int) mouseOverN.drawx,(int) mouseOverN.drawy);

        if ( mouseOverN != null) { //Should never be null if TGUIManager works properly
            tgPanel.setDragNode(mouseOverN);

            dragOffs.setLocation((int) (mouseOverN.drawx-mousePos.x), //For when you click to the side of
                    (int)(mouseOverN.drawy-mousePos.y));//the node, but you still want to drag it
        }
    }

    public void mouseReleased( MouseEvent e ) {
        tgPanel.setDragNode(null);
        tgPanel.repaintAfterMove();
        tgPanel.startDamper();
    }

    public void mouseDragged( MouseEvent e ) {
        Node dragNode = tgPanel.getDragNode();
        dragNode.drawx = e.getX()+dragOffs.x;
        dragNode.drawy = e.getY()+dragOffs.y;
        tgPanel.updatePosFromDraw(dragNode);
        tgPanel.repaintAfterMove();
        tgPanel.stopDamper(); //Keep the graph alive while dragging.
    }

} // end com.touchgraph.graphlayout.interaction.DragNodeUI


text:
class CreateOmertaLoggerBulletFactoryBulletHistories < ActiveRecord::Migration
  def change
    create_table :omerta_logger_bullet_factory_bullet_histories do |t|
      t.references :bullet_factory
      t.datetime :date
      t.integer :bullets, :limit => 3
      t.index :bullet_factory_id, name: 'index_bullet_bullet_factory_id'
    end
  end
end


text:
var access_token = '';
var client_id;
var api_endpoint;
var nonce;
var state;

client_id = tmp_api.gapi_client_id;
api_endpoint = tmp_api.gapi_redirect_uri;
access_token = tmp_api.gapi_access_token;
jQuery(document).ready(function($) {
	nonce = $('INPUT#gforms_tmp_google_oauth').val();
	state = {
		origin : document.location.hostname,
		referrer : window.location.href,
		id : nonce
	};
	// we don't need the client secret for
	// this, and should not
	// expose it to the web.

	function request_auth_code() {
		var oauth_url = 'https://accounts.google.com/o/oauth2/auth';
		var oauth_scope = 'profile email';
		var win_url = oauth_url + '?scope=' + oauth_scope + '&client_id=' + client_id + '&redirect_uri=' + api_endpoint + '&state=' + btoa(JSON.stringify(state)) + '&access_type=offline&response_type=code&prompt=select_account consent';

		var win = window.open(win_url, "googleauthwindow", 'width=800, height=600');
		var pollTimer = window.setInterval(function() {
			try {
				if (win.closed === true) {
					window.clearInterval(pollTimer);
					// Get token from server using nonce
					var data = {
						action : 'gforms_tmp_handle_code_exchange',
						id : nonce,
						_wpnonce : nonce
					};
					$.post(ajaxurl, data, ajax_handler_cb, 'json');
				}
			} catch (e) {
			}
		}, 500);
	}

	function logout_from_google() {
		var data = {
			action : 'gforms_tmp_handle_token_revocation',
			id : nonce,
			_wpnonce : nonce
		};
		$.post(ajaxurl, data, ajax_handler_cb, 'json');
	}

	function ajax_handler_cb(response) {
		if (response && typeof response == 'object') {
			if (typeof response.message != 'undefined') {
				$('#gforms_tmp_google_oauth_message').val(response.message);
			}
			if (typeof response.error != 'undefined') {
				$('#gforms_tmp_google_oauth_error').val(response.message);
			}
		}
		$('#gforms_tmp_auth_settings_form').submit();
	}

	$(function() {
		$('#google-login-block').click(request_auth_code);
		$('#google-logout-block').click(logout_from_google);
	});
});


text:
angular
    .module('app.exchange.option')
    .factory('CategoryDirective', function () {
        var value;
        return {

            login: function ( value ) {
                return value;
            }
        };
    });


text:
dirscalate
==========

Dirscalate helps escalate a directory traversal vulnerability to root access (hopefully)

Requirements
============
Mechanize

Usage
=====

dirscalate.py [-h] --link LINK [--histfile HISTFILE]
                       [--tokens TOKENS] [--logfile LOGFILE]
                       [--depth DEPTH] [--type TYPE]

  Exploit a directory traversal vulnerability to find sensitive information

  optional arguments:

    -h, --help           show this help message and exit
    --link LINK          the full URL to exploit, replace value in vulnerable
                         parameter with #vulnerability# marker (must include
                         http(s):// (default: None)
    --histfile HISTFILE  the list of history files to search (default:
                         histfile.txt)
    --tokens TOKENS      the list of strings to search for in the history
                         files (default: tokens.txt)
    --logfile LOGFILE    the logfile to write matches to (default:
                         dirscalate.txt)
    --depth DEPTH        the length of the traversal attempt (default: 10)
    --type TYPE          1 (../), 2 (URL encoded), or 3 (double encoded)
                         (default: 1)

  Example: dirscalate.py --link
    https://www.victim.com/login.php?test=1&blah=#vulnerability#&id=2
    --histfile histfile.txt --tokens tokens.txt --depth 10 --type standard


text:
using System;
using System.Collections.Generic;
using System.Linq;
using RIAPP.DataService.DomainService.Exceptions;
using RIAPP.DataService.DomainService.Types;
using RIAPP.DataService.Resources;
using RIAPP.DataService.Utils;

namespace RIAPP.DataService.DomainService
{
    public class ParentChildNode
    {
        public ParentChildNode(RowInfo childRow)
        {
            ChildRow = childRow;
        }

        public RowInfo ChildRow { get; set; }

        public RowInfo ParentRow { get; set; }

        public Association association { get; set; }
    }

    internal class ChangeSetGraph
    {
        private readonly LinkedList<RowInfo> _allList = new LinkedList<RowInfo>();
        private readonly LinkedList<RowInfo> _deleteList = new LinkedList<RowInfo>();
        private readonly LinkedList<RowInfo> _insertList = new LinkedList<RowInfo>();
        private readonly CachedMetadata _metadata;
        private readonly LinkedList<RowInfo> _updateList = new LinkedList<RowInfo>();
        private DbSet[] sortedDbSets;
        private readonly LinkedList<ParentChildNode> updateNodes = new LinkedList<ParentChildNode>();

        public ChangeSetGraph(ChangeSet changeSet, CachedMetadata metadata)
        {
            this.changeSet = changeSet;
            _metadata = metadata;
        }

        public ChangeSet changeSet { get; }

        public IEnumerable<RowInfo> insertList
        {
            get { return _insertList; }
        }

        public IEnumerable<RowInfo> updateList
        {
            get { return _updateList; }
        }

        public IEnumerable<RowInfo> deleteList
        {
            get { return _deleteList; }
        }

        public IEnumerable<RowInfo> allList
        {
            get { return _allList; }
        }

        private void getAllParentDbSets(LinkedList<string> list, string dbSetName)
        {
            var parentDbNames =
                _metadata.associations.Values.Where(a => a.childDbSetName == dbSetName)
                    .Select(x => x.parentDbSetName)
                    .ToArray();
            foreach (var name in parentDbNames)
            {
                list.AddLast(name);
                getAllParentDbSets(list, name);
            }
        }

        private int DbSetComparison(DbSet dbSet1, DbSet dbSet2)
        {
            var parentDbNames = new LinkedList<string>();
            getAllParentDbSets(parentDbNames, dbSet1.dbSetName);
            var names1 = parentDbNames.ToArray();
            if (Array.IndexOf(names1, dbSet2.dbSetName) > -1)
            {
                return 1;
            }
            parentDbNames.Clear();
            getAllParentDbSets(parentDbNames, dbSet2.dbSetName);
            var names2 = parentDbNames.ToArray();
            if (Array.IndexOf(names2, dbSet1.dbSetName) > -1)
            {
                return -1;
            }
            return string.Compare(dbSet1.dbSetName, dbSet2.dbSetName);
        }

        private static string GetKey(RowInfo rowInfo)
        {
            return string.Format("{0}:{1}", rowInfo.dbSetInfo.dbSetName, rowInfo.clientKey);
        }

        private Dictionary<string, RowInfo> GetRowsMap()
        {
            var result = new Dictionary<string, RowInfo>();
            foreach (var dbSet in changeSet.dbSets)
            {
                var dbSetInfo = _metadata.dbSets[dbSet.dbSetName];
                if (dbSetInfo.EntityType == null)
                    throw new DomainServiceException(string.Format(ErrorStrings.ERR_DB_ENTITYTYPE_INVALID,
                        dbSetInfo.dbSetName));

                foreach (var rowInfo in dbSet.rows)
                {
                    rowInfo.dbSetInfo = dbSetInfo;
                    result.Add(GetKey(rowInfo), rowInfo);
                }
            }
            return result;
        }

        public void Prepare()
        {
            var rowsMap = GetRowsMap();

            foreach (var trackAssoc in changeSet.trackAssocs)
            {
                var assoc = _metadata.associations[trackAssoc.assocName];
                var pkey = string.Format("{0}:{1}", assoc.parentDbSetName, trackAssoc.parentKey);
                var ckey = string.Format("{0}:{1}", assoc.childDbSetName, trackAssoc.childKey);
                var parent = rowsMap[pkey];
                var child = rowsMap[ckey];
                var childNode = new ParentChildNode(child);
                childNode.association = assoc;
                childNode.ParentRow = parent;
                updateNodes.AddLast(childNode);
            }

            foreach (var dbSet in GetSortedDbSets())
            {
                foreach (var rowInfo in dbSet.rows)
                {
                    var dbSetInfo = rowInfo.dbSetInfo;
                    _allList.AddLast(rowInfo);
                    switch (rowInfo.changeType)
                    {
                        case ChangeType.Added:
                            _insertList.AddLast(rowInfo);
                            break;
                        case ChangeType.Updated:
                            _updateList.AddLast(rowInfo);
                            break;
                        case ChangeType.Deleted:
                            _deleteList.AddFirst(rowInfo);
                            break;
                        default:
                            throw new DomainServiceException(string.Format(ErrorStrings.ERR_REC_CHANGETYPE_INVALID,
                                dbSetInfo.EntityType.Name, rowInfo.changeType));
                    }
                }
            }
        }

        public DbSet[] GetSortedDbSets()
        {
            if (sortedDbSets == null)
            {
                var array = changeSet.dbSets.ToArray();
                Array.Sort(array, DbSetComparison);
                sortedDbSets = array;
            }
            return sortedDbSets;
        }

        public ParentChildNode[] GetChildren(RowInfo parent)
        {
            return updateNodes.Where(u => u.ParentRow == parent).ToArray();
        }

        public ParentChildNode[] GetParents(RowInfo child)
        {
            return updateNodes.Where(u => u.ChildRow == child).ToArray();
        }
    }
}


text:
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __WAVE_PLAYER_H
#define __WAVE_PLAYER_H

/* Includes ------------------------------------------------------------------*/
#include "main.h"

/* Exported types ------------------------------------------------------------*/
typedef enum
{
  LittleEndian,
  BigEndian
}Endianness;

typedef struct
{
  uint32_t  RIFFchunksize;
  uint16_t  FormatTag;
  uint16_t  NumChannels;
  uint32_t  SampleRate;
  uint32_t  ByteRate;
  uint16_t  BlockAlign;
  uint16_t  BitsPerSample;
  uint32_t  DataSize;
}
WAVE_FormatTypeDef;

typedef enum
{
  Valid_WAVE_File = 0,
  Unvalid_RIFF_ID,
  Unvalid_WAVE_Format,
  Unvalid_FormatChunk_ID,
  Unsupporetd_FormatTag,
  Unsupporetd_Number_Of_Channel,
  Unsupporetd_Sample_Rate,
  Unsupporetd_Bits_Per_Sample,
  Unvalid_DataChunk_ID,
  Unsupporetd_ExtraFormatBytes,
  Unvalid_FactChunk_ID
} ErrorCode;

/* Exported constants --------------------------------------------------------*/
#define  CHUNK_ID                            0x52494646  /* correspond to the letters 'RIFF' */
#define  FILE_FORMAT                         0x57415645  /* correspond to the letters 'WAVE' */
#define  FORMAT_ID                           0x666D7420  /* correspond to the letters 'fmt ' */
#define  DATA_ID                             0x64617461  /* correspond to the letters 'data' */
#define  FACT_ID                             0x66616374  /* correspond to the letters 'fact' */
#define  WAVE_FORMAT_PCM                     0x01
#define  FORMAT_CHNUK_SIZE                   0x10
#define  CHANNEL_MONO                        0x01
#define  CHANNEL_STEREO                      0x02
#define  SAMPLE_RATE_8000                    8000
#define  SAMPLE_RATE_11025                   11025
#define  SAMPLE_RATE_22050                   22050
#define  SAMPLE_RATE_44100                   44100
#define  BITS_PER_SAMPLE_8                   8
#define  BITS_PER_SAMPLE_16                  16

/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void TimingDelay_Decrement(void);
void Delay(__IO uint32_t nTime);
void WavePlayBack(uint32_t AudioFreq);
uint32_t AudioFlashPlay(uint16_t* pBuffer, uint32_t FullSize, uint32_t StartAdd);
int WavePlayerInit(uint32_t AudioFreq);
void WavePlayerStop(void);
void WavePlayerPauseResume(uint8_t state);
uint8_t WaveplayerCtrlVolume(uint8_t volume);
void WavePlayerStart(void);
void WavePlayer_CallBack(void);
uint32_t ReadUnit(uint8_t *buffer, uint8_t idx, uint8_t NbrOfBytes, Endianness BytesFormat);

#endif /* __WAVE_PLAYER_H */

/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/


text:
package com.winterbe.java8.samples.concurrent;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.atomic.LongAccumulator;
import java.util.function.LongBinaryOperator;
import java.util.stream.IntStream;

/**
 * @author Benjamin Winterberg
 * @Message 累加计算
 */
public class LongAccumulator1 {

    public static void main(String[] args) {
        testAccumulate();
    }

    private static void testAccumulate() {
        LongBinaryOperator op = (x, y) -> 2 * x + y;
        LongAccumulator accumulator = new LongAccumulator(op, 1L);
        ExecutorService executor = Executors.newFixedThreadPool(2);
        IntStream.range(0, 3).forEach(i -> executor.submit(() -> accumulator.accumulate(i)));
        ConcurrentUtils.stop(executor);
        System.out.format("Add: %d\n", accumulator.getThenReset());
    }
}


text:
 describe('Create League Ctrl', function() {
    var $scope, $rootScope, $location, $httpBackend, createController, $controller, $state, League;

    beforeEach(module('app'));
    beforeEach(inject(function ($injector){
      $rootScope = $injector.get('$rootScope');
      $location = $injector.get('$location');
      $httpBackend = $injector.get('$httpBackend');
      League = $injector.get('League')
      $scope = $rootScope.$new();
      $state = $injector.get('$state');
      var $controller = $injector.get('$controller');

      createController = function () {
        return $controller('createLeagueCtrl', {
          $scope: $scope,
          $location: $location,
          League: League
        });
      };

      createController();
    }));

    afterEach(function () {
      $httpBackend.verifyNoOutstandingExpectation();
      $httpBackend.verifyNoOutstandingRequest();
    });

    it('should have a saveLeagueInfo method', function() {
      $httpBackend.expect('GET', 'app/user/login.html').respond(201);
      expect($scope.saveLeagueInfo).to.be.a('function');
      $httpBackend.flush();
    });

    it('should have a factory League with postLeague method', function() {
      $httpBackend.expect('GET', 'app/user/login.html').respond(201);
      expect(League.postLeague).to.be.a('function');
      $httpBackend.flush();
    });

    it('should POST request to /league the saveLeagueInfo', function() {
      $scope.league = {
        name: 'leagueName',
        show: 'tvShow',
        roster_limit: 1
      };
      $httpBackend.expect('POST', '/league', $scope.league).respond(false, $scope.league);
      $httpBackend.expect('GET', 'app/user/login.html').respond(201);
      $scope.saveLeagueInfo();
      $httpBackend.flush();
    });

  });


text:
This repository contains various code snippets written in [Pascal Programming Language](http://en.wikipedia.org/wiki/Pascal_%28programming_language%29).<br/>
It aims to be a collection of random math and logic problems, implemented for learning purposes.

## Usage ##
Each folder contains two or more files.
* A [Rich Text Format](http://en.wikipedia.org/wiki/Rich_Text_Format) file (*.rtf) containing an exercice statement and some implementation guidelines.
* One or more Pascal (*.pas) source file(s) containing a possible solution implemented.

## Compilers ##
A collection of compilers can be found here:
[Pascal Compilers](http://en.wikipedia.org/wiki/Category:Pascal_compilers)

## License ##
All files (*.pas sources and *.rtf files) and contents are [MIT-Licensed](http://www.opensource.org/licenses/mit-license.php).

	Copyright (c) 2012 Roland Yonaba

    Permission is hereby granted, free of charge, to any person obtaining a
    copy of this software and associated documentation files (the
    "Software"), to deal in the Software without restriction, including
    without limitation the rights to use, copy, modify, merge, publish,
    distribute, sublicense, and/or sell copies of the Software, and to
    permit persons to whom the Software is furnished to do so, subject to
    the following conditions:

    The above copyright notice and this permission notice shall be included
    in all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
    OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/Yonaba/pascal-exercises/trend.png)](https://bitdeli.com/free "Bitdeli Badge")


text:
package org.jivesoftware.smack;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.TimeUnit;

import org.jivesoftware.smack.SmackException.NoResponseException;
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
import org.jivesoftware.smack.filter.PacketFilter;
import org.jivesoftware.smack.packet.Stanza;

/**
 * Provides a mechanism to collect packets into a result queue that pass a
 * specified filter. The collector lets you perform blocking and polling
 * operations on the result queue. So, a PacketCollector is more suitable to
 * use than a {@link PacketListener} when you need to wait for a specific
 * result.

 *
 * Each packet collector will queue up a configured number of packets for processing before
 * older packets are automatically dropped.  The default number is retrieved by
 * {@link SmackConfiguration#getPacketCollectorSize()}.
 *
 * @see XMPPConnection#createPacketCollector(PacketFilter)
 * @author Matt Tucker
 */
public class PacketCollector {

    private final PacketFilter packetFilter;
    private final ArrayBlockingQueue<Stanza> resultQueue;

    /**
     * The packet collector which timeout for the next result will get reset once this collector collects a stanza.
     */
    private final PacketCollector collectorToReset;

    private final XMPPConnection connection;

    private boolean cancelled = false;

    /**
     * Creates a new packet collector. If the packet filter is <tt>null</tt>, then
     * all packets will match this collector.
     *
     * @param connection the connection the collector is tied to.
     * @param configuration the configuration used to construct this collector
     */
    protected PacketCollector(XMPPConnection connection, Configuration configuration) {
        this.connection = connection;
        this.packetFilter = configuration.packetFilter;
        this.resultQueue = new ArrayBlockingQueue<>(configuration.size);
        this.collectorToReset = configuration.collectorToReset;
    }

    /**
     * Explicitly cancels the packet collector so that no more results are
     * queued up. Once a packet collector has been cancelled, it cannot be
     * re-enabled. Instead, a new packet collector must be created.
     */
    public void cancel() {
        // If the packet collector has already been cancelled, do nothing.
        if (!cancelled) {
            cancelled = true;
            connection.removePacketCollector(this);
        }
    }

    /**
     * Returns the packet filter associated with this packet collector. The packet
     * filter is used to determine what packets are queued as results.
     *
     * @return the packet filter.
     */
    public PacketFilter getPacketFilter() {
        return packetFilter;
    }

    /**
     * Polls to see if a packet is currently available and returns it, or
     * immediately returns <tt>null</tt> if no packets are currently in the
     * result queue.
     *
     * @return the next packet result, or <tt>null</tt> if there are no more
     *      results.
     */
    @SuppressWarnings("unchecked")
    public
 P pollResult() {
        return (P) resultQueue.poll();
    }

    /**
     * Polls to see if a packet is currently available and returns it, or
     * immediately returns <tt>null</tt> if no packets are currently in the
     * result queue.
     *

     * Throws an XMPPErrorException in case the polled stanzas did contain an XMPPError.
     *

     *
     * @return the next available packet.
     * @throws XMPPErrorException in case an error response.
     */
    public
 P pollResultOrThrow() throws XMPPErrorException {
        P result = pollResult();
        if (result != null) {
            XMPPErrorException.ifHasErrorThenThrow(result);
        }
        return result;
    }

    /**
     * Returns the next available packet. The method call will block (not return) until a packet is
     * available.
     *
     * @return the next available packet.
     * @throws InterruptedException
     */
    @SuppressWarnings("unchecked")
    public
 P nextResultBlockForever() throws InterruptedException {
        throwIfCancelled();
        P res = null;
        while (res == null) {
            res = (P) resultQueue.take();
        }
        return res;
    }

    /**
     * Returns the next available packet. The method call will block until the connection's default
     * timeout has elapsed.
     *
     * @return the next available packet.
     * @throws InterruptedException
     */
    public
 P nextResult() throws InterruptedException {
        return nextResult(connection.getPacketReplyTimeout());
    }

    private volatile long waitStart;

    /**
     * Returns the next available packet. The method call will block (not return)
     * until a packet is available or the <tt>timeout</tt> has elapsed. If the
     * timeout elapses without a result, <tt>null</tt> will be returned.
     *
     * @param timeout the timeout in milliseconds.
     * @return the next available packet.
     * @throws InterruptedException
     */
    @SuppressWarnings("unchecked")
    public
 P nextResult(long timeout) throws InterruptedException {
        throwIfCancelled();
        P res = null;
        long remainingWait = timeout;
        waitStart = System.currentTimeMillis();
        do {
            res = (P) resultQueue.poll(remainingWait, TimeUnit.MILLISECONDS);
            if (res != null) {
                return res;
            }
            remainingWait = timeout - (System.currentTimeMillis() - waitStart);
        } while (remainingWait > 0);
        return null;
    }

    /**
     * Returns the next available packet. The method call will block until a packet is available or
     * the connections reply timeout has elapsed. If the timeout elapses without a result,
     * <tt>null</tt> will be returned. This method does also cancel the PacketCollector.
     *
     * @return the next available packet.
     * @throws XMPPErrorException in case an error response.
     * @throws NoResponseException if there was no response from the server.
     * @throws InterruptedException
     */
    public
 P nextResultOrThrow() throws NoResponseException, XMPPErrorException, InterruptedException {
        return nextResultOrThrow(connection.getPacketReplyTimeout());
    }

    /**
     * Returns the next available packet. The method call will block until a packet is available or
     * the <tt>timeout</tt> has elapsed. This method does also cancel the PacketCollector.
     *
     * @param timeout the amount of time to wait for the next packet (in milleseconds).
     * @return the next available packet.
     * @throws NoResponseException if there was no response from the server.
     * @throws XMPPErrorException in case an error response.
     * @throws InterruptedException
     */
    public
 P nextResultOrThrow(long timeout) throws NoResponseException, XMPPErrorException, InterruptedException {
        P result = nextResult(timeout);
        cancel();
        if (result == null) {
            throw NoResponseException.newWith(connection, this);
        }

        XMPPErrorException.ifHasErrorThenThrow(result);

        return result;
    }

    /**
     * Get the number of collected stanzas this packet collector has collected so far.
     *
     * @return the count of collected stanzas.
     * @since 4.1
     */
    public int getCollectedCount() {
        return resultQueue.size();
    }

    /**
     * Processes a packet to see if it meets the criteria for this packet collector.
     * If so, the packet is added to the result queue.
     *
     * @param packet the packet to process.
     */
    protected void processPacket(Stanza packet) {
        if (packetFilter == null || packetFilter.accept(packet)) {
        	while (!resultQueue.offer(packet)) {
        		// Since we know the queue is full, this poll should never actually block.
        		resultQueue.poll();
        	}
            if (collectorToReset != null) {
                collectorToReset.waitStart = System.currentTimeMillis();
            }
        }
    }

    private final void throwIfCancelled() {
        if (cancelled) {
            throw new IllegalStateException("Packet collector already cancelled");
        }
    }

    /**
     * Get a new packet collector configuration instance.
     *
     * @return a new packet collector configuration.
     */
    public static Configuration newConfiguration() {
        return new Configuration();
    }

    public static class Configuration {
        private PacketFilter packetFilter;
        private int size = SmackConfiguration.getPacketCollectorSize();
        private PacketCollector collectorToReset;

        private Configuration() {
        }

        /**
         * Set the packet filter used by this collector. If null, then all packets will
         * get collected by this collector.
         *
         * @param packetFilter
         * @return a reference to this configuration.
         */
        public Configuration setPacketFilter(PacketFilter packetFilter) {
            this.packetFilter = packetFilter;
            return this;
        }

        /**
         * Set the maximum size of this collector, i.e. how many stanzas this collector will collect
         * before dropping old ones.
         *
         * @param size
         * @return a reference to this configuration.
         */
        public Configuration setSize(int size) {
            this.size = size;
            return this;
        }

        /**
         * Set the collector which timeout for the next result is reset once this collector collects
         * a packet.
         *
         * @param collector
         * @return a reference to this configuration.
         */
        public Configuration setCollectorToReset(PacketCollector collector) {
            this.collectorToReset = collector;
            return this;
        }
    }
}


text:
import { DataSourceInstanceSettings, DataSourcePluginMeta } from '@grafana/data';
import { GoogleAuthType } from '@grafana/google-sdk';

import { CloudMonitoringOptions } from '../types';

export const createMockInstanceSetttings = (
  overrides?: Partial<DataSourceInstanceSettings<CloudMonitoringOptions>>
): DataSourceInstanceSettings<CloudMonitoringOptions> => ({
  url: '/ds/1',
  id: 1,
  uid: 'abc',
  type: 'stackdriver',
  access: 'proxy',
  meta: {} as DataSourcePluginMeta,
  name: 'stackdriver',

  jsonData: {
    authenticationType: GoogleAuthType.JWT,
    defaultProject: 'test-project',
    gceDefaultProject: 'test-project',
    clientEmail: 'test-email@test.com',
    tokenUri: 'https://oauth2.googleapis.com/token',
  },
  ...overrides,
});


text:
export { connect } from './connect';
export { Provider } from './provider';
export { formize } from './formize';
export request from './request';
export { observer } from 'mobx-react';
export { MatchAsMember, MatchAsGuest } from './routing';
export { observable, extendObservable, action, computed, toJS, asMap } from 'mobx';


text:
package mm.tstring.objects;

public class FileTString extends TString
{
    private final long length;

    private final long offset;

    /**
     * The constructor constructs a TString-object with the
     * specified index and value.
     *
     * @param value  The String value of this TString
     * @param index  The index.
     * @param offset The starting character of the index part
     * @param length The length of the index part
     */
    public FileTString(String value, int index, long offset, long length)
    {
        super(value, index);
        this.offset = offset;
        this.length = length;
    }

    public long getIndexLength()
    {
        return length;
    }

    public long getIndexOffset()
    {
        return offset;
    }
}


text:
sap.ui.define(['sap/f/semantic/SemanticButton'], function(SemanticButton) {
	"use strict";

	/**
	* Constructor for a new SendEmailAction.
	* @param {string} [sId] ID for the new control, generated automatically if no ID is given
	* @param {object} [mSettings] Optional initial settings for the new control:  a map/JSON-object with initial property values, event listeners etc. for the new object
	*
	* @class
	* A semantic-specific button, eligible for the sendEmailAction aggregation of the
	* {@link sap.f.semantic.SemanticPage} to be placed in the share menu within its title.
	*
	* @extends sap.f.semantic.SemanticButton
	*
	* @author SAP SE
	* @version ${version}
	*
	* @constructor
	* @public
	* @since 1.46.0
	* @alias sap.f.semantic.SendEmailAction
	*/
	var SendEmailAction = SemanticButton.extend("sap.f.semantic.SendEmailAction", /** @lends sap.f.semantic.SendEmailAction.prototype */ {
		metadata: {
			library: "sap.f"
		}
	});

	return SendEmailAction;
});


text:
using System;
using System.Linq.Expressions;
using Marten.Internal;
using Marten.Linq.SqlGeneration;
using Marten.Transforms;
using Remotion.Linq.Clauses;
using Remotion.Linq.Clauses.ResultOperators;
using Remotion.Linq.Clauses.StreamedData;

namespace Marten.Linq.Operators
{
    public class AsJsonResultOperator
        : SequenceTypePreservingResultOperatorBase, ISelectableOperator
    {
        public static readonly AsJsonResultOperator Flyweight = new AsJsonResultOperator(null);

        public AsJsonResultOperator(Expression parameter)
        {
            Parameter = parameter;
        }

        public Expression Parameter { get; private set; }

        public override ResultOperatorBase Clone(CloneContext cloneContext)
        {
            return new AsJsonResultOperator(Parameter);
        }

        public override void TransformExpressions(
            Func<Expression, Expression> transformation)
        {
            Parameter = transformation(Parameter);
        }

        public override StreamedSequence ExecuteInMemory<T>(StreamedSequence input)
        {
            return input;
        }

        public SelectorStatement ModifyStatement(SelectorStatement statement, IMartenSession session)
        {
            statement.ToJsonSelector();

            return statement;
        }
    }
}


text:
package com.orientechnologies.common.concur.lock;

import com.orientechnologies.common.exception.OException;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class ONotThreadRWLockManager<T> implements OSimpleRWLockManager<T> {

  private static class LockGuard {
    private volatile int count;
    private final Condition condition;
    private final boolean shared;

    public LockGuard(int count, Condition condition, boolean shared) {
      this.count = count;
      this.condition = condition;
      this.shared = shared;
    }
  }

  private final Lock lock = new ReentrantLock();
  private final Map<T, LockGuard> map = new ConcurrentHashMap<>();

  public ONotThreadRWLockManager() {}

  public void lock(T key, boolean shared, long timeout) {

    lock.lock();
    try {
      try {

        LockGuard c;
        do {
          c = map.get(key);
          if (c != null) {
            if (c.shared && shared) {
              c.count++;
              return;
            } else {
              if (timeout == 0) {
                c.condition.await();
              } else {
                if (!c.condition.await(timeout, TimeUnit.MILLISECONDS)) {
                  throw new OLockException(
                      String.format("Time out acquire lock for resource: '%s' ", key));
                }
              }
            }
          }
        } while (c != null);
        c = new LockGuard(1, lock.newCondition(), shared);
        map.put(key, c);
      } catch (InterruptedException e) {
        throw OException.wrapException(new OInterruptedException("Interrupted Lock"), e);
      }
    } finally {
      lock.unlock();
    }
  }

  public void unlock(T key, boolean shared) {
    lock.lock();
    try {
      LockGuard c = map.get(key);
      assert c != null;
      if (c.shared != shared) {
        throw new OLockException("Impossible to release a not acquired lock");
      }
      c.count--;
      if (c.count == 0) {
        map.remove(key);
        c.condition.signalAll();
      }
    } finally {
      lock.unlock();
    }
  }

  @Override
  public void acquireReadLock(T key, long timeout) {
    lock(key, true, timeout);
  }

  @Override
  public void acquireWriteLock(T key, long timeout) {
    lock(key, false, timeout);
  }

  @Override
  public void releaseReadLock(T key) {
    unlock(key, true);
  }

  @Override
  public void releaseWriteLock(T key) {
    unlock(key, false);
  }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using InfiniteCity.Model;
using InfiniteCity.Model.Enums;
using Microsoft.Xna.Framework.Graphics;

namespace InfiniteCity.Tests.Model
{
    internal class MockTile : Tile
    {
        private readonly string _building;
        private readonly string _rules;

        public MockTile() : this("Façade", string.Empty) {}

        public MockTile(string building, string rules)
        {
            _building = building;
            _rules = rules;
        }

        /// <summary>
        ///   Gets or sets the texture of this type of tile.
        /// </summary>
        public static Texture2D TileTexture { get; set; }

        /// <summary>
        ///   Gets the name of this tile's building.
        /// </summary>
        public override string Building
        {
            get { return _building; }
        }

        /// <summary>
        ///   Gets the rules text of this tile.
        /// </summary>
        public override string Rules
        {
            get { return _rules; }
        }

        /// <summary>
        ///   Gets the texture of this tile.
        /// </summary>
        public override Texture2D Texture
        {
            get { return TileTexture; }
        }

        /// <summary>
        ///   Resets the tile's active state.
        /// </summary>
        internal override void Reset() {}

        /// <summary>
        ///   Reverts the tile's active state.
        /// </summary>
        internal override Selection Revert()
        {
            return Selection.None;
        }

        /// <summary>
        ///   Skips the current selection.
        /// </summary>
        internal override Selection Skip()
        {
            return Selection.None;
        }

        internal override Exception TryValidateInput(object input)
        {
            return null;
        }
    }
}


text:
layout: doc
title: Documentation
---

The node you are looking for is at EasyCrypt customizations.


text:
/*****************************************************************************

        test.cpp
        By Laurent de Soras

--- Legal stuff ---

This program is free software. It comes without any warranty, to
the extent permitted by applicable law. You can redistribute it
and/or modify it under the terms of the Do What The Fuck You Want
To Public License, Version 2, as published by Sam Hocevar. See
http://sam.zoy.org/wtfpl/COPYING for more details.

*Tab=3***********************************************************************/

#if defined (_MSC_VER)
	#pragma warning (4 : 4786) // "identifier was truncated to '255' characters in the debug information"
	#pragma warning (4 : 4800) // "forcing value to bool 'true' or 'false' (performance warning)"
#endif

/*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/

#include	"ffft/test/conf.h"
#include	"ffft/test/TestHelperFixLen.h"
#include	"ffft/test/TestHelperNormal.h"

#if defined (_MSC_VER)
#include	<crtdbg.h>
#include	<new.h>
#endif	// _MSC_VER

#include	<new>

#include	<cassert>
#include	<cstdio>

/*\\\ FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/

static int	TEST_perform_test_accuracy_all ();
static int	TEST_perform_test_speed_all ();

static void	TEST_prog_init ();
static void	TEST_prog_end ();

int main (int argc, char *argv [])
{
	using namespace std;

	int				ret_val = 0;

	TEST_prog_init ();

	try
	{
		if (ret_val == 0)
		{
			ret_val = TEST_perform_test_accuracy_all ();
		}

		if (ret_val == 0)
		{
			ret_val = TEST_perform_test_speed_all ();
		}
	}

	catch (std::exception &e)
	{
		printf ("\n*** main(): Exception (std::exception) : %s\n", e.what ());
		ret_val = -1;
	}

	catch (...)
	{
		printf ("\n*** main(): Undefined exception\n");
		ret_val = -1;
	}

	TEST_prog_end ();

	return (ret_val);
}

int	TEST_perform_test_accuracy_all ()
{
   int            ret_val = 0;

	ffft::test::TestHelperNormal <float >::perform_test_accuracy (ret_val);
	ffft::test::TestHelperNormal <double>::perform_test_accuracy (ret_val);

   ffft::test::TestHelperFixLen < 1>::perform_test_accuracy (ret_val);
   ffft::test::TestHelperFixLen < 2>::perform_test_accuracy (ret_val);
   ffft::test::TestHelperFixLen < 3>::perform_test_accuracy (ret_val);
   ffft::test::TestHelperFixLen < 4>::perform_test_accuracy (ret_val);
   ffft::test::TestHelperFixLen < 7>::perform_test_accuracy (ret_val);
   ffft::test::TestHelperFixLen < 8>::perform_test_accuracy (ret_val);
   ffft::test::TestHelperFixLen <10>::perform_test_accuracy (ret_val);
   ffft::test::TestHelperFixLen <12>::perform_test_accuracy (ret_val);
   ffft::test::TestHelperFixLen <13>::perform_test_accuracy (ret_val);

	return (ret_val);
}

int	TEST_perform_test_speed_all ()
{
   int            ret_val = 0;

#if defined (ffft_test_SPEED_TEST_ENABLED)

	ffft::test::TestHelperNormal <float >::perform_test_speed (ret_val);
	ffft::test::TestHelperNormal <double>::perform_test_speed (ret_val);

   ffft::test::TestHelperFixLen < 1>::perform_test_speed (ret_val);
   ffft::test::TestHelperFixLen < 2>::perform_test_speed (ret_val);
   ffft::test::TestHelperFixLen < 3>::perform_test_speed (ret_val);
   ffft::test::TestHelperFixLen < 4>::perform_test_speed (ret_val);
   ffft::test::TestHelperFixLen < 7>::perform_test_speed (ret_val);
   ffft::test::TestHelperFixLen < 8>::perform_test_speed (ret_val);
   ffft::test::TestHelperFixLen <10>::perform_test_speed (ret_val);
   ffft::test::TestHelperFixLen <12>::perform_test_speed (ret_val);
   ffft::test::TestHelperFixLen <14>::perform_test_speed (ret_val);
   ffft::test::TestHelperFixLen <16>::perform_test_speed (ret_val);
   ffft::test::TestHelperFixLen <20>::perform_test_speed (ret_val);

#endif

   return (ret_val);
}

#if defined (_MSC_VER)
static int __cdecl	TEST_new_handler_cb (size_t dummy)
{
	throw std::bad_alloc ();
	return (0);
}
#endif	// _MSC_VER

#if defined (_MSC_VER) && ! defined (NDEBUG)
static int	__cdecl	TEST_debug_alloc_hook_cb (int alloc_type, void *user_data_ptr, size_t size, int block_type, long request_nbr, const unsigned char *filename_0, int line_nbr)
{
	if (block_type != _CRT_BLOCK)	// Ignore CRT blocks to prevent infinite recursion
	{
		switch (alloc_type)
		{
		case	_HOOK_ALLOC:
		case	_HOOK_REALLOC:
		case	_HOOK_FREE:

			// Put some debug code here

			break;

		default:
			assert (false);	// Undefined allocation type
			break;
		}
	}

	return (1);
}
#endif

#if defined (_MSC_VER) && ! defined (NDEBUG)
static int	__cdecl	TEST_debug_report_hook_cb (int report_type, char *user_msg_0, int *ret_val_ptr)
{
	*ret_val_ptr = 0;	// 1 to override the CRT default reporting mode

	switch (report_type)
	{
	case	_CRT_WARN:
	case	_CRT_ERROR:
	case	_CRT_ASSERT:

// Put some debug code here

		break;
	}

	return (*ret_val_ptr);
}
#endif

static void	TEST_prog_init ()
{
#if defined (_MSC_VER)
	::_set_new_handler (::TEST_new_handler_cb);
#endif	// _MSC_VER

#if defined (_MSC_VER) && ! defined (NDEBUG)
	{
		const int	mode =   (1 * _CRTDBG_MODE_DEBUG)
						       | (1 * _CRTDBG_MODE_WNDW);
		::_CrtSetReportMode (_CRT_WARN, mode);
		::_CrtSetReportMode (_CRT_ERROR, mode);
		::_CrtSetReportMode (_CRT_ASSERT, mode);

		const int	old_flags = ::_CrtSetDbgFlag (_CRTDBG_REPORT_FLAG);
		::_CrtSetDbgFlag (  old_flags
		                  | (1 * _CRTDBG_LEAK_CHECK_DF)
		                  | (1 * _CRTDBG_CHECK_ALWAYS_DF));
		::_CrtSetBreakAlloc (-1);	// Specify here a memory bloc number
		::_CrtSetAllocHook (TEST_debug_alloc_hook_cb);
		::_CrtSetReportHook (TEST_debug_report_hook_cb);

		// Speed up I/O but breaks C stdio compatibility
//		std::cout.sync_with_stdio (false);
//		std::cin.sync_with_stdio (false);
//		std::cerr.sync_with_stdio (false);
//		std::clog.sync_with_stdio (false);
	}
#endif	// _MSC_VER, NDEBUG
}

static void	TEST_prog_end ()
{
#if defined (_MSC_VER) && ! defined (NDEBUG)
	{
		const int	mode =   (1 * _CRTDBG_MODE_DEBUG)
						       | (0 * _CRTDBG_MODE_WNDW);
		::_CrtSetReportMode (_CRT_WARN, mode);
		::_CrtSetReportMode (_CRT_ERROR, mode);
		::_CrtSetReportMode (_CRT_ASSERT, mode);

		::_CrtMemState	mem_state;
		::_CrtMemCheckpoint (&mem_state);
		::_CrtMemDumpStatistics (&mem_state);
	}
#endif	// _MSC_VER, NDEBUG
}

/*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/


text:
package org.phenoscape.owl

import org.openrdf.model.URI
import org.openrdf.repository.sail.SailRepositoryConnection
import org.openrdf.rio.RDFFormat
import org.phenoscape.kb.ingest.util.OBOUtil
import org.phenoscape.owl.util.NullIRIMapper
import org.semanticweb.elk.owlapi.ElkReasonerFactory
import org.semanticweb.owlapi.apibinding.OWLManager
import org.semanticweb.owlapi.formats.{RDFXMLDocumentFormat, RioRDFXMLDocumentFormat}
import org.semanticweb.owlapi.io.FileDocumentTarget
import org.semanticweb.owlapi.model._
import org.semanticweb.owlapi.model.parameters.Imports
import org.semanticweb.owlapi.reasoner.OWLReasoner

import java.io.{ByteArrayInputStream, ByteArrayOutputStream, File}
import java.util.Date
import scala.jdk.CollectionConverters._

class KnowledgeBaseBuilder extends App {

  private[this] val globalManager = OWLManager.createOWLOntologyManager
  globalManager.clearIRIMappers()
  globalManager.addIRIMapper(NullIRIMapper)

  def getManager: OWLOntologyManager = globalManager

  def iri(string: String): IRI = IRI.create(string)

  def combine(ontologies: OWLOntology*): OWLOntology =
    if (ontologies.size == 1)
      ontologies(0)
    else {
      val newManager = OWLManager.createOWLOntologyManager
      newManager.createOntology(ontologies.flatMap(_.getAxioms().asScala).toSet.asJava)
    }

  def combine(ontology: SourcedAxioms, ontologies: SourcedAxioms*): OWLOntology =
    OWLManager.createOWLOntologyManager().createOntology((ontology.axioms ++ ontologies.flatMap(_.axioms)).asJava)

  def reasoner(ontologies: OWLOntology*): OWLReasoner = {
    val allAxioms = combine(ontologies: _*)
    new ElkReasonerFactory().createReasoner(allAxioms)
  }

  def reasoner(axioms: Set[OWLAxiom]): OWLReasoner =
    new ElkReasonerFactory().createReasoner(OWLManager.createOWLOntologyManager().createOntology(axioms.asJava))

  def loadNormalized(location: File): OWLOntology = {
    val ont = globalManager.loadOntologyFromOntologyDocument(location)
    val definedByAxioms = ont.getClassesInSignature().asScala.flatMap(OBOUtil.createDefinedByAnnotation)
    globalManager.addAxioms(ont, definedByAxioms.asJava)
    PropertyNormalizer.normalize(ont)
  }

  def loadFromWeb(iri: IRI, excludeImports: Boolean): SourcedAxioms = {
    val manager = OWLManager.createOWLOntologyManager()
    // Even if we are excluding axioms from imports, we want to initially include imports in case property types rely on declarations there
    val ont = manager.loadOntology(iri)
    if (!excludeImports) {
      val importsAxioms = ont.getImports.asScala.flatMap(_.getAxioms().asScala)
      manager.addAxioms(ont, importsAxioms.asJava)
    }
    val definedByAxioms = ont.getClassesInSignature(Imports.EXCLUDED).asScala.flatMap(OBOUtil.createDefinedByAnnotation)
    manager.addAxioms(ont, definedByAxioms.asJava)
    PropertyNormalizer.normalize(ont)
    SourcedAxioms(ont.getAxioms(Imports.EXCLUDED).asScala.toSet, ont.getOntologyID)
  }

  def write(ontology: OWLOntology, file: File): Unit = {
    val ontManager = ontology.getOWLOntologyManager
    ontManager.saveOntology(ontology, new RDFXMLDocumentFormat(), new FileDocumentTarget(file))
  }

  def step(message: String): Unit =
    println(new Date() + ": " + message)

  def isTboxAxiom(axiom: OWLAxiom): Boolean = axiom.isOfType(AxiomType.TBoxAxiomTypes)

  def addTriples(ontology: OWLOntology, db: SailRepositoryConnection, graph: URI): Unit = {
    val manager = ontology.getOWLOntologyManager
    val outStream = new ByteArrayOutputStream()
    manager.saveOntology(ontology, new RioRDFXMLDocumentFormat(), outStream)
    outStream.close()
    val inStream = new ByteArrayInputStream(outStream.toByteArray)
    db.add(inStream, "", RDFFormat.RDFXML, graph)
    inStream.close()
  }

  def addTriples(axioms: SourcedAxioms, db: SailRepositoryConnection, graph: URI): Unit =
    addTriples(axioms.axioms, db, graph, axioms.ontologyID)

  def addTriples(
    axioms: Iterable[OWLAxiom],
    db: SailRepositoryConnection,
    graph: URI,
    ontID: OWLOntologyID = new OWLOntologyID()
  ): Unit = {
    val manager = OWLManager.createOWLOntologyManager()
    val ont = manager.createOntology(ontID)
    manager.addAxioms(ont, axioms.toSet[OWLAxiom].asJava)
    addTriples(ont, db, graph)
  }

}

case class SourcedAxioms(axioms: Set[OWLAxiom], ontologyID: OWLOntologyID)

object SourcedAxioms {

  def apply(ont: OWLOntology): SourcedAxioms = SourcedAxioms(ont.getAxioms().asScala.toSet, ont.getOntologyID)

}


text:
<!doctype html>

<head>
    <title>TmCookie.tech</title>
    <link href='http://fonts.googleapis.com/css?family=Source+Code+Pro:400,600,700' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" type="text/css" href="styles/jquery.terminal.css">
    <meta name="description" content="Home page of TmCookie" />
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
</head>

<body>
    <script src="js/jquery-1.7.1.min.js" type="text/javascript"></script>
    <script src="js/jquery.mousewheel-min.js" type="text/javascript"></script>
    <script src="js/jquery.terminal-min.js" type="text/javascript"></script>
    <script src="js/main.js" type="text/javascript"></script>
</body>

</html>