text:
#ifndef OSMIUM_OSM_CRC_HPP
#define OSMIUM_OSM_CRC_HPP

#include <cstdint>

#include <osmium/osm/area.hpp>
#include <osmium/osm/box.hpp>
#include <osmium/osm/changeset.hpp>
#include <osmium/osm/item_type.hpp>
#include <osmium/osm/location.hpp>
#include <osmium/osm/node.hpp>
#include <osmium/osm/node_ref.hpp>
#include <osmium/osm/node_ref_list.hpp>
#include <osmium/osm/object.hpp>
#include <osmium/osm/relation.hpp>
#include <osmium/osm/tag.hpp>
#include <osmium/osm/timestamp.hpp>
#include <osmium/osm/way.hpp>
#include <osmium/util/endian.hpp>

namespace osmium {

    namespace util {

        inline uint16_t byte_swap_16(uint16_t value) noexcept {
# if defined(__GNUC__) || defined(__clang__)
            return __builtin_bswap16(value);
# else
            return (value >> 8) | (value << 8);
# endif
        }

        inline uint32_t byte_swap_32(uint32_t value) noexcept {
# if defined(__GNUC__) || defined(__clang__)
            return __builtin_bswap32(value);
# else
            return  (value >> 24) |
                   ((value >>  8) & 0x0000FF00) |
                   ((value <<  8) & 0x00FF0000) |
                    (value << 24);
# endif
        }

        inline uint64_t byte_swap_64(uint64_t value) noexcept {
# if defined(__GNUC__) || defined(__clang__)
            return __builtin_bswap64(value);
# else
            const uint64_t val1 = byte_swap_32(value & 0xFFFFFFFF);
            const uint64_t val2 = byte_swap_32(value >> 32);
            return (val1 << 32) | val2;
# endif
        }

    } // namespace util

    template <typename TCRC>
    class CRC {

        TCRC m_crc;

    public:

        TCRC& operator()() noexcept {
            return m_crc;
        }

        const TCRC& operator()() const noexcept {
            return m_crc;
        }

        void update_bool(const bool value) noexcept {
            m_crc.process_byte(value);
        }

        void update_int8(const uint8_t value) noexcept {
            m_crc.process_byte(value);
        }

        void update_int16(const uint16_t value) noexcept {
#if __BYTE_ORDER == __LITTLE_ENDIAN
            m_crc.process_bytes(&value, sizeof(uint16_t));
#else
            const uint16_t v = osmium::util::byte_swap_16(value);
            m_crc.process_bytes(&v, sizeof(uint16_t));
#endif
        }

        void update_int32(const uint32_t value) noexcept {
#if __BYTE_ORDER == __LITTLE_ENDIAN
            m_crc.process_bytes(&value, sizeof(uint32_t));
#else
            const uint32_t v = osmium::util::byte_swap_32(value);
            m_crc.process_bytes(&v, sizeof(uint32_t));
#endif
        }

        void update_int64(const uint64_t value) noexcept {
#if __BYTE_ORDER == __LITTLE_ENDIAN
            m_crc.process_bytes(&value, sizeof(uint64_t));
#else
            const uint64_t v = osmium::util::byte_swap_64(value);
            m_crc.process_bytes(&v, sizeof(uint64_t));
#endif
        }

        void update_string(const char* str) noexcept {
            while (*str) {
                m_crc.process_byte(*str++);
            }
        }

        void update(const Timestamp& timestamp) noexcept {
            update_int32(uint32_t(timestamp));
        }

        void update(const osmium::Location& location) noexcept {
            update_int32(location.x());
            update_int32(location.y());
        }

        void update(const osmium::Box& box) noexcept {
            update(box.bottom_left());
            update(box.top_right());
        }

        void update(const NodeRef& node_ref) noexcept {
            update_int64(node_ref.ref());
            update(node_ref.location());
        }

        void update(const NodeRefList& node_refs) noexcept {
            for (const NodeRef& node_ref : node_refs) {
                update(node_ref);
            }
        }

        void update(const TagList& tags) noexcept {
            for (const Tag& tag : tags) {
                update_string(tag.key());
                update_string(tag.value());
            }
        }

        void update(const osmium::RelationMember& member) noexcept {
            update_int64(member.ref());
            update_int16(uint16_t(member.type()));
            update_string(member.role());
        }

        void update(const osmium::RelationMemberList& members) noexcept {
            for (const RelationMember& member : members) {
                update(member);
            }
        }

        void update(const osmium::OSMObject& object) noexcept {
            update_int64(object.id());
            update_bool(object.visible());
            update_int32(object.version());
            update(object.timestamp());
            update_int32(object.uid());
            update_string(object.user());
            update(object.tags());
        }

        void update(const osmium::Node& node) noexcept {
            update(static_cast<const osmium::OSMObject&>(node));
            update(node.location());
        }

        void update(const osmium::Way& way) noexcept {
            update(static_cast<const osmium::OSMObject&>(way));
            update(way.nodes());
        }

        void update(const osmium::Relation& relation) noexcept {
            update(static_cast<const osmium::OSMObject&>(relation));
            update(relation.members());
        }

        void update(const osmium::Area& area) noexcept {
            update(static_cast<const osmium::OSMObject&>(area));
            for (const auto& subitem : area) {
                if (subitem.type() == osmium::item_type::outer_ring ||
                    subitem.type() == osmium::item_type::inner_ring) {
                    update(static_cast<const osmium::NodeRefList&>(subitem));
                }
            }
        }

        void update(const osmium::ChangesetDiscussion& discussion) noexcept {
            for (const auto& comment : discussion) {
                update(comment.date());
                update_int32(comment.uid());
                update_string(comment.user());
                update_string(comment.text());
            }
        }

        void update(const osmium::Changeset& changeset) noexcept {
            update_int64(changeset.id());
            update(changeset.created_at());
            update(changeset.closed_at());
            update(changeset.bounds());
            update_int32(changeset.num_changes());
            update_int32(changeset.num_comments());
            update_int32(changeset.uid());
            update_string(changeset.user());
            update(changeset.tags());
            update(changeset.discussion());
        }

    }; // class CRC

} // namespace osmium

#endif // OSMIUM_OSM_CRC


text:
/*
 * 修订记录:
 * qiubo@yiji.com 2015-04-27 11:25 创建
 *
 */
package com.yiji.framework.watcher.http.metrics;

import java.util.List;
import java.util.Map;

import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
import javax.management.ObjectName;

import com.yiji.framework.watcher.WatcherException;
import com.yiji.framework.watcher.metrics.base.AbstractCachedWatcherMetrics;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.collect.Maps;

/**
 * @author qiubo@yiji.com
 */
public class WebContainerMetrics extends AbstractCachedWatcherMetrics {
	private static final Logger logger = LoggerFactory.getLogger(WebContainerMetrics.class);
	private static final String tomcatEmbedDomain = "Tomcat";
	private static final String tomcatDomain = "Catalina";

	public Object doMonitor(Map<String, Object> params) {
		Map<String, Object> map = Maps.newHashMap();

		List<MBeanServer> mBeanServers = MBeanServerFactory.findMBeanServer(null);
		if (!mBeanServers.isEmpty()) {
			MBeanServer mBeanServer = mBeanServers.get(0);
			String domain = getTomcatDomian(mBeanServer);
			try {

				ObjectName[] objNames = (ObjectName[]) mBeanServer.getAttribute(new ObjectName(domain, "type", "Service"), "connectorNames");
				for (ObjectName on : objNames) {
					Map<String, Object> connector = Maps.newHashMap();
					Object protocol = mBeanServer.getAttribute(on, "protocol");
					connector.put("protocol", protocol);
					Object acceptCount = mBeanServer.getAttribute(on, "acceptCount");
					connector.put("acceptCount", acceptCount);

					Object connectionTimeout = mBeanServer.getAttribute(on, "connectionTimeout");
					connector.put("connectionTimeout", connectionTimeout);

					Object protocolHandlerClassName = mBeanServer.getAttribute(on, "protocolHandlerClassName");
					connector.put("protocolHandlerClassName", protocolHandlerClassName);

					Object enableLookups = mBeanServer.getAttribute(on, "enableLookups");
					connector.put("enableLookups", enableLookups);

					Object uriEncoding = mBeanServer.getAttribute(on, "URIEncoding");
					connector.put("URIEncoding", uriEncoding);

					Object useBodyEncodingForURI = mBeanServer.getAttribute(on, "useBodyEncodingForURI");
					connector.put("useBodyEncodingForURI", useBodyEncodingForURI);

					Object localPort = mBeanServer.getAttribute(on, "localPort");
					map.put("connector-" + localPort, connector);

					if (protocolHandlerClassName.toString().equals("org.apache.coyote.http11.Http11NioProtocol")) {
						String threadPoolONStr = domain + ":type=ThreadPool,name=\"http-nio-" + localPort + "\"";
						ObjectName threadPoolON = new ObjectName(threadPoolONStr);
						Map<String, Object> threadPoolMap = Maps.newHashMap();

						Object connectionCount = mBeanServer.getAttribute(threadPoolON, "connectionCount");
						threadPoolMap.put("connectionCount", connectionCount);

						Object currentThreadCount = mBeanServer.getAttribute(threadPoolON, "currentThreadCount");
						threadPoolMap.put("currentThreadCount", currentThreadCount);

						Object currentThreadsBusy = mBeanServer.getAttribute(threadPoolON, "currentThreadsBusy");
						threadPoolMap.put("currentThreadsBusy", currentThreadsBusy);

						Object keepAliveCount = mBeanServer.getAttribute(threadPoolON, "keepAliveCount");
						threadPoolMap.put("keepAliveCount", keepAliveCount);

						Object maxConnections = mBeanServer.getAttribute(threadPoolON, "maxConnections");
						threadPoolMap.put("maxConnections", maxConnections);

						Object maxThreads = mBeanServer.getAttribute(threadPoolON, "maxThreads");
						threadPoolMap.put("maxThreads", maxThreads);

						Object minSpareThreads = mBeanServer.getAttribute(threadPoolON, "minSpareThreads");
						threadPoolMap.put("minSpareThreads", minSpareThreads);
						connector.put("threadPool", threadPoolMap);
					}
				}
			} catch (Exception e) {
				logger.warn("获取信息失败", e);
                throw WatcherException.throwIt(e);
			}
		}
		return map;
	}

	@Override
	public CacheTime getCacheTime() {
		return CacheTime.THIRTY_SECOND;
	}

	private String getTomcatDomian(MBeanServer mBeanServer) {
		try {
			mBeanServer.getAttribute(new ObjectName(tomcatEmbedDomain, "type", "Service"), "connectorNames");
			return tomcatEmbedDomain;
		} catch (Exception e) {
			return tomcatDomain;
		}
	}

	public String name() {
		return "webContainer";
	}

	public String desc() {
		return "web container info";
	}
}

redpajama_set_name: RedPajamaGithub


text:
pghoard |BuildStatus|_
======================

.. |BuildStatus| image:: https://travis-ci.org/ohmu/pghoard.png?branch=master
.. _BuildStatus: https://travis-ci.org/ohmu/pghoard

pghoard is a PostgreSQL backup/restore service, it consists of a daemon
process and a restore client.

PostgreSQL Point In Time Replication (PITR) consists of a having a database
basebackup and changes after that point go into WAL log files that can be
replayed to get to the desired replication point.

pghoard supports multiple operating models. The basic mode where you have a
separate backup machine, pghoard can simply connect with pg_receivexlog to
receive WAL files from the database as they're written.  Another model is to
use pghoard_archive_command as a PostgreSQL archive_command.

With both modes of operations pghoard creates basebackups using
pg_basebackup that is run against the database in question.

pghoard compresses the received WAL logs and basebackups with LZMA (level 0)
in order to ensure good compression speed and relatively small backup size.

pghoard also supports backing up and restoring from either a local machine
or from various object stores (AWS S3, Azure, Ceph, Google Cloud.)

In case you just have a single database machine, it is heavily recommended
to let pghoard backup the files into an object storage service, so in case
the machine where it's running is incapacitated, there's still access to the
database backups.

Building
========

To build an installation package for your distribution, go to the root
directory of a pghoard Git checkout and then run:

Debian::

  make deb

This will produce a .deb package into the parent directory of the Git
checkout.

Fedora::

  make rpm

This will produce a .rpm package usually into ~/rpmbuild/RPMS/noarch/ .

Python/Other::

  python setup.py bdist_egg

This will produce an egg file into a dist directory within the same folder.

pghoard requires Python 2.7 or 3.4 or newer.

Installation
============

To install it run as root:

Debian::

  dpkg -i ../pghoard*.deb

Fedora::

  rpm -Uvh ~/rpmbuild/RPMS/noarch/pghoard*

On Fedora it is recommended to simply run pghoard under systemd::

  systemctl enable pghoard.service

and eventually after the setup section, you can just run::

  systemctl start pghoard.service

Python/Other::

  easy_install dist/pghoard-0.9.0-py2.7.egg

On Debian/Other systems it is recommended that you run pghoard within a
supervisord (http://supervisord.org) Process control system.  (see examples
directory for an example supervisord.conf)

Setup
=====

After this you need to create a suitable JSON configuration file for your
installation.

1. Create a suitable PostgreSQL user account for pghoard::

     CREATE USER pghoard PASSWORD 'putyourpasswordhere';

2. Edit the local ``pg_hba.conf`` to allow access for the newly created
   account to the ``postgres`` (or other suitable database of your choice)
   from the master, slave and possible observer nodes.  While pghoard will
   only need to run a few builtin functions within the database, it is still
   recommended to setup a separate empty database for this use.  Remember to
   reload the configuration with either::

     SELECT pg_reload_conf();

   or by sending directly a ``SIGHUP`` to the PostgreSQL postmaster process.

3. Fill in the created user account and master/slave addresses into the
   configuration file ``pghoard.json`` to the section ``backup_sites``.

4. Fill in the possible object storage user credentials into the
   configuration file ``pghoard.json`` under section "object_storage"
   in case you wish pghoard to back up into the cloud.

5. Now copy the same ``pghoard.json`` configuration to the slave and
   possible observer nodes but you need to edit the configuration on the
   other nodes so that the ``own_db`` configuration variable matches the
   node's address given in the ``remote_conns`` as the key.  For observer
   nodes, you can leave it as an empty '' value, since they don't have a DB
   of their own.

Other possible configuration settings are covered in more detail under the
`Configuration keys`_ section of this README.

6. If all has been set up correctly up to this point, pghoard should now be
   ready to be started.

Alert files
===========

Alert files are created whenever an error condition that requires human
intervention to solve.  You're recommended to add checks for the existence
of these files to your alerting system.

``authentication_error``

There has been a problem in the authentication of at least one of the
PostgreSQL connections.  This usually denotes a wrong username and/or
password.

``pg_hba_conf_error``

There has been a problem in the authentication of at least one of the
PostgreSQL connections.  This usually denotes a missing pg_hba conf entry.

``version_mismatch_error``

Your local PostgreSQL client versions of pg_basebackup or pg_receivexlog do
not match with the servers PostgreSQL version.  You need to update them to
be on the same version level.

``version_unsupported_error``

Server PostgreSQL versions is not supported.

General notes
=============

If correctly installed, pghoard comes with three executables, ``pghoard``,
``pghoard_restore`` and ``pghoard_archivecommand``.

``pghoard`` is the main process that should be run under systemd or
supervisord.  It handles the backup of the configured sites.

``pghoard_restore`` is a command line tool that can be used to restore a
previous database backup from either pghoard itself or from one of the
supported object stores.

``pghoard_archivecommand`` is a command line tool that can be used to
restore a previous database backup.  In essence, it just calls pghoard's
webserver to let it know there's a new file.  It must also be configured on
the ``postgresql.conf`` side to be the ``archive_command``.

While pghoard is running it may be useful to read the JSON state file
``pghoard_state.json`` that exists where ``json_state_file_path`` points.
The JSON state file is human readable and is meant to describe the current
state of pghoard's backup activities.

Configuration keys
==================

``active_backup_mode`` (no default)

Can be either ``pg_receivexlog`` or ``archive_command``. If set to
``pg_receivexlog``, pghoard will start up a ``pg_receivexlog`` process to be
run against the database server.  If archive_command is set, we rely on the
user setting the correct pg_archive_command

``backup_location`` (no default)

Place where pghoard will create its internal data structures for local state
data and the actual backups.  (if no object storage is used)

``backup_sites`` (default ``{}``)

This object contains names and configurations for the different PostgreSQL
clusters (here called ``sites``) from which to take backups.  Each site's
configuration must list one or more nodes (under the configuration key
``nodes``) from which the backups are taken.  A node can be described as an
object of libpq key: value connection info pairs or libpq connection string
or a postgres:// connection uri.

``pg_xlog_directory`` (default ``""``)

This is used when using a PostgreSQL  archive_command against pghoard. It
means the absolute path to the PostgreSQL pg_xlog directory.  Note that
pghoard will need to be able to read files from the directory in order to
back them up.

``http_address`` (default ``""``)

HTTP webserver address, by default pghoard binds to all available addresses.

``http_port`` (default ``16000``)

HTTP webserver port. Used for the archive command and for fetching of
basebackups/WAL's when restoring if not using an object store.

``basebackup_count`` (default ``1``)

How many basebackups should be kept around for restoration purposes.  The
more there are the more diskspace will be used.

``basebackup_interval_hours`` (no default)

How often to take a new basebackup of a cluster. The shorter the interval,
the faster your recovery will be, but the more CPU/IO usage from the servers
it takes to take a basebackup.

``maintenance_mode_file`` (default ``"/tmp/pghoard_maintenance_mode_file"``)

If a file exists in this location, no new backup actions will be started.

``alert_file_dir`` (default ``os.getcwd()``)

Directory in which alert files for replication warning and failover are
created.

``json_state_file_path`` (default ``"/tmp/pghoard_state.json"``)

Location of a JSON state file which describes the state of the pghoard
process.

``log_level`` (default ``"INFO"``)

Determines log level of pghoard.

``pg_basebackup_path`` (default ``/usr/bin/pg_basebackup``)

Determines the path where to find the correct pg_basebackup binary.

``pg_receivexlog_path`` (default ``/usr/bin/pg_receivexlog``)

Determines the path where to find the correct pg_receivexlog binary.

``syslog`` (default ``false``)

Determines whether syslog logging should be turned on or not.

``syslog_address`` (default ``"/dev/log"``)

Determines syslog address to use in logging (requires syslog to be true as
well)

``syslog_facility`` (default ``"local2"``)

Determines syslog log facility. (requires syslog to be true as well)

License
=======

pghoard is licensed under the Apache License, Version 2.0. Full license text
is available in the ``LICENSE`` file and at
http://www.apache.org/licenses/LICENSE-2.0.txt

Credits
=======

pghoard was created by Hannu Valtonen <hannu.valtonen@ohmu.fi> and is now
maintained by Ohmu Ltd's hackers <opensource@ohmu.fi>.

Recent contributors are listed on the GitHub project page,
https://github.com/ohmu/pghoard/graphs/contributors

Contact
=======

Bug reports and patches are very welcome, please post them as GitHub issues
and pull requests at https://github.com/ohmu/pghoard .  Any possible
vulnerabilities or other serious issues should be reported directly to the
maintainers <opensource@ohmu.fi>.

Copyright
=========

Copyright (C) 2015 Ohmu Ltd


text:
using System;
using CoreExampleLibrary;
using Xunit;

namespace CoreExampleLibrary.Tests
{
    public class SomeClassTests
    {
        [Fact]
        public void One()
        {
            Assert.Equal(1, SomeClass.One());
        }
    }
}


text:
package org.eclipse.dd.dc;

import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;

/**
 *
 * The Package for the model.
 * It contains accessors for the meta objects to represent
 *

 *
each class,

 *
each feature of each class,

 *
each enum,

 *
and each data type

 *

 *
 * @see org.eclipse.dd.dc.DcFactory
 * @model kind="package"
 * @generated
 */
public interface DcPackage extends EPackage {
	/**
	 * The package name.
	 *
	 *
	 * @generated
	 */
	String eNAME = "dc";

	/**
	 * The package namespace URI.
	 *
	 *
	 * @generated
	 */
	String eNS_URI = "http://www.omg.org/spec/DD/20100524/DC-XMI";

	/**
	 * The package namespace name.
	 *
	 *
	 * @generated
	 */
	String eNS_PREFIX = "dc";

	/**
	 * The singleton instance of the package.
	 *
	 *
	 * @generated
	 */
	DcPackage eINSTANCE = org.eclipse.dd.dc.impl.DcPackageImpl.init();

	/**
	 * The meta object id for the '{@link org.eclipse.dd.dc.impl.DocumentRootImpl Document Root}' class.
	 *
	 *
	 * @see org.eclipse.dd.dc.impl.DocumentRootImpl
	 * @see org.eclipse.dd.dc.impl.DcPackageImpl#getDocumentRoot()
	 * @generated
	 */
	int DOCUMENT_ROOT = 0;

	/**
	 * The feature id for the 'Mixed' attribute list.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	int DOCUMENT_ROOT__MIXED = 0;

	/**
	 * The feature id for the 'XMLNS Prefix Map' map.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	int DOCUMENT_ROOT__XMLNS_PREFIX_MAP = 1;

	/**
	 * The feature id for the 'XSI Schema Location' map.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	int DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = 2;

	/**
	 * The feature id for the 'Bounds' containment reference.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	int DOCUMENT_ROOT__BOUNDS = 3;

	/**
	 * The feature id for the 'Font' containment reference.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	int DOCUMENT_ROOT__FONT = 4;

	/**
	 * The feature id for the 'Point' containment reference.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	int DOCUMENT_ROOT__POINT = 5;

	/**
	 * The number of structural features of the 'Document Root' class.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	int DOCUMENT_ROOT_FEATURE_COUNT = 6;

	/**
	 * The meta object id for the '{@link org.eclipse.dd.dc.impl.BoundsImpl Bounds}' class.
	 *
	 *
	 * @see org.eclipse.dd.dc.impl.BoundsImpl
	 * @see org.eclipse.dd.dc.impl.DcPackageImpl#getBounds()
	 * @generated
	 */
	int BOUNDS = 1;

	/**
	 * The feature id for the 'Height' attribute.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	int BOUNDS__HEIGHT = 0;

	/**
	 * The feature id for the 'Width' attribute.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	int BOUNDS__WIDTH = 1;

	/**
	 * The feature id for the 'X' attribute.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	int BOUNDS__X = 2;

	/**
	 * The feature id for the 'Y' attribute.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	int BOUNDS__Y = 3;

	/**
	 * The number of structural features of the 'Bounds' class.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	int BOUNDS_FEATURE_COUNT = 4;

	/**
	 * The meta object id for the '{@link org.eclipse.dd.dc.impl.FontImpl Font}' class.
	 *
	 *
	 * @see org.eclipse.dd.dc.impl.FontImpl
	 * @see org.eclipse.dd.dc.impl.DcPackageImpl#getFont()
	 * @generated
	 */
	int FONT = 2;

	/**
	 * The feature id for the 'Is Bold' attribute.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	int FONT__IS_BOLD = 0;

	/**
	 * The feature id for the 'Is Italic' attribute.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	int FONT__IS_ITALIC = 1;

	/**
	 * The feature id for the 'Is Strike Through' attribute.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	int FONT__IS_STRIKE_THROUGH = 2;

	/**
	 * The feature id for the 'Is Underline' attribute.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	int FONT__IS_UNDERLINE = 3;

	/**
	 * The feature id for the 'Name' attribute.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	int FONT__NAME = 4;

	/**
	 * The feature id for the 'Size' attribute.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	int FONT__SIZE = 5;

	/**
	 * The number of structural features of the 'Font' class.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	int FONT_FEATURE_COUNT = 6;

	/**
	 * The meta object id for the '{@link org.eclipse.dd.dc.impl.PointImpl Point}' class.
	 *
	 *
	 * @see org.eclipse.dd.dc.impl.PointImpl
	 * @see org.eclipse.dd.dc.impl.DcPackageImpl#getPoint()
	 * @generated
	 */
	int POINT = 3;

	/**
	 * The feature id for the 'X' attribute.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	int POINT__X = 0;

	/**
	 * The feature id for the 'Y' attribute.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	int POINT__Y = 1;

	/**
	 * The number of structural features of the 'Point' class.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	int POINT_FEATURE_COUNT = 2;

	/**
	 * Returns the meta object for class '{@link org.eclipse.dd.dc.DocumentRoot Document Root}'.
	 *
	 *
	 * @return the meta object for class 'Document Root'.
	 * @see org.eclipse.dd.dc.DocumentRoot
	 * @generated
	 */
	EClass getDocumentRoot();

	/**
	 * Returns the meta object for the attribute list '{@link org.eclipse.dd.dc.DocumentRoot#getMixed Mixed}'.
	 *
	 *
	 * @return the meta object for the attribute list 'Mixed'.
	 * @see org.eclipse.dd.dc.DocumentRoot#getMixed()
	 * @see #getDocumentRoot()
	 * @generated
	 */
	EAttribute getDocumentRoot_Mixed();

	/**
	 * Returns the meta object for the map '{@link org.eclipse.dd.dc.DocumentRoot#getXMLNSPrefixMap XMLNS Prefix Map}'.
	 *
	 *
	 * @return the meta object for the map 'XMLNS Prefix Map'.
	 * @see org.eclipse.dd.dc.DocumentRoot#getXMLNSPrefixMap()
	 * @see #getDocumentRoot()
	 * @generated
	 */
	EReference getDocumentRoot_XMLNSPrefixMap();

	/**
	 * Returns the meta object for the map '{@link org.eclipse.dd.dc.DocumentRoot#getXSISchemaLocation XSI Schema Location}'.
	 *
	 *
	 * @return the meta object for the map 'XSI Schema Location'.
	 * @see org.eclipse.dd.dc.DocumentRoot#getXSISchemaLocation()
	 * @see #getDocumentRoot()
	 * @generated
	 */
	EReference getDocumentRoot_XSISchemaLocation();

	/**
	 * Returns the meta object for the containment reference '{@link org.eclipse.dd.dc.DocumentRoot#getBounds Bounds}'.
	 *
	 *
	 * @return the meta object for the containment reference 'Bounds'.
	 * @see org.eclipse.dd.dc.DocumentRoot#getBounds()
	 * @see #getDocumentRoot()
	 * @generated
	 */
	EReference getDocumentRoot_Bounds();

	/**
	 * Returns the meta object for the containment reference '{@link org.eclipse.dd.dc.DocumentRoot#getFont Font}'.
	 *
	 *
	 * @return the meta object for the containment reference 'Font'.
	 * @see org.eclipse.dd.dc.DocumentRoot#getFont()
	 * @see #getDocumentRoot()
	 * @generated
	 */
	EReference getDocumentRoot_Font();

	/**
	 * Returns the meta object for the containment reference '{@link org.eclipse.dd.dc.DocumentRoot#getPoint Point}'.
	 *
	 *
	 * @return the meta object for the containment reference 'Point'.
	 * @see org.eclipse.dd.dc.DocumentRoot#getPoint()
	 * @see #getDocumentRoot()
	 * @generated
	 */
	EReference getDocumentRoot_Point();

	/**
	 * Returns the meta object for class '{@link org.eclipse.dd.dc.Bounds Bounds}'.
	 *
	 *
	 * @return the meta object for class 'Bounds'.
	 * @see org.eclipse.dd.dc.Bounds
	 * @generated
	 */
	EClass getBounds();

	/**
	 * Returns the meta object for the attribute '{@link org.eclipse.dd.dc.Bounds#getHeight Height}'.
	 *
	 *
	 * @return the meta object for the attribute 'Height'.
	 * @see org.eclipse.dd.dc.Bounds#getHeight()
	 * @see #getBounds()
	 * @generated
	 */
	EAttribute getBounds_Height();

	/**
	 * Returns the meta object for the attribute '{@link org.eclipse.dd.dc.Bounds#getWidth Width}'.
	 *
	 *
	 * @return the meta object for the attribute 'Width'.
	 * @see org.eclipse.dd.dc.Bounds#getWidth()
	 * @see #getBounds()
	 * @generated
	 */
	EAttribute getBounds_Width();

	/**
	 * Returns the meta object for the attribute '{@link org.eclipse.dd.dc.Bounds#getX X}'.
	 *
	 *
	 * @return the meta object for the attribute 'X'.
	 * @see org.eclipse.dd.dc.Bounds#getX()
	 * @see #getBounds()
	 * @generated
	 */
	EAttribute getBounds_X();

	/**
	 * Returns the meta object for the attribute '{@link org.eclipse.dd.dc.Bounds#getY Y}'.
	 *
	 *
	 * @return the meta object for the attribute 'Y'.
	 * @see org.eclipse.dd.dc.Bounds#getY()
	 * @see #getBounds()
	 * @generated
	 */
	EAttribute getBounds_Y();

	/**
	 * Returns the meta object for class '{@link org.eclipse.dd.dc.Font Font}'.
	 *
	 *
	 * @return the meta object for class 'Font'.
	 * @see org.eclipse.dd.dc.Font
	 * @generated
	 */
	EClass getFont();

	/**
	 * Returns the meta object for the attribute '{@link org.eclipse.dd.dc.Font#isIsBold Is Bold}'.
	 *
	 *
	 * @return the meta object for the attribute 'Is Bold'.
	 * @see org.eclipse.dd.dc.Font#isIsBold()
	 * @see #getFont()
	 * @generated
	 */
	EAttribute getFont_IsBold();

	/**
	 * Returns the meta object for the attribute '{@link org.eclipse.dd.dc.Font#isIsItalic Is Italic}'.
	 *
	 *
	 * @return the meta object for the attribute 'Is Italic'.
	 * @see org.eclipse.dd.dc.Font#isIsItalic()
	 * @see #getFont()
	 * @generated
	 */
	EAttribute getFont_IsItalic();

	/**
	 * Returns the meta object for the attribute '{@link org.eclipse.dd.dc.Font#isIsStrikeThrough Is Strike Through}'.
	 *
	 *
	 * @return the meta object for the attribute 'Is Strike Through'.
	 * @see org.eclipse.dd.dc.Font#isIsStrikeThrough()
	 * @see #getFont()
	 * @generated
	 */
	EAttribute getFont_IsStrikeThrough();

	/**
	 * Returns the meta object for the attribute '{@link org.eclipse.dd.dc.Font#isIsUnderline Is Underline}'.
	 *
	 *
	 * @return the meta object for the attribute 'Is Underline'.
	 * @see org.eclipse.dd.dc.Font#isIsUnderline()
	 * @see #getFont()
	 * @generated
	 */
	EAttribute getFont_IsUnderline();

	/**
	 * Returns the meta object for the attribute '{@link org.eclipse.dd.dc.Font#getName Name}'.
	 *
	 *
	 * @return the meta object for the attribute 'Name'.
	 * @see org.eclipse.dd.dc.Font#getName()
	 * @see #getFont()
	 * @generated
	 */
	EAttribute getFont_Name();

	/**
	 * Returns the meta object for the attribute '{@link org.eclipse.dd.dc.Font#getSize Size}'.
	 *
	 *
	 * @return the meta object for the attribute 'Size'.
	 * @see org.eclipse.dd.dc.Font#getSize()
	 * @see #getFont()
	 * @generated
	 */
	EAttribute getFont_Size();

	/**
	 * Returns the meta object for class '{@link org.eclipse.dd.dc.Point Point}'.
	 *
	 *
	 * @return the meta object for class 'Point'.
	 * @see org.eclipse.dd.dc.Point
	 * @generated
	 */
	EClass getPoint();

	/**
	 * Returns the meta object for the attribute '{@link org.eclipse.dd.dc.Point#getX X}'.
	 *
	 *
	 * @return the meta object for the attribute 'X'.
	 * @see org.eclipse.dd.dc.Point#getX()
	 * @see #getPoint()
	 * @generated
	 */
	EAttribute getPoint_X();

	/**
	 * Returns the meta object for the attribute '{@link org.eclipse.dd.dc.Point#getY Y}'.
	 *
	 *
	 * @return the meta object for the attribute 'Y'.
	 * @see org.eclipse.dd.dc.Point#getY()
	 * @see #getPoint()
	 * @generated
	 */
	EAttribute getPoint_Y();

	/**
	 * Returns the factory that creates the instances of the model.
	 *
	 *
	 * @return the factory that creates the instances of the model.
	 * @generated
	 */
	DcFactory getDcFactory();

	/**
	 *
	 * Defines literals for the meta objects that represent
	 *

	 *
each class,

	 *
each feature of each class,

	 *
each enum,

	 *
and each data type

	 *

	 *
	 * @generated
	 */
	interface Literals {
		/**
		 * The meta object literal for the '{@link org.eclipse.dd.dc.impl.DocumentRootImpl Document Root}' class.
		 *
		 *
		 * @see org.eclipse.dd.dc.impl.DocumentRootImpl
		 * @see org.eclipse.dd.dc.impl.DcPackageImpl#getDocumentRoot()
		 * @generated
		 */
		EClass DOCUMENT_ROOT = eINSTANCE.getDocumentRoot();

		/**
		 * The meta object literal for the 'Mixed' attribute list feature.
		 *
		 *
		 * @generated
		 */
		EAttribute DOCUMENT_ROOT__MIXED = eINSTANCE.getDocumentRoot_Mixed();

		/**
		 * The meta object literal for the 'XMLNS Prefix Map' map feature.
		 *
		 *
		 * @generated
		 */
		EReference DOCUMENT_ROOT__XMLNS_PREFIX_MAP = eINSTANCE
				.getDocumentRoot_XMLNSPrefixMap();

		/**
		 * The meta object literal for the 'XSI Schema Location' map feature.
		 *
		 *
		 * @generated
		 */
		EReference DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = eINSTANCE
				.getDocumentRoot_XSISchemaLocation();

		/**
		 * The meta object literal for the 'Bounds' containment reference feature.
		 *
		 *
		 * @generated
		 */
		EReference DOCUMENT_ROOT__BOUNDS = eINSTANCE.getDocumentRoot_Bounds();

		/**
		 * The meta object literal for the 'Font' containment reference feature.
		 *
		 *
		 * @generated
		 */
		EReference DOCUMENT_ROOT__FONT = eINSTANCE.getDocumentRoot_Font();

		/**
		 * The meta object literal for the 'Point' containment reference feature.
		 *
		 *
		 * @generated
		 */
		EReference DOCUMENT_ROOT__POINT = eINSTANCE.getDocumentRoot_Point();

		/**
		 * The meta object literal for the '{@link org.eclipse.dd.dc.impl.BoundsImpl Bounds}' class.
		 *
		 *
		 * @see org.eclipse.dd.dc.impl.BoundsImpl
		 * @see org.eclipse.dd.dc.impl.DcPackageImpl#getBounds()
		 * @generated
		 */
		EClass BOUNDS = eINSTANCE.getBounds();

		/**
		 * The meta object literal for the 'Height' attribute feature.
		 *
		 *
		 * @generated
		 */
		EAttribute BOUNDS__HEIGHT = eINSTANCE.getBounds_Height();

		/**
		 * The meta object literal for the 'Width' attribute feature.
		 *
		 *
		 * @generated
		 */
		EAttribute BOUNDS__WIDTH = eINSTANCE.getBounds_Width();

		/**
		 * The meta object literal for the 'X' attribute feature.
		 *
		 *
		 * @generated
		 */
		EAttribute BOUNDS__X = eINSTANCE.getBounds_X();

		/**
		 * The meta object literal for the 'Y' attribute feature.
		 *
		 *
		 * @generated
		 */
		EAttribute BOUNDS__Y = eINSTANCE.getBounds_Y();

		/**
		 * The meta object literal for the '{@link org.eclipse.dd.dc.impl.FontImpl Font}' class.
		 *
		 *
		 * @see org.eclipse.dd.dc.impl.FontImpl
		 * @see org.eclipse.dd.dc.impl.DcPackageImpl#getFont()
		 * @generated
		 */
		EClass FONT = eINSTANCE.getFont();

		/**
		 * The meta object literal for the 'Is Bold' attribute feature.
		 *
		 *
		 * @generated
		 */
		EAttribute FONT__IS_BOLD = eINSTANCE.getFont_IsBold();

		/**
		 * The meta object literal for the 'Is Italic' attribute feature.
		 *
		 *
		 * @generated
		 */
		EAttribute FONT__IS_ITALIC = eINSTANCE.getFont_IsItalic();

		/**
		 * The meta object literal for the 'Is Strike Through' attribute feature.
		 *
		 *
		 * @generated
		 */
		EAttribute FONT__IS_STRIKE_THROUGH = eINSTANCE
				.getFont_IsStrikeThrough();

		/**
		 * The meta object literal for the 'Is Underline' attribute feature.
		 *
		 *
		 * @generated
		 */
		EAttribute FONT__IS_UNDERLINE = eINSTANCE.getFont_IsUnderline();

		/**
		 * The meta object literal for the 'Name' attribute feature.
		 *
		 *
		 * @generated
		 */
		EAttribute FONT__NAME = eINSTANCE.getFont_Name();

		/**
		 * The meta object literal for the 'Size' attribute feature.
		 *
		 *
		 * @generated
		 */
		EAttribute FONT__SIZE = eINSTANCE.getFont_Size();

		/**
		 * The meta object literal for the '{@link org.eclipse.dd.dc.impl.PointImpl Point}' class.
		 *
		 *
		 * @see org.eclipse.dd.dc.impl.PointImpl
		 * @see org.eclipse.dd.dc.impl.DcPackageImpl#getPoint()
		 * @generated
		 */
		EClass POINT = eINSTANCE.getPoint();

		/**
		 * The meta object literal for the 'X' attribute feature.
		 *
		 *
		 * @generated
		 */
		EAttribute POINT__X = eINSTANCE.getPoint_X();

		/**
		 * The meta object literal for the 'Y' attribute feature.
		 *
		 *
		 * @generated
		 */
		EAttribute POINT__Y = eINSTANCE.getPoint_Y();

	}

} //DcPackage


text:
package org.apache.flink.graph.library.metric.undirected;

import org.apache.flink.graph.Graph;
import org.apache.flink.graph.asm.AsmTestBase;
import org.apache.flink.graph.library.metric.undirected.VertexMetrics.Result;
import org.apache.flink.types.NullValue;

import org.apache.commons.math3.util.CombinatoricsUtils;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

/**
 * Tests for {@link VertexMetrics}.
 */
public class VertexMetricsTest extends AsmTestBase {

	/**
	 * Validate a test result.
	 *
	 * @param graph input graph
	 * @param includeZeroDegreeVertices whether to include zero-degree vertices
	 * @param result expected {@link Result}
	 * @param averageDegree result average degree
	 * @param density result density
	 * @param <T> graph ID type
	 * @throws Exception on error
	 */
	private static <T extends Comparable<T>> void validate(
			Graph<T, NullValue, NullValue> graph, boolean includeZeroDegreeVertices,
			Result result, float averageDegree, float density) throws Exception {
		Result vertexMetrics = new VertexMetrics<T, NullValue, NullValue>()
			.setIncludeZeroDegreeVertices(includeZeroDegreeVertices)
			.run(graph)
			.execute();

		assertEquals(result, vertexMetrics);
		assertEquals(averageDegree, vertexMetrics.getAverageDegree(), ACCURACY);
		assertEquals(density, vertexMetrics.getDensity(), ACCURACY);
	}

	@Test
	public void testWithSimpleGraph() throws Exception {
		validate(undirectedSimpleGraph, false, new Result(6, 7, 13, 4, 6), 14f / 6, 7f / 15);
	}

	@Test
	public void testWithCompleteGraph() throws Exception {
		long expectedDegree = completeGraphVertexCount - 1;
		long expectedEdges = completeGraphVertexCount * expectedDegree / 2;
		long expectedMaximumTriplets = CombinatoricsUtils.binomialCoefficient((int) expectedDegree, 2);
		long expectedTriplets = completeGraphVertexCount * expectedMaximumTriplets;

		Result expectedResult = new Result(completeGraphVertexCount, expectedEdges, expectedTriplets,
			expectedDegree, expectedMaximumTriplets);

		validate(completeGraph, false, expectedResult, expectedDegree, 1.0f);
	}

	@Test
	public void testWithEmptyGraphWithVertices() throws Exception {
		validate(emptyGraphWithVertices, false, new Result(0, 0, 0, 0, 0), Float.NaN, Float.NaN);
		validate(emptyGraphWithVertices, true, new Result(3, 0, 0, 0, 0), 0.0f, 0.0f);
	}

	@Test
	public void testWithEmptyGraphWithoutVertices() throws Exception {
		Result expectedResult =  new Result(0, 0, 0, 0, 0);
		validate(emptyGraphWithoutVertices, false, expectedResult, Float.NaN, Float.NaN);
		validate(emptyGraphWithoutVertices, true, expectedResult, Float.NaN, Float.NaN);
	}

	@Test
	public void testWithRMatGraph() throws Exception {
		Result expectedResult = new Result(902, 10442, 1003442, 463, 106953);
		validate(undirectedRMatGraph(10, 16), false, expectedResult, 23.1529933f, 0.0256969f);
	}
}


text:
#include "Ike.h"
#include "IkeCommon.h"
#include "IpSecConfigImpl.h"
#include "IpSecDebug.h"

//
// Initial the SPI
//
UINT32            mNextSpi  = IKE_SPI_BASE;
EFI_GUID          mZeroGuid = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

/**
  Call Crypto Lib to generate a random value with eight-octet length.

  @return the 64 byte vaule.

**/
UINT64
IkeGenerateCookie (
  VOID
  )
{
  UINT64     Cookie;
  EFI_STATUS Status;

  Status = IpSecCryptoIoGenerateRandomBytes ((UINT8 *)&Cookie, sizeof (UINT64));
  if (EFI_ERROR (Status)) {
    return 0;
  } else {
    return Cookie;
  }
}

/**
  Generate the random data for Nonce payload.

  @param[in]  NonceSize      Size of the data in bytes.

  @return Buffer which contains the random data of the spcified size.

**/
UINT8 *
IkeGenerateNonce (
  IN UINTN              NonceSize
  )
{
  UINT8                  *Nonce;
  EFI_STATUS             Status;

  Nonce = AllocateZeroPool (NonceSize);
  if (Nonce == NULL) {
    return NULL;
  }

  Status = IpSecCryptoIoGenerateRandomBytes (Nonce, NonceSize);
  if (EFI_ERROR (Status)) {
    FreePool (Nonce);
    return NULL;
  } else {
    return Nonce;
  }
}

/**
  Convert the IKE Header from Network order to Host order.

  @param[in, out]  Header    The pointer of the IKE_HEADER.

**/
VOID
IkeHdrNetToHost (
  IN OUT IKE_HEADER *Header
  )
{
  Header->InitiatorCookie = NTOHLL (Header->InitiatorCookie);
  Header->ResponderCookie = NTOHLL (Header->ResponderCookie);
  Header->MessageId       = NTOHL (Header->MessageId);
  Header->Length          = NTOHL (Header->Length);
}

/**
  Convert the IKE Header from Host order to Network order.

  @param[in, out] Header     The pointer of the IKE_HEADER.

**/
VOID
IkeHdrHostToNet (
  IN OUT IKE_HEADER *Header
  )
{
  Header->InitiatorCookie = HTONLL (Header->InitiatorCookie);
  Header->ResponderCookie = HTONLL (Header->ResponderCookie);
  Header->MessageId       = HTONL (Header->MessageId);
  Header->Length          = HTONL (Header->Length);
}

/**
  Allocate a buffer of IKE_PAYLOAD and set its Signature.

  @return A buffer of IKE_PAYLOAD.

**/
IKE_PAYLOAD *
IkePayloadAlloc (
  VOID
  )
{
  IKE_PAYLOAD *IkePayload;

  IkePayload            = (IKE_PAYLOAD *) AllocateZeroPool (sizeof (IKE_PAYLOAD));
  if (IkePayload == NULL) {
    return NULL;
  }

  IkePayload->Signature = IKE_PAYLOAD_SIGNATURE;

  return IkePayload;
}

/**
  Free a specified IKE_PAYLOAD buffer.

  @param[in]  IkePayload   Pointer of IKE_PAYLOAD to be freed.

**/
VOID
IkePayloadFree (
  IN IKE_PAYLOAD *IkePayload
  )
{
  if (IkePayload == NULL) {
    return;
  }
  //
  // If this IkePayload is not referred by others, free it.
  //
  if (!IkePayload->IsPayloadBufExt && (IkePayload->PayloadBuf != NULL)) {
    FreePool (IkePayload->PayloadBuf);
  }

  FreePool (IkePayload);
}

/**
  Generate an new SPI.

  @return a SPI in 4 bytes.

**/
UINT32
IkeGenerateSpi (
  VOID
  )
{
  //
  // TODO: should generate SPI randomly to avoid security issue
  //
  return mNextSpi++;
}

/**
  Generate a random data for IV

  @param[in]  IvBuffer  The pointer of the IV buffer.
  @param[in]  IvSize    The IV size.

  @retval     EFI_SUCCESS  Create a random data for IV.
  @retval     otherwise    Failed.

**/
EFI_STATUS
IkeGenerateIv (
  IN UINT8                           *IvBuffer,
  IN UINTN                           IvSize
  )
{
  return IpSecCryptoIoGenerateRandomBytes (IvBuffer, IvSize);
}

/**
  Find SPD entry by a specified SPD selector.

  @param[in] SpdSel       Point to SPD Selector to be searched for.

  @retval Point to SPD Entry if the SPD entry found.
  @retval NULL if not found.

**/
IPSEC_SPD_ENTRY *
IkeSearchSpdEntry (
  IN EFI_IPSEC_SPD_SELECTOR             *SpdSel
  )
{
  IPSEC_SPD_ENTRY *SpdEntry;
  LIST_ENTRY      *SpdList;
  LIST_ENTRY      *Entry;

  SpdList = &mConfigData[IPsecConfigDataTypeSpd];

  NET_LIST_FOR_EACH (Entry, SpdList) {
    SpdEntry = IPSEC_SPD_ENTRY_FROM_LIST (Entry);

    //
    // Find the required SPD entry
    //
    if (CompareSpdSelector (
          (EFI_IPSEC_CONFIG_SELECTOR *) SpdSel,
          (EFI_IPSEC_CONFIG_SELECTOR *) SpdEntry->Selector
          )) {
      return SpdEntry;
    }

  }

  return NULL;
}

/**
  Get the IKE Version from the IKE_SA_SESSION.

  @param[in]  Session  Pointer of the IKE_SA_SESSION.

**/
UINT8
IkeGetVersionFromSession (
  IN UINT8    *Session
  )
{
  if (*(UINT32 *) Session == IKEV2_SA_SESSION_SIGNATURE) {
    return ((IKEV2_SA_SESSION *) Session)->SessionCommon.IkeVer;
  } else {
    //
    // Add IKEv1 support here.
    //
    return 0;
  }
}


text:
package org.apache.geode.security.query.data;

import java.io.Serializable;

import org.apache.geode.pdx.PdxReader;
import org.apache.geode.pdx.PdxSerializable;
import org.apache.geode.pdx.PdxWriter;

public class PdxTrade implements PdxSerializable, Serializable {

  private String id;

  private String cusip;

  private int shares;

  private int price;

  public PdxTrade() {}

  public String getCusip() {
    return this.cusip;
  }

  public PdxTrade(String id, String cusip, int shares, int price) {
    this.id = id;
    this.cusip = cusip;
    this.shares = shares;
    this.price = price;
  }

  @Override
  public void toData(PdxWriter writer) {
    writer.writeString("id", id);
    writer.writeString("cusip", cusip);
    writer.writeInt("shares", shares);
    writer.writeInt("price", price);
  }

  @Override
  public void fromData(PdxReader reader) {
    id = reader.readString("id");
    cusip = reader.readString("cusip");
    shares = reader.readInt("shares");
    price = reader.readInt("price");
  }
}


text:
<?php
namespace Chamilo\Core\Repository\ContentObject\Link\Package;

use Chamilo\Core\Repository\Common\Action\ContentObjectInstaller;

class Installer extends ContentObjectInstaller
{
}


text:
<!DOCTYPE html>

<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charset="utf-8">
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="generator" content="Hugo 0.57.2" />
<meta property="og:title" content="Welcome" />
<meta name="twitter:title" content="welcome"/>
<meta itemprop="name" content="welcome"><meta property="og:description" content="devopsdays Istanbul 2017" />
  <meta name="twitter:description" content="devopsdays Istanbul 2017" />
  <meta itemprop="description" content="devopsdays Istanbul 2017"><meta name="twitter:site" content="@devopsdays">
<meta property="og:type" content="event" />
<meta property="og:url" content="/events/2017-istanbul/welcome/" /><meta name="twitter:creator" content="@devopsdaysist" /><meta name="twitter:label1" value="Event" />
  <meta name="twitter:data1" value="devopsdays Istanbul 2017" /><meta name="twitter:label2" value="Date" />
    <meta name="twitter:data2" value="September 28, 2017" /><meta property="og:image" content="https://www.devopsdays.org/img/sharing.jpg" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content="https://www.devopsdays.org/img/sharing.jpg" />
<meta itemprop="image" content="https://www.devopsdays.org/img/sharing.jpg" />
<meta property="fb:app_id" content="1904065206497317" /><meta itemprop="wordCount" content="66">
<title>devopsdays Istanbul 2017
</title>

<link href="/css/site.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto+Condensed:300,400,700" rel="stylesheet"><link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192"  href="/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">

      <link href="/events/index.xml" rel="alternate" type="application/rss+xml" title="DevOpsDays" />
      <link href="/events/index.xml" rel="feed" type="application/rss+xml" title="DevOpsDays" />

  DevOpsDays

<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">

</button>

events

blog

sponsor

speaking

organizing

about

  Istanbul
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar2">

</button>

                  propose

                  location

                  registration

                  sponsor

                  contact

                  conduct

devopsdays Istanbul

          September 28, 2017

Dedeman Bostanci Istanbul

Other Istanbul Events
2016   2018   2019

        Follow

Thursday, Sep 28, 2017 - Thursday, Sep 28, 2017

devopsdays is coming to Dedeman Bostanci Istanbul
!

    Dates

    Thursday, Sep 28, 2017 - Thursday, Sep 28, 2017

    Location

    Dedeman Bostanci Istanbul

    Propose

    Propose a talk!

    Speakers

    Check out the speakers!

    Sponsors

    Sponsor the conference!

    Contact

    Get in touch with the organizers

Follow @devopsdaysist

Platinium Sponsors
Join as Platinium Sponsor!

Gold Sponsors
Join as Gold Sponsor!

Silver Sponsors
Join as Silver Sponsor!

Bronze Sponsors
Join as Bronze Sponsor!

Community Sponsors
Join as Community Sponsor!

Media Sponsors
Join as Media Sponsor!

Supporter Sponsors
Join as Supporter Sponsor!

@DEVOPSDAYS

BLOG

10 years of devopsdays

by Kris Buytaert - 10 May, 2019

It’s hard to believe but it is almost 10 years ago since #devopsdays happened for the first time in Gent. Back then there were almost 70 of us talking about topics that were of interest to both Operations and Development, we were exchanging our ideas and experiences `on how we were improving the quality of software delivery.
Our ideas got started on the crossroads of Open Source, Agile and early Cloud Adoption.

Blogs

10 May, 2019

Feed

CFP OPEN
Campinas
Macapá
Shanghai
Recife
Charlotte
Prague
Tokyo
Salt Lake City

Propose a talk at an event near you!

About

    devopsdays is a worldwide community conference series for anyone interested in IT improvement.

    About devopsdays

    Privacy Policy

    Code of Conduct


text:
package org.uberfire.ext.security.management.client.widgets.management.editor.acl;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.uberfire.ext.security.management.client.widgets.management.editor.acl.node.PermissionExceptionSwitch;
import org.uberfire.mvp.Command;

import static org.junit.Assert.*;
import static org.mockito.Mockito.*;

@RunWith(MockitoJUnitRunner.class)
public class PermissionExceptionSwitchTest {

    @Mock
    PermissionExceptionSwitch.View view;

    @Mock
    Command onChange;

    PermissionExceptionSwitch presenter;

    @Before
    public void setup() {
        presenter = new PermissionExceptionSwitch(view);
    }

    @Test
    public void testExceptionInit() {
        when(view.isOn()).thenReturn(true);
        presenter.init(null,
                       null,
                       true,
                       true);

        assertTrue(presenter.isOn());
        verify(view).init(null,
                          null);
        verify(view).setOn(true);
        verify(view).setExceptionEnabled(true);
        assertTrue(presenter.isOn());
    }

    @Test
    public void testExceptionChange() {
        when(view.isOn()).thenReturn(false);
        presenter.init(null,
                       null,
                       true,
                       true);
        presenter.setOnChange(onChange);

        reset(view);
        presenter.onChange();
        assertFalse(presenter.isOn());
        verify(onChange).execute();

        reset(view);
        when(view.isOn()).thenReturn(true);
        presenter.onChange();
    }

    @Test
    public void testNoExceptionInit() {
        when(view.isOn()).thenReturn(true);
        presenter.init(null,
                       null,
                       true,
                       false);

        assertTrue(presenter.isOn());
        verify(view).init(null,
                          null);
        verify(view).setOn(true);
        assertTrue(presenter.isOn());
    }

    @Test
    public void testNoExceptionChange() {
        when(view.isOn()).thenReturn(false);
        presenter.init(null,
                       null,
                       true,
                       false);
        presenter.setOnChange(onChange);

        reset(view);
        presenter.onChange();
        assertFalse(presenter.isOn());
        verify(onChange).execute();
    }
}


text:
/* 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.
 */
package org.flowable.idm.engine.impl.db;

import org.flowable.common.engine.api.FlowableException;
import org.flowable.common.engine.api.FlowableWrongDbException;
import org.flowable.common.engine.impl.db.ServiceSqlScriptBasedDbSchemaManager;
import org.flowable.idm.engine.IdmEngine;
import org.flowable.idm.engine.IdmEngineConfiguration;
import org.flowable.idm.engine.impl.util.CommandContextUtil;

public class IdmDbSchemaManager extends ServiceSqlScriptBasedDbSchemaManager {

    private static final String IDM_PROPERTY_TABLE = "ACT_ID_PROPERTY";
    private static final String VERSION_PROPERTY = "schema.version";
    private static final String SCHEMA_COMPONENT = "identity";

   public IdmDbSchemaManager() {
       // note; no schema property set, managed by this class itself as it has (for historical reasons) it's own property table
       super(IDM_PROPERTY_TABLE, SCHEMA_COMPONENT, null, VERSION_PROPERTY);
   }

   @Override
   protected String getResourcesRootDirectory() {
       return "org/flowable/idm/db/";
   }

   @Override
   protected String getPropertyTable() {
       return IDM_PROPERTY_TABLE;
   }

   @Override
   protected String getUpgradeStartVersion() {
       return "5.99.0.0";
   }

   @Override
   protected void internalDbSchemaCreate() {
       // User and Group tables can already have been created by the process engine in an earlier version
       if (isIdmGroupTablePresent()) {
           schemaUpdate();

       } else {
           super.internalDbSchemaCreate();
       }
   }

   @Override
   protected boolean isUpdateNeeded() {
       boolean propertyTablePresent = isTablePresent(IDM_PROPERTY_TABLE);
       if (!propertyTablePresent) {
           return isIdmGroupTablePresent();
       }
       return true;
   }

   public boolean isIdmGroupTablePresent() {
       return isTablePresent("ACT_ID_GROUP");
   }

   @Override
   public void schemaCheckVersion() {
       try {
           String dbVersion = getSchemaVersion();
           if (!IdmEngine.VERSION.equals(dbVersion)) {
               throw new FlowableWrongDbException(IdmEngine.VERSION, dbVersion);
           }

           String errorMessage = null;
           if (!isTablePresent(IDM_PROPERTY_TABLE)) {
               errorMessage = addMissingComponent(errorMessage, "engine");
           }

           if (errorMessage != null) {
               throw new FlowableException("Flowable IDM database problem: " + errorMessage);
           }

       } catch (Exception e) {
           if (isMissingTablesException(e)) {
               throw new FlowableException(
                       "no flowable tables in db. set <property name=\"databaseSchemaUpdate\" to value=\"true\" or value=\"create-drop\" (use create-drop for testing only!) in bean processEngineConfiguration in flowable.cfg.xml for automatic schema creation",
                       e);
           } else {
               if (e instanceof RuntimeException) {
                   throw (RuntimeException) e;
               } else {
                   throw new FlowableException("couldn't get db schema version", e);
               }
           }
       }

       logger.debug("flowable idm db schema check successful");
   }

   protected String addMissingComponent(String missingComponents, String component) {
       if (missingComponents == null) {
           return "Tables missing for component(s) " + component;
       }
       return missingComponents + ", " + component;
   }

   protected boolean isMissingTablesException(Exception e) {
       String exceptionMessage = e.getMessage();
       if (e.getMessage() != null) {
           // Matches message returned from H2
           if ((exceptionMessage.contains("Table")) && (exceptionMessage.contains("not found"))) {
               return true;
           }

           // Message returned from MySQL and Oracle
           if ((exceptionMessage.contains("Table") || exceptionMessage.contains("table")) && (exceptionMessage.contains("doesn't exist"))) {
               return true;
           }

           // Message returned from Postgres
           if ((exceptionMessage.contains("relation") || exceptionMessage.contains("table")) && (exceptionMessage.contains("does not exist"))) {
               return true;
           }
       }
       return false;
   }

   public void performSchemaOperationsIdmEngineBuild() {
       String databaseSchemaUpdate = CommandContextUtil.getIdmEngineConfiguration().getDatabaseSchemaUpdate();
       if (IdmEngineConfiguration.DB_SCHEMA_UPDATE_DROP_CREATE.equals(databaseSchemaUpdate)) {
           try {
               schemaDrop();
           } catch (RuntimeException e) {
               // ignore
           }
       }
       if (IdmEngineConfiguration.DB_SCHEMA_UPDATE_CREATE_DROP.equals(databaseSchemaUpdate) || IdmEngineConfiguration.DB_SCHEMA_UPDATE_DROP_CREATE.equals(databaseSchemaUpdate)
               || IdmEngineConfiguration.DB_SCHEMA_UPDATE_CREATE.equals(databaseSchemaUpdate)) {
           schemaCreate();

       } else if (IdmEngineConfiguration.DB_SCHEMA_UPDATE_FALSE.equals(databaseSchemaUpdate)) {
           schemaCheckVersion();

       } else if (IdmEngineConfiguration.DB_SCHEMA_UPDATE_TRUE.equals(databaseSchemaUpdate)) {
           schemaUpdate();
       }
   }

}


text:
(function(jsPDFAPI) {
'use strict'

	/*
	 * @see http://www.w3.org/TR/PNG-Chunks.html
	 *
	 Color    Allowed      Interpretation
	 Type     Bit Depths

	   0       1,2,4,8,16  Each pixel is a grayscale sample.

	   2       8,16        Each pixel is an R,G,B triple.

	   3       1,2,4,8     Each pixel is a palette index;
	                       a PLTE chunk must appear.

	   4       8,16        Each pixel is a grayscale sample,
	                       followed by an alpha sample.

	   6       8,16        Each pixel is an R,G,B triple,
	                       followed by an alpha sample.
	*/

	/*
	 * PNG filter method types
	 *
	 * @see http://www.w3.org/TR/PNG-Filters.html
	 * @see http://www.libpng.org/pub/png/book/chapter09.html
	 *
	 * This is what the value 'Predictor' in decode params relates to
	 *
	 * 15 is "optimal prediction", which means the prediction algorithm can change from line to line.
	 * In that case, you actually have to read the first byte off each line for the prediction algorthim (which should be 0-4, corresponding to PDF 10-14) and select the appropriate unprediction algorithm based on that byte.
	 *
	   0       None
	   1       Sub
	   2       Up
	   3       Average
	   4       Paeth
	 */

	var doesNotHavePngJS = function() {
		return typeof PNG !== 'function' || typeof FlateStream !== 'function';
	}
	, canCompress = function(value) {
		return value !== jsPDFAPI.image_compression.NONE && hasCompressionJS();
	}
	, hasCompressionJS = function() {
		var inst = typeof Deflater === 'function';
		if(!inst)
			throw new Error("requires deflate.js for compression")
		return inst;
	}
	, compressBytes = function(bytes, lineLength, colorsPerPixel, compression) {

		var level = 5,
			filter_method = filterUp;

		switch(compression) {

			case jsPDFAPI.image_compression.FAST:

				level = 3;
				filter_method = filterSub;
				break;

			case jsPDFAPI.image_compression.MEDIUM:

				level = 6;
				filter_method = filterAverage;
				break;

			case jsPDFAPI.image_compression.SLOW:

				level = 9;
				filter_method = filterPaeth;//uses to sum to choose best filter for each line
				break;
		}

		bytes = applyPngFilterMethod(bytes, lineLength, colorsPerPixel, filter_method);

		var header = new Uint8Array(createZlibHeader(level));
		var checksum = adler32(bytes);

		var deflate = new Deflater(level);
		var a = deflate.append(bytes);
		var cBytes = deflate.flush();

		var len = header.length + a.length + cBytes.length;

		var cmpd = new Uint8Array(len + 4);
		cmpd.set(header);
		cmpd.set(a, header.length);
		cmpd.set(cBytes, header.length + a.length);

		cmpd[len++] = (checksum >>> 24) & 0xff;
		cmpd[len++] = (checksum >>> 16) & 0xff;
		cmpd[len++] = (checksum >>> 8) & 0xff;
		cmpd[len++] = checksum & 0xff;

		return jsPDFAPI.arrayBufferToBinaryString(cmpd);
	}
	, createZlibHeader = function(bytes, level){
		/*
		 * @see http://www.ietf.org/rfc/rfc1950.txt for zlib header
		 */
		var cm = 8;
        var cinfo = Math.LOG2E * Math.log(0x8000) - 8;
        var cmf = (cinfo << 4) | cm;

        var hdr = cmf << 8;
        var flevel = Math.min(3, ((level - 1) & 0xff) >> 1);

        hdr |= (flevel << 6);
        hdr |= 0;//FDICT
        hdr += 31 - (hdr % 31);

        return [cmf, (hdr & 0xff) & 0xff];
	}
	, adler32 = function(array, param) {
		var adler = 1;
	    var s1 = adler & 0xffff,
	        s2 = (adler >>> 16) & 0xffff;
	    var len = array.length;
	    var tlen;
	    var i = 0;

	    while (len > 0) {
	      tlen = len > param ? param : len;
	      len -= tlen;
	      do {
	        s1 += array[i++];
	        s2 += s1;
	      } while (--tlen);

	      s1 %= 65521;
	      s2 %= 65521;
	    }

	    return ((s2 << 16) | s1) >>> 0;
	}
	, applyPngFilterMethod = function(bytes, lineLength, colorsPerPixel, filter_method) {
		var lines = bytes.length / lineLength,
			result = new Uint8Array(bytes.length + lines),
			filter_methods = getFilterMethods(),
			i = 0, line, prevLine, offset;

		for(; i < lines; i++) {
			offset = i * lineLength;
			line = bytes.subarray(offset, offset + lineLength);

			if(filter_method) {
				result.set(filter_method(line, colorsPerPixel, prevLine), offset + i);

			}else{

				var j = 0,
					len = filter_methods.length,
					results = [];

				for(; j < len; j++)
					results[j] = filter_methods[j](line, colorsPerPixel, prevLine);

				var ind = getIndexOfSmallestSum(results.concat());

				result.set(results[ind], offset + i);
			}

			prevLine = line;
		}

		return result;
	}
	, filterNone = function(line, colorsPerPixel, prevLine) {
		/*var result = new Uint8Array(line.length + 1);
		result[0] = 0;
		result.set(line, 1);*/

		var result = Array.apply([], line);
		result.unshift(0);

		return result;
	}
	, filterSub = function(line, colorsPerPixel, prevLine) {
		var result = [],
			i = 0,
			len = line.length,
			left;

		result[0] = 1;

		for(; i < len; i++) {
			left = line[i - colorsPerPixel] || 0;
			result[i + 1] = (line[i] - left + 0x0100) & 0xff;
		}

		return result;
	}
	, filterUp = function(line, colorsPerPixel, prevLine) {
		var result = [],
			i = 0,
			len = line.length,
			up;

		result[0] = 2;

		for(; i < len; i++) {
			up = prevLine && prevLine[i] || 0;
			result[i + 1] = (line[i] - up + 0x0100) & 0xff;
		}

		return result;
	}
	, filterAverage = function(line, colorsPerPixel, prevLine) {
		var result = [],
			i = 0,
			len = line.length,
			left,
			up;

		result[0] = 3;

		for(; i < len; i++) {
			left = line[i - colorsPerPixel] || 0;
			up = prevLine && prevLine[i] || 0;
			result[i + 1] = (line[i] + 0x0100 - ((left + up) >>> 1)) & 0xff;
		}

		return result;
	}
	, filterPaeth = function(line, colorsPerPixel, prevLine) {
		var result = [],
			i = 0,
			len = line.length,
			left,
			up,
			upLeft,
			paeth;

		result[0] = 4;

		for(; i < len; i++) {
			left = line[i - colorsPerPixel] || 0;
			up = prevLine && prevLine[i] || 0;
			upLeft = prevLine && prevLine[i - colorsPerPixel] || 0;
			paeth = paethPredictor(left, up, upLeft);
			result[i + 1] = (line[i] - paeth + 0x0100) & 0xff;
		}

		return result;
	}
	,paethPredictor = function(left, up, upLeft) {

		var p = left + up - upLeft,
	        pLeft = Math.abs(p - left),
	        pUp = Math.abs(p - up),
	        pUpLeft = Math.abs(p - upLeft);

		return (pLeft <= pUp && pLeft <= pUpLeft) ? left : (pUp <= pUpLeft) ? up : upLeft;
	}
	, getFilterMethods = function() {
		return [filterNone, filterSub, filterUp, filterAverage, filterPaeth];
	}
	,getIndexOfSmallestSum = function(arrays) {
		var i = 0,
			len = arrays.length,
			sum, min, ind;

		while(i < len) {
			sum = absSum(arrays[i].slice(1));

			if(sum < min || !min) {
				min = sum;
				ind = i;
			}

			i++;
		}

		return ind;
	}
	, absSum = function(array) {
		var i = 0,
			len = array.length,
			sum = 0;

		while(i < len)
			sum += Math.abs(array[i++]);

		return sum;
	}
	, logImg = function(img) {
		console.log("width: " + img.width);
		console.log("height: " + img.height);
		console.log("bits: " + img.bits);
		console.log("colorType: " + img.colorType);
		console.log("transparency:");
		console.log(img.transparency);
		console.log("text:");
		console.log(img.text);
		console.log("compressionMethod: " + img.compressionMethod);
		console.log("filterMethod: " + img.filterMethod);
		console.log("interlaceMethod: " + img.interlaceMethod);
		console.log("imgData:");
		console.log(img.imgData);
		console.log("palette:");
		console.log(img.palette);
		console.log("colors: " + img.colors);
		console.log("colorSpace: " + img.colorSpace);
		console.log("pixelBitlength: " + img.pixelBitlength);
		console.log("hasAlphaChannel: " + img.hasAlphaChannel);
	};

	jsPDFAPI.processPNG = function(imageData, imageIndex, alias, compression, dataAsBinaryString) {
		'use strict'

		var colorSpace = this.color_spaces.DEVICE_RGB,
			decode = this.decode.FLATE_DECODE,
			bpc = 8,
			img, dp, trns,
			colors, pal, smask;

		if(this.isString(imageData)) {

		}

		if(this.isArrayBuffer(imageData))
			imageData = new Uint8Array(imageData);

		if(this.isArrayBufferView(imageData)) {

			if(doesNotHavePngJS())
				throw new Error("PNG support requires png.js and zlib.js");

			img = new PNG(imageData);
			imageData = img.imgData;
			bpc = img.bits;
			colorSpace = img.colorSpace;
			colors = img.colors;

			//logImg(img);

			/*
			 * colorType 6 - Each pixel is an R,G,B triple, followed by an alpha sample.
			 *
			 * colorType 4 - Each pixel is a grayscale sample, followed by an alpha sample.
			 *
			 * Extract alpha to create two separate images, using the alpha as a sMask
			 */
			if([4,6].indexOf(img.colorType) !== -1) {

				/*
				 * processes 8 bit RGBA and grayscale + alpha images
				 */
				if(img.bits === 8) {

					var pixelsArrayType = window['Uint' + img.pixelBitlength + 'Array'],
						pixels = new pixelsArrayType(img.decodePixels().buffer),
						len = pixels.length,
						imgData = new Uint8Array(len * img.colors),
						alphaData = new Uint8Array(len),
						pDiff = img.pixelBitlength - img.bits,
						i = 0, n = 0, pixel, pbl;

					for(; i < len; i++) {
						pixel = pixels[i];
						pbl = 0;

						while(pbl < pDiff) {

							imgData[n++] = ( pixel >>> pbl ) & 0xff;
							pbl = pbl + img.bits;
						}

						alphaData[i] = ( pixel >>> pbl ) & 0xff;
					}
				}

				/*
				 * processes 16 bit RGBA and grayscale + alpha images
				 */
				if(img.bits === 16) {

					var pixels = new Uint32Array(img.decodePixels().buffer),
						len = pixels.length,
						imgData = new Uint8Array((len * (32 / img.pixelBitlength) ) * img.colors),
						alphaData = new Uint8Array(len * (32 / img.pixelBitlength) ),
						hasColors = img.colors > 1,
						i = 0, n = 0, a = 0, pixel;

					while(i < len) {
						pixel = pixels[i++];

						imgData[n++] = (pixel >>> 0) & 0xFF;

						if(hasColors) {
							imgData[n++] = (pixel >>> 16) & 0xFF;

							pixel = pixels[i++];
							imgData[n++] = (pixel >>> 0) & 0xFF;
						}

						alphaData[a++] = (pixel >>> 16) & 0xFF;
					}

					bpc = 8;
				}

				if(canCompress(compression)) {

					imageData = compressBytes(imgData, img.width * img.colors, img.colors, compression);
					smask = compressBytes(alphaData, img.width, 1, compression);

				}else{

					imageData = imgData;
					smask = alphaData;
					decode = null;
				}
			}

			/*
			 * Indexed png. Each pixel is a palette index.
			 */
			if(img.colorType === 3) {

				colorSpace = this.color_spaces.INDEXED;
				pal = img.palette;

				if(img.transparency.indexed) {

					var trans = img.transparency.indexed;

					var total = 0,
						i = 0,
						len = trans.length;

					for(; i<len; ++i)
					    total += trans[i];

					total = total / 255;

					/*
					 * a single color is specified as 100% transparent (0),
					 * so we set trns to use a /Mask with that index
					 */
					if(total === len - 1 && trans.indexOf(0) !== -1) {
						trns = [trans.indexOf(0)];

					/*
					 * there's more than one colour within the palette that specifies
					 * a transparency value less than 255, so we unroll the pixels to create an image sMask
					 */
					}else if(total !== len){

						var pixels = img.decodePixels(),
							alphaData = new Uint8Array(pixels.length),
							i = 0,
							len = pixels.length;

						for(; i < len; i++)
							alphaData[i] = trans[pixels[i]];

						smask = compressBytes(alphaData, img.width, 1);
					}
				}
			}

			if(decode === this.decode.FLATE_DECODE)
				dp = '/Predictor 15 /Colors '+ colors +' /BitsPerComponent '+ bpc +' /Columns '+ img.width;
			else
				//remove 'Predictor' as it applies to the type of png filter applied to its IDAT - we only apply with compression
				dp = '/Colors '+ colors +' /BitsPerComponent '+ bpc +' /Columns '+ img.width;

			if(this.isArrayBuffer(imageData) || this.isArrayBufferView(imageData))
				imageData = this.arrayBufferToBinaryString(imageData);

			if(smask && this.isArrayBuffer(smask) || this.isArrayBufferView(smask))
				smask = this.arrayBufferToBinaryString(smask);

			return this.createImageInfo(imageData, img.width, img.height, colorSpace,
										bpc, decode, imageIndex, alias, dp, trns, pal, smask);
		}

		return info;
	}

})(jsPDF.API)


text:
package com.tvntd.ether.api;

import java.util.List;

import org.ethereum.jsonrpc.JsonRpc.BlockResult;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.tvntd.ether.dto.AccountInfoDTO;

public interface EtherRpcApi
{
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class RpcResponse
    {
        protected String jsonRpc;
        protected String id;
        protected Object error;

        public void printJson()
        {
            try {
                ObjectMapper mapper = new ObjectMapper();
                System.out.println(mapper.writerWithDefaultPrettyPrinter()
                        .writeValueAsString(this));

            } catch(JsonProcessingException e) {
                System.out.println("Exception " + e.getMessage());
            }
        }

        /**
         * @return the jsonRpc
         */
        @JsonProperty(value = "jsonrpc")
        public String getJsonRpc() {
            return jsonRpc;
        }

        /**
         * @return the id
         */
        @JsonProperty(value = "id")
        public String getId() {
            return id;
        }

        /**
         * @return the error
         */
        @JsonProperty(value = "error")
        public Object getError() {
            return error;
        }
    }

    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class EtherAcctInfo extends RpcResponse
    {
        protected Result result;

        /**
         * @return the result
         */
        @JsonProperty(value = "result")
        public Result getResult() {
            return result;
        }

        public List<AccountInfoDTO> accountResult()
        {
            if (result != null) {
                return result.getAccounts();
            }
            return null;
        }

        public BlockResult getLatestBlock()
        {
            if (result != null) {
                return result.getLatest();
            }
            return null;
        }

        static class Result
        {
            protected List<AccountInfoDTO> accounts;
            protected BlockResult latest;
            protected String error;

            /**
             * @return the accounts
             */
            @JsonProperty(value = "accounts")
            public List<AccountInfoDTO> getAccounts() {
                return accounts;
            }

            /**
             * @return the latest
             */
            @JsonProperty(value = "latest")
            public BlockResult getLatest() {
                return latest;
            }

            /**
             * @return the error
             */
            @JsonProperty(value = "error")
            public String getError() {
                return error;
            }
        }
    }

    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class EtherAccount extends RpcResponse
    {
        protected Result result;

        /**
         * @return the accounts
         */
        @JsonProperty(value = "result")
        public Result getResult() {
            return result;
        }

        static class Result
        {
            protected List<Account> accounts;

            @JsonProperty(value = "account")
            public List<Account> getAccounts() {
                return accounts;
            }
        }

        public static class Account
        {
            protected String ownerUuid;
            protected String publicName;
            protected String passKey;
            protected String walletUuid;
            protected String account;

            /**
             * @return the ownerUuid
             */
            @JsonProperty(value = "OwnerUuid")
            public String getOwnerUuid() {
                return ownerUuid;
            }

            /**
             * @return the publicName
             */
            @JsonProperty(value = "PublicName")
            public String getPublicName() {
                return publicName;
            }

            /**
             * @return the passKey
             */
            @JsonProperty(value = "PassKey")
            public String getPassKey() {
                return passKey;
            }

            /**
             * @return the walletUuid
             */
            @JsonProperty(value = "WalletUuid")
            public String getWalletUuid() {
                return walletUuid;
            }

            /**
             * @return the account
             */
            @JsonProperty(value = "Account")
            public String getAccount() {
                return account;
            }
        }
    }
}


text:
ABCD

EFGH


text:
<?php

namespace Magento\Weee\Test\Unit\Observer;

use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
use Magento\Weee\Model\Tax as WeeeDisplayConfig;
use Magento\Tax\Model\Config as TaxConfig;

class UpdateProductOptionsObserverTest extends \PHPUnit_Framework_TestCase
{
    /**
     * Tests the methods that rely on the ScopeConfigInterface object to provide their return values
     *
     * @param array $initialArray The initial array that specifies the set of additional options
     * @param bool $weeeEnabled Whether the Weee module is assumed to be enabled
     * @param int $weeeDisplay Which Weee display is configured
     * @param int $priceDisplay Values are: including tax, excluding tax, or both including and excluding tax
     * @param array $expectedArray The revised array of the additional options
     *
     * @dataProvider updateProductOptionsProvider
     */
    public function testUpdateProductOptions($initialArray, $weeeEnabled, $weeeDisplay, $priceDisplay, $expectedArray)
    {
        $configObj = new \Magento\Framework\DataObject(
            [
                'additional_options' => $initialArray,
            ]
        );

        $weeeObject1 = new \Magento\Framework\DataObject(
            [
                'code' => 'fpt1',
                'amount' => '15.0000',
            ]
        );

        $weeeObject2 = new \Magento\Framework\DataObject(
            [
                'code' => 'fpt2',
                'amount' => '7.0000',
            ]
        );

        $weeeHelper=$this->getMock('Magento\Weee\Helper\Data', [], [], '', false);
        $weeeHelper->expects($this->any())
            ->method('isEnabled')
            ->will($this->returnValue($weeeEnabled));
        $weeeHelper->expects($this->any())
            ->method('isDisplayIncl')
            ->will($this->returnValue($weeeDisplay == WeeeDisplayConfig::DISPLAY_INCL));
        $weeeHelper->expects($this->any())
            ->method('isDisplayExclDescIncl')
            ->will($this->returnValue($weeeDisplay == WeeeDisplayConfig::DISPLAY_EXCL_DESCR_INCL));
        $weeeHelper->expects($this->any())
            ->method('isDisplayExcl')
            ->will($this->returnValue($weeeDisplay == WeeeDisplayConfig::DISPLAY_EXCL));
        $weeeHelper->expects($this->any())
            ->method('getWeeeAttributesForBundle')
            ->will($this->returnValue([['fpt1' => $weeeObject1], ['fpt1'=>$weeeObject1, 'fpt2'=>$weeeObject2]]));

        $taxHelper=$this->getMock('Magento\Tax\Helper\Data', [], [], '', false);
        $taxHelper->expects($this->any())
            ->method('displayPriceExcludingTax')
            ->will($this->returnValue($priceDisplay == TaxConfig::DISPLAY_TYPE_EXCLUDING_TAX));
        $taxHelper->expects($this->any())
            ->method('priceIncludesTax')
            ->will($this->returnValue(true));

        $responseObject=$this->getMock('Magento\Framework\Event\Observer', ['getResponseObject'], [], '', false);
        $responseObject->expects($this->any())
            ->method('getResponseObject')
            ->will($this->returnValue($configObj));

        $observerObject=$this->getMock('Magento\Framework\Event\Observer', ['getEvent'], [], '', false);
        $observerObject->expects($this->any())
            ->method('getEvent')
            ->will($this->returnValue($responseObject));

        $product = $this->getMock('\Magento\Bundle\Model\Product\Type', ['getTypeId', 'getStoreId'], [], '', false);
        $product->expects($this->any())
            ->method('getStoreId')
            ->will($this->returnValue(1));
        $product->expects($this->any())
            ->method('getTypeId')
            ->will($this->returnValue('bundle'));

        $registry=$this->getMock('Magento\Framework\Registry', [], [], '', false);
        $registry->expects($this->any())
            ->method('registry')
            ->with('current_product')
            ->will($this->returnValue($product));

        $objectManager = new ObjectManager($this);
        /** @var \Magento\Weee\Observer\UpdateProductOptionsObserver $weeeObserverObject */
        $weeeObserverObject = $objectManager->getObject(
            'Magento\Weee\Observer\UpdateProductOptionsObserver',
            [
                'weeeData' => $weeeHelper,
                'taxData' => $taxHelper,
                'registry' => $registry,
            ]
        );
        $weeeObserverObject->execute($observerObject);

        $this->assertEquals($expectedArray, $configObj->getData('additional_options'));
    }

    /**
     * @return array
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
     */
    public function updateProductOptionsProvider()
    {
        return [
            'weee not enabled' => [
                'initialArray' => [
                    'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION',
                    'optionTemplate' => '<%= data.label %><% if (data.finalPrice.value) '
                        . '{ %> +<%- data.finalPrice.formatted %><% } %>',
                ],
                'weeeEnabled' => false,
                'weeeDisplay' => WeeeDisplayConfig::DISPLAY_INCL,         // has no effect for this scenario
                'priceDisplay' => TaxConfig::DISPLAY_TYPE_EXCLUDING_TAX,  // has no effect for this scenario
                'expectedArray' => [
                    'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION',
                    'optionTemplate' => '<%= data.label %><% if (data.finalPrice.value) '
                        . '{ %> +<%- data.finalPrice.formatted %><% } %>',
                ],
            ],

            'weee enabled, and display with Weee included in the price' => [
                'initialArray' => [
                    'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION',
                    'optionTemplate' => '<%= data.label %><% if (data.basePrice.value) '
                        . '{ %> +<%- data.basePrice.formatted %><% } %>',
                ],
                'weeeEnabled' => true,
                'weeeDisplay' => WeeeDisplayConfig::DISPLAY_INCL,
                'priceDisplay' => TaxConfig::DISPLAY_TYPE_INCLUDING_TAX,
                'expectedArray' => [
                    'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION',
                    'optionTemplate' => '<%= data.label %><% if (data.basePrice.value) '
                        . '{ %> +<%- data.basePrice.formatted %><% } %>',
                ],
            ],

            'weee enabled, and display with Weee included in the price, and include the Weee descriptions' => [
                'initialArray' => [
                    'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION',
                    'optionTemplate' => '<%= data.label %><% if (data.basePrice.value) '
                        . '{ %> +<%- data.basePrice.formatted %><% } %>',
                ],
                'weeeEnabled' => true,
                'weeeDisplay' => WeeeDisplayConfig::DISPLAY_INCL_DESCR,
                'priceDisplay' => TaxConfig::DISPLAY_TYPE_INCLUDING_TAX,
                'expectedArray' => [
                    'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION',
                    'optionTemplate' => '<%= data.label %><% if (data.basePrice.value) '
                        . '{ %> +<%- data.basePrice.formatted %><% } %> <% if (data.weeePricefpt1) '
                        . '{ %>  (: <%- data.weeePricefpt1.formatted %>)<% } %> '
                        . '<% if (data.weeePricefpt2) { %>  (: <%- data.weeePricefpt2.formatted %>)<% } %>',
                ],
            ],

            'weee enabled, and display with ExclDescIncl' => [
                'initialArray' => [
                    'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION',
                    'optionTemplate' => '<%= data.label %><% if (data.basePrice.value) '
                        . '{ %> +<%- data.basePrice.formatted %><% } %>',
                ],
                'weeeEnabled' => true,
                'weeeDisplay' => WeeeDisplayConfig::DISPLAY_EXCL_DESCR_INCL,
                'priceDisplay' => TaxConfig::DISPLAY_TYPE_INCLUDING_TAX,
                'expectedArray' => [
                    'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION',
                    'optionTemplate' => '<%= data.label %><% if (data.basePrice.value) '
                        . '{ %> +<%- data.basePrice.formatted %><% } %> <% if (data.weeePricefpt1) '
                        . '{ %>  (: <%- data.weeePricefpt1.formatted %>)<% } %> '
                        . '<% if (data.weeePricefpt2) { %>  (: <%- data.weeePricefpt2.formatted %>)<% } %> '
                        . '<% if (data.weeePrice) { %><%- data.weeePrice.formatted %><% } %>',
                ],
            ],

            'weee enabled, and display prices including tax but without Weee' => [
                'initialArray' => [
                    'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION',
                ],
                'weeeEnabled' => true,
                'weeeDisplay' => WeeeDisplayConfig::DISPLAY_EXCL,
                'priceDisplay' => TaxConfig::DISPLAY_TYPE_INCLUDING_TAX,
                'expectedArray' => [
                    'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION',
                    'optionTemplate' => '<%- data.label %><% if (data.finalPrice.value) '
                        . '{ %> +<%- data.finalPrice.formatted %><% } %>',
                ],
            ],

            'weee enabled, and display prices excluding tax but without Weee' => [
                'initialArray' => [
                    'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION',
                ],
                'weeeEnabled' => true,
                'weeeDisplay' => WeeeDisplayConfig::DISPLAY_EXCL,
                'priceDisplay' => TaxConfig::DISPLAY_TYPE_EXCLUDING_TAX,
                'expectedArray' => [
                    'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION',
                    'optionTemplate' => '<%- data.label %><% if (data.basePrice.value) '
                        . '{ %> +<%- data.basePrice.formatted %><% } %>',
                ],
            ],
        ];
    }
}


text:
import {
  AllOfProps,
  AllWithRestProps,
  Props,
  PropsService,
} from './props.service';

describe('@props: service checks', () => {

  const props: Props = {
    backgroundColor: 'black',
    color: 'white',
    fontSize: 32,
  };

  const textProps: string[] = [
    'color',
    'fontSize',
  ];

  it('should retrieve all text props', () => {
    const retrievedProps: AllOfProps = PropsService.all(props, textProps);

    expect(retrievedProps).toEqual({
      color: 'white',
      fontSize: 32,
    });
  });

  it('should retrieve all text props and move rest props under `rest` key', () => {
    const retrievedProps: AllWithRestProps = PropsService.allWithRest(props, textProps);
    const { rest, ...allOf } = retrievedProps;

    expect(allOf).toEqual({
      color: 'white',
      fontSize: 32,
    });

    expect(rest).toEqual({
      backgroundColor: 'black',
    });
  });

  it('should be able to work with falsy objects', () => {
    const allRetrievedProps: AllOfProps = PropsService.all(undefined, textProps);
    const allWithRestRetrievedProps: AllWithRestProps = PropsService.allWithRest(undefined, textProps);

    expect(allRetrievedProps).toEqual({});
    expect(allWithRestRetrievedProps).toEqual({
      rest: {},
    });
  });

});


text:
/* The defaults.h file serves as a central default settings file for different machine
   types, from DIY CNC mills to CNC conversions of off-the-shelf machines. The settings
   here are supplied by users, so your results may vary. However, this should give you
   a good starting point as you get to know your machine and tweak the settings for your
   our nefarious needs. */

#ifndef defaults_h
#define defaults_h

#ifdef DEFAULTS_GENERIC
  // Grbl generic default settings. Should work across different machines.
  #define DEFAULT_X_STEPS_PER_MM 250.0
  #define DEFAULT_Y_STEPS_PER_MM 250.0
  #define DEFAULT_Z_STEPS_PER_MM 250.0
  #define DEFAULT_STEP_PULSE_MICROSECONDS 10
  #define DEFAULT_MM_PER_ARC_SEGMENT 0.1
  #define DEFAULT_RAPID_FEEDRATE 500.0 // mm/min
  #define DEFAULT_FEEDRATE 250.0
  #define DEFAULT_ACCELERATION (10.0*60*60) // 10 mm/min^2
  #define DEFAULT_JUNCTION_DEVIATION 0.05 // mm
  #define DEFAULT_STEPPING_INVERT_MASK ((1<<Y_DIRECTION_BIT)|(1<<Z_DIRECTION_BIT))
  #define DEFAULT_REPORT_INCHES 0 // false
  #define DEFAULT_AUTO_START 1 // true
  #define DEFAULT_INVERT_ST_ENABLE 0 // false
  #define DEFAULT_HARD_LIMIT_ENABLE 0  // false
  #define DEFAULT_HOMING_ENABLE 0  // false
  #define DEFAULT_HOMING_DIR_MASK 0 // move positive dir
  #define DEFAULT_HOMING_RAPID_FEEDRATE 250.0 // mm/min
  #define DEFAULT_HOMING_FEEDRATE 25.0 // mm/min
  #define DEFAULT_HOMING_DEBOUNCE_DELAY 100 // msec (0-65k)
  #define DEFAULT_HOMING_PULLOFF 1.0 // mm
  #define DEFAULT_STEPPER_IDLE_LOCK_TIME 25 // msec (0-255)
  #define DEFAULT_DECIMAL_PLACES 3
  #define DEFAULT_N_ARC_CORRECTION 25
#endif

#ifdef DEFAULTS_SHERLINE_5400
  // Description: Sherline 5400 mill with three NEMA 23 Keling  KL23H256-21-8B 185 oz-in stepper motors,
  // driven by three Pololu A4988 stepper drivers with a 30V, 6A power supply at 1.5A per winding.
  #define MICROSTEPS 2
  #define STEPS_PER_REV 200.0
  #define MM_PER_REV (0.050*MM_PER_INCH) // 0.050 inch/rev leadscrew
  #define DEFAULT_X_STEPS_PER_MM (STEPS_PER_REV*MICROSTEPS/MM_PER_REV)
  #define DEFAULT_Y_STEPS_PER_MM (STEPS_PER_REV*MICROSTEPS/MM_PER_REV)
  #define DEFAULT_Z_STEPS_PER_MM (STEPS_PER_REV*MICROSTEPS/MM_PER_REV)
  #define DEFAULT_STEP_PULSE_MICROSECONDS 10
  #define DEFAULT_MM_PER_ARC_SEGMENT 0.1
  #define DEFAULT_RAPID_FEEDRATE 635.0 // mm/min (25ipm)
  #define DEFAULT_FEEDRATE 254.0 // mm/min (10ipm)
  #define DEFAULT_ACCELERATION 50.0*60*60 // 50 mm/min^2
  #define DEFAULT_JUNCTION_DEVIATION 0.05 // mm
  #define DEFAULT_STEPPING_INVERT_MASK ((1<<Y_DIRECTION_BIT)|(1<<Z_DIRECTION_BIT))
  #define DEFAULT_REPORT_INCHES 1 // false
  #define DEFAULT_AUTO_START 1 // true
  #define DEFAULT_INVERT_ST_ENABLE 0 // false
  #define DEFAULT_HARD_LIMIT_ENABLE 0  // false
  #define DEFAULT_HOMING_ENABLE 0  // false
  #define DEFAULT_HOMING_DIR_MASK 0 // move positive dir
  #define DEFAULT_HOMING_RAPID_FEEDRATE 250.0 // mm/min
  #define DEFAULT_HOMING_FEEDRATE 25.0 // mm/min
  #define DEFAULT_HOMING_DEBOUNCE_DELAY 100 // msec (0-65k)
  #define DEFAULT_HOMING_PULLOFF 1.0 // mm
  #define DEFAULT_STEPPER_IDLE_LOCK_TIME 25 // msec (0-255)
  #define DEFAULT_DECIMAL_PLACES 3
  #define DEFAULT_N_ARC_CORRECTION 25
#endif

#ifdef DEFAULTS_SHAPEOKO
  // Description: Shapeoko CNC mill with three NEMA 17 stepper motors, driven by Synthetos
  // grblShield with a 24V, 4.2A power supply.
  #define MICROSTEPS_XY 8
  #define STEP_REVS_XY 400
  #define MM_PER_REV_XY (0.08*18*MM_PER_INCH) // 0.08 in belt pitch, 18 pulley teeth
  #define MICROSTEPS_Z 2
  #define STEP_REVS_Z 400
  #define MM_PER_REV_Z 1.250 // 1.25 mm/rev leadscrew
  #define DEFAULT_X_STEPS_PER_MM (MICROSTEPS_XY*STEP_REVS_XY/MM_PER_REV_XY)
  #define DEFAULT_Y_STEPS_PER_MM (MICROSTEPS_XY*STEP_REVS_XY/MM_PER_REV_XY)
  #define DEFAULT_Z_STEPS_PER_MM (MICROSTEPS_Z*STEP_REVS_Z/MM_PER_REV_Z)
  #define DEFAULT_STEP_PULSE_MICROSECONDS 10
  #define DEFAULT_MM_PER_ARC_SEGMENT 0.1
  #define DEFAULT_RAPID_FEEDRATE 1000.0 // mm/min
  #define DEFAULT_FEEDRATE 250.0
  #define DEFAULT_ACCELERATION (15.0*60*60) // 15 mm/min^2
  #define DEFAULT_JUNCTION_DEVIATION 0.05 // mm
  #define DEFAULT_STEPPING_INVERT_MASK ((1<<Y_DIRECTION_BIT)|(1<<Z_DIRECTION_BIT))
  #define DEFAULT_REPORT_INCHES 0 // false
  #define DEFAULT_AUTO_START 1 // true
  #define DEFAULT_INVERT_ST_ENABLE 0 // false
  #define DEFAULT_HARD_LIMIT_ENABLE 0  // false
  #define DEFAULT_HOMING_ENABLE 0  // false
  #define DEFAULT_HOMING_DIR_MASK 0 // move positive dir
  #define DEFAULT_HOMING_RAPID_FEEDRATE 250.0 // mm/min
  #define DEFAULT_HOMING_FEEDRATE 25.0 // mm/min
  #define DEFAULT_HOMING_DEBOUNCE_DELAY 100 // msec (0-65k)
  #define DEFAULT_HOMING_PULLOFF 1.0 // mm
  #define DEFAULT_STEPPER_IDLE_LOCK_TIME 255 // msec (0-255)
  #define DEFAULT_DECIMAL_PLACES 3
  #define DEFAULT_N_ARC_CORRECTION 25
#endif

#ifdef DEFAULTS_ZEN_TOOLWORKS_7x7
  // Description: Zen Toolworks 7x7 mill with three Shinano SST43D2121 65oz-in NEMA 17 stepper motors.
  // Leadscrew is different from some ZTW kits, where most are 1.25mm/rev rather than 8.0mm/rev here.
  // Driven by 30V, 6A power supply and TI DRV8811 stepper motor drivers.
  #define MICROSTEPS 8
  #define STEPS_PER_REV 200.0
  #define MM_PER_REV 8.0 // 8 mm/rev leadscrew
  #define DEFAULT_X_STEPS_PER_MM (STEPS_PER_REV*MICROSTEPS/MM_PER_REV)
  #define DEFAULT_Y_STEPS_PER_MM (STEPS_PER_REV*MICROSTEPS/MM_PER_REV)
  #define DEFAULT_Z_STEPS_PER_MM (STEPS_PER_REV*MICROSTEPS/MM_PER_REV)
  #define DEFAULT_STEP_PULSE_MICROSECONDS 10
  #define DEFAULT_MM_PER_ARC_SEGMENT 0.1
  #define DEFAULT_RAPID_FEEDRATE 2500.0 // mm/min
  #define DEFAULT_FEEDRATE 1000.0 // mm/min
  #define DEFAULT_ACCELERATION 150.0*60*60 // 150 mm/min^2
  #define DEFAULT_JUNCTION_DEVIATION 0.05 // mm
  #define DEFAULT_STEPPING_INVERT_MASK (1<<Y_DIRECTION_BIT)
  #define DEFAULT_REPORT_INCHES 0 // false
  #define DEFAULT_AUTO_START 1 // true
  #define DEFAULT_INVERT_ST_ENABLE 0 // false
  #define DEFAULT_HARD_LIMIT_ENABLE 0  // false
  #define DEFAULT_HOMING_ENABLE 0  // false
  #define DEFAULT_HOMING_DIR_MASK 0 // move positive dir
  #define DEFAULT_HOMING_RAPID_FEEDRATE 500.0 // mm/min
  #define DEFAULT_HOMING_FEEDRATE 50.0 // mm/min
  #define DEFAULT_HOMING_DEBOUNCE_DELAY 100 // msec (0-65k)
  #define DEFAULT_HOMING_PULLOFF 1.0 // mm
  #define DEFAULT_STEPPER_IDLE_LOCK_TIME 25 // msec (0-255)
  #define DEFAULT_DECIMAL_PLACES 3
  #define DEFAULT_N_ARC_CORRECTION 25
#endif

#endif


text:
namespace OpenQA.Selenium.DevTools.DOM
{
    using Newtonsoft.Json;

    ///
    /// Returns node id at given location. Depending on whether DOM domain is enabled, nodeId is
    /// either returned or not.
    ///
    public sealed class GetNodeForLocationCommandSettings : ICommand
    {
        private const string DevToolsRemoteInterface_CommandName = "DOM.getNodeForLocation";

        [JsonIgnore]
        public string CommandName
        {
            get { return DevToolsRemoteInterface_CommandName; }
        }

        ///
        /// X coordinate.
        ///
        [JsonProperty("x")]
        public long X
        {
            get;
            set;
        }
        ///
        /// Y coordinate.
        ///
        [JsonProperty("y")]
        public long Y
        {
            get;
            set;
        }
        ///
        /// False to skip to the nearest non-UA shadow root ancestor (default: false).
        ///
        [JsonProperty("includeUserAgentShadowDOM", DefaultValueHandling = DefaultValueHandling.Ignore)]
        public bool? IncludeUserAgentShadowDOM
        {
            get;
            set;
        }
    }

    public sealed class GetNodeForLocationCommandResponse : ICommandResponse<GetNodeForLocationCommandSettings>
    {
        ///
        /// Resulting node.
        ///
        [JsonProperty("backendNodeId")]
        public long BackendNodeId
        {
            get;
            set;
        }
        ///
        /// Id of the node at given coordinates, only when enabled and requested document.
        ///
        [JsonProperty("nodeId", DefaultValueHandling = DefaultValueHandling.Ignore)]
        public long? NodeId
        {
            get;
            set;
        }
    }
}


text:
import {NgModule} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {MatButtonModule} from '@angular/material/button';
import {MatInputModule} from '@angular/material/input';
import {MatSelectModule} from '@angular/material/select';
import {MatSnackBarModule} from '@angular/material/snack-bar';
import {
  PizzaPartyComponent,
  SnackBarComponentExample,
} from './snack-bar-component/snack-bar-component-example';
import {
  PizzaPartyAnnotatedComponent,
  SnackBarAnnotatedComponentExample,
} from './snack-bar-annotated-component/snack-bar-annotated-component-example';
import {SnackBarOverviewExample} from './snack-bar-overview/snack-bar-overview-example';
import {SnackBarPositionExample} from './snack-bar-position/snack-bar-position-example';
import {SnackBarHarnessExample} from './snack-bar-harness/snack-bar-harness-example';

export {
  SnackBarAnnotatedComponentExample,
  SnackBarComponentExample,
  SnackBarHarnessExample,
  SnackBarOverviewExample,
  SnackBarPositionExample,
  PizzaPartyComponent,
  PizzaPartyAnnotatedComponent,
};

const EXAMPLES = [
  SnackBarComponentExample,
  SnackBarHarnessExample,
  SnackBarOverviewExample,
  SnackBarPositionExample,
  SnackBarAnnotatedComponentExample,
];

@NgModule({
  imports: [FormsModule, MatButtonModule, MatInputModule, MatSelectModule, MatSnackBarModule],
  declarations: [...EXAMPLES, PizzaPartyComponent, PizzaPartyAnnotatedComponent],
  exports: EXAMPLES,
})
export class SnackBarExamplesModule {}