text:
#pragma checksum "..\..\MainWindow.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "7D3D0D770AAB4FBFD818DB94FE68E3E2"
//------------------------------------------------------------------------------
// <auto-generated>
//     このコードはツールによって生成されました。
//     ランタイム バージョン:4.0.30319.42000
//
//     このファイルへの変更は、以下の状況下で不正な動作の原因になったり、
//     コードが再生成されるときに損失したりします。
// </auto-generated>
//------------------------------------------------------------------------------

using CloudRoboWpfLoadTest;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;

namespace CloudRoboWpfLoadTest {

    /// <summary>
    /// MainWindow
    /// </summary>
    public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {

        #line 19 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.TextBox textBoxJson;

        #line default
        #line hidden

        #line 20 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.Label labelDateTime;

        #line default
        #line hidden

        #line 21 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.TextBox textBoxDateTime;

        #line default
        #line hidden

        #line 22 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.Label labelParam1;

        #line default
        #line hidden

        #line 23 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.ComboBox comboBoxP1;

        #line default
        #line hidden

        #line 27 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.Label labelP1;

        #line default
        #line hidden

        #line 28 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.TextBox textBoxIncreP1;

        #line default
        #line hidden

        #line 29 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.Label labelStartP1;

        #line default
        #line hidden

        #line 30 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.TextBox textBoxStartP1;

        #line default
        #line hidden

        #line 31 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.Label labelEndP1;

        #line default
        #line hidden

        #line 32 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.TextBox textBoxEndP1;

        #line default
        #line hidden

        #line 33 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.Label labelParam2;

        #line default
        #line hidden

        #line 34 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.ComboBox comboBoxP2;

        #line default
        #line hidden

        #line 38 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.Label labelP2;

        #line default
        #line hidden

        #line 39 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.TextBox textBoxIncreP2;

        #line default
        #line hidden

        #line 40 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.Label labelStartP2;

        #line default
        #line hidden

        #line 41 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.TextBox textBoxStartP2;

        #line default
        #line hidden

        #line 42 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.Label labelEndP2;

        #line default
        #line hidden

        #line 43 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.TextBox textBoxEndP2;

        #line default
        #line hidden

        #line 44 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.Label labelParam3;

        #line default
        #line hidden

        #line 45 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.ComboBox comboBoxP3;

        #line default
        #line hidden

        #line 49 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.Label labelP3;

        #line default
        #line hidden

        #line 50 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.TextBox textBoxIncreP3;

        #line default
        #line hidden

        #line 51 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.Label labelStartP3;

        #line default
        #line hidden

        #line 52 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.TextBox textBoxStartP3;

        #line default
        #line hidden

        #line 53 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.Label labelEndP3;

        #line default
        #line hidden

        #line 54 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.TextBox textBoxEndP3;

        #line default
        #line hidden

        #line 55 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.Label labelIoTHub;

        #line default
        #line hidden

        #line 56 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.TextBox textBoxIotHub;

        #line default
        #line hidden

        #line 57 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.Label labelDevices;

        #line default
        #line hidden

        #line 58 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.TextBox textBoxDevices;

        #line default
        #line hidden

        #line 59 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.Label labelLoop;

        #line default
        #line hidden

        #line 60 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.TextBox textBoxLoops;

        #line default
        #line hidden

        #line 61 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.Button buttonStart;

        #line default
        #line hidden

        #line 62 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.Button buttonStop;

        #line default
        #line hidden

        #line 63 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.Button buttonFinish;

        #line default
        #line hidden

        #line 64 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.Button buttonMessageCleanup;

        #line default
        #line hidden

        #line 65 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.Label labelQStorageConnString;

        #line default
        #line hidden

        #line 66 "..\..\MainWindow.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.TextBox textBoxQStorageConnString;

        #line default
        #line hidden

        private bool _contentLoaded;

        /// <summary>
        /// InitializeComponent
        /// </summary>
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
        public void InitializeComponent() {
            if (_contentLoaded) {
                return;
            }
            _contentLoaded = true;
            System.Uri resourceLocater = new System.Uri("/CloudRoboWpfLoadTest;component/mainwindow.xaml", System.UriKind.Relative);

            #line 1 "..\..\MainWindow.xaml"
            System.Windows.Application.LoadComponent(this, resourceLocater);

            #line default
            #line hidden
        }

        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
            switch (connectionId)
            {
            case 1:

            #line 8 "..\..\MainWindow.xaml"
            ((CloudRoboWpfLoadTest.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.MainWindow_Loaded);

            #line default
            #line hidden
            return;
            case 2:
            this.textBoxJson = ((System.Windows.Controls.TextBox)(target));
            return;
            case 3:
            this.labelDateTime = ((System.Windows.Controls.Label)(target));
            return;
            case 4:
            this.textBoxDateTime = ((System.Windows.Controls.TextBox)(target));
            return;
            case 5:
            this.labelParam1 = ((System.Windows.Controls.Label)(target));
            return;
            case 6:
            this.comboBoxP1 = ((System.Windows.Controls.ComboBox)(target));

            #line 23 "..\..\MainWindow.xaml"
            this.comboBoxP1.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.comboBoxP1_SelectionChanged);

            #line default
            #line hidden
            return;
            case 7:
            this.labelP1 = ((System.Windows.Controls.Label)(target));
            return;
            case 8:
            this.textBoxIncreP1 = ((System.Windows.Controls.TextBox)(target));
            return;
            case 9:
            this.labelStartP1 = ((System.Windows.Controls.Label)(target));
            return;
            case 10:
            this.textBoxStartP1 = ((System.Windows.Controls.TextBox)(target));
            return;
            case 11:
            this.labelEndP1 = ((System.Windows.Controls.Label)(target));
            return;
            case 12:
            this.textBoxEndP1 = ((System.Windows.Controls.TextBox)(target));
            return;
            case 13:
            this.labelParam2 = ((System.Windows.Controls.Label)(target));
            return;
            case 14:
            this.comboBoxP2 = ((System.Windows.Controls.ComboBox)(target));

            #line 34 "..\..\MainWindow.xaml"
            this.comboBoxP2.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.comboBoxP2_SelectionChanged);

            #line default
            #line hidden
            return;
            case 15:
            this.labelP2 = ((System.Windows.Controls.Label)(target));
            return;
            case 16:
            this.textBoxIncreP2 = ((System.Windows.Controls.TextBox)(target));
            return;
            case 17:
            this.labelStartP2 = ((System.Windows.Controls.Label)(target));
            return;
            case 18:
            this.textBoxStartP2 = ((System.Windows.Controls.TextBox)(target));
            return;
            case 19:
            this.labelEndP2 = ((System.Windows.Controls.Label)(target));
            return;
            case 20:
            this.textBoxEndP2 = ((System.Windows.Controls.TextBox)(target));
            return;
            case 21:
            this.labelParam3 = ((System.Windows.Controls.Label)(target));
            return;
            case 22:
            this.comboBoxP3 = ((System.Windows.Controls.ComboBox)(target));

            #line 45 "..\..\MainWindow.xaml"
            this.comboBoxP3.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.comboBoxP3_SelectionChanged);

            #line default
            #line hidden
            return;
            case 23:
            this.labelP3 = ((System.Windows.Controls.Label)(target));
            return;
            case 24:
            this.textBoxIncreP3 = ((System.Windows.Controls.TextBox)(target));
            return;
            case 25:
            this.labelStartP3 = ((System.Windows.Controls.Label)(target));
            return;
            case 26:
            this.textBoxStartP3 = ((System.Windows.Controls.TextBox)(target));
            return;
            case 27:
            this.labelEndP3 = ((System.Windows.Controls.Label)(target));
            return;
            case 28:
            this.textBoxEndP3 = ((System.Windows.Controls.TextBox)(target));
            return;
            case 29:
            this.labelIoTHub = ((System.Windows.Controls.Label)(target));
            return;
            case 30:
            this.textBoxIotHub = ((System.Windows.Controls.TextBox)(target));
            return;
            case 31:
            this.labelDevices = ((System.Windows.Controls.Label)(target));
            return;
            case 32:
            this.textBoxDevices = ((System.Windows.Controls.TextBox)(target));
            return;
            case 33:
            this.labelLoop = ((System.Windows.Controls.Label)(target));
            return;
            case 34:
            this.textBoxLoops = ((System.Windows.Controls.TextBox)(target));
            return;
            case 35:
            this.buttonStart = ((System.Windows.Controls.Button)(target));

            #line 61 "..\..\MainWindow.xaml"
            this.buttonStart.Click += new System.Windows.RoutedEventHandler(this.buttonStart_Click);

            #line default
            #line hidden
            return;
            case 36:
            this.buttonStop = ((System.Windows.Controls.Button)(target));

            #line 62 "..\..\MainWindow.xaml"
            this.buttonStop.Click += new System.Windows.RoutedEventHandler(this.buttonStop_Click);

            #line default
            #line hidden
            return;
            case 37:
            this.buttonFinish = ((System.Windows.Controls.Button)(target));

            #line 63 "..\..\MainWindow.xaml"
            this.buttonFinish.Click += new System.Windows.RoutedEventHandler(this.buttonFinish_Click);

            #line default
            #line hidden
            return;
            case 38:
            this.buttonMessageCleanup = ((System.Windows.Controls.Button)(target));

            #line 64 "..\..\MainWindow.xaml"
            this.buttonMessageCleanup.Click += new System.Windows.RoutedEventHandler(this.buttonMessageCleanup_Click);

            #line default
            #line hidden
            return;
            case 39:
            this.labelQStorageConnString = ((System.Windows.Controls.Label)(target));
            return;
            case 40:
            this.textBoxQStorageConnString = ((System.Windows.Controls.TextBox)(target));
            return;
            }
            this._contentLoaded = true;
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Text;

namespace EmitMapper.AST.Interfaces
{
    interface IAstRef : IAstRefOrValue, IAstRefOrAddr
    {
    }
}

redpajama_set_name: RedPajamaGithub


text:
import os
import re

# read content from validate.html
htmlContent = [x for x in open('validate.html')]

# identify template boundaries
preIdx  = htmlContent.index([ x for x in htmlContent if re.match(r'\s*<!-- START AUTO-POPULATED TESTS -->',x) ][0])
postIdx = htmlContent.index([ x for x in htmlContent if re.match(r'\s*<!-- END AUTO-POPULATED TESTS -->'  ,x) ][0])

# initialize output array with start of validate.html
out = htmlContent[:preIdx+1]

# files to read
files = [ f for f in os.listdir('marked/test/tests') if f.endswith('.text') ]

# iterate over files
for f in files:

    # base file name
    base = f.replace('.text','')

    # don't process tests for non-default marked.js modes
    if base.endswith('.smartypants') or base.endswith('.nogfm') or base.endswith('.breaks'):
        pass
    else:

        # extract text and html (skipping blank lines in html)
        text = ''.join([
            re.sub(r'\s+\n', '\n', '    '+x)
            for x in open('marked/test/tests/'+base+'.text') ])
        html = ''.join([
            re.sub(r'\s+\n', '\n', '    '+x)
            for x in open('marked/test/tests/'+base+'.html')
            if not re.match(r'^\s*$',x) ])

        # escape ampersands in text input
        text = text.replace('&', '&')

        # escape quotes in text input
        text = text.replace('"', '"')

        # generate corresponding output
        out.append('  <!-- ' + base + '-->\n')
        out.append('  <section id="' + base + '" data-text="\n')
        out.append(text + '\n')
        out.append('    ">\n')
        out.append(html + '\n')
        out.append('  </section>\n')

# extend output array with end of validate.html
out.append('\n')
out.extend(htmlContent[postIdx:])

# update validate.html file with new content
with open('validate.html', 'w') as handle:
    handle.writelines(out)


text:
package ch.ethz.ssh2;

/**
 * An abstract marker interface implemented by all proxy data implementations.
 *
 * @author Christian Plattner, plattner@inf.ethz.ch
 * @version $Id: ProxyData.java,v 1.3 2006/08/02 12:17:22 cplattne Exp $
 * @see HTTPProxyData
 */

public abstract interface ProxyData {
}


text:
<?php

defined('admin') or die ('no direct access');

class Products_Allergens extends Controller {
    private $db;
    private $fields;

    function Products_Allergens() {
        $this->db = new Products_Database();
        $this->fields = array(
            'name' => '',
        );
    }

    function handle(ORequest $request) {
        $id = $request->param_as_number(2);

        if ($request->is_post('products-allergens')) {
            $fields = $request->populate($this->fields);
            if ($id == 0) {
                $id = $this->db->allergens_insert($fields);
            } else {
                $this->db->allergens_update($id, $fields);
            }
            $request->forward('products-allergens-' . $id);
        } else {
            $template = new Template('products', 'allergens');
            $template->set('id', $id);
            if (empty($id)) {
                $template->set_ar($this->fields);
            } else {
                $template->set_ar($this->db->allergens_get($id));
            }
            $template->set_ar('allergens', $this->db->allergens_all());
            $template->display();
        }
    }
}


text:
watchdock
=========

# Docker Monitoring and Management Client

watchdock is a Docker monitoring web application. The application is self contained, no additional dependencies, services (except docker :-) or servers are needed.

The docker demon needs to be exposed as IP service with activated CORS:
`-H tcp://0.0.0.0:5555 -api-enable-cors` See also: [https://docs.docker.com/reference/api/docker_remote_api_v1.10/#33-cors-requests](https://docs.docker.com/reference/api/docker_remote_api_v1.10/#33-cors-requests)

Launch index.html from a browser and set the docker host and port.

You can also try watchdock directly from [watchdock.org](http://watchdock.org).


text:
/**
 * The implementation of key snapshot objects such as representing classes, arrays, and objects in the snapshot. This is
 * for use by the parser, not by queries.
 */
package org.eclipse.mat.parser.model;


text:
import React from 'react';
import PageLayout from 'layouts/PageLayout/PageLayout';
import { connect } from 'react-redux';
import WorkItems from 'components/work-items';
import styles from './work-view.css';
const mapStateToProps = (state) => ({
  work: state.work,
  routerState: state.router
});

export class WorkView extends PageLayout {
  constructor (props) {
    super(props);
  }

  componentWillMount () {
    this.setupPageInfo('Our Work');
  }

  componentDidMount () {
    this.animatePageContentIn();
    this.checkBodyVisibility();
  }

  render () {
    return (

our work

yeah, we get paid to do this.

            <WorkItems workpage actions={this.actions} location={this.props.routerState.locationBeforeTransitions} params={this.props.params}  />

    );
  }
}

export default connect(mapStateToProps)(WorkView);


text:
namespace ofbx { struct IScene; }

namespace Veng
{

class Engine;
class Allocator;

namespace Editor
{

class ObjImportWidget : public WidgetBase
{
public:
	struct ConvertParams
	{
		enum class CoordSystemHandness : u8
		{
			Right,
			Left,
		};
		enum class TriangleDefinition : u8
		{
			ClockWise,
			CounterClockWise,
		};

		Allocator* allocator;
		CoordSystemHandness coordSystem = CoordSystemHandness::Right;
		TriangleDefinition triangleDef = TriangleDefinition::ClockWise;
	};

public:
	ObjImportWidget(Allocator& allocator);
	~ObjImportWidget() override;
	void Init(Engine& engine, EditorInterface& editor) override;
	void Deinit() override;

	void Update(EventQueue& queue) override;
	void Render(EventQueue& queue) override;
	const char* GetName() const override { return "Object importer"; };

private:
	Allocator& m_allocator;
	ofbx::IScene* m_scene = nullptr;
	ConvertParams m_params;
};

}

}


text:
import serial, sys, argparse, time

# Parse command line arguments
parser = argparse.ArgumentParser(
        description='Meepromer Command Line Interface',
        epilog='Read source for further information')

task = parser.add_mutually_exclusive_group()
task.add_argument('-V', '--version', dest="cmd", action="store_const",
        const="version", help='Request and display device version')
task.add_argument('-w', '--write', dest="cmd", action="store_const",
        const="write", help='Write to EEPROM')
task.add_argument('-W', '--write_paged', dest="cmd", action="store_const",
        const="write_paged", help='Fast paged write to EEPROM')
task.add_argument('-r', '--read', dest="cmd", action="store_const",
        const="read", help='Read from EEPROM as ascii')
task.add_argument('-d', '--dump', dest="cmd", action="store_const",
        const="dump", help='Dump EEPROM to binary file')
task.add_argument('-v', '--verify', dest="cmd", action="store_const",
        const="verify", help='Compare EEPROM with file')
task.add_argument('-u', '--unlock', dest="cmd", action="store_const",
        const="unlock", help='Unlock EEPROM')
task.add_argument('-l', '--list', dest="cmd", action="store_const",
        const="list", help='List serial ports')

parser.add_argument('-a', '--address', action='store', default='0',
        help='Starting eeprom address (as hex), default 0')
parser.add_argument('-o', '--offset', action='store', default='0',
        help='Input file offset (as hex), default 0')
parser.add_argument('-b', '--bytes', action='store', default='8',
        type=int, help='Number of kBytes to r/w, default 8')
parser.add_argument('-p', '--page_size', action='store', default='32',
        type=int, help='Number of bytes per EEPROM page e.g.:'+
            'CAT28C*=32, AT28C*=64, X28C*=64, default 32')
parser.add_argument('-f', '--file', action='store',
        help='Name of data file')
parser.add_argument('-c', '--com', action='store',
        default='COM5', help='Com/tty port address')
parser.add_argument('-s', '--speed', action='store',
        type=int, default='115200', help='Com port baud, default 115200')

def list_ports():
    from serial.tools import list_ports
    print("Found the following serial devices :")
    for x in list_ports.comports():
        print(x[0], x[1])

def dump_file():
    ser.flushInput()
    ser.write(bytes("r "+format(args.address,'04x')+" "+
        format(args.address+args.bytes*1024,'04x')+
        " 10\n", 'ascii'))
    eeprom = ser.read(args.bytes*1024)
    if(ser.read(1) != b'\0'):
        print("Error: no Ack")
        sys.exit(1)
    try:
        fo = open(args.file,'wb+')
    except OSError:
        print("Error: File cannot be opened, verify it is not in use")
        sys.exit(1)
    fo.write(eeprom)
    fo.close()

def verify():
    print("Verifying...")
    ser.flushInput()
    ser.write(bytes("r "+format(args.address,'04x')+" "+
        format(args.bytes*1024,'04x')+" 10\n", 'ascii'))
    try:
        fi = open(args.file,'rb')
    except FileNotFoundError:
        print("Error: ",args.file," not found, please select a valid file")
        sys.exit(1)
    except TypeError:
        print("Error: No file specified")
        sys.exit(1)

    fi.seek(args.offset)
    file = fi.read(args.bytes*1024)
    eeprom = ser.read(args.bytes*1024)
    if ser.read(1) != b'\0':
        print("Error: no EOF received")

    if file != eeprom:
        print("Not equal")
        n = 0
        for i in range(args.bytes*1024):
            if file[i] != eeprom[i]:
                n+=1
        print(n,"differences found")
        sys.exit(1)
    else:
        print("Ok")

def read_eeprom():
    ser.flushInput()
    ser.write(bytes("R "+format(args.address,'04x')+" "+
        format(args.address+args.bytes*1024,'04x')+
        " 10\n", 'ascii'))
    ser.readline()#remove blank starting line
    for i in range(round(args.bytes*1024/16)):
        print(ser.readline().decode('ascii').rstrip())

def write_eeprom(paged):
    fi = open(args.file,'rb')
    fi.seek(args.offset)
    now = time.time() #start our stopwatch
    for i in range(args.bytes): #write n blocks of 1024 bytes
        output = fi.read(1024)
        print("Writing from",format(args.address+i*1024,'04x'),
              "to",format(args.address+i*1024+1023,'04x'))
        if paged:
            ser.write(bytes("W "+format(args.address+i*1024,'04x')+
                " 0400 "+format(args.page_size,'02x')+"\n", 'ascii'))
        else:
            ser.write(bytes("w "+format(args.address+i*1024,'04x')+
                " 0400 00\n", 'ascii'))

        ser.flushInput()
        ser.write(output)
        if(ser.read(1) != b'%'):
            print("Error: no Ack")
            sys.exit(1)
    print("Wrote",args.bytes*1024,"bytes in","%.2f"%(time.time()-now),"seconds")

def unlock():
    print("Unlocking...")
    ser.flushInput()
    ser.write(bytes("u 0000 0000 00\n", 'ascii'))
    if ser.read(1) != b'%':
        print("Error: no ack")
        sys.exit(1)
    else:
        print("Unlocked!")

def version():
    ser.write(b'V\n')
    print(ser.readline().decode('ascii').rstrip())

args = parser.parse_args()
#convert our hex strings to ints
args.address = int(args.address,16)
args.offset = int(args.offset,16)

if not args.cmd:
    print("Missing arguments :")
    print("Com/tty port device must be set (-c)")
    print("-h for detailed help")
    parser.print_usage()
    sys.exit(1)

class DebugSerial(serial.Serial):
    def write(self, data):
        #enable the below print statment to show debug data sent to the arduino
        #print("write: %s" % (data,))
        super().write(data)

SERIAL_TIMEOUT = 20 #seconds
try:
    ser = DebugSerial(args.com, args.speed, timeout=SERIAL_TIMEOUT)
except serial.serialutil.SerialException:
    print("Error: Serial port is not valid, please select a valid port")
    list_ports()
    sys.exit(1)

def CleanUp():
    ser.close()

# It seems necessary to wait >= ~1.8 seconds for the device to respond.
time.sleep(2)

if args.cmd == 'version':
    version()
elif args.cmd == 'write':
    write_eeprom(False)
    CleanUp()
elif args.cmd == 'write_paged':
    write_eeprom(True)
    CleanUp()
elif args.cmd == 'read':
    read_eeprom()
    CleanUp()
elif args.cmd == 'dump':
    dump_file()
    CleanUp()
elif args.cmd == 'verify':
    verify()
    CleanUp()
elif args.cmd == 'unlock':
    unlock()
    CleanUp()
elif args.cmd == 'list':
    list_ports()
    CleanUp()
else:
    parser.print_usage()


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

import java.io.IOException;
import java.lang.ref.WeakReference;
import java.net.*;
import java.nio.ByteBuffer;
import java.nio.channels.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.*;
import java.util.function.Supplier;
import java.util.logging.Level;
import javax.net.ssl.SSLContext;
import org.redkale.convert.*;
import org.redkale.convert.json.JsonConvert;
import org.redkale.util.*;

/**
 * 传输客户端
 *
 * <p>
 * 详情见: https://redkale.org
 *
 * @author zhangjx
 */
public final class Transport {

    public static final String DEFAULT_NETPROTOCOL = "TCP";

    protected final AtomicInteger seq = new AtomicInteger(-1);

    protected final TransportFactory factory;

    protected final String name; //即<group>的name属性

    protected final boolean tcp;

    protected final String netprotocol;

    //传输端的AsyncGroup
    protected final AsyncGroup asyncGroup;

    protected final InetSocketAddress clientAddress;

    //不可能为null
    protected TransportNode[] transportNodes = new TransportNode[0];

    protected final SSLContext sslContext;

    //负载均衡策略
    protected final TransportStrategy strategy;

    //连接上限, 为null表示无限制
    protected Semaphore semaphore;

    protected Transport(String name, TransportFactory factory, final AsyncGroup asyncGroup, final SSLContext sslContext, final InetSocketAddress clientAddress,
        final Collection<InetSocketAddress> addresses, final TransportStrategy strategy) {
        this(name, DEFAULT_NETPROTOCOL, factory, asyncGroup, sslContext, clientAddress, addresses, strategy);
    }

    protected Transport(String name, String netprotocol, final TransportFactory factory, final AsyncGroup asyncGroup, final SSLContext sslContext, final InetSocketAddress clientAddress,
        final Collection<InetSocketAddress> addresses, final TransportStrategy strategy) {
        this.name = name;
        this.netprotocol = netprotocol;
        this.factory = factory;
        factory.transportReferences.add(new WeakReference<>(this));
        this.tcp = "TCP".equalsIgnoreCase(netprotocol);
        this.asyncGroup = asyncGroup;
        this.sslContext = sslContext;
        this.clientAddress = clientAddress;
        this.strategy = strategy;
        updateRemoteAddresses(addresses);
    }

    public Semaphore getSemaphore() {
        return semaphore;
    }

    public void setSemaphore(Semaphore semaphore) {
        this.semaphore = semaphore;
    }

    public final InetSocketAddress[] updateRemoteAddresses(final Collection<InetSocketAddress> addresses) {
        final TransportNode[] oldNodes = this.transportNodes;
        synchronized (this) {
            boolean same = false;
            if (this.transportNodes != null && addresses != null && this.transportNodes.length == addresses.size()) {
                same = true;
                for (TransportNode node : this.transportNodes) {
                    if (!addresses.contains(node.getAddress())) {
                        same = false;
                        break;
                    }
                }
            }
            if (!same) {
                List<TransportNode> list = new ArrayList<>();
                if (addresses != null) {
                    for (InetSocketAddress addr : addresses) {
                        if (clientAddress != null && clientAddress.equals(addr)) continue;
                        boolean hasold = false;
                        for (TransportNode oldAddr : oldNodes) {
                            if (oldAddr.getAddress().equals(addr)) {
                                list.add(oldAddr);
                                hasold = true;
                                break;
                            }
                        }
                        if (hasold) continue;
                        list.add(new TransportNode(factory.poolmaxconns, addr));
                    }
                }
                this.transportNodes = list.toArray(new TransportNode[list.size()]);
            }
        }
        InetSocketAddress[] rs = new InetSocketAddress[oldNodes.length];
        for (int i = 0; i < rs.length; i++) {
            rs[i] = oldNodes[i].getAddress();
        }
        return rs;
    }

    public final boolean addRemoteAddresses(final InetSocketAddress addr) {
        if (addr == null) return false;
        if (clientAddress != null && clientAddress.equals(addr)) return false;
        synchronized (this) {
            if (this.transportNodes.length == 0) {
                this.transportNodes = new TransportNode[]{new TransportNode(factory.poolmaxconns, addr)};
            } else {
                for (TransportNode i : this.transportNodes) {
                    if (addr.equals(i.address)) return false;
                }
                this.transportNodes = Utility.append(transportNodes, new TransportNode(factory.poolmaxconns, addr));
            }
            return true;
        }
    }

    public final boolean removeRemoteAddresses(InetSocketAddress addr) {
        if (addr == null) return false;
        synchronized (this) {
            this.transportNodes = Utility.remove(transportNodes, new TransportNode(factory.poolmaxconns, addr));
        }
        return true;
    }

    public String getName() {
        return name;
    }

    public void close() {
        TransportNode[] nodes = this.transportNodes;
        if (nodes == null) return;
        for (TransportNode node : nodes) {
            if (node != null) node.dispose();
        }
    }

    public InetSocketAddress getClientAddress() {
        return clientAddress;
    }

    public TransportNode[] getTransportNodes() {
        return transportNodes;
    }

    public TransportNode findTransportNode(SocketAddress addr) {
        for (TransportNode node : this.transportNodes) {
            if (node.address.equals(addr)) return node;
        }
        return null;
    }

    public InetSocketAddress[] getRemoteAddresses() {
        InetSocketAddress[] rs = new InetSocketAddress[transportNodes.length];
        for (int i = 0; i < rs.length; i++) {
            rs[i] = transportNodes[i].getAddress();
        }
        return rs;
    }

    @Override
    public String toString() {
        return Transport.class.getSimpleName() + "{name = " + name + ", protocol = " + netprotocol + ", clientAddress = " + clientAddress + ", remoteNodes = " + Arrays.toString(transportNodes) + "}";
    }

    public String getNetprotocol() {
        return netprotocol;
    }

    public boolean isTCP() {
        return tcp;
    }

    protected CompletableFuture<AsyncConnection> pollAsync(TransportNode node, SocketAddress addr, Supplier<CompletableFuture<AsyncConnection>> func) {
        final BlockingQueue<AsyncConnection> queue = node.connQueue;
        if (!queue.isEmpty()) {
            AsyncConnection conn;
            while ((conn = queue.poll()) != null) {
                if (conn.isOpen()) {
                    return CompletableFuture.completedFuture(conn);
                } else {
                    conn.dispose();
                }
            }
        }
        if (semaphore != null && !semaphore.tryAcquire()) {
            final CompletableFuture<AsyncConnection> future = Utility.orTimeout(new CompletableFuture<>(), 10, TimeUnit.SECONDS);
            future.whenComplete((r, t) -> node.pollQueue.remove(future));
            if (node.pollQueue.offer(future)) return future;
            future.completeExceptionally(new IOException("create transport connection error"));
            return future;
        }
        return func.get().thenApply(conn -> {
            if (conn != null && semaphore != null) conn.beforeCloseListener((c) -> semaphore.release());
            return conn;
        });
    }

    public CompletableFuture<AsyncConnection> pollConnection(SocketAddress addr0) {
        if (this.strategy != null) return strategy.pollConnection(addr0, this);
        final TransportNode[] nodes = this.transportNodes;
        if (addr0 == null && nodes.length == 1) addr0 = nodes[0].address;
        final SocketAddress addr = addr0;
        final boolean rand = addr == null; //是否随机取地址
        if (rand && nodes.length < 1) throw new RuntimeException("Transport (" + this.name + ") have no remoteAddress list");
        try {
            if (!tcp) { // UDP
                SocketAddress udpaddr = rand ? nodes[0].address : addr;
                return asyncGroup.createUDPClient(udpaddr, factory.readTimeoutSeconds, factory.writeTimeoutSeconds);
            }
            if (!rand) { //指定地址
                TransportNode node = findTransportNode(addr);
                if (node == null) return asyncGroup.createTCPClient(addr, factory.readTimeoutSeconds, factory.writeTimeoutSeconds);
                return pollAsync(node, addr, () -> asyncGroup.createTCPClient(addr, factory.readTimeoutSeconds, factory.writeTimeoutSeconds));
            }

            //---------------------随机取地址------------------------
            int enablecount = 0;
            final TransportNode[] newnodes = new TransportNode[nodes.length];
            for (final TransportNode node : nodes) {
                if (node.disabletime > 0) continue;
                newnodes[enablecount++] = node;
            }
            final long now = System.currentTimeMillis();
            if (enablecount > 0) { //存在可用的地址
                final TransportNode one = newnodes[Math.abs(seq.incrementAndGet()) % enablecount];
                final BlockingQueue<AsyncConnection> queue = one.connQueue;
                if (!queue.isEmpty()) {
                    AsyncConnection conn;
                    while ((conn = queue.poll()) != null) {
                        if (conn.isOpen()) {
                            return CompletableFuture.completedFuture(conn);
                        } else {
                            conn.dispose();
                        }
                    }
                }
                return pollAsync(one, one.getAddress(), () -> {
                    return asyncGroup.createTCPClient(one.address, factory.readTimeoutSeconds, factory.writeTimeoutSeconds)
                        .whenComplete((c, t) -> {
                            one.disabletime = t == null ? 0 : System.currentTimeMillis();
                        });
                });
            }
            return pollConnection0(nodes, null, now);
        } catch (Exception ex) {
            throw new RuntimeException("transport address = " + addr, ex);
        }
    }

    private CompletableFuture<AsyncConnection> pollConnection0(TransportNode[] nodes, TransportNode exclude, long now) throws IOException {
        //从可用/不可用的地址列表中创建连接
        CompletableFuture future = new CompletableFuture();
        for (final TransportNode node : nodes) {
            if (node == exclude) continue;
            if (future.isDone()) return future;
            asyncGroup.createTCPClient(node.address, factory.readTimeoutSeconds, factory.writeTimeoutSeconds)
                .whenComplete((c, t) -> {
                    if (c != null && !future.complete(c)) node.connQueue.offer(c);
                    node.disabletime = t == null ? 0 : System.currentTimeMillis();
                });
        }
        return future;
    }

    public void offerConnection(final boolean forceClose, AsyncConnection conn) {
        if (this.strategy != null && strategy.offerConnection(forceClose, conn)) return;
        if (!forceClose && conn.isTCP()) {
            if (conn.isOpen()) {
                TransportNode node = findTransportNode(conn.getRemoteAddress());
                if (node == null || !node.connQueue.offer(conn)) conn.dispose();
            } else {
                conn.dispose();
            }
        } else {
            conn.dispose();
        }
    }

    public <A> void async(SocketAddress addr, final ByteBuffer buffer, A att, final CompletionHandler<Integer, A> handler) {
        pollConnection(addr).whenComplete((conn, ex) -> {
            if (ex != null) {
                factory.getLogger().log(Level.WARNING, Transport.class.getSimpleName() + " async error", ex);
                return;
            }
            conn.write(buffer, buffer, new CompletionHandler<Integer, ByteBuffer>() {

                @Override
                public void completed(Integer result, ByteBuffer attachment) {
                    buffer.clear();
                    conn.setReadBuffer(buffer);
                    conn.read(new CompletionHandler<Integer, ByteBuffer>() {

                        @Override
                        public void completed(Integer result, ByteBuffer attachment) {
                            if (handler != null) handler.completed(result, att);
                            conn.offerBuffer(attachment);
                            offerConnection(false, conn);
                        }

                        @Override
                        public void failed(Throwable exc, ByteBuffer attachment) {
                            conn.offerBuffer(attachment);
                            offerConnection(true, conn);
                        }
                    });

                }

                @Override
                public void failed(Throwable exc, ByteBuffer attachment) {
                    conn.offerBuffer(attachment);
                    offerConnection(true, conn);
                }
            });
        });
    }

    public static class TransportNode {

        protected InetSocketAddress address;

        protected volatile long disabletime; //不可用时的时间, 为0表示可用

        protected final BlockingQueue<AsyncConnection> connQueue;

        protected final ArrayBlockingQueue<CompletableFuture<AsyncConnection>> pollQueue;

        protected final ConcurrentHashMap<String, Object> attributes = new ConcurrentHashMap<>();

        public TransportNode(int poolmaxconns, InetSocketAddress address) {
            this.address = address;
            this.disabletime = 0;
            this.connQueue = new ArrayBlockingQueue<>(poolmaxconns);
            this.pollQueue = new ArrayBlockingQueue(this.connQueue.remainingCapacity() * 100);
        }

        @ConstructorParameters({"poolmaxconns", "address", "disabletime"})
        public TransportNode(int poolmaxconns, InetSocketAddress address, long disabletime) {
            this.address = address;
            this.disabletime = disabletime;
            this.connQueue = new LinkedBlockingQueue<>(poolmaxconns);
            this.pollQueue = new ArrayBlockingQueue(this.connQueue.remainingCapacity() * 100);
        }

        public int getPoolmaxconns() {
            return this.connQueue.remainingCapacity() + this.connQueue.size();
        }

        public <T> T setAttribute(String name, T value) {
            attributes.put(name, value);
            return value;
        }

        @SuppressWarnings("unchecked")
        public <T> T getAttribute(String name) {
            return (T) attributes.get(name);
        }

        @SuppressWarnings("unchecked")
        public <T> T removeAttribute(String name) {
            return (T) attributes.remove(name);
        }

        public TransportNode clearAttributes() {
            attributes.clear();
            return this;
        }

        public ConcurrentHashMap<String, Object> getAttributes() {
            return attributes;
        }

        public void setAttributes(ConcurrentHashMap<String, Object> map) {
            attributes.clear();
            if (map != null) attributes.putAll(map);
        }

        public InetSocketAddress getAddress() {
            return address;
        }

        public long getDisabletime() {
            return disabletime;
        }

        @ConvertDisabled
        public BlockingQueue<AsyncConnection> getConnQueue() {
            return connQueue;
        }

        public void dispose() {
            AsyncConnection conn;
            while ((conn = connQueue.poll()) != null) {
                conn.dispose();
            }
        }

        @Override
        public int hashCode() {
            return this.address.hashCode();
        }

        @Override
        public boolean equals(Object obj) {
            if (this == obj) return true;
            if (obj == null) return false;
            if (getClass() != obj.getClass()) return false;
            final TransportNode other = (TransportNode) obj;
            return this.address.equals(other.address);
        }

        @Override
        public String toString() {
            return JsonConvert.root().convertTo(this);
        }
    }
}


text:
ICON_DST=../../src/qt/res/icons/greencoin.ico

convert ../../src/qt/res/icons/greencoin-16.png ../../src/qt/res/icons/greencoin-32.png ../../src/qt/res/icons/greencoin-48.png ${ICON_DST}


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.dfareporting.model;

/**
 * Placement Tag Data
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Campaign Manager 360 API. For a detailed explanation
 * see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class TagData extends com.google.api.client.json.GenericJson {

  /**
   * Ad associated with this placement tag. Applicable only when format is PLACEMENT_TAG_TRACKING.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @com.google.api.client.json.JsonString
  private java.lang.Long adId;

  /**
   * Tag string to record a click.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String clickTag;

  /**
   * Creative associated with this placement tag. Applicable only when format is
   * PLACEMENT_TAG_TRACKING.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @com.google.api.client.json.JsonString
  private java.lang.Long creativeId;

  /**
   * TagData tag format of this tag.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String format;

  /**
   * Tag string for serving an ad.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String impressionTag;

  /**
   * Ad associated with this placement tag. Applicable only when format is PLACEMENT_TAG_TRACKING.
   * @return value or {@code null} for none
   */
  public java.lang.Long getAdId() {
    return adId;
  }

  /**
   * Ad associated with this placement tag. Applicable only when format is PLACEMENT_TAG_TRACKING.
   * @param adId adId or {@code null} for none
   */
  public TagData setAdId(java.lang.Long adId) {
    this.adId = adId;
    return this;
  }

  /**
   * Tag string to record a click.
   * @return value or {@code null} for none
   */
  public java.lang.String getClickTag() {
    return clickTag;
  }

  /**
   * Tag string to record a click.
   * @param clickTag clickTag or {@code null} for none
   */
  public TagData setClickTag(java.lang.String clickTag) {
    this.clickTag = clickTag;
    return this;
  }

  /**
   * Creative associated with this placement tag. Applicable only when format is
   * PLACEMENT_TAG_TRACKING.
   * @return value or {@code null} for none
   */
  public java.lang.Long getCreativeId() {
    return creativeId;
  }

  /**
   * Creative associated with this placement tag. Applicable only when format is
   * PLACEMENT_TAG_TRACKING.
   * @param creativeId creativeId or {@code null} for none
   */
  public TagData setCreativeId(java.lang.Long creativeId) {
    this.creativeId = creativeId;
    return this;
  }

  /**
   * TagData tag format of this tag.
   * @return value or {@code null} for none
   */
  public java.lang.String getFormat() {
    return format;
  }

  /**
   * TagData tag format of this tag.
   * @param format format or {@code null} for none
   */
  public TagData setFormat(java.lang.String format) {
    this.format = format;
    return this;
  }

  /**
   * Tag string for serving an ad.
   * @return value or {@code null} for none
   */
  public java.lang.String getImpressionTag() {
    return impressionTag;
  }

  /**
   * Tag string for serving an ad.
   * @param impressionTag impressionTag or {@code null} for none
   */
  public TagData setImpressionTag(java.lang.String impressionTag) {
    this.impressionTag = impressionTag;
    return this;
  }

  @Override
  public TagData set(String fieldName, Object value) {
    return (TagData) super.set(fieldName, value);
  }

  @Override
  public TagData clone() {
    return (TagData) super.clone();
  }

}


text:
// tensorflow/tensorflow/core/lib/core/arena.h

// TODO(vrv): Switch this to an open-sourced version of Arena.

#ifndef BUBBLEFS_UTILS_ARENA_H_
#define BUBBLEFS_UTILS_ARENA_H_

#include <assert.h>
#include <vector>
#include "platform/logging.h"
#include "platform/macros.h"
#include "platform/types.h"
#include "utils/allocator.h"

namespace bubblefs {
namespace core {

// This class is "thread-compatible": different threads can access the
// arena at the same time without locking, as long as they use only
// const methods.
class Arena : public Allocator {
 public:
  // Allocates a thread-compatible arena with the specified block size.
  explicit Arena(const size_t block_size = kMinBlockSize);
  virtual ~Arena();

  static const size_t kInlineSize = 2048;
  static const size_t kMinBlockSize;
  static const size_t kMaxBlockSize;

  virtual char* Alloc(const size_t size) override {
    return reinterpret_cast<char*>(GetMemory(size, 1));
  }

  virtual char* AllocAligned(const size_t size, const size_t alignment) override {
    return reinterpret_cast<char*>(GetMemory(size, alignment));
  }

  virtual size_t BlockSize() const override { return block_size_; }

  void Reset();

 protected:
  bool SatisfyAlignment(const size_t alignment);
  void MakeNewBlock(const uint32 alignment);
  void* GetMemoryFallback(const size_t size, const int align);
  void* GetMemory(const size_t size, const int align) {
    assert(remaining_ <= block_size_);                  // an invariant
    if (size > 0 && size < remaining_ && align == 1) {  // common case
      void* result = freestart_;
      freestart_ += size;
      remaining_ -= size;
      return result;
    }
    return GetMemoryFallback(size, align);
  }

  size_t remaining_;

 private:
  struct AllocatedBlock {
    char* mem;
    size_t size;
  };

  // Allocate new block of at least block_size, with the specified
  // alignment.
  // The returned AllocatedBlock* is valid until the next call to AllocNewBlock
  // or Reset (i.e. anything that might affect overflow_blocks_).
  AllocatedBlock* AllocNewBlock(const size_t block_size,
                                const uint32 alignment);

  const size_t block_size_;
  char* freestart_;  // beginning of the free space in most recent block
  char* freestart_when_empty_;  // beginning of the free space when we're empty
  // STL vector isn't as efficient as it could be, so we use an array at first
  size_t blocks_alloced_;  // how many of the first_blocks_ have been alloced
  AllocatedBlock first_blocks_[16];  // the length of this array is arbitrary
  // if the first_blocks_ aren't enough, expand into overflow_blocks_.
  std::vector<AllocatedBlock>* overflow_blocks_;

  void FreeBlocks();  // Frees all except first block

  DISALLOW_COPY_AND_ASSIGN(Arena);
};

}  // namespace core
}  // namespace bubblefs

#endif  // BUBBLEFS_UTILS_ARENA_H_


text:
/* Code generated by IfcQuery EXPRESS generator, www.ifcquery.com */

#include <sstream>
#include <limits>
#include <map>
#include "ifcpp/reader/ReaderUtil.h"
#include "ifcpp/writer/WriterUtil.h"
#include "ifcpp/model/BasicTypes.h"
#include "ifcpp/model/BuildingException.h"
#include "ifcpp/IFC4/include/IfcTaskTypeEnum.h"

// TYPE IfcTaskTypeEnum = ENUMERATION OF	(ATTENDANCE	,CONSTRUCTION	,DEMOLITION	,DISMANTLE	,DISPOSAL	,INSTALLATION	,LOGISTIC	,MAINTENANCE	,MOVE	,OPERATION	,REMOVAL	,RENOVATION	,USERDEFINED	,NOTDEFINED);
shared_ptr<BuildingObject> IfcTaskTypeEnum::getDeepCopy( BuildingCopyOptions& options )
{
	shared_ptr<IfcTaskTypeEnum> copy_self( new IfcTaskTypeEnum() );
	copy_self->m_enum = m_enum;
	return copy_self;
}
void IfcTaskTypeEnum::getStepParameter( std::stringstream& stream, bool is_select_type ) const
{
	if( is_select_type ) { stream << "IFCTASKTYPEENUM("; }
	switch( m_enum )
	{
		case ENUM_ATTENDANCE:	stream << ".ATTENDANCE."; break;
		case ENUM_CONSTRUCTION:	stream << ".CONSTRUCTION."; break;
		case ENUM_DEMOLITION:	stream << ".DEMOLITION."; break;
		case ENUM_DISMANTLE:	stream << ".DISMANTLE."; break;
		case ENUM_DISPOSAL:	stream << ".DISPOSAL."; break;
		case ENUM_INSTALLATION:	stream << ".INSTALLATION."; break;
		case ENUM_LOGISTIC:	stream << ".LOGISTIC."; break;
		case ENUM_MAINTENANCE:	stream << ".MAINTENANCE."; break;
		case ENUM_MOVE:	stream << ".MOVE."; break;
		case ENUM_OPERATION:	stream << ".OPERATION."; break;
		case ENUM_REMOVAL:	stream << ".REMOVAL."; break;
		case ENUM_RENOVATION:	stream << ".RENOVATION."; break;
		case ENUM_USERDEFINED:	stream << ".USERDEFINED."; break;
		case ENUM_NOTDEFINED:	stream << ".NOTDEFINED."; break;
	}
	if( is_select_type ) { stream << ")"; }
}
const std::wstring IfcTaskTypeEnum::toString() const
{
	switch( m_enum )
	{
		case ENUM_ATTENDANCE:	return L"ATTENDANCE";
		case ENUM_CONSTRUCTION:	return L"CONSTRUCTION";
		case ENUM_DEMOLITION:	return L"DEMOLITION";
		case ENUM_DISMANTLE:	return L"DISMANTLE";
		case ENUM_DISPOSAL:	return L"DISPOSAL";
		case ENUM_INSTALLATION:	return L"INSTALLATION";
		case ENUM_LOGISTIC:	return L"LOGISTIC";
		case ENUM_MAINTENANCE:	return L"MAINTENANCE";
		case ENUM_MOVE:	return L"MOVE";
		case ENUM_OPERATION:	return L"OPERATION";
		case ENUM_REMOVAL:	return L"REMOVAL";
		case ENUM_RENOVATION:	return L"RENOVATION";
		case ENUM_USERDEFINED:	return L"USERDEFINED";
		case ENUM_NOTDEFINED:	return L"NOTDEFINED";
	}
	return L"";
}
shared_ptr<IfcTaskTypeEnum> IfcTaskTypeEnum::createObjectFromSTEP( const std::wstring& arg, const std::map<int,shared_ptr<BuildingEntity> >& map )
{
	if( arg.compare( L"$" ) == 0 ) { return shared_ptr<IfcTaskTypeEnum>(); }
	if( arg.compare( L"*" ) == 0 ) { return shared_ptr<IfcTaskTypeEnum>(); }
	shared_ptr<IfcTaskTypeEnum> type_object( new IfcTaskTypeEnum() );
	if( std_iequal( arg, L".ATTENDANCE." ) )
	{
		type_object->m_enum = IfcTaskTypeEnum::ENUM_ATTENDANCE;
	}
	else if( std_iequal( arg, L".CONSTRUCTION." ) )
	{
		type_object->m_enum = IfcTaskTypeEnum::ENUM_CONSTRUCTION;
	}
	else if( std_iequal( arg, L".DEMOLITION." ) )
	{
		type_object->m_enum = IfcTaskTypeEnum::ENUM_DEMOLITION;
	}
	else if( std_iequal( arg, L".DISMANTLE." ) )
	{
		type_object->m_enum = IfcTaskTypeEnum::ENUM_DISMANTLE;
	}
	else if( std_iequal( arg, L".DISPOSAL." ) )
	{
		type_object->m_enum = IfcTaskTypeEnum::ENUM_DISPOSAL;
	}
	else if( std_iequal( arg, L".INSTALLATION." ) )
	{
		type_object->m_enum = IfcTaskTypeEnum::ENUM_INSTALLATION;
	}
	else if( std_iequal( arg, L".LOGISTIC." ) )
	{
		type_object->m_enum = IfcTaskTypeEnum::ENUM_LOGISTIC;
	}
	else if( std_iequal( arg, L".MAINTENANCE." ) )
	{
		type_object->m_enum = IfcTaskTypeEnum::ENUM_MAINTENANCE;
	}
	else if( std_iequal( arg, L".MOVE." ) )
	{
		type_object->m_enum = IfcTaskTypeEnum::ENUM_MOVE;
	}
	else if( std_iequal( arg, L".OPERATION." ) )
	{
		type_object->m_enum = IfcTaskTypeEnum::ENUM_OPERATION;
	}
	else if( std_iequal( arg, L".REMOVAL." ) )
	{
		type_object->m_enum = IfcTaskTypeEnum::ENUM_REMOVAL;
	}
	else if( std_iequal( arg, L".RENOVATION." ) )
	{
		type_object->m_enum = IfcTaskTypeEnum::ENUM_RENOVATION;
	}
	else if( std_iequal( arg, L".USERDEFINED." ) )
	{
		type_object->m_enum = IfcTaskTypeEnum::ENUM_USERDEFINED;
	}
	else if( std_iequal( arg, L".NOTDEFINED." ) )
	{
		type_object->m_enum = IfcTaskTypeEnum::ENUM_NOTDEFINED;
	}
	return type_object;
}


text:
package libkv

import (
	"github.com/docker/libkv/store"
	"github.com/docker/libkv/store/consul"
	"github.com/docker/libkv/store/etcd"
	"github.com/docker/libkv/store/zookeeper"
)

// Initialize creates a new Store object, initializing the client
type Initialize func(addrs []string, options *store.Config) (store.Store, error)

var (
	// Backend initializers
	initializers = map[store.Backend]Initialize{
		store.CONSUL: consul.New,
		store.ETCD:   etcd.New,
		store.ZK:     zookeeper.New,
	}
)

// NewStore creates a an instance of store
func NewStore(backend store.Backend, addrs []string, options *store.Config) (store.Store, error) {
	if init, exists := initializers[backend]; exists {
		return init(addrs, options)
	}

	return nil, store.ErrNotSupported
}


text:
(function($, window, document, undefined){
	"use strict";
	if(!$.webshims){
		var langs = navigator.browserLanguage || navigator.language || $('html').attr('lang') || '';
		$.webshims = {
			addReady: function(fn){$(function(){fn(document, $([]));});},
			ready: function(n, fn){fn();},
			activeLang: function(){return langs;}
		};
	}
	var webshims = $.webshims;
	var customValidityRules = {};
	var formReady = false;
	var blockCustom;
	var initTest;
	var onEventTest = function(e){
		webshims.refreshCustomValidityRules(e.target);
	};

	webshims.customErrorMessages = {};
	webshims.addCustomValidityRule = function(name, test, defaultMessage){
		customValidityRules[name] = test;
		if(!webshims.customErrorMessages[name]){
			webshims.customErrorMessages[name] = [];
			webshims.customErrorMessages[name][''] = defaultMessage || name;
		}
		if($.isReady && formReady){
			$('input, select, textarea').each(function(){
				testValidityRules(this);
			});
		}
	};
	webshims.refreshCustomValidityRules = function(elem){
		if(!elem.form || (!initTest && !$.prop(elem, 'willValidate')) ){return;}
		blockCustom = true;
		var customMismatchedRule = $.data(elem, 'customMismatchedRule');
		var validity = $.prop(elem, 'validity') || {};
		var message = '';
		if(customMismatchedRule || !validity.customError){
			var val = $(elem).val();
			$.each(customValidityRules, function(name, test){
				message = test(elem, val) || '';
				customMismatchedRule = name;
				if(message){

					if(typeof message != 'string'){
						message = $(elem).data('errormessage') || elem.getAttribute('x-moz-errormessage') || webshims.customErrorMessages[name][webshims.activeLang()] || webshims.customErrorMessages[name][''];
					}

					if(typeof message == 'object'){
						message = message[name] || message.customError || message.defaultMessage;
					}
					return false;
				}
			});

			if(message){
				$.data(elem, 'customMismatchedRule', customMismatchedRule);
			}
			$(elem).setCustomValidity(message);
		}
		blockCustom = false;
	};
	var testValidityRules = webshims.refreshCustomValidityRules;

	webshims.ready('forms', function(){
		formReady = true;

		var oldCustomValidity = $.fn.setCustomValidity || function(message){
			return this.each(function(){
				if(this.setCustomValidity){
					this.setCustomValidity(message);
				}
			});
		};

		$.fn.setCustomValidity = function(message){
			if(!blockCustom){
				this.data('customMismatchedRule', '');
			}
			return oldCustomValidity.apply(this, arguments);
		};

		$(document).bind('change', onEventTest);

		webshims.addReady(function(context, selfElement){
			initTest = true;
			$('input, select, textarea', context).add(selfElement.filter('input, select, textarea')).each(function(){
				testValidityRules(this);
			});
			initTest = false;
		});
		$(document).bind('refreshCustomValidityRules', onEventTest);

	});

})(jQuery, window, document);

/*
 * adds support for HTML5 constraint validation
 * 	- partial pattern: <input data-partial-pattern="RegExp" />
 *  - creditcard-validation: <input class="creditcard-input" />
 *  - several dependent-validation patterns (examples):
 *  	- <input type="email" id="mail" /> <input data-dependent-validation='mail' />
 *  	- <input type="date" id="start" data-dependent-validation='{"from": "end", "prop": "max"}' /> <input type="date" id="end" data-dependent-validation='{"from": "start", "prop": "min"}' />
 *  	- <input type="checkbox" id="check" /> <input data-dependent-validation='checkbox' />
 */
(function($, window, document, undefined){
	"use strict";
	var addCustomValidityRule = $.webshims.addCustomValidityRule;
	addCustomValidityRule('partialPattern', function(elem, val){
		if(!val || !elem.getAttribute('data-partial-pattern')){return;}
		var pattern = $(elem).data('partial-pattern');
		if(!pattern){return;}
		return !(new RegExp('(' + pattern + ')', 'i').test(val));
	}, 'This format is not allowed here.');

	addCustomValidityRule('tooShort', function(elem, val){
		if(!val || !elem.getAttribute('data-minlength')){return;}
		return $(elem).data('minlength') > val.length;
	}, 'Entered value is too short.');

	var groupTimer = {};
	addCustomValidityRule('group-required', function(elem, val){
		var name = elem.name;
		if(!name || elem.type !== 'checkbox' || !$(elem).hasClass('group-required')){return;}
		var checkboxes = $( (elem.form && elem.form[name]) || document.getElementsByName(name));
		var isValid = checkboxes.filter(':checked:enabled');
		if(groupTimer[name]){
			clearTimeout(groupTimer[name]);
		}
		groupTimer[name] = setTimeout(function(){
			checkboxes
				.unbind('click.groupRequired')
				.bind('click.groupRequired', function(){
					checkboxes.filter('.group-required').each(function(){
						$.webshims.refreshCustomValidityRules(this);
					});
				})
			;
		}, 9);

		return !(isValid[0]);
	}, 'Please check one of these checkboxes.');

	// based on https://sites.google.com/site/abapexamples/javascript/luhn-validation
	addCustomValidityRule('creditcard', function(elem, value){
		if(!value || !$(elem).hasClass('creditcard-input')){return;}
		value = value.replace(/\-/g, "");
		//if it's not numeric return true >- for invalid
		if(value != value * 1){return true;}
		var len = value.length;
		var sum = 0;
		var mul = 1;
		var ca;

		while (len--) {
			ca = parseInt(value.charAt(len),10) * mul;
			sum += ca - (ca>9)*9;// sum += ca - (-(ca>9))|9
			// 1 <--> 2 toggle.
			mul ^= 3; // (mul = 3 - mul);
		}
		return !((sum%10 === 0) && (sum > 0));
	}, 'Please enter a valid credit card number');

	var dependentDefaults = {
		//"from": "IDREF || UniqueNAMEREF", //required property: element
		"prop": "value", //default: value||disabled	(last if "from-prop" is checked)
		"from-prop": "value", //default: value||checked (last if element checkbox or radio)
		"toggle": false
	};

	var getGroupElements = function(elem) {
		return $(elem.form[elem.name]).filter('[type="radio"]');
	};
	$.webshims.ready('form-core', function(){
		if($.webshims.modules){
			getGroupElements = $.webshims.modules["form-core"].getGroupElements || getGroupElements;
		}
	});

	addCustomValidityRule('dependent', function(elem, val){

		if( !elem.getAttribute('data-dependent-validation') ){return;}

		var data = $(elem).data('dependentValidation');
		var specialVal;
		if(!data){return;}
		var depFn = function(e){
			var val = $.prop(data.masterElement, data["from-prop"]);
			if(specialVal){
				val = $.inArray(val, specialVal) !== -1;
			}
			if(data.toggle){
				val = !val;
			}
			$.prop( elem, data.prop, val);
		};

		if(!data._init || !data.masterElement){

			if(typeof data == 'string'){
				data = {"from": data};
			}

			data.masterElement = document.getElementById(data["from"]) || (document.getElementsByName(data["from"] || [])[0]);

			if (!data.masterElement || !data.masterElement.form) {return;}

			if(/radio|checkbox/i.test(data.masterElement.type)){
				if(!data["from-prop"]){
					data["from-prop"] = 'checked';
				}
				if(!data.prop && data["from-prop"] == 'checked'){
					data.prop = 'disabled';
				}
			} else if(!data["from-prop"]){
				data["from-prop"] = 'value';
			}

			if(data["from-prop"].indexOf('value:') === 0){
				specialVal = data["from-prop"].replace('value:', '').split('||');
				data["from-prop"] = 'value';

			}

			data = $.data(elem, 'dependentValidation', $.extend({_init: true}, dependentDefaults, data));

			if(data.prop !== "value" || specialVal){
				$(data.masterElement.type === 'radio' && getGroupElements(data.masterElement) || data.masterElement).bind('change', depFn);
			} else {
				$(data.masterElement).bind('change', function(){
					$.webshims.refreshCustomValidityRules(elem);
					if($(elem).is('.user-error, .user-success')){
						$(elem).trigger('refreshvalidityui');
					}
				});
			}
		}

		if(data.prop == "value" && !specialVal){
			return ($.prop(data.masterElement, 'value') != val);
		} else {
			depFn();
			return '';
		}

	}, 'The value of this field does not repeat the value of the other field');
})(jQuery, window, document);


text:
package org.apache.pulsar.broker.stats.prometheus;

import io.netty.util.concurrent.FastThreadLocal;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.atomic.LongAdder;
import java.util.function.Function;
import lombok.extern.slf4j.Slf4j;
import org.apache.bookkeeper.client.LedgerHandle;
import org.apache.bookkeeper.mledger.ManagedLedger;
import org.apache.bookkeeper.mledger.impl.ManagedLedgerMBeanImpl;
import org.apache.pulsar.broker.PulsarService;
import org.apache.pulsar.broker.service.Topic;
import org.apache.pulsar.broker.service.persistent.PersistentTopic;
import org.apache.pulsar.common.policies.data.BacklogQuota;
import org.apache.pulsar.common.policies.data.stats.ConsumerStatsImpl;
import org.apache.pulsar.common.policies.data.stats.NonPersistentSubscriptionStatsImpl;
import org.apache.pulsar.common.policies.data.stats.NonPersistentTopicStatsImpl;
import org.apache.pulsar.common.policies.data.stats.ReplicatorStatsImpl;
import org.apache.pulsar.common.policies.data.stats.SubscriptionStatsImpl;
import org.apache.pulsar.common.policies.data.stats.TopicStatsImpl;
import org.apache.pulsar.compaction.CompactedTopicContext;
import org.apache.pulsar.compaction.Compactor;
import org.apache.pulsar.compaction.CompactorMXBean;

@Slf4j
public class NamespaceStatsAggregator {

    private static final FastThreadLocal<AggregatedNamespaceStats> localNamespaceStats =
            new FastThreadLocal<>() {
                @Override
                protected AggregatedNamespaceStats initialValue() {
                    return new AggregatedNamespaceStats();
                }
            };

    private static final FastThreadLocal<TopicStats> localTopicStats = new FastThreadLocal<>() {
        @Override
        protected TopicStats initialValue() {
            return new TopicStats();
        }
    };

    public static void generate(PulsarService pulsar, boolean includeTopicMetrics, boolean includeConsumerMetrics,
                                boolean includeProducerMetrics, boolean splitTopicAndPartitionIndexLabel,
                                PrometheusMetricStreams stream) {
        String cluster = pulsar.getConfiguration().getClusterName();
        AggregatedNamespaceStats namespaceStats = localNamespaceStats.get();
        TopicStats topicStats = localTopicStats.get();
        Optional<CompactorMXBean> compactorMXBean = getCompactorMXBean(pulsar);
        LongAdder topicsCount = new LongAdder();
        Map<String, Long> localNamespaceTopicCount = new HashMap<>();

        printDefaultBrokerStats(stream, cluster);

        pulsar.getBrokerService().getMultiLayerTopicMap().forEach((namespace, bundlesMap) -> {
            namespaceStats.reset();
            topicsCount.reset();

            bundlesMap.forEach((bundle, topicsMap) -> topicsMap.forEach((name, topic) -> {
                getTopicStats(topic, topicStats, includeConsumerMetrics, includeProducerMetrics,
                        pulsar.getConfiguration().isExposePreciseBacklogInPrometheus(),
                        pulsar.getConfiguration().isExposeSubscriptionBacklogSizeInPrometheus(),
                        compactorMXBean
                );

                if (includeTopicMetrics) {
                    topicsCount.add(1);
                    TopicStats.printTopicStats(stream, topicStats, compactorMXBean, cluster, namespace, name,
                            splitTopicAndPartitionIndexLabel);
                } else {
                    namespaceStats.updateStats(topicStats);
                }
            }));

            if (!includeTopicMetrics) {
                // Only include namespace level stats if we don't have the per-topic, otherwise we're going to
                // report the same data twice, and it will make the aggregation difficult
                printNamespaceStats(stream, namespaceStats, cluster, namespace);
            } else {
                localNamespaceTopicCount.put(namespace, topicsCount.sum());
            }
        });

        if (includeTopicMetrics) {
            printTopicsCountStats(stream, localNamespaceTopicCount, cluster);
        }
    }

    private static Optional<CompactorMXBean> getCompactorMXBean(PulsarService pulsar) {
        Compactor compactor = pulsar.getNullableCompactor();
        return Optional.ofNullable(compactor).map(Compactor::getStats);
    }

    private static void aggregateTopicStats(TopicStats stats, SubscriptionStatsImpl subscriptionStats,
                                            AggregatedSubscriptionStats subsStats) {
        stats.subscriptionsCount++;
        stats.msgBacklog += subscriptionStats.msgBacklog;
        subsStats.msgBacklog = subscriptionStats.msgBacklog;
        subsStats.msgDelayed = subscriptionStats.msgDelayed;
        subsStats.msgRateExpired = subscriptionStats.msgRateExpired;
        subsStats.totalMsgExpired = subscriptionStats.totalMsgExpired;
        subsStats.msgBacklogNoDelayed = subsStats.msgBacklog - subsStats.msgDelayed;
        subsStats.lastExpireTimestamp = subscriptionStats.lastExpireTimestamp;
        subsStats.lastAckedTimestamp = subscriptionStats.lastAckedTimestamp;
        subsStats.lastConsumedFlowTimestamp = subscriptionStats.lastConsumedFlowTimestamp;
        subsStats.lastConsumedTimestamp = subscriptionStats.lastConsumedTimestamp;
        subsStats.lastMarkDeleteAdvancedTimestamp = subscriptionStats.lastMarkDeleteAdvancedTimestamp;
        subsStats.consumersCount = subscriptionStats.consumers.size();
        subscriptionStats.consumers.forEach(cStats -> {
            stats.consumersCount++;
            subsStats.unackedMessages += cStats.unackedMessages;
            subsStats.msgRateRedeliver += cStats.msgRateRedeliver;
            subsStats.msgRateOut += cStats.msgRateOut;
            subsStats.messageAckRate += cStats.messageAckRate;
            subsStats.msgThroughputOut += cStats.msgThroughputOut;
            subsStats.bytesOutCounter += cStats.bytesOutCounter;
            subsStats.msgOutCounter += cStats.msgOutCounter;
            if (!subsStats.blockedSubscriptionOnUnackedMsgs && cStats.blockedConsumerOnUnackedMsgs) {
                subsStats.blockedSubscriptionOnUnackedMsgs = true;
            }
        });
        stats.rateOut += subsStats.msgRateOut;
        stats.throughputOut += subsStats.msgThroughputOut;
        subsStats.filterProcessedMsgCount = subscriptionStats.filterProcessedMsgCount;
        subsStats.filterAcceptedMsgCount = subscriptionStats.filterAcceptedMsgCount;
        subsStats.filterRejectedMsgCount = subscriptionStats.filterRejectedMsgCount;
        subsStats.filterRescheduledMsgCount = subscriptionStats.filterRescheduledMsgCount;
    }

    private static void getTopicStats(Topic topic, TopicStats stats, boolean includeConsumerMetrics,
                                      boolean includeProducerMetrics, boolean getPreciseBacklog,
                                      boolean subscriptionBacklogSize, Optional<CompactorMXBean> compactorMXBean) {
        stats.reset();

        if (topic instanceof PersistentTopic) {
            // Managed Ledger stats
            ManagedLedger ml = ((PersistentTopic) topic).getManagedLedger();
            ManagedLedgerMBeanImpl mlStats = (ManagedLedgerMBeanImpl) ml.getStats();

            stats.managedLedgerStats.storageSize = mlStats.getStoredMessagesSize();
            stats.managedLedgerStats.storageLogicalSize = mlStats.getStoredMessagesLogicalSize();
            stats.managedLedgerStats.backlogSize = ml.getEstimatedBacklogSize();
            stats.managedLedgerStats.offloadedStorageUsed = ml.getOffloadedSize();
            stats.backlogQuotaLimit = topic
                    .getBacklogQuota(BacklogQuota.BacklogQuotaType.destination_storage).getLimitSize();
            stats.backlogQuotaLimitTime = topic
                    .getBacklogQuota(BacklogQuota.BacklogQuotaType.message_age).getLimitTime();

            stats.managedLedgerStats.storageWriteLatencyBuckets
                    .addAll(mlStats.getInternalAddEntryLatencyBuckets());
            stats.managedLedgerStats.storageWriteLatencyBuckets.refresh();
            stats.managedLedgerStats.storageLedgerWriteLatencyBuckets
                    .addAll(mlStats.getInternalLedgerAddEntryLatencyBuckets());
            stats.managedLedgerStats.storageLedgerWriteLatencyBuckets.refresh();

            stats.managedLedgerStats.entrySizeBuckets.addAll(mlStats.getInternalEntrySizeBuckets());
            stats.managedLedgerStats.entrySizeBuckets.refresh();

            stats.managedLedgerStats.storageWriteRate = mlStats.getAddEntryMessagesRate();
            stats.managedLedgerStats.storageReadRate = mlStats.getReadEntriesRate();
        }
        TopicStatsImpl tStatus = topic.getStats(getPreciseBacklog, subscriptionBacklogSize, false);
        stats.msgInCounter = tStatus.msgInCounter;
        stats.bytesInCounter = tStatus.bytesInCounter;
        stats.msgOutCounter = tStatus.msgOutCounter;
        stats.bytesOutCounter = tStatus.bytesOutCounter;
        stats.averageMsgSize = tStatus.averageMsgSize;
        stats.publishRateLimitedTimes = tStatus.publishRateLimitedTimes;
        stats.delayedTrackerMemoryUsage = tStatus.delayedMessageIndexSizeInBytes;
        stats.abortedTxnCount = tStatus.abortedTxnCount;
        stats.ongoingTxnCount = tStatus.ongoingTxnCount;
        stats.committedTxnCount = tStatus.committedTxnCount;

        stats.producersCount = 0;
        topic.getProducers().values().forEach(producer -> {
            if (producer.isRemote()) {
                AggregatedReplicationStats replStats = stats.replicationStats
                        .computeIfAbsent(producer.getRemoteCluster(), k -> new AggregatedReplicationStats());

                replStats.msgRateIn += producer.getStats().msgRateIn;
                replStats.msgThroughputIn += producer.getStats().msgThroughputIn;
            } else {
                // Local producer
                stats.producersCount++;
                stats.rateIn += producer.getStats().msgRateIn;
                stats.throughputIn += producer.getStats().msgThroughputIn;

                if (includeProducerMetrics) {
                    AggregatedProducerStats producerStats = stats.producerStats.computeIfAbsent(
                            producer.getProducerName(), k -> new AggregatedProducerStats());
                    producerStats.producerId = producer.getStats().producerId;
                    producerStats.msgRateIn = producer.getStats().msgRateIn;
                    producerStats.msgThroughputIn = producer.getStats().msgThroughputIn;
                    producerStats.averageMsgSize = producer.getStats().averageMsgSize;
                }
            }
        });

        if (topic instanceof PersistentTopic) {
            tStatus.subscriptions.forEach((subName, subscriptionStats) -> {
                AggregatedSubscriptionStats subsStats = stats.subscriptionStats
                        .computeIfAbsent(subName, k -> new AggregatedSubscriptionStats());
                aggregateTopicStats(stats, subscriptionStats, subsStats);
            });
        } else {
            ((NonPersistentTopicStatsImpl) tStatus).getNonPersistentSubscriptions()
                    .forEach((subName, nonPersistentSubscriptionStats) -> {
                        NonPersistentSubscriptionStatsImpl subscriptionStats =
                                (NonPersistentSubscriptionStatsImpl) nonPersistentSubscriptionStats;
                        AggregatedSubscriptionStats subsStats = stats.subscriptionStats
                                .computeIfAbsent(subName, k -> new AggregatedSubscriptionStats());
                        aggregateTopicStats(stats, subscriptionStats, subsStats);
                        subsStats.msgDropRate += subscriptionStats.getMsgDropRate();
                    });
        }

        // Consumer stats can be a lot if a subscription has many consumers
        if (includeConsumerMetrics) {
            topic.getSubscriptions().forEach((name, subscription) -> {
                AggregatedSubscriptionStats subsStats = stats.subscriptionStats
                        .computeIfAbsent(name, k -> new AggregatedSubscriptionStats());
                subscription.getConsumers().forEach(consumer -> {
                    ConsumerStatsImpl conStats = consumer.getStats();

                    AggregatedConsumerStats consumerStats = subsStats.consumerStat
                            .computeIfAbsent(consumer, k -> new AggregatedConsumerStats());

                    consumerStats.unackedMessages = conStats.unackedMessages;
                    consumerStats.msgRateRedeliver = conStats.msgRateRedeliver;
                    consumerStats.msgRateOut = conStats.msgRateOut;
                    consumerStats.msgAckRate = conStats.messageAckRate;
                    consumerStats.msgThroughputOut = conStats.msgThroughputOut;
                    consumerStats.bytesOutCounter = conStats.bytesOutCounter;
                    consumerStats.msgOutCounter = conStats.msgOutCounter;
                    consumerStats.availablePermits = conStats.availablePermits;
                    consumerStats.blockedSubscriptionOnUnackedMsgs = conStats.blockedConsumerOnUnackedMsgs;
                });
            });
        }

        topic.getReplicators().forEach((cluster, replicator) -> {
            ReplicatorStatsImpl replStats = replicator.getStats();
            AggregatedReplicationStats aggReplStats = stats.replicationStats.get(replicator.getRemoteCluster());
            if (aggReplStats == null) {
                aggReplStats = new AggregatedReplicationStats();
                stats.replicationStats.put(replicator.getRemoteCluster(), aggReplStats);
                aggReplStats.msgRateIn = replStats.msgRateIn;
                aggReplStats.msgThroughputIn = replStats.msgThroughputIn;
            }

            aggReplStats.msgRateOut += replStats.msgRateOut;
            aggReplStats.msgThroughputOut += replStats.msgThroughputOut;
            aggReplStats.replicationBacklog += replStats.replicationBacklog;
            aggReplStats.msgRateExpired += replStats.msgRateExpired;
            aggReplStats.connectedCount += replStats.connected ? 1 : 0;
            aggReplStats.replicationDelayInSeconds += replStats.replicationDelayInSeconds;
        });

        compactorMXBean
                .flatMap(mxBean -> mxBean.getCompactionRecordForTopic(topic.getName()))
                .map(compactionRecord -> {
                    stats.compactionRemovedEventCount = compactionRecord.getCompactionRemovedEventCount();
                    stats.compactionSucceedCount = compactionRecord.getCompactionSucceedCount();
                    stats.compactionFailedCount = compactionRecord.getCompactionFailedCount();
                    stats.compactionDurationTimeInMills = compactionRecord.getCompactionDurationTimeInMills();
                    stats.compactionReadThroughput = compactionRecord.getCompactionReadThroughput();
                    stats.compactionWriteThroughput = compactionRecord.getCompactionWriteThroughput();
                    stats.compactionLatencyBuckets.addAll(compactionRecord.getCompactionLatencyStats());
                    stats.compactionLatencyBuckets.refresh();
                    PersistentTopic persistentTopic = (PersistentTopic) topic;
                    Optional<CompactedTopicContext> compactedTopicContext = persistentTopic
                            .getCompactedTopicContext();
                    if (compactedTopicContext.isPresent()) {
                        LedgerHandle ledger = compactedTopicContext.get().getLedger();
                        long entries = ledger.getLastAddConfirmed() + 1;
                        long size = ledger.getLength();

                        stats.compactionCompactedEntriesCount = entries;
                        stats.compactionCompactedEntriesSize = size;
                    }
                    return compactionRecord;
                });
    }

    private static void printDefaultBrokerStats(PrometheusMetricStreams stream, String cluster) {
        // Print metrics with 0 values. This is necessary to have the available brokers being
        // reported in the brokers dashboard even if they don't have any topic or traffic
        writeMetric(stream, "pulsar_topics_count", 0, cluster);
        writeMetric(stream, "pulsar_subscriptions_count", 0, cluster);
        writeMetric(stream, "pulsar_producers_count", 0, cluster);
        writeMetric(stream, "pulsar_consumers_count", 0, cluster);
        writeMetric(stream, "pulsar_rate_in", 0, cluster);
        writeMetric(stream, "pulsar_rate_out", 0, cluster);
        writeMetric(stream, "pulsar_throughput_in", 0, cluster);
        writeMetric(stream, "pulsar_throughput_out", 0, cluster);
        writeMetric(stream, "pulsar_storage_size", 0, cluster);
        writeMetric(stream, "pulsar_storage_logical_size", 0, cluster);
        writeMetric(stream, "pulsar_storage_write_rate", 0, cluster);
        writeMetric(stream, "pulsar_storage_read_rate", 0, cluster);
        writeMetric(stream, "pulsar_msg_backlog", 0, cluster);
    }

    private static void printTopicsCountStats(PrometheusMetricStreams stream, Map<String, Long> namespaceTopicsCount,
                                              String cluster) {
        namespaceTopicsCount.forEach(
                (ns, topicCount) -> writeMetric(stream, "pulsar_topics_count", topicCount, cluster, ns)
        );
    }

    private static void printNamespaceStats(PrometheusMetricStreams stream, AggregatedNamespaceStats stats,
                                            String cluster, String namespace) {
        writeMetric(stream, "pulsar_topics_count", stats.topicsCount, cluster, namespace);
        writeMetric(stream, "pulsar_subscriptions_count", stats.subscriptionsCount, cluster,
                namespace);
        writeMetric(stream, "pulsar_producers_count", stats.producersCount, cluster, namespace);
        writeMetric(stream, "pulsar_consumers_count", stats.consumersCount, cluster, namespace);

        writeMetric(stream, "pulsar_rate_in", stats.rateIn, cluster, namespace);
        writeMetric(stream, "pulsar_rate_out", stats.rateOut, cluster, namespace);
        writeMetric(stream, "pulsar_throughput_in", stats.throughputIn, cluster, namespace);
        writeMetric(stream, "pulsar_throughput_out", stats.throughputOut, cluster, namespace);
        writeMetric(stream, "pulsar_txn_tb_active_total", stats.ongoingTxnCount, cluster, namespace);
        writeMetric(stream, "pulsar_txn_tb_aborted_total", stats.abortedTxnCount, cluster, namespace);
        writeMetric(stream, "pulsar_txn_tb_committed_total", stats.committedTxnCount, cluster, namespace);
        writeMetric(stream, "pulsar_consumer_msg_ack_rate", stats.messageAckRate, cluster, namespace);

        writeMetric(stream, "pulsar_in_bytes_total", stats.bytesInCounter, cluster, namespace);
        writeMetric(stream, "pulsar_in_messages_total", stats.msgInCounter, cluster, namespace);
        writeMetric(stream, "pulsar_out_bytes_total", stats.bytesOutCounter, cluster, namespace);
        writeMetric(stream, "pulsar_out_messages_total", stats.msgOutCounter, cluster, namespace);

        writeMetric(stream, "pulsar_storage_size", stats.managedLedgerStats.storageSize, cluster,
                namespace);
        writeMetric(stream, "pulsar_storage_logical_size",
                stats.managedLedgerStats.storageLogicalSize, cluster, namespace);
        writeMetric(stream, "pulsar_storage_backlog_size", stats.managedLedgerStats.backlogSize, cluster,
                namespace);
        writeMetric(stream, "pulsar_storage_offloaded_size",
                stats.managedLedgerStats.offloadedStorageUsed, cluster, namespace);

        writeMetric(stream, "pulsar_storage_write_rate", stats.managedLedgerStats.storageWriteRate,
                cluster, namespace);
        writeMetric(stream, "pulsar_storage_read_rate", stats.managedLedgerStats.storageReadRate,
                cluster, namespace);

        writeMetric(stream, "pulsar_subscription_delayed", stats.msgDelayed, cluster, namespace);

        writeMetric(stream, "pulsar_delayed_message_index_size_bytes", stats.delayedTrackerMemoryUsage, cluster,
                namespace);

        writePulsarMsgBacklog(stream, stats.msgBacklog, cluster, namespace);

        stats.managedLedgerStats.storageWriteLatencyBuckets.refresh();
        long[] latencyBuckets = stats.managedLedgerStats.storageWriteLatencyBuckets.getBuckets();
        writeMetric(stream, "pulsar_storage_write_latency_le_0_5", latencyBuckets[0], cluster, namespace);
        writeMetric(stream, "pulsar_storage_write_latency_le_1", latencyBuckets[1], cluster, namespace);
        writeMetric(stream, "pulsar_storage_write_latency_le_5", latencyBuckets[2], cluster, namespace);
        writeMetric(stream, "pulsar_storage_write_latency_le_10", latencyBuckets[3], cluster, namespace);
        writeMetric(stream, "pulsar_storage_write_latency_le_20", latencyBuckets[4], cluster, namespace);
        writeMetric(stream, "pulsar_storage_write_latency_le_50", latencyBuckets[5], cluster, namespace);
        writeMetric(stream, "pulsar_storage_write_latency_le_100", latencyBuckets[6], cluster, namespace);
        writeMetric(stream, "pulsar_storage_write_latency_le_200", latencyBuckets[7], cluster, namespace);
        writeMetric(stream, "pulsar_storage_write_latency_le_1000", latencyBuckets[8], cluster, namespace);
        writeMetric(stream, "pulsar_storage_write_latency_overflow", latencyBuckets[9], cluster, namespace);
        writeMetric(stream, "pulsar_storage_write_latency_count",
                stats.managedLedgerStats.storageWriteLatencyBuckets.getCount(), cluster, namespace);
        writeMetric(stream, "pulsar_storage_write_latency_sum",
                stats.managedLedgerStats.storageWriteLatencyBuckets.getSum(), cluster, namespace);

        stats.managedLedgerStats.storageLedgerWriteLatencyBuckets.refresh();
        long[] ledgerWriteLatencyBuckets = stats.managedLedgerStats.storageLedgerWriteLatencyBuckets.getBuckets();
        writeMetric(stream, "pulsar_storage_ledger_write_latency_le_0_5", ledgerWriteLatencyBuckets[0],
                cluster, namespace);
        writeMetric(stream, "pulsar_storage_ledger_write_latency_le_1", ledgerWriteLatencyBuckets[1],
                cluster, namespace);
        writeMetric(stream, "pulsar_storage_ledger_write_latency_le_5", ledgerWriteLatencyBuckets[2],
                cluster, namespace);
        writeMetric(stream, "pulsar_storage_ledger_write_latency_le_10", ledgerWriteLatencyBuckets[3],
                cluster, namespace);
        writeMetric(stream, "pulsar_storage_ledger_write_latency_le_20", ledgerWriteLatencyBuckets[4],
                cluster, namespace);
        writeMetric(stream, "pulsar_storage_ledger_write_latency_le_50", ledgerWriteLatencyBuckets[5],
                cluster, namespace);
        writeMetric(stream, "pulsar_storage_ledger_write_latency_le_100", ledgerWriteLatencyBuckets[6],
                cluster, namespace);
        writeMetric(stream, "pulsar_storage_ledger_write_latency_le_200", ledgerWriteLatencyBuckets[7],
                cluster, namespace);
        writeMetric(stream, "pulsar_storage_ledger_write_latency_le_1000", ledgerWriteLatencyBuckets[8],
                cluster, namespace);
        writeMetric(stream, "pulsar_storage_ledger_write_latency_overflow", ledgerWriteLatencyBuckets[9],
                cluster, namespace);
        writeMetric(stream, "pulsar_storage_ledger_write_latency_count",
                stats.managedLedgerStats.storageLedgerWriteLatencyBuckets.getCount(), cluster, namespace);
        writeMetric(stream, "pulsar_storage_ledger_write_latency_sum",
                stats.managedLedgerStats.storageLedgerWriteLatencyBuckets.getSum(), cluster, namespace);

        stats.managedLedgerStats.entrySizeBuckets.refresh();
        long[] entrySizeBuckets = stats.managedLedgerStats.entrySizeBuckets.getBuckets();
        writeMetric(stream, "pulsar_entry_size_le_128", entrySizeBuckets[0], cluster, namespace);
        writeMetric(stream, "pulsar_entry_size_le_512", entrySizeBuckets[1], cluster, namespace);
        writeMetric(stream, "pulsar_entry_size_le_1_kb", entrySizeBuckets[2], cluster, namespace);
        writeMetric(stream, "pulsar_entry_size_le_2_kb", entrySizeBuckets[3], cluster, namespace);
        writeMetric(stream, "pulsar_entry_size_le_4_kb", entrySizeBuckets[4], cluster, namespace);
        writeMetric(stream, "pulsar_entry_size_le_16_kb", entrySizeBuckets[5], cluster, namespace);
        writeMetric(stream, "pulsar_entry_size_le_100_kb", entrySizeBuckets[6], cluster, namespace);
        writeMetric(stream, "pulsar_entry_size_le_1_mb", entrySizeBuckets[7], cluster, namespace);
        writeMetric(stream, "pulsar_entry_size_le_overflow", entrySizeBuckets[8], cluster, namespace);
        writeMetric(stream, "pulsar_entry_size_count", stats.managedLedgerStats.entrySizeBuckets.getCount(),
                cluster, namespace);
        writeMetric(stream, "pulsar_entry_size_sum", stats.managedLedgerStats.entrySizeBuckets.getSum(),
                cluster, namespace);

        writeReplicationStat(stream, "pulsar_replication_rate_in", stats,
                replStats -> replStats.msgRateIn, cluster, namespace);
        writeReplicationStat(stream, "pulsar_replication_rate_out", stats,
                replStats -> replStats.msgRateOut, cluster, namespace);
        writeReplicationStat(stream, "pulsar_replication_throughput_in", stats,
                replStats -> replStats.msgThroughputIn, cluster, namespace);
        writeReplicationStat(stream, "pulsar_replication_throughput_out", stats,
                replStats -> replStats.msgThroughputOut, cluster, namespace);
        writeReplicationStat(stream, "pulsar_replication_backlog", stats,
                replStats -> replStats.replicationBacklog, cluster, namespace);
        writeReplicationStat(stream, "pulsar_replication_connected_count", stats,
                replStats -> replStats.connectedCount, cluster, namespace);
        writeReplicationStat(stream, "pulsar_replication_rate_expired", stats,
                replStats -> replStats.msgRateExpired, cluster, namespace);
        writeReplicationStat(stream, "pulsar_replication_delay_in_seconds", stats,
                replStats -> replStats.replicationDelayInSeconds, cluster, namespace);
    }

    private static void writePulsarMsgBacklog(PrometheusMetricStreams stream, Number value,
                                              String cluster, String namespace) {
        stream.writeSample("pulsar_msg_backlog", value, "cluster", cluster, "namespace", namespace,
                "remote_cluster",
                "local");
    }

    private static void writeMetric(PrometheusMetricStreams stream, String metricName, Number value,
                                    String cluster) {
        stream.writeSample(metricName, value, "cluster", cluster);
    }

    private static void writeMetric(PrometheusMetricStreams stream, String metricName, Number value, String cluster,
                                    String namespace) {
        stream.writeSample(metricName, value, "cluster", cluster, "namespace", namespace);
    }

    private static void writeReplicationStat(PrometheusMetricStreams stream, String metricName,
                                             AggregatedNamespaceStats namespaceStats,
                                             Function<AggregatedReplicationStats, Number> sampleValueFunction,
                                             String cluster, String namespace) {
        if (!namespaceStats.replicationStats.isEmpty()) {
            namespaceStats.replicationStats.forEach((remoteCluster, replStats) ->
                    stream.writeSample(metricName, sampleValueFunction.apply(replStats),
                            "cluster", cluster,
                            "namespace", namespace,
                            "remote_cluster", remoteCluster)
            );
        }
    }

}


text:
'use strict';

module.exports = function (project, mod, router) {

  mod.register('home', './routes/home.js');

  router.get('/', mod('home').index);

};


text: Losuj dalej


text:
import { Component } from '@angular/core';

@Component({
    selector: 'pipes',
    templateUrl: './pipes.component.html',
    styleUrls: ['./pipes.scss']
})
export class PipesComponent {}