text:
package Nfsources;

use strict;
use warnings;
use Log;

use NfSenRC;

sub ValidateSources {

	# Bundle the sources in the number of collectors since
	# nfcapd 1.6.x can handle several sources at the same port
	my %AllCollectors;
	foreach my $source ( sort keys %NfConf::sources ) {
		my $port = $NfConf::sources{$source}{'port'};
		push @{$AllCollectors{$port}}, $source;
	}

	foreach my $port ( keys %AllCollectors ) {
		# no collector
		if ( $port == 0 ) {
			next;
		}

		my $identref 	= $AllCollectors{$port};
		my $ident 		= $$identref[0];
		my $type		= exists $NfConf::sources{$ident}{'type'} ? $NfConf::sources{$ident}{'type'}: 'netflow';
		my $collector 	= $NfSenRC::CollectorMap{$type};

		if ( !defined $NfSenRC::CollectorMap{$type} ) {
			print "Source '$ident': unknown collector for type '$type'";
			return 0;
		} elsif ( ! -f "$NfConf::PREFIX/$collector" ) {
			print "Source '$ident': missing collector '$collector' for type '$type'";
			return 0;
		}

		foreach $ident ( @$identref ) {
			my $len = length($ident);
			if ( $len < 1 || $len > 19 ) {
				print "Error Ident: '$ident': Source identifiers must be between 1 and 19 chars long!\n";
				return 0;
			}
			if ( $ident =~ /[^a-z0-9_\-]+/i ) {
				print "Error Ident: '$ident': Source identifiers must contain only characters [a-zA-Z0-9_-] !\n";
				return 0;
			}

			if ( exists $NfConf::sources{$ident}{'type'} && $NfConf::sources{$ident}{'type'} ne $type ) {
				print "\nError: $ident has different type than $$identref[0] for same collector.\n";
				return 0;
			}
			if ( scalar @$identref > 1 && !exists $NfConf::sources{$ident}{'IP'} ) {
				print "\nError: $ident missing parameter 'IP' for multiple sources collector.\n";
				return 0;
			}
			my $IP = $NfConf::sources{$ident}{'IP'};
		}
	}

	return 1;

} # End of ValidateSources

sub CheckReconfig {

	if ( !ValidateSources() ) {
		return 2;
	}
	# profile 'live' contains by definition all netflow sources currently in use.
	my %profileinfo = NfProfile::ReadProfile('live', '.');
	if ( $profileinfo{'status'} eq 'empty' ) {
		# it's an error reading this profile
		print STDERR "Error reading profile 'live'";
		if ( defined $Log::ERROR ) {
			print STDERR ": $Log::ERROR";
		}
		print STDERR "\n";
		return 2;
	}

	my @current_sources = NfProfile::ProfileChannels(\%profileinfo);
    my %_tmp;
    @_tmp{@current_sources} = 1;

	# Building source lists
	foreach my $source ( keys %NfConf::sources ) {
		if ( exists $_tmp{$source} ) {
			delete $_tmp{$source};
		} else {
			return 0;
		}
	}

	if ( scalar keys %_tmp > 0 ) {
		return 0;
	}

	return 1;

} # End of CheckReconfig

sub Reconfig {

	if ( scalar(keys %NfConf::sources) == 0 ) {
		print STDERR "Error: No sources defined!";
		return;
	}

	# profile 'live' contains by definition all netflow sources currently in use.
	my %profileinfo = NfProfile::ReadProfile('live', '.');
	if ( $profileinfo{'status'} eq 'empty' ) {
		# it's an error reading this profile
		print STDERR "Error reading profile 'live'";
		if ( defined $Log::ERROR ) {
			print STDERR ": $Log::ERROR";
		}
		print STDERR "\n";
		return;
	}

	my @current_sources = NfProfile::ProfileChannels(\%profileinfo);

    my %_tmp;
    @_tmp{@current_sources} = 1;

	# Building source lists
	my @AddSourceList;
	my @DeleteSourceList;
	foreach my $source ( sort keys %NfConf::sources ) {
		if ( exists $_tmp{$source} ) {
			delete $_tmp{$source};
		} else {
			push @AddSourceList, $source;
		}
	}
	@DeleteSourceList = keys %_tmp;

	# Nothing to do ?
	if ( (scalar @AddSourceList) == 0 && (scalar @DeleteSourceList) == 0 ) {
		print "Reconfig: No changes found!\n";
		$profileinfo{'locked'} = 0;
		if ( !NfProfile::WriteProfile(\%profileinfo) ) {
			print STDERR "Error writing profile 'live': $Log::ERROR\n";
		}
		return;
	}

	foreach my $source ( @AddSourceList ) {
		my $ret = NfSen::ValidFilename($source);
		if ( $ret ne "ok" ) {
			print STDERR "Error checking source name: $ret\n";
			return;
		}
	}

	# Confirm add/delete sources
	print "New sources to configure : ", join(' ', @AddSourceList), "\n" if scalar @AddSourceList;
	print "Remove configured sources: ", join(' ', @DeleteSourceList), "\n" if scalar @DeleteSourceList;
	if ( NfSen::UserInput("Continue?") ne 'y') {
		print "Faire enough! - Nothing changed!\n";
		$profileinfo{'locked'} = 0;
		if ( !NfProfile::WriteProfile(\%profileinfo) ) {
			print STDERR "Error writing profile 'live': $Log::ERROR\n";
		}
		return;
	}
	print "\n";

	my %StopCollectorList;
	my %StartCollectorList;
	my %AllCollectors;
	foreach my $source ( sort keys %NfConf::sources ) {
		my $port = $NfConf::sources{$source}{'port'};
		push @{$AllCollectors{$port}}, $source;
	}

	# lock live profile
	%profileinfo = NfProfile::LockProfile('live', '.');
	if ( $profileinfo{'status'} eq 'empty' ) {
		# profile already locked and in use
		if ( $profileinfo{'locked'} == 1 ) {
			print STDERR "Profile 'live' is locked. Try later\n";
			return;
		}

		# it's an error reading this profile
		if ( defined $Log::ERROR ) {
			print STDERR "Error profile 'live': $Log::ERROR\n";
			return;
		}
	}

	# Add all new netflow sources
	if ( scalar @AddSourceList > 0 ) {
		# Add sources
		my $now = time();
		my $tstart = $now - ( $now % $NfConf::CYCLETIME );
		foreach my $source ( @AddSourceList ) {
			print "Add source '$source'";
			my $ret = NfProfile::AddChannel(\%profileinfo, $source, '+', 0, $NfConf::sources{$source}{'col'}, $source, []);
			if ( $ret eq "ok" ) {
				my $port = $NfConf::sources{$source}{'port'};
				# Do we need to start/restart a collector on that port?
				if ( NfSenRC::CollectorStatus($port) > 0 ) {
					# we already have a collector running - need to restart with new source added
					$StopCollectorList{$port}  = 1;	# mark to be started
					$StartCollectorList{$port} = 1; # mark to be stopped
				} else {
					# no collector is running - start a new one
					$StartCollectorList{$port} = 1;	# mark to be started
				}
			} else {
				print "Error while setting up channel '$source': $ret";
				print "No collector started! ";
			}
			print "\n";
		}
		print "\n";
	}

	# Delete sources, no longer configured
	if ( scalar @DeleteSourceList > 0 ) {
		print "Delete source(s): ", join(' ', @DeleteSourceList), ":\n";
		# Delete sources
		foreach my $source ( @DeleteSourceList ) {
			print "Delete source '$source' ";
			# Stop this collector if not already done
			my $port = $$NfSen::hints{'sources'}{$source};
			if ( NfSenRC::CollectorStatus($port) > 0 ) {
				# Properly stop collector before deleting the channel
				print "Stop running collector on port '$port' ";
				NfSenRC::StopCollector($port);
				$StopCollectorList{$port} = 2;	# mark as already stopped
			}

			# Do we need to restart the collector on this for for other
			# still existing sources?
			if ( exists $AllCollectors{$port} ) {
				$StartCollectorList{$port} = 1;	# mark to be started
			}

			my $ret = NfProfile::DeleteChannel(\%profileinfo, $source);
			if ( $ret ne "ok" ) {
				print "\nError while removing channel '$source': $ret\n";
			}
			print " \n";
		}
	}

	# Unlock/Write profile
	$profileinfo{'locked'} = 0;
	if ( !NfProfile::WriteProfile(\%profileinfo) ) {
		print STDERR "Error writing profile 'live': $Log::ERROR\n";
	}

	if ( !-f "$NfConf::PIDDIR/nfsend.pid") {
		# NfSen is not running - we are done
		print "Reconfig done!\n";
		delete $$NfSen::hints{'sources'};
		foreach my $source ( sort keys %NfConf::sources ) {
			$$NfSen::hints{'sources'}{$source} = $NfConf::sources{$source}{'port'};
		}
		return;
	}

	# Collector Jojo ...
	my $port;
	foreach $port ( keys %StopCollectorList ) {
		# Stop running collectors if not already done so
		if ( ($StopCollectorList{$port} == 1) && (NfSenRC::CollectorStatus($port) > 0) ) {
			print "Stop running collector on port '$port' ";
			NfSenRC::StopCollector($port);
		print "\n";
		}
	}
	foreach $port ( keys %StartCollectorList ) {
		if ( NfSenRC::CollectorStatus($port) > 0) {
			# Ups .. should not happen - something fishy!
			print STDERR "A collector on port '$port' is already running! Unclean reconfig\n";
			# give it another try to die
			NfSenRC::StopCollector($port);
		}
		print "Start/restart collector on port '$port' for ";
		NfSenRC::StartCollector($port);
		print "\n";
	}

	print "\n";

	delete $$NfSen::hints{'sources'};
	foreach my $source ( sort keys %NfConf::sources ) {
		$$NfSen::hints{'sources'}{$source} = $NfConf::sources{$source}{'port'};
	}

	NfSenRC::NfSen_reload();

} # End of Reconfig

1;


text:
import * as gulp from 'gulp';
import gulp_rename = require('gulp-rename');
import * as path from 'path';
import { output_extname, output_relative_es_sub_dirname } from './constants';
import { create_transform } from './create-transform';

export function generate_es_files(
  glob_files: string,
  on_error: (error: Error) => void = error => {
    throw error;
  },
  on_end: () => void = () => {
    /* do nothing */
  },
) {
  return gulp
    .src(glob_files)
    .pipe(
      create_transform(filename => {
        const basename = path.basename(filename).split('.')[0];
        return `import ${basename} = require("../src/${basename}");\nexport default ${basename};`;
      }),
    )
    .on('error', on_error)
    .on('end', on_end)
    .pipe(
      gulp_rename(the_path => {
        the_path.basename = the_path.basename!.replace(/\.[a-z]$/, '');
        the_path.extname = output_extname;
      }),
    )
    .pipe(gulp.dest(output_relative_es_sub_dirname));
}

redpajama_set_name: RedPajamaGithub


text:
package be.enabling.callbackplayground.service;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import be.enabling.callbackplayground.App;
import be.enabling.callbackplayground.dto.CallbackDataDTO;

/**
 * Service which will trigger its action when it is called after a callback has been triggered.
 */
public class ActionTriggerer {

    public void triggerAction(CallbackDataDTO dto) {
        // TODO: update this block to do something useful with callback data
        LOG.info("New data inserted: " + dto);
    }

    private static final Log LOG = LogFactory.getLog(App.class);
}


text:
"""
wigiki
------

Static html site generator that uses Github's Gists as pages.

Installation
------------

    pip install wigiki

Usage
-----

Run with:

    wigiki

For all available options use:

    wigiki --help

Example:

    wigiki -t templates/default -o _site

"""

import os
import sys
from setuptools import setup
import wigiki

with open("requirements.txt") as fp:
    requirements = fp.read().splitlines()

# default template files
tpl_path = "wigiki"
if os.name is 'posix':
    if sys.prefix.split(os.sep)[1] == 'usr':
        tpl_path = "/usr/share/wigiki"

tpl_files = [
    (os.path.join(tpl_path, "templates", "default"),
        ["templates/default/index.html",
        "templates/default/base.html",
        "templates/default/page.html"]
    ),
    (os.path.join(tpl_path, "templates", "default", "assets"),
        ["templates/default/assets/style.css"]
    )
]

setup(
    name="wigiki",
    version=wigiki.__version__,
    description=wigiki.__doc__.strip(),
    long_description=__doc__,
    url="https://github.com/tlatsas/wigiki",
    author="Tasos Latsas",
    author_email="tlatsas@gmx.com",
    license="MIT",
    packages=["wigiki"],
    install_requires=requirements,
    entry_points = {
        "console_scripts": [
            "wigiki = wigiki.__main__:main",
        ],
    },
    classifiers = [
        "Development Status :: 4 - Beta",
        "Environment :: Console",
        "Intended Audience :: Developers",
        "Intended Audience :: End Users/Desktop",
        "Programming Language :: Python",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
        "License :: OSI Approved :: MIT License",
        "Topic :: Internet",
    ],
    data_files=tpl_files
)


text: Experiments and testing


text:
{% extends "helpdesk/public_base.html" %}{% load i18n bootstrap %}{% load url from future %}

{% block helpdesk_body %}

{% if kb_categories %}

{% trans "Knowledgebase Articles" %}

{% trans "Knowledgebase Categories" %}

{% trans "Category" %}

{% for category in kb_categories %}

{{ category.title }}

{{ category.description }}

{% endfor %}

{% endif %}

{% if helpdesk_settings.HELPDESK_SUBMIT_A_TICKET_PUBLIC %}

{% trans "Submit a Ticket" %}

{% trans "All fields are required. Please provide as descriptive a title and description as possible." %}

<form role="form" method='post' action='./#submit' enctype='multipart/form-data'>
<fieldset>
        {{ form|bootstrap }}
        {% comment %}
        {% for field in form %}

            {% if field.is_hidden %}
                {{ field }}
            {% else %}

                {{ field.label }}{% if not field.field.required %} {% trans "(Optional)" %}{% endif %}

{{ field }}

                {% if field.errors %}
{{ field.errors }}
{% endif %}
                {% if field.help_text %}{{ field.help_text }}{% endif %}

        {% endif %}

        {% endfor %}
        {% endcomment %}

        <input type='submit' class="btn btn-primary" value='{% trans "Submit Ticket" %}' />

</fieldset>

{% csrf_token %}</form>

{% endif %}

{% if not helpdesk_settings.HELPDESK_VIEW_A_TICKET_PUBLIC and not helpdesk_settings.HELPDESK_SUBMIT_A_TICKET_PUBLIC %}

{% trans "Please use button at upper right to login first." %}

{% endif %}

{% if helpdesk_settings.HELPDESK_VIEW_A_TICKET_PUBLIC %}

{% trans "View a Ticket" %}

<form method='get' action="{% url 'helpdesk_public_view' %}">
<fieldset>

        {% trans "Ticket" %}

<input type='text' name='ticket' />

        {% trans "Your E-mail Address" %}

<input type='text' name='email' />

    <input type='submit' class="btn btn-primary"  value='{% trans "View Ticket" %}' />

</fieldset>
{% csrf_token %}</form>

{% endif %}

{% endblock %}


text:
<!--
 -
 - Copyright (C) 2014 Twobo Technologies AB
 -
 - 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.
 -->

# Stockholm Java User Group Meeting Demo Files

> This repository contains the code samples used during the presentation given by [Travis Spencer][travis] to the Stockholm Java user group meeting on December 11, 2014.

## Simple Examples

The simples examples (1 -7) are all in seperate Java files. To test them, do the following:

1. Build the code (`mvn package`).
2. Execute the example (e.g., `java java_meetup_spark_demo.Example01_Hello_World`); this will start the Web API.
3. Run the corresponding script (e.g., `scripts/Example01_Hello_World`) which will curl a request to the API.

All of these simple examples are [based on the ones distributed with Spark][spark].

## More Complex Example

In the Example08 source directory, you will find an example that adds some useful functionality on top of Spark:

* Pico container integration, including hierarchical dependency resolution
* Simplified programming model for creating controllers
* Syntactic sugar to beautify Spark's syntax for defining routes

### Pico Integration

The Pico integration is handled in the `Application` class. On application startup, session creation, and request initiation, the `ContainerComposer`'s respective static methods will be called to wire-up any app-, session-, and request-level dependencies. These will be passed on to the controllers and other objects.

### Controllers

A controller is a class that implements the `Controllable` interface. This interface defines all the methods that a Web API might want to respond to (e.g., `get`, `post`, etc.). This interface uses Java 8's new `default` keyword on *all* of these methods, effectively making it an abstract class rather than an interface. Consequently, a controller only needs to override the methods it wishes to handle; the others will not be routed. For each method that is overloaded, the `Router` (a derivative of Spark's router) will reflectively wire-up the overload to the given endpoint.

The net effect is that message handling for an endpoint is packaged up in a Controller class (e.g., see `FooController` below), and the routes are kept together in the microservice's `Application` class.

## Examples of an Application and a Controller

### Application Example

```java
public class Application implements SparkApplication
{
    private final DefaultPicoContainer appContainer;

    public Application() throws ConfigurationException
    {
        appContainer = new DefaultPicoContainer();

        ContainerComposer.composeApplication(appContainer);
    }

    @Override
    public void init()
    {
        route("/login").to(LoginController.class, usingContainer(appContainer), renderedWith("login.vm"));
        route("/foo").to(FooController.class, usingContainer(appContainer), renderedWith("foo.vm"));
        // Etc.
    }
}
```

### Controller Example

```java
public class FooController implements Controllable
{
    @Override
    public boolean before(Request request, Response response)
    {
        if (request.session(false) == null)
        {
            response.redirect("/login");

            return false;
        }

        return true;
    }

    @Override
    public boolean get(Request request, Response response, final Map<String, Object> model)
    {
        Map<String, String> data = new HashMap<>();

        data.put("e1", "e1 value");
        data.put("e2", "e2 value");
        data.put("e3", "e3 value");

        model.put("user", "tspencer");
        model.put("data", data);

        return true;
    }
}
```

## More Information

For more information, check out the [Spark home page][spark-home-page] and read through [the documentation][spark-docs]. For questions or info on these examples or the micro-micro framework in Example08, contract [Travis Spencer][travis].

[spark]: https://github.com/perwendel/spark
[spark-home-page]: http://sparkjava.com/
[spark-docs]: http://sparkjava.com/documentation.html
[travis]: http://travisspencer.com/contact-me.html


text:
<?php

namespace Concrete\Core\Notification\View;

use Concrete\Core\Entity\Notification\GroupSignupRequestDeclineNotification;
use Concrete\Core\Support\Facade\Facade;
use Concrete\Core\User\Group\Group;
use HtmlObject\Element;

class GroupSignupRequestDeclineListView extends StandardListView
{

    /**
     * @var GroupSignupRequestDeclineNotification
     */
    protected $notification;

    public function getTitle()
    {
        return t('Group declined signup requests');
    }

    public function getIconClass()
    {
        return 'fa fa-user';
    }

    public function getActionDescription()
    {
        $app = Facade::getFacadeApplication();
        $resolver = $app->make('url/manager');

        $user = $this->notification->getSignupRequestDecline()->getUser();
        $group = $this->notification->getSignupRequestDecline()->getGroup();
        $manager = $this->notification->getSignupRequestDecline()->getManager();

        return t('User %s declined the request to signup the group %s from user %s.',
            $resolver->resolve([$manager->getUserInfoObject()]),
            $manager->getUserName(),
            $group->getGroupName(),
            $resolver->resolve([$user->getUserInfoObject()]),
            $user->getUserName()
        );
    }

    protected function getRequestedByElement()
    {
        return new Element('span', t('Created By '));
    }

}


text:
package com.androidbook.utils;

public class Utils {

	public static boolean IsEmpty(String friends) {
		if(friends==null || friends.equals("")){
			return true;
		}
		return false;
	}
	public static String pad(String field){
		StringBuffer sb = new StringBuffer();
		sb.append("'").append(field).append("'");
		return sb.toString();

	}
}


text:
const Reply = require('./reply');

module.exports = (...args) => new Reply('render', ...args);


text:
module Representer
  module Element
    class Field
      attr_reader :name, :type

      def initialize(name, type)
        @name = name
        @type = type
      end
    end
  end
end


text:
/*******************************************************************************
  USB CDC class definitions

  Company:
    Microchip Technology Inc.

  File Name:
    usb_cdc.h

  Summary:
    USB CDC class definitions

  Description:
    This file describes the CDC class specific definitions. This file is
    included by usb_device_cdc.h and usb_host_cdc.h header files. The
    application can include this file if it needs to use any USB CDC Class
    definitions.
*******************************************************************************/

//DOM-IGNORE-BEGIN
/*******************************************************************************
* Copyright (C) 2018 Microchip Technology Inc. and its subsidiaries.
*
* Subject to your compliance with these terms, you may use Microchip software
* and any derivatives exclusively with Microchip products. It is your
* responsibility to comply with third party license terms applicable to your
* use of third party software (including open source software) that may
* accompany Microchip software.
*
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
* EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
* WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
* PARTICULAR PURPOSE.
*
* IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
* INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
* WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
* BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
* FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
* ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
 *******************************************************************************/
// DOM-IGNORE-END

#ifndef _USB_CDC_H
#define _USB_CDC_H

// DOM-IGNORE-BEGIN
#ifdef __cplusplus  // Provide C++ Compatibility

    extern "C" {

#endif
// DOM-IGNORE-END

// *****************************************************************************
// *****************************************************************************
// Section: Included Files
// *****************************************************************************
// *****************************************************************************

// *****************************************************************************
// *****************************************************************************
// Section: Constants
// *****************************************************************************
// *****************************************************************************

// *****************************************************************************
/* CDC Interface Class Subclass and Protocol constants.

  Summary:
    Identifies the CDC Interface Class, Subclass and protocol constants.

  Description:
    These constants identify the CDC Interface Class, Subclass and protocol
    constants.

  Remarks:
    None.
*/

#define USB_CDC_CLASS_CODE                              0x02
#define USB_CDC_SUBCLASS_CODE                           0x00
#define USB_CDC_COMMUNICATIONS_INTERFACE_CLASS_CODE     0x02
#define USB_CDC_DATA_INTERFACE_CLASS_CODE               0x0A
#define USB_CDC_DATA_INTERFACE_SUBCLASS_CODE            0x00
#define USB_CDC_DATA_INTERFACE_PROTOCOL                 0x00
#define CS_INTERFACE                                    0x24

/* Bit code information in line state */
#define USB_CDC_LINESTATE_CARRIER                       0

/* Bit code information in line state */
#define USB_CDC_LINESTATE_DTR                           1

/* CDC specific request */
#define USB_CDC_REQUEST_CLASS_SPECIFIC                  0x20

// *****************************************************************************
/* CDC ACM capabilities.

  Summary:
    Identifies the CDC ACM sub-class capabilities.

  Description:
    This enumeration identifies the CDC ACM sub-class capabilities.

  Remarks:
    This value goes into the bDescriptorSubtype of CDC functional descriptor.
*/

#define USB_CDC_ACM_SUPPORT_NONE                                     ( 0 )
#define USB_CDC_ACM_SUPPORT_COMM_FEATURE                             ( 1 << 0 )
#define USB_CDC_ACM_SUPPORT_LINE_CODING_LINE_STATE_AND_NOTIFICATION  ( 1 << 1 )
#define USB_CDC_ACM_SUPPORT_BREAK                                    ( 1 << 2 )
#define USB_CDC_ACM_SUPPORT_NETWORK_NOTIFICATION                     ( 1 << 3 )

// *****************************************************************************
// *****************************************************************************
// Section: Data Types
// *****************************************************************************
// *****************************************************************************

// *****************************************************************************
/* CDC Communication interface subclass codes

  Summary:
    Identifies the subclass codes for communication interface.

  Description:
    This enumeration identifies the possible subclass codes for CDC
    communication interface

  Remarks:
    None.
*/

typedef enum
{
    USB_CDC_SUBCLASS_DIRECT_LINE_CONTROL_MODEL     = 0x01,
    USB_CDC_SUBCLASS_ABSTRACT_CONTROL_MODEL        = 0x02,
    USB_CDC_SUBCLASS_TELEPHONE_CONTROL_MODEL       = 0x03,
    USB_CDC_SUBCLASS_MULTI_CHANNEL_CONTROL_MODEL   = 0x04,
    USB_CDC_SUBCLASS_CAPI_CONTROL_MODEL            = 0x05,
    USB_CDC_SUBCLASS_ETH_NW_CONTROL_MODEL          = 0x06,
    USB_CDC_SUBCLASS_ATM_NW_CONTROL_MODEL          = 0x07,
    USB_CDC_SUBCLASS_WL_HANDSET_CONTROL_MODEL      = 0x08,
    USB_CDC_SUBCLASS_DEV_MANAGEMENT_CONTROL_MODEL  = 0x09,
    USB_CDC_SUBCLASS_MOBILE_DL_CONTROL_MODEL       = 0x0A,
    USB_CDC_SUBCLASS_OBEX                          = 0x0B,
    USB_CDC_SUBCLASS_ETH_EMULATION_MODEL           = 0x0C

} USB_CDC_SUBCLASS;

// *****************************************************************************
/* CDC notification codes

  Summary:
    Identifies the notification codes available for CDC.

  Description:
    This enumeration identifies the possible notification codes available for
    CDC.

  Remarks:
    None.
*/

typedef enum
{
    USB_CDC_NOTIFICATION_NETWORK_CONNECTION        = 0x00,
    USB_CDC_NOTIFICATION_RESPONSE_AVAILABLE        = 0x01,
    USB_CDC_NOTIFICATION_AUX_JACK_HOOK_STATE       = 0x08,
    USB_CDC_NOTIFICATION_RING_DETECT               = 0x09,
    USB_CDC_NOTIFICATION_SERIAL_STATE              = 0x20,
    USB_CDC_NOTIFICATION_CALL_STATE_CHANGE         = 0x28,
    USB_CDC_NOTIFICATION_LINE_STATE_CHANGE         = 0x29,
    USB_CDC_NOTIFICATION_CONNECTION_SPEED_CHANGE   = 0x2A

} USB_CDC_NOTIFICATION;

// *****************************************************************************
/* CDC request codes

  Summary:
    Identifies the CDC specific request codes.

  Description:
    This enumeration identifies the possible CDC specific request codes.

  Remarks:
    None.
*/

typedef enum
{
    USB_CDC_REQUEST_SEND_ENCAPSULATED_COMMAND               = 0x00,
    USB_CDC_REQUEST_GET_ENCAPSULATED_RESPONSE               = 0x01,
    USB_CDC_REQUEST_SET_COMM_FEATURE                        = 0x02,
    USB_CDC_REQUEST_GET_COMM_FEATURE                        = 0x03,
    USB_CDC_REQUEST_CLEAR_COMM_FEATURE                      = 0x04,
    USB_CDC_REQUEST_SET_AUX_LINE_STATE                      = 0x10,
    USB_CDC_REQUEST_SET_HOOK_STATE                          = 0x11,
    USB_CDC_REQUEST_PULSE_SETUP                             = 0x12,
    USB_CDC_REQUEST_SEND_PULSE                              = 0x13,
    USB_CDC_REQUEST_SET_PULSE_TIME                          = 0x14,
    USB_CDC_REQUEST_RING_AUX_JACK                           = 0x15,
    USB_CDC_REQUEST_SET_LINE_CODING                         = 0x20,
    USB_CDC_REQUEST_GET_LINE_CODING                         = 0x21,
    USB_CDC_REQUEST_SET_CONTROL_LINE_STATE                  = 0x22,
    USB_CDC_REQUEST_SEND_BREAK                              = 0x23,
    USB_CDC_REQUEST_SET_RINGER_PARMS                        = 0x30,
    USB_CDC_REQUEST_GET_RINGER_PARMS                        = 0x31,
    USB_CDC_REQUEST_SET_OPERATIONAL_PARMS                   = 0x32,
    USB_CDC_REQUEST_GET_OPERATIONAL_PARMS                   = 0x33,
    USB_CDC_REQUEST_SET_LINE_PARMS                          = 0x34,
    USB_CDC_REQUEST_GET_LINE_PARMS                          = 0x35,
    USB_CDC_REQUEST_DIAL_DIGITS                             = 0x36,
    USB_CDC_REQUEST_SET_UNIT_PARAMETER                      = 0x37,
    USB_CDC_REQUEST_GET_UNIT_PARAMETER                      = 0x38,
    USB_CDC_REQUEST_CLEAR_UNIT_PARAMETER                    = 0x39,
    USB_CDC_REQUEST_GET_PROFILE                             = 0x3A,
    USB_CDC_REQUEST_SET_ETHERNET_MULTICAST_FILTERS          = 0x40,
    USB_CDC_REQUEST_SET_ETHERNET_POWER_MANAGEMENT_FILTER    = 0x41,
    USB_CDC_REQUEST_GET_ETHERNET_POWER_MANAGEMENT_FILTER    = 0x42,
    USB_CDC_REQUEST_SET_ETHERNET_PACKET_FILTER              = 0x43,
    USB_CDC_REQUEST_GET_ETHERNET_STATISTIC                  = 0x44,
    USB_CDC_REQUEST_SET_ATM_DATA_FORMAT                     = 0x50,
    USB_CDC_REQUEST_GET_ATM_DEVICE_STATISTICS               = 0x51,
    USB_CDC_REQUEST_SET_ATM_DEFAULT_VC                      = 0x52,
    USB_CDC_REQUEST_GET_ATM_VC_STATISTICS                   = 0x53,
    USB_CDC_REQUEST_NONE                                    = 0xFF

} USB_CDC_REQUEST;

// *****************************************************************************
/* CDC protocol codes

  Summary:
    Identifies the protocol codes.

  Description:
    This enumeration identifies the possible protocol codes for CDC.

  Remarks:
    None.
*/

typedef enum
{
    USB_CDC_PROTOCOL_NO_CLASS_SPECIFIC      = 0x00,
    USB_CDC_PROTOCOL_AT_V250                = 0x01,
    USB_CDC_PROTOCOL_AT_PCCA                = 0x02,
    USB_CDC_PROTOCOL_AT_PCCA_ANNEX_O        = 0x03,
    USB_CDC_PROTOCOL_AT_GSM                 = 0x04,
    USB_CDC_PROTOCOL_AT_3GPP                = 0x05,
    USB_CDC_PROTOCOL_AT_CDMA                = 0x06,
    USB_CDC_PROTOCOL_ETH_EMULATION          = 0x07,
    USB_CDC_PROTOCOL_EXTERNAL               = 0xFE,
    USB_CDC_PROTOCOL_VENDOR_SPECIFIC        = 0xFF

} USB_CDC_INF_PROTOCOL;

// *****************************************************************************
/* CDC descriptor type.

  Summary:
    Identifies the descriptor types in the CDC.

  Description:
    This enumeration identifies the descriptor types in the CDC.

  Remarks:
    This value goes into the bDescriptorType of CDC functional descriptor.
*/

typedef enum
{
    USB_CDC_DESC_CS_INTERFACE       = 0x24,
    USB_CDC_DESC_CS_ENDPOINT        = 0x25

} USB_CDC_DESCRIPTOR_TYPE;

// *****************************************************************************
/* CDC function header type.

  Summary:
    Identifies the CDC function header type.

  Description:
    This enumeration identifies the CDC function header type.

  Remarks:
    This value goes into the bDescriptorSubtype of CDC functional descriptor.
*/

typedef enum
{
    USB_CDC_FUNCTIONAL_HEADER                                   = 0x00,
    USB_CDC_FUNCTIONAL_CALL_MANAGEMENT                          = 0x01,
    USB_CDC_FUNCTIONAL_ABSTRACT_CONTROL_MANAGEMENT              = 0x02,
    USB_CDC_FUNCTIONAL_DIRECT_LINE                              = 0x03,
    USB_CDC_FUNCTIONAL_TELEPHONE_RINGER                         = 0x04,
    USB_CDC_FUNCTIONAL_TELEPHONE_CALL_AND_LINE_STATE_REPORTING  = 0x05,
    USB_CDC_FUNCTIONAL_UNION                                    = 0x06,
    USB_CDC_FUNCTIONAL_COUNTRY_SELECT                           = 0x07,
    USB_CDC_FUNCTIONAL_TELEPHONE_OPERATIONAL_MODES              = 0x08,
    USB_CDC_FUNCTIONAL_USB_TERMINAL                             = 0x09,
    USB_CDC_FUNCTIONAL_NETWORK_CHANNEL_TERMINAL                 = 0x0A,
    USB_CDC_FUNCTIONAL_PROTOCOL_UNIT                            = 0x0B,
    USB_CDC_FUNCTIONAL_EXTENSION_UNIT                           = 0x0C,
    USB_CDC_FUNCTIONAL_MULTI_CHANNEL_MANAGEMENT                 = 0x0D,
    USB_CDC_FUNCTIONAL_CAPI_CONTROL                             = 0x0E,
    USB_CDC_FUNCTIONAL_ETHERNET_NETWORKING                      = 0x0F,
    USB_CDC_FUNCTIONAL_ATM_NETWORKING                           = 0x10,
    USB_CDC_FUNCTIONAL_WIRELESS_HANDSET                         = 0x11,
    USB_CDC_FUNCTIONAL_MOBILE_DIRECT_LINE                       = 0x12,
    USB_CDC_FUNCTIONAL_MDLM_DETAIL                              = 0x13,
    USB_CDC_FUNCTIONAL_DEVICE_MANAGEMENT                        = 0x14,
    USB_CDC_FUNCTIONAL_OBEX                                     = 0x15,
    USB_CDC_FUNCTIONAL_COMMAND_SET                              = 0x16,
    USB_CDC_FUNCTIONAL_COMMAND_SET_DETAIL                       = 0x17,
    USB_CDC_FUNCTIONAL_TELEPHONE_CONTROL                        = 0x18,
    USB_CDC_FUNCTIONAL_OBEX_SERVICE_IDENTIFY                    = 0x19

} USB_CDC_FUNCTIONAL_DESCRIPTOR;

// *****************************************************************************
/* CDC interface type.

  Summary:
    Identifies the CDC interface type.

  Description:
    This enumeration identifies the CDC interface type. CDC has one mandatory
    data interface and an optional notification interface.

  Remarks:
    None.
*/

typedef enum
{
    USB_CDC_INTERFACE_DATA          = 0,
    USB_CDC_INTERFACE_NOTIFICATION

} USB_CDC_INTERFACE_TYPE;

// *****************************************************************************
/* CDC line coding.

  Summary:
    Identifies the CDC line coding information.

  Description:
    This type identifies the CDC line coding information. This structure is
    as per the USB protocol.

  Remarks:
    Need to be packed always.
*/

typedef struct __attribute__ ((packed))
{
    /* data terminal rate in bits per second */
    uint32_t dwDTERate;

    /* stop bits */
    uint8_t bCharFormat;

    /* Parity */
    uint8_t bParityType;

    /* Data bits */
    uint8_t bDataBits;

} USB_CDC_LINE_CODING;

// *****************************************************************************
/* CDC control line state.

  Summary:
    Identifies the CDC control line state.

  Description:
    This type identifies the CDC control line state information. This structure
    is as per the USB protocol. Used for
    SET_CONTROL_LINE_STATE/GET_CONTROL_LINE_STATE

  Remarks:
    Need to be packed always.
*/

typedef struct __attribute__ ((packed))
{
    /* indicates to DCE(device/modem) if DTE(host) is present or not*/
    uint8_t dtr:1;

    /* Activate/deactivate carrier (RTS)*/
    uint8_t carrier:1;

} USB_CDC_CONTROL_LINE_STATE;

// *****************************************************************************
/* CDC serial state.

  Summary:
    Identifies the CDC serial state.

  Description:
    This type identifies the CDC serial state.

  Remarks:
    Need to be packed always.
*/

typedef struct __attribute__ ((packed))
{
    uint8_t bRxCarrier  :1;
    uint8_t bTxCarrier  :1;
    uint8_t bBreak      :1;
    uint8_t bRingSignal :1;
    uint8_t bFraming    :1;
    uint8_t bParity     :1;
    uint8_t bOverRun    :1;
    uint8_t             :1;
    uint8_t             :8;

} USB_CDC_SERIAL_STATE;

// *****************************************************************************
/* CDC serial state response.

  Summary:
    Identifies the CDC serial state response.

  Description:
    This type identifies the CDC serial state response. Sent via the interrupt
    IN end-point whenever there is a state change.

  Remarks:
    Need to be packed always.
*/

typedef struct __attribute__ ((packed))
{
    uint8_t bmRequestType;
    uint8_t bNotification;
    uint16_t wValue;
    uint16_t wIndex;
    uint16_t wLength;
    USB_CDC_SERIAL_STATE stSerial;

} USB_CDC_SERIAL_STATE_RESPONSE;

// *****************************************************************************
/* CDC serial response available information.

  Summary:
    Contains the CDC serial response available information.

  Description:
    This type forms the CDC serial response available. Sent via the interrupt IN
    end-point whenever there is a response available.

  Remarks:
    Need to be packed always.
*/

typedef struct __attribute__ ((packed))
{
    uint8_t bmRequestType;
    uint8_t bNotification;
    uint16_t wValue;
    uint16_t wIndex;
    uint16_t wLength;

} USB_CDC_SERIAL_RESPONSE_AVAILABLE;

// *****************************************************************************
/* CDC header functional descriptor.

  Summary:
    Identifies the CDC header functional descriptor.

  Description:
    This type identifies the CDC header functional descriptor. This structure
    is as per the USB protocol.

  Remarks:
    Need to be packed always.
*/

typedef struct __attribute__ ((packed))
{
    /* Size of this descriptor in bytes */
    uint8_t bFunctionLength;

    /* Descriptor type */
    uint8_t bDescriptorType;

    /* functional descriptor sub-type */
    uint8_t bDescriptorSubtype;

    /* CDC specification release number */
    uint16_t bcdCDC;

} USB_CDC_HEADER_FUNCTIONAL_DESCRIPTOR;

// *****************************************************************************
/* CDC union functional descriptor.

  Summary:
    Identifies the CDC union functional descriptor.

  Description:
    This type identifies the CDC union functional descriptor. This structure
    is as per the USB protocol.

  Remarks:
    Need to be packed always.
*/

typedef struct __attribute__ ((packed))
{
    /* Size of this descriptor in bytes */
    uint8_t bFunctionLength;

    /* Descriptor type */
    uint8_t bDescriptorType;

    /* functional descriptor sub-type */
    uint8_t bDescriptorSubtype;

    /* controlling interface for the union */
    uint8_t bControllInterface;

} USB_CDC_UNION_FUNCTIONAL_DESCRIPTOR_HEADER;

typedef uint8_t USB_CDC_UNION_FUNCTIONAL_DESCRIPTOR_SUBORDINATE;

// *****************************************************************************
/* CDC ACM functional descriptor.

  Summary:
    Identifies the CDC ACM functional descriptor.

  Description:
    This type identifies the CDC ACM functional descriptor. This structure is as
    per the USB protocol.

  Remarks:
    Need to be packed always.
*/

typedef struct __attribute__ ((packed))
{
    /* Size of this descriptor in bytes */
    uint8_t bFunctionLength;

    /* Descriptor type */
    uint8_t bDescriptorType;

    /* functional descriptor sub-type */
    uint8_t bDescriptorSubtype;

    /* The capabilities that this configuration supports */
    uint8_t bmCapabilities;

} USB_CDC_ACM_FUNCTIONAL_DESCRIPTOR;

// *****************************************************************************
/* CDC Call Management functional descriptor.

  Summary:
    Identifies the CDC Call Management functional descriptor.

  Description:
    This type identifies the CDC Call Management functional descriptor.  This
    structure is as per the USB protocol.

  Remarks:
    Need to be packed always.
*/

typedef struct __attribute__ ((packed))
{
    /* Size of this descriptor in bytes */
    uint8_t bFunctionLength;

    /* Descriptor type */
    uint8_t bDescriptorType;

    /* functional descriptor sub-type */
    uint8_t bDescriptorSubtype;

    /* The capabilities that this configuration supports */
    uint8_t bmCapabilities;

    /* Interface number of Data Class interface optionally used for call management */
    uint8_t bDataInterface;

} USB_CDC_CALL_MANAGEMENT_DESCRIPTOR;

//DOM-IGNORE-BEGIN
#ifdef __cplusplus
}
#endif
//DOM-IGNORE-END

#endif


text:
package Paws::Glacier::JobParameters;
  use Moose;
  has ArchiveId => (is => 'ro', isa => 'Str');
  has Description => (is => 'ro', isa => 'Str');
  has Format => (is => 'ro', isa => 'Str');
  has InventoryRetrievalParameters => (is => 'ro', isa => 'Paws::Glacier::InventoryRetrievalJobInput');
  has RetrievalByteRange => (is => 'ro', isa => 'Str');
  has SNSTopic => (is => 'ro', isa => 'Str');
  has Tier => (is => 'ro', isa => 'Str');
  has Type => (is => 'ro', isa => 'Str');
1;

### main pod documentation begin ###

=head1 NAME

Paws::Glacier::JobParameters

=head1 USAGE

This class represents one of two things:

=head3 Arguments in a call to a service

Use the attributes of this class as arguments to methods. You shouldn't make instances of this class.
Each attribute should be used as a named argument in the calls that expect this type of object.

As an example, if Att1 is expected to be a Paws::Glacier::JobParameters object:

  $service_obj->Method(Att1 => { ArchiveId => $value, ..., Type => $value  });

=head3 Results returned from an API call

Use accessors for each attribute. If Att1 is expected to be an Paws::Glacier::JobParameters object:

  $result = $service_obj->Method(...);
  $result->Att1->ArchiveId

=head1 DESCRIPTION

Provides options for defining a job.

=head1 ATTRIBUTES

=head2 ArchiveId => Str

  The ID of the archive that you want to retrieve. This field is required
only if C<Type> is set to archive-retrieval. An error occurs if you
specify this request parameter for an inventory retrieval job request.

=head2 Description => Str

  The optional description for the job. The description must be less than
or equal to 1,024 bytes. The allowable characters are 7-bit ASCII
without control codes-specifically, ASCII values 32-126 decimal or
0x20-0x7E hexadecimal.

=head2 Format => Str

  When initiating a job to retrieve a vault inventory, you can optionally
add this parameter to your request to specify the output format. If you
are initiating an inventory job and do not specify a Format field, JSON
is the default format. Valid values are "CSV" and "JSON".

=head2 InventoryRetrievalParameters => L<Paws::Glacier::InventoryRetrievalJobInput>

  Input parameters used for range inventory retrieval.

=head2 RetrievalByteRange => Str

  The byte range to retrieve for an archive retrieval. in the form
"I<StartByteValue>-I<EndByteValue>" If not specified, the whole archive
is retrieved. If specified, the byte range must be megabyte (1024*1024)
aligned which means that I<StartByteValue> must be divisible by 1 MB
and I<EndByteValue> plus 1 must be divisible by 1 MB or be the end of
the archive specified as the archive byte size value minus 1. If
RetrievalByteRange is not megabyte aligned, this operation returns a
400 response.

An error occurs if you specify this field for an inventory retrieval
job request.

=head2 SNSTopic => Str

  The Amazon SNS topic ARN to which Amazon Glacier sends a notification
when the job is completed and the output is ready for you to download.
The specified topic publishes the notification to its subscribers. The
SNS topic must exist.

=head2 Tier => Str

  The retrieval option to use for the archive retrieval. Valid values are
C<Expedited>, C<Standard>, or C<Bulk>. C<Standard> is the default.

=head2 Type => Str

  The job type. You can initiate a job to retrieve an archive or get an
inventory of a vault. Valid values are "archive-retrieval" and
"inventory-retrieval".

=head1 SEE ALSO

This class forms part of L<Paws>, describing an object used in L<Paws::Glacier>

=head1 BUGS and CONTRIBUTIONS

The source code is located here: https://github.com/pplu/aws-sdk-perl

Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues

=cut


text:
module SuckerPunch
  class Railtie < ::Rails::Railtie
    initializer "sucker_punch.logger" do
      SuckerPunch.logger = Rails.logger
    end
  end
end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Lecanora trevisanii A. Massal.

### Remarks
null


text:
import {
  Component,
  OnInit
} from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
import { AppSettings } from '..';
import { ApiService, DataService, NavigateService, TextService } from '../common';

@Component({
  selector: 'warnings-details',
  styleUrls: ['./warnings.component.scss'],
  templateUrl: './warnings.component.html'
})
export class WarningsComponent implements OnInit {
  private item: string;
  private pageHeader: string;
  private warningsObject: any = {};
  private pageText: any = {};
  private sub: any;

  constructor(private textService: TextService, private navigateService: NavigateService, private dataService: DataService,
    private apiService: ApiService, private route: ActivatedRoute) { }

  public ngOnInit() {
    window.scrollTo(0, 0);
    this.dataService.page = {
      text: 'Warnings',
      name: 'Warnings'
    };
    //get state of this page
    this.sub = this.route
      .queryParams
      .subscribe(params => {
        this.item = params['food'] || '';
        if (!this.item) {
          this.navigateService.navigateTo('home');
        }
        this.pageHeader = 'Warnings about ' + this.item;
        this.init();
        });
  }

  public ngOnDestroy() {
    this.sub.unsubscribe();
  }

  private init = function () {
    this.textService.getMiscTranslations().subscribe(
      data => this.setTranslations(data),
      error => console.error('Error getting translations: ' + error));
    let warningQuery = 'foods=';
    warningQuery += encodeURIComponent(this.item);
    this.apiService.get(AppSettings.API_ROUTES.WARNINGS + '?' + warningQuery, true)
      .subscribe(data => this.processWarningsData(data),
      error => console.error('Error getting warnings data: ' + error)
      );
  };

  private setTranslations(data: any) {
    this.pageText['translate'] = data["translate"] || "TRANSLATE";
    this.dataService.page.text = data["menu_warnings"] || this.dataService.page.text;
  }

  private processWarningsData(data: any) {
    this.warningsObject = data;
  }

  private getTranslateLink(description: string) {
    let url: string = "https://translate.google.com/#auto/"
      + AppSettings.LANGUAGE_CODE_MAP[this.textService.language.toLowerCase()]
      + "/"
      + description;
    return url;
  }
}


text:
using FlaUI.Core.Identifiers;
using FlaUI.Core.Patterns.Infrastructure;

namespace FlaUI.Core.Patterns
{
    public interface IDropTargetPattern : IPattern
    {
        IDropTargetPatternPropertyIds PropertyIds { get; }
        IDropTargetPatternEventIds EventIds { get; }

        AutomationProperty<string> DropTargetEffect { get; }
        AutomationProperty<string[]> DropTargetEffects { get; }
    }

    public interface IDropTargetPatternPropertyIds
    {
        PropertyId DropTargetEffect { get; }
        PropertyId DropTargetEffects { get; }
    }

    public interface IDropTargetPatternEventIds
    {
        EventId DragEnterEvent { get; }
        EventId DragLeaveEvent { get; }
        EventId DragCompleteEvent { get; }
    }

    public abstract class DropTargetPatternBase<TNativePattern> : PatternBase<TNativePattern>, IDropTargetPattern
        where TNativePattern : class
    {
        private AutomationProperty<string> _dropTargetEffect;
        private AutomationProperty<string[]> _dropTargetEffects;

        protected DropTargetPatternBase(FrameworkAutomationElementBase frameworkAutomationElement, TNativePattern nativePattern) : base(frameworkAutomationElement, nativePattern)
        {
        }

        public IDropTargetPatternPropertyIds PropertyIds => Automation.PropertyLibrary.DropTarget;
        public IDropTargetPatternEventIds EventIds => Automation.EventLibrary.DropTarget;

        public AutomationProperty<string> DropTargetEffect => GetOrCreate(ref _dropTargetEffect, PropertyIds.DropTargetEffect);
        public AutomationProperty<string[]> DropTargetEffects => GetOrCreate(ref _dropTargetEffects, PropertyIds.DropTargetEffects);
    }
}


text:
subdir = src/backend/gporca/libnaucrates/src/parser
top_builddir = ../../../../../..
include $(top_builddir)/src/Makefile.global

include $(top_srcdir)/src/backend/gporca/gporca.mk

OBJS        = CParseHandlerAgg.o \
              CParseHandlerAppend.o \
              CParseHandlerArray.o \
              CParseHandlerAssert.o \
              CParseHandlerBase.o \
              CParseHandlerBroadcastMotion.o \
              CParseHandlerCTEConfig.o \
              CParseHandlerCTEList.o \
              CParseHandlerColDescr.o \
              CParseHandlerColStats.o \
              CParseHandlerColStatsBucket.o \
              CParseHandlerCondList.o \
              CParseHandlerCost.o \
              CParseHandlerCostModel.o \
              CParseHandlerCostParam.o \
              CParseHandlerCostParams.o \
              CParseHandlerCtasStorageOptions.o \
              CParseHandlerDXL.o \
              CParseHandlerDefaultValueExpr.o \
              CParseHandlerDirectDispatchInfo.o \
              CParseHandlerDistinctComp.o \
              CParseHandlerDummy.o \
              CParseHandlerDynamicIndexScan.o \
              CParseHandlerDynamicTableScan.o \
              CParseHandlerEnumeratorConfig.o \
              CParseHandlerExternalScan.o \
              CParseHandlerFactory.o \
              CParseHandlerFilter.o \
              CParseHandlerGatherMotion.o \
              CParseHandlerGroupingColList.o \
              CParseHandlerHashExpr.o \
              CParseHandlerHashExprList.o \
              CParseHandlerHashJoin.o \
              CParseHandlerHint.o \
              CParseHandlerIndexCondList.o \
              CParseHandlerIndexDescr.o \
              CParseHandlerIndexOnlyScan.o \
              CParseHandlerIndexScan.o \
              CParseHandlerLimit.o \
              CParseHandlerLogicalCTAS.o \
              CParseHandlerLogicalCTEAnchor.o \
              CParseHandlerLogicalCTEConsumer.o \
              CParseHandlerLogicalCTEProducer.o \
              CParseHandlerLogicalConstTable.o \
              CParseHandlerLogicalDelete.o \
              CParseHandlerLogicalExternalGet.o \
              CParseHandlerLogicalGet.o \
              CParseHandlerLogicalGroupBy.o \
              CParseHandlerLogicalInsert.o \
              CParseHandlerLogicalJoin.o \
              CParseHandlerLogicalLimit.o \
              CParseHandlerLogicalOp.o \
              CParseHandlerLogicalProject.o \
              CParseHandlerLogicalSelect.o \
              CParseHandlerLogicalSetOp.o \
              CParseHandlerLogicalTVF.o \
              CParseHandlerLogicalUpdate.o \
              CParseHandlerLogicalWindow.o \
              CParseHandlerMDArrayCoerceCast.o \
              CParseHandlerMDCast.o \
              CParseHandlerMDGPDBAgg.o \
              CParseHandlerMDGPDBCheckConstraint.o \
              CParseHandlerMDGPDBFunc.o \
              CParseHandlerMDGPDBScalarOp.o \
              CParseHandlerMDGPDBTrigger.o \
              CParseHandlerMDIndex.o \
              CParseHandlerMDIndexInfoList.o \
              CParseHandlerMDRelation.o \
              CParseHandlerMDRelationCtas.o \
              CParseHandlerMDRelationExternal.o \
              CParseHandlerMDRequest.o \
              CParseHandlerMDScCmp.o \
              CParseHandlerMDType.o \
              CParseHandlerManager.o \
              CParseHandlerMaterialize.o \
              CParseHandlerMergeJoin.o \
              CParseHandlerMetadata.o \
              CParseHandlerMetadataColumn.o \
              CParseHandlerMetadataColumns.o \
              CParseHandlerMetadataIdList.o \
              CParseHandlerMetadataObject.o \
              CParseHandlerNLJIndexParam.o \
              CParseHandlerNLJIndexParamList.o \
              CParseHandlerNLJoin.o \
              CParseHandlerOp.o \
              CParseHandlerOptimizerConfig.o \
              CParseHandlerPartitionSelector.o \
              CParseHandlerPhysicalAbstractBitmapScan.o \
              CParseHandlerPhysicalBitmapTableScan.o \
              CParseHandlerPhysicalCTAS.o \
              CParseHandlerPhysicalCTEConsumer.o \
              CParseHandlerPhysicalCTEProducer.o \
              CParseHandlerPhysicalDML.o \
              CParseHandlerPhysicalDynamicBitmapTableScan.o \
              CParseHandlerPhysicalOp.o \
              CParseHandlerPhysicalRowTrigger.o \
              CParseHandlerPhysicalSplit.o \
              CParseHandlerPhysicalTVF.o \
              CParseHandlerPhysicalWindow.o \
              CParseHandlerPlan.o \
              CParseHandlerProjElem.o \
              CParseHandlerProjList.o \
              CParseHandlerProperties.o \
              CParseHandlerQuery.o \
              CParseHandlerQueryOutput.o \
              CParseHandlerRandomMotion.o \
              CParseHandlerRedistributeMotion.o \
              CParseHandlerRelStats.o \
              CParseHandlerResult.o \
              CParseHandlerRoutedMotion.o \
              CParseHandlerScalarAggref.o \
              CParseHandlerScalarArrayCoerceExpr.o \
              CParseHandlerScalarArrayComp.o \
              CParseHandlerScalarArrayRef.o \
              CParseHandlerScalarArrayRefIndexList.o \
              CParseHandlerScalarAssertConstraintList.o \
              CParseHandlerScalarBitmapBoolOp.o \
              CParseHandlerScalarBitmapIndexProbe.o \
              CParseHandlerScalarBoolExpr.o \
              CParseHandlerScalarBooleanTest.o \
              CParseHandlerScalarCaseTest.o \
              CParseHandlerScalarCast.o \
              CParseHandlerScalarCoalesce.o \
              CParseHandlerScalarCoerceToDomain.o \
              CParseHandlerScalarCoerceViaIO.o \
              CParseHandlerScalarComp.o \
              CParseHandlerScalarConstValue.o \
              CParseHandlerScalarDMLAction.o \
              CParseHandlerScalarExpr.o \
              CParseHandlerScalarFuncExpr.o \
              CParseHandlerScalarIdent.o \
              CParseHandlerScalarIfStmt.o \
              CParseHandlerScalarLimitCount.o \
              CParseHandlerScalarLimitOffset.o \
              CParseHandlerScalarMinMax.o \
              CParseHandlerScalarNullIf.o \
              CParseHandlerScalarNullTest.o \
              CParseHandlerScalarOp.o \
              CParseHandlerScalarOpExpr.o \
              CParseHandlerScalarOpList.o \
              CParseHandlerScalarPartBound.o \
              CParseHandlerScalarPartBoundInclusion.o \
              CParseHandlerScalarPartBoundOpen.o \
              CParseHandlerScalarPartDefault.o \
              CParseHandlerScalarPartListNullTest.o \
              CParseHandlerScalarPartListValues.o \
              CParseHandlerScalarPartOid.o \
              CParseHandlerScalarSubPlan.o \
              CParseHandlerScalarSubPlanParam.o \
              CParseHandlerScalarSubPlanParamList.o \
              CParseHandlerScalarSubPlanTestExpr.o \
              CParseHandlerScalarSubquery.o \
              CParseHandlerScalarSubqueryExists.o \
              CParseHandlerScalarSubqueryQuantified.o \
              CParseHandlerScalarSwitch.o \
              CParseHandlerScalarSwitchCase.o \
              CParseHandlerScalarValuesList.o \
              CParseHandlerScalarWindowFrameEdge.o \
              CParseHandlerScalarWindowRef.o \
              CParseHandlerSearchStage.o \
              CParseHandlerSearchStrategy.o \
              CParseHandlerSequence.o \
              CParseHandlerSort.o \
              CParseHandlerSortCol.o \
              CParseHandlerSortColList.o \
              CParseHandlerStackTrace.o \
              CParseHandlerStatistics.o \
              CParseHandlerStatisticsConfig.o \
              CParseHandlerStatsBound.o \
              CParseHandlerStatsDerivedColumn.o \
              CParseHandlerStatsDerivedRelation.o \
              CParseHandlerSubqueryScan.o \
              CParseHandlerTableDescr.o \
              CParseHandlerTableScan.o \
              CParseHandlerTraceFlags.o \
              CParseHandlerUtils.o \
              CParseHandlerValuesScan.o \
              CParseHandlerWindowFrame.o \
              CParseHandlerWindowKey.o \
              CParseHandlerWindowKeyList.o \
              CParseHandlerWindowOids.o \
              CParseHandlerWindowSpec.o \
              CParseHandlerWindowSpecList.o \
              CParseHandlerXform.o

include $(top_srcdir)/src/backend/common.mk


text:
namespace industrial_extrinsic_cal
{
#define YAML_ITERATOR YAML::const_iterator

inline bool parseDouble(const YAML::Node& node, char const* var_name, double& var_value)
{
  if (node[var_name])
  {
    var_value = node[var_name].as<double>();
    return true;
  }
  return false;
}

inline bool parseInt(const YAML::Node& node, char const* var_name, int& var_value)
{
  if (node[var_name])
  {
    var_value = node[var_name].as<int>();
    return true;
  }
  return false;
}
inline bool parseUInt(const YAML::Node& node, char const* var_name, unsigned int& var_value)
{
  if (node[var_name])
  {
    var_value = node[var_name].as<unsigned int>();
    return true;
  }
  return false;
}

inline bool parseString(const YAML::Node& node, char const* var_name, std::string& var_value)
{
  if (node[var_name])
  {
    var_value = node[var_name].as<std::string>();
    return true;
  }
  return false;
}

inline bool parseBool(const YAML::Node& node, char const* var_name, bool& var_value)
{
  if (node[var_name])
  {
    var_value = node[var_name];
    return true;
  }
  return false;
}

inline bool parseVectorD(const YAML::Node& node, char const* var_name, std::vector<double>& var_value)
{
  if (node[var_name])
  {
    var_value.clear();
    const YAML::Node n = node[var_name];
    for (int i = 0; i < (int)n.size(); i++)
    {
      double value;
      value = n[i].as<double>();
      var_value.push_back(value);
    }
    return true;
  }
  return false;
}

inline const YAML::Node parseNode(const YAML::Node& node, char const* var_name)
{
  if (!node[var_name])
  {
    ROS_INFO("Can't parse node[%s]", var_name);
  }
  return (node[var_name]);
}
inline void parseKeyDValue(YAML::const_iterator& it, std::string& key, double& dvalue)
{
  key = it->first.as<std::string>();
  dvalue = it->second.as<double>();
}

inline bool yamlNodeFromFileName(std::string filename, YAML::Node& ynode)
{
  bool rtn = true;
  try
  {
    ynode = YAML::LoadFile(filename.c_str());
  }
  catch (int e)
  {
    ROS_ERROR("could not open %s in yamlNodeFromFileName()", filename.c_str());
    rtn = false;
  }
  return (rtn);
}

}  // end namespace

#endif


text:
.common-ul-background{
    background-color: beige;
}

.common-special-b{
    color: #e94d1c;
}

.common-row-background{
    background: url("/static/img/1.jpg") no-repeat center;
    background-size: cover;
    -moz-background-size: cover;
}


text:
/* ###
 * IP: GHIDRA
 *
 * 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 ghidra.app.plugin.core.string;

import ghidra.program.model.address.Address;
import ghidra.program.model.data.DataType;
import ghidra.program.util.string.FoundString;
import ghidra.program.util.string.FoundString.DefinedState;

public class StringAddedEvent extends StringEvent {

	public StringAddedEvent(DataType stringDataType, Address address, int length) {
		super(stringDataType, address, length);
	}

	@Override
	public void process(StringTableModel model, StringTableOptions options) {
		// first attempt to find the corresponding entry quickly
		FoundString newString = new FoundString(address, length, stringDataType);
		int row = model.getRowIndex(newString);

		FoundString existingString = null;
		if (row >= 0) {
			existingString = model.getRowObject(row);
			if (!existingString.getAddress().equals(address)) {
				existingString = null;
			}
		}
		if (existingString == null) {
			existingString = findRowSlowWay(model);
		}

		if (existingString == null) {
			if (options.includeDefinedStrings()) {
				newString.setDefinedState(DefinedState.DEFINED);
				model.addObject(newString);
			}
			return;
		}

		updateMatch(existingString, newString);

		if (existingString.isDefined() && !options.includeDefinedStrings()) {
			model.removeObject(existingString);
		}
		else if (existingString.isPartiallyDefined() && !options.includePartiallyDefinedStrings()) {
			model.removeObject(existingString);
		}
		else {
			model.updateObject(existingString);
		}

	}

	private void updateMatch(FoundString existingString, FoundString newString) {
		Address existingAddr = existingString.getAddress();
		Address newAddr = newString.getAddress();

		if (existingAddr.equals(newAddr) && existingString.getLength() <= newString.getLength()) {
			existingString.setDefinedState(DefinedState.DEFINED);
			return;
		}

		Address existingEndAddr = existingString.getEndAddress();
		Address newEndAddr = newString.getEndAddress();

		Address minAddress = getMinAddress(existingAddr, newAddr);
		Address maxAddress = getMaxAddress(existingEndAddr, newEndAddr);
		length = (int) maxAddress.subtract(minAddress) + 1;

		existingString.setAddress(minAddress);
		existingString.setLength(length);
		existingString.setDefinedState(DefinedState.PARTIALLY_DEFINED);
	}

}


text:
<?php

use Mollie\API\Mollie;
use Mollie\API\Request;
use Mollie\API\Tests\TestCase\ResourceTestCase;

/**
 * Customer mandate get tests
 */
class CustomerMandateGetTest extends ResourceTestCase
{
    /**
     * Get customer mandate
     */
    public function testGetCustomerMandate()
    {
        // Mock the mandate
        $mandateMock = $this->getMandate();

        // Mock the customer
        $customerMock = $this->getCustomer();

        // Mock the request
        $requestMock = $this->createMock(Request::class);

        $requestMock
            ->expects($this->exactly(2))
            ->method('get')
            ->with($this->equalTo("/customers/{$customerMock->id}/mandates/{$mandateMock->id}"))
            ->will($this->returnValue($mandateMock));

        // Create API instance
        $api = new Mollie('test_testapikey');
        $api->request = $requestMock;

        // Get customer mandate
        $mandate = $api->customer($customerMock->id)->mandate($mandateMock->id)->get();
        $mandate2 = $api->customer($customerMock->id)->mandate()->get($mandateMock->id);

        // Check if we have the correct mandate
        $this->assertEquals($mandate, $mandate2);
        $this->assertMandate($mandate, $mandateMock);
    }

    /**
     * Get all customer mandates
     */
    public function testGetCustomerMandates()
    {
        // Prepare a list of mandates
        $mandateListMock = [];

        for ($i = 0; $i <= 15; $i++) {
            $mandate = $this->getMandate($i < 15 ? "invalid" : "valid");
            $mandate->id .= "_{$i}";   // mdt_test_1

            // Add mandate to list
            $mandateListMock[] = $mandate;
        }

        // Mock the customer
        $customerMock = $this->getCustomer();

        // Create API instance
        $api = new Mollie('test_testapikey');

        // Mock the request handler
        $requestMock = $this->getMultiPageRequestMock($api, $mandateListMock, "/customer/{$customerMock->id}/mandates");

        // Set request handler
        $api->request = $requestMock;

        // Get mandates
        $mandates = $api->customer($customerMock->id)->mandate()->all();

        // Check the number of mandates returned
        $this->assertEquals(count($mandateListMock), count($mandates));

        // Check all mandates
        $this->assertMandates($mandates, $mandateListMock);
    }

    /**
     * Get customer mandate without mandate ID
     *
     * @expectedException BadMethodCallException
     * @expectedExceptionMessage No mandate ID
     */
    public function testGetCustomerMandateWithoutID()
    {
        $api = new Mollie('test_testapikey');
        $api->customer('cst_test')->mandate()->get();
    }

    /**
     * Get customer mandate without customer ID
     *
     * @expectedException BadMethodCallException
     * @expectedExceptionMessage No customer ID
     */
    public function testGetCustomerMandateWithoutCustomerID()
    {
        $api = new Mollie('test_testapikey');
        $api->customer()->mandate('mdt_test')->get();
    }

    /**
     * Get customer mandate without any arguments (doh!)
     *
     * @expectedException BadMethodCallException
     */
    public function testGetCustomerMandateWithoutAnything()
    {
        $api = new Mollie('test_testapikey');
        $api->customer()->mandate()->get();
    }
}


text:
package cucumber.runtime.java.needle.test;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

import javax.inject.Inject;

import cucumber.api.java.Before;
import cucumber.runtime.java.needle.test.injectionprovider.NameGetter;
import cucumber.runtime.java.needle.test.injectionprovider.SimpleNameGetterProvider;

public class AtmWithdrawalGlue {

    /*
     * Inject will be mocked.
     */
    @Inject
    private NameGetter fooGetter;

    @Before
    public void assertInjection() {
        assertThat(fooGetter.getName(), is(SimpleNameGetterProvider.FOO));
    }
}


text:
enum CategoryGroupEnabledFlags {
  // Category group enabled for the recording mode.
  kEnabledForRecording_CategoryGroupEnabledFlags = 1 << 0,
  // Category group enabled by SetEventCallbackEnabled().
  kEnabledForEventCallback_CategoryGroupEnabledFlags = 1 << 2,
  // Category group enabled to export events to ETW.
  kEnabledForETWExport_CategoryGroupEnabledFlags = 1 << 3,
};

// By default, const char* asrgument values are assumed to have long-lived scope
// and will not be copied. Use this macro to force a const char* to be copied.
#define TRACE_STR_COPY(str) v8::internal::tracing::TraceStringWithCopy(str)

// By default, uint64 ID argument values are not mangled with the Process ID in
// TRACE_EVENT_ASYNC macros. Use this macro to force Process ID mangling.
#define TRACE_ID_MANGLE(id) v8::internal::tracing::TraceID::ForceMangle(id)

// By default, pointers are mangled with the Process ID in TRACE_EVENT_ASYNC
// macros. Use this macro to prevent Process ID mangling.
#define TRACE_ID_DONT_MANGLE(id) v8::internal::tracing::TraceID::DontMangle(id)

// Sets the current sample state to the given category and name (both must be
// constant strings). These states are intended for a sampling profiler.
// Implementation note: we store category and name together because we don't
// want the inconsistency/expense of storing two pointers.
// |thread_bucket| is [0..2] and is used to statically isolate samples in one
// thread from others.
#define TRACE_EVENT_SET_SAMPLING_STATE_FOR_BUCKET(bucket_number, category, \
                                                  name)                    \
  v8::internal::tracing::TraceEventSamplingStateScope<bucket_number>::Set( \
      category "\0" name)

// Returns a current sampling state of the given bucket.
#define TRACE_EVENT_GET_SAMPLING_STATE_FOR_BUCKET(bucket_number) \
  v8::internal::tracing::TraceEventSamplingStateScope<bucket_number>::Current()

// Creates a scope of a sampling state of the given bucket.
//
// {  // The sampling state is set within this scope.
//    TRACE_EVENT_SAMPLING_STATE_SCOPE_FOR_BUCKET(0, "category", "name");
//    ...;
// }
#define TRACE_EVENT_SCOPED_SAMPLING_STATE_FOR_BUCKET(bucket_number, category, \
                                                     name)                    \
  v8::internal::TraceEventSamplingStateScope<bucket_number>                   \
      traceEventSamplingScope(category "\0" name);

#define INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE() \
  *INTERNAL_TRACE_EVENT_UID(category_group_enabled) &                    \
      (kEnabledForRecording_CategoryGroupEnabledFlags |                  \
       kEnabledForEventCallback_CategoryGroupEnabledFlags)

// The following macro has no implementation, but it needs to exist since
// it gets called from scoped trace events. It cannot call UNIMPLEMENTED()
// since an empty implementation is a valid one.
#define INTERNAL_TRACE_MEMORY(category, name)

////////////////////////////////////////////////////////////////////////////////
// Implementation specific tracing API definitions.

// Get a pointer to the enabled state of the given trace category. Only
// long-lived literal strings should be given as the category group. The
// returned pointer can be held permanently in a local static for example. If
// the unsigned char is non-zero, tracing is enabled. If tracing is enabled,
// TRACE_EVENT_API_ADD_TRACE_EVENT can be called. It's OK if tracing is disabled
// between the load of the tracing state and the call to
// TRACE_EVENT_API_ADD_TRACE_EVENT, because this flag only provides an early out
// for best performance when tracing is disabled.
// const uint8_t*
//     TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(const char* category_group)
#define TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED              \
  v8::internal::tracing::TraceEventHelper::GetCurrentPlatform() \
      ->GetCategoryGroupEnabled

// Get the number of times traces have been recorded. This is used to implement
// the TRACE_EVENT_IS_NEW_TRACE facility.
// unsigned int TRACE_EVENT_API_GET_NUM_TRACES_RECORDED()
#define TRACE_EVENT_API_GET_NUM_TRACES_RECORDED UNIMPLEMENTED()

// Add a trace event to the platform tracing system.
// uint64_t TRACE_EVENT_API_ADD_TRACE_EVENT(
//                    char phase,
//                    const uint8_t* category_group_enabled,
//                    const char* name,
//                    uint64_t id,
//                    uint64_t bind_id,
//                    int num_args,
//                    const char** arg_names,
//                    const uint8_t* arg_types,
//                    const uint64_t* arg_values,
//                    unsigned int flags)
#define TRACE_EVENT_API_ADD_TRACE_EVENT \
  v8::internal::tracing::TraceEventHelper::GetCurrentPlatform()->AddTraceEvent

// Set the duration field of a COMPLETE trace event.
// void TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(
//     const uint8_t* category_group_enabled,
//     const char* name,
//     uint64_t id)
#define TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION             \
  v8::internal::tracing::TraceEventHelper::GetCurrentPlatform() \
      ->UpdateTraceEventDuration

// Defines atomic operations used internally by the tracing system.
#define TRACE_EVENT_API_ATOMIC_WORD v8::base::AtomicWord
#define TRACE_EVENT_API_ATOMIC_LOAD(var) v8::base::NoBarrier_Load(&(var))
#define TRACE_EVENT_API_ATOMIC_STORE(var, value) \
  v8::base::NoBarrier_Store(&(var), (value))

// The thread buckets for the sampling profiler.
extern TRACE_EVENT_API_ATOMIC_WORD g_trace_state[3];

#define TRACE_EVENT_API_THREAD_BUCKET(thread_bucket) \
  g_trace_state[thread_bucket]

////////////////////////////////////////////////////////////////////////////////

// Implementation detail: trace event macros create temporary variables
// to keep instrumentation overhead low. These macros give each temporary
// variable a unique name based on the line number to prevent name collisions.
#define INTERNAL_TRACE_EVENT_UID3(a, b) trace_event_unique_##a##b
#define INTERNAL_TRACE_EVENT_UID2(a, b) INTERNAL_TRACE_EVENT_UID3(a, b)
#define INTERNAL_TRACE_EVENT_UID(name_prefix) \
  INTERNAL_TRACE_EVENT_UID2(name_prefix, __LINE__)

// Implementation detail: internal macro to create static category.
// No barriers are needed, because this code is designed to operate safely
// even when the unsigned char* points to garbage data (which may be the case
// on processors without cache coherency).
// TODO(fmeawad): This implementation contradicts that we can have a different
// configuration for each isolate,
// https://code.google.com/p/v8/issues/detail?id=4563
#define INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO_CUSTOM_VARIABLES(             \
    category_group, atomic, category_group_enabled)                          \
  category_group_enabled =                                                   \
      reinterpret_cast<const uint8_t*>(TRACE_EVENT_API_ATOMIC_LOAD(atomic)); \
  if (!category_group_enabled) {                                             \
    category_group_enabled =                                                 \
        TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(category_group);          \
    TRACE_EVENT_API_ATOMIC_STORE(                                            \
        atomic, reinterpret_cast<TRACE_EVENT_API_ATOMIC_WORD>(               \
                    category_group_enabled));                                \
  }

#define INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group)             \
  static TRACE_EVENT_API_ATOMIC_WORD INTERNAL_TRACE_EVENT_UID(atomic) = 0; \
  const uint8_t* INTERNAL_TRACE_EVENT_UID(category_group_enabled);         \
  INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO_CUSTOM_VARIABLES(                 \
      category_group, INTERNAL_TRACE_EVENT_UID(atomic),                    \
      INTERNAL_TRACE_EVENT_UID(category_group_enabled));

// Implementation detail: internal macro to create static category and add
// event if the category is enabled.
#define INTERNAL_TRACE_EVENT_ADD(phase, category_group, name, flags, ...)    \
  do {                                                                       \
    INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group);                  \
    if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) {  \
      v8::internal::tracing::AddTraceEvent(                                  \
          phase, INTERNAL_TRACE_EVENT_UID(category_group_enabled), name,     \
          v8::internal::tracing::kNoId, v8::internal::tracing::kNoId, flags, \
          ##__VA_ARGS__);                                                    \
    }                                                                        \
  } while (0)

// Implementation detail: internal macro to create static category and add begin
// event if the category is enabled. Also adds the end event when the scope
// ends.
#define INTERNAL_TRACE_EVENT_ADD_SCOPED(category_group, name, ...)          \
  INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group);                   \
  v8::internal::tracing::ScopedTracer INTERNAL_TRACE_EVENT_UID(tracer);     \
  if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) {   \
    uint64_t h = v8::internal::tracing::AddTraceEvent(                      \
        TRACE_EVENT_PHASE_COMPLETE,                                         \
        INTERNAL_TRACE_EVENT_UID(category_group_enabled), name,             \
        v8::internal::tracing::kNoId, v8::internal::tracing::kNoId,         \
        TRACE_EVENT_FLAG_NONE, ##__VA_ARGS__);                              \
    INTERNAL_TRACE_EVENT_UID(tracer)                                        \
        .Initialize(INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \
                    h);                                                     \
  }

#define INTERNAL_TRACE_EVENT_ADD_SCOPED_WITH_FLOW(category_group, name,     \
                                                  bind_id, flow_flags, ...) \
  INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group);                   \
  v8::internal::tracing::ScopedTracer INTERNAL_TRACE_EVENT_UID(tracer);     \
  if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) {   \
    unsigned int trace_event_flags = flow_flags;                            \
    v8::internal::tracing::TraceID trace_event_bind_id(bind_id,             \
                                                       &trace_event_flags); \
    uint64_t h = v8::internal::tracing::AddTraceEvent(                      \
        TRACE_EVENT_PHASE_COMPLETE,                                         \
        INTERNAL_TRACE_EVENT_UID(category_group_enabled), name,             \
        v8::internal::tracing::kNoId, trace_event_bind_id.data(),           \
        trace_event_flags, ##__VA_ARGS__);                                  \
    INTERNAL_TRACE_EVENT_UID(tracer)                                        \
        .Initialize(INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \
                    h);                                                     \
  }

// Implementation detail: internal macro to create static category and add
// event if the category is enabled.
#define INTERNAL_TRACE_EVENT_ADD_WITH_ID(phase, category_group, name, id,      \
                                         flags, ...)                           \
  do {                                                                         \
    INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group);                    \
    if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) {    \
      unsigned int trace_event_flags = flags | TRACE_EVENT_FLAG_HAS_ID;        \
      v8::internal::tracing::TraceID trace_event_trace_id(id,                  \
                                                          &trace_event_flags); \
      v8::internal::tracing::AddTraceEvent(                                    \
          phase, INTERNAL_TRACE_EVENT_UID(category_group_enabled), name,       \
          trace_event_trace_id.data(), v8::internal::tracing::kNoId,           \
          trace_event_flags, ##__VA_ARGS__);                                   \
    }                                                                          \
  } while (0)

// Adds a trace event with a given timestamp. Not Implemented.
#define INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(phase, category_group, name, \
                                                timestamp, flags, ...)       \
  UNIMPLEMENTED()

// Adds a trace event with a given id and timestamp. Not Implemented.
#define INTERNAL_TRACE_EVENT_ADD_WITH_ID_AND_TIMESTAMP(     \
    phase, category_group, name, id, timestamp, flags, ...) \
  UNIMPLEMENTED()

// Adds a trace event with a given id, thread_id, and timestamp. Not
// Implemented.
#define INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(            \
    phase, category_group, name, id, thread_id, timestamp, flags, ...) \
  UNIMPLEMENTED()

namespace v8 {
namespace internal {
namespace tracing {

// Specify these values when the corresponding argument of AddTraceEvent is not
// used.
const int kZeroNumArgs = 0;
const uint64_t kNoId = 0;

class TraceEventHelper {
 public:
  static v8::Platform* GetCurrentPlatform();
};

// TraceID encapsulates an ID that can either be an integer or pointer. Pointers
// are by default mangled with the Process ID so that they are unlikely to
// collide when the same pointer is used on different processes.
class TraceID {
 public:
  class DontMangle {
   public:
    explicit DontMangle(const void* id)
        : data_(static_cast<uint64_t>(reinterpret_cast<uintptr_t>(id))) {}
    explicit DontMangle(uint64_t id) : data_(id) {}
    explicit DontMangle(unsigned int id) : data_(id) {}
    explicit DontMangle(uint16_t id) : data_(id) {}
    explicit DontMangle(unsigned char id) : data_(id) {}
    explicit DontMangle(int64_t id) : data_(static_cast<uint64_t>(id)) {}
    explicit DontMangle(int id) : data_(static_cast<uint64_t>(id)) {}
    explicit DontMangle(int16_t id) : data_(static_cast<uint64_t>(id)) {}
    explicit DontMangle(signed char id) : data_(static_cast<uint64_t>(id)) {}
    uint64_t data() const { return data_; }

   private:
    uint64_t data_;
  };

  class ForceMangle {
   public:
    explicit ForceMangle(uint64_t id) : data_(id) {}
    explicit ForceMangle(unsigned int id) : data_(id) {}
    explicit ForceMangle(uint16_t id) : data_(id) {}
    explicit ForceMangle(unsigned char id) : data_(id) {}
    explicit ForceMangle(int64_t id) : data_(static_cast<uint64_t>(id)) {}
    explicit ForceMangle(int id) : data_(static_cast<uint64_t>(id)) {}
    explicit ForceMangle(int16_t id) : data_(static_cast<uint64_t>(id)) {}
    explicit ForceMangle(signed char id) : data_(static_cast<uint64_t>(id)) {}
    uint64_t data() const { return data_; }

   private:
    uint64_t data_;
  };

  TraceID(const void* id, unsigned int* flags)
      : data_(static_cast<uint64_t>(reinterpret_cast<uintptr_t>(id))) {
    *flags |= TRACE_EVENT_FLAG_MANGLE_ID;
  }
  TraceID(ForceMangle id, unsigned int* flags) : data_(id.data()) {
    *flags |= TRACE_EVENT_FLAG_MANGLE_ID;
  }
  TraceID(DontMangle id, unsigned int* flags) : data_(id.data()) {}
  TraceID(uint64_t id, unsigned int* flags) : data_(id) { (void)flags; }
  TraceID(unsigned int id, unsigned int* flags) : data_(id) { (void)flags; }
  TraceID(uint16_t id, unsigned int* flags) : data_(id) { (void)flags; }
  TraceID(unsigned char id, unsigned int* flags) : data_(id) { (void)flags; }
  TraceID(int64_t id, unsigned int* flags) : data_(static_cast<uint64_t>(id)) {
    (void)flags;
  }
  TraceID(int id, unsigned int* flags) : data_(static_cast<uint64_t>(id)) {
    (void)flags;
  }
  TraceID(int16_t id, unsigned int* flags) : data_(static_cast<uint64_t>(id)) {
    (void)flags;
  }
  TraceID(signed char id, unsigned int* flags)
      : data_(static_cast<uint64_t>(id)) {
    (void)flags;
  }

  uint64_t data() const { return data_; }

 private:
  uint64_t data_;
};

// Simple union to store various types as uint64_t.
union TraceValueUnion {
  bool as_bool;
  uint64_t as_uint;
  int64_t as_int;
  double as_double;
  const void* as_pointer;
  const char* as_string;
};

// Simple container for const char* that should be copied instead of retained.
class TraceStringWithCopy {
 public:
  explicit TraceStringWithCopy(const char* str) : str_(str) {}
  operator const char*() const { return str_; }

 private:
  const char* str_;
};

// Define SetTraceValue for each allowed type. It stores the type and
// value in the return arguments. This allows this API to avoid declaring any
// structures so that it is portable to third_party libraries.
#define INTERNAL_DECLARE_SET_TRACE_VALUE(actual_type, union_member,         \
                                         value_type_id)                     \
  static V8_INLINE void SetTraceValue(actual_type arg, unsigned char* type, \
                                      uint64_t* value) {                    \
    TraceValueUnion type_value;                                             \
    type_value.union_member = arg;                                          \
    *type = value_type_id;                                                  \
    *value = type_value.as_uint;                                            \
  }
// Simpler form for int types that can be safely casted.
#define INTERNAL_DECLARE_SET_TRACE_VALUE_INT(actual_type, value_type_id)    \
  static V8_INLINE void SetTraceValue(actual_type arg, unsigned char* type, \
                                      uint64_t* value) {                    \
    *type = value_type_id;                                                  \
    *value = static_cast<uint64_t>(arg);                                    \
  }

INTERNAL_DECLARE_SET_TRACE_VALUE_INT(uint64_t, TRACE_VALUE_TYPE_UINT)
INTERNAL_DECLARE_SET_TRACE_VALUE_INT(unsigned int, TRACE_VALUE_TYPE_UINT)
INTERNAL_DECLARE_SET_TRACE_VALUE_INT(uint16_t, TRACE_VALUE_TYPE_UINT)
INTERNAL_DECLARE_SET_TRACE_VALUE_INT(unsigned char, TRACE_VALUE_TYPE_UINT)
INTERNAL_DECLARE_SET_TRACE_VALUE_INT(int64_t, TRACE_VALUE_TYPE_INT)
INTERNAL_DECLARE_SET_TRACE_VALUE_INT(int, TRACE_VALUE_TYPE_INT)
INTERNAL_DECLARE_SET_TRACE_VALUE_INT(int16_t, TRACE_VALUE_TYPE_INT)
INTERNAL_DECLARE_SET_TRACE_VALUE_INT(signed char, TRACE_VALUE_TYPE_INT)
INTERNAL_DECLARE_SET_TRACE_VALUE(bool, as_bool, TRACE_VALUE_TYPE_BOOL)
INTERNAL_DECLARE_SET_TRACE_VALUE(double, as_double, TRACE_VALUE_TYPE_DOUBLE)
INTERNAL_DECLARE_SET_TRACE_VALUE(const void*, as_pointer,
                                 TRACE_VALUE_TYPE_POINTER)
INTERNAL_DECLARE_SET_TRACE_VALUE(const char*, as_string,
                                 TRACE_VALUE_TYPE_STRING)
INTERNAL_DECLARE_SET_TRACE_VALUE(const TraceStringWithCopy&, as_string,
                                 TRACE_VALUE_TYPE_COPY_STRING)

#undef INTERNAL_DECLARE_SET_TRACE_VALUE
#undef INTERNAL_DECLARE_SET_TRACE_VALUE_INT

// These AddTraceEvent template
// function is defined here instead of in the macro, because the arg_values
// could be temporary objects, such as std::string. In order to store
// pointers to the internal c_str and pass through to the tracing API,
// the arg_values must live throughout these procedures.

static V8_INLINE uint64_t AddTraceEvent(char phase,
                                        const uint8_t* category_group_enabled,
                                        const char* name, uint64_t id,
                                        uint64_t bind_id, unsigned int flags) {
  return TRACE_EVENT_API_ADD_TRACE_EVENT(phase, category_group_enabled, name,
                                         id, bind_id, kZeroNumArgs, NULL, NULL,
                                         NULL, flags);
}

template <class ARG1_TYPE>
static V8_INLINE uint64_t AddTraceEvent(char phase,
                                        const uint8_t* category_group_enabled,
                                        const char* name, uint64_t id,
                                        uint64_t bind_id, unsigned int flags,
                                        const char* arg1_name,
                                        const ARG1_TYPE& arg1_val) {
  const int num_args = 1;
  uint8_t arg_types[1];
  uint64_t arg_values[1];
  SetTraceValue(arg1_val, &arg_types[0], &arg_values[0]);
  return TRACE_EVENT_API_ADD_TRACE_EVENT(phase, category_group_enabled, name,
                                         id, bind_id, num_args, &arg1_name,
                                         arg_types, arg_values, flags);
}

template <class ARG1_TYPE, class ARG2_TYPE>
static V8_INLINE uint64_t AddTraceEvent(
    char phase, const uint8_t* category_group_enabled, const char* name,
    uint64_t id, uint64_t bind_id, unsigned int flags, const char* arg1_name,
    const ARG1_TYPE& arg1_val, const char* arg2_name,
    const ARG2_TYPE& arg2_val) {
  const int num_args = 2;
  const char* arg_names[2] = {arg1_name, arg2_name};
  unsigned char arg_types[2];
  uint64_t arg_values[2];
  SetTraceValue(arg1_val, &arg_types[0], &arg_values[0]);
  SetTraceValue(arg2_val, &arg_types[1], &arg_values[1]);
  return TRACE_EVENT_API_ADD_TRACE_EVENT(phase, category_group_enabled, name,
                                         id, bind_id, num_args, arg_names,
                                         arg_types, arg_values, flags);
}

// Used by TRACE_EVENTx macros. Do not use directly.
class ScopedTracer {
 public:
  // Note: members of data_ intentionally left uninitialized. See Initialize.
  ScopedTracer() : p_data_(NULL) {}

  ~ScopedTracer() {
    if (p_data_ && *data_.category_group_enabled)
      TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(
          data_.category_group_enabled, data_.name, data_.event_handle);
  }

  void Initialize(const uint8_t* category_group_enabled, const char* name,
                  uint64_t event_handle) {
    data_.category_group_enabled = category_group_enabled;
    data_.name = name;
    data_.event_handle = event_handle;
    p_data_ = &data_;
  }

 private:
  // This Data struct workaround is to avoid initializing all the members
  // in Data during construction of this object, since this object is always
  // constructed, even when tracing is disabled. If the members of Data were
  // members of this class instead, compiler warnings occur about potential
  // uninitialized accesses.
  struct Data {
    const uint8_t* category_group_enabled;
    const char* name;
    uint64_t event_handle;
  };
  Data* p_data_;
  Data data_;
};

// Used by TRACE_EVENT_BINARY_EFFICIENTx macro. Do not use directly.
class ScopedTraceBinaryEfficient {
 public:
  ScopedTraceBinaryEfficient(const char* category_group, const char* name);
  ~ScopedTraceBinaryEfficient();

 private:
  const uint8_t* category_group_enabled_;
  const char* name_;
  uint64_t event_handle_;
};

// TraceEventSamplingStateScope records the current sampling state
// and sets a new sampling state. When the scope exists, it restores
// the sampling state having recorded.
template <size_t BucketNumber>
class TraceEventSamplingStateScope {
 public:
  explicit TraceEventSamplingStateScope(const char* category_and_name) {
    previous_state_ = TraceEventSamplingStateScope<BucketNumber>::Current();
    TraceEventSamplingStateScope<BucketNumber>::Set(category_and_name);
  }

  ~TraceEventSamplingStateScope() {
    TraceEventSamplingStateScope<BucketNumber>::Set(previous_state_);
  }

  static V8_INLINE const char* Current() {
    return reinterpret_cast<const char*>(
        TRACE_EVENT_API_ATOMIC_LOAD(g_trace_state[BucketNumber]));
  }

  static V8_INLINE void Set(const char* category_and_name) {
    TRACE_EVENT_API_ATOMIC_STORE(g_trace_state[BucketNumber],
                                 reinterpret_cast<TRACE_EVENT_API_ATOMIC_WORD>(
                                     const_cast<char*>(category_and_name)));
  }

 private:
  const char* previous_state_;
};

}  // namespace tracing
}  // namespace internal
}  // namespace v8

#endif  // SRC_TRACING_TRACE_EVENT_H_


text:
// OOP244 Workshop 8: Derived Classes
// File	w8_at_home.cpp
// Version 1.0
// Date	2016/11/06
// Author	Franz Newland, Eden Burton
// Description
//      This file demonstrates the client module of w8
/////////////////////////////////////////////////////

#include <iostream>
#include "SuperHero.h"

int main()
{
	SuperHero p;
	p.display(std::cout);

	SuperHero w("wimpy", -10, 5);
	w.display(std::cout);

	SuperHero h("Hercules", 100, 5);
	h.display(std::cout);

	SuperHero hClone(h);
	hClone.display(std::cout);

	SuperHero sm("Superman", 130, 5);
	sm.display(std::cout);

	std::cout << "Superman battles Hercules' clone!" << std::endl;
	sm *= hClone;

	sm.display(std::cout);
	hClone.display(std::cout);

	std::cout << "Hercules battles Superman!" << std::endl;
	h *= sm;

	sm.display(std::cout);
	hClone.display(std::cout);

	// Reflection section
	Hero o = sm;  // Why does this compile?
	o.isEmpty();

	// Uncomment the following two lines to see what happens. Explain the result!
	//Hero o2;
	//SuperHero sh = o2;

	return 0;
}


text:
<?php

/*
 * This file is part of CustomScripts HelpDesk project.
 *
 * (c) 2015 Pierre du Plessis <info@customscripts.co.za>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace spec\CS\HelpDeskBundle\Repository;

use CS\HelpDeskBundle\Entity\Ticket;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Mapping\ClassMetadata;
use PhpSpec\ObjectBehavior;

class TicketRepositorySpec extends ObjectBehavior
{
    function it_is_initializable()
    {
        $this->shouldHaveType('CS\HelpDeskBundle\Repository\TicketRepository');
        $this->shouldImplement('Doctrine\Common\Persistence\ObjectRepository');
    }

    function let(EntityManager $em, ClassMetadata $metadata)
    {
        $this->beConstructedWith($em, $metadata);
    }

    function it_saves_a_ticket($em)
    {
        $ticket = new Ticket();

        $this->save($ticket)->shouldReturn(true);

        $em->persist($ticket)->shouldHaveBeenCalled();
        $em->flush()->shouldHaveBeenCalled();
    }
}


text:
const lib = require('something');

function f() {
    return {
        x: new Object() /* def=moduleImport("something").getMember("exports").getMember("m1").getParameter(0).getMember("x") */
    }
}

lib.m1({
    ...f()
})


text:
package org.zalando.logbook;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.io.IOException;
import java.time.Clock;
import java.time.Duration;
import java.time.Instant;
import java.util.function.Predicate;

import static lombok.AccessLevel.PRIVATE;

@AllArgsConstructor
final class DefaultLogbook implements Logbook {

    private final Predicate<HttpRequest> predicate;
    private final CorrelationId correlationId;
    private final RequestFilter requestFilter;
    private final ResponseFilter responseFilter;
    private final Strategy strategy;
    private final Sink sink;
    private final Clock clock = Clock.systemUTC();

    @Override
    public RequestWritingStage process(final HttpRequest originalRequest) throws IOException {
        return process(originalRequest, strategy);
    }

    @Override
    public RequestWritingStage process(final HttpRequest originalRequest, final Strategy strategy) throws IOException {

        if (sink.isActive() && predicate.test(originalRequest)) {
            final Precorrelation precorrelation = newPrecorrelation(originalRequest);
            final HttpRequest processedRequest = strategy.process(originalRequest);

            final HttpRequest request = new CachingHttpRequest(processedRequest);
            final HttpRequest filteredRequest = requestFilter.filter(request);

            return new RequestWritingStage() {
                @Override
                public ResponseProcessingStage write() throws IOException {
                    strategy.write(precorrelation, filteredRequest, sink);

                    return this;
                }

                @Override
                public ResponseWritingStage process(final HttpResponse originalResponse) throws IOException {
                    final HttpResponse processedResponse = strategy.process(filteredRequest, originalResponse);

                    return () -> {
                        final HttpResponse response = new CachingHttpResponse(processedResponse);
                        final HttpResponse filteredResponse = responseFilter.filter(response);
                        strategy.write(precorrelation.correlate(), filteredRequest, filteredResponse, sink);
                    };
                }
            };
        } else {
            return Stages.noop();
        }
    }

    private Precorrelation newPrecorrelation(final HttpRequest request) {
        return new SimplePrecorrelation(correlationId.generate(request), clock);
    }

    static final class SimplePrecorrelation implements Precorrelation {

        @Getter
        private final String id;

        private final Clock clock;

        @Getter
        private final Instant start;

        // visible for testing
        SimplePrecorrelation(final String id, final Clock clock) {
            this.id = id;
            this.clock = clock;
            this.start = Instant.now(clock);
        }

        @Override
        public Correlation correlate() {
            return new SimpleCorrelation(id, start, Instant.now(clock));
        }

    }

    @AllArgsConstructor(access = PRIVATE)
    @Getter
    static final class SimpleCorrelation implements Correlation {

        private final String id;
        private final Instant start;
        private final Instant end;
        private final Duration duration;

        SimpleCorrelation(final String id, final Instant start, final Instant end) {
            this(id, start, end, Duration.between(start, end));
        }

    }

}