text:
<?php

namespace Cassandra\RetryPolicy;

use Cassandra\RetryPolicy;

/**
 * A retry policy that will downgrade the consistency of a request in
 * an attempt to save a request in cases where there is any chance of success. A
 * write request will succeed if there is at least a single copy persisted and a
 * read request will succeed if there is some data available even if it increases
 * the risk of reading stale data. This policy will retry in the same scenarios as
 * the default policy, and it will also retry in the following case:
 *
 * * On a read timeout, if some replicas responded but is lower than
 *   required by the current consistency level then retry with a lower
 *   consistency level
 * * On a write timeout, Retry unlogged batches at a lower consistency level
 *   if at least one replica responded. For single queries and batch if any
 *   replicas responded then consider the request successful and swallow the
 *   error.
 * * On unavailable, retry at a lower consistency if at lease one replica
 *   responded.
 *
 * Important: This policy may attempt to retry requests with a lower
 * consistency level. Using this policy can break consistency guarantees.
 */
final class DowngradingConsistency implements RetryPolicy
{
}


text:
var express = require('express');
var router  = express.Router();

router.get('/', function (req, res) {
  res.render('hello', {title: 'Hello World!'});
});

module.exports = router;

redpajama_set_name: RedPajamaGithub


text:
#include "qwindowsintegration.h"
#include "qwindowswindow.h"
#include "qwindowscontext.h"

#if defined(QT_OPENGL_ES_2) || defined(QT_OPENGL_DYNAMIC)
#  include "qwindowseglcontext.h"
#  include <QtGui/QOpenGLContext>
#endif

#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2)
#  include "qwindowsglcontext.h"
#endif

#if !defined(QT_NO_OPENGL)
#  include <QtGui/QOpenGLFunctions>
#endif

#include "qwindowsscreen.h"
#include "qwindowstheme.h"
#include "qwindowsservices.h"
#ifndef QT_NO_FREETYPE
#  include "qwindowsfontdatabase_ft.h"
#endif
#include "qwindowsfontdatabase.h"
#include "qwindowsguieventdispatcher.h"
#ifndef QT_NO_CLIPBOARD
#  include "qwindowsclipboard.h"
#  ifndef QT_NO_DRAGANDDROP
#    include "qwindowsdrag.h"
#  endif
#endif
#include "qwindowsinputcontext.h"
#include "qwindowskeymapper.h"
#ifndef QT_NO_ACCESSIBILITY
#  include "accessible/qwindowsaccessibility.h"
#endif

#include <qpa/qplatformnativeinterface.h>
#include <qpa/qwindowsysteminterface.h>
#if !defined(Q_OS_WINCE) && !defined(QT_NO_SESSIONMANAGER)
#  include "qwindowssessionmanager.h"
#endif
#include <QtGui/private/qguiapplication_p.h>
#include <QtGui/qpa/qplatforminputcontextfactory_p.h>

#include <QtCore/private/qeventdispatcher_win_p.h>
#include <QtCore/QDebug>
#include <QtCore/QVariant>

QT_BEGIN_NAMESPACE

/*!
    \class QWindowsIntegration
    \brief QPlatformIntegration implementation for Windows.
    \internal

    \section1 Programming Considerations

    The platform plugin should run on Desktop Windows from Windows XP onwards
    and Windows Embedded.

    It should compile with:
    \list
    \li Microsoft Visual Studio 2008 or later (using the Microsoft Windows SDK,
        (\c Q_CC_MSVC).
    \li Stock \l{http://mingw.org/}{MinGW} (\c Q_CC_MINGW).
        This version ships with headers that are missing a lot of WinAPI.
    \li MinGW distributions using GCC 4.7 or higher and a recent MinGW-w64 runtime API,
        such as \l{http://tdm-gcc.tdragon.net/}{TDM-GCC}, or
        \l{http://mingwbuilds.sourceforge.net/}{MinGW-builds}
        (\c Q_CC_MINGW and \c __MINGW64_VERSION_MAJOR indicating the version).
        MinGW-w64 provides more complete headers (compared to stock MinGW from mingw.org),
        including a considerable part of the Windows SDK.
    \li Visual Studio 2008 for Windows Embedded (\c Q_OS_WINCE).
    \endlist

    The file \c qtwindows_additional.h contains defines and declarations that
    are missing in MinGW. When encountering missing declarations, it should
    be added there so that \c #ifdefs for MinGW can be avoided. Similarly,
    \c qplatformfunctions_wince.h contains defines and declarations for
    Windows Embedded.

    When using a function from the WinAPI, the minimum supported Windows version
    and Windows Embedded support should be checked. If the function is not supported
    on Windows XP or is not present in the MinGW-headers, it should be dynamically
    resolved. For this purpose, QWindowsContext has static structs like
    QWindowsUser32DLL and QWindowsShell32DLL. All function pointers should go to
    these structs to avoid lookups in several places.

    \ingroup qt-lighthouse-win
*/

struct QWindowsIntegrationPrivate
{
#if defined(QT_OPENGL_ES_2) || defined(QT_OPENGL_DYNAMIC)
    typedef QSharedPointer<QWindowsEGLStaticContext> QEGLStaticContextPtr;
#endif
#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2)
    typedef QSharedPointer<QOpenGLStaticContext> QOpenGLStaticContextPtr;
#endif

    explicit QWindowsIntegrationPrivate(const QStringList &paramList);
    ~QWindowsIntegrationPrivate();

    unsigned m_options;
    QWindowsContext m_context;
    QPlatformFontDatabase *m_fontDatabase;
#ifndef QT_NO_CLIPBOARD
    QWindowsClipboard m_clipboard;
#  ifndef QT_NO_DRAGANDDROP
    QWindowsDrag m_drag;
#  endif
#endif
#if defined(QT_OPENGL_ES_2) || defined(QT_OPENGL_DYNAMIC)
    QEGLStaticContextPtr m_staticEGLContext;
#endif
#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2)
    QOpenGLStaticContextPtr m_staticOpenGLContext;
#endif
    QScopedPointer<QPlatformInputContext> m_inputContext;
#ifndef QT_NO_ACCESSIBILITY
    QWindowsAccessibility m_accessibility;
#endif
    QWindowsServices m_services;
};

static inline unsigned parseOptions(const QStringList &paramList,
                                    int *tabletAbsoluteRange)
{
    unsigned options = 0;
    foreach (const QString &param, paramList) {
        if (param.startsWith(QLatin1String("fontengine="))) {
            if (param.endsWith(QLatin1String("freetype"))) {
                options |= QWindowsIntegration::FontDatabaseFreeType;
            } else if (param.endsWith(QLatin1String("native"))) {
                options |= QWindowsIntegration::FontDatabaseNative;
            }
        } else if (param.startsWith(QLatin1String("dialogs="))) {
            if (param.endsWith(QLatin1String("xp"))) {
                options |= QWindowsIntegration::XpNativeDialogs;
            } else if (param.endsWith(QLatin1String("none"))) {
                options |= QWindowsIntegration::NoNativeDialogs;
            }
        } else if (param == QLatin1String("gl=gdi")) {
            options |= QWindowsIntegration::DisableArb;
        } else if (param == QLatin1String("nomousefromtouch")) {
            options |= QWindowsIntegration::DontPassOsMouseEventsSynthesizedFromTouch;
        } else if (param.startsWith(QLatin1String("verbose="))) {
            QWindowsContext::verbose = param.right(param.size() - 8).toInt();
        } else if (param.startsWith(QLatin1String("tabletabsoluterange="))) {
            *tabletAbsoluteRange = param.rightRef(param.size() - 20).toInt();
        }
    }
    return options;
}

QWindowsIntegrationPrivate::QWindowsIntegrationPrivate(const QStringList &paramList)
    : m_options(0)
    , m_fontDatabase(0)
{
    int tabletAbsoluteRange = -1;
    m_options = parseOptions(paramList, &tabletAbsoluteRange);
    if (tabletAbsoluteRange >= 0)
        m_context.setTabletAbsoluteRange(tabletAbsoluteRange);
}

QWindowsIntegrationPrivate::~QWindowsIntegrationPrivate()
{
    if (m_fontDatabase)
        delete m_fontDatabase;
}

QWindowsIntegration::QWindowsIntegration(const QStringList &paramList) :
    d(new QWindowsIntegrationPrivate(paramList))
{
#ifndef QT_NO_CLIPBOARD
    d->m_clipboard.registerViewer();
#endif
    d->m_context.screenManager().handleScreenChanges();
}

QWindowsIntegration::~QWindowsIntegration()
{
}

void QWindowsIntegration::initialize()
{
    if (QPlatformInputContext *pluginContext = QPlatformInputContextFactory::create())
        d->m_inputContext.reset(pluginContext);
    else
        d->m_inputContext.reset(new QWindowsInputContext);
}

bool QWindowsIntegration::hasCapability(QPlatformIntegration::Capability cap) const
{
    switch (cap) {
    case ThreadedPixmaps:
        return true;
#ifndef QT_NO_OPENGL
    case OpenGL:
        return true;
    case ThreadedOpenGL:
#if defined(QT_OPENGL_ES_2) || defined(QT_OPENGL_DYNAMIC)
        return QOpenGLContext::openGLModuleType() != QOpenGLContext::LibGL
            ? QWindowsEGLContext::hasThreadedOpenGLCapability() : true;
#  else
        return true;
#  endif // QT_OPENGL_ES_2
#endif // !QT_NO_OPENGL
    case WindowMasks:
        return true;
    case MultipleWindows:
        return true;
    case ForeignWindows:
        return true;
    case RasterGLSurface:
        return true;
    default:
        return QPlatformIntegration::hasCapability(cap);
    }
    return false;
}

QWindowsWindowData QWindowsIntegration::createWindowData(QWindow *window) const
{
    QWindowsWindowData requested;
    requested.flags = window->flags();
    requested.geometry = window->geometry();
    // Apply custom margins (see  QWindowsWindow::setCustomMargins())).
    const QVariant customMarginsV = window->property("_q_windowsCustomMargins");
    if (customMarginsV.isValid())
        requested.customMargins = qvariant_cast<QMargins>(customMarginsV);

    const QWindowsWindowData obtained
            = QWindowsWindowData::create(window, requested, window->title());
    qCDebug(lcQpaWindows).nospace()
        << __FUNCTION__ << '<' << window
        << "\n    Requested: " << requested.geometry << "frame incl.: "
        << QWindowsGeometryHint::positionIncludesFrame(window)
        << " Flags=" << QWindowsWindow::debugWindowFlags(requested.flags)
        << "\n    Obtained : " << obtained.geometry << " Margins "<< obtained.frame
        << " Flags=" << QWindowsWindow::debugWindowFlags(obtained.flags)
        << " Handle=" << obtained.hwnd << '\n';

    if (obtained.hwnd) {
        if (requested.flags != obtained.flags)
            window->setFlags(obtained.flags);
        // Trigger geometry change signals of QWindow.
        if ((obtained.flags & Qt::Desktop) != Qt::Desktop && requested.geometry != obtained.geometry)
            QWindowSystemInterface::handleGeometryChange(window, obtained.geometry);
    }

    return obtained;
}

QPlatformWindow *QWindowsIntegration::createPlatformWindow(QWindow *window) const
{
    QWindowsWindowData data = createWindowData(window);
    return data.hwnd ? new QWindowsWindow(window, data)
                     : Q_NULLPTR;
}

#ifndef QT_NO_OPENGL
QPlatformOpenGLContext
    *QWindowsIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
{
    qCDebug(lcQpaGl) << __FUNCTION__ << context->format();
#if defined(QT_OPENGL_ES_2) || defined(QT_OPENGL_DYNAMIC)
    if (QOpenGLContext::openGLModuleType() != QOpenGLContext::LibGL) {
        if (d->m_staticEGLContext.isNull()) {
            QWindowsEGLStaticContext *staticContext = QWindowsEGLStaticContext::create();
            if (!staticContext)
                return 0;
            d->m_staticEGLContext = QSharedPointer<QWindowsEGLStaticContext>(staticContext);
        }
        return new QWindowsEGLContext(d->m_staticEGLContext, context->format(), context->shareHandle());
    }
#endif
#if !defined(QT_OPENGL_ES_2)
    if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) {
        if (d->m_staticOpenGLContext.isNull())
            d->m_staticOpenGLContext =
                QSharedPointer<QOpenGLStaticContext>(QOpenGLStaticContext::create());
        QScopedPointer<QWindowsGLContext> result(new QWindowsGLContext(d->m_staticOpenGLContext, context));
        return result->isValid() ? result.take() : 0;
    }
#endif // !QT_OPENGL_ES_2
    return 0;
}
#endif // !QT_NO_OPENGL

/* Workaround for QTBUG-24205: In 'Auto', pick the FreeType engine for
 * QML2 applications. */

#ifdef Q_OS_WINCE
// It's not easy to detect if we are running a QML application
// Let's try to do so by checking if the Qt Quick module is loaded.
inline bool isQMLApplication()
{
    // check if the Qt Quick module is loaded
#ifdef _DEBUG
    HMODULE handle = GetModuleHandle(L"Qt5Quick" QT_LIBINFIX L"d.dll");
#else
    HMODULE handle = GetModuleHandle(L"Qt5Quick" QT_LIBINFIX L".dll");
#endif
    return (handle != NULL);
}
#endif

QPlatformFontDatabase *QWindowsIntegration::fontDatabase() const
{
    if (!d->m_fontDatabase) {
#ifdef QT_NO_FREETYPE
        d->m_fontDatabase = new QWindowsFontDatabase();
#else // QT_NO_FREETYPE
        if (d->m_options & QWindowsIntegration::FontDatabaseFreeType) {
            d->m_fontDatabase = new QWindowsFontDatabaseFT;
        } else if (d->m_options & QWindowsIntegration::FontDatabaseNative){
            d->m_fontDatabase = new QWindowsFontDatabase;
        } else {
#ifndef Q_OS_WINCE
            d->m_fontDatabase = new QWindowsFontDatabase;
#else
            if (isQMLApplication()) {
                qCDebug(lcQpaFonts) << "QML application detected, using FreeType rendering";
                d->m_fontDatabase = new QWindowsFontDatabaseFT;
            }
            else
                d->m_fontDatabase = new QWindowsFontDatabase;
#endif
        }
#endif // QT_NO_FREETYPE
    }
    return d->m_fontDatabase;
}

#ifdef SPI_GETKEYBOARDSPEED
static inline int keyBoardAutoRepeatRateMS()
{
  DWORD time = 0;
  if (SystemParametersInfo(SPI_GETKEYBOARDSPEED, 0, &time, 0))
      return time ? 1000 / static_cast<int>(time) : 500;
  return 30;
}
#endif

QVariant QWindowsIntegration::styleHint(QPlatformIntegration::StyleHint hint) const
{
    switch (hint) {
    case QPlatformIntegration::CursorFlashTime:
        if (const unsigned timeMS = GetCaretBlinkTime())
            return QVariant(int(timeMS) * 2);
        break;
#ifdef SPI_GETKEYBOARDSPEED
    case KeyboardAutoRepeatRate:
        return QVariant(keyBoardAutoRepeatRateMS());
#endif
    case QPlatformIntegration::StartDragTime:
    case QPlatformIntegration::StartDragDistance:
    case QPlatformIntegration::KeyboardInputInterval:
    case QPlatformIntegration::ShowIsFullScreen:
    case QPlatformIntegration::PasswordMaskDelay:
    case QPlatformIntegration::StartDragVelocity:
        break; // Not implemented
    case QPlatformIntegration::FontSmoothingGamma:
        return QVariant(QWindowsFontDatabase::fontSmoothingGamma());
    case QPlatformIntegration::MouseDoubleClickInterval:
        if (const int ms = GetDoubleClickTime())
            return QVariant(ms);
        break;
    case QPlatformIntegration::UseRtlExtensions:
        return QVariant(d->m_context.useRTLExtensions());
    case QPlatformIntegration::SynthesizeMouseFromTouchEvents:
#ifdef Q_OS_WINCE
        // We do not want Qt to synthesize mouse events as Windows also does that.
       return false;
#else // Q_OS_WINCE
       return QVariant(bool(d->m_options & DontPassOsMouseEventsSynthesizedFromTouch));
#endif // !Q_OS_WINCE
    default:
        break;
    }
    return QPlatformIntegration::styleHint(hint);
}

Qt::KeyboardModifiers QWindowsIntegration::queryKeyboardModifiers() const
{
    return QWindowsKeyMapper::queryKeyboardModifiers();
}

QList<int> QWindowsIntegration::possibleKeys(const QKeyEvent *e) const
{
    return d->m_context.possibleKeys(e);
}

#ifndef QT_NO_CLIPBOARD
QPlatformClipboard * QWindowsIntegration::clipboard() const
{
    return &d->m_clipboard;
}
#  ifndef QT_NO_DRAGANDDROP
QPlatformDrag *QWindowsIntegration::drag() const
{
    return &d->m_drag;
}
#  endif // !QT_NO_DRAGANDDROP
#endif // !QT_NO_CLIPBOARD

QPlatformInputContext * QWindowsIntegration::inputContext() const
{
    return d->m_inputContext.data();
}

#ifndef QT_NO_ACCESSIBILITY
QPlatformAccessibility *QWindowsIntegration::accessibility() const
{
    return &d->m_accessibility;
}
#endif

QWindowsIntegration *QWindowsIntegration::instance()
{
    return static_cast<QWindowsIntegration *>(QGuiApplicationPrivate::platformIntegration());
}

unsigned QWindowsIntegration::options() const
{
    return d->m_options;
}

#if !defined(Q_OS_WINCE) && !defined(QT_NO_SESSIONMANAGER)
QPlatformSessionManager *QWindowsIntegration::createPlatformSessionManager(const QString &id, const QString &key) const
{
    return new QWindowsSessionManager(id, key);
}
#endif

QAbstractEventDispatcher * QWindowsIntegration::createEventDispatcher() const
{
    return new QWindowsGuiEventDispatcher;
}

QStringList QWindowsIntegration::themeNames() const
{
    return QStringList(QLatin1String(QWindowsTheme::name));
}

QPlatformTheme *QWindowsIntegration::createPlatformTheme(const QString &name) const
{
    if (name == QLatin1String(QWindowsTheme::name))
        return new QWindowsTheme;
    return QPlatformIntegration::createPlatformTheme(name);
}

QPlatformServices *QWindowsIntegration::services() const
{
    return &d->m_services;
}

QT_END_NAMESPACE


text:
/// Copyright (c) 2012 Ecma International.  All rights reserved.
/// Ecma International makes this code available under the terms and conditions set
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
/// "Use Terms").   Any redistribution of this code must retain the above
/// copyright and this notice and otherwise comply with the Use Terms.

// Do not cache any JSON files - see
// https://bugs.ecmascript.org/show_bug.cgi?id=87
$.ajaxSetup( {cache:false});

/*
 * Run a test in the browser. Works by injecting an iframe with the test code.
 *
 * Public Methods:
 * * run(id, test): Runs the test specified.
 *
 * Callbacks:
 * * onComplete(test): Called when the test is run. Test object
 *                     contains result and error strings describing how the
 *                     test ran.
 */
function BrowserRunner() {
    var iframe,             // injected iframe
        currentTest,        // Current test being run.
        scriptCache = {},   // Holds the various includes required to run certain tests.
        instance    = this,
        errorDetectorFileContents,
        simpleTestAPIContents,
        globalScopeContents,
        harnessDir = "harness/";

    $.ajax({async: false,
            dataType: "text",
            success: function(data){errorDetectorFileContents = data;},
            url:harnessDir+"ed.js"});

    $.ajax({async: false,
            dataType: "text",
            success: function(data){simpleTestAPIContents = data;},
            url:harnessDir+"sta.js"});

    $.ajax({async: false,
            dataType: "text",
            success: function(data){globalScopeContents = data;},
            url:harnessDir+"gs.js"});

    /* Called by the child window to notify that the test has
     * finished. This function call is put in a separate script block
     * at the end of the page so errors in the test script block
     * should not prevent this function from being called.
     */
    function testFinished() {
        if((typeof currentTest.result) === "undefined") {
            // We didn't get a call to testRun, which likely means the
            // test failed to load.
            currentTest.result = "fail";
            currentTest.error  = "Failed to load test case (probable parse error).";
            currentTest.description = "Failed to load test case!";
        } else if((typeof currentTest.error) !== "undefined") {
            // We have an error logged from testRun.
            if(currentTest.error instanceof Test262Error) {
                currentTest.error = currentTest.message;
            } else {
            currentTest.error = currentTest.error.name + ": " + currentTest.error.message;
            }
        } else if ((typeof currentTest.error === "undefined") && (currentTest.result === "fail")) {
            currentTest.error = "Test case returned non-true value.";
        }

        document.body.removeChild(iframe);

        instance.onComplete(currentTest);
    }

    /* Called from the child window after the test has run. */
    function testRun(id, path, description, codeString, result, error) {
        currentTest.id = id;
        currentTest.path = path;
        currentTest.description = description;
        currentTest.result = result;
        currentTest.error = error;
        currentTest.code = codeString;
    }

    /* Run the test. */
    this.run = function (test, code) {

        //--Detect proper window.onerror support
        if (instance.supportsWindowOnerror===undefined) {
            var iframePrereqs = document.createElement("iframe");
            iframePrereqs.setAttribute("id", "prereqsIframe");
            if (!/firefox/i.test(navigator.userAgent)) {
                iframePrereqs.setAttribute("style", "display:none");
            }
            document.body.appendChild(iframePrereqs);

            var iwinPrereqs = iframePrereqs.contentWindow;
            var idocPrereqs = iwinPrereqs.document;
            idocPrereqs.open();

            iwinPrereqs.failCount = 0;

            var stuff = [
                         "window.onerror = function(a, b, c) { this.failCount++; }",
                         "va xyz =",
                         "throw Error();"
            ];

            for(var i in stuff) {
                idocPrereqs.writeln("<script type='text/javascript'>");
                idocPrereqs.writeln(stuff[i]);
                idocPrereqs.writeln("</script>");
            }
            idocPrereqs.close();

            //TODO - 500ms *should* be a sufficient delay
            setTimeout(function() {
                instance.supportsWindowOnerror = iwinPrereqs.failCount === 2;
                //alert(iwinPrereqs.failCount);
                document.body.removeChild(iframePrereqs);
                instance.run(test, code);
            }, 500);
            return;
        }

        currentTest = {};
        for (var tempIndex in test) {
            if (test.hasOwnProperty(tempIndex)) {
                currentTest[tempIndex] = test[tempIndex];
            }
        }
        currentTest.code = code;

        iframe = document.createElement("iframe");
        iframe.setAttribute("id", "runnerIframe");
        //FireFox has a defect where it doesn't fire window.onerror for an iframe if the iframe
        //is invisible.
        if (!/firefox/i.test(navigator.userAgent)) {
            iframe.setAttribute("style", "display:none");
        }
        document.body.appendChild(iframe);

        var iwin = window.frames[window.frames.length - 1];
        var idoc = iwin.document;
        idoc.open();

        // Set up some globals.
        iwin.testRun = testRun;
        iwin.testFinished = testFinished;

        //TODO: these should be moved to sta.js
        var includes = code.match(/\$INCLUDE\(([^\)]+)\)/g), // find all of the $INCLUDE statements
            include;

        if (includes !== null) {
            // We have some includes, so loop through each include and
            // pull in the dependencies.
            for (var i = 0; i < includes.length; i++) {
                include = includes[i].replace(/.*\(('|")(.*)('|")\)/, "$2");

                // First check to see if we have this script cached
                // already, and if not, grab it.
                if (typeof scriptCache[include] === "undefined") {
                    $.ajax({
                        async: false,
                        url: 'harness/' + include,
                        success: function (s) { scriptCache[include] = s; }
                    });
                }

                // Finally, write the required script to the window.
                idoc.writeln("<script type='text/javascript'>" + scriptCache[include] + "</script>");
            }
        }

        //Write out all of our helper functions
        //idoc.writeln("<script type='text/javascript' src='harness/sta.js'>" + "</script>");
        idoc.writeln("<script type='text/javascript'>");
        idoc.writeln(simpleTestAPIContents);
        idoc.writeln("</script>");

        iwin.iframeError = undefined;
        iwin.onerror = undefined;
        iwin.testDescrip = currentTest;

        //Add an error handler capable of catching so-called early errors
        //idoc.writeln("<script type='text/javascript' src='harness/ed.js'>" + "</script>");
        idoc.writeln("<script type='text/javascript'>");
        idoc.writeln(errorDetectorFileContents);
        idoc.writeln("</script>");

        //Run the code
        idoc.writeln("<script type='text/javascript'>");
        if (! instance.supportsWindowOnerror) {
            idoc.writeln("try {eval(\"" + this.convertForEval(code) + "\");} catch(e) {window.onerror(e.toString(), null, null);}");
        } else {
            idoc.writeln(code);
        }
        idoc.writeln("</script>");

        //Validate the results
        //idoc.writeln("<script type='text/javascript' src='harness/gs.js' defer>" + "</script>");
        idoc.writeln("<script type='text/javascript'>");
        idoc.writeln(globalScopeContents);
        idoc.writeln("</script>");
        idoc.close();
    };

    //--Helper functions-------------------------------------------------------
    this.convertForEval = function(txt) {
        txt = txt.replace(/\\/g,"\\\\");
        txt = txt.replace(/\"/g,"\\\"");
        txt = txt.replace(/\'/g,"\\\'");
        txt = txt.replace(/\r/g,"\\r");
        txt = txt.replace(/\n/g,"\\n");
        return txt;
    };
}

/* Loads tests from the sections specified in testcases.json.
 * Public Methods:
 * * getNextTest() - Start loading the next test.
 * * reset() - Start over at the first test.
 *
 * Callbacks:
 * * onLoadingNextSection(path): Called after a request is sent for the next section json, with the path to that json.
 * * onInitialized(totalTests, version, date): Called after the testcases.json is loaded and parsed.
 * * onTestReady(id, code): Called when a test is ready with the
 *       test's id and code.
 * * onTestsExhausted(): Called when there are no more tests to run.
 */
function TestLoader() {
    var testGroups       = [],
        testGroupIndex   = 0,
        currentTestIndex = 0,
        loader           = this;

    this.version    = undefined;
    this.date       = undefined;
    this.totalTests = 0;

    /* Get the XML for the next section */
    function getNextXML() {
        var group = testGroups[testGroupIndex];
        currentTestIndex = 0;

        if(group.tests.length > 0) {
            // already loaded this section.
            loader.getNextTest();
            return;
        }
        $.ajax({url: group.path, dataType: 'json', success: function(data) {
            group.tests = data.testsCollection.tests;
            loader.getNextTest();
        },
	error: function (XMLHttpRequest, textStatus, errorThrown) {
		//alert(XMLHttpRequest);
	}

	});

        loader.onLoadingNextSection(group.path);
    }

    /* Get the test list xml */
    function loadTestXML() {
        var testsListLoader = new XMLHttpRequest();

        $.ajax({url: TEST_LIST_PATH, dataType: 'json', success: function(data) {
            var testSuite = data.testSuite;

            loader.version    = data.version;
            loader.date       = data.date;
            loader.totalTests = data.numTests;

            for (var i = 0; i < testSuite.length; i++) {
                testGroups[i] = {
                    path: testSuite[i],
                    tests: []
                };
            }
            loader.onInitialized(loader.totalTests);
            getNextXML();
        }});
    }

    function getIdFromPath (path) {
        //path is of the form "a/b/c.js"

        var id = path.split("/");
        //id is now of the form ["a", "b", "c.js"];

        id = id[id.length-1];
        //id is now of the form "c.js"

        id = id.replace(/\.js$/i, "");
        //id is now of the form "c"

        return id;
    }

    /* Move on to the next test */
    this.getNextTest = function() {
        if(testGroups.length == 0) {
            // Initialize.
            loadTestXML();
        } else if(currentTestIndex < testGroups[testGroupIndex].tests.length) {
            // We have tests left in this test group.
            var test = testGroups[testGroupIndex].tests[currentTestIndex++];
            var scriptCode = test.code;
            test.id = getIdFromPath(test.path);
            //var scriptCode = (test.firstChild.text != undefined) ?
            //    test.firstChild.text : test.firstChild.textContent;

            loader.onTestReady(test, $.base64Decode(scriptCode));
        } else if(testGroupIndex < testGroups.length - 1) {
            // We don't have tests left in this test group, so move on
            // to the next.
            testGroupIndex++;
            getNextXML();
        } else {
            // We're done.
            loader.onTestsExhausted();
        }
    };

    /* Start over at the beginning */
    this.reset = function() {
        currentTestIndex = 0;
        testGroupIndex = 0;
    };

}

/* Controls test generation and running, and sends results to the presenter. */
function Controller() {
    var state  = 'stopped';
    var runner = new BrowserRunner();
    var loader = new TestLoader();
    var controller = this;
    var startTime;
    var elapsed = 0;
    //Hook which allows browser implementers to hook their own test harness API
    //into this test framework to handle test case failures and passes in their
    //own way (e.g., logging failures to the filesystem)
    this.implementerHook = {
        //Adds a test result
        addTestResult: function (test) { },

        //Called whenever all tests have finished running.  Provided with the
        //elapsed time in milliseconds.
        finished: function(elapsed) { }
    };

    runner.onComplete = function(test) {
        presenter.addTestResult(test);
        try {
            controller.implementerHook.addTestResult(test);
        } catch(e) { /*no-op*/}

        if(state === 'running')
            setTimeout(loader.getNextTest, 10);
    };

    loader.onInitialized = function(totalTests) {
        presenter.setTotalTests(totalTests);
    };

    loader.onLoadingNextSection = function(path) {
        presenter.updateStatus("Loading: " + path);
    };

    loader.onTestReady = function(testObj, testSrc) {
        presenter.updateStatus("Running Test: " + testObj.id);
        runner.run(testObj, testSrc);
    };

    loader.onTestsExhausted = function() {
        state = 'stopped';
        elapsed += new Date() - startTime;
        elapsed = elapsed/(1000*60);  //minutes
        elapsed = elapsed.toFixed(1);
        presenter.finished(elapsed);
        try {
            controller.implementerHook.finished(elapsed);
        } catch(e) { /*no-op*/}
    };

    this.start = function() {
        state = 'running';
        startTime = new Date();
        loader.getNextTest();
        presenter.started();
    };

    this.pause = function() {
        elapsed += new Date() - startTime;
        state = 'paused';
        presenter.paused();
    };

    this.reset = function() {
        startTime = new Date();
        elapsed = 0;
        loader.reset();
        presenter.reset();
    };

    this.toggle = function() {
        if(state === 'running') {
            controller.pause();
        } else {
            controller.start();
        }
    };
}

var controller = new Controller();

/* Helper function which shows if we're in the 'debug' mode of the Test262 site.
   This mode is only useful for debugging issues with the test harness and
   website. */
function isSiteDebugMode() {
    var str=window.location.href.substring(window.location.href.indexOf("?")+1);
    if(str.indexOf("sitedebug") > -1) {
        return true;
    }
    else {
        return false;
    }
}

$(function () {
    presenter.setup();
    $('.content-home').show();
    // Adding attribute to the tabs (e.g. Home, Run etc.) and
    // attaching the click event on buttons (e.g. Reset, Start etc.)
    $('.nav-link').each(function (index) {
        //Adding "targetDiv" attribute to the header tab and on that
        //basis the div related to header tabs are displayed
        if (index === 0) {
            $(this).attr('targetDiv', '.content-home');
        } else if (index === 1) {
            $(this).attr('targetDiv', '.content-tests');
        } else if (index === 2) {
            $(this).attr('targetDiv', '.content-results');
            $(this).attr('testRunning', 'false');
        } else if (index === 3) {
            $(this).attr('targetDiv', '.content-dev');
        }
        else {
            $(this).attr('targetDiv', '.content-browsers');
        }

        //Attaching the click event to the header tab that shows the
        //respective div of header
        $(this).click(function () {
            var target = $(this).attr('targetDiv');
            $('#contentContainer > div:visible').hide();
            $('.navBar .selected').toggleClass('selected');
            $(this).addClass('selected');
            $(target).show();

            //If clicked tab is Result, it generates the results.
            if ($(target).hasClass('content-results')) {
                presenter.refresh();
            }
        });
    });

    //Attach the click event to the start button. It starts, stops and
    //pauses the tests
    $('.button-start').click(function () {
        controller.toggle();
    });

    //Attach the click event to the reset button. It reset all the
    //test to zero
    $('.button-reset').click(function () {
        controller.reset();
    });

    var SUITE_DESCRIP_PATH = "json/suiteDescrip.json";
    $.ajax({ url: SUITE_DESCRIP_PATH, dataType: 'json', success: function (data) {
        presenter.setVersion(data.version);
        presenter.setDate(data.date);
    }
    });
});


text:
<?php

use yii\db\Schema;
use yii\db\Migration;

class m141230_045307_create_catalog_products_table extends Migration
{
    public function up()
    {
        $this->createTable('catalog_products',[
            'id' => 'pk',
            'title' => Schema::TYPE_STRING . ' NOT NULL',
            'photo' => Schema::TYPE_STRING. ' NULL',
            'photo_crop' => Schema::TYPE_STRING . ' NULL',
            'photo_cropped' => Schema::TYPE_STRING . ' NULL',
            'description' => Schema::TYPE_TEXT. ' NOT NULL',
            'date_created' => Schema::TYPE_DATE.' NOT NULL',
            'date_modified' => Schema::TYPE_DATE. 'NOT NULL',
            'status' => Schema::TYPE_INTEGER . ' NOT NULL',
            'category_id' => Schema::TYPE_INTEGER.' NOT NULL'
        ]);

        $this->addForeignKey('product_category_key','catalog_products','category_id','catalog_categories','id','cascade','cascade');
    }

    public function down()
    {
        $this->dropTable('catalog_products');
        return false;
    }
}


text:
/* $Id: format.h 4994 2015-03-17 04:02:44Z nanang $ */
/*
 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
#ifndef __PJMEDIA_FORMAT_H__
#define __PJMEDIA_FORMAT_H__

/**
 * @file pjmedia/format.h Media format
 * @brief Media format
 */
#include <VialerPJSIP/pjmedia/types.h>

/**
 * @defgroup PJMEDIA_FORMAT Media format
 * @ingroup PJMEDIA_TYPES
 * @brief Media format
 * @{
 */

PJ_BEGIN_DECL

/**
 * Macro for packing format from a four character code, similar to FOURCC.
 * This macro is used for building the constants in pjmedia_format_id
 * enumeration.
 */
#define PJMEDIA_FORMAT_PACK(C1, C2, C3, C4) PJMEDIA_FOURCC(C1, C2, C3, C4)

/**
 * This enumeration uniquely identify audio sample and/or video pixel formats.
 * Some well known formats are listed here. The format ids are built by
 * combining four character codes, similar to FOURCC. The format id is
 * extensible, as application may define and use format ids not declared
 * on this enumeration.
 *
 * This format id along with other information will fully describe the media
 * in #pjmedia_format structure.
 */
typedef enum pjmedia_format_id
{
    /*
     * Audio formats
     */

    /** 16bit signed integer linear PCM audio */
    PJMEDIA_FORMAT_L16	    = 0,

    /** Alias for PJMEDIA_FORMAT_L16 */
    PJMEDIA_FORMAT_PCM	    = PJMEDIA_FORMAT_L16,

    /** G.711 ALAW */
    PJMEDIA_FORMAT_PCMA	    = PJMEDIA_FORMAT_PACK('A', 'L', 'A', 'W'),

    /** Alias for PJMEDIA_FORMAT_PCMA */
    PJMEDIA_FORMAT_ALAW	    = PJMEDIA_FORMAT_PCMA,

    /** G.711 ULAW */
    PJMEDIA_FORMAT_PCMU	    = PJMEDIA_FORMAT_PACK('u', 'L', 'A', 'W'),

    /** Aliaw for PJMEDIA_FORMAT_PCMU */
    PJMEDIA_FORMAT_ULAW	    = PJMEDIA_FORMAT_PCMU,

    /** AMR narrowband */
    PJMEDIA_FORMAT_AMR	    = PJMEDIA_FORMAT_PACK(' ', 'A', 'M', 'R'),

    /** ITU G.729 */
    PJMEDIA_FORMAT_G729	    = PJMEDIA_FORMAT_PACK('G', '7', '2', '9'),

    /** Internet Low Bit-Rate Codec (ILBC) */
    PJMEDIA_FORMAT_ILBC	    = PJMEDIA_FORMAT_PACK('I', 'L', 'B', 'C'),

    /*
     * Video formats.
     */
    /**
     * 24bit RGB
     */
    PJMEDIA_FORMAT_RGB24    = PJMEDIA_FORMAT_PACK('R', 'G', 'B', '3'),

    /**
     * 32bit RGB with alpha channel
     */
    PJMEDIA_FORMAT_RGBA     = PJMEDIA_FORMAT_PACK('R', 'G', 'B', 'A'),
    PJMEDIA_FORMAT_BGRA     = PJMEDIA_FORMAT_PACK('B', 'G', 'R', 'A'),

    /**
     * Alias for PJMEDIA_FORMAT_RGBA
     */
    PJMEDIA_FORMAT_RGB32    = PJMEDIA_FORMAT_RGBA,

    /**
     * Device Independent Bitmap, alias for 24 bit RGB
     */
    PJMEDIA_FORMAT_DIB      = PJMEDIA_FORMAT_PACK('D', 'I', 'B', ' '),

    /**
     * This is planar 4:4:4/24bpp RGB format, the data can be treated as
     * three planes of color components, where the first plane contains
     * only the G samples, the second plane contains only the B samples,
     * and the third plane contains only the R samples.
     */
    PJMEDIA_FORMAT_GBRP    = PJMEDIA_FORMAT_PACK('G', 'B', 'R', 'P'),

    /**
     * This is a packed 4:4:4/32bpp format, where each pixel is encoded as
     * four consecutive bytes, arranged in the following sequence: V0, U0,
     * Y0, A0. Source:
     * http://msdn.microsoft.com/en-us/library/dd206750%28v=VS.85%29.aspx#ayuv
     */
    PJMEDIA_FORMAT_AYUV	    = PJMEDIA_FORMAT_PACK('A', 'Y', 'U', 'V'),

    /**
     * This is packed 4:2:2/16bpp YUV format, the data can be treated as
     * an array of unsigned char values, where the first byte contains
     * the first Y sample, the second byte contains the first U (Cb) sample,
     * the third byte contains the second Y sample, and the fourth byte
     * contains the first V (Cr) sample, and so forth. Source:
     * http://msdn.microsoft.com/en-us/library/dd206750%28v=VS.85%29.aspx#yuy2
     */
    PJMEDIA_FORMAT_YUY2	    = PJMEDIA_FORMAT_PACK('Y', 'U', 'Y', '2'),

    /**
     * This format is the same as the YUY2 format except the byte order is
     * reversed -- that is, the chroma and luma bytes are flipped. If the
     * image is addressed as an array of two little-endian WORD values, the
     * first WORD contains U in the LSBs and Y0 in the MSBs, and the second
     * WORD contains V in the LSBs and Y1 in the MSBs. Source:
     * http://msdn.microsoft.com/en-us/library/dd206750%28v=VS.85%29.aspx#uyvy
     */
    PJMEDIA_FORMAT_UYVY	    = PJMEDIA_FORMAT_PACK('U', 'Y', 'V', 'Y'),

    /**
     * This format is the same as the YUY2 and UYVY format except the byte
     * order is reversed -- that is, the chroma and luma bytes are flipped.
     * If the image is addressed as an array of two little-endian WORD values,
     * the first WORD contains Y0 in the LSBs and V in the MSBs, and the second
     * WORD contains Y1 in the LSBs and U in the MSBs.
     */
    PJMEDIA_FORMAT_YVYU	    = PJMEDIA_FORMAT_PACK('Y', 'V', 'Y', 'U'),

    /**
     * This is planar 4:2:0/12bpp YUV format, the data can be treated as
     * three planes of color components, where the first plane contains
     * only the Y samples, the second plane contains only the U (Cb) samples,
     * and the third plane contains only the V (Cr) sample.
     */
    PJMEDIA_FORMAT_I420	    = PJMEDIA_FORMAT_PACK('I', '4', '2', '0'),

    /**
     * IYUV is alias for I420.
     */
    PJMEDIA_FORMAT_IYUV	    = PJMEDIA_FORMAT_I420,

    /**
     * This is planar 4:2:0/12bpp YUV format, similar to I420 or IYUV but
     * the U (Cb) and V (Cr) planes order is switched, i.e: the second plane
     * contains the V (Cb) samples and the third plane contains the V (Cr)
     * samples.
     */
    PJMEDIA_FORMAT_YV12	    = PJMEDIA_FORMAT_PACK('Y', 'V', '1', '2'),

    /**
     * This is planar 4:2:0/12bpp YUV format, the data can be treated as
     * two planes of color components, where the first plane contains
     * only the Y samples, the second plane contains interleaved
     * V (Cr) - U (Cb) samples.
     */
    PJMEDIA_FORMAT_NV21	    = PJMEDIA_FORMAT_PACK('N', 'V', '2', '1'),

    /**
     * This is planar 4:2:2/16bpp YUV format, the data can be treated as
     * three planes of color components, where the first plane contains
     * only the Y samples, the second plane contains only the U (Cb) samples,
     * and the third plane contains only the V (Cr) sample.
     */
    PJMEDIA_FORMAT_I422	    = PJMEDIA_FORMAT_PACK('I', '4', '2', '2'),

    /**
     * The JPEG version of planar 4:2:0/12bpp YUV format.
     */
    PJMEDIA_FORMAT_I420JPEG = PJMEDIA_FORMAT_PACK('J', '4', '2', '0'),

    /**
     * The JPEG version of planar 4:2:2/16bpp YUV format.
     */
    PJMEDIA_FORMAT_I422JPEG = PJMEDIA_FORMAT_PACK('J', '4', '2', '2'),

    /**
     * Encoded video formats
     */

    PJMEDIA_FORMAT_H261     = PJMEDIA_FORMAT_PACK('H', '2', '6', '1'),
    PJMEDIA_FORMAT_H263     = PJMEDIA_FORMAT_PACK('H', '2', '6', '3'),
    PJMEDIA_FORMAT_H263P    = PJMEDIA_FORMAT_PACK('P', '2', '6', '3'),
    PJMEDIA_FORMAT_H264     = PJMEDIA_FORMAT_PACK('H', '2', '6', '4'),

    PJMEDIA_FORMAT_MJPEG    = PJMEDIA_FORMAT_PACK('M', 'J', 'P', 'G'),
    PJMEDIA_FORMAT_MPEG1VIDEO = PJMEDIA_FORMAT_PACK('M', 'P', '1', 'V'),
    PJMEDIA_FORMAT_MPEG2VIDEO = PJMEDIA_FORMAT_PACK('M', 'P', '2', 'V'),
    PJMEDIA_FORMAT_MPEG4    = PJMEDIA_FORMAT_PACK('M', 'P', 'G', '4'),

} pjmedia_format_id;

/**
 * This enumeration specifies what type of detail is included in a
 * #pjmedia_format structure.
 */
typedef enum pjmedia_format_detail_type
{
    /** Format detail is not specified. */
    PJMEDIA_FORMAT_DETAIL_NONE,

    /** Audio format detail. */
    PJMEDIA_FORMAT_DETAIL_AUDIO,

    /** Video format detail. */
    PJMEDIA_FORMAT_DETAIL_VIDEO,

    /** Number of format detail type that has been defined. */
    PJMEDIA_FORMAT_DETAIL_MAX

} pjmedia_format_detail_type;

/**
 * This structure is put in \a detail field of #pjmedia_format to describe
 * detail information about an audio media.
 */
typedef struct pjmedia_audio_format_detail
{
    unsigned	clock_rate;	/**< Audio clock rate in samples or Hz. */
    unsigned	channel_count;	/**< Number of channels.		*/
    unsigned	frame_time_usec;/**< Frame interval, in microseconds.	*/
    unsigned	bits_per_sample;/**< Number of bits per sample.		*/
    pj_uint32_t	avg_bps;	/**< Average bitrate			*/
    pj_uint32_t	max_bps;	/**< Maximum bitrate			*/
} pjmedia_audio_format_detail;

/**
 * This structure is put in \a detail field of #pjmedia_format to describe
 * detail information about a video media.
 *
 * Additional information about a video format can also be retrieved by
 * calling #pjmedia_get_video_format_info().
 */
typedef struct pjmedia_video_format_detail
{
    pjmedia_rect_size	size;	/**< Video size (width, height) 	*/
    pjmedia_ratio	fps;	/**< Number of frames per second.	*/
    pj_uint32_t		avg_bps;/**< Average bitrate.			*/
    pj_uint32_t		max_bps;/**< Maximum bitrate.			*/
} pjmedia_video_format_detail;

/**
 * This macro declares the size of the detail section in #pjmedia_format
 * to be reserved for user defined detail.
 */
#ifndef PJMEDIA_FORMAT_DETAIL_USER_SIZE
#   define PJMEDIA_FORMAT_DETAIL_USER_SIZE		1
#endif

/**
 * This structure contains all the information needed to completely describe
 * a media.
 */
typedef struct pjmedia_format
{
    /**
     * The format id that specifies the audio sample or video pixel format.
     * Some well known formats ids are declared in pjmedia_format_id
     * enumeration.
     *
     * @see pjmedia_format_id
     */
    pj_uint32_t		 	 id;

    /**
     * The top-most type of the media, as an information.
     */
    pjmedia_type		 type;

    /**
     * The type of detail structure in the \a detail pointer.
     */
    pjmedia_format_detail_type	 detail_type;

    /**
     * Detail section to describe the media.
     */
    union
    {
	/**
	 * Detail section for audio format.
	 */
	pjmedia_audio_format_detail	aud;

	/**
	 * Detail section for video format.
	 */
	pjmedia_video_format_detail	vid;

	/**
	 * Reserved area for user-defined format detail.
	 */
	char				user[PJMEDIA_FORMAT_DETAIL_USER_SIZE];
    } det;

} pjmedia_format;

/**
 * This enumeration describes video color model. It mostly serves as
 * information only.
 */
typedef enum pjmedia_color_model
{
    /** The color model is unknown or unspecified. */
    PJMEDIA_COLOR_MODEL_NONE,

    /** RGB color model. */
    PJMEDIA_COLOR_MODEL_RGB,

    /** YUV color model. */
    PJMEDIA_COLOR_MODEL_YUV
} pjmedia_color_model;

/**
 * This structure holds information to apply a specific video format
 * against size and buffer information, and get additional information
 * from it. To do that, application fills up the input fields of this
 * structure, and give this structure to \a apply_fmt() function
 * of #pjmedia_video_format_info structure.
 */
typedef struct pjmedia_video_apply_fmt_param
{
    /* input fields: */

    /**
     * [IN] The image size. This field is mandatory, and has to be set
     * correctly prior to calling \a apply_fmt() function.
     */
    pjmedia_rect_size	 size;

    /**
     * [IN] Pointer to the buffer that holds the frame. The \a apply_fmt()
     * function uses this pointer to calculate the pointer for each video
     * planes of the media. This field is optional -- however, the
     * \a apply_fmt() would still fill up the \a planes[] array with the
     * correct pointer even though the buffer is set to NULL. This could be
     * useful to calculate the size (in bytes) of each plane.
     */
    pj_uint8_t		*buffer;

    /* output fields: */

    /**
     * [OUT] The size (in bytes) required of the buffer to hold the video
     * frame of the particular frame size (width, height).
     */
    pj_size_t		 framebytes;

    /**
     * [OUT] Array of strides value (in bytes) for each video plane.
     */
    int		         strides[PJMEDIA_MAX_VIDEO_PLANES];

    /**
     * [OUT] Array of pointers to each of the video planes. The values are
     * calculated from the \a buffer field.
     */
    pj_uint8_t		*planes[PJMEDIA_MAX_VIDEO_PLANES];

    /**
     * [OUT] Array of video plane sizes.
     */
    pj_size_t		 plane_bytes[PJMEDIA_MAX_VIDEO_PLANES];

} pjmedia_video_apply_fmt_param;

/**
 * This structure holds information to describe a video format. Application
 * can retrieve this structure by calling #pjmedia_get_video_format_info()
 * funcion.
 */
typedef struct pjmedia_video_format_info
{
    /**
     * The unique format ID of the media. Well known format ids are declared
     * in pjmedia_format_id enumeration.
     */
    pj_uint32_t		id;

    /**
     * Null terminated string containing short identification about the
     * format.
     */
    char		name[8];

    /**
     * Information about the color model of this video format.
     */
    pjmedia_color_model	color_model;

    /**
     * Number of bits needed to store one pixel of this video format.
     */
    pj_uint8_t		bpp;

    /**
     * Number of video planes that this format uses. Value 1 indicates
     * packed format, while value greater than 1 indicates planar format.
     */
    pj_uint8_t		plane_cnt;

    /**
     * Pointer to function to apply this format against size and buffer
     * information in pjmedia_video_apply_fmt_param argument. Application
     * uses this function to obtain various information such as the
     * memory size of a frame buffer, strides value of the image, the
     * location of the planes, and so on. See pjmedia_video_apply_fmt_param
     * for additional information.
     *
     * @param vfi	The video format info.
     * @param vafp	The parameters to investigate.
     *
     * @return		PJ_SUCCESS if the function has calculated the
     * 			information in \a vafp successfully.
     */
    pj_status_t (*apply_fmt)(const struct pjmedia_video_format_info *vfi,
	                     pjmedia_video_apply_fmt_param *vafp);

} pjmedia_video_format_info;

/*****************************************************************************
 * UTILITIES:
 */

/**
 * General utility routine to calculate samples per frame value from clock
 * rate, ptime (in usec), and channel count. Application should use this
 * macro whenever possible due to possible overflow in the math calculation.
 *
 * @param clock_rate		Clock rate.
 * @param usec_ptime		Frame interval, in microsecond.
 * @param channel_count		Number of channels.
 *
 * @return			The samples per frame value.
 */
PJ_INLINE(unsigned) PJMEDIA_SPF(unsigned clock_rate, unsigned usec_ptime,
				unsigned channel_count)
{
#if PJ_HAS_INT64
    return ((unsigned)((pj_uint64_t)usec_ptime * \
		       clock_rate * channel_count / 1000000));
#elif PJ_HAS_FLOATING_POINT
    return ((unsigned)(1.0*usec_ptime * clock_rate * channel_count / 1000000));
#else
    return ((unsigned)(usec_ptime / 1000L * clock_rate * \
		       channel_count / 1000));
#endif
}

/**
 * Variant of #PJMEDIA_SPF() which takes frame rate instead of ptime.
 */
PJ_INLINE(unsigned) PJMEDIA_SPF2(unsigned clock_rate, const pjmedia_ratio *fr,
				 unsigned channel_count)
{
#if PJ_HAS_INT64
    return ((unsigned)((pj_uint64_t)clock_rate * fr->denum \
		       / fr->num / channel_count));
#elif PJ_HAS_FLOATING_POINT
    return ((unsigned)(1.0* clock_rate * fr->denum / fr->num /channel_count));
#else
    return ((unsigned)(1L * clock_rate * fr->denum / fr->num / channel_count));
#endif
}

/**
 * Utility routine to calculate frame size (in bytes) from bitrate and frame
 * interval values. Application should use this macro whenever possible due
 * to possible overflow in the math calculation.
 *
 * @param bps			The bitrate of the stream.
 * @param usec_ptime		Frame interval, in microsecond.
 *
 * @return			Frame size in bytes.
 */
PJ_INLINE(unsigned) PJMEDIA_FSZ(unsigned bps, unsigned usec_ptime)
{
#if PJ_HAS_INT64
    return ((unsigned)((pj_uint64_t)bps * usec_ptime / PJ_UINT64(8000000)));
#elif PJ_HAS_FLOATING_POINT
    return ((unsigned)(1.0 * bps * usec_ptime / 8000000.0));
#else
    return ((unsigned)(bps / 8L * usec_ptime / 1000000));
#endif
}

/**
 * General utility routine to calculate ptime value from frame rate.
 * Application should use this macro whenever possible due to possible
 * overflow in the math calculation.
 *
 * @param frame_rate		Frame rate
 *
 * @return			The ptime value (in usec).
 */
PJ_INLINE(unsigned) PJMEDIA_PTIME(const pjmedia_ratio *frame_rate)
{
#if PJ_HAS_INT64
    return ((unsigned)((pj_uint64_t)1000000 * \
		       frame_rate->denum / frame_rate->num));
#elif PJ_HAS_FLOATING_POINT
    return ((unsigned)(1000000.0 * frame_rate->denum /
                       frame_rate->num));
#else
    return ((unsigned)((1000L * frame_rate->denum /
                       frame_rate->num) * 1000));
#endif
}

/**
 * Utility to retrieve samples_per_frame value from
 * pjmedia_audio_format_detail.
 *
 * @param pafd		Pointer to pjmedia_audio_format_detail
 * @return		Samples per frame
 */
PJ_INLINE(unsigned) PJMEDIA_AFD_SPF(const pjmedia_audio_format_detail *pafd)
{
    return PJMEDIA_SPF(pafd->clock_rate, pafd->frame_time_usec,
		       pafd->channel_count);
}

/**
 * Utility to retrieve average frame size from pjmedia_audio_format_detail.
 * The average frame size is derived from the average bitrate of the audio
 * stream.
 *
 * @param afd		Pointer to pjmedia_audio_format_detail
 * @return		Average frame size.
 */
PJ_INLINE(unsigned) PJMEDIA_AFD_AVG_FSZ(const pjmedia_audio_format_detail *afd)
{
    return PJMEDIA_FSZ(afd->avg_bps, afd->frame_time_usec);
}

/**
 * Utility to retrieve maximum frame size from pjmedia_audio_format_detail.
 * The maximum frame size is derived from the maximum bitrate of the audio
 * stream.
 *
 * @param afd		Pointer to pjmedia_audio_format_detail
 * @return		Average frame size.
 */
PJ_INLINE(unsigned) PJMEDIA_AFD_MAX_FSZ(const pjmedia_audio_format_detail *afd)
{
    return PJMEDIA_FSZ(afd->max_bps, afd->frame_time_usec);
}

/**
 * Initialize the format as audio format with the specified parameters.
 *
 * @param fmt			The format to be initialized.
 * @param fmt_id		Format ID. See #pjmedia_format_id
 * @param clock_rate		Audio clock rate.
 * @param channel_count		Number of channels.
 * @param bits_per_sample	Number of bits per sample.
 * @param frame_time_usec	Frame interval, in microsecond.
 * @param avg_bps		Average bitrate.
 * @param max_bps		Maximum bitrate.
 */
PJ_INLINE(void) pjmedia_format_init_audio(pjmedia_format *fmt,
				          pj_uint32_t fmt_id,
					  unsigned clock_rate,
					  unsigned channel_count,
					  unsigned bits_per_sample,
					  unsigned frame_time_usec,
					  pj_uint32_t avg_bps,
					  pj_uint32_t max_bps)
{
    /* This function is inlined to avoid build problem due to circular
     * dependency, i.e: this function is part of pjmedia and is needed
     * by pjmedia-audiodev, while pjmedia depends on pjmedia-audiodev.
     */

    fmt->id = fmt_id;
    fmt->type = PJMEDIA_TYPE_AUDIO;
    fmt->detail_type = PJMEDIA_FORMAT_DETAIL_AUDIO;

    fmt->det.aud.clock_rate = clock_rate;
    fmt->det.aud.channel_count = channel_count;
    fmt->det.aud.bits_per_sample = bits_per_sample;
    fmt->det.aud.frame_time_usec = frame_time_usec;
    fmt->det.aud.avg_bps = avg_bps;
    fmt->det.aud.max_bps = max_bps;
}

/**
 * Initialize the format as video format with the specified parameters.
 * A format manager should have been created, as this function will need
 * to consult to a format manager in order to fill in detailed
 * information about the format.
 *
 * @param fmt		The format to be initialised.
 * @param fmt_id	Format ID. See #pjmedia_format_id
 * @param width		Image width.
 * @param height	Image heigth.
 * @param fps_num	FPS numerator.
 * @param fps_denum	FPS denumerator.
 * @param avg_bps	Average bitrate.
 * @param max_bps	Maximum bitrate.
 */
PJ_DECL(void) pjmedia_format_init_video(pjmedia_format *fmt,
					pj_uint32_t fmt_id,
					unsigned width,
					unsigned height,
					unsigned fps_num,
					unsigned fps_denum);

/**
 * Copy format to another.
 *
 * @param dst		The destination format.
 * @param src		The source format.
 *
 * @return		Pointer to destination format.
 */
PJ_DECL(pjmedia_format*) pjmedia_format_copy(pjmedia_format *dst,
					     const pjmedia_format *src);

/**
 * Check if the format contains audio format, and retrieve the audio format
 * detail in the format.
 *
 * @param fmt		The format structure.
 * @param assert_valid	If this is set to non-zero, an assertion will be
 * 			raised if the detail type is not audio or if the
 * 			the detail is NULL.
 *
 * @return		The instance of audio format detail in the format
 * 			structure, or NULL if the format doesn't contain
 * 			audio detail.
 */
PJ_DECL(pjmedia_audio_format_detail*)
pjmedia_format_get_audio_format_detail(const pjmedia_format *fmt,
				       pj_bool_t assert_valid);

/**
 * Check if the format contains video format, and retrieve the video format
 * detail in the format.
 *
 * @param fmt		The format structure.
 * @param assert_valid	If this is set to non-zero, an assertion will be
 * 			raised if the detail type is not video or if the
 * 			the detail is NULL.
 *
 * @return		The instance of video format detail in the format
 * 			structure, or NULL if the format doesn't contain
 * 			video detail.
 */
PJ_DECL(pjmedia_video_format_detail*)
pjmedia_format_get_video_format_detail(const pjmedia_format *fmt,
				       pj_bool_t assert_valid);

/*****************************************************************************
 * FORMAT MANAGEMENT:
 */

/**
 * Opaque data type for video format manager. The video format manager manages
 * the repository of video formats that the framework recognises. Typically it
 * is a singleton instance, although application may instantiate more than one
 * instances of this if required.
 */
typedef struct pjmedia_video_format_mgr pjmedia_video_format_mgr;

/**
 * Create a new video format manager instance. This will also set the pointer
 * to the singleton instance if the value is still NULL.
 *
 * @param pool		The pool to allocate memory.
 * @param max_fmt	Maximum number of formats to accommodate.
 * @param options	Option flags. Must be zero for now.
 * @param p_mgr		Pointer to hold the created instance.
 *
 * @return		PJ_SUCCESS on success, or the appripriate error value.
 */
PJ_DECL(pj_status_t)
pjmedia_video_format_mgr_create(pj_pool_t *pool,
				unsigned max_fmt,
				unsigned options,
				pjmedia_video_format_mgr **p_mgr);

/**
 * Get the singleton instance of the video format manager.
 *
 * @return		The instance.
 */
PJ_DECL(pjmedia_video_format_mgr*) pjmedia_video_format_mgr_instance(void);

/**
 * Manually assign a specific video manager instance as the singleton
 * instance. Normally this is not needed if only one instance is ever
 * going to be created, as the library automatically assign the singleton
 * instance.
 *
 * @param mgr		The instance to be used as the singleton instance.
 * 			Application may specify NULL to clear the singleton
 * 			singleton instance.
 */
PJ_DECL(void)
pjmedia_video_format_mgr_set_instance(pjmedia_video_format_mgr *mgr);

/**
 * Retrieve a video format info for the specified format id.
 *
 * @param mgr		The video format manager. Specify NULL to use
 * 			the singleton instance (however, a video format
 * 			manager still must have been created prior to
 * 			calling this function).
 * @param id		The format id which format info is to be
 * 			retrieved.
 *
 * @return		The video format info.
 */
PJ_DECL(const pjmedia_video_format_info*)
pjmedia_get_video_format_info(pjmedia_video_format_mgr *mgr,
			      pj_uint32_t id);

/**
 * Register a new video format to the framework. By default, built-in
 * formats will be registered automatically to the format manager when
 * it is created (note: built-in formats are ones which format id is
 * listed in pjmedia_format_id enumeration). This function allows
 * application to use user defined format id by registering that format
 * into the framework.
 *
 * @param mgr		The video format manager. Specify NULL to use
 * 			the singleton instance (however, a video format
 * 			manager still must have been created prior to
 * 			calling this function).
 * @param vfi		The video format info to be registered. This
 * 			structure must remain valid until the format
 * 			manager is destroyed.
 *
 * @return		PJ_SUCCESS on success, or the appripriate error value.
 */
PJ_DECL(pj_status_t)
pjmedia_register_video_format_info(pjmedia_video_format_mgr *mgr,
				   pjmedia_video_format_info *vfi);

/**
 * Destroy a video format manager. If the manager happens to be the singleton
 * instance, the singleton instance will be set to NULL.
 *
 * @param mgr		The video format manager. Specify NULL to use
 * 			the singleton instance (however, a video format
 * 			manager still must have been created prior to
 * 			calling this function).
 */
PJ_DECL(void) pjmedia_video_format_mgr_destroy(pjmedia_video_format_mgr *mgr);

PJ_END_DECL

/**
 * @}
 */

#endif	/* __PJMEDIA_FORMAT_H__ */


text:
% Split 1000 streams into 100 trials, 10 reps

load('UsualParams.mat')
expnum = 'C27';

ntrials = 100;
reps = 10;

BaseExperiment(expnum, mats, Kvals, randwfn, randicfn, preprocfn, ...
    deltat, endtime, ntrials, reps, tsplits, freq)

exit;


text:
<!DOCTYPE html>

    <title>Settings</title>
    <link rel="stylesheet" th:href="@{/css/bootstrap.min.css}"/>
    <link rel="stylesheet" th:href="@{/css/blog.css}"/>

Settings


text:
using System.Collections.Generic;
using StockportWebapp.Models;

namespace StockportWebapp.ViewModels
{
    public class Favourites
    {
        public List<Crumb> Crumbs { get; set; }
        public string Type { get; set; }
        public string FavouritesUrl { get; set; }
    }
}


text:
require 'test_helper'

class Admin::CommentsControllerTest < ActionController::TestCase
  setup do
    @admin_comment = admin_comments(:one)
  end

  test "should get index" do
    get :index
    assert_response :success
    assert_not_nil assigns(:admin_comments)
  end

  test "should get new" do
    get :new
    assert_response :success
  end

  test "should create admin_comment" do
    assert_difference('Admin::Comment.count') do
      post :create, admin_comment: { comment: @admin_comment.comment, publication_id: @admin_comment.publication_id, user_id: @admin_comment.user_id }
    end

    assert_redirected_to admin_comment_path(assigns(:admin_comment))
  end

  test "should show admin_comment" do
    get :show, id: @admin_comment
    assert_response :success
  end

  test "should get edit" do
    get :edit, id: @admin_comment
    assert_response :success
  end

  test "should update admin_comment" do
    patch :update, id: @admin_comment, admin_comment: { comment: @admin_comment.comment, publication_id: @admin_comment.publication_id, user_id: @admin_comment.user_id }
    assert_redirected_to admin_comment_path(assigns(:admin_comment))
  end

  test "should destroy admin_comment" do
    assert_difference('Admin::Comment.count', -1) do
      delete :destroy, id: @admin_comment
    end

    assert_redirected_to admin_comments_path
  end
end


text:
<?php

/**
 * @author Kirill Gusakov
 */
class InkRouter_Models_Attributes_BookletAttributes implements InkRouter_Models_Attributes_AttributeInterface
{
    /**
     * @var string
     */
    private $cover;

    /**
     * @var string
     */
    private $binding;

    /**
     * @var int
     */
    private $pages;

    /**
     * @var int
     */
    private $tabbing;

    /**
     * @var int
     */
    private $shrinkWrapping;

    /**
     * @var string
     */
    private $holeMaking;

    /**
     * @var string
     */
    private $coverSubstrate;

    /**
     * @param string $cover
     * @return InkRouter_Models_Attributes_BookletAttributes
     */
    public function setCover($cover)
    {
        $this->cover = $cover;
        return $this;
    }

    /**
     * @return string
     */
    public function getCover()
    {
        return $this->cover;
    }

    /**
     * @param string $binding
     * @return InkRouter_Models_Attributes_BookletAttributes
     */
    public function setBinding($binding)
    {
        $this->binding = $binding;
        return $this;
    }

    /**
     * @return string
     */
    public function getBinding()
    {
        return $this->binding;
    }

    /**
     * @param int $pages
     * @return InkRouter_Models_Attributes_BookletAttributes
     */
    public function setPages($pages)
    {
        $this->pages = $pages;
        return $this;
    }

    /**
     * @return int
     */
    public function getPages()
    {
        return $this->pages;
    }

    /**
     * @param int $tabbing
     * @return InkRouter_Models_Attributes_BookletAttributes
     */
    public function setTabbing($tabbing)
    {
        $this->tabbing = $tabbing;
        return $this;
    }

    /**
     * @return int
     */
    public function getTabbing()
    {
        return $this->tabbing;
    }

    /**
     * @param int $shrinkWrapping
     * @return InkRouter_Models_Attributes_BookletAttributes
     */
    public function setShrinkWrapping($shrinkWrapping)
    {
        $this->shrinkWrapping = $shrinkWrapping;
        return $this;
    }

    /**
     * @return int
     */
    public function getShrinkWrapping()
    {
        return $this->shrinkWrapping;
    }

    /**
     * @param string $holeMaking
     * @return InkRouter_Models_Attributes_BookletAttributes
     */
    public function setHoleMaking($holeMaking)
    {
        $this->holeMaking = $holeMaking;
        return $this;
    }

    /**
     * @return string
     */
    public function getHoleMaking()
    {
        return $this->holeMaking;
    }

    /**
     * @param string $coverSubstrate
     * @return InkRouter_Models_Attributes_BookletAttributes
     */
    public function setCoverSubstrate($coverSubstrate)
    {
        $this->coverSubstrate = $coverSubstrate;
        return $this;
    }

    /**
     * @return string
     */
    public function getCoverSubstrate()
    {
        return $this->coverSubstrate;
    }

    /**
     * @param bool $root
     * @return string
     */
    public function pack($root = false)
    {
        $writer = new XMLWriter();
        $writer->openMemory();
        if ($root) {
            $writer->startDocument();
        }

        $writer->startElement('booklet_attributes');

        if (isset($this->cover)) {
            $writer->writeElement('cover', $this->cover);
        }

        if (isset($this->binding)) {
            $writer->writeElement('binding', $this->binding);
        }

        if (isset($this->pages)) {
            $writer->writeElement('pages', $this->pages);
        }

        if (isset($this->tabbing)) {
            $writer->writeElement('tabbing', $this->tabbing);
        }

        if (isset($this->shrinkWrapping)) {
            $writer->writeElement('shrink_wrapping', $this->shrinkWrapping);
        }

        if (isset($this->holeMaking)) {
            $writer->writeElement('hole_making', $this->holeMaking);
        }

        if (isset($this->coverSubstrate)) {
            $writer->writeElement('cover_substrate', $this->coverSubstrate);
        }

        $writer->endElement();

        return $writer->outputMemory();
    }

}


text:
package com.lightbend.lagom.javadsl.api.deser;

import org.pcollections.PSequence;

/**
 * A path param serializer is responsible for serializing and deserializing parameters that are extracted from and
 * formatted into paths.
 *
 * When used in URLs, a path param serializer is used both for path segments as well as query string parameters.  It is
 * expected that the serializer will consume and return singleton sequences for path segments, but may return 0 to many
 * values for query string parameters.
 *
 * @param <Param> The type of the path parameter.
 */
public interface PathParamSerializer<Param> {

    /**
     * Serialize the given parameter into path parameters.
     *
     * @param parameter The parameter to serialize.
     * @return The parameters.
     */
    PSequence<String> serialize(Param parameter);

    /**
     * Deserialize the parameters into a deserialized parameter.
     *
     * @return The deserialized parameter.
     */
    Param deserialize(PSequence<String> parameters);
}


text:
import {
  VeuiDefineComponent,
  VeuiDefineInstance,
  UiMixin,
  OverlayMixin,
  BeforeClose,
  Status
} from '../common'

type Props = {
  type?: Status
  open?: boolean
  title?: string
  beforeClose?: BeforeClose
  loading?: boolean
  disabled?: boolean
  okLabel?: string
}

type Emits = {
  ok(): void
  afteropen(): void
  afterclose(): void
}

type Mixins = [UiMixin, OverlayMixin]

type Slots = {
  default(): unknown
  title(): unknown
  foot(): unknown
}

type AlertBox = VeuiDefineComponent<{
  new (...args: any[]): VeuiDefineInstance<Props, Emits, Slots, Mixins>
}>

export default AlertBox


text:
'use strict';

define(['angular'], function(angular) {
	angular.module('myApp.version.interpolate-filter', [])
	.filter('interpolate', ['version', function(version) {
		return function(text) {
			return String(text).replace(/\%VERSION\%/mg, version);
		};
	}]);
});


text:
export interface IOmnichannelCustomAgent {
	agentId: string;
	username: string;
}


text:
from django.conf.urls import url

from . import views

urlpatterns = [
    url(r'^$', views.index, name='api_index'),
    url(r'^time$', views.get_server_time, name='api_time'),
    url(r'^rooms/available', views.find_available, name='api_available'),
]


text:
module.exports = {
  name: 'ember-cli-echonest'
};


text:
'use strict';

let template = function(config, req, env, value){
	return {
		params: {
		    articleId: value.articleId || "N1241M00F-G11",
		}
	}
}

module.exports = function(REQ, ENV, CONFIG) {
	return (value) => {
		let config = template(CONFIG, REQ, ENV, value);
		let request = require('request');

		let promise = new Promise(function(resolve, reject){
			request.get('https://api.zalando.com/articles/' + config.params.articleId + '/reviews').on('data', (resp) => {
				console.log(resp.toString());
				resolve(resp.toString());
			}).on('error', (err) => {
				reject(err);
			});
		});

		return promise;
  };
}


text:
/*
 * Created on 16.02.2016
 */
package com.github.dockerjava.core.async;

import static org.testng.Assert.assertFalse;

import java.io.ByteArrayInputStream;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;

import org.testng.annotations.Test;

import com.github.dockerjava.api.async.ResultCallback;
import com.github.dockerjava.api.model.PullResponseItem;

/**
 *
 * @author Marcus Linke
 *
 */
public class JsonStreamProcessorTest {

    @Test
    public void processEmptyJson() throws Exception {

        InputStream response = new ByteArrayInputStream("{}".getBytes());

        JsonStreamProcessor<PullResponseItem> jsonStreamProcessor = new JsonStreamProcessor<PullResponseItem>(PullResponseItem.class);

        final List<Boolean> completed = new ArrayList<Boolean>();

        jsonStreamProcessor.processResponseStream(response, new ResultCallback<PullResponseItem>() {

            @Override
            public void close() throws IOException {
            }

            @Override
            public void onStart(Closeable closeable) {
            }

            @Override
            public void onNext(PullResponseItem object) {
                assertFalse(true, "onNext called for empty json");
            }

            @Override
            public void onError(Throwable throwable) {
            }

            @Override
            public void onComplete() {
                completed.add(true);
            }
        });

        assertFalse(completed.isEmpty(), "Stream processing not completed");
    }

}


text:
<?php

namespace AppBundle\Controller\Report;

use AppBundle\Controller\AbstractController;
use AppBundle\Entity as EntityDir;
use AppBundle\Entity\Report;
use AppBundle\Form as FormDir;

use AppBundle\Service\StepRedirector;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;

class AssetController extends AbstractController
{
    private static $jmsGroups = [
        'asset',
        'asset-state',
    ];

    /**
     * @Route("/report/{reportId}/assets", name="assets")
     * @Template("AppBundle:Report/Asset:start.html.twig")
     *
     * @param int $reportId
     *
     * @return array
     */
    public function startAction($reportId)
    {
        $report = $this->getReportIfNotSubmitted($reportId, self::$jmsGroups);
        if ($report->getStatus()->getAssetsState()['state'] != EntityDir\Report\Status::STATE_NOT_STARTED) {
            return $this->redirectToRoute('assets_summary', ['reportId' => $reportId]);
        }

        return [
            'report' => $report,
        ];
    }

    /**
     * @Route("/report/{reportId}/assets/exist", name="assets_exist")
     * @Template("AppBundle:Report/Asset:exist.html.twig")
     */
    public function existAction(Request $request, $reportId)
    {
        $report = $this->getReportIfNotSubmitted($reportId, self::$jmsGroups);
        if ($request->getMethod() == 'GET' && $report->getAssets()) { // if assets are added, set form default to "Yes"
            $report->setNoAssetToAdd(0);
        }
        $form = $this->createForm(FormDir\YesNoType::class, $report, [
            'field'              => 'noAssetToAdd',
            'translation_domain' => 'report-assets',
            'choices'            => ['Yes' => 0, 'No' => 1]
        ]);

        $form->handleRequest($request);

        if ($form->isValid()) {
            switch ($report->getNoAssetToAdd()) {
                case 0: // yes
                    return $this->redirectToRoute('assets_type', ['reportId' => $reportId,]);
                case 1: //no
                    $this->getRestClient()->put('report/' . $reportId, $report, ['noAssetsToAdd']);
                    return $this->redirectToRoute('assets_summary', ['reportId' => $reportId]);
            }
        }

        $backLink = $this->generateUrl('assets', ['reportId' => $reportId]);
        if ($request->get('from') == 'summary') {
            $backLink = $this->generateUrl('assets_summary', ['reportId' => $reportId]);
        }

        return [
            'backLink' => $backLink,
            'form' => $form->createView(),
            'report' => $report,
        ];
    }

    /**
     * @Route("/report/{reportId}/assets/step-type", name="assets_type")
     * @Template("AppBundle:Report/Asset:type.html.twig")
     */
    public function typeAction(Request $request, $reportId)
    {
        $report = $this->getReportIfNotSubmitted($reportId, self::$jmsGroups);
        $form = $this->createForm(FormDir\Report\Asset\AssetTypeTitle::class, new EntityDir\Report\AssetOther(), [
        ]);
        $form->handleRequest($request);

        if ($form->isValid()) {
            $title = $form->getData()->getTitle();
            switch ($title) {
                case 'Property':
                    return $this->redirect($this->generateUrl('assets_property_step', ['reportId' => $reportId, 'step' => 1]));
                default:
                    return $this->redirect($this->generateUrl('asset_other_add', ['reportId' => $reportId, 'title' => $title]));
            }
        }

        return [
            'report' => $report,
            'form' => $form->createView(),
            'backLink' => $this->generateUrl('assets', ['reportId' => $report->getId()]),
            'skipLink' => null,
        ];
    }

    /**
     * @Route("/report/{reportId}/assets/other/{title}/add", name="asset_other_add")
     * @Template("AppBundle:Report/Asset/Other:add.html.twig")
     */
    public function otherAddAction(Request $request, $reportId, $title)
    {
        $report = $this->getReportIfNotSubmitted($reportId);
        $asset = new Report\AssetOther();
        $asset->setTitle($title);
        $asset->setReport($report);

        $form = $this->createForm(FormDir\Report\Asset\AssetTypeOther::class, $asset);
        $form->handleRequest($request);

        if ($form->isValid()) {
            $asset = $form->getData();
            $this->getRestClient()->post("report/{$reportId}/asset", $asset);

            return $this->redirect($this->generateUrl('assets_add_another', ['reportId' => $reportId]));
        }

        return [
            'asset' => $asset,
            'backLink' => $this->generateUrl('assets_type', ['reportId' => $reportId]),
            'form' => $form->createView(),
            'report' => $report,
            // avoid sending query string to GA containing user's data
            'gaCustomUrl' => $this->generateUrl('asset_other_add', ['reportId'=>$reportId, 'title'=>'type'])
        ];
    }

    /**
     * @Route("/report/{reportId}/assets/other/edit/{assetId}", name="asset_other_edit")
     * @Template("AppBundle:Report/Asset/Other:edit.html.twig")
     */
    public function otherEditAction(Request $request, $reportId, $assetId = null)
    {
        $report = $this->getReportIfNotSubmitted($reportId);
        if ($assetId) {
            $asset = $this->getRestClient()->get("report/{$reportId}/asset/{$assetId}", 'Report\\Asset');
        } else {
            $asset = new Report\AssetOther();
            $asset->setReport($report);
        }

        $form = $this->createForm(FormDir\Report\Asset\AssetTypeOther::class, $asset);
        $form->handleRequest($request);

        if ($form->isValid()) {
            $asset = $form->getData();
            $this->getRestClient()->put("report/{$reportId}/asset/{$assetId}", $asset);
            $request->getSession()->getFlashBag()->add('notice', 'Asset edited');

            return $this->redirect($this->generateUrl('assets', ['reportId' => $reportId]));
        }

        return [
            'asset' => $asset,
            'backLink' => $this->generateUrl('assets_summary', ['reportId' => $reportId]),
            'form' => $form->createView(),
            'report' => $report,
        ];
    }

    /**
     * @Route("/report/{reportId}/assets/add_another", name="assets_add_another")
     * @Template("AppBundle:Report/Asset:addAnother.html.twig")
     */
    public function addAnotherAction(Request $request, $reportId)
    {
        $report = $this->getReportIfNotSubmitted($reportId);

        $form = $this->createForm(FormDir\AddAnotherRecordType::class, $report, ['translation_domain' => 'report-assets']);
        $form->handleRequest($request);

        if ($form->isValid()) {
            switch ($form['addAnother']->getData()) {
                case 'yes':
                    return $this->redirectToRoute('assets_type', ['reportId' => $reportId, 'from' => 'another']);
                case 'no':
                    return $this->redirectToRoute('assets_summary', ['reportId' => $reportId]);
            }
        }

        return [
            'form' => $form->createView(),
            'report' => $report,
        ];
    }

    /**
     * @Route("/report/{reportId}/assets/property/step{step}/{assetId}", name="assets_property_step", requirements={"step":"\d+"})
     * @Template("AppBundle:Report/Asset/Property:step.html.twig")
     */
    public function propertyStepAction(Request $request, $reportId, $step, $assetId = null)
    {
        $totalSteps = 8;
        if ($step < 1 || $step > $totalSteps) {
            return $this->redirectToRoute('assets_summary', ['reportId' => $reportId]);
        }

        // common vars and data
        $dataFromUrl = $request->get('data') ?: [];
        $stepUrlData = $dataFromUrl;
        $report = $this->getReportIfNotSubmitted($reportId, self::$jmsGroups);
        $fromPage = $request->get('from');

        $stepRedirector = $this->stepRedirector()
            ->setRoutes('assets_type', 'assets_property_step', 'assets_summary')
            ->setFromPage($fromPage)
            ->setCurrentStep($step)->setTotalSteps($totalSteps)
            ->setRouteBaseParams(['reportId' => $reportId, 'assetId' => $assetId]);

        if ($assetId) { // edit asset
            $assets = array_filter($report->getAssets(), function ($t) use ($assetId) {
                return $t->getId() == $assetId;
            });
            $asset = array_shift($assets);
            $stepRedirector->setFromPage('summary');
        } else { // add new asset
            $asset = new EntityDir\Report\AssetProperty();
        }

        // add URL-data into model
        isset($dataFromUrl['address']) && $asset->setAddress($dataFromUrl['address']);
        isset($dataFromUrl['address2']) && $asset->setAddress2($dataFromUrl['address2']);
        isset($dataFromUrl['postcode']) && $asset->setPostcode($dataFromUrl['postcode']);
        isset($dataFromUrl['county']) && $asset->setCounty($dataFromUrl['county']);
        isset($dataFromUrl['occupants']) && $asset->setOccupants($dataFromUrl['occupants']);
        isset($dataFromUrl['owned']) && $asset->setOwned($dataFromUrl['owned']);
        isset($dataFromUrl['owned_p']) && $asset->setOwnedPercentage($dataFromUrl['owned_p']);
        isset($dataFromUrl['has_mg']) && $asset->setHasMortgage($dataFromUrl['has_mg']);
        isset($dataFromUrl['mg_oa']) && $asset->setMortgageOutstandingAmount($dataFromUrl['mg_oa']);
        isset($dataFromUrl['value']) && $asset->setValue($dataFromUrl['value']);
        isset($dataFromUrl['ser']) && $asset->setIsSubjectToEquityRelease($dataFromUrl['ser']);
        isset($dataFromUrl['hc']) && $asset->setHasCharges($dataFromUrl['hc']);
        $stepRedirector->setStepUrlAdditionalParams([
            'data' => $dataFromUrl
        ]);

        // crete and handle form
        $form = $this->createForm(FormDir\Report\Asset\AssetTypeProperty::class, $asset, ['step' => $step]);
        $form->handleRequest($request);

        if ($form->get('save')->isClicked() && $form->isValid()) {
            $asset = $form->getData();
            /* @var $asset Report\AssetProperty */

            // edit mode: save immediately and go back to summary page
            if ($assetId) {
                $this->getRestClient()->put("report/{$reportId}/asset/{$assetId}", $asset);
                $request->getSession()->getFlashBag()->add('notice', 'Asset edited');

                return $this->redirect($this->generateUrl('assets_summary', ['reportId' => $reportId]));
            }

            if ($step == 1) {
                $stepUrlData['address'] = $asset->getAddress();
                $stepUrlData['address2'] = $asset->getAddress2();
                $stepUrlData['postcode'] = $asset->getPostcode();
                $stepUrlData['county'] = $asset->getCounty();
            }

            if ($step == 2) {
                $stepUrlData['occupants'] = $asset->getOccupants();
            }

            if ($step == 3) {
                $stepUrlData['owned'] = $asset->getOwned();
                $stepUrlData['owned_p'] = $asset->getOwnedPercentage();
            }

            if ($step == 4) {
                $stepUrlData['has_mg'] = $asset->getHasMortgage();
                $stepUrlData['mg_oa'] = $asset->getMortgageOutstandingAmount();
            }
            if ($step == 5) {
                $stepUrlData['value'] = $asset->getValue();
            }
            if ($step == 6) {
                $stepUrlData['ser'] = $asset->getIsSubjectToEquityRelease();
            }
            if ($step == 7) {
                $stepUrlData['hc'] = $asset->getHasCharges();
            }

            // last step: save
            if ($step == $totalSteps) {
                $this->getRestClient()->post("report/{$reportId}/asset", $asset);

                return $this->redirect($this->generateUrl('assets_add_another', ['reportId' => $reportId]));
            }

            $stepRedirector->setStepUrlAdditionalParams([
                'data' => $stepUrlData
            ]);

            return $this->redirect($stepRedirector->getRedirectLinkAfterSaving());
        }

        return [
            'asset' => $asset,
            'report' => $report,
            'step' => $step,
            'form' => $form->createView(),
            'backLink' => $stepRedirector->getBackLink(),
            'skipLink' => null,
            'gaCustomUrl' => $request->getPathInfo() // avoid sending query string to GA containing user's data
        ];
    }

    /**
     * @Route("/report/{reportId}/assets/summary", name="assets_summary")
     * @Template("AppBundle:Report/Asset:summary.html.twig")
     *
     * @param int $reportId
     *
     * @return array
     */
    public function summaryAction($reportId)
    {
        $report = $this->getReportIfNotSubmitted($reportId, self::$jmsGroups);
        if ($report->getStatus()->getAssetsState()['state'] == EntityDir\Report\Status::STATE_NOT_STARTED) {
            return $this->redirect($this->generateUrl('assets', ['reportId' => $reportId]));
        }

        return [
            'report' => $report,
        ];
    }

    /**
     * @Route("/report/{reportId}/assets/{assetId}/delete", name="asset_delete")
     * @Template("AppBundle:Common:confirmDelete.html.twig")
     *
     * @return RedirectResponse
     */
    public function deleteAction(Request $request, $reportId, $assetId)
    {
        $form = $this->createForm(FormDir\ConfirmDeleteType::class);
        $form->handleRequest($request);
        $report = $this->getReportIfNotSubmitted($reportId, self::$jmsGroups);

        if ($form->isValid()) {
            if ($report->hasAssetWithId($assetId)) {
                $this->getRestClient()->delete("/report/{$reportId}/asset/{$assetId}");
                $request->getSession()->getFlashBag()->add('notice', 'Asset removed');
            }

            return $this->redirect($this->generateUrl('assets_summary', ['reportId' => $reportId]));
        }

        $asset = $this->getRestClient()->get("report/{$reportId}/asset/{$assetId}", 'Report\\Asset');

        if ($asset instanceof EntityDir\Report\AssetProperty) {
            $summary = [
                ['label' => 'deletePage.summary.type', 'value' => 'deletePage.summary.property', 'format' => 'translate'],
                ['label' => 'deletePage.summary.address', 'value' => implode(', ', $asset->getAddressValidLines())],
                ['label' => 'deletePage.summary.value', 'value' => $asset->getValue(), 'format' => 'money'],
            ];
        } else {
            $summary = [
                ['label' => 'deletePage.summary.type', 'value' => $asset->getTitle()],
                ['label' => 'deletePage.summary.description', 'value' => $asset->getDescription()],
                ['label' => 'deletePage.summary.value', 'value' => $asset->getValue(), 'format' => 'money'],
                ['label' => 'deletePage.summary.valuationDate', 'value' => $asset->getValuationDate(), 'format' => 'date'],
            ];
        }

        return [
            'translationDomain' => 'report-assets',
            'report' => $report,
            'form' => $form->createView(),
            'summary' => $summary,
            'backLink' => $this->generateUrl('assets_summary', ['reportId' => $reportId]),
        ];
    }

    /**
     * @return string
     */
    protected function getSectionId()
    {
        return 'assets';
    }
}


text:
<?php

namespace Citfact\FilterSubscribe;

use Bitrix\Main\Entity;
use Citfact\FilterSubscribe\Model;

class Agent
{
    /**
     * Method searches for a custom filter that, needs updating (notifications of new elements).
     * Custom filters are added to the stack of tasks.
     *
     * @param int $limitFilter
     * @return string
     */
    public static function findUserFilterNotify($limitFilter = 1, $limitFilterUser = 100)
    {
        $iblockElement = new \CIBlockElement();
        $connection = \Bitrix\Main\Application::getConnection();
        $sqlHelper = $connection->getSqlHelper();

        $limitFilter = (int)$limitFilter;
        $limitFilterUser = (int)$limitFilterUser;
        if ($limitFilterUser <= 0 || $limitFilterUser <= 0) {
            return;
        }

        $queryBuilder = new Entity\Query(Model\SubscribeTable::getEntity());
        $filterResult = $queryBuilder->setSelect(array('*'))
            ->setFilter(array('ACTIVE' => 'Y'))
            ->setLimit($limitFilter)
            ->exec();

        while ($filterRow = $filterResult->fetch()) {
            $filter['IBLOCK_ID'] = $filterRow['IBLOCK_ID'];
            if ($filterRow['SECTION_ID'] > 0) {
                $filter['SECTION_ID'] = $filterRow['SECTION_ID'];
            }

            $filter = array_merge($filter, unserialize($filterRow['FILTER']));
            $elementResult = $iblockElement->GetList(false, $filter, array('IBLOCK_ID'))->fetch();
            if ($elementResult['CNT'] <= 0) {
                continue;
            }

            // Choose filters which notification less,
            // than the number of elements with filter
            $sql = "
                SELECT DISTINCT t1.ID
                FROM b_citfact_filter_subscribe_user as t1
                LEFT OUTER JOIN b_citfact_filter_subscribe_notify as t2 ON (
                    t1.ID = t2.FILTER_USER_ID AND
                    t1.FILTER_ID = '" . $sqlHelper->forSql($filterRow['ID']) . "'
                )
                WHERE (SELECT count(ID) FROM b_citfact_filter_subscribe_notify as t3 WHERE t3.FILTER_USER_ID = t1.ID) < '" . $sqlHelper->forSql($elementResult['CNT']) . "'
                GROUP BY t1.ID
                LIMIT 0,".$limitFilterUser."
            ";

            // Adding custom filters to stack table
            $notifyList = (array)$connection->query($sql)->fetchAll();
            foreach ($notifyList as $key => $notify) {
                Model\SubscribeStackTable::add(array(
                    'FILTER_USER_ID' => $notify['ID'],
                    'ACTION' => 'UPDATE',
                ));
            }

            // If list for stack table is not empty, then deactivate filter
            if (sizeof($notifyList) > 0) {
                Model\SubscribeTable::update($filterRow['ID'], array(
                    'ACTIVE' => 'N'
                ));
            }
        }

        return "Citfact\\FilterSubscribe\\Agent::findUserFilterNotify($limitFilter)";
    }

    /**
     * TASK performs with ACTION = INSERT
     *
     * @param int $limit
     * @return string
     */
    public static function taskInsertElement($limit = 500)
    {
        if (($limit = (int)$limit) < 0) {
            return;
        }

        $iblockElement = new \CIBlockElement();
        $connection = \Bitrix\Main\Application::getConnection();
        $sqlHelper = $connection->getSqlHelper();

        // We get a task with the `ACTION` of `INSERT`
        $sql = "
            SELECT t1.ID as TASK_ID, t1.PARAMS, t1.FILTER_USER_ID, t3.*
            FROM b_citfact_filter_subscribe_stack as t1
            LEFT JOIN b_citfact_filter_subscribe_user as t2 ON t2.ID = t1.FILTER_USER_ID
            LEFT JOIN b_citfact_filter_subscribe as t3 ON t3.ID = t2.FILTER_USER
            WHERE t1.ACTION = 'INSERT' AND t3.ACTIVE = 'N'
            LIMIT 1
        ";

        $task = (array)$connection->query($sql)->fetch();
        if (!empty($task)) {
            $filter['IBLOCK_ID'] = $task['IBLOCK_ID'];
            if ($task['SECTION_ID'] > 0) {
                $filter['SECTION_ID'] = $task['SECTION_ID'];
            }

            $filter = array_merge($filter, unserialize($task['FILTER']));
            $elementResult = $iblockElement->GetList(array('ID' => 'ASC'), $filter, false, array('nTopCount' => $limit), array('ID'));
            while ($element = $elementResult->fetch()) {
                Model\SubscribeNotifyTable::add(array(
                    'FILTER_USER_ID' => $task['FILTER_USER_ID'],
                    'ELEMENT_ID' => $element['ID'],
                ));
            }

            Model\SubscribeStackTable::delete(array('ID' => $task['TASK_ID']));
        }

        return "Citfact\\FilterSubscribe\\Agent::taskInsertElement($limit)";
    }

    /**
     * TASK performs with ACTION = UPDATE
     *
     * @param int $limit
     * @return string
     */
    public static function taskUpdateElement($limit = 30)
    {
        return "Citfact\\FilterSubscribe\\Agent::taskUpdateElement()";
    }

    /**
     * Updates field `ACTIVE` on the filters
     *
     * @param int $limit
     * @return string
     */
    public static function updateFilterStatus($limit = 50)
    {
        if (($limit = (int)$limit) < 0) {
            return;
        }

        $connection = \Bitrix\Main\Application::getConnection();
        $sqlHelper = $connection->getSqlHelper();

        $sql = "
            SELECT t1.ID
            FROM b_citfact_filter_subscribe as t1
            LEFT JOIN b_citfact_filter_subscribe_user as t2 ON t1.ID = t2.FILTER_ID
            WHERE t1.ACTIVE = 'N' AND NOT EXISTS (
                SELECT t3.ID
                FROM b_citfact_filter_subscribe_stack as t3
                WHERE t3.FILTER_USER_ID = t2.ID
            )
            LIMIT 0,".$limit."
        ";

        $fitlerResult = $connection->query($sql);
        while ($filter = $fitlerResult->fetch()) {
            Model\SubscribeTable::update($filter['ID'], array('ACTIVE' => 'Y'));
        }

        return "Citfact\\FilterSubscribe\\Agent::updateFilterStatus($limit)";
    }

    /**
     * Remove filter, if him not used
     *
     * @param int $limit
     * @return string
     */
    public static function removeUnusedFilter($limit = 50)
    {
        if (($limit = (int)$limit) < 0) {
            return;
        }

        $connection = \Bitrix\Main\Application::getConnection();
        $sqlHelper = $connection->getSqlHelper();

        $sql = "
            SELECT t1.ID
            FROM b_citfact_filter_subscribe as t1
            WHERE NOT EXISTS (
                SELECT t2.ID
                FROM b_citfact_filter_subscribe_user as t2
                WHERE t2.FILTER_ID = t1.ID
            )
            LIMIT 0,".$limit."
        ";

        $fitlerResult = $connection->query($sql);
        while ($filter = $fitlerResult->fetch()) {
            Model\SubscribeTable::delete(array('ID' => $filter['ID']));
        }

        return "Citfact\\FilterSubscribe\\Agent::removeUnusedFilter($limit)";
    }
}


text:
function showModal() {
    $('body').addClass('dialogIsOpen');
    $('#modal section').hide();
    $('#modal #' + $(this).attr('class')).show();
}

function closeModal() {
    $('body').removeClass('dialogIsOpen');
}

$('nav a, .usage').on('click', showModal);

// ESC
$(document).on('keydown', function(e) {
    if (e.keyCode == 27) {
        closeModal();
    }
});
$('#modal .x, nav .simulator').off('click').on('click', closeModal);

// set default map
$('textarea[name=map]').val("r, g, g, r, r\nr, r, g, r, r\nr, r, g, g, r\nr, r, r, r, r");

// =============================================================================
// CLASS GENERATOR
// =============================================================================
function Class(methods) {
    var c = function() {
        this.init.apply(this, arguments);
    };
    for (var property in methods) {
        c.prototype[property] = methods[property];
    }
    if (!c.prototype.init)
        c.prototype.init = function() {
        };
    return c;
}


text:
package org.couch4j.api;

import net.sf.json.JSONObject;

/**
 * Implementors can be exported to a JSON string and a JSONObject.
 *
 * @author Stefan Saasen
 */
public interface JsonExportable {
    String toJson();

    JSONObject toJSONObject();
}


text:
id: bsk:home
title: Knex Schema Reader ∙ A database schema reader and export utility
---

# Knex Schema Reader

Knex Schema Reader is a utility for exporting a database schema to an object (API) and/or json file (CLI)

### Features

Exports a database schema to either an object (api) or to a json file (cli).
Useful in a code generation pipeline or to build tooling.

Supported database dialects:

-  mssql
-  mysql
-  postgresql
-  oracle

### Sample Outputs

- SQL Server samples:
  - [AdventureWorks 2014](https://github.com/mattjcowan/knex-schema-reader/blob/master/samples/mssql/adventureworks.json)
    - [Get the database](https://msftdbprodsamples.codeplex.com/releases)
  - [Northwind](https://github.com/mattjcowan/knex-schema-reader/blob/master/samples/mssql/northwind.json)
    - [Get the database](https://northwinddatabase.codeplex.com/releases/view/71634)

- MySQL samples:
  - [Sakila JSON output file](https://github.com/mattjcowan/knex-schema-reader/blob/master/samples/mysql/sakila.json)
    - [Get the database](https://dev.mysql.com/doc/sakila/en/)
  - [Employees JSON output file](https://github.com/mattjcowan/knex-schema-reader/blob/master/samples/mysql/employees.json)
    - [Get the database](https://dev.mysql.com/doc/employee/en/)

- PostgreSQL samples:
  - [Pagila JSON output file](https://github.com/mattjcowan/knex-schema-reader/blob/master/samples/postgresql/pagila.json)
    - [Get the database](http://www.postgresqltutorial.com/postgresql-sample-database/)
  - [SportsDB JSON output file](https://github.com/mattjcowan/knex-schema-reader/blob/master/samples/postgresql/sportsdb.json)
    - [Get the database](http://www.sportsdb.org/sd/samples)


text:
import { song } from './songmanager';
import { state } from '../state';
import { signal } from './signal';
import { player } from '../audio/player';
import { cursor } from './cursor';

class EventSystem {
  constructor() {
    this.keys = {};
    this.playing = {};

    this.noteDown = signal(false);
    this.noteUp = signal(false);

    this.events = {
      noteDown: (args) => {
        const note = args[0];

        if (state.cursor.get('record')) {
          if (state.cursor.get('item') !== 0) {
            return;
          }
          state.groupHistoryStart('Play note into pattern');
          const instrument = note >= 96 ? null : state.cursor.get('instrument') + 1;
          song.addNoteToSong(state.cursor.toJS(), note, instrument);
          state.groupHistoryEnd();
          if (!player.playing) {
            cursor.rowDown(state.transport.get('step'));
          }
        }
        if (note < 96) {
          // Trigger note immediately if a VK note
          if (note in this.playing && this.playing[note] != null) {
            player.stopInteractiveInstrument(this.playing[note]);
            delete this.playing[note];
          }
          this.playing[note] = player.playNoteOnCurrentChannel(note, (instrument) => {
            player.stopInteractiveInstrument(instrument);
            if (this.playing[note] === instrument) {
              delete this.playing[note];
            }
          });
          this.noteDown(note);
        }
      },
      noteUp: (args) => {
        const note = args[0];
        if (note < 96) {
          if (!state.cursor.get('record')) {
            // If not recording, and a note is playing that matches, stop it.
            if (note in this.playing && this.playing[note] != null) {
              player.releaseInteractiveInstrument(this.playing[note]);
            }
            this.noteUp(note);

            return true;
          }
        }
        return false;
      },
    };
  }

  raise(eventName, ...args) {
    if (eventName in this.events) {
      this.events[eventName](args);
    }
  }
}

export const eventSystem = new EventSystem();