text:
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/**
 * @constructor
 * @extends {WebInspector.TimelineUIUtils}
 */
WebInspector.TracingTimelineUIUtils = function()
{
    WebInspector.TimelineUIUtils.call(this);
}

WebInspector.TracingTimelineUIUtils.prototype = {
    /**
     * @param {!WebInspector.TimelineModel.Record} record
     * @return {boolean}
     */
    isBeginFrame: function(record)
    {
        return record.type() === WebInspector.TracingTimelineModel.RecordType.BeginFrame;
    },

    /**
     * @param {!WebInspector.TimelineModel.Record} record
     * @return {boolean}
     */
    isProgram: function(record)
    {
        return record.type() === WebInspector.TracingTimelineModel.RecordType.Program;
    },

    /**
     * @param {string} recordType
     * @return {boolean}
     */
    isCoalescable: function(recordType)
    {
        return !!WebInspector.TracingTimelineUIUtils._coalescableRecordTypes[recordType];
    },

    /**
     * @param {!WebInspector.TimelineModel.Record} record
     * @return {boolean}
     */
    isEventDivider: function(record)
    {
        return WebInspector.TracingTimelineUIUtils.isMarkerEvent(record.traceEvent());
    },

    /**
     * @param {!WebInspector.TimelineModel.Record} record
     * @return {?Object}
     */
    countersForRecord: function(record)
    {
        return record.type() === WebInspector.TracingTimelineModel.RecordType.UpdateCounters ? record.data() : null;
    },

    /**
     * @param {!WebInspector.TimelineModel.Record} record
     * @return {?Object}
     */
    highlightQuadForRecord: function(record)
    {
        return record.traceEvent().highlightQuad || null;
    },

    /**
     * @param {!WebInspector.TimelineModel.Record} record
     * @return {string}
     */
    titleForRecord: function(record)
    {
        var event = record.traceEvent();
        return WebInspector.TracingTimelineUIUtils.eventTitle(event, record.timelineModel());
    },

    /**
     * @param {!WebInspector.TimelineModel.Record} record
     * @return {!WebInspector.TimelineCategory}
     */
    categoryForRecord: function(record)
    {
        return WebInspector.TracingTimelineUIUtils.eventStyle(record.traceEvent()).category;
    },

    /**
     * @param {!WebInspector.TimelineModel.Record} record
     * @param {!WebInspector.Linkifier} linkifier
     * @return {?Node}
     */
    buildDetailsNode: function(record, linkifier)
    {
        return WebInspector.TracingTimelineUIUtils.buildDetailsNodeForTraceEvent(record.traceEvent(), linkifier);
    },

    /**
     * @param {!WebInspector.TimelineModel.Record} record
     * @param {!WebInspector.TimelineModel} model
     * @param {!WebInspector.Linkifier} linkifier
     * @param {function(!DocumentFragment)} callback
     */
    generateDetailsContent: function(record, model, linkifier, callback)
    {
        if (!(model instanceof WebInspector.TracingTimelineModel))
            throw new Error("Illegal argument.");
        var tracingTimelineModel = /** @type {!WebInspector.TracingTimelineModel} */ (model);
        WebInspector.TracingTimelineUIUtils.buildTraceEventDetails(record.traceEvent(), tracingTimelineModel, linkifier, callback);
    },

    /**
     * @return {!Element}
     */
    createBeginFrameDivider: function()
    {
        return this.createEventDivider(WebInspector.TracingTimelineModel.RecordType.BeginFrame);
    },

    /**
     * @param {string} recordType
     * @param {string=} title
     * @return {!Element}
     */
    createEventDivider: function(recordType, title)
    {
        return WebInspector.TracingTimelineUIUtils._createEventDivider(recordType, title);
    },

    /**
     * @param {!WebInspector.TimelineModel.Record} record
     * @param {!RegExp} regExp
     * @return {boolean}
     */
    testContentMatching: function(record, regExp)
    {
        var traceEvent = record.traceEvent();
        var title = WebInspector.TracingTimelineUIUtils.eventStyle(traceEvent).title;
        var tokens = [title];
        for (var argName in traceEvent.args) {
            var argValue = traceEvent.args[argName];
            for (var key in argValue)
                tokens.push(argValue[key]);
        }
        return regExp.test(tokens.join("|"));
    },

    /**
     * @param {!Object} total
     * @param {!WebInspector.TimelineModel.Record} record
     */
    aggregateTimeForRecord: function(total, record)
    {
        var traceEvent = record.traceEvent();
        var model = record._model;
        WebInspector.TracingTimelineUIUtils._aggregatedStatsForTraceEvent(total, model, traceEvent);
    },

    /**
     * @return {!WebInspector.TimelineModel.Filter}
     */
    hiddenRecordsFilter: function()
    {
        return new WebInspector.TimelineRecordVisibleTypeFilter(WebInspector.TracingTimelineUIUtils._visibleTypes());
    },

    /**
     * @return {?WebInspector.TimelineModel.Filter}
     */
    hiddenEmptyRecordsFilter: function()
    {
        var hiddenEmptyRecords = [WebInspector.TimelineModel.RecordType.EventDispatch];
        return new WebInspector.TimelineRecordHiddenEmptyTypeFilter(hiddenEmptyRecords);
    },

    __proto__: WebInspector.TimelineUIUtils.prototype
}

/**
 * @constructor
 * @param {string} title
 * @param {!WebInspector.TimelineCategory} category
 * @param {boolean=} hidden
 */
WebInspector.TimelineRecordStyle = function(title, category, hidden)
{
    this.title = title;
    this.category = category;
    this.hidden = !!hidden;
}

/**
 * @return {!Object.<string, !WebInspector.TimelineRecordStyle>}
 */
WebInspector.TracingTimelineUIUtils._initEventStyles = function()
{
    if (WebInspector.TracingTimelineUIUtils._eventStylesMap)
        return WebInspector.TracingTimelineUIUtils._eventStylesMap;

    var recordTypes = WebInspector.TracingTimelineModel.RecordType;
    var categories = WebInspector.TimelineUIUtils.categories();

    var eventStyles = {};
    eventStyles[recordTypes.Program] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Other"), categories["other"]);
    eventStyles[recordTypes.EventDispatch] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Event"), categories["scripting"]);
    eventStyles[recordTypes.RequestMainThreadFrame] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Request Main Thread Frame"), categories["rendering"], true);
    eventStyles[recordTypes.BeginFrame] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Frame Start"), categories["rendering"], true);
    eventStyles[recordTypes.BeginMainThreadFrame] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Frame Start (main thread)"), categories["rendering"], true);
    eventStyles[recordTypes.DrawFrame] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Draw Frame"), categories["rendering"], true);
    eventStyles[recordTypes.ScheduleStyleRecalculation] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Schedule Style Recalculation"), categories["rendering"], true);
    eventStyles[recordTypes.RecalculateStyles] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Recalculate Style"), categories["rendering"]);
    eventStyles[recordTypes.InvalidateLayout] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Invalidate Layout"), categories["rendering"], true);
    eventStyles[recordTypes.Layout] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Layout"), categories["rendering"]);
    eventStyles[recordTypes.PaintSetup] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Paint Setup"), categories["painting"]);
    eventStyles[recordTypes.UpdateLayer] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Update Layer"), categories["painting"], true);
    eventStyles[recordTypes.UpdateLayerTree] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Update Layer Tree"), categories["rendering"]);
    eventStyles[recordTypes.Paint] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Paint"), categories["painting"]);
    eventStyles[recordTypes.RasterTask] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Paint"), categories["painting"]);
    eventStyles[recordTypes.ScrollLayer] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Scroll"), categories["rendering"]);
    eventStyles[recordTypes.CompositeLayers] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Composite Layers"), categories["painting"]);
    eventStyles[recordTypes.ParseHTML] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Parse HTML"), categories["loading"]);
    eventStyles[recordTypes.TimerInstall] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Install Timer"), categories["scripting"]);
    eventStyles[recordTypes.TimerRemove] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Remove Timer"), categories["scripting"]);
    eventStyles[recordTypes.TimerFire] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Timer Fired"), categories["scripting"]);
    eventStyles[recordTypes.XHRReadyStateChange] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("XHR Ready State Change"), categories["scripting"]);
    eventStyles[recordTypes.XHRLoad] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("XHR Load"), categories["scripting"]);
    eventStyles[recordTypes.EvaluateScript] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Evaluate Script"), categories["scripting"]);
    eventStyles[recordTypes.MarkLoad] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Load event"), categories["scripting"], true);
    eventStyles[recordTypes.MarkDOMContent] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("DOMContentLoaded event"), categories["scripting"], true);
    eventStyles[recordTypes.MarkFirstPaint] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("First paint"), categories["painting"], true);
    eventStyles[recordTypes.TimeStamp] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Timestamp"), categories["scripting"]);
    eventStyles[recordTypes.ConsoleTime] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Console Time"), categories["scripting"]);
    eventStyles[recordTypes.ResourceSendRequest] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Send Request"), categories["loading"]);
    eventStyles[recordTypes.ResourceReceiveResponse] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Receive Response"), categories["loading"]);
    eventStyles[recordTypes.ResourceFinish] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Finish Loading"), categories["loading"]);
    eventStyles[recordTypes.ResourceReceivedData] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Receive Data"), categories["loading"]);
    eventStyles[recordTypes.FunctionCall] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Function Call"), categories["scripting"]);
    eventStyles[recordTypes.GCEvent] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("GC Event"), categories["scripting"]);
    eventStyles[recordTypes.JSFrame] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("JS Frame"), categories["scripting"]);
    eventStyles[recordTypes.RequestAnimationFrame] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Request Animation Frame"), categories["scripting"]);
    eventStyles[recordTypes.CancelAnimationFrame] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Cancel Animation Frame"), categories["scripting"]);
    eventStyles[recordTypes.FireAnimationFrame] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Animation Frame Fired"), categories["scripting"]);
    eventStyles[recordTypes.WebSocketCreate] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Create WebSocket"), categories["scripting"]);
    eventStyles[recordTypes.WebSocketSendHandshakeRequest] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Send WebSocket Handshake"), categories["scripting"]);
    eventStyles[recordTypes.WebSocketReceiveHandshakeResponse] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Receive WebSocket Handshake"), categories["scripting"]);
    eventStyles[recordTypes.WebSocketDestroy] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Destroy WebSocket"), categories["scripting"]);
    eventStyles[recordTypes.EmbedderCallback] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Embedder Callback"), categories["scripting"]);
    eventStyles[recordTypes.DecodeImage] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Image Decode"), categories["painting"]);
    eventStyles[recordTypes.ResizeImage] = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Image Resize"), categories["painting"]);
    WebInspector.TracingTimelineUIUtils._eventStylesMap = eventStyles;
    return eventStyles;
}

WebInspector.TracingTimelineUIUtils._coalescableRecordTypes = {};
WebInspector.TracingTimelineUIUtils._coalescableRecordTypes[WebInspector.TracingTimelineModel.RecordType.Layout] = 1;
WebInspector.TracingTimelineUIUtils._coalescableRecordTypes[WebInspector.TracingTimelineModel.RecordType.Paint] = 1;
WebInspector.TracingTimelineUIUtils._coalescableRecordTypes[WebInspector.TracingTimelineModel.RecordType.RasterTask] = 1;
WebInspector.TracingTimelineUIUtils._coalescableRecordTypes[WebInspector.TracingTimelineModel.RecordType.DecodeImage] = 1;
WebInspector.TracingTimelineUIUtils._coalescableRecordTypes[WebInspector.TracingTimelineModel.RecordType.ResizeImage] = 1;

/**
 * @param {!WebInspector.TracingModel.Event} event
 * @return {!{title: string, category: !WebInspector.TimelineCategory}}
 */
WebInspector.TracingTimelineUIUtils.eventStyle = function(event)
{
    var eventStyles = WebInspector.TracingTimelineUIUtils._initEventStyles();
    if (event.category === WebInspector.TracingModel.ConsoleEventCategory)
        return { title: event.name, category: WebInspector.TimelineUIUtils.categories()["scripting"] };

    var result = eventStyles[event.name];
    if (!result) {
        result = new WebInspector.TimelineRecordStyle(WebInspector.UIString("Unknown: %s", event.name),  WebInspector.TimelineUIUtils.categories()["other"]);
        eventStyles[event.name] = result;
    }
    return result;
}

/**
 * @param {!WebInspector.TracingModel.Event} event
 * @return {string}
 */
WebInspector.TracingTimelineUIUtils.markerEventColor = function(event)
{
    var red = "rgb(255, 0, 0)";
    var blue = "rgb(0, 0, 255)";
    var orange = "rgb(255, 178, 23)";
    var green = "rgb(0, 130, 0)";

    if (event.category === WebInspector.TracingModel.ConsoleEventCategory)
        return orange;

    var recordTypes = WebInspector.TracingTimelineModel.RecordType;
    var eventName = event.name;
    switch (eventName) {
    case recordTypes.MarkDOMContent: return blue;
    case recordTypes.MarkLoad: return red;
    case recordTypes.MarkFirstPaint: return green;
    case recordTypes.TimeStamp: return orange;
    }
    return green;
}

/**
 * @param {!WebInspector.TracingModel.Event} event
 * @param {!WebInspector.TimelineModel} model
 * @return {string}
 */
WebInspector.TracingTimelineUIUtils.eventTitle = function(event, model)
{
    var title = WebInspector.TracingTimelineUIUtils.eventStyle(event).title;
    if (event.category === WebInspector.TracingModel.ConsoleEventCategory)
        return title;
    if (event.name === WebInspector.TracingTimelineModel.RecordType.TimeStamp)
        return WebInspector.UIString("%s: %s", title, event.args["data"]["message"]);
    if (WebInspector.TracingTimelineUIUtils.isMarkerEvent(event)) {
        var startTime = Number.millisToString(event.startTime - model.minimumRecordTime());
        return WebInspector.UIString("%s at %s", title, startTime);
    }
    return title;
}

/**
 * @param {!WebInspector.TracingModel.Event} event
 * @return {boolean}
 */
WebInspector.TracingTimelineUIUtils.isMarkerEvent = function(event)
{
    var recordTypes = WebInspector.TracingTimelineModel.RecordType;
    switch (event.name) {
    case recordTypes.TimeStamp:
    case recordTypes.MarkFirstPaint:
        return true;
    case recordTypes.MarkDOMContent:
    case recordTypes.MarkLoad:
        return event.args["data"]["isMainFrame"];
    default:
        return false;
    }
}

/**
 * @param {!WebInspector.TracingModel.Event} event
 * @param {!WebInspector.Linkifier} linkifier
 * @return {?Node}
 */
WebInspector.TracingTimelineUIUtils.buildDetailsNodeForTraceEvent = function(event, linkifier)
{
    var recordType = WebInspector.TracingTimelineModel.RecordType;
    var target = event.thread.target();
    var details;
    var detailsText;
    var eventData = event.args["data"];
    switch (event.name) {
    case recordType.GCEvent:
        var delta = event.args["usedHeapSizeBefore"] - event.args["usedHeapSizeAfter"];
        detailsText = WebInspector.UIString("%s collected", Number.bytesToString(delta));
        break;
    case recordType.TimerFire:
        detailsText = eventData["timerId"];
        break;
    case recordType.FunctionCall:
        details = linkifyLocation(eventData["scriptId"], eventData["scriptName"], eventData["scriptLine"], 0);
        break;
    case recordType.JSFrame:
        details = linkifyLocation(eventData["scriptId"], eventData["url"], eventData["lineNumber"], eventData["columnNumber"]);
        detailsText = WebInspector.CPUProfileDataModel.beautifyFunctionName(eventData["functionName"]);
        break;
    case recordType.FireAnimationFrame:
        detailsText = eventData["id"];
        break;
    case recordType.EventDispatch:
        detailsText = eventData ? eventData["type"] : null;
        break;
    case recordType.Paint:
        var width = WebInspector.TimelineUIUtils.quadWidth(eventData.clip);
        var height = WebInspector.TimelineUIUtils.quadHeight(eventData.clip);
        if (width && height)
            detailsText = WebInspector.UIString("%d\u2009\u00d7\u2009%d", width, height);
        break;
    case recordType.TimerInstall:
    case recordType.TimerRemove:
        details = linkifyTopCallFrame();
        detailsText = eventData["timerId"];
        break;
    case recordType.RequestAnimationFrame:
    case recordType.CancelAnimationFrame:
        details = linkifyTopCallFrame();
        detailsText = eventData["id"];
        break;
    case recordType.ParseHTML:
    case recordType.RecalculateStyles:
        details = linkifyTopCallFrame();
        break;
    case recordType.EvaluateScript:
        var url = eventData["url"];
        if (url)
            details = linkifyLocation("", url, eventData["lineNumber"], 0);
        break;
    case recordType.XHRReadyStateChange:
    case recordType.XHRLoad:
    case recordType.ResourceSendRequest:
        var url = eventData["url"];
        if (url)
            detailsText = WebInspector.displayNameForURL(url);
        break;
    case recordType.ResourceReceivedData:
    case recordType.ResourceReceiveResponse:
    case recordType.ResourceFinish:
        var initiator = event.initiator;
        if (initiator) {
            var url = initiator.args["data"]["url"];
            if (url)
                detailsText = WebInspector.displayNameForURL(url);
        }
        break;
    case recordType.EmbedderCallback:
        detailsText = eventData["callbackName"];
        break;

    case recordType.PaintImage:
    case recordType.DecodeImage:
    case recordType.ResizeImage:
    case recordType.DecodeLazyPixelRef:
            var url = event.imageURL;
            if (url)
                detailsText = WebInspector.displayNameForURL(url);
        break;

    default:
        if (event.category === WebInspector.TracingModel.ConsoleEventCategory)
            detailsText = null;
        else
            details = linkifyTopCallFrame();
        break;
    }

    if (detailsText) {
        if (details)
            details.textContent = detailsText;
        else
            details = document.createTextNode(detailsText);
    }
    return details;

    /**
     * @param {string} scriptId
     * @param {string} url
     * @param {number} lineNumber
     * @param {number=} columnNumber
     */
    function linkifyLocation(scriptId, url, lineNumber, columnNumber)
    {
        if (!url)
            return null;

        // FIXME(62725): stack trace line/column numbers are one-based.
        return linkifier.linkifyScriptLocation(target, scriptId, url, lineNumber - 1, (columnNumber ||1) - 1, "timeline-details");
    }

    /**
     * @return {?Element}
     */
    function linkifyTopCallFrame()
    {
        var stackTrace = event.stackTrace;
        if (!stackTrace) {
            var initiator = event.initiator;
            if (initiator)
                stackTrace = initiator.stackTrace;
        }
        if (!stackTrace || !stackTrace.length)
            return null;
        return linkifier.linkifyConsoleCallFrame(target, stackTrace[0], "timeline-details");
    }
}

/**
 * @param {!WebInspector.TracingModel.Event} event
 * @param {!WebInspector.TracingTimelineModel} model
 * @param {!WebInspector.Linkifier} linkifier
 * @param {function(!DocumentFragment)} callback
 */
WebInspector.TracingTimelineUIUtils.buildTraceEventDetails = function(event, model, linkifier, callback)
{
    var target = event.thread.target();
    var relatedNode = null;
    var barrier = new CallbackBarrier();
    if (!event.previewElement && target) {
        if (event.imageURL)
            WebInspector.DOMPresentationUtils.buildImagePreviewContents(target, event.imageURL, false, barrier.createCallback(saveImage));
        else if (event.picture)
            WebInspector.TracingTimelineUIUtils.buildPicturePreviewContent(event, barrier.createCallback(saveImage));
    }
    if (event.backendNodeId && target)
        target.domModel.pushNodesByBackendIdsToFrontend([event.backendNodeId], barrier.createCallback(setRelatedNode));
    barrier.callWhenDone(callbackWrapper);

    /**
     * @param {!Element=} element
     */
    function saveImage(element)
    {
        event.previewElement = element || null;
    }

    /**
     * @param {?Array.<!DOMAgent.NodeId>} nodeIds
     */
    function setRelatedNode(nodeIds)
    {
        if (nodeIds)
            relatedNode = target.domModel.nodeForId(nodeIds[0]);
    }

    function callbackWrapper()
    {
        callback(WebInspector.TracingTimelineUIUtils._buildTraceEventDetailsSynchronously(event, model, linkifier, relatedNode));
    }
}

/**
 * @param {!WebInspector.TracingModel.Event} event
 * @param {!WebInspector.TracingTimelineModel} model
 * @param {!WebInspector.Linkifier} linkifier
 * @param {?WebInspector.DOMNode} relatedNode
 * @return {!DocumentFragment}
 */
WebInspector.TracingTimelineUIUtils._buildTraceEventDetailsSynchronously = function(event, model, linkifier, relatedNode)
{
    var fragment = document.createDocumentFragment();
    var stats = {};
    var hasChildren = WebInspector.TracingTimelineUIUtils._aggregatedStatsForTraceEvent(stats, model, event);
    var pieChart = hasChildren ?
        WebInspector.TimelineUIUtils.generatePieChart(stats, WebInspector.TracingTimelineUIUtils.eventStyle(event).category, event.selfTime) :
        WebInspector.TimelineUIUtils.generatePieChart(stats);
    fragment.appendChild(pieChart);

    var recordTypes = WebInspector.TracingTimelineModel.RecordType;

    // The messages may vary per event.name;
    var callSiteStackTraceLabel;
    var callStackLabel;
    var relatedNodeLabel;

    var contentHelper = new WebInspector.TimelineDetailsContentHelper(event.thread.target(), linkifier, true);
    contentHelper.appendTextRow(WebInspector.UIString("Self Time"), Number.millisToString(event.selfTime, true));
    contentHelper.appendTextRow(WebInspector.UIString("Start Time"), Number.millisToString((event.startTime - model.minimumRecordTime())));
    var eventData = event.args["data"];
    var initiator = event.initiator;

    switch (event.name) {
    case recordTypes.GCEvent:
        var delta = event.args["usedHeapSizeBefore"] - event.args["usedHeapSizeAfter"];
        contentHelper.appendTextRow(WebInspector.UIString("Collected"), Number.bytesToString(delta));
        break;
    case recordTypes.TimerFire:
        callSiteStackTraceLabel = WebInspector.UIString("Timer installed");
        // Fall-through intended.

    case recordTypes.TimerInstall:
    case recordTypes.TimerRemove:
        contentHelper.appendTextRow(WebInspector.UIString("Timer ID"), eventData["timerId"]);
        if (event.name === recordTypes.TimerInstall) {
            contentHelper.appendTextRow(WebInspector.UIString("Timeout"), Number.millisToString(eventData["timeout"]));
            contentHelper.appendTextRow(WebInspector.UIString("Repeats"), !eventData["singleShot"]);
        }
        break;
    case recordTypes.FireAnimationFrame:
        callSiteStackTraceLabel = WebInspector.UIString("Animation frame requested");
        contentHelper.appendTextRow(WebInspector.UIString("Callback ID"), eventData["id"]);
        break;
    case recordTypes.FunctionCall:
        if (eventData["scriptName"])
            contentHelper.appendLocationRow(WebInspector.UIString("Location"), eventData["scriptName"], eventData["scriptLine"]);
        break;
    case recordTypes.ResourceSendRequest:
    case recordTypes.ResourceReceiveResponse:
    case recordTypes.ResourceReceivedData:
    case recordTypes.ResourceFinish:
        var url = (event.name === recordTypes.ResourceSendRequest) ? eventData["url"] : initiator.args["data"]["url"];
        if (url)
            contentHelper.appendElementRow(WebInspector.UIString("Resource"), WebInspector.linkifyResourceAsNode(url));
        if (eventData["requestMethod"])
            contentHelper.appendTextRow(WebInspector.UIString("Request Method"), eventData["requestMethod"]);
        if (typeof eventData["statusCode"] === "number")
            contentHelper.appendTextRow(WebInspector.UIString("Status Code"), eventData["statusCode"]);
        if (eventData["mimeType"])
            contentHelper.appendTextRow(WebInspector.UIString("MIME Type"), eventData["mimeType"]);
        if (eventData["encodedDataLength"])
            contentHelper.appendTextRow(WebInspector.UIString("Encoded Data Length"), WebInspector.UIString("%d Bytes", eventData["encodedDataLength"]));
        break;
    case recordTypes.EvaluateScript:
        var url = eventData["url"];
        if (url)
            contentHelper.appendLocationRow(WebInspector.UIString("Script"), url, eventData["lineNumber"]);
        break;
    case recordTypes.Paint:
        var clip = eventData["clip"];
        contentHelper.appendTextRow(WebInspector.UIString("Location"), WebInspector.UIString("(%d, %d)", clip[0], clip[1]));
        var clipWidth = WebInspector.TimelineUIUtils.quadWidth(clip);
        var clipHeight = WebInspector.TimelineUIUtils.quadHeight(clip);
        contentHelper.appendTextRow(WebInspector.UIString("Dimensions"), WebInspector.UIString("%d × %d", clipWidth, clipHeight));
        // Fall-through intended.

    case recordTypes.PaintSetup:
    case recordTypes.Rasterize:
    case recordTypes.ScrollLayer:
        relatedNodeLabel = WebInspector.UIString("Layer root");
        break;
    case recordTypes.PaintImage:
    case recordTypes.DecodeLazyPixelRef:
    case recordTypes.DecodeImage:
    case recordTypes.ResizeImage:
    case recordTypes.DrawLazyPixelRef:
        relatedNodeLabel = WebInspector.UIString("Image element");
        if (event.imageURL)
            contentHelper.appendElementRow(WebInspector.UIString("Image URL"), WebInspector.linkifyResourceAsNode(event.imageURL));
        break;
    case recordTypes.RecalculateStyles: // We don't want to see default details.
        contentHelper.appendTextRow(WebInspector.UIString("Elements affected"), event.args["elementCount"]);
        callStackLabel = WebInspector.UIString("Styles recalculation forced");
        break;
    case recordTypes.Layout:
        var beginData = event.args["beginData"];
        contentHelper.appendTextRow(WebInspector.UIString("Nodes that need layout"), beginData["dirtyObjects"]);
        contentHelper.appendTextRow(WebInspector.UIString("Layout tree size"), beginData["totalObjects"]);
        contentHelper.appendTextRow(WebInspector.UIString("Layout scope"),
                                    beginData["partialLayout"] ? WebInspector.UIString("Partial") : WebInspector.UIString("Whole document"));
        callSiteStackTraceLabel = WebInspector.UIString("Layout invalidated");
        callStackLabel = WebInspector.UIString("Layout forced");
        relatedNodeLabel = WebInspector.UIString("Layout root");
        break;
    case recordTypes.ConsoleTime:
        contentHelper.appendTextRow(WebInspector.UIString("Message"), event.name);
        break;
    case recordTypes.WebSocketCreate:
    case recordTypes.WebSocketSendHandshakeRequest:
    case recordTypes.WebSocketReceiveHandshakeResponse:
    case recordTypes.WebSocketDestroy:
        var initiatorData = initiator ? initiator.args["data"] : eventData;
        if (typeof initiatorData["webSocketURL"] !== "undefined")
            contentHelper.appendTextRow(WebInspector.UIString("URL"), initiatorData["webSocketURL"]);
        if (typeof initiatorData["webSocketProtocol"] !== "undefined")
            contentHelper.appendTextRow(WebInspector.UIString("WebSocket Protocol"), initiatorData["webSocketProtocol"]);
        if (typeof eventData["message"] !== "undefined")
            contentHelper.appendTextRow(WebInspector.UIString("Message"), eventData["message"]);
        break;
    case recordTypes.EmbedderCallback:
        contentHelper.appendTextRow(WebInspector.UIString("Callback Function"), eventData["callbackName"]);
        break;
    default:
        var detailsNode = WebInspector.TracingTimelineUIUtils.buildDetailsNodeForTraceEvent(event, linkifier);
        if (detailsNode)
            contentHelper.appendElementRow(WebInspector.UIString("Details"), detailsNode);
        break;
    }

    if (relatedNode)
        contentHelper.appendElementRow(relatedNodeLabel || WebInspector.UIString("Related node"), WebInspector.DOMPresentationUtils.linkifyNodeReference(relatedNode));

    if (eventData && eventData["scriptName"] && event.name !== recordTypes.FunctionCall)
        contentHelper.appendLocationRow(WebInspector.UIString("Function Call"), eventData["scriptName"], eventData["scriptLine"]);

    if (initiator) {
        var callSiteStackTrace = initiator.stackTrace;
        if (callSiteStackTrace)
            contentHelper.appendStackTrace(callSiteStackTraceLabel || WebInspector.UIString("Call Site stack"), callSiteStackTrace);
    }
    var eventStackTrace = event.stackTrace;
    if (eventStackTrace)
        contentHelper.appendStackTrace(callStackLabel || WebInspector.UIString("Call Stack"), eventStackTrace);

    var warning = event.warning;
    if (warning) {
        var div = document.createElement("div");
        div.textContent = warning;
        contentHelper.appendElementRow(WebInspector.UIString("Warning"), div);
    }
    if (event.previewElement)
        contentHelper.appendElementRow(WebInspector.UIString("Preview"), event.previewElement);
    fragment.appendChild(contentHelper.element);
    return fragment;
}

/**
 * @param {!Object} total
 * @param {!WebInspector.TracingTimelineModel} model
 * @param {!WebInspector.TracingModel.Event} event
 * @return {boolean}
 */
WebInspector.TracingTimelineUIUtils._aggregatedStatsForTraceEvent = function(total, model, event)
{
    var events = model.inspectedTargetEvents();
    /**
     * @param {number} startTime
     * @param {!WebInspector.TracingModel.Event} e
     * @return {number}
     */
    function eventComparator(startTime, e)
    {
        return startTime - e.startTime;
    }
    var index = events.binaryIndexOf(event.startTime, eventComparator);
    var hasChildren = false;
    var endTime = event.endTime;
    if (endTime) {
        for (var i = index; i < events.length; i++) {
            var nextEvent = events[i];
            if (nextEvent.startTime >= endTime)
                break;
            if (!nextEvent.selfTime)
                continue;
            if (nextEvent.thread !== event.thread)
                continue;
            if (i > index)
                hasChildren = true;
            var categoryName = WebInspector.TracingTimelineUIUtils.eventStyle(nextEvent).category.name;
            total[categoryName] = (total[categoryName] || 0) + nextEvent.selfTime;
        }
    }
    if (WebInspector.TracingModel.isAsyncPhase(event.phase)) {
        if (event.endTime) {
            var aggregatedTotal = 0;
            for (var categoryName in total)
                aggregatedTotal += total[categoryName];
            total["idle"] = Math.max(0, event.endTime - event.startTime - aggregatedTotal);
        }
        return false;
    }
    return hasChildren;
}

/**
 * @param {!WebInspector.TracingModel.Event} event
 * @param {function(!Element=)} callback
 */
WebInspector.TracingTimelineUIUtils.buildPicturePreviewContent = function(event, callback)
{

    new WebInspector.LayerPaintEvent(event).loadPicture(onSnapshotLoaded);
    /**
     * @param {?Array.<number>} rect
     * @param {?WebInspector.PaintProfilerSnapshot} snapshot
     */
    function onSnapshotLoaded(rect, snapshot)
    {
        if (!snapshot) {
            callback();
            return;
        }
        snapshot.requestImage(null, null, 1, onGotImage);
        snapshot.dispose();
    }

    /**
     * @param {string=} imageURL
     */
    function onGotImage(imageURL)
    {
        if (!imageURL) {
            callback();
            return;
        }
        var container = document.createElement("div");
        container.className = "image-preview-container";
        var img = container.createChild("img");
        img.src = imageURL;
        callback(container);
    }
}

/**
 * @param {string} recordType
 * @param {string=} title
 * @return {!Element}
 */
WebInspector.TracingTimelineUIUtils._createEventDivider = function(recordType, title)
{
    var eventDivider = document.createElement("div");
    eventDivider.className = "resources-event-divider";
    var recordTypes = WebInspector.TracingTimelineModel.RecordType;

    if (recordType === recordTypes.MarkDOMContent)
        eventDivider.className += " resources-blue-divider";
    else if (recordType === recordTypes.MarkLoad)
        eventDivider.className += " resources-red-divider";
    else if (recordType === recordTypes.MarkFirstPaint)
        eventDivider.className += " resources-green-divider";
    else if (recordType === recordTypes.TimeStamp || recordType === recordTypes.ConsoleTime)
        eventDivider.className += " resources-orange-divider";
    else if (recordType === recordTypes.BeginFrame)
        eventDivider.className += " timeline-frame-divider";

    if (title)
        eventDivider.title = title;

    return eventDivider;
}

/**
 * @return {!Array.<string>}
 */
WebInspector.TracingTimelineUIUtils._visibleTypes = function()
{
    var eventStyles = WebInspector.TracingTimelineUIUtils._initEventStyles();
    var result = [];
    for (var name in eventStyles) {
        if (!eventStyles[name].hidden)
            result.push(name);
    }
    return result;
}

/**
 * @return {!WebInspector.TracingTimelineModel.Filter}
 */
WebInspector.TracingTimelineUIUtils.hiddenEventsFilter = function()
{
    return new WebInspector.TracingTimelineModel.InclusiveEventNameFilter(WebInspector.TracingTimelineUIUtils._visibleTypes());
}


text:
import lasagne
from lasagne.layers import cuda_convnet
import numpy as np
import theano
import theano.tensor as T

import base
import game2048
from astropy.units import act

class NetworkAgent(base.Agent):
  def __init__(self, network):
    inp_layer = lasagne.layers.get_all_layers(network)[0]
    self.shape = inp_layer.shape
    states = T.tensor4('states')
    self.state_shared = theano.shared(np.zeros(self.shape,
                                               dtype=theano.config.floatX))

    q_out = lasagne.layers.get_output(network, states)
    self.q_func = theano.function([], q_out, givens={states: self.state_shared})

  def ChooseAction(self, state):
    # here [0] stands for the first element in batch
    inp = np.zeros(self.shape, dtype=theano.config.floatX)
    inp[0, ...] = state
    self.state_shared.set_value(inp)
    vals = self.q_func()[0]
    return np.argmax(vals)

def Build2048Network(batch_size):
  inp = lasagne.layers.InputLayer(shape=(batch_size, 1, 4, 4))
  conv1 = cuda_convnet.Conv2DCCLayer(inp, num_filters=16,
                                     filter_size=(2, 2), stride=(1, 1),
                                     nonlinearity=lasagne.nonlinearities.rectify,
                                     border_mode='valid', W=lasagne.init.HeUniform(),
                                     b=lasagne.init.Constant(.1))
  conv2 = cuda_convnet.Conv2DCCLayer(conv1, num_filters=32,
                                     filter_size=(2, 2), stride=(1, 1),
                                     nonlinearity=lasagne.nonlinearities.rectify,
                                     border_mode='valid', W=lasagne.init.HeUniform(),
                                     b=lasagne.init.Constant(.1))
  hidden = lasagne.layers.DenseLayer(conv2, 64, nonlinearity=lasagne.nonlinearities.rectify,
                                     W=lasagne.init.HeUniform(), b=lasagne.init.Constant(.1))
  out = lasagne.layers.DenseLayer(hidden, 4, nonlinearity=None,
                                  W=lasagne.init.HeUniform(), b=lasagne.init.Constant(.1))
  return out

if __name__ == "__main__":
  game = game2048.Game2048()
  network = Build2048Network(32)
  agent = NetworkAgent(network)

  act = agent.ChooseAction(game.GetState())
  print act
  print game.ProcessAction(act)
  act = agent.ChooseAction(game.GetState())
  print act
  print game.ProcessAction(act)

redpajama_set_name: RedPajamaGithub


text:
class msvidctl_msvidgenericsink_1 {
    constructor() {
    }

}

module.exports = msvidctl_msvidgenericsink_1;


text:
function publish()
{
        for (i = 1; i <= 1000; i++) {
          mqttspy.publish("trigger1", "{\"value\": " + i + "}", 1, false);
        }
        // This means all OK, script has completed without any issues and as expected
        return true;
}

publish();


text:
from enum import Enum
from azure.core import CaseInsensitiveEnumMeta

class AgentPoolMode(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """AgentPoolMode represents mode of an agent pool."""

    SYSTEM = "System"
    USER = "User"

class AgentPoolType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """AgentPoolType represents types of an agent pool."""

    VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets"
    AVAILABILITY_SET = "AvailabilitySet"

class Code(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Tells whether the cluster is Running or Stopped."""

    RUNNING = "Running"
    STOPPED = "Stopped"

class ConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """The private link service connection status."""

    PENDING = "Pending"
    APPROVED = "Approved"
    REJECTED = "Rejected"
    DISCONNECTED = "Disconnected"

class ContainerServiceStorageProfileTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Storage profile specifies what kind of storage used. Choose from StorageAccount and
    ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice.
    """

    STORAGE_ACCOUNT = "StorageAccount"
    MANAGED_DISKS = "ManagedDisks"

class ContainerServiceVMSizeTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Size of agent VMs."""

    STANDARD_A1 = "Standard_A1"
    STANDARD_A10 = "Standard_A10"
    STANDARD_A11 = "Standard_A11"
    STANDARD_A1_V2 = "Standard_A1_v2"
    STANDARD_A2 = "Standard_A2"
    STANDARD_A2_V2 = "Standard_A2_v2"
    STANDARD_A2_M_V2 = "Standard_A2m_v2"
    STANDARD_A3 = "Standard_A3"
    STANDARD_A4 = "Standard_A4"
    STANDARD_A4_V2 = "Standard_A4_v2"
    STANDARD_A4_M_V2 = "Standard_A4m_v2"
    STANDARD_A5 = "Standard_A5"
    STANDARD_A6 = "Standard_A6"
    STANDARD_A7 = "Standard_A7"
    STANDARD_A8 = "Standard_A8"
    STANDARD_A8_V2 = "Standard_A8_v2"
    STANDARD_A8_M_V2 = "Standard_A8m_v2"
    STANDARD_A9 = "Standard_A9"
    STANDARD_B2_MS = "Standard_B2ms"
    STANDARD_B2_S = "Standard_B2s"
    STANDARD_B4_MS = "Standard_B4ms"
    STANDARD_B8_MS = "Standard_B8ms"
    STANDARD_D1 = "Standard_D1"
    STANDARD_D11 = "Standard_D11"
    STANDARD_D11_V2 = "Standard_D11_v2"
    STANDARD_D11_V2_PROMO = "Standard_D11_v2_Promo"
    STANDARD_D12 = "Standard_D12"
    STANDARD_D12_V2 = "Standard_D12_v2"
    STANDARD_D12_V2_PROMO = "Standard_D12_v2_Promo"
    STANDARD_D13 = "Standard_D13"
    STANDARD_D13_V2 = "Standard_D13_v2"
    STANDARD_D13_V2_PROMO = "Standard_D13_v2_Promo"
    STANDARD_D14 = "Standard_D14"
    STANDARD_D14_V2 = "Standard_D14_v2"
    STANDARD_D14_V2_PROMO = "Standard_D14_v2_Promo"
    STANDARD_D15_V2 = "Standard_D15_v2"
    STANDARD_D16_V3 = "Standard_D16_v3"
    STANDARD_D16_S_V3 = "Standard_D16s_v3"
    STANDARD_D1_V2 = "Standard_D1_v2"
    STANDARD_D2 = "Standard_D2"
    STANDARD_D2_V2 = "Standard_D2_v2"
    STANDARD_D2_V2_PROMO = "Standard_D2_v2_Promo"
    STANDARD_D2_V3 = "Standard_D2_v3"
    STANDARD_D2_S_V3 = "Standard_D2s_v3"
    STANDARD_D3 = "Standard_D3"
    STANDARD_D32_V3 = "Standard_D32_v3"
    STANDARD_D32_S_V3 = "Standard_D32s_v3"
    STANDARD_D3_V2 = "Standard_D3_v2"
    STANDARD_D3_V2_PROMO = "Standard_D3_v2_Promo"
    STANDARD_D4 = "Standard_D4"
    STANDARD_D4_V2 = "Standard_D4_v2"
    STANDARD_D4_V2_PROMO = "Standard_D4_v2_Promo"
    STANDARD_D4_V3 = "Standard_D4_v3"
    STANDARD_D4_S_V3 = "Standard_D4s_v3"
    STANDARD_D5_V2 = "Standard_D5_v2"
    STANDARD_D5_V2_PROMO = "Standard_D5_v2_Promo"
    STANDARD_D64_V3 = "Standard_D64_v3"
    STANDARD_D64_S_V3 = "Standard_D64s_v3"
    STANDARD_D8_V3 = "Standard_D8_v3"
    STANDARD_D8_S_V3 = "Standard_D8s_v3"
    STANDARD_DS1 = "Standard_DS1"
    STANDARD_DS11 = "Standard_DS11"
    STANDARD_DS11_V2 = "Standard_DS11_v2"
    STANDARD_DS11_V2_PROMO = "Standard_DS11_v2_Promo"
    STANDARD_DS12 = "Standard_DS12"
    STANDARD_DS12_V2 = "Standard_DS12_v2"
    STANDARD_DS12_V2_PROMO = "Standard_DS12_v2_Promo"
    STANDARD_DS13 = "Standard_DS13"
    STANDARD_DS13_2_V2 = "Standard_DS13-2_v2"
    STANDARD_DS13_4_V2 = "Standard_DS13-4_v2"
    STANDARD_DS13_V2 = "Standard_DS13_v2"
    STANDARD_DS13_V2_PROMO = "Standard_DS13_v2_Promo"
    STANDARD_DS14 = "Standard_DS14"
    STANDARD_DS14_4_V2 = "Standard_DS14-4_v2"
    STANDARD_DS14_8_V2 = "Standard_DS14-8_v2"
    STANDARD_DS14_V2 = "Standard_DS14_v2"
    STANDARD_DS14_V2_PROMO = "Standard_DS14_v2_Promo"
    STANDARD_DS15_V2 = "Standard_DS15_v2"
    STANDARD_DS1_V2 = "Standard_DS1_v2"
    STANDARD_DS2 = "Standard_DS2"
    STANDARD_DS2_V2 = "Standard_DS2_v2"
    STANDARD_DS2_V2_PROMO = "Standard_DS2_v2_Promo"
    STANDARD_DS3 = "Standard_DS3"
    STANDARD_DS3_V2 = "Standard_DS3_v2"
    STANDARD_DS3_V2_PROMO = "Standard_DS3_v2_Promo"
    STANDARD_DS4 = "Standard_DS4"
    STANDARD_DS4_V2 = "Standard_DS4_v2"
    STANDARD_DS4_V2_PROMO = "Standard_DS4_v2_Promo"
    STANDARD_DS5_V2 = "Standard_DS5_v2"
    STANDARD_DS5_V2_PROMO = "Standard_DS5_v2_Promo"
    STANDARD_E16_V3 = "Standard_E16_v3"
    STANDARD_E16_S_V3 = "Standard_E16s_v3"
    STANDARD_E2_V3 = "Standard_E2_v3"
    STANDARD_E2_S_V3 = "Standard_E2s_v3"
    STANDARD_E32_16_S_V3 = "Standard_E32-16s_v3"
    STANDARD_E32_8_S_V3 = "Standard_E32-8s_v3"
    STANDARD_E32_V3 = "Standard_E32_v3"
    STANDARD_E32_S_V3 = "Standard_E32s_v3"
    STANDARD_E4_V3 = "Standard_E4_v3"
    STANDARD_E4_S_V3 = "Standard_E4s_v3"
    STANDARD_E64_16_S_V3 = "Standard_E64-16s_v3"
    STANDARD_E64_32_S_V3 = "Standard_E64-32s_v3"
    STANDARD_E64_V3 = "Standard_E64_v3"
    STANDARD_E64_S_V3 = "Standard_E64s_v3"
    STANDARD_E8_V3 = "Standard_E8_v3"
    STANDARD_E8_S_V3 = "Standard_E8s_v3"
    STANDARD_F1 = "Standard_F1"
    STANDARD_F16 = "Standard_F16"
    STANDARD_F16_S = "Standard_F16s"
    STANDARD_F16_S_V2 = "Standard_F16s_v2"
    STANDARD_F1_S = "Standard_F1s"
    STANDARD_F2 = "Standard_F2"
    STANDARD_F2_S = "Standard_F2s"
    STANDARD_F2_S_V2 = "Standard_F2s_v2"
    STANDARD_F32_S_V2 = "Standard_F32s_v2"
    STANDARD_F4 = "Standard_F4"
    STANDARD_F4_S = "Standard_F4s"
    STANDARD_F4_S_V2 = "Standard_F4s_v2"
    STANDARD_F64_S_V2 = "Standard_F64s_v2"
    STANDARD_F72_S_V2 = "Standard_F72s_v2"
    STANDARD_F8 = "Standard_F8"
    STANDARD_F8_S = "Standard_F8s"
    STANDARD_F8_S_V2 = "Standard_F8s_v2"
    STANDARD_G1 = "Standard_G1"
    STANDARD_G2 = "Standard_G2"
    STANDARD_G3 = "Standard_G3"
    STANDARD_G4 = "Standard_G4"
    STANDARD_G5 = "Standard_G5"
    STANDARD_GS1 = "Standard_GS1"
    STANDARD_GS2 = "Standard_GS2"
    STANDARD_GS3 = "Standard_GS3"
    STANDARD_GS4 = "Standard_GS4"
    STANDARD_GS4_4 = "Standard_GS4-4"
    STANDARD_GS4_8 = "Standard_GS4-8"
    STANDARD_GS5 = "Standard_GS5"
    STANDARD_GS5_16 = "Standard_GS5-16"
    STANDARD_GS5_8 = "Standard_GS5-8"
    STANDARD_H16 = "Standard_H16"
    STANDARD_H16_M = "Standard_H16m"
    STANDARD_H16_MR = "Standard_H16mr"
    STANDARD_H16_R = "Standard_H16r"
    STANDARD_H8 = "Standard_H8"
    STANDARD_H8_M = "Standard_H8m"
    STANDARD_L16_S = "Standard_L16s"
    STANDARD_L32_S = "Standard_L32s"
    STANDARD_L4_S = "Standard_L4s"
    STANDARD_L8_S = "Standard_L8s"
    STANDARD_M128_32_MS = "Standard_M128-32ms"
    STANDARD_M128_64_MS = "Standard_M128-64ms"
    STANDARD_M128_MS = "Standard_M128ms"
    STANDARD_M128_S = "Standard_M128s"
    STANDARD_M64_16_MS = "Standard_M64-16ms"
    STANDARD_M64_32_MS = "Standard_M64-32ms"
    STANDARD_M64_MS = "Standard_M64ms"
    STANDARD_M64_S = "Standard_M64s"
    STANDARD_NC12 = "Standard_NC12"
    STANDARD_NC12_S_V2 = "Standard_NC12s_v2"
    STANDARD_NC12_S_V3 = "Standard_NC12s_v3"
    STANDARD_NC24 = "Standard_NC24"
    STANDARD_NC24_R = "Standard_NC24r"
    STANDARD_NC24_RS_V2 = "Standard_NC24rs_v2"
    STANDARD_NC24_RS_V3 = "Standard_NC24rs_v3"
    STANDARD_NC24_S_V2 = "Standard_NC24s_v2"
    STANDARD_NC24_S_V3 = "Standard_NC24s_v3"
    STANDARD_NC6 = "Standard_NC6"
    STANDARD_NC6_S_V2 = "Standard_NC6s_v2"
    STANDARD_NC6_S_V3 = "Standard_NC6s_v3"
    STANDARD_ND12_S = "Standard_ND12s"
    STANDARD_ND24_RS = "Standard_ND24rs"
    STANDARD_ND24_S = "Standard_ND24s"
    STANDARD_ND6_S = "Standard_ND6s"
    STANDARD_NV12 = "Standard_NV12"
    STANDARD_NV24 = "Standard_NV24"
    STANDARD_NV6 = "Standard_NV6"

class Count(int, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The
    default value is 1.
    """

    ONE = 1
    THREE = 3
    FIVE = 5

class Expander(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Expander."""

    LEAST_WASTE = "least-waste"
    MOST_PODS = "most-pods"
    RANDOM = "random"

class LicenseType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """The licenseType to use for Windows VMs. Windows_Server is used to enable Azure Hybrid User
    Benefits for Windows VMs.
    """

    NONE = "None"
    WINDOWS_SERVER = "Windows_Server"

class LoadBalancerSku(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """The load balancer sku for the managed cluster."""

    STANDARD = "standard"
    BASIC = "basic"

class ManagedClusterSKUName(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Name of a managed cluster SKU."""

    BASIC = "Basic"

class ManagedClusterSKUTier(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Tier of a managed cluster SKU."""

    PAID = "Paid"
    FREE = "Free"

class NetworkMode(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Network mode used for building Kubernetes network."""

    TRANSPARENT = "transparent"
    BRIDGE = "bridge"

class NetworkPlugin(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Network plugin used for building Kubernetes network."""

    AZURE = "azure"
    KUBENET = "kubenet"

class NetworkPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """Network policy used for building Kubernetes network."""

    CALICO = "calico"
    AZURE = "azure"

class OSDiskType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """OSDiskType represents the type of an OS disk on an agent pool."""

    MANAGED = "Managed"
    EPHEMERAL = "Ephemeral"

class OSType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux."""

    LINUX = "Linux"
    WINDOWS = "Windows"

class OutboundType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """The outbound (egress) routing method."""

    LOAD_BALANCER = "loadBalancer"
    USER_DEFINED_ROUTING = "userDefinedRouting"

class PrivateEndpointConnectionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """The current provisioning state."""

    SUCCEEDED = "Succeeded"
    CREATING = "Creating"
    DELETING = "Deleting"
    FAILED = "Failed"

class ResourceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly
    created identity in master components and an auto-created user assigned identity in MC_
    resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service
    principal will be used instead.
    """

    SYSTEM_ASSIGNED = "SystemAssigned"
    USER_ASSIGNED = "UserAssigned"
    NONE = "None"

class ScaleSetEvictionPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale
    set. Default to Delete.
    """

    DELETE = "Delete"
    DEALLOCATE = "Deallocate"

class ScaleSetPriority(str, Enum, metaclass=CaseInsensitiveEnumMeta):
    """ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular."""

    SPOT = "Spot"
    REGULAR = "Regular"


text:
var path = require("path"),
    child_process = require("child_process"),
    fs = require("fs"),
    clientModules = path.join(__dirname, "client-modules"),
    output = path.join(__dirname, "public", "bundle.js")

function readFiles(dir) {
    fs.readdir(dir, function (err, files) {
        //console.log("reading files", files)
        files.forEach(function (file) {
            file = path.join(dir, file)
            //console.log("stat", file)
            fs.stat(file, function (err, stat) {
                if (err) {
                    console.log(err)
                }
                if (stat.isDirectory()) {
                    readFiles(file)
                } else if (stat.isFile()) {
                    fs.watchFile(file, build)
                }
            })
        })
    })
}

function build() {
    console.log("building")
    child_process.exec("make ncore")
}

readFiles(clientModules)
build()


text:
namespace Nancy.ViewEngines.Razor.VisualBasic
{
    using System;
    using System.CodeDom;
    using System.Web.Razor;
    using System.Web.Razor.Generator;
    using System.Web.Razor.Parser.SyntaxTree;

    /// <summary>
    /// A nancy version of the visual basic code generator for razor.
    /// </summary>
    public class NancyVisualBasicRazorCodeGenerator : VBRazorCodeGenerator
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="NancyVisualBasicRazorCodeGenerator"/> class.
        /// </summary>
        /// <param name="className">Name of the class.</param>
        /// <param name="rootNamespaceName">Name of the root namespace.</param>
        /// <param name="sourceFileName">Name of the source file.</param>
        /// <param name="host">The host.</param>
        public NancyVisualBasicRazorCodeGenerator(string className, string rootNamespaceName, string sourceFileName, RazorEngineHost host)
            : base(className, rootNamespaceName, sourceFileName, host)
		{
            this.SetBaseType(typeof(object).FullName);
        }

		protected override bool TryVisitSpecialSpan(Span span)
		{
			return RazorCodeGenerator.TryVisit<ModelSpan>(span, new Action<ModelSpan>(this.VisitModelSpan));
		}

		private void VisitModelSpan(ModelSpan span)
		{
			this.SetBaseType(span.ModelTypeName);
		}

        private void SetBaseType(string modelTypeName)
        {
            this.GeneratedClass.BaseTypes.Clear();
            this.GeneratedClass.BaseTypes.Add(new CodeTypeReference(this.Host.DefaultBaseClass + "(Of " + modelTypeName + ")"));
        }
    }
}


text:
---
layout: video_sample
title: Prebid Video | Video Outstream Example with  Radiant Media Player
description: An example of an outstream video with a pre-roll ad using Prebid.js and Radiant Media Player.
videoType: pb-os-rd
isVideo: true
sidebarType: 4
---

{{ page.title }}

{{page.description }}

Important:
			This example uses a test version of Prebid.js hosted on our CDN that is not recommended for production use. It includes all available adapters. Production implementations should build from source or customize the build using the Download page to make sure only the necessary bidder adapters are included.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?

Warning:
			Do not forget to exchange the placementId in the code examples with your own placementId!

Place this code in the page header.

<!--radiant code-->
<script src="https://cdn.radiantmediatechs.com/rmp/5.5.6/js/rmp.debug.js"></script>

Place this code in the page body.

<script>
	/* our app where we run player
   our app variables */
		var pbjs;
		pbjs = pbjs || {};
		pbjs.que = pbjs.que || [];
		var debug = false;
		if (typeof window.console === 'undefined' || typeof window.console.log === 'undefined' || typeof window.console.dir === 'undefined') {
		  debug = false;
		}
		var videoId = 'video1';

		/* Prebid video ad unit
		   This is a working example but you must use your own settings/bidders for production
		   More docs at https://prebid.org/prebid-video/video-overview.html */
		var adUnits = [{
		  code: videoId,
		  mediaTypes: {
		    video: {
		      playerSize: [640, 480],
		      context: 'outstream'
		    }
		  },
		  bids: [{
		    bidder: 'appnexus',
		    params: {
		      placementId: 13232385,
		      video: {
		        skippable: true,
		        playback_method: ['auto_play_sound_off']
		      }
		    }
		  }]
		}];

		pbjs.que.push(function () {
		  pbjs.addAdUnits(adUnits);
		  pbjs.requestBids({
		    timeout: 1000,
		    bidsBackHandler: function (bids) {
		      if (debug) {
		        window.console.dir(bids);
		      }
		      // we get the VAST XML from bids adResponse and pass it to our outstream player
		      if (bids && bids[videoId] && bids[videoId].bids && bids[videoId].bids[0] && bids[videoId].bids[0].adResponse) {
		        var adResponse = bids[videoId].bids[0].adResponse;
		        if (adResponse.ad && adResponse.ad.video && typeof adResponse.ad.video.content === 'string') {
		          var vastXml = bids[videoId].bids[0].adResponse.ad.video.content;
		          if (vastXml !== '') {
		            if (debug) {
		              window.console.log(vastXml);
		            }
		            var settings = {
		              licenseKey: 'Kl8lZ292K3N6MmVvZD9yb201ZGFzaXMzMGRiMEElXyo=',
		              width: 640,
		              height: 360,
		              autoplay: true,
		              adOutStreamMutedAutoplay: true,
		              ads: true,
		              adsResponse: vastXml,
		              adOutStream: true,
		              skin: 'outstream'
		            };
		            var elementID = 'rmpPlayer';
		            var rmp = new RadiantMP(elementID);
		            rmp.init(settings);
		          }
		        }
		      }
		    }
		  });
		});
</script>


text:
package com.stratio.crossdata.connector.elasticsearch

import java.util.{GregorianCalendar, UUID}

import com.sksamuel.elastic4s.{ElasticClient, ElasticsearchClientUri}
import com.sksamuel.elastic4s.ElasticDsl._
import com.sksamuel.elastic4s.mappings.FieldType._
import com.sksamuel.elastic4s.mappings.{MappingDefinition, TypedFieldDefinition}
import com.stratio.common.utils.components.logger.impl.SparkLoggerComponent
import com.typesafe.config.ConfigFactory
import org.apache.spark.sql.Row
import org.apache.spark.sql.catalyst.expressions.GenericRowWithSchema
import org.apache.spark.sql.crossdata.test.SharedXDContextWithDataTest
import org.apache.spark.sql.crossdata.test.SharedXDContextWithDataTest.SparkTable
import org.elasticsearch.common.settings.Settings
import org.scalatest.Suite
import org.joda.time.DateTime

import scala.util.Try

//TODO: Use `SharedXDContextTypesTest` types test and template.
trait ElasticDataTypesWithSharedContext extends SharedXDContextWithDataTest with ElasticSearchDataTypesDefaultConstants with SparkLoggerComponent {
  this: Suite =>

  override type ClientParams = ElasticClient
  override val provider: String = SourceProvider

  override val defaultOptions = Map(
    "resource" -> s"$Index/$Type",
    "es.nodes" -> s"$ElasticHost",
    "es.port" -> s"$ElasticRestPort",
    "es.nativePort" -> s"$ElasticNativePort",
    "es.cluster" -> s"$ElasticClusterName",
    "es.nodes.wan.only" -> "true"
  )

  case class ESColumnMetadata(fieldName: String, sparkSqlType: String, elasticType: TypedFieldDefinition, data: () => Any, typeValidation: Any => Unit)

  val dataTest = Seq(
    ESColumnMetadata("id", "INT", "id" typed IntegerType, () => 1, _ shouldBe a[java.lang.Integer]),
    ESColumnMetadata("age", "LONG", "age" typed LongType, () => 1, _ shouldBe a[java.lang.Long]),
    ESColumnMetadata("description", "STRING", "description" typed StringType, () => "1", _ shouldBe a[java.lang.String]),
    ESColumnMetadata("name", "STRING", "name" typed StringType index NotAnalyzed, () => "1", _ shouldBe a[java.lang.String]),
    ESColumnMetadata("enrolled", "BOOLEAN", "enrolled" typed BooleanType, () => false, _ shouldBe a[java.lang.Boolean]),
    ESColumnMetadata("birthday", "DATE", "birthday" typed DateType, () => DateTime.parse(1980 + "-01-01T10:00:00-00:00").toDate, _ shouldBe a [java.sql.Date]),
    ESColumnMetadata("salary", "DOUBLE", "salary" typed DoubleType, () => 0.15, _ shouldBe a[java.lang.Double]),
    ESColumnMetadata("timecol", "TIMESTAMP", "timecol" typed DateType, () => new java.sql.Timestamp(new GregorianCalendar(1970, 0, 1, 0, 0, 0).getTimeInMillis), _ shouldBe a[java.sql.Timestamp]),
    ESColumnMetadata("float", "FLOAT", "float" typed FloatType, () => 0.15, _ shouldBe a[java.lang.Float]),
    ESColumnMetadata("binary", "BINARY", "binary" typed BinaryType, () => "YWE=".getBytes, x => x
      .isInstanceOf[Array[Byte]] shouldBe true),
    ESColumnMetadata("tinyint", "TINYINT", "tinyint" typed ByteType, () => Byte.MinValue, _ shouldBe a[java.lang.Byte]),
    ESColumnMetadata("smallint", "SMALLINT", "smallint" typed ShortType, () => Short.MaxValue, _ shouldBe a[java.lang.Short]),
    ESColumnMetadata("subdocument", "STRUCT<field1: INT>", "subdocument"  inner ("field1" typed IntegerType), () => Map( "field1" -> 15), _ shouldBe a [Row]),
    ESColumnMetadata(
      "deepsubdocument",
      "STRUCT<field1: INT, nested: STRUCT<field2: INT>>",
      "deepsubdocument" inner ("field1" typed IntegerType, "nested" inner("field2" typed IntegerType))
      , () => Map("field1" -> 15, "nested" -> Map("field2" -> 42)), { res =>
        res shouldBe a[GenericRowWithSchema]
        res.asInstanceOf[GenericRowWithSchema].get(1) shouldBe a[GenericRowWithSchema]
      }
    )
  )

  override protected def saveTestData: Unit = for (a <- 1 to 1) {
    client.get.execute {
      index into Index / Type fields( dataTest.map( colMetadata => (colMetadata.fieldName,colMetadata.data())): _*)
    }.await
    client.get.execute {
      flush index Index
    }.await
  }

  override protected def terminateClient: Unit = client.get.close()

  override protected def cleanTestData: Unit = cleanTestData(client.get, Index)

  //Template steps: Override them
  override protected def prepareClient: Option[ClientParams] = Try {
    logInfo(s"Connection to elastic search, ElasticHost: $ElasticHost, ElasticNativePort:$ElasticNativePort, ElasticClusterName $ElasticClusterName")
    val settings = Settings.settingsBuilder().put("cluster.name", ElasticClusterName).build()
    val elasticClient = ElasticClient.transport(settings, ElasticsearchClientUri(ElasticHost, ElasticNativePort))
    createIndex(elasticClient, Index, typeMapping())
    elasticClient
  } toOption

  override def sparkRegisterTableSQL: Seq[SparkTable] = super.sparkRegisterTableSQL :+
    str2sparkTableDesc(
      s"CREATE TEMPORARY TABLE $Type ( ${fieldAndSparkType() mkString "," })"
    )

  override val runningError: String = "ElasticSearch and Spark must be up and running"

  def createIndex(elasticClient: ElasticClient, indexName:String, mappings:MappingDefinition): Unit ={
    val command = Option(mappings).fold(create index indexName)(create index indexName mappings _)
    elasticClient.execute {command}.await
  }

  def fieldAndSparkType(): Seq[String] = {
    Seq( dataTest.map(colMetadata => s"${colMetadata.fieldName}  ${colMetadata.sparkSqlType}") : _*)
  }

  def typeMapping(): MappingDefinition ={
    mapping(Type) fields (
      dataTest.map(_.elasticType) :_*
      )
  }

  def cleanTestData(elasticClient: ElasticClient, indexName:String): Unit = {
    elasticClient.execute {
      deleteIndex(indexName)
    }
  }

}

trait ElasticSearchDataTypesDefaultConstants extends ElasticSearchDefaultConstants{
  private lazy val config = ConfigFactory.load()
  override val Index = s"idxname${UUID.randomUUID.toString.replaceAll("-", "")}"
  override val Type = s"typename${UUID.randomUUID.toString.replaceAll("-", "")}"

}


text:
  obj->Set(v8::String::NewSymbol(name),                                       \
           v8::FunctionTemplate::New(callback)->GetFunction())

#define LXJS_SET_PROTO_METHOD(templ, name, callback)                          \
do {                                                                          \
  v8::Local<v8::Signature> __callback##_SIG = v8::Signature::New(templ);      \
  v8::Local<v8::FunctionTemplate> __callback##_TEM =                          \
    v8::FunctionTemplate::New(callback,                                       \
                              v8::Handle<v8::Value>(),                        \
                              __callback##_SIG);                              \
  templ->PrototypeTemplate()->Set(v8::String::NewSymbol(name),                \
                                  __callback##_TEM);                          \
} while (0)

#define LIBXMLJS_THROW_EXCEPTION(err)                                         \
  v8::Local<v8::Value> exception = v8::Exception::TypeError(                  \
    v8::String::New(err));                                                    \
  ThrowException(exception);

#define LIBXMLJS_ARGUMENT_TYPE_CHECK(arg, type, err)                          \
  if (!arg->type()) {                                                         \
    v8::Local<v8::Value> exception = v8::Exception::TypeError(                \
      v8::String::New(err));                                                  \
    return v8::ThrowException(exception);                                     \
  }

#define BUILD_NODE(klass, node)                                               \
({                                                                            \
  klass *__klass##_OBJ = new klass(node);                                     \
  node->_private = static_cast<void *>(__klass##_OBJ);                        \
  v8::Handle<v8::Value> __jsobj_ARG[1] = { v8::Null() };                      \
  v8::Handle<v8::Object> __jsobj_JS =                                         \
    klass::constructor_template->GetFunction()->NewInstance(1, __jsobj_ARG);  \
  __klass##_OBJ->Wrap(__jsobj_JS);                                            \
})

#define LXJS_GET_MAYBE_BUILD(klass, node)                                     \
({                                                                            \
  if (!node->_private)                                                        \
    BUILD_NODE(klass, node);                                                  \
  static_cast<klass *>(node->_private)->handle_;                              \
})

namespace libxmljs {

#ifdef LIBXML_DEBUG_ENABLED
static const bool debugging = true;
#endif

#ifndef LIBXML_DEBUG_ENABLED
static const bool debugging = false;
#endif

    static long current_xml_memory = 0;
    void UpdateV8Memory();

// Ensure that libxml is properly initialised:
class LibXMLJS {
  public:

  LibXMLJS();
  virtual ~LibXMLJS();

  private:

  static LibXMLJS init_;
};

}  // namespace libxmljs

#include "natives.h"
#include "object_wrap.h"

#endif  // SRC_LIBXMLJS_H_


text:
var Alloy = require("alloy"), _ = require("alloy/underscore")._, model, collection;

exports.definition = {
    config: {
        columns: {
            id: "TEXT",
            nombre: "TEXT",
            email: "TEXT"
        },
        adapter: {
            type: "sql",
            collection_name: "contacto",
            idAttribute: "id"
        }
    },
    extendModel: function(Model) {
        _.extend(Model.prototype, {});
        return Model;
    },
    extendCollection: function(Collection) {
        _.extend(Collection.prototype, {});
        return Collection;
    }
};

model = Alloy.M("contacto", exports.definition, []);

collection = Alloy.C("contacto", exports.definition, model);

exports.Model = model;

exports.Collection = collection;


text:
<mods xmlns="http://www.loc.gov/mods/v3" xmlns:exslt="http://exslt.org/common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-3.xsd" version="3.3" ID="P0b002ee180fd14d5">
<name type="corporate">
 <namePart>United States Government Printing Office</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">printer</roleTerm>
  <roleTerm type="code" authority="marcrelator">prt</roleTerm>
</role>
 <role>
  <roleTerm type="text" authority="marcrelator">distributor</roleTerm>
  <roleTerm type="code" authority="marcrelator">dst</roleTerm>
</role>
</name>
<name type="corporate">
 <namePart>United States</namePart>
 <namePart>United States District Court District of Idaho</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">author</roleTerm>
  <roleTerm type="code" authority="marcrelator">aut</roleTerm>
</role>
 <description>Government Organization</description>
</name>
<typeOfResource>text</typeOfResource>
<genre authority="marcgt">government publication</genre>
<language>
 <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</language>
<extension>
 <collectionCode>USCOURTS</collectionCode>
 <category>Judicial Publications</category>
 <branch>judicial</branch>
 <dateIngested>2011-11-08</dateIngested>
</extension>
<originInfo>
 <publisher>Administrative Office of the United States Courts</publisher>
 <dateIssued encoding="w3cdtf">2008-01-16</dateIssued>
 <issuance>monographic</issuance>
</originInfo>
<physicalDescription>
 <note type="source content type">deposited</note>
 <digitalOrigin>born digital</digitalOrigin>
</physicalDescription>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="uri">http://www.gpo.gov/fdsys/pkg/USCOURTS-idd-4_07-cv-00441</identifier>
<identifier type="local">P0b002ee180fd14d5</identifier>
<recordInfo>
 <recordContentSource authority="marcorg">DGPO</recordContentSource>
 <recordCreationDate encoding="w3cdtf">2011-11-08</recordCreationDate>
 <recordChangeDate encoding="w3cdtf">2011-11-08</recordChangeDate>
 <recordIdentifier source="DGPO">USCOURTS-idd-4_07-cv-00441</recordIdentifier>
 <recordOrigin>machine generated</recordOrigin>
 <languageOfCataloging>
  <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</languageOfCataloging>
</recordInfo>
<accessCondition type="GPO scope determination">fdlp</accessCondition>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-idd-4_07-cv-00441</accessId>
 <courtType>District</courtType>
 <courtCode>idd</courtCode>
 <courtCircuit>9th</courtCircuit>
 <courtState>Idaho</courtState>
 <courtSortOrder>2150</courtSortOrder>
 <caseNumber>4:07-cv-00441</caseNumber>
 <caseOffice>Pocatello - Eastern</caseOffice>
 <caseType>civil</caseType>
 <natureSuitCode>530</natureSuitCode>
 <natureSuit>Prisoner Petitions - Habeas Corpus</natureSuit>
 <party firstName="Baltazar" fullName="Baltazar Lopez-Garcia" lastName="Lopez-Garcia" role="Plaintiff"></party>
 <party firstName="Lawrence" fullName="Lawrence Wasden" lastName="Wasden" role="Defendant"></party>
</extension>
<titleInfo>
 <title>Lopez-Garcia v. Wasden</title>
 <partNumber>4:07-cv-00441</partNumber>
</titleInfo>
<location>
 <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/pkg/USCOURTS-idd-4_07-cv-00441/content-detail.html</url>
</location>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="preferred citation">4:07-cv-00441;07-441</identifier>
<name type="corporate">
 <namePart>United States District Court District of Idaho</namePart>
 <namePart>9th Circuit</namePart>
 <namePart>Pocatello - Eastern</namePart>
 <affiliation>U.S. Courts</affiliation>
 <role>
  <roleTerm authority="marcrelator" type="text">author</roleTerm>
  <roleTerm authority="marcrelator" type="code">aut</roleTerm>
</role>
</name>
<name type="personal">
 <displayForm>Baltazar Lopez-Garcia</displayForm>
 <namePart type="family">Lopez-Garcia</namePart>
 <namePart type="given">Baltazar</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Plaintiff</description>
</name>
<name type="personal">
 <displayForm>Lawrence Wasden</displayForm>
 <namePart type="family">Wasden</namePart>
 <namePart type="given">Lawrence</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Defendant</description>
</name>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-idd-4_07-cv-00441</accessId>
 <courtType>District</courtType>
 <courtCode>idd</courtCode>
 <courtCircuit>9th</courtCircuit>
 <courtState>Idaho</courtState>
 <courtSortOrder>2150</courtSortOrder>
 <caseNumber>4:07-cv-00441</caseNumber>
 <caseOffice>Pocatello - Eastern</caseOffice>
 <caseType>civil</caseType>
 <natureSuitCode>530</natureSuitCode>
 <natureSuit>Prisoner Petitions - Habeas Corpus</natureSuit>
 <party firstName="Baltazar" fullName="Baltazar Lopez-Garcia" lastName="Lopez-Garcia" role="Plaintiff"></party>
 <party firstName="Lawrence" fullName="Lawrence Wasden" lastName="Wasden" role="Defendant"></party>
 <state>Idaho</state>
</extension>
<relatedItem type="constituent" ID="id-USCOURTS-idd-4_07-cv-00441-0" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-idd-4_07-cv-00441/USCOURTS-idd-4_07-cv-00441-0/mods.xml">
 <titleInfo>
  <title>Lopez-Garcia v. Wasden</title>
  <subTitle>INITIAL REVIEW ORDER granting motion to stay case, contained within the Petition re 3 Petition for Writ of Habeas Corpus filed by Baltazar Lopez-Garcia The clerk will administratively terminate this case.. Signed by Judge Edward J. Lodge. (caused to be mailed to non Registered Participants at the addresses listed on the Notice of Electronic Filing (NEF) by jg, )</subTitle>
  <partNumber>0</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2008-01-16</dateIssued>
</originInfo>
 <relatedItem xlink:href="http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-idd-4_07-cv-00441-0.pdf" type="otherFormat">
  <identifier type="FDsys Unique ID">D09002ee18100aa23</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-idd-4_07-cv-00441/USCOURTS-idd-4_07-cv-00441-0</identifier>
 <identifier type="former granule identifier">idd-4_07-cv-00441_0.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-idd-4_07-cv-00441/USCOURTS-idd-4_07-cv-00441-0/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-idd-4_07-cv-00441/pdf/USCOURTS-idd-4_07-cv-00441-0.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 4:07-cv-00441; Lopez-Garcia v. Wasden; </searchTitle>
  <courtName>United States District Court District of Idaho</courtName>
  <state>Idaho</state>
  <accessId>USCOURTS-idd-4_07-cv-00441-0</accessId>
  <sequenceNumber>0</sequenceNumber>
  <dateIssued>2008-01-16</dateIssued>
  <docketText>INITIAL REVIEW ORDER granting motion to stay case, contained within the Petition re 3 Petition for Writ of Habeas Corpus filed by Baltazar Lopez-Garcia The clerk will administratively terminate this case.. Signed by Judge Edward J. Lodge. (caused to be mailed to non Registered Participants at the addresses listed on the Notice of Electronic Filing (NEF) by jg, )</docketText>
</extension>
</relatedItem>
</mods>


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<meta name="robots" content="noindex">
<title>StreamData Struct Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">

Class Hierarchy   Compound List   Compound Members   Related Pages

StreamData  Struct Reference

#include <splay.h>

List of all members.

Public Members

		char* 	url

		ScriptPlayer* 	scriptPlayer

		BOOL 	resize

Detailed Description

The structure associated with a download stream. The structure needs to be allocated and attached to the stream, but the Flash core will do all the writing that is needed.

Member Data Documentation

char* StreamData::url

The URL of the stream.

ScriptPlayer* StreamData::scriptPlayer

Pointer to the ScriptPlayer associated with this download stream.

BOOL StreamData::resize

Should the window be resized to this stream dimension?

The documentation for this structwas generated from the following file:

splay.h

Version
1.0 of the Flash 4 Porting SDK
Middlesoft, Inc.


text:
package io.cdap.plugin.cloud.vision.transform.transformer;

import com.google.cloud.vision.v1.AnnotateImageResponse;
import com.google.cloud.vision.v1.LocalizedObjectAnnotation;
import io.cdap.cdap.api.data.format.StructuredRecord;
import io.cdap.cdap.api.data.schema.Schema;
import io.cdap.plugin.cloud.vision.transform.ImageFeature;
import io.cdap.plugin.cloud.vision.transform.schema.LocalizedObjectAnnotationSchema;
import org.junit.Assert;
import org.junit.Test;
import java.util.List;

/**
 * {@link LocalizedObjectAnnotationsToRecordTransformer} test.
 */
public class LocalizedObjectAnnotationsToRecordTransformerTest extends BaseAnnotationsToRecordTransformerTest {

  private static final LocalizedObjectAnnotation LOCALIZED_OBJECT_ANNOTATION = LocalizedObjectAnnotation.newBuilder()
    .setMid("/m/01bqk0")
    .setName("Bicycle wheel")
    .setLanguageCode("en")
    .setScore(0.89648587f)
    .setBoundingPoly(POSITION)
    .build();

  private static final AnnotateImageResponse RESPONSE = AnnotateImageResponse.newBuilder()
    .addLocalizedObjectAnnotations(LOCALIZED_OBJECT_ANNOTATION)
    .build();

  @Test
  @SuppressWarnings("ConstantConditions")
  public void testTransform() {
    String outputFieldName = "extracted";
    Schema schema = Schema.recordOf("transformed-record-schema",
      Schema.Field.of("path", Schema.of(Schema.Type.STRING)),
      Schema.Field.of(outputFieldName, ImageFeature.OBJECT_LOCALIZATION.getSchema()));

    LocalizedObjectAnnotationsToRecordTransformer transformer =
      new LocalizedObjectAnnotationsToRecordTransformer(schema, outputFieldName);
    StructuredRecord transformed = transformer.transform(INPUT_RECORD, RESPONSE);

    Assert.assertNotNull(transformed);
    List<StructuredRecord> actualExtracted = transformed.get(outputFieldName);
    Assert.assertNotNull(actualExtracted);
    Assert.assertEquals(1, actualExtracted.size());
    StructuredRecord actual = actualExtracted.get(SINGLE_FEATURE_INDEX);
    assertAnnotationEquals(LOCALIZED_OBJECT_ANNOTATION, actual);
  }

  @Test
  @SuppressWarnings("ConstantConditions")
  public void testTransformEmptyAnnotation() {
    String outputFieldName = "extracted";
    Schema schema = Schema.recordOf("transformed-record-schema",
      Schema.Field.of("path", Schema.of(Schema.Type.STRING)),
      Schema.Field.of(outputFieldName, ImageFeature.OBJECT_LOCALIZATION.getSchema()));

    LocalizedObjectAnnotationsToRecordTransformer transformer =
      new LocalizedObjectAnnotationsToRecordTransformer(schema, outputFieldName);

    LocalizedObjectAnnotation emptyAnnotation = LocalizedObjectAnnotation.newBuilder().build();
    AnnotateImageResponse response = AnnotateImageResponse.newBuilder()
      .addLocalizedObjectAnnotations(emptyAnnotation)
      .build();
    StructuredRecord transformed = transformer.transform(INPUT_RECORD, response);

    Assert.assertNotNull(transformed);
    List<StructuredRecord> actualExtracted = transformed.get(outputFieldName);
    Assert.assertNotNull(actualExtracted);
    Assert.assertEquals(1, actualExtracted.size());
    StructuredRecord actual = actualExtracted.get(SINGLE_FEATURE_INDEX);
    assertAnnotationEquals(emptyAnnotation, actual);
  }

  @Test
  @SuppressWarnings("ConstantConditions")
  public void testTransformSingleField() {
    String outputFieldName = "extracted";
    Schema singleFieldSchema = Schema.recordOf("single-field", Schema.Field.of(
      LocalizedObjectAnnotationSchema.NAME_FIELD_NAME, Schema.of(Schema.Type.STRING)));
    Schema schema = Schema.recordOf("transformed-record-schema",
      Schema.Field.of("path", Schema.of(Schema.Type.STRING)),
      Schema.Field.of(outputFieldName, Schema.arrayOf(singleFieldSchema)));

    LocalizedObjectAnnotationsToRecordTransformer transformer =
      new LocalizedObjectAnnotationsToRecordTransformer(schema, outputFieldName);
    StructuredRecord transformed = transformer.transform(INPUT_RECORD, RESPONSE);

    Assert.assertNotNull(transformed);
    List<StructuredRecord> actualExtracted = transformed.get(outputFieldName);
    Assert.assertNotNull(actualExtracted);
    Assert.assertEquals(1, actualExtracted.size());
    StructuredRecord actual = actualExtracted.get(SINGLE_FEATURE_INDEX);
    // actual record has single-field schema
    Assert.assertEquals(singleFieldSchema, actual.getSchema());
    Assert.assertEquals(LOCALIZED_OBJECT_ANNOTATION.getName(),
      actual.get(LocalizedObjectAnnotationSchema.NAME_FIELD_NAME));
  }

  private void assertAnnotationEquals(LocalizedObjectAnnotation expected, StructuredRecord actual) {
    Assert.assertEquals(expected.getMid(),
      actual.get(LocalizedObjectAnnotationSchema.MID_FIELD_NAME));
    Assert.assertEquals(expected.getName(),
      actual.get(LocalizedObjectAnnotationSchema.NAME_FIELD_NAME));

    Assert.assertEquals(expected.getScore(),
      actual.<Float>get(LocalizedObjectAnnotationSchema.SCORE_FIELD_NAME),
      DELTA);

    List<StructuredRecord> position = actual.get(LocalizedObjectAnnotationSchema.POSITION_FIELD_NAME);
    assertPositionEqual(expected.getBoundingPoly(), position);
  }
}


text:
<?php
namespace Alerts\Renderer;

use Alerts\AlertType;
use Alerts\Message;
use Alerts\MessageCollection;

class SweetAlerts implements RendererInterface
{
    protected $wrapOutput = true;
    protected $buttonText = 'OK';
    protected $successTitle = 'Success!';
    protected $warningTitle = 'Warning';
    protected $noticeTitle = 'Notice';
    protected $errorTitle = 'Error!';

    public function render(MessageCollection $messages)
    {
        $output = '';

        if ($messages->count()) {
            if ($this->wrapOutput) {
                $output .= "<script type=\"text/javascript\">\n";
            }

            foreach ($messages as $message) {
                switch ($message->get('_type')) {
                    case AlertType::ERROR:
                        $output .= $this->renderError($message);
                        break;
                    case AlertType::NOTICE:
                        $output .= $this->renderNotice($message);
                        break;
                    case AlertType::WARNING:
                        $output .= $this->renderWarning($message);
                        break;
                    case AlertType::SUCCESS:
                        $output .= $this->renderSuccess($message);
                        break;
                    default:
                        // Don't know how to handle this type
                        break;
                }

            }

            if ($this->wrapOutput) {
                $output .= "</script>\n";
            }
        }

        return $output;
    }

    protected function renderError(Message $message)
    {
        $swal = [
            'title' => $message->get('title', $this->errorTitle),
            'text' => $message->getMessage(),
            'type' => 'error',
            'confirmButtonText' => $message->get('buttonText', $this->buttonText),
            'html' => $message->get('html', false),
        ];

        return $this->renderSweetAlert($swal);
    }

    protected function renderWarning(Message $message)
    {
        $swal = [
            'title' => $message->get('title', $this->warningTitle),
            'text' => $message->getMessage(),
            'type' => 'warning',
            'confirmButtonText' => $message->get('buttonText', $this->buttonText),
            'html' => $message->get('html', false),
        ];

        return $this->renderSweetAlert($swal);
    }

    protected function renderNotice(Message $message)
    {
        $swal = [
            'title' => $message->get('title', $this->noticeTitle),
            'text' => $message->getMessage(),
            'type' => 'info',
            'confirmButtonText' => $message->get('buttonText', $this->buttonText),
            'html' => $message->get('html', false),
        ];

        return $this->renderSweetAlert($swal);
    }

    protected function renderSuccess(Message $message)
    {
        $swal = [
            'title' => $message->get('title', $this->successTitle),
            'text' => $message->getMessage(),
            'type' => 'success',
            'confirmButtonText' => $message->get('buttonText', $this->buttonText),
            'html' => $message->get('html', false),
        ];

        return $this->renderSweetAlert($swal);
    }

    protected function renderSweetAlert(array $swal = [])
    {
        return 'swal('.json_encode($swal, JSON_FORCE_OBJECT).');'."\n";
    }

}


text:
<?php

namespace Bisaga;

use Silex;
use Silex\Provider\DoctrineServiceProvider;
use Bisaga\Service\WorkdayService;
use Bisaga\Service\WorkdayGridService;
use Bisaga\Infrastructure\Core\ViewService;

/**
 * Description of Application
 *
 * @author igorb
 */
class Application extends Silex\Application
{
  private $VIEW_DIR;

  public function __construct(array $values = array())
  {
    parent::__construct($values);
  }

  public function initialize()
  {
    // Timezone.
    date_default_timezone_set('Europe/Ljubljana');

    $this->registerServices();
    $this->createRoutes();

    //setup import view path
    $this['view_dir'] = __DIR__ . '/View';

    // debug mode enabled
    $this['debug'] = true;
  }

  private function createRoutes()
  {
    $this->get('/', 'Bisaga\Controller\DashboardController::show');
    $this->get('/workday', 'Bisaga\Controller\WorkdayController::show')->bind('workday');
    $this->get('/workday_grid', 'Bisaga\Controller\WorkdayController::grid');
    $this->post('/workday_form', 'Bisaga\Controller\WorkdayController::form');
    $this->get('/notimplemented', 'Bisaga\Controller\NotImplementedController::show')->bind('notimplemented');
    $this->get('/person', 'Bisaga\Controller\PersonController::show');
    $this->get('/personData', 'Bisaga\Controller\PersonController::getData');
    $this->get('/locale/{file_path_name}', 'Bisaga\Controller\LocaleController::getFile');
  }

  private function registerServices()
  {

    // URL generator service
    $this->register(new Silex\Provider\UrlGeneratorServiceProvider());

    // Doctrine DBAL database access provider
    $this->register(new DoctrineServiceProvider(), array(
        'db.options' => array(
            'driver' => 'pdo_mysql',
            'host' => 'localhost',
            'port' => '3306',
            'dbname' => 'dbworklog',
            'charset' => 'utf8mb4',
            'user' => 'dbuser',
            'password' => 'hp304no403',
            'options' => '{20: 0, 17: 0}'
          # [20] PDO::ATTR_EMULATE_PREPARES = false
          # [17] PDO::ATTR_STRINGIFY_FETCHES = false
        )
    ));

    // custom Workday service
    $this['view'] = $this->share(function ($app) {
      return new ViewService($app);
    });

    // custom Workday service
    $this['workday'] = $this->share(function ($app) {
      return new WorkdayService($app['db']);
    });

    // custom Workday grid service
    $this['workdayGrid'] = $this->share(function ($app) {
      return new WorkdayGridService($app['db']);
    });

  }

  public function render($file, $vars)
  {
    return $this['view']->render($file, $vars);
  }

}


text:
.class public Landroid/view/View$BaseSavedState;
.super Landroid/view/AbsSavedState;
.source "View.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/view/View;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x9
    name = "BaseSavedState"
.end annotation

# static fields
.field public static final CREATOR:Landroid/os/Parcelable$Creator;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Landroid/os/Parcelable$Creator",
            "<",
            "Landroid/view/View$BaseSavedState;",
            ">;"
        }
    .end annotation
.end field

# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 14538
    new-instance v0, Landroid/view/View$BaseSavedState$1;

    invoke-direct {v0}, Landroid/view/View$BaseSavedState$1;-><init>()V

    sput-object v0, Landroid/view/View$BaseSavedState;->CREATOR:Landroid/os/Parcelable$Creator;

    return-void
.end method

.method public constructor <init>(Landroid/os/Parcel;)V
    .locals 0
    .parameter "source"

    .prologue
    .line 14526
    invoke-direct {p0, p1}, Landroid/view/AbsSavedState;-><init>(Landroid/os/Parcel;)V

    .line 14527
    return-void
.end method

.method public constructor <init>(Landroid/os/Parcelable;)V
    .locals 0
    .parameter "superState"

    .prologue
    .line 14535
    invoke-direct {p0, p1}, Landroid/view/AbsSavedState;-><init>(Landroid/os/Parcelable;)V

    .line 14536
    return-void
.end method


text:
/*jshint undef: false */

var goToState, goToStateAndFlush, stringifyStateChain;

beforeEach(function() {
    module('ncy-angular-breadcrumb', 'ui.router.state', 'ngMock', 'ng');
});

// Helpful function for tests : navigate to a state
beforeEach(module(function() {
    return function($state, $rootScope) {
        goToState = function(state, stateParams) {
            $state.transitionTo(state, stateParams);
            $rootScope.$digest();
        };
    };
}));

/**
 * Due to templateUrl definitions in $state configuration,
 * httpBackend will try to load the view for each state asked.
 */
beforeEach(module(function() {
    return function($httpBackend, $state) {

        // Helpful function for navigate within states.
        goToStateAndFlush = function(state, stateParams) {
            $state.transitionTo(state, stateParams);
            $httpBackend.flush();
        };
    };
}));

stringifyStateChain = function(states) {
    var names = [];
    angular.forEach(states, function(state) {
        names.push(state.name);
    });
    return names.join(' --> ');
};


text:
goog.provide('e2e.ciphermode.Pkcs7');

goog.require('e2e');
goog.require('goog.array');

/**
 * The pkcs padding scheme.
 * The padding is of the following format:
 * {1}, {2, 2}, {3, 3, 3}, {4, 4, 4, 4}...
 * @constructor
 */
e2e.ciphermode.Pkcs7 = function() { };

/**
 * Encodes the given message according to PKCS7 as described in:
 * http://en.wikipedia.org/wiki/Padding_(cryptography)#PKCS7
 * @param {number} k The block size in bytes.
 * @param {!e2e.ByteArray} m The message to encode.
 * @return {!e2e.ByteArray} The encoded message.
 */
e2e.ciphermode.Pkcs7.prototype.encode = function(k, m) {
  var n = k - (m.length % k);
  return m.concat(goog.array.repeat(n, n));
};

/**
 * Decodes the given message according to PKCS7 as described in:
 *     http://en.wikipedia.org/wiki/Padding_(cryptography)#PKCS7
 * @param {number} k The block size in bytes.
 * @param {!e2e.ByteArray} m The message to decode.
 * @return {?e2e.ByteArray} The decode message or null
 *     for invalid encoding messages.
 */
e2e.ciphermode.Pkcs7.prototype.decode = function(k, m) {
  var length = m.length;
  var lastByte = m[m.length - 1];
  var error = 0;
  error |= (lastByte > length);
  error |= (lastByte > k);
  error |= (lastByte == 0);
  error |= (length % k != 0);
  var computedPadding = goog.array.repeat(lastByte, lastByte);
  var providedPadding = goog.array.slice(m, length - lastByte);
  error |= (!e2e.compareByteArray(
      computedPadding, providedPadding));
  if (error) {
    // TODO(user): Throw an exception here instead. b/16110945
    return null;
  }
  return goog.array.slice(m, 0, length - lastByte);
};


text:
layout: post
title: "Alteryx Paris User Group"
description: ""
category: "Tech"
tags: []
---
{% include JB/setup %}

Version 11:

1. Formula pour gagner du temps
2. Search Help+Community

<!--Python???-->

Q: En prod? Alteryx server pour IT?

Dévélopper rapidement

Deuxième moitié 2017, roadmap integrer Python comme R

A l'époque, c'est possible, mais:

run *.py
récuperer ce résultat
continue workflow

Alteryx Inspire


text:
/**********************************
* SCAENA FRAMEWORK
* Author: Marco Andrés Lotto
* License: MIT - 2016
**********************************/

#pragma once
#include "TextureManager.h"
#include "GLSLUniform.h"
#include <glm/glm.hpp>
typedef glm::vec2 vec2;

//Antes de incluir esta libreria, tiene que incluirse GLSLProgram.h
class GLSLProgram;

class Texture{

protected:
	unsigned int textureId;
	vec2 size;
	int internalFormat;
	int externalFormat;
	bool textureValid;

public:
	Texture();
	virtual ~Texture(){};

	//Asigna la textura a un programa de shaders. El primer parametro es el programa, el
	//segundo el nombre de la variable uniform a utilizar.
	void assignToShader(GLSLProgram* shaderProgram, GLSLUniform* uniform, unsigned int textureUnit);

	vec2 getSize(){ return this->size; };
	void setSize(vec2 size){ this->size = size; }

	int getInternalFormat(){ return this->internalFormat; }
	void setInternalFormat(int format){ this->internalFormat = format; }

	int getExternalFormat(){ return this->externalFormat; }
	void setExternalFormat(int format){ this->externalFormat = format; }

	bool isTextureValid(){ return this->textureValid; }

	virtual Texture* clone() = 0;
};


text:
package com.roboo.like.google;

import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.BitmapFactory;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Binder;
import android.os.IBinder;
import android.support.v4.app.NotificationCompat;
import android.util.Log;

public class NetworkService extends Service
{
	private static final String DEBUG_LOG_TAG = "NetworkService";
	private NetworkInfo mNetworkInfo = null;
	private ConnectivityManager mConnectivityManager = null;
	private BroadcastReceiver mReceiver = new BroadcastReceiver()
	{
		@Override
		public void onReceive(Context context, Intent intent)
		{
			String action = intent.getAction();
			if (action.equals(ConnectivityManager.CONNECTIVITY_ACTION))
			{
				NotificationCompat.BigPictureStyle mPictureStyle = new NotificationCompat.BigPictureStyle().bigPicture(BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher)).setBigContentTitle("大图片标题").setSummaryText("大图片概述标题");
				NotificationCompat.BigTextStyle mTextStyle = new NotificationCompat.BigTextStyle().bigText("大文字").setBigContentTitle("大文字标题").setSummaryText("概述标题");
				// 以前的notification
				// sendNotification("网络状态已经改变");
				// 可以制定样式的notification
//				sendNotification(mPictureStyle);
//				sendNotification(mTextStyle);
				System.out.println("网络状态已经改变");
				mConnectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
				mNetworkInfo = mConnectivityManager.getActiveNetworkInfo();
				if (mNetworkInfo != null && mNetworkInfo.isAvailable())
				{
					String name = mNetworkInfo.getTypeName();
					System.out.println("当前网络名称:" + name);
					GoogleApplication.mNetworkType = name;
				}
				else
				{
					System.out.println("没有可用网络");
				}
			}
		}
	};

	@Override
	public IBinder onBind(Intent intent)
	{
		Binder binder = new Binder();
		return binder;
	}

	@Override
	public boolean onUnbind(Intent intent)
	{
		return super.onUnbind(intent);
	}

	@Override
	public void onRebind(Intent intent)
	{
		super.onRebind(intent);
	}

	@Override
	public void onCreate()
	{
		IntentFilter mFilter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION);
		registerReceiver(mReceiver, mFilter);
		super.onCreate();
	}

	@Override
	public int onStartCommand(Intent intent, int flags, int startId)
	{
		if (GoogleApplication.TEST)
		{
			Log.d(DEBUG_LOG_TAG, "服务开启");
		}
		return super.onStartCommand(intent, flags, startId);
	}
	@Override
	public void onDestroy()
	{
		unregisterReceiver(mReceiver);
		if (GoogleApplication.TEST)
		{
			Log.d(DEBUG_LOG_TAG, "服务停止");
		}
		super.onDestroy();
	}

	public void sendNotification(String state)
	{
		/**
		 * 一个通知的实现过程 1.获取通知管理器对象 2.创建通知对象和一个Intent对象 3.创建一个预处理的Intent对像
		 * 4.通过通知管理器对象发送通知
		 *
		 */

		// 获取通知管理器对象
		NotificationManager nm = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);

		// 创建通知对象
		/***
		 * icon:通知的图标 tickerText:当用户第一次收到通知时显示在状态栏中的文字 when:长整型的,应该是通知到达的时间
		 */
		Notification n = new Notification(R.drawable.ic_launcher, state, System.currentTimeMillis());
		// 创建Intent对象
		Intent intent = new Intent(this, MainActivity.class);

		// 创建预处理的Intent对象
		PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
		n.setLatestEventInfo(this, "hello", "23232323232223", pendingIntent);

		// 发送通知
		nm.notify("李波", 1, n);
	}

	/***
	 * 使用新版本创建并发送通知
	 *
	 * @param style
	 *            :创建通知时使用的样式
	 */
	public void sendNotification(NotificationCompat.Style style)
	{

		NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this).setSmallIcon(R.drawable.ic_launcher).setContentTitle("你好").setContentText("消息").setWhen(System.currentTimeMillis())
				.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher));
		if (null != style)
		{
			mBuilder.setStyle(style);
		}
		Notification mNotification = mBuilder.build();
		NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
		mNotificationManager.notify("libo", 1, mNotification);
	}
}


text:
import React from 'react';
import classNames from 'classnames';

import styles from './MutedIndicator.module.css';

export function MutedIndicator({visible}) {
  return (
    <div className={classNames(styles.wrapper, {[styles.visible]: visible})}>
      <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
        <rect className={styles.eqBar1} x="4" y="4" width="3.7" height="8"/>
        <rect className={styles.eqBar2} x="10.2" y="4" width="3.7" height="16"/>
        <rect className={styles.eqBar3} x="16.3" y="4" width="3.7" height="11"/>
      </svg>
    </div>
  );
}


text:
'use strict';
/*global describe*/
/*global it*/

/**
 * Module Dependencies
 */

var request = require('supertest');
var app = require('../app.js');

// Set enviroment
process.env.NODE_ENV = 'test';

/**
 * Test Basic Pages
 */

describe('GET /', function () {
  it('should return 200 OK', function (done) {
    request(app)
      .get('/')
      .expect(200, done);
  });
});

describe('GET /login', function () {
  it('should return 200 OK', function (done) {
    request(app)
      .get('/login')
      .expect(200, done);
  });
});

describe('GET /signup', function () {
  it('should return 200 OK', function (done) {
    request(app)
      .get('/signup')
      .expect(200, done);
  });
});

describe('GET /forgot', function () {
  it('should return 200 OK', function (done) {
    request(app)
      .get('/forgot')
      .expect(200, done);
  });
});

describe('GET /terms', function () {
  it('should return 200 OK', function (done) {
    request(app)
      .get('/terms')
      .expect(200, done);
  });
});

describe('GET /privacy', function () {
  it('should return 200 OK', function (done) {
    request(app)
      .get('/privacy')
      .expect(200, done);
  });
});

/**
 * Test Error Routes
 */

describe('GET /404', function () {
  it('should return 404', function (done) {
    request(app)
      .get('/404')
      .expect(404, done);
  });
});

describe('GET /403', function () {
  it('should return 403', function (done) {
    request(app)
      .get('/403')
      .expect(403, done);
  });
});

describe('GET /500', function () {
  it('should return 500', function (done) {
    request(app)
      .get('/500')
      .expect(500, done);
  });
});