text:
#include "qplatformwindow_qpa.h"

#include <QtGui/qwindowsysteminterface_qpa.h>
#include <QtGui/qwidget.h>

class QPlatformWindowPrivate
{
    QWidget *tlw;
    QRect rect;
    Qt::WindowFlags flags;
    friend class QPlatformWindow;
};

/*!
    Constructs a platform window with the given top level widget.
*/

QPlatformWindow::QPlatformWindow(QWidget *tlw)
    : d_ptr(new QPlatformWindowPrivate)
{
    Q_D(QPlatformWindow);
    d->tlw = tlw;
    tlw->setPlatformWindow(this);
}

/*!
    Virtual destructor does not delete its top level widget.
*/
QPlatformWindow::~QPlatformWindow()
{
}

/*!
    Returnes the widget which belongs to the QPlatformWindow
*/
QWidget *QPlatformWindow::widget() const
{
    Q_D(const QPlatformWindow);
    return d->tlw;
}

/*!
    This function is called by Qt whenever a window is moved or the window is resized. The resize
    can happen programatically(from ie. user application) or by the window manager. This means that
    there is no need to call this function specifically from the window manager callback, instead
    call QWindowSystemInterface::handleGeometryChange(QWidget *w, const QRect &newRect);
*/
void QPlatformWindow::setGeometry(const QRect &rect)
{
    Q_D(QPlatformWindow);
    d->rect = rect;
}

/*!
    Returnes the current geometry of a window
*/
QRect QPlatformWindow::geometry() const
{
    Q_D(const QPlatformWindow);
    return d->rect;
}

/*!
    Reimplemented in subclasses to show the surface
    if \a visible is \c true, and hide it if \a visible is \c false.
*/
void QPlatformWindow::setVisible(bool visible)
{
    Q_UNUSED(visible);
}
/*!
    Requests setting the window flags of this surface
    to \a type. Returns the actual flags set.
*/
Qt::WindowFlags QPlatformWindow::setWindowFlags(Qt::WindowFlags flags)
{
    Q_D(QPlatformWindow);
    d->flags = flags;
    return flags;
}

/*!
  Returns the effective window flags for this surface.
*/
Qt::WindowFlags QPlatformWindow::windowFlags() const
{
    Q_D(const QPlatformWindow);
    return d->flags;
}

/*!
  Reimplement in subclasses to return a handle to the native window
*/
WId QPlatformWindow::winId() const { return WId(0); }

/*!
    This function is called to enable native child widgets in QPA. It is common not to support this
    feature in Window systems, but can be faked. When this function is called all geometry of this
    platform window will be relative to the parent.
*/
//jl: It would be useful to have a property on the platform window which indicated if the sub-class
// supported the setParent. If not, then geometry would be in screen coordinates.
void QPlatformWindow::setParent(const QPlatformWindow *parent)
{
    Q_UNUSED(parent);
    qWarning("This plugin does not support setParent!");
}

/*!
  Reimplement to set the window title to \a title
*/
void QPlatformWindow::setWindowTitle(const QString &) {}

/*!
  Reimplement to be able to let Qt rais windows to the top of the desktop
*/
void QPlatformWindow::raise() { qWarning("This plugin does not support raise()"); }

/*!
  Reimplement to be able to let Qt lower windows to the bottom of the desktop
*/
void QPlatformWindow::lower() { qWarning("This plugin does not support lower()"); }

/*!
  Reimplement to be able to let Qt set the opacity level of a window
*/
void QPlatformWindow::setOpacity(qreal level)
{
    Q_UNUSED(level);
    qWarning("This plugin does not support setting window opacity");
}

/*!
  Reimplement to let Qt be able to request activation/focus for a window

  Some window systems will probably not have callbacks for this functionality,
  and then calling QWindowSystemInterface::handleWindowActivated(QWidget *w)
  would be sufficient.

  If the window system has some event handling/callbacks then call
  QWindowSystemInterface::handleWindowActivated(QWidget *w) when the window system
  gives the notification.

  Default implementation calls QWindowSystem::handleWindowActivated(QWidget *w)
*/
void QPlatformWindow::requestActivateWindow()
{
    QWindowSystemInterface::handleWindowActivated(widget());
}

/*!
  Reimplement to return the glContext associated with the window.
*/
QPlatformGLContext *QPlatformWindow::glContext() const
{
    return 0;
}

/*!
    \class QPlatformWindow
    \since 4.8
    \internal
    \preliminary
    \ingroup qpa

    \brief The QPlatformWindow class provides an abstraction for top-level windows.

    The QPlatformWindow abstraction is used by QWidget for all its top level widgets. It is being
    created by calling the createPlatformWindow function in the loaded QPlatformIntegration
    instance.

    QPlatformWindow is used to signal to the windowing system, how Qt persieves its frame.
    However, it is not concerned with how Qt renders into the window it represents.

    Top level QWidgets(tlw) will always have a QPlatformWindow. However, it is not necessary for
    all tlw to have a QWindowSurface. This is the case for QGLWidget. And could be the case for
    widgets where some  3.party renders into it.

    The platform specific window handle can be retrieved by the winId function.

    QPlatformWindow is also the way QPA defines how native child windows should be supported
    through the setParent function.

    The only way to retrieve a QPlatformGLContext in QPA is by calling the glContext() function
    on QPlatformWindow.

    \sa QWindowSurface, QWidget
*/


text:
package io.perfmark.java9;

import static org.junit.Assert.assertEquals;

import io.perfmark.impl.Generator;
import io.perfmark.impl.Mark;
import io.perfmark.impl.MarkHolder;
import io.perfmark.testing.MarkHolderTest;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

@RunWith(JUnit4.class)
public class VarHandleMarkHolderTest extends MarkHolderTest {

  private final long gen = 1L << Generator.GEN_OFFSET;

  @Override
  protected MarkHolder getMarkHolder() {
    return new VarHandleMarkHolder();
  }

  @Test
  public void read_getsAllButLastIfNotWriter() {
    MarkHolder mh = getMarkHolder();
    int events = mh.maxMarks() - 1;
    for (int i = 0; i < events; i++) {
      mh.start(gen, "task", 3);
    }

    List<Mark> marks = mh.read(true);
    assertEquals(events - 1, marks.size());
  }

  @Test
  public void read_getsAllIfNotWriterButNoWrap() {
    MarkHolder mh = getMarkHolder();

    int events = mh.maxMarks() - 2;
    for (int i = 0; i < events; i++) {
      mh.start(gen, "task", 3);
    }

    List<Mark> marks = mh.read(true);
    assertEquals(events, marks.size());
  }
}

redpajama_set_name: RedPajamaGithub


text:
describe("ItemContainer control directive tests", function () {
    var scope,
        compile;

    beforeEach(angular.mock.module("winjs"));
    beforeEach(angular.mock.inject(function ($rootScope, $compile) {
        scope = $rootScope.$new();
        compile = $compile;
    }));

    function initControl(markup) {
        var element = angular.element(markup)[0];
        document.body.appendChild(element);
        var compiledControl = compile(element)(scope)[0];
        scope.$digest();
        return compiledControl;
    }

    it("should initialize a simple ItemContainer", function () {
        var compiledControl = initControl("<win-item-container></win-item-container>");

        expect(compiledControl.winControl).toBeDefined();
        expect(compiledControl.winControl instanceof WinJS.UI.ItemContainer);
        expect(compiledControl.className).toContain("win-itemcontainer");
    });

    it("should use the draggable attribute", function () {
        var compiledControl = initControl("<win-item-container draggable='true'></win-item-container>");

        var winControl = compiledControl.winControl;
        expect(winControl.draggable).toBeTruthy();
    });

    it("should use the selected attribute", function () {
        var compiledControl = initControl("<win-item-container selected='true'></win-item-container>");

        var winControl = compiledControl.winControl;
        expect(winControl.selected).toBeTruthy();
    });

    it("should use the selectionDisabled attribute", function () {
        var compiledControl = initControl("<win-item-container selection-disabled='true'></win-item-container>");

        var winControl = compiledControl.winControl;
        expect(winControl.selectionDisabled).toBeTruthy();
    });

    it("should use the tapBehavior attribute", function () {
        var compiledControl = initControl("<win-item-container tap-behavior='\"toggleSelect\"'></win-item-container>");

        var winControl = compiledControl.winControl;
        expect(winControl.tapBehavior).toBe(WinJS.UI.TapBehavior.toggleSelect);
    });

    it("should receive selection events", function () {
        var gotChangingEvent = false,
            gotChangedEvent = false;
        scope.changingEventHandler = function (e) {
            gotChangingEvent = true;
        };
        scope.changedEventHandler = function (e) {
            gotChangedEvent = true;
        };
        var compiledControl = initControl("<win-item-container on-selection-changing='changingEventHandler($event)' on-selection-changed='changedEventHandler($event)'></win-item-container>");

        var winControl = compiledControl.winControl;
        expect(winControl.selected).toBeFalsy();
        expect(gotChangingEvent).toBeFalsy();
        expect(gotChangedEvent).toBeFalsy();
        winControl.selected = true;
        scope.$digest();
        expect(winControl.selected).toBeTruthy();
        expect(gotChangingEvent).toBeTruthy();
        expect(gotChangedEvent).toBeTruthy();
    });

    afterEach(function () {
        var controls = document.querySelectorAll(".win-itemcontainer");
        for (var i = 0; i < controls.length; i++) {
            controls[i].parentNode.removeChild(controls[i]);
        }
    });
});


text:
var Url = "http://user:pass@host.com:8080/p/a/t/h?query=string#hash";

var fs = require('fs'),
url = require('url'),
exec = require('child_process').exec;

console.log( url.parse(Url) );

require.ext = function(module){
	fs.exists('./ext/'+module+'/index.js' , function(err){
		if( err ){
			exec('su - www-data -c "./ext/'+module+'/index.js"');
			//- return require('./ext/'+module+'/index.js');
		}
	});
};

var Config = require('./config.js');

console.log( typeof require.ext );

var mysql = require.ext('mysql');


text:
<html>
<head>
<script src="../../../http/tests/inspector/inspector-test.js"></script>
<script src="../../../http/tests/inspector/debugger-test.js"></script>
<script>

function testFunction()
{
    setTimeout(timeout, 0);
}

function timeout()
{
    window.addEventListener("paste", onPaste, false);

    var input = document.getElementById("input");
    input.value = "value";
    input.focus();
    input.select();
    document.execCommand("Copy");

    input.value = "";
    input.focus();
    document.execCommand("Paste");
}

function onPaste(e)
{
    debugger;
    window.removeEventListener("paste", onPaste, false);
    var items = (e.originalEvent || e).clipboardData.items;
    var item = items[0];
    item.getAsString(onGetAsString);
}

function onGetAsString()
{
    debugger;
}

function test()
{
    var totalDebuggerStatements = 2;
    var maxAsyncCallStackDepth = 4;
    InspectorTest.runAsyncCallStacksTest(totalDebuggerStatements, maxAsyncCallStackDepth);
}

</script>
</head>

<body onload="runTest()">
<input type="text" id="input"></input>
<p>
Tests asynchronous call stacks for DataTransferItem.getAsString.
</p>

</body>
</html>


text:
namespace silica
{
    using Models;
    using System.Threading;
    using System.Threading.Tasks;

    /// <summary>
    /// Extension methods for GetSystemUseragentApi.
    /// </summary>
    public static partial class GetSystemUseragentApiExtensions
    {
            /// <summary>
            /// Consumer User Agent Information
            /// </summary>
            /// <remarks>
            /// Endpoint used to return the Consumer User Agent Information.
            /// </remarks>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='aPIKey'>
            /// Client API Key
            /// </param>
            public static void Key(this IGetSystemUseragentApi operations, string aPIKey)
            {
                operations.KeyAsync(aPIKey).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Consumer User Agent Information
            /// </summary>
            /// <remarks>
            /// Endpoint used to return the Consumer User Agent Information.
            /// </remarks>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='aPIKey'>
            /// Client API Key
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task KeyAsync(this IGetSystemUseragentApi operations, string aPIKey, CancellationToken cancellationToken = default(CancellationToken))
            {
                (await operations.KeyWithHttpMessagesAsync(aPIKey, null, cancellationToken).ConfigureAwait(false)).Dispose();
            }

    }
}


text:
#ifndef CRYS_ECPKI_ERROR_H
#define CRYS_ECPKI_ERROR_H

/*!
@file
@brief This module contains the definitions of the CRYS ECPKI errors.
@defgroup crys_ecpki_error CryptoCell ECC specific errors
@{
@ingroup cryptocell_ecpki
*/

#include "crys_error.h"

#ifdef __cplusplus
extern "C"
{
#endif

/************************ Defines ******************************/

/* CRYS_ECPKI_MODULE_ERROR_BASE = 0x00F00800  */

/*********************************************************************************************
 * CRYS ECPKI MODULE ERRORS                                                                  *
 *********************************************************************************************/
/*! Illegal domain ID. */
#define CRYS_ECPKI_ILLEGAL_DOMAIN_ID_ERROR	                (CRYS_ECPKI_MODULE_ERROR_BASE + 0x1UL)
/*! Illegal domain pointer. */
#define CRYS_ECPKI_DOMAIN_PTR_ERROR	  			(CRYS_ECPKI_MODULE_ERROR_BASE + 0x2UL)
/* The CRYS ECPKI GEN KEY PAIR module errors */
/*! Illegal private key pointer. */
#define CRYS_ECPKI_GEN_KEY_INVALID_PRIVATE_KEY_PTR_ERROR        (CRYS_ECPKI_MODULE_ERROR_BASE + 0x3UL)
/*! Illegal public key pointer. */
#define CRYS_ECPKI_GEN_KEY_INVALID_PUBLIC_KEY_PTR_ERROR         (CRYS_ECPKI_MODULE_ERROR_BASE + 0x4UL)
/*! Illegal temporary buffer pointer. */
#define CRYS_ECPKI_GEN_KEY_INVALID_TEMP_DATA_PTR_ERROR          (CRYS_ECPKI_MODULE_ERROR_BASE + 0x5UL)
/*! Illegal RND context pointer. */
#define CRYS_ECPKI_RND_CONTEXT_PTR_ERROR	  		(CRYS_ECPKI_MODULE_ERROR_BASE + 0x6UL)

/************************************************************************************************************
* The CRYS ECPKI BUILD KEYS MODULE ERRORS                                                                   *
*************************************************************************************************************/
/*! Illegal compression mode. */
#define CRYS_ECPKI_BUILD_KEY_INVALID_COMPRESSION_MODE_ERROR     (CRYS_ECPKI_MODULE_ERROR_BASE + 0x07UL)
/*! Illegal domain ID. */
#define CRYS_ECPKI_BUILD_KEY_ILLEGAL_DOMAIN_ID_ERROR            (CRYS_ECPKI_MODULE_ERROR_BASE + 0x08UL)
/*! Illegal private key pointer. */
#define CRYS_ECPKI_BUILD_KEY_INVALID_PRIV_KEY_IN_PTR_ERROR      (CRYS_ECPKI_MODULE_ERROR_BASE + 0x09UL)
/*! Illegal private key structure pointer. */
#define CRYS_ECPKI_BUILD_KEY_INVALID_USER_PRIV_KEY_PTR_ERROR    (CRYS_ECPKI_MODULE_ERROR_BASE + 0x0AUL)
/*! Illegal private key size. */
#define CRYS_ECPKI_BUILD_KEY_INVALID_PRIV_KEY_SIZE_ERROR        (CRYS_ECPKI_MODULE_ERROR_BASE + 0x0BUL)
/*! Illegal private key data. */
#define CRYS_ECPKI_BUILD_KEY_INVALID_PRIV_KEY_DATA_ERROR        (CRYS_ECPKI_MODULE_ERROR_BASE + 0x0CUL)
/*! Illegal public key pointer. */
#define CRYS_ECPKI_BUILD_KEY_INVALID_PUBL_KEY_IN_PTR_ERROR      (CRYS_ECPKI_MODULE_ERROR_BASE + 0x0DUL)
/*! Illegal public key structure pointer. */
#define CRYS_ECPKI_BUILD_KEY_INVALID_USER_PUBL_KEY_PTR_ERROR    (CRYS_ECPKI_MODULE_ERROR_BASE + 0x0EUL)
/*! Illegal public key size. */
#define CRYS_ECPKI_BUILD_KEY_INVALID_PUBL_KEY_SIZE_ERROR        (CRYS_ECPKI_MODULE_ERROR_BASE + 0x0FUL)
/*! Illegal public key data. */
#define CRYS_ECPKI_BUILD_KEY_INVALID_PUBL_KEY_DATA_ERROR        (CRYS_ECPKI_MODULE_ERROR_BASE + 0x10UL)
/*! Illegal EC build check mode option. */
#define CRYS_ECPKI_BUILD_KEY_INVALID_CHECK_MODE_ERROR           (CRYS_ECPKI_MODULE_ERROR_BASE + 0x11UL)
/*! Illegal temporary buffer pointer. */
#define CRYS_ECPKI_BUILD_KEY_INVALID_TEMP_BUFF_PTR_ERROR        (CRYS_ECPKI_MODULE_ERROR_BASE + 0x12UL)

/* The CRYS ECPKI EXPORT PUBLIC KEY MODULE ERRORS */
/*! Illegal public key structure pointer. */
#define CRYS_ECPKI_EXPORT_PUBL_KEY_INVALID_USER_PUBL_KEY_PTR_ERROR      (CRYS_ECPKI_MODULE_ERROR_BASE + 0x14UL)
/*! Illegal public key compression mode. */
#define CRYS_ECPKI_EXPORT_PUBL_KEY_ILLEGAL_COMPRESSION_MODE_ERROR       (CRYS_ECPKI_MODULE_ERROR_BASE + 0x15UL)
/*! Illegal output public key pointer. */
#define CRYS_ECPKI_EXPORT_PUBL_KEY_INVALID_EXTERN_PUBL_KEY_PTR_ERROR    (CRYS_ECPKI_MODULE_ERROR_BASE + 0x16UL)
/*! Illegal output public key size pointer. */
#define CRYS_ECPKI_EXPORT_PUBL_KEY_INVALID_PUBL_KEY_SIZE_PTR_ERROR      (CRYS_ECPKI_MODULE_ERROR_BASE + 0x17UL)
/*! Illegal output public key size. */
#define CRYS_ECPKI_EXPORT_PUBL_KEY_INVALID_PUBL_KEY_SIZE_ERROR          (CRYS_ECPKI_MODULE_ERROR_BASE + 0x18UL)
/*! Illegal domain ID. */
#define CRYS_ECPKI_EXPORT_PUBL_KEY_ILLEGAL_DOMAIN_ID_ERROR              (CRYS_ECPKI_MODULE_ERROR_BASE + 0x19UL)
/*! Validation of public key failed. */
#define CRYS_ECPKI_EXPORT_PUBL_KEY_ILLEGAL_VALIDATION_TAG_ERROR         (CRYS_ECPKI_MODULE_ERROR_BASE + 0x1AUL)
/*! Validation of public key failed. */
#define CRYS_ECPKI_EXPORT_PUBL_KEY_INVALID_PUBL_KEY_DATA_ERROR          (CRYS_ECPKI_MODULE_ERROR_BASE + 0x1BUL)

/* The CRYS ECPKI BUILD ECC DOMAIN ERRORS */
/*! Illegal domain ID. */
#define CRYS_ECPKI_BUILD_DOMAIN_ID_IS_NOT_VALID_ERROR	         (CRYS_ECPKI_MODULE_ERROR_BASE + 0x20UL)
/*! Illegal domain ID pointer. */
#define CRYS_ECPKI_BUILD_DOMAIN_DOMAIN_PTR_ERROR                 (CRYS_ECPKI_MODULE_ERROR_BASE + 0x21UL)
/*! Illegal domain parameter pointer. */
#define CRYS_ECPKI_BUILD_DOMAIN_EC_PARAMETR_PTR_ERROR            (CRYS_ECPKI_MODULE_ERROR_BASE + 0x22UL)
/*! Illegal domain parameter size. */
#define CRYS_ECPKI_BUILD_DOMAIN_EC_PARAMETR_SIZE_ERROR           (CRYS_ECPKI_MODULE_ERROR_BASE + 0x23UL)
/*! Illegal domain cofactor parameters. */
#define CRYS_ECPKI_BUILD_DOMAIN_COFACTOR_PARAMS_ERROR            (CRYS_ECPKI_MODULE_ERROR_BASE + 0x24UL)
/*! Insufficient strength. */
#define CRYS_ECPKI_BUILD_DOMAIN_SECURITY_STRENGTH_ERROR          (CRYS_ECPKI_MODULE_ERROR_BASE + 0x25UL)
/*! SCA resistance error. */
#define CRYS_ECPKI_BUILD_SCA_RESIST_ILLEGAL_MODE_ERROR           (CRYS_ECPKI_MODULE_ERROR_BASE + 0x26UL)

/*! Internal PKI error */
#define CRYS_ECPKI_PKI_INTERNAL_ERROR                            (CRYS_ECPKI_MODULE_ERROR_BASE + 0x30UL)

/************************************************************************************************************
 * CRYS EC DIFFIE-HELLMAN MODULE ERRORS
*************************************************************************************************************/
/* The CRYS EC SVDP_DH Function errors */
/*! Illegal partner's public key pointer. */
#define CRYS_ECDH_SVDP_DH_INVALID_PARTNER_PUBL_KEY_PTR_ERROR	              (CRYS_ECPKI_MODULE_ERROR_BASE + 0x31UL)
/*! Partner's public key validation failed. */
#define CRYS_ECDH_SVDP_DH_PARTNER_PUBL_KEY_VALID_TAG_ERROR	              (CRYS_ECPKI_MODULE_ERROR_BASE + 0x32UL)
/*! Illegal user private key pointer. */
#define CRYS_ECDH_SVDP_DH_INVALID_USER_PRIV_KEY_PTR_ERROR		      (CRYS_ECPKI_MODULE_ERROR_BASE + 0x33UL)
/*! Private key validation failed. */
#define CRYS_ECDH_SVDP_DH_USER_PRIV_KEY_VALID_TAG_ERROR		              (CRYS_ECPKI_MODULE_ERROR_BASE + 0x34UL)
/*! Illegal shared secret pointer. */
#define CRYS_ECDH_SVDP_DH_INVALID_SHARED_SECRET_VALUE_PTR_ERROR	              (CRYS_ECPKI_MODULE_ERROR_BASE + 0x35UL)
/*! Illegal temporary buffer pointer. */
#define CRYS_ECDH_SVDP_DH_INVALID_TEMP_DATA_PTR_ERROR                         (CRYS_ECPKI_MODULE_ERROR_BASE + 0x36UL)
/*! Illegal shared secret size pointer. */
#define CRYS_ECDH_SVDP_DH_INVALID_SHARED_SECRET_VALUE_SIZE_PTR_ERROR          (CRYS_ECPKI_MODULE_ERROR_BASE + 0x37UL)
/*! Illegal shared secret size. */
#define CRYS_ECDH_SVDP_DH_INVALID_SHARED_SECRET_VALUE_SIZE_ERROR              (CRYS_ECPKI_MODULE_ERROR_BASE + 0x38UL)
/*! Illegal domain ID. */
#define CRYS_ECDH_SVDP_DH_ILLEGAL_DOMAIN_ID_ERROR                             (CRYS_ECPKI_MODULE_ERROR_BASE + 0x39UL)
/*! Illegal private and public domain ID are different. */
#define CRYS_ECDH_SVDP_DH_NOT_CONCENT_PUBL_AND_PRIV_DOMAIN_ID_ERROR           (CRYS_ECPKI_MODULE_ERROR_BASE + 0x3AUL)

/************************************************************************************************************
 * CRYS ECDSA  MODULE ERRORS
 ************************************************************************************************************/
/* The CRYS ECDSA Signing  errors */
/*! Illegal domain ID. */
#define CRYS_ECDSA_SIGN_INVALID_DOMAIN_ID_ERROR			(CRYS_ECPKI_MODULE_ERROR_BASE + 0x50UL)
/*! Illegal context pointer. */
#define CRYS_ECDSA_SIGN_INVALID_USER_CONTEXT_PTR_ERROR 	        (CRYS_ECPKI_MODULE_ERROR_BASE + 0x51UL)
/*! Illegal private key pointer. */
#define CRYS_ECDSA_SIGN_INVALID_USER_PRIV_KEY_PTR_ERROR         (CRYS_ECPKI_MODULE_ERROR_BASE + 0x52UL)
/*! Illegal hash operation mode. */
#define CRYS_ECDSA_SIGN_ILLEGAL_HASH_OP_MODE_ERROR              (CRYS_ECPKI_MODULE_ERROR_BASE + 0x53UL)
/*! Illegal data in pointer. */
#define CRYS_ECDSA_SIGN_INVALID_MESSAGE_DATA_IN_PTR_ERROR       (CRYS_ECPKI_MODULE_ERROR_BASE + 0x54UL)
/*! Illegal data in size. */
#define CRYS_ECDSA_SIGN_INVALID_MESSAGE_DATA_IN_SIZE_ERROR      (CRYS_ECPKI_MODULE_ERROR_BASE + 0x55UL)
/*! Context validation failed. */
#define CRYS_ECDSA_SIGN_USER_CONTEXT_VALIDATION_TAG_ERROR       (CRYS_ECPKI_MODULE_ERROR_BASE + 0x57UL)
/*! User's private key validation failed. */
#define CRYS_ECDSA_SIGN_USER_PRIV_KEY_VALIDATION_TAG_ERROR      (CRYS_ECPKI_MODULE_ERROR_BASE + 0x58UL)
/*! Illegal signature pointer. */
#define CRYS_ECDSA_SIGN_INVALID_SIGNATURE_OUT_PTR_ERROR         (CRYS_ECPKI_MODULE_ERROR_BASE + 0x60UL)
/*! Illegal signature size pointer. */
#define CRYS_ECDSA_SIGN_INVALID_SIGNATURE_OUT_SIZE_PTR_ERROR    (CRYS_ECPKI_MODULE_ERROR_BASE + 0x61UL)
/*! Illegal signature size. */
#define CRYS_ECDSA_SIGN_INVALID_SIGNATURE_OUT_SIZE_ERROR        (CRYS_ECPKI_MODULE_ERROR_BASE + 0x62UL)
/*! Ephemeral key error. */
#define CRYS_ECDSA_SIGN_INVALID_IS_EPHEMER_KEY_INTERNAL_ERROR   (CRYS_ECPKI_MODULE_ERROR_BASE + 0x63UL)
/*! Illegal ephemeral key pointer. */
#define CRYS_ECDSA_SIGN_INVALID_EPHEMERAL_KEY_PTR_ERROR         (CRYS_ECPKI_MODULE_ERROR_BASE + 0x64UL)
/*! Illegal RND context pointer. */
#define CRYS_ECDSA_SIGN_INVALID_RND_CONTEXT_PTR_ERROR           (CRYS_ECPKI_MODULE_ERROR_BASE + 0x65UL)
/*! Illegal RND function pointer. */
#define CRYS_ECDSA_SIGN_INVALID_RND_FUNCTION_PTR_ERROR          (CRYS_ECPKI_MODULE_ERROR_BASE + 0x66UL)
/*! Signature calculation failed. */
#define CRYS_ECDSA_SIGN_SIGNING_ERROR                           (CRYS_ECPKI_MODULE_ERROR_BASE + 0x67UL)

/* The CRYS ECDSA Verifying  errors */
/*! Illegal domain ID. */
#define CRYS_ECDSA_VERIFY_INVALID_DOMAIN_ID_ERROR		(CRYS_ECPKI_MODULE_ERROR_BASE + 0x70UL)
/*! Illegal user's context pointer. */
#define CRYS_ECDSA_VERIFY_INVALID_USER_CONTEXT_PTR_ERROR	(CRYS_ECPKI_MODULE_ERROR_BASE + 0x71UL)
/*! Illegal public key pointer. */
#define CRYS_ECDSA_VERIFY_INVALID_SIGNER_PUBL_KEY_PTR_ERROR     (CRYS_ECPKI_MODULE_ERROR_BASE + 0x72UL)
/*! Illegal hash operation mode. */
#define CRYS_ECDSA_VERIFY_ILLEGAL_HASH_OP_MODE_ERROR            (CRYS_ECPKI_MODULE_ERROR_BASE + 0x73UL)
/*! Illegal signature pointer. */
#define CRYS_ECDSA_VERIFY_INVALID_SIGNATURE_IN_PTR_ERROR        (CRYS_ECPKI_MODULE_ERROR_BASE + 0x76UL)
/*! Illegal signature size. */
#define CRYS_ECDSA_VERIFY_INVALID_SIGNATURE_SIZE_ERROR   	(CRYS_ECPKI_MODULE_ERROR_BASE + 0x77UL)
/*! Illegal data in pointer. */
#define CRYS_ECDSA_VERIFY_INVALID_MESSAGE_DATA_IN_PTR_ERROR     (CRYS_ECPKI_MODULE_ERROR_BASE + 0x80UL)
/*! Illegal data in size. */
#define CRYS_ECDSA_VERIFY_INVALID_MESSAGE_DATA_IN_SIZE_ERROR    (CRYS_ECPKI_MODULE_ERROR_BASE + 0x81UL)
/*! Context validation failed. */
#define CRYS_ECDSA_VERIFY_USER_CONTEXT_VALIDATION_TAG_ERROR     (CRYS_ECPKI_MODULE_ERROR_BASE + 0x82UL)
/*! public key validation failed. */
#define CRYS_ECDSA_VERIFY_SIGNER_PUBL_KEY_VALIDATION_TAG_ERROR  (CRYS_ECPKI_MODULE_ERROR_BASE + 0x83UL)
/*! Verification failed. */
#define CRYS_ECDSA_VERIFY_INCONSISTENT_VERIFY_ERROR             (CRYS_ECPKI_MODULE_ERROR_BASE + 0x84UL)

/*! Illegal parameters. */
#define CRYS_ECC_ILLEGAL_PARAMS_ACCORDING_TO_PRIV_ERROR      	     (CRYS_ECPKI_MODULE_ERROR_BASE + 0xD3UL)
/*! Illegal hash mode. */
#define CRYS_ECC_ILLEGAL_HASH_MODE_ERROR      	     		     (CRYS_ECPKI_MODULE_ERROR_BASE + 0xE0UL)

/************************************************************************************************************
 * CRYS ECPKI MODULE  COMMON ERRORS
*************************************************************************************************************/
/*! Illegal RND function pointer. */
#define CRYS_ECPKI_INVALID_RND_FUNC_PTR_ERROR                   (CRYS_ECPKI_MODULE_ERROR_BASE + 0x90UL)
/*! Illegal RND context pointer. */
#define CRYS_ECPKI_INVALID_RND_CTX_PTR_ERROR                    (CRYS_ECPKI_MODULE_ERROR_BASE + 0x91UL)
/*! Illegal domain ID. */
#define CRYS_ECPKI_INVALID_DOMAIN_ID_ERROR                      (CRYS_ECPKI_MODULE_ERROR_BASE + 0x92UL)
/*! Private key validation failed. */
#define CRYS_ECPKI_INVALID_PRIV_KEY_TAG_ERROR                   (CRYS_ECPKI_MODULE_ERROR_BASE + 0x93UL)
/*! Public key validation failed. */
#define CRYS_ECPKI_INVALID_PUBL_KEY_TAG_ERROR                   (CRYS_ECPKI_MODULE_ERROR_BASE + 0x94UL)
/*! Illegal data in. */
#define CRYS_ECPKI_INVALID_DATA_IN_PASSED_STRUCT_ERROR          (CRYS_ECPKI_MODULE_ERROR_BASE + 0x95UL)

/************************************************************************************************************
 * CRYS ECIES MODULE ERRORS
*************************************************************************************************************/
/*! Illegal public key pointer. */
#define CRYS_ECIES_INVALID_PUBL_KEY_PTR_ERROR                   (CRYS_ECPKI_MODULE_ERROR_BASE + 0xE0UL)
/*! Public key validation failed. */
#define CRYS_ECIES_INVALID_PUBL_KEY_TAG_ERROR			(CRYS_ECPKI_MODULE_ERROR_BASE + 0xE1UL)
/*! Illegal private key pointer. */
#define CRYS_ECIES_INVALID_PRIV_KEY_PTR_ERROR                   (CRYS_ECPKI_MODULE_ERROR_BASE + 0xE2UL)
/*! Private key validation failed. */
#define CRYS_ECIES_INVALID_PRIV_KEY_TAG_ERROR			(CRYS_ECPKI_MODULE_ERROR_BASE + 0xE3UL)
/*! Illegal private key value. */
#define CRYS_ECIES_INVALID_PRIV_KEY_VALUE_ERROR			(CRYS_ECPKI_MODULE_ERROR_BASE + 0xE4UL)
/*! Illegal KDF derivation mode. */
#define CRYS_ECIES_INVALID_KDF_DERIV_MODE_ERROR	    		(CRYS_ECPKI_MODULE_ERROR_BASE + 0xE5UL)
/*! Illegal KDF hash mode. */
#define CRYS_ECIES_INVALID_KDF_HASH_MODE_ERROR			(CRYS_ECPKI_MODULE_ERROR_BASE + 0xE6UL)
/*! Illegal secret key pointer. */
#define CRYS_ECIES_INVALID_SECRET_KEY_PTR_ERROR 		(CRYS_ECPKI_MODULE_ERROR_BASE + 0xE7UL)
/*! Illegal secret key size. */
#define CRYS_ECIES_INVALID_SECRET_KEY_SIZE_ERROR 		(CRYS_ECPKI_MODULE_ERROR_BASE + 0xE8UL)
/*! Illegal cipher data pointer. */
#define CRYS_ECIES_INVALID_CIPHER_DATA_PTR_ERROR 		(CRYS_ECPKI_MODULE_ERROR_BASE + 0xE9UL)
/*! Illegal cipher data size pointer. */
#define CRYS_ECIES_INVALID_CIPHER_DATA_SIZE_PTR_ERROR 		(CRYS_ECPKI_MODULE_ERROR_BASE + 0xEAUL)
/*! Illegal cipher data size. */
#define CRYS_ECIES_INVALID_CIPHER_DATA_SIZE_ERROR 		(CRYS_ECPKI_MODULE_ERROR_BASE + 0xEBUL)
/*! Illegal temporary buffer pointer. */
#define CRYS_ECIES_INVALID_TEMP_DATA_PTR_ERROR 			(CRYS_ECPKI_MODULE_ERROR_BASE + 0xECUL)
/*! Illegal ephemeral key pointer */
#define CRYS_ECIES_INVALID_EPHEM_KEY_PAIR_PTR_ERROR             (CRYS_ECPKI_MODULE_ERROR_BASE + 0xEDUL)

/************************ Enums ********************************/

/************************ Typedefs  ****************************/

/************************ Structs  ******************************/

/************************ Public Variables **********************/

/************************ Public Functions **********************/

#ifdef __cplusplus
}
#endif
/**
@}
 */
#endif


text:
FROM ubuntu:focal

ADD setuptools-pip.sh /setuptools-pip.sh
RUN (bash -x setuptools-pip.sh ; rm setuptools-pip.sh )


text:
"use strict";
/**
 * User model events
 */
Object.defineProperty(exports, "__esModule", { value: true });
var events_1 = require("events");
var user_model_1 = require("./user.model");
var UserEvents = new events_1.EventEmitter();
// Set max event listeners (0 == unlimited)
UserEvents.setMaxListeners(0);
// Model events
var events = {
    save: 'save',
    remove: 'remove'
};
// Register the event emitter to the model events
for (var e in events) {
    var event_1 = events[e];
    user_model_1.default.schema.post(e, emitEvent(event_1));
}
function emitEvent(event) {
    return function (doc) {
        UserEvents.emit(event + ":" + doc._id, doc);
        UserEvents.emit(event, doc);
    };
}
exports.default = UserEvents;
//# sourceMappingURL=user.events.js.map


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Martin Zhang</title>

    <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
    <link href='https://fonts.googleapis.com/css?family=Kaushan+Script' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700' rel='stylesheet' type='text/css'>
	<link rel="icon" href="https://martin5696.github.io/favicon.ico"/>

    <link href="css/agency.css" rel="stylesheet">

        Martin Zhang
        <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
          Menu

        </button>

              Employment

              Projects + Hobbies

              Team

              Contact

Hi, I'm Martin!

Engineer | Musician | Rackets Enthusiast

Employment

What I've been up to so far.

2009-2011

Our Humble Beginnings

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sunt ut voluptatum eius sapiente, totam reiciendis temporibus qui quibusdam, recusandae sit vero unde, sed, incidunt et ea quo dolore laudantium consectetur!

March 2011

An Agency is Born

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sunt ut voluptatum eius sapiente, totam reiciendis temporibus qui quibusdam, recusandae sit vero unde, sed, incidunt et ea quo dolore laudantium consectetur!

December 2012

Transition to Full Service

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sunt ut voluptatum eius sapiente, totam reiciendis temporibus qui quibusdam, recusandae sit vero unde, sed, incidunt et ea quo dolore laudantium consectetur!

July 2014

Phase Two Expansion

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sunt ut voluptatum eius sapiente, totam reiciendis temporibus qui quibusdam, recusandae sit vero unde, sed, incidunt et ea quo dolore laudantium consectetur!

The

Early

Days

Projects + Hobbies

Some cool stuff I've worked on.

DelEm

Hackathon

Explore

Graphic Design

Finish

Identity

Lines

Branding

Southwest

Website Design

Window

Photography

Our Amazing Team

Lorem ipsum dolor sit amet consectetur.

Kay Garland

Lead Designer

Larry Parker

Lead Marketer

Diana Pertersen

Lead Developer

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aut eaque, laboriosam veritatis, quos non quis ad perspiciatis, totam corporis ea, alias ut unde.

Contact Us

Lorem ipsum dolor sit amet consectetur.

            <form id="contactForm" name="sentMessage" novalidate>

                    <input class="form-control" id="name" type="text" placeholder="Your Name *" required data-validation-required-message="Please enter your name.">

                    <input class="form-control" id="email" type="email" placeholder="Your Email *" required data-validation-required-message="Please enter your email address.">

                    <input class="form-control" id="phone" type="tel" placeholder="Your Phone *" required data-validation-required-message="Please enter your phone number.">

                    <textarea class="form-control" id="message" placeholder="Your Message *" required data-validation-required-message="Please enter a message."></textarea>

                  <button id="sendMessageButton" class="btn btn-primary btn-xl text-uppercase" type="submit">Send Message</button>

            </form>

            Copyright © Your Website 2017

                Privacy Policy

                Terms of Use

DelEm

Delegation Empowerment, a productivity boosting SaaS startup.

Use this area to describe your project. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Est blanditiis dolorem culpa incidunt minus dignissimos deserunt repellat aperiam quasi sunt officia expedita beatae cupiditate, maiores repudiandae, nostrum, reiciendis facere nemo!

Date: January 2017

Client: Threads

Category: Illustration

                  <button class="btn btn-primary" data-dismiss="modal" type="button">

                    Close Project</button>

Project Name

Lorem ipsum dolor sit amet consectetur.

Use this area to describe your project. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Est blanditiis dolorem culpa incidunt minus dignissimos deserunt repellat aperiam quasi sunt officia expedita beatae cupiditate, maiores repudiandae, nostrum, reiciendis facere nemo!

Date: January 2017

Client: Explore

Category: Graphic Design

                  <button class="btn btn-primary" data-dismiss="modal" type="button">

                    Close Project</button>

Project Name

Lorem ipsum dolor sit amet consectetur.

Use this area to describe your project. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Est blanditiis dolorem culpa incidunt minus dignissimos deserunt repellat aperiam quasi sunt officia expedita beatae cupiditate, maiores repudiandae, nostrum, reiciendis facere nemo!

Date: January 2017

Client: Finish

Category: Identity

                  <button class="btn btn-primary" data-dismiss="modal" type="button">

                    Close Project</button>

Project Name

Lorem ipsum dolor sit amet consectetur.

Use this area to describe your project. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Est blanditiis dolorem culpa incidunt minus dignissimos deserunt repellat aperiam quasi sunt officia expedita beatae cupiditate, maiores repudiandae, nostrum, reiciendis facere nemo!

Date: January 2017

Client: Lines

Category: Branding

                  <button class="btn btn-primary" data-dismiss="modal" type="button">

                    Close Project</button>

Project Name

Lorem ipsum dolor sit amet consectetur.

Use this area to describe your project. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Est blanditiis dolorem culpa incidunt minus dignissimos deserunt repellat aperiam quasi sunt officia expedita beatae cupiditate, maiores repudiandae, nostrum, reiciendis facere nemo!

Date: January 2017

Client: Southwest

Category: Website Design

                  <button class="btn btn-primary" data-dismiss="modal" type="button">

                    Close Project</button>

Project Name

Lorem ipsum dolor sit amet consectetur.

Use this area to describe your project. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Est blanditiis dolorem culpa incidunt minus dignissimos deserunt repellat aperiam quasi sunt officia expedita beatae cupiditate, maiores repudiandae, nostrum, reiciendis facere nemo!

Date: January 2017

Client: Window

Category: Photography

                  <button class="btn btn-primary" data-dismiss="modal" type="button">

                    Close Project</button>

Badminton

I play badminton.

Use this area to describe your hobby. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Est blanditiis dolorem culpa incidunt minus dignissimos deserunt repellat aperiam quasi sunt officia expedita beatae cupiditate, maiores repudiandae, nostrum, reiciendis facere nemo!

Date: January 2017

Client: Threads

Category: Illustration

                  <button class="btn btn-primary" data-dismiss="modal" type="button">

                    Close Project</button>


text:
/** \file stlsoft/meta/is_void_type.hpp
 *
 * \brief [C++ only] Definition of the stlsoft::is_void_type meta class
 *  template
 *   (\ref group__library__meta "Template Meta-programming" Library).
 */

#ifndef STLSOFT_INCL_STLSOFT_META_HPP_IS_VOID_TYPE
#define STLSOFT_INCL_STLSOFT_META_HPP_IS_VOID_TYPE

#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
# define STLSOFT_VER_STLSOFT_META_HPP_IS_VOID_TYPE_MAJOR    1
# define STLSOFT_VER_STLSOFT_META_HPP_IS_VOID_TYPE_MINOR    0
# define STLSOFT_VER_STLSOFT_META_HPP_IS_VOID_TYPE_REVISION 2
# define STLSOFT_VER_STLSOFT_META_HPP_IS_VOID_TYPE_EDIT     7
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */

/* /////////////////////////////////////////////////////////////////////////
 * Includes
 */

#ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT
# include <stlsoft/stlsoft.h>
#endif /* !STLSOFT_INCL_STLSOFT_H_STLSOFT */
#ifndef STLSOFT_INCL_STLSOFT_META_HPP_YESNO
# include <stlsoft/meta/yesno.hpp>
#endif /* !STLSOFT_INCL_STLSOFT_META_HPP_YESNO */
#ifndef STLSOFT_INCL_STLSOFT_META_UTIL_HPP_META_
# include <stlsoft/meta/util/meta_.hpp>
#endif /* !STLSOFT_INCL_STLSOFT_META_UTIL_HPP_META_ */

/* /////////////////////////////////////////////////////////////////////////
 * Namespace
 */

#ifndef _STLSOFT_NO_NAMESPACE
namespace stlsoft
{
#endif /* _STLSOFT_NO_NAMESPACE */

/* /////////////////////////////////////////////////////////////////////////
 * Classes
 */

/** \brief Traits type used to determine whether the given type is
 *    void.
 *
 * \ingroup group__library__meta
 */
template <ss_typename_param_k T>
struct is_void_type
{
    enum { value = 0 };

    typedef no_type     type;
};

#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION

STLSOFT_GEN_TRAIT_SPECIALISATION_WITH_TYPE(is_void_type, void, 1, yes_type)

#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */

////////////////////////////////////////////////////////////////////////////
// Unit-testing

#ifdef STLSOFT_UNITTEST
# include "./unittest/is_void_type_unittest_.h"
#endif /* STLSOFT_UNITTEST */

/* ////////////////////////////////////////////////////////////////////// */

#ifndef _STLSOFT_NO_NAMESPACE
} // namespace stlsoft
#endif /* _STLSOFT_NO_NAMESPACE */

/* ////////////////////////////////////////////////////////////////////// */

#endif /* !STLSOFT_INCL_STLSOFT_META_HPP_IS_VOID_TYPE */

/* ///////////////////////////// end of file //////////////////////////// */


text:
using namespace dicom::data;
using namespace dicom::data::attribute;
using namespace dicom::data::dictionary;
using namespace dicom::network;

namespace dicom
{

namespace serviceclass
{

using handlermap = std::map<dicom::data::dataset::DIMSE_SERVICE_GROUP,
std::function<void(dicom::network::dimse::dimse_pm* pm, dicom::data::dataset::commandset_data cdata, std::unique_ptr<dicom::data::dataset::iod> data)>>;

class storage_scu_thread
{
   public:
      storage_scu_thread(queryretrieve_scp& qr_scp,
                         connection move_destination,
                         dicom::data::dataset::commandset_data cmove_cmd,
                         dicom::network::dimse::dimse_pm* cfind_pm,
                         std::function<boost::optional<dicom::data::dataset::iod>()> cmove_handler,
                         dicom::data::dictionary::dictionaries& dict):
         qr_scp {qr_scp},
         move_destination {move_destination},
         cmove_cmd {cmove_cmd},
         cfind_pm {cfind_pm},
         cmove_handler {cmove_handler},
         dict {dict}
      {
      }

      void operator()()
      {
         storage_scu st
         {
            move_destination, dict,
                  [this](storage_scu* st, dicom::data::dataset::commandset_data cmd, std::unique_ptr<dicom::data::dataset::iod> data)
                  {
                     auto response = cmove_handler();
                     if (response.is_initialized()) {
                        st->set_store_data(*response);
                        cfind_pm->send_response({dicom::data::dataset::DIMSE_SERVICE_GROUP::C_MOVE_RSP, cmove_cmd, boost::none, 0xff00});
                     } else {
                        st->release();
                        cfind_pm->send_response({dicom::data::dataset::DIMSE_SERVICE_GROUP::C_MOVE_RSP, cmove_cmd, boost::none, 0x0000});
                     }
                  }
         };
         st.run();
      }

   private:
      queryretrieve_scp& qr_scp;
      connection move_destination;
      dicom::data::dataset::commandset_data cmove_cmd;
      dicom::network::dimse::dimse_pm* cfind_pm;
      std::function<boost::optional<dicom::data::dataset::iod>()> cmove_handler;
      dicom::data::dictionary::dictionaries& dict;
};

queryretrieve_scp::queryretrieve_scp(connection endpoint, dicom::data::dictionary::dictionaries& dict,
                                     std::function<void(queryretrieve_scp*, dataset::commandset_data, std::shared_ptr<dataset::iod>)> handler):
   cmove_sop {{ dataset::DIMSE_SERVICE_GROUP::C_MOVE_RQ, [this](dimse::dimse_pm* pm, dataset::commandset_data command, std::unique_ptr<dataset::iod> data) { this->handle_cfind(pm, command, std::move(data)); }} },
   dict {dict},
   sop_classes {
      {"1.2.840.10008.5.1.4.1.2.1.2", cmove_sop},
      {"1.2.840.10008.5.1.4.1.2.2.2", cmove_sop},
      {"1.2.840.10008.5.1.4.1.2.3.2", cmove_sop},
      {"1.2.840.10008.5.1.4.38.3", cmove_sop}
   },
   assoc_def {
      endpoint.calling_ae, endpoint.called_ae, {
         dimse::make_presentation_contexts(
                  sop_classes,
                  {"1.2.840.10008.1.2", "1.2.840.10008.1.2.1", "1.2.840.10008.1.2.2"},
                  dimse::association_definition::DIMSE_MSG_TYPE::RESPONSE),
      }
   },
   infrstr_scp {endpoint.port, nullptr, nullptr},
   scp {infrstr_scp, dict},
   dimse_pm {scp, assoc_def, dict},
   storage_thread {nullptr},
   handler {handler}
{

}

queryretrieve_scp::~queryretrieve_scp()
{
   storage_thread->join();
}

void queryretrieve_scp::handle_cfind(dimse::dimse_pm* pm, dataset::commandset_data command, std::unique_ptr<dataset::iod> data)
{
   filter_data = std::move(data);

   // wrapper around handler which returns data
   auto cmove_handler = std::bind(&queryretrieve_scp::handle_cmove, this, this, command, filter_data);

   if (storage_thread.get()) {
      storage_thread->join();
   }

   std::string move_dest;
   get_value_field<VR::AE>(command.at({0x0000,0x0600}), move_dest);
   move_dest.erase(std::find_if(move_dest.rbegin(), move_dest.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), move_dest.end());
   auto move_destination = move_destinations[move_dest];

   storage_operation.reset(new storage_scu_thread {*this, move_destination, command, pm, cmove_handler, dict});
   storage_thread.reset(new std::thread {*storage_operation});
}

boost::optional<dicom::data::dataset::iod> queryretrieve_scp::handle_cmove(queryretrieve_scp *scp, dataset::commandset_data command, std::shared_ptr<dataset::iod> data)
{
   handler(scp, command, data);
   return response_data;
}

void queryretrieve_scp::set_move_destination(std::string ae, connection conn)
{
   move_destinations[ae] = conn;
}

void queryretrieve_scp::run()
{
   dimse_pm.run();
}

void queryretrieve_scp::send_image(boost::optional<dataset::iod> data)
{
   response_data = data;
}

}

}


text:
using System;
using Microsoft.Owin.Extensions;
using Microsoft.Owin.Security.Cookies;

namespace Owin
{
    /// <summary>
    /// Extension methods provided by the cookies authentication middleware
    /// </summary>
    public static class CookieAuthenticationExtensions
    {
        /// <summary>
        /// Adds a cookie-based authentication middleware to your web application pipeline.
        /// </summary>
        /// <param name="app">The IAppBuilder passed to your configuration method</param>
        /// <param name="options">An options class that controls the middleware behavior</param>
        /// <returns>The original app parameter</returns>
        public static IAppBuilder UseCookieAuthentication(this IAppBuilder app, CookieAuthenticationOptions options)
        {
            if (app == null)
            {
                throw new ArgumentNullException("app");
            }

            app.Use(typeof(CookieAuthenticationMiddleware), app, options);
            app.UseStageMarker(PipelineStage.Authenticate);
            return app;
        }
    }
}


text:
/*
 * Changes for SnappyData data platform.
 *
 * Portions Copyright (c) 2016 SnappyData, Inc. All rights reserved.
 *
 * 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. See accompanying
 * LICENSE file.
 */
package io.snappydata.test.dunit;

import java.util.concurrent.TimeoutException;

import junit.framework.AssertionFailedError;

import com.gemstone.gemfire.InternalGemFireError;
import com.gemstone.gemfire.SystemFailure;

// @todo davidw Add the ability to get a return value back from the
// async method call.  (Use a static ThreadLocal field that is
// accessible from the Runnable used in VM#invoke)
/**
 *
An AsyncInvocation represents the invocation of a
 * remote invocation that executes asynchronously from its caller.  An
 * instanceof AsyncInvocation provides information about
 * the invocation such as any exception that it may have thrown.

 *
 *
Because it is a Thread, an
 * AsyncInvocation can be used as follows:

 *
 *

 *   AsyncInvocation ai1 = vm.invokeAsync(Test.class, "method1");
 *   AsyncInvocation ai2 = vm.invokeAsync(Test.class, "method2");
 *
 *   ai1.join();
 *   ai2.join();
 *
 *   assertTrue("Exception occurred while invoking " + ai1,
 *              !ai1.exceptionOccurred());
 *   if (ai2.exceptionOccurred()) {
 *     throw ai2.getException();
 *   }
 *

 *
 * @see VM#invokeAsync(Class, String)
 */
public class AsyncInvocation extends Thread {

  private static final ThreadLocal returnValue = new ThreadLocal();

  /** The singleton the thread group */
  private static final ThreadGroup GROUP = new AsyncInvocationGroup();

  ///////////////////// Instance Fields  /////////////////////

  /** An exception thrown while this async invocation ran */
  protected volatile Throwable exception;

  /** The object (or class) that is the receiver of this asyn method
   * invocation */
  private Object receiver;

  /** The name of the method being invoked */
  private String methodName;

  /** The returned object if any */
  public volatile Object returnedObj = null;

  //////////////////////  Constructors  //////////////////////

  /**
   * Creates a new AsyncInvocation
   *
   * @param receiver
   *        The object or {@link Class} on which the remote method was
   *        invoked
   * @param methodName
   *        The name of the method being invoked
   * @param work
   *        The actual invocation of the method
   */
  public AsyncInvocation(Object receiver, String methodName, Runnable work) {
    super(GROUP, work, getName(receiver, methodName));
    this.receiver = receiver;
    this.methodName = methodName;
    this.exception = null;
  }

  //////////////////////  Static Methods  /////////////////////

  /**
   * Returns the name of a AsyncInvocation based on its
   * receiver and method name.
   */
  private static String getName(Object receiver, String methodName) {
    StringBuffer sb = new StringBuffer(methodName);
    sb.append(" invoked on ");
    if (receiver instanceof Class) {
      sb.append("class ");
      sb.append(((Class) receiver).getName());

    } else {
      sb.append("an instance of ");
      sb.append(receiver.getClass().getName());
    }

    return sb.toString();
  }

  /////////////////////  Instance Methods  ////////////////////

  /**
   * Returns the receiver of this async method invocation
   */
  public Object getReceiver() {
    return this.receiver;
  }

  /**
   * Returns the name of the method being invoked remotely
   */
  public String getMethodName() {
    return this.methodName;
  }

  /**
   * Returns whether or not an exception occurred during this async
   * method invocation.
   */
  public boolean exceptionOccurred() {
    if (this.isAlive()) {
      throw new InternalGemFireError("Exception status not available while thread is alive.");
    }
    return this.exception != null;
  }

  /**
   * Returns the exception that was thrown during this async method
   * invocation.
   */
  public Throwable getException() {
    if (this.isAlive()) {
      throw new InternalGemFireError("Exception status not available while thread is alive.");
    }
    if (this.exception instanceof RMIException) {
      return ((RMIException) this.exception).getCause();

    } else {
      return this.exception;
    }
  }

  //////////////////////  Inner Classes  //////////////////////

  /**
   * A ThreadGroup that notices when an exception occurrs
   * during an AsyncInvocation.
   */
  private static class AsyncInvocationGroup extends ThreadGroup {
    AsyncInvocationGroup() {
      super("Async Invocations");
    }

    public void uncaughtException(Thread t, Throwable e) {
      if (e instanceof VirtualMachineError) {
        SystemFailure.setFailure((VirtualMachineError)e); // don't throw
      }
      if (t instanceof AsyncInvocation) {
        ((AsyncInvocation) t).exception = e;
      }
    }
  }

  public Object getResult() throws Throwable {
    join();
    if(this.exceptionOccurred()) {
      throw new Exception("An exception occured during async invocation", this.exception);
    }
    return this.returnedObj;
  }

  public Object getResult(long waitTime) throws Throwable {
    join(waitTime);
    if(this.isAlive()) {
      throw new TimeoutException();
    }
    if(this.exceptionOccurred()) {
      throw new Exception("An exception occured during async invocation", this.exception);
    }
    return this.returnedObj;
  }

  public Object getReturnValue() {
    if (this.isAlive()) {
      throw new InternalGemFireError("Return value not available while thread is alive.");
    }
    return this.returnedObj;
  }

  public void run()
  {
    super.run();
    this.returnedObj = returnValue.get();
    returnValue.set(null);
  }

  static void setReturnValue(Object v) {
    returnValue.set(v);
  }
}


text:
include(CheckCSourceCompiles)

set(C99_C_TEST_SOURCE
"#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
#include <wchar.h>
#include <stdio.h>

// Check varargs macros.  These examples are taken from C99 6.10.3.5.
#define debug(...) fprintf (stderr, __VA_ARGS__)
#define showlist(...) puts (#__VA_ARGS__)
#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
static void
test_varargs_macros (void)
{
  int x = 1234;
  int y = 5678;
  debug (\"Flag\");
  debug (\"X = %d\\\\n\", x);
  showlist (The first, second, and third items.);
  report (x>y, \"x is %d but y is %d\", x, y);
}

// Check long long types.
#define BIG64 18446744073709551615ull
#define BIG32 4294967295ul
#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
#if !BIG_OK
  your preprocessor is broken;
#endif
#if BIG_OK
#else
  your preprocessor is broken;
#endif
static long long int bignum = -9223372036854775807LL;
static unsigned long long int ubignum = BIG64;

struct incomplete_array
{
  int datasize;
  double data[];
};

struct named_init {
  int number;
  const wchar_t *name;
  double average;
};

typedef const char *ccp;

static inline int
test_restrict (ccp restrict text)
{
  // See if C++-style comments work.
  // Iterate through items via the restricted pointer.
  // Also check for declarations in for loops.
  for (unsigned int i = 0; *(text+i) != '\\\\0'; ++i)
    continue;
  return 0;
}

// Check varargs and va_copy.
static void
test_varargs (const char *format, ...)
{
  va_list args;
  va_start (args, format);
  va_list args_copy;
  va_copy (args_copy, args);

  const char *str = NULL;
  int number = 0;
  float fnumber = 0.0;

  while (*format)
    {
      switch (*format++)
	{
	case 's': // string
	  str = va_arg (args_copy, const char *);
	  break;
	case 'd': // int
	  number = va_arg (args_copy, int);
	  break;
	case 'f': // float
	  fnumber = va_arg (args_copy, double);
	  break;
	default:
	  break;
	}
    }
  va_end (args_copy);
  va_end (args);

  number = (number != 0) && (str != NULL) && (fnumber != 0.0);
}

int
main ()
{

  // Check bool.
  _Bool success = false;

  // Check restrict.
  if (test_restrict (\"String literal\") == 0)
    success = true;
  char *restrict newvar = \"Another string\";

  // Check varargs.
  test_varargs (\"s, d' f .\", \"string\", 65, 34.234);
  test_varargs_macros ();

  // Check flexible array members.
  struct incomplete_array *ia =
    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
  ia->datasize = 10;
  for (int i = 0; i < ia->datasize; ++i)
    ia->data[i] = i * 1.234;

  // Check named initializers.
  struct named_init ni = {
    .number = 34,
    .name = L\"Test wide string\",
    .average = 543.34343,
  };

  ni.number = 58;

  int dynamic_array[ni.number];
  dynamic_array[ni.number - 1] = 543;

  // work around unused variable warnings
  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
	  || dynamic_array[ni.number - 1] != 543);

  ;
  return 0;
}")

set(C99_C_FLAG_CANDIDATES
   " "
   "-std=c99"
   "-std=gnu99"
   "-c99"
   "-AC99"
   "-xc99=all"
   "-qlanglvl=extc99"
)

if(DEFINED C99_C_FLAGS)
   set(C99_C_FLAG_CANDIDATES)
endif(DEFINED C99_C_FLAGS)

set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
foreach(FLAG ${C99_C_FLAG_CANDIDATES})
   set(CMAKE_REQUIRED_FLAGS "${FLAG}")
   unset(C99_FLAG_DETECTED CACHE)
   message(STATUS "Try C99 C flag = [${FLAG}]")
   check_c_source_compiles("${C99_C_TEST_SOURCE}" C99_FLAG_DETECTED)
   if(C99_FLAG_DETECTED)
      set(C99_C_FLAGS_INTERNAL "${FLAG}")
      break()
   endif(C99_FLAG_DETECTED)
endforeach(FLAG ${C99_C_FLAG_CANDIDATES})
set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")

set(C99_C_FLAGS "${C99_C_FLAGS_INTERNAL}"
   CACHE STRING "C compiler flags for C99 standard")

mark_as_advanced(C99_C_FLAGS)


text:
package basic

import (
	"errors"
	"reflect"

	"github.com/mishudark/eventhus"
)

// ErrInvalidID missing initial event
var ErrInvalidID = errors.New("Invalid ID, initial event missign")

// Handler contains the info to manage commands
type Handler struct {
	repository     *eventhus.Repository
	aggregate      reflect.Type
	bucket, subset string
}

// NewCommandHandler return a handler
func NewCommandHandler(repository *eventhus.Repository, aggregate eventhus.AggregateHandler, bucket, subset string) eventhus.CommandHandle {
	return &Handler{
		repository: repository,
		aggregate:  reflect.TypeOf(aggregate).Elem(),
		bucket:     bucket,
		subset:     subset,
	}
}

// Handle a command
func (h *Handler) Handle(command eventhus.Command) error {
	var err error

	version := command.GetVersion()
	aggregate := reflect.New(h.aggregate).Interface().(eventhus.AggregateHandler)

	if version != 0 {
		if err = h.repository.Load(aggregate, command.GetAggregateID()); err != nil {
			return err
		}
	}

	if err = aggregate.HandleCommand(command); err != nil {
		return err
	}

	// if not contain a valid ID,  the initial event (some like createAggreagate event) is missing
	if aggregate.GetID() == "" {
		return ErrInvalidID
	}

	if err = h.repository.Save(aggregate, version); err != nil {
		return err
	}

	if err = h.repository.PublishEvents(aggregate, h.bucket, h.subset); err != nil {
		return err
	}

	return nil
}


text:
package com.amazonaws.services.kendra.model.transform;

import java.util.List;
import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.kendra.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * DocumentMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class DocumentMarshaller {

    private static final MarshallingInfo<String> ID_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("Id").build();
    private static final MarshallingInfo<String> TITLE_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("Title").build();
    private static final MarshallingInfo<java.nio.ByteBuffer> BLOB_BINDING = MarshallingInfo.builder(MarshallingType.BYTE_BUFFER)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("Blob").build();
    private static final MarshallingInfo<StructuredPojo> S3PATH_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("S3Path").build();
    private static final MarshallingInfo<List> ATTRIBUTES_BINDING = MarshallingInfo.builder(MarshallingType.LIST).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("Attributes").build();
    private static final MarshallingInfo<List> ACCESSCONTROLLIST_BINDING = MarshallingInfo.builder(MarshallingType.LIST)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("AccessControlList").build();
    private static final MarshallingInfo<List> HIERARCHICALACCESSCONTROLLIST_BINDING = MarshallingInfo.builder(MarshallingType.LIST)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("HierarchicalAccessControlList").build();
    private static final MarshallingInfo<String> CONTENTTYPE_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ContentType").build();
    private static final MarshallingInfo<String> ACCESSCONTROLCONFIGURATIONID_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("AccessControlConfigurationId").build();

    private static final DocumentMarshaller instance = new DocumentMarshaller();

    public static DocumentMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(Document document, ProtocolMarshaller protocolMarshaller) {

        if (document == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(document.getId(), ID_BINDING);
            protocolMarshaller.marshall(document.getTitle(), TITLE_BINDING);
            protocolMarshaller.marshall(document.getBlob(), BLOB_BINDING);
            protocolMarshaller.marshall(document.getS3Path(), S3PATH_BINDING);
            protocolMarshaller.marshall(document.getAttributes(), ATTRIBUTES_BINDING);
            protocolMarshaller.marshall(document.getAccessControlList(), ACCESSCONTROLLIST_BINDING);
            protocolMarshaller.marshall(document.getHierarchicalAccessControlList(), HIERARCHICALACCESSCONTROLLIST_BINDING);
            protocolMarshaller.marshall(document.getContentType(), CONTENTTYPE_BINDING);
            protocolMarshaller.marshall(document.getAccessControlConfigurationId(), ACCESSCONTROLCONFIGURATIONID_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
using namespace MonsterSpace;
using namespace MonsterSound;

//////////////////////////////////////////////////////////////////////////
bool CBaseMonster::bfAssignMovement (CScriptEntityAction *tpEntityAction)
{
	CScriptMovementAction	&l_tMovementAction	= tpEntityAction->m_tMovementAction;

	// check if completed
	if (l_tMovementAction.m_bCompleted)	return(false);

	// check if alive
	CEntityAlive *entity_alive = smart_cast<CEntityAlive*>(this);
	if (entity_alive && !entity_alive->g_Alive()) {
		l_tMovementAction.m_bCompleted = true;
		return				(false);
	}

	if (control().path_builder().detail().time_path_built() >= tpEntityAction->m_tActionCondition.m_tStartTime) {
		if ((l_tMovementAction.m_fDistToEnd > 0) && control().path_builder().is_path_end(l_tMovementAction.m_fDistToEnd))  {
			l_tMovementAction.m_bCompleted = true;

		}
		if (control().path_builder().actual_all() && control().path_builder().path_completed()) {
			l_tMovementAction.m_bCompleted = true;
			return false;
		}
	}

	// translate script.action into anim().action
	switch (l_tMovementAction.m_tMoveAction) {
	case eMA_WalkFwd:	anim().m_tAction = ACT_WALK_FWD;		break;
	case eMA_WalkBkwd:	anim().m_tAction = ACT_WALK_BKWD;	break;
	case eMA_Run:		anim().m_tAction = ACT_RUN;			break;
	case eMA_Drag:		anim().m_tAction = ACT_DRAG;			break;
	case eMA_Steal:		anim().m_tAction = ACT_STEAL;		break;
	}

	m_force_real_speed = (l_tMovementAction.m_tSpeedParam == eSP_ForceSpeed);

	switch (l_tMovementAction.m_tGoalType) {

		case CScriptMovementAction::eGoalTypeObject : {
			CGameObject		*l_tpGameObject = smart_cast<CGameObject*>(l_tMovementAction.m_tpObjectToGo);
			path().set_target_point	(l_tpGameObject->Position(), l_tpGameObject->ai_location().level_vertex_id());
			break;
													  }
		case CScriptMovementAction::eGoalTypePatrolPath :
			path().set_patrol_path_type							();
			control().path_builder().set_path_type				(MovementManager::ePathTypePatrolPath);
			control().path_builder().patrol().set_path			(l_tMovementAction.m_path,l_tMovementAction.m_path_name);
			control().path_builder().patrol().set_start_type	(l_tMovementAction.m_tPatrolPathStart);
			control().path_builder().patrol().set_route_type	(l_tMovementAction.m_tPatrolPathStop);
			control().path_builder().patrol().set_random		(l_tMovementAction.m_bRandom);
			if (l_tMovementAction.m_previous_patrol_point != u32(-1)) {
				control().path_builder().patrol().set_previous_point(l_tMovementAction.m_previous_patrol_point);
			}
			break;

		case CScriptMovementAction::eGoalTypePathPosition :
		case CScriptMovementAction::eGoalTypeNoPathPosition :
			path().set_target_point	(l_tMovementAction.m_tDestinationPosition);
			break;
		case CScriptMovementAction::eGoalTypePathNodePosition :
			path().set_target_point	(l_tMovementAction.m_tDestinationPosition, l_tMovementAction.m_tNodeID);
			break;
	}

	return	(true);
}

///////////////////////////////////////////////////////////////////////////
bool CBaseMonster::bfAssignObject(CScriptEntityAction *tpEntityAction)
{
	if (!inherited::bfAssignObject(tpEntityAction))
		return	(false);

//	CScriptObjectAction	&l_tObjectAction = tpEntityAction->m_tObjectAction;
//	if (!l_tObjectAction.m_tpObject)
//		return	(false == (l_tObjectAction.m_bCompleted = true));
//
//	CEntityAlive	*l_tpEntity		= smart_cast<CEntityAlive*>(l_tObjectAction.m_tpObject);
//	if (!l_tpEntity) return	(false == (l_tObjectAction.m_bCompleted = true));
//
//	switch (l_tObjectAction.m_tGoalType) {
//		case eObjectActionTake:
//			m_PhysicMovementControl->PHCaptureObject(l_tpEntity);
//			break;
//		case eObjectActionDrop:
//			m_PhysicMovementControl->PHReleaseObject();
//			break;
//	}
//
//	l_tObjectAction.m_bCompleted = true;
	return	(true);
}

bool CBaseMonster::bfAssignWatch(CScriptEntityAction *tpEntityAction)
{
	if (!inherited::bfAssignWatch(tpEntityAction))
		return		(false);

	// Èíèöèàëèçèðîâàòü action
	anim().m_tAction = ACT_STAND_IDLE;

	CScriptWatchAction	&l_tWatchAction = tpEntityAction->m_tWatchAction;
	if (l_tWatchAction.completed()) return false;

	Fvector new_pos;
	switch (l_tWatchAction.m_tWatchType) {
		case SightManager::eSightTypePosition:
			LookPosition(l_tWatchAction.m_tWatchVector);
			break;
		case SightManager::eSightTypeDirection:
			new_pos.mad(Position(), l_tWatchAction.m_tWatchVector, 2.f);
			LookPosition(new_pos);
			break;
	}

	if (!control().direction().is_turning())
		l_tWatchAction.m_bCompleted = true;
	else
		l_tWatchAction.m_bCompleted = false;

	return		(!l_tWatchAction.m_bCompleted);
}

bool CBaseMonster::bfAssignAnimation(CScriptEntityAction *tpEntityAction)
{
	if (!inherited::bfAssignAnimation(tpEntityAction))
		return			(false);

	CScriptAnimationAction	&l_tAnimAction	= tpEntityAction->m_tAnimationAction;
	if (l_tAnimAction.completed()) return false;

	// translate animation.action into anim().action
	switch (l_tAnimAction.m_tAnimAction) {
	case eAA_StandIdle:		anim().m_tAction = ACT_STAND_IDLE;	break;
	case eAA_SitIdle:		anim().m_tAction = ACT_SIT_IDLE;		break;
	case eAA_LieIdle:		anim().m_tAction = ACT_LIE_IDLE;		break;
	case eAA_Eat:			anim().m_tAction = ACT_EAT;			break;
	case eAA_Sleep:			anim().m_tAction = ACT_SLEEP;		break;
	case eAA_Rest:			anim().m_tAction = ACT_REST;			break;
	case eAA_Attack:		anim().m_tAction = ACT_ATTACK;		break;
	case eAA_LookAround:	anim().m_tAction = ACT_LOOK_AROUND;	break;
	}

	return				(true);
}

bool CBaseMonster::bfAssignSound(CScriptEntityAction *tpEntityAction)
{
	CScriptSoundAction	&l_tAction = tpEntityAction->m_tSoundAction;
	if (l_tAction.completed()) return false;

	if (l_tAction.m_monster_sound == MonsterSound::eMonsterSoundDummy) {
		if (!inherited::bfAssignSound(tpEntityAction))
			return			(false);
	}

	switch (l_tAction.m_monster_sound) {
	case	eMonsterSoundIdle:			sound().play(eMonsterSoundIdle,			0, 0, (l_tAction.m_monster_sound_delay == int(-1)) ? db().m_dwIdleSndDelay		: l_tAction.m_monster_sound_delay);		break;
	case 	eMonsterSoundEat:			sound().play(eMonsterSoundEat,			0, 0, (l_tAction.m_monster_sound_delay == int(-1)) ? db().m_dwEatSndDelay		: l_tAction.m_monster_sound_delay);		break;
	case 	eMonsterSoundAggressive:	sound().play(eMonsterSoundAggressive,	0, 0, (l_tAction.m_monster_sound_delay == int(-1)) ? db().m_dwAttackSndDelay	: l_tAction.m_monster_sound_delay);		break;
	case	eMonsterSoundAttackHit:		sound().play(eMonsterSoundAttackHit);	break;
	case	eMonsterSoundTakeDamage:	sound().play(eMonsterSoundTakeDamage);	break;
	case	eMonsterSoundDie:			sound().play(eMonsterSoundDie);			break;
	case	eMonsterSoundThreaten:		sound().play(eMonsterSoundThreaten,		0, 0, (l_tAction.m_monster_sound_delay == int(-1)) ? db().m_dwAttackSndDelay : l_tAction.m_monster_sound_delay);		break;
	case	eMonsterSoundSteal:			sound().play(eMonsterSoundSteal,		0, 0, (l_tAction.m_monster_sound_delay == int(-1)) ? db().m_dwAttackSndDelay : l_tAction.m_monster_sound_delay);		break;
	case	eMonsterSoundPanic:			sound().play(eMonsterSoundPanic,		0, 0, (l_tAction.m_monster_sound_delay == int(-1)) ? db().m_dwAttackSndDelay : l_tAction.m_monster_sound_delay);		break;
	}

	return				(true);
}

bool CBaseMonster::bfAssignMonsterAction(CScriptEntityAction *tpEntityAction)
{
	if (!inherited::bfAssignMonsterAction(tpEntityAction)) return false;

	CScriptMonsterAction	&l_tAction = tpEntityAction->m_tMonsterAction;
	if (l_tAction.completed()) return false;

	CEntityAlive *pE = smart_cast<CEntityAlive *>(l_tAction.m_tObject);

	switch(l_tAction.m_tAction) {
		case eGA_Rest:
			StateMan->force_script_state(eStateRest);
			break;
		case eGA_Eat:
			if (pE && !pE->getDestroy() && !pE->g_Alive()){
				CorpseMan.force_corpse(pE);
				StateMan->force_script_state(eStateEat);
			} else StateMan->force_script_state(eStateRest);

			break;
		case eGA_Attack:
			if (pE && !pE->getDestroy() && pE->g_Alive()){
				EnemyMan.force_enemy(pE);
				StateMan->force_script_state(eStateAttack);
			} else StateMan->force_script_state(eStateRest);

			break;
		case eGA_Panic:
			if (pE && !pE->getDestroy() && pE->g_Alive()){
				EnemyMan.force_enemy			(pE);
				StateMan->force_script_state	(eStatePanic);
			} else StateMan->force_script_state	(eStateRest);
			break;
	}

	m_script_state_must_execute = true;
	return (!l_tAction.m_bCompleted);
}

void CBaseMonster::ProcessScripts()
{
	if (!g_Alive()) return;
	if (m_script_processing_active) return;

	m_script_processing_active = true;

	//movement().Update_Initialize			();

	// Âûïîëíèòü ñêðèïòîâûå actions
	m_script_state_must_execute					= false;
	inherited::ProcessScripts					();

	Device.dwTimeGlobal							= Device.dwTimeGlobal;

	// îáíîâèòü ìèð (ïàìÿòü, âðàãè, îáúåêòû)
	UpdateMemory								();

	anim().accel_deactivate					();

	// åñëè èç ñêðèïòà âûáðàíî äåéñòâèå ïî óíèâåðñàëüíîé ñõåìå, âûïîëíèòü åãî
	if (m_script_state_must_execute)
		StateMan->execute_script_state			();

	TranslateActionToPathParams					();

	// îáíîâèòü ïóòü
	//movement().Update_Execute			();

	//anim().Update							();

	// óñòàíîâèòü òåêóùóþ ñêîðîñòü
	//movement().Update_Finalize			();

	// Óäàëèòü âñå âðàãè è îáúåêòû, êîòîðûå áûëè ïðèíóäèòåëüíî óñòàíîâëåíû
	// âî âðåìÿ âûïîëíåíèÿ ñêðèïòîâîãî äåéñòâèÿ
	if (m_script_state_must_execute) {
		EnemyMan.unforce_enemy();
		CorpseMan.unforce_corpse();
	}

	m_force_real_speed			= false;
	m_script_processing_active	= false;

#ifdef DEBUG
	if (psAI_Flags.test(aiMonsterDebug)) {
		DBG().object_info(this,this).remove_item (u32(0));
		DBG().object_info(this,this).remove_item (u32(1));
		DBG().object_info(this,this).add_item	 (*cName(), D3DCOLOR_XRGB(255,0,0), 0);
		DBG().object_info(this,this).add_item	 ("Under script", D3DCOLOR_XRGB(255,0,0), 1);
	} else {
		DBG().object_info(this,this).clear		 ();
	}
#endif

}

CEntity *CBaseMonster::GetCurrentEnemy()
{
	CEntity *enemy = 0;

	if (EnemyMan.get_enemy())
		enemy = const_cast<CEntity *>(smart_cast<const CEntity*>(EnemyMan.get_enemy()));

	if (!enemy || enemy->getDestroy() || !enemy->g_Alive()) enemy = 0;

	return (enemy);
}

CEntity *CBaseMonster::GetCurrentCorpse()
{
	CEntity *corpse = 0;

	if (CorpseMan.get_corpse())
		corpse = const_cast<CEntity *>(smart_cast<const CEntity*>(CorpseMan.get_corpse()));

	if (!corpse || corpse->getDestroy() || corpse->g_Alive()) corpse = 0;

	return (corpse);
}

void CBaseMonster::SetScriptControl(const bool bScriptControl, shared_str caScriptName)
{
	if (StateMan) StateMan->critical_finalize();

	CScriptEntity::SetScriptControl(bScriptControl, caScriptName);
}

int	CBaseMonster::get_enemy_strength()
{
	if (EnemyMan.get_enemy()) {
		switch (EnemyMan.get_danger_type()) {
			case eVeryStrong	: 	return (4);
			case eStrong		: 	return (3);
			case eNormal		: 	return (2);
			case eWeak			:	return (1);
		}
	}

	return (0);
}

void CBaseMonster::vfFinishAction(CScriptEntityAction *tpEntityAction)
{
	inherited::vfFinishAction(tpEntityAction);
}


text:
package org.eclipse.gemini.mgmt.framework;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;

import javax.management.openmbean.TabularData;

import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Version;

import org.osgi.jmx.framework.PackageStateMBean;
import org.osgi.service.packageadmin.ExportedPackage;
import org.osgi.service.packageadmin.PackageAdmin;

import org.eclipse.gemini.mgmt.framework.internal.OSGiPackage;

/**
 *
 */
@SuppressWarnings("deprecation")
public final class PackageState implements PackageStateMBean {

	//private BundleContext bundleContext;

	private PackageAdmin admin;

	/**
	 *
	 * @param bundleContext
	 */
	public PackageState(BundleContext bundleContext) {
		//this.bundleContext = bundleContext;
		this.admin = (PackageAdmin) bundleContext.getService(bundleContext.getServiceReference(PackageAdmin.class));
	}

	/**
	 * {@inheritDoc}
	 */
	public long[] getExportingBundles(String packageName, String version) throws IOException {
		if (packageName == null) {
			throw new IOException("Package name cannot be null");
		}
		Version v = Version.emptyVersion;
		if (version != null) {
			try {
				v = Version.parseVersion(version);
			} catch (Throwable e) {
				throw new IOException("Invalid package version: " + version);
			}
		}
		ExportedPackage[] exportedPackages = admin.getExportedPackages(packageName);
		if (exportedPackages == null) {
			return new long[0];
		}
		ArrayList<Long> bundleIdentifiers = new ArrayList<Long>();
		for (ExportedPackage pkg : exportedPackages) {
			if (pkg.getVersion().equals(v)) {
				bundleIdentifiers.add(pkg.getExportingBundle().getBundleId());
			}
		}
		long[] bundles = new long[bundleIdentifiers.size()];
		int i = 0;
		for (long id : bundleIdentifiers) {
			bundles[i++] = id;
		}
		return bundles;
	}

	/**
	 * {@inheritDoc}
	 */
	public long[] getImportingBundles(String packageName, String version, long exportingBundle) throws IOException {
		if (packageName == null) {
			throw new IOException("Package name cannot be null");
		}
		Version v = Version.emptyVersion;
		if (version != null) {
			try {
				v = Version.parseVersion(version);
			} catch (Throwable e) {
				throw new IOException("Invalid package version: " + version);
			}
		}
		ExportedPackage[] exportedPackages = admin.getExportedPackages(packageName);
		if (exportedPackages == null) {
			return new long[0];
		}
		for (ExportedPackage pkg : exportedPackages) {
			if (pkg.getVersion().equals(v) && pkg.getExportingBundle().getBundleId() == exportingBundle) {
				Bundle[] bundles = pkg.getImportingBundles();
				long[] ids = new long[bundles.length];
				for (int i = 0; i < bundles.length; i++) {
					ids[i] = bundles[i].getBundleId();
				}
				return ids;
			}
		}
		return new long[0];
	}

	/**
	 * {@inheritDoc}
	 */
	public TabularData listPackages() {
		Set<OSGiPackage> packages = new HashSet<OSGiPackage>();
//		for (Bundle bundle : bundleContext.getBundles()) {
//			ExportedPackage[] pkgs = admin.getExportedPackages(bundle);
//			if (pkgs != null) {
//				for (ExportedPackage pkg : pkgs) {
//					packages.add(new OSGiPackage(pkg.getName(), pkg.getVersion().toString(), pkg.isRemovalPending(), new Bundle[] { pkg.getExportingBundle() }, pkg.getImportingBundles()));
//				}
//			}
//		}
		for(ExportedPackage pkg : admin.getExportedPackages((Bundle) null)){
			packages.add(new OSGiPackage(pkg.getName(), pkg.getVersion().toString(), pkg.isRemovalPending(), new Bundle[] { pkg.getExportingBundle() }, pkg.getImportingBundles()));
		}
		return OSGiPackage.tableFrom(packages);
	}

	/**
	 * {@inheritDoc}
	 */
	public boolean isRemovalPending(String packageName, String version, long exportingBundle) throws IOException {
		if (packageName == null) {
			throw new IOException("Package name cannot be null");
		}
		Version v = Version.emptyVersion;
		if (version != null) {
			try {
				v = Version.parseVersion(version);
			} catch (Throwable e) {
				throw new IOException("Invalid package version: " + version);
			}
		}
		ExportedPackage[] exportedPackages = admin.getExportedPackages(packageName);
		if (exportedPackages == null) {
			return false;
		}
		for (ExportedPackage pkg : exportedPackages) {
			if (pkg.getVersion().equals(v) && pkg.getExportingBundle().getBundleId() == exportingBundle) {
				return pkg.isRemovalPending();
			}
		}
		return false;
	}

}


text:
import { GET_REC_POSTS } from '../actions';

const defaultState = {
    recPostsList: [],
    totalPages: 1,
    status: "start"
};

export default function recPosts(state = defaultState, {status,type,payload}) {

    switch (type) {

        case GET_REC_POSTS:

            let totalPages = state.totalPages;
            let recPostsList = state.recPostsList;

            if (status == "success") {
                totalPages = payload.headers["x-wp-totalpages"];
                recPostsList = payload.data;
            }

            return {
                ...state,
                status: status,
                recPostsList: recPostsList,
                totalPages: parseInt(totalPages)
            };

        default:
            return state;

    }

}


text:
using bazel::tools::cpp::runfiles::Runfiles;

class BM : public benchmark::Fixture {
 public:
  void SetUp(::benchmark::State&) override {
#ifdef _WIN32
    auto cwd = std::filesystem::current_path();
    std::string argv0 = cwd.parent_path().append("eval_benchmark.exe").string();
#else
    std::string argv0 = program_invocation_name;
#endif

    runfiles.reset(Runfiles::Create(argv0));

    lldb_eval::SetupLLDBServerEnv(*runfiles);

    auto binary_path =
        runfiles->Rlocation("lldb_eval/testdata/benchmark_binary");
    auto source_path =
        runfiles->Rlocation("lldb_eval/testdata/benchmark_binary.cc");

    debugger = lldb::SBDebugger::Create(false);
    process = lldb_eval::LaunchTestProgram(debugger, source_path, binary_path,
                                           "// BREAK HERE");
    frame = process.GetSelectedThread().GetSelectedFrame();
  }

  void TearDown(::benchmark::State&) override {
    process.Destroy();
    lldb::SBDebugger::Destroy(debugger);
  }

  lldb::SBDebugger debugger;
  lldb::SBProcess process;
  lldb::SBFrame frame;

  std::unique_ptr<Runfiles> runfiles;
};

BENCHMARK_F(BM, AddTwoNumbers)(benchmark::State& state) {
  for (auto _ : state) {
    lldb::SBError error;
    lldb_eval::EvaluateExpression(frame, "1 + 1", error);

    if (error.Fail()) {
      state.SkipWithError("Failed to evaluate the expression!");
    }
  }
}

BENCHMARK_F(BM, ArrayDereference)(benchmark::State& state) {
  for (auto _ : state) {
    lldb::SBError error;
    lldb_eval::EvaluateExpression(frame, "*arr", error);

    if (error.Fail()) {
      state.SkipWithError("Failed to evaluate the expression!");
    }
  }
}

BENCHMARK_F(BM, ArraySubscript)(benchmark::State& state) {
  for (auto _ : state) {
    lldb::SBError error;
    lldb_eval::EvaluateExpression(frame, "arr[0]", error);

    if (error.Fail()) {
      state.SkipWithError("Failed to evaluate the expression!");
    }
  }
}

BENCHMARK_F(BM, TypeCasting)(benchmark::State& state) {
  for (auto _ : state) {
    lldb::SBError error;
    lldb_eval::EvaluateExpression(
        frame, "(char)1 + (short)1.1f + (long long)1.1 + (double)(char)2",
        error);

    if (error.Fail()) {
      state.SkipWithError("Failed to evaluate the expression!");
    }
  }
}

BENCHMARK_F(BM, ParseInteger)(benchmark::State& state) {
  auto context = lldb_eval::Context::Create(
      lldb_eval::SourceManager::Create("1+1u+1l+1ul+1ll+1ull"), frame);

  for (auto _ : state) {
    lldb_eval::Error err;
    lldb_eval::Parser(context).Run(err);

    if (err) {
      state.SkipWithError("Failed to parse the expression!");
    }
  }
}

int main(int argc, char** argv) {
  lldb::SBDebugger::Initialize();

  // Same as BENCHMARK_MAIN()
  // clang-format off
  ::benchmark::Initialize(&argc, argv);
  if (::benchmark::ReportUnrecognizedArguments(argc, argv)) return 1;
  ::benchmark::RunSpecifiedBenchmarks();
  // clang-format on

  lldb::SBDebugger::Terminate();
}


text:
package upgrade

import (
	"fmt"
	"os"
	"time"

	"github.com/spf13/cobra"

	clientset "k8s.io/client-go/kubernetes"
	kubeadmapi "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm"
	cmdutil "k8s.io/kubernetes/cmd/kubeadm/app/cmd/util"
	"k8s.io/kubernetes/cmd/kubeadm/app/constants"
	"k8s.io/kubernetes/cmd/kubeadm/app/phases/controlplane"
	"k8s.io/kubernetes/cmd/kubeadm/app/phases/upgrade"
	kubeadmutil "k8s.io/kubernetes/cmd/kubeadm/app/util"
	"k8s.io/kubernetes/cmd/kubeadm/app/util/apiclient"
	configutil "k8s.io/kubernetes/cmd/kubeadm/app/util/config"
	dryrunutil "k8s.io/kubernetes/cmd/kubeadm/app/util/dryrun"
	"k8s.io/kubernetes/pkg/api"
	"k8s.io/kubernetes/pkg/util/version"
)

const (
	upgradeManifestTimeout = 1 * time.Minute
)

// applyFlags holds the information about the flags that can be passed to apply
type applyFlags struct {
	nonInteractiveMode bool
	force              bool
	dryRun             bool
	newK8sVersionStr   string
	newK8sVersion      *version.Version
	imagePullTimeout   time.Duration
	parent             *cmdUpgradeFlags
}

// SessionIsInteractive returns true if the session is of an interactive type (the default, can be opted out of with -y, -f or --dry-run)
func (f *applyFlags) SessionIsInteractive() bool {
	return !f.nonInteractiveMode
}

// NewCmdApply returns the cobra command for `kubeadm upgrade apply`
func NewCmdApply(parentFlags *cmdUpgradeFlags) *cobra.Command {
	flags := &applyFlags{
		parent:           parentFlags,
		imagePullTimeout: 15 * time.Minute,
	}

	cmd := &cobra.Command{
		Use:   "apply [version]",
		Short: "Upgrade your Kubernetes cluster to the specified version",
		Run: func(cmd *cobra.Command, args []string) {
			// Ensure the user is root
			err := runPreflightChecks(flags.parent.skipPreFlight)
			kubeadmutil.CheckErr(err)

			err = cmdutil.ValidateExactArgNumber(args, []string{"version"})
			kubeadmutil.CheckErr(err)

			// It's safe to use args[0] here as the slice has been validated above
			flags.newK8sVersionStr = args[0]

			// Default the flags dynamically, based on each others' value
			err = SetImplicitFlags(flags)
			kubeadmutil.CheckErr(err)

			err = RunApply(flags)
			kubeadmutil.CheckErr(err)
		},
	}

	// Specify the valid flags specific for apply
	cmd.Flags().BoolVarP(&flags.nonInteractiveMode, "yes", "y", flags.nonInteractiveMode, "Perform the upgrade and do not prompt for confirmation (non-interactive mode).")
	cmd.Flags().BoolVarP(&flags.force, "force", "f", flags.force, "Force upgrading although some requirements might not be met. This also implies non-interactive mode.")
	cmd.Flags().BoolVar(&flags.dryRun, "dry-run", flags.dryRun, "Do not change any state, just output what actions would be applied.")
	cmd.Flags().DurationVar(&flags.imagePullTimeout, "image-pull-timeout", flags.imagePullTimeout, "The maximum amount of time to wait for the control plane pods to be downloaded.")

	return cmd
}

// RunApply takes care of the actual upgrade functionality
// It does the following things:
// - Checks if the cluster is healthy
// - Gets the configuration from the kubeadm-config ConfigMap in the cluster
// - Enforces all version skew policies
// - Asks the user if they really want to upgrade
// - Makes sure the control plane images are available locally on the master(s)
// - Upgrades the control plane components
// - Applies the other resources that'd be created with kubeadm init as well, like
//   - Creating the RBAC rules for the Bootstrap Tokens and the cluster-info ConfigMap
//   - Applying new kube-dns and kube-proxy manifests
//   - Uploads the newly used configuration to the cluster ConfigMap
func RunApply(flags *applyFlags) error {

	// Start with the basics, verify that the cluster is healthy and get the configuration from the cluster (using the ConfigMap)
	upgradeVars, err := enforceRequirements(flags.parent.kubeConfigPath, flags.parent.cfgPath, flags.parent.printConfig, flags.dryRun)
	if err != nil {
		return err
	}

	// Set the upgraded version on the external config object now
	upgradeVars.cfg.KubernetesVersion = flags.newK8sVersionStr

	// Grab the external, versioned configuration and convert it to the internal type for usage here later
	internalcfg := &kubeadmapi.MasterConfiguration{}
	api.Scheme.Convert(upgradeVars.cfg, internalcfg, nil)

	// Validate requested and validate actual version
	if err := configutil.NormalizeKubernetesVersion(internalcfg); err != nil {
		return err
	}

	// Use normalized version string in all following code.
	flags.newK8sVersionStr = internalcfg.KubernetesVersion
	k8sVer, err := version.ParseSemantic(flags.newK8sVersionStr)
	if err != nil {
		return fmt.Errorf("unable to parse normalized version %q as a semantic version", flags.newK8sVersionStr)
	}
	flags.newK8sVersion = k8sVer

	// Enforce the version skew policies
	if err := EnforceVersionPolicies(flags, upgradeVars.versionGetter); err != nil {
		return fmt.Errorf("[upgrade/version] FATAL: %v", err)
	}

	// If the current session is interactive, ask the user whether they really want to upgrade
	if flags.SessionIsInteractive() {
		if err := InteractivelyConfirmUpgrade("Are you sure you want to proceed with the upgrade?"); err != nil {
			return err
		}
	}

	// Use a prepuller implementation based on creating DaemonSets
	// and block until all DaemonSets are ready; then we know for sure that all control plane images are cached locally
	prepuller := upgrade.NewDaemonSetPrepuller(upgradeVars.client, upgradeVars.waiter, internalcfg)
	upgrade.PrepullImagesInParallel(prepuller, flags.imagePullTimeout)

	// Now; perform the upgrade procedure
	if err := PerformControlPlaneUpgrade(flags, upgradeVars.client, upgradeVars.waiter, internalcfg); err != nil {
		return fmt.Errorf("[upgrade/apply] FATAL: %v", err)
	}

	// Upgrade RBAC rules and addons. Optionally, if needed, perform some extra task for a specific version
	if err := upgrade.PerformPostUpgradeTasks(upgradeVars.client, internalcfg, flags.newK8sVersion); err != nil {
		return fmt.Errorf("[upgrade/postupgrade] FATAL post-upgrade error: %v", err)
	}

	if flags.dryRun {
		fmt.Println("[dryrun] Finished dryrunning successfully!")
		return nil
	}

	fmt.Println("")
	fmt.Printf("[upgrade/successful] SUCCESS! Your cluster was upgraded to %q. Enjoy!\n", flags.newK8sVersionStr)
	fmt.Println("")
	fmt.Println("[upgrade/kubelet] Now that your control plane is upgraded, please proceed with upgrading your kubelets in turn.")

	return nil
}

// SetImplicitFlags handles dynamically defaulting flags based on each other's value
func SetImplicitFlags(flags *applyFlags) error {
	// If we are in dry-run or force mode; we should automatically execute this command non-interactively
	if flags.dryRun || flags.force {
		flags.nonInteractiveMode = true
	}

	if len(flags.newK8sVersionStr) == 0 {
		return fmt.Errorf("version string can't be empty")
	}

	return nil
}

// EnforceVersionPolicies makes sure that the version the user specified is valid to upgrade to
// There are both fatal and skippable (with --force) errors
func EnforceVersionPolicies(flags *applyFlags, versionGetter upgrade.VersionGetter) error {
	fmt.Printf("[upgrade/version] You have chosen to upgrade to version %q\n", flags.newK8sVersionStr)

	versionSkewErrs := upgrade.EnforceVersionPolicies(versionGetter, flags.newK8sVersionStr, flags.newK8sVersion, flags.parent.allowExperimentalUpgrades, flags.parent.allowRCUpgrades)
	if versionSkewErrs != nil {

		if len(versionSkewErrs.Mandatory) > 0 {
			return fmt.Errorf("The --version argument is invalid due to these fatal errors: %v", versionSkewErrs.Mandatory)
		}

		if len(versionSkewErrs.Skippable) > 0 {
			// Return the error if the user hasn't specified the --force flag
			if !flags.force {
				return fmt.Errorf("The --version argument is invalid due to these errors: %v. Can be bypassed if you pass the --force flag", versionSkewErrs.Skippable)
			}
			// Soft errors found, but --force was specified
			fmt.Printf("[upgrade/version] Found %d potential version compatibility errors but skipping since the --force flag is set: %v\n", len(versionSkewErrs.Skippable), versionSkewErrs.Skippable)
		}
	}
	return nil
}

// PerformControlPlaneUpgrade actually performs the upgrade procedure for the cluster of your type (self-hosted or static-pod-hosted)
func PerformControlPlaneUpgrade(flags *applyFlags, client clientset.Interface, waiter apiclient.Waiter, internalcfg *kubeadmapi.MasterConfiguration) error {

	// Check if the cluster is self-hosted and act accordingly
	if upgrade.IsControlPlaneSelfHosted(client) {
		fmt.Printf("[upgrade/apply] Upgrading your Self-Hosted control plane to version %q...\n", flags.newK8sVersionStr)

		// Upgrade the self-hosted cluster
		return upgrade.SelfHostedControlPlane(client, waiter, internalcfg, flags.newK8sVersion)
	}

	// OK, the cluster is hosted using static pods. Upgrade a static-pod hosted cluster
	fmt.Printf("[upgrade/apply] Upgrading your Static Pod-hosted control plane to version %q...\n", flags.newK8sVersionStr)

	if flags.dryRun {
		return DryRunStaticPodUpgrade(internalcfg)
	}
	return PerformStaticPodUpgrade(client, waiter, internalcfg)
}

// PerformStaticPodUpgrade performs the upgrade of the control plane components for a static pod hosted cluster
func PerformStaticPodUpgrade(client clientset.Interface, waiter apiclient.Waiter, internalcfg *kubeadmapi.MasterConfiguration) error {
	pathManager, err := upgrade.NewKubeStaticPodPathManagerUsingTempDirs(constants.GetStaticPodDirectory())
	if err != nil {
		return err
	}

	if err := upgrade.StaticPodControlPlane(waiter, pathManager, internalcfg); err != nil {
		return err
	}
	return nil
}

// DryRunStaticPodUpgrade fakes an upgrade of the control plane
func DryRunStaticPodUpgrade(internalcfg *kubeadmapi.MasterConfiguration) error {

	dryRunManifestDir, err := constants.CreateTempDirForKubeadm("kubeadm-upgrade-dryrun")
	if err != nil {
		return err
	}
	defer os.RemoveAll(dryRunManifestDir)

	if err := controlplane.CreateInitStaticPodManifestFiles(dryRunManifestDir, internalcfg); err != nil {
		return err
	}

	// Print the contents of the upgraded manifests and pretend like they were in /etc/kubernetes/manifests
	files := []dryrunutil.FileToPrint{}
	for _, component := range constants.MasterComponents {
		realPath := constants.GetStaticPodFilepath(component, dryRunManifestDir)
		outputPath := constants.GetStaticPodFilepath(component, constants.GetStaticPodDirectory())
		files = append(files, dryrunutil.NewFileToPrint(realPath, outputPath))
	}

	if err := dryrunutil.PrintDryRunFiles(files, os.Stdout); err != nil {
		return err
	}
	return nil
}


text:
package com.facebook.imagepipeline.producers;

import android.graphics.Bitmap;
import com.facebook.common.internal.Preconditions;
import com.facebook.common.references.CloseableReference;
import com.facebook.imagepipeline.image.CloseableImage;
import com.facebook.imagepipeline.image.CloseableStaticBitmap;

/**
 * This producer issues to a call to {@link android.graphics.Bitmap#prepareToDraw()} to allow the
 * RendererThread upload the bitmap to GPU asynchronously before it is used. This has no affect on
 * Android versions before N.
 *
 * Controlled via {@link com.facebook.imagepipeline.core.ImagePipelineExperiments#mUseBitmapPrepareToDraw}
 */
public class BitmapPrepareProducer implements Producer<CloseableReference<CloseableImage>> {

  public static final String PRODUCER_NAME = "BitmapPrepareProducer";

  private final Producer<CloseableReference<CloseableImage>> mInputProducer;
  private final int mMinBitmapSizeBytes;
  private final int mMaxBitmapSizeBytes;
  private final boolean mPreparePrefetch;

  /**
   * @param inputProducer The next producer in the pipeline
   * @param minBitmapSizeBytes Bitmaps with a {@link Bitmap#getByteCount()} smaller than this value
   *     are not uploaded
   * @param maxBitmapSizeBytes Bitmaps with a {@link Bitmap#getByteCount()} larger than this value
   *     are not uploaded
   */
  public BitmapPrepareProducer(
      final Producer<CloseableReference<CloseableImage>> inputProducer,
      int minBitmapSizeBytes,
      int maxBitmapSizeBytes,
      boolean preparePrefetch) {
    Preconditions.checkArgument(minBitmapSizeBytes <= maxBitmapSizeBytes);
    mInputProducer = Preconditions.checkNotNull(inputProducer);
    mMinBitmapSizeBytes = minBitmapSizeBytes;
    mMaxBitmapSizeBytes = maxBitmapSizeBytes;
    mPreparePrefetch = preparePrefetch;
  }

  @Override
  public void produceResults(
      final Consumer<CloseableReference<CloseableImage>> consumer,
      final ProducerContext producerContext) {
    // only prepare pre-fetched bitmaps if enabled
    if (producerContext.isPrefetch() && !mPreparePrefetch) {
      mInputProducer.produceResults(consumer, producerContext);
    } else {
      mInputProducer.produceResults(
          new BitmapPrepareConsumer(consumer, mMinBitmapSizeBytes, mMaxBitmapSizeBytes),
          producerContext);
    }
  }

  private static class BitmapPrepareConsumer extends
      DelegatingConsumer<CloseableReference<CloseableImage>, CloseableReference<CloseableImage>> {

    private final int mMinBitmapSizeBytes;
    private final int mMaxBitmapSizeBytes;

    BitmapPrepareConsumer(
        Consumer<CloseableReference<CloseableImage>> consumer,
        int minBitmapSizeBytes,
        int maxBitmapSizeBytes) {
      super(consumer);
      mMinBitmapSizeBytes = minBitmapSizeBytes;
      mMaxBitmapSizeBytes = maxBitmapSizeBytes;
    }

    @Override
    protected void onNewResultImpl(
        CloseableReference<CloseableImage> newResult,
        @Status int status) {
      internalPrepareBitmap(newResult);
      getConsumer().onNewResult(newResult, status);
    }

    private void internalPrepareBitmap(CloseableReference<CloseableImage> newResult) {
      if (newResult == null || !newResult.isValid()) {
        return;
      }

      final CloseableImage closeableImage = newResult.get();
      if (closeableImage == null || closeableImage.isClosed()) {
        return;
      }

      if (closeableImage instanceof CloseableStaticBitmap) {
        final CloseableStaticBitmap staticBitmap = (CloseableStaticBitmap) closeableImage;
        final Bitmap bitmap = staticBitmap.getUnderlyingBitmap();
        if (bitmap == null) {
          return;
        }

        final int bitmapByteCount = bitmap.getRowBytes() * bitmap.getHeight();
        if (bitmapByteCount < mMinBitmapSizeBytes) {
          return;
        }
        if (bitmapByteCount > mMaxBitmapSizeBytes) {
          return;
        }

        bitmap.prepareToDraw();
      }
    }
  }
}


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.sudoku.data.model;

import java.util.List;

public class ContactCategory implements Ruleable {

    private String name;
    private List<User> contacts;

    public ContactCategory(){}
    public ContactCategory(String name){}

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the contacts
     */
    public List<User> getContacts() {
        return contacts;
    }

    /**
     * @param contacts the contacts to set
     */
    public void setContacts(List<User> contacts) {
        this.contacts = contacts;
    }

    public void addContact(User user){
        this.contacts.add(user);
    }

    public void removeContact(User user){
        this.contacts.remove(user);
    }

    @Override
    public Boolean hasUser(User user){
        return this.contacts.contains(user);
    }

    @Override
    public Boolean isUser(){
        return false;
    }
}