text:
namespace BankAccounts.Accounts
{
    using System;

    using BankAccounts.Contracts;

    internal class BankAccount : IBankAccount
    {
        private decimal balance;
        private decimal interestRate;

        public BankAccount(ICustomer customer, decimal balance, decimal interestRate)
        {
            this.Customer = customer;
            this.Balance = balance;
            this.InterestRate = interestRate;
        }

        public decimal Balance
        {
            get
            {
                return this.balance;
            }

            protected set
            {
                if (value < 0M)
                {
                    throw new ArgumentException("Acoount balance cannot be negative!");
                }

                this.balance = value;
            }
        }

        public ICustomer Customer { get; private set; }

        public decimal InterestRate
        {
            get
            {
                return this.interestRate;
            }

            private set
            {
                if (value < 0M)
                {
                    throw new ArgumentException("Acoount interest rate cannot be negative!");
                }

                this.interestRate = value;
            }
        }

        public virtual decimal CalculateInterestAmount(int months)
        {
            decimal interestAmount = months * this.InterestRate;
            return interestAmount;
        }
    }
}


text:
package  aksw.org.sdw.rdf.namespaces;

public class SKOS {

	public static final String corePrefix = "http://www.w3.org/2004/02/skos/core#";

	public static final String prefLabel = corePrefix + "prefLabel";
	public static final String altLabel = corePrefix + "altLabel";
	public static final String notation = corePrefix + "notation";

}

redpajama_set_name: RedPajamaGithub


text:
namespace StatsViewer
{
  partial class StatsViewer
  {
    /// <summary>
    /// Required designer variable.
    /// </summary>
    private System.ComponentModel.IContainer components = null;

    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    protected override void Dispose(bool disposing)
    {
      if (disposing && (components != null))
      {
        components.Dispose();
      }
      base.Dispose(disposing);
    }

    #region Windows Form Designer generated code

    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    {
      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(StatsViewer));
      this.listViewCounters = new System.Windows.Forms.ListView();
      this.columnHeaderName = new System.Windows.Forms.ColumnHeader();
      this.columnHeaderValue = new System.Windows.Forms.ColumnHeader();
      this.columnHeaderDelta = new System.Windows.Forms.ColumnHeader();
      this.pictureBoxTitle = new System.Windows.Forms.PictureBox();
      this.panelHeader = new System.Windows.Forms.Panel();
      this.labelKills = new System.Windows.Forms.Label();
      this.label1 = new System.Windows.Forms.Label();
      this.labelInterval = new System.Windows.Forms.Label();
      this.comboBoxFilter = new System.Windows.Forms.ComboBox();
      this.panelControls = new System.Windows.Forms.Panel();
      this.buttonExport = new System.Windows.Forms.Button();
      this.buttonZero = new System.Windows.Forms.Button();
      this.comboBoxInterval = new System.Windows.Forms.ComboBox();
      this.labelFilter = new System.Windows.Forms.Label();
      this.saveFileDialogExport = new System.Windows.Forms.SaveFileDialog();
      this.menuStrip1 = new System.Windows.Forms.MenuStrip();
      this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
      this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
      this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
      this.quitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
      this.listViewRates = new System.Windows.Forms.ListView();
      this.columnHeaderRateName = new System.Windows.Forms.ColumnHeader();
      this.columnHeaderRateCount = new System.Windows.Forms.ColumnHeader();
      this.columnHeaderRateTotaltime = new System.Windows.Forms.ColumnHeader();
      this.columnHeaderRateAvgTime = new System.Windows.Forms.ColumnHeader();
      this.splitContainer1 = new System.Windows.Forms.SplitContainer();
      ((System.ComponentModel.ISupportInitialize)(this.pictureBoxTitle)).BeginInit();
      this.panelHeader.SuspendLayout();
      this.panelControls.SuspendLayout();
      this.menuStrip1.SuspendLayout();
      this.splitContainer1.Panel1.SuspendLayout();
      this.splitContainer1.Panel2.SuspendLayout();
      this.splitContainer1.SuspendLayout();
      this.SuspendLayout();
      //
      // listViewCounters
      //
      this.listViewCounters.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
            this.columnHeaderName,
            this.columnHeaderValue,
            this.columnHeaderDelta});
      this.listViewCounters.Dock = System.Windows.Forms.DockStyle.Fill;
      this.listViewCounters.FullRowSelect = true;
      this.listViewCounters.Location = new System.Drawing.Point(0, 0);
      this.listViewCounters.Name = "listViewCounters";
      this.listViewCounters.Size = new System.Drawing.Size(505, 221);
      this.listViewCounters.Sorting = System.Windows.Forms.SortOrder.Descending;
      this.listViewCounters.TabIndex = 0;
      this.listViewCounters.UseCompatibleStateImageBehavior = false;
      this.listViewCounters.View = System.Windows.Forms.View.Details;
      this.listViewCounters.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.column_Click);
      //
      // columnHeaderName
      //
      this.columnHeaderName.Text = "Counter Name";
      this.columnHeaderName.Width = 203;
      //
      // columnHeaderValue
      //
      this.columnHeaderValue.Text = "Value";
      this.columnHeaderValue.Width = 69;
      //
      // columnHeaderDelta
      //
      this.columnHeaderDelta.Text = "Delta";
      this.columnHeaderDelta.Width = 86;
      //
      // pictureBoxTitle
      //
      this.pictureBoxTitle.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
      this.pictureBoxTitle.BackColor = System.Drawing.Color.Transparent;
      this.pictureBoxTitle.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxTitle.Image")));
      this.pictureBoxTitle.Location = new System.Drawing.Point(257, 0);
      this.pictureBoxTitle.Name = "pictureBoxTitle";
      this.pictureBoxTitle.Size = new System.Drawing.Size(248, 86);
      this.pictureBoxTitle.TabIndex = 1;
      this.pictureBoxTitle.TabStop = false;
      //
      // panelHeader
      //
      this.panelHeader.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panelHeader.BackgroundImage")));
      this.panelHeader.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
      this.panelHeader.Controls.Add(this.labelKills);
      this.panelHeader.Controls.Add(this.label1);
      this.panelHeader.Controls.Add(this.pictureBoxTitle);
      this.panelHeader.Dock = System.Windows.Forms.DockStyle.Top;
      this.panelHeader.Location = new System.Drawing.Point(0, 24);
      this.panelHeader.Name = "panelHeader";
      this.panelHeader.Size = new System.Drawing.Size(505, 86);
      this.panelHeader.TabIndex = 2;
      //
      // labelKills
      //
      this.labelKills.AutoSize = true;
      this.labelKills.BackColor = System.Drawing.Color.Transparent;
      this.labelKills.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
      this.labelKills.Location = new System.Drawing.Point(12, 33);
      this.labelKills.Name = "labelKills";
      this.labelKills.Size = new System.Drawing.Size(280, 16);
      this.labelKills.TabIndex = 3;
      this.labelKills.Text = "During the World Wide Wait, God Kills Kittens.";
      //
      // label1
      //
      this.label1.AutoSize = true;
      this.label1.BackColor = System.Drawing.Color.Transparent;
      this.label1.Font = new System.Drawing.Font("Arial", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
      this.label1.Location = new System.Drawing.Point(12, 9);
      this.label1.Name = "label1";
      this.label1.Size = new System.Drawing.Size(140, 24);
      this.label1.TabIndex = 2;
      this.label1.Text = "Chrome Varz";
      //
      // labelInterval
      //
      this.labelInterval.AutoSize = true;
      this.labelInterval.Location = new System.Drawing.Point(11, 9);
      this.labelInterval.Name = "labelInterval";
      this.labelInterval.Size = new System.Drawing.Size(73, 13);
      this.labelInterval.TabIndex = 3;
      this.labelInterval.Text = "Interval (secs)";
      //
      // comboBoxFilter
      //
      this.comboBoxFilter.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
      this.comboBoxFilter.FormattingEnabled = true;
      this.comboBoxFilter.Location = new System.Drawing.Point(302, 5);
      this.comboBoxFilter.Name = "comboBoxFilter";
      this.comboBoxFilter.Size = new System.Drawing.Size(121, 21);
      this.comboBoxFilter.TabIndex = 5;
      this.comboBoxFilter.SelectedIndexChanged += new System.EventHandler(this.filter_changed);
      this.comboBoxFilter.DropDownClosed += new System.EventHandler(this.mouse_Leave);
      this.comboBoxFilter.DropDown += new System.EventHandler(this.mouse_Enter);
      //
      // panelControls
      //
      this.panelControls.Controls.Add(this.buttonExport);
      this.panelControls.Controls.Add(this.buttonZero);
      this.panelControls.Controls.Add(this.comboBoxInterval);
      this.panelControls.Controls.Add(this.labelFilter);
      this.panelControls.Controls.Add(this.comboBoxFilter);
      this.panelControls.Controls.Add(this.labelInterval);
      this.panelControls.Dock = System.Windows.Forms.DockStyle.Top;
      this.panelControls.Location = new System.Drawing.Point(0, 110);
      this.panelControls.Name = "panelControls";
      this.panelControls.Size = new System.Drawing.Size(505, 32);
      this.panelControls.TabIndex = 6;
      //
      // buttonExport
      //
      this.buttonExport.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
      this.buttonExport.Location = new System.Drawing.Point(187, 4);
      this.buttonExport.Name = "buttonExport";
      this.buttonExport.Size = new System.Drawing.Size(75, 23);
      this.buttonExport.TabIndex = 9;
      this.buttonExport.Text = "Export";
      this.buttonExport.UseVisualStyleBackColor = true;
      this.buttonExport.Click += new System.EventHandler(this.buttonExport_Click);
      //
      // buttonZero
      //
      this.buttonZero.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
      this.buttonZero.Location = new System.Drawing.Point(427, 4);
      this.buttonZero.Name = "buttonZero";
      this.buttonZero.Size = new System.Drawing.Size(75, 23);
      this.buttonZero.TabIndex = 8;
      this.buttonZero.Text = "Clear All";
      this.buttonZero.UseVisualStyleBackColor = true;
      this.buttonZero.Click += new System.EventHandler(this.buttonZero_Click);
      //
      // comboBoxInterval
      //
      this.comboBoxInterval.FormattingEnabled = true;
      this.comboBoxInterval.Items.AddRange(new object[] {
            "1",
            "2",
            "5",
            "10",
            "30",
            "60"});
      this.comboBoxInterval.Location = new System.Drawing.Point(84, 6);
      this.comboBoxInterval.Name = "comboBoxInterval";
      this.comboBoxInterval.Size = new System.Drawing.Size(55, 21);
      this.comboBoxInterval.TabIndex = 7;
      this.comboBoxInterval.Text = "1";
      this.comboBoxInterval.SelectedIndexChanged += new System.EventHandler(this.interval_changed);
      this.comboBoxInterval.DropDownClosed += new System.EventHandler(this.mouse_Leave);
      this.comboBoxInterval.DropDown += new System.EventHandler(this.mouse_Enter);
      //
      // labelFilter
      //
      this.labelFilter.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
      this.labelFilter.AutoSize = true;
      this.labelFilter.Location = new System.Drawing.Point(268, 9);
      this.labelFilter.Name = "labelFilter";
      this.labelFilter.Size = new System.Drawing.Size(29, 13);
      this.labelFilter.TabIndex = 6;
      this.labelFilter.Text = "Filter";
      //
      // saveFileDialogExport
      //
      this.saveFileDialogExport.FileName = "results.txt";
      //
      // menuStrip1
      //
      this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.fileToolStripMenuItem});
      this.menuStrip1.Location = new System.Drawing.Point(0, 0);
      this.menuStrip1.Name = "menuStrip1";
      this.menuStrip1.Size = new System.Drawing.Size(505, 24);
      this.menuStrip1.TabIndex = 7;
      this.menuStrip1.Text = "menuStrip1";
      //
      // fileToolStripMenuItem
      //
      this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.openToolStripMenuItem,
            this.closeToolStripMenuItem,
            this.quitToolStripMenuItem});
      this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
      this.fileToolStripMenuItem.Size = new System.Drawing.Size(35, 20);
      this.fileToolStripMenuItem.Text = "File";
      //
      // openToolStripMenuItem
      //
      this.openToolStripMenuItem.Name = "openToolStripMenuItem";
      this.openToolStripMenuItem.Size = new System.Drawing.Size(111, 22);
      this.openToolStripMenuItem.Text = "Open";
      this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click);
      //
      // closeToolStripMenuItem
      //
      this.closeToolStripMenuItem.Name = "closeToolStripMenuItem";
      this.closeToolStripMenuItem.Size = new System.Drawing.Size(111, 22);
      this.closeToolStripMenuItem.Text = "Close";
      this.closeToolStripMenuItem.Click += new System.EventHandler(this.closeToolStripMenuItem_Click);
      //
      // quitToolStripMenuItem
      //
      this.quitToolStripMenuItem.Name = "quitToolStripMenuItem";
      this.quitToolStripMenuItem.Size = new System.Drawing.Size(111, 22);
      this.quitToolStripMenuItem.Text = "Quit";
      this.quitToolStripMenuItem.Click += new System.EventHandler(this.quitToolStripMenuItem_Click);
      //
      // listViewRates
      //
      this.listViewRates.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
            this.columnHeaderRateName,
            this.columnHeaderRateCount,
            this.columnHeaderRateTotaltime,
            this.columnHeaderRateAvgTime});
      this.listViewRates.Dock = System.Windows.Forms.DockStyle.Fill;
      this.listViewRates.FullRowSelect = true;
      this.listViewRates.Location = new System.Drawing.Point(0, 0);
      this.listViewRates.Name = "listViewRates";
      this.listViewRates.Size = new System.Drawing.Size(505, 270);
      this.listViewRates.Sorting = System.Windows.Forms.SortOrder.Descending;
      this.listViewRates.TabIndex = 8;
      this.listViewRates.UseCompatibleStateImageBehavior = false;
      this.listViewRates.View = System.Windows.Forms.View.Details;
      //
      // columnHeaderRateName
      //
      this.columnHeaderRateName.Text = "Rate Name";
      this.columnHeaderRateName.Width = 205;
      //
      // columnHeaderRateCount
      //
      this.columnHeaderRateCount.Text = "Count";
      //
      // columnHeaderRateTotaltime
      //
      this.columnHeaderRateTotaltime.Text = "Total Time (ms)";
      this.columnHeaderRateTotaltime.Width = 100;
      //
      // columnHeaderRateAvgTime
      //
      this.columnHeaderRateAvgTime.Text = "Average Time (ms)";
      this.columnHeaderRateAvgTime.Width = 110;
      //
      // splitContainer1
      //
      this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
      this.splitContainer1.Location = new System.Drawing.Point(0, 142);
      this.splitContainer1.Name = "splitContainer1";
      this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
      //
      // splitContainer1.Panel1
      //
      this.splitContainer1.Panel1.Controls.Add(this.listViewCounters);
      //
      // splitContainer1.Panel2
      //
      this.splitContainer1.Panel2.Controls.Add(this.listViewRates);
      this.splitContainer1.Size = new System.Drawing.Size(505, 495);
      this.splitContainer1.SplitterDistance = 221;
      this.splitContainer1.TabIndex = 9;
      //
      // StatsViewer
      //
      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
      this.ClientSize = new System.Drawing.Size(505, 637);
      this.Controls.Add(this.splitContainer1);
      this.Controls.Add(this.panelControls);
      this.Controls.Add(this.panelHeader);
      this.Controls.Add(this.menuStrip1);
      this.DoubleBuffered = true;
      this.Name = "StatsViewer";
      this.Text = "Chrome Varz";
      ((System.ComponentModel.ISupportInitialize)(this.pictureBoxTitle)).EndInit();
      this.panelHeader.ResumeLayout(false);
      this.panelHeader.PerformLayout();
      this.panelControls.ResumeLayout(false);
      this.panelControls.PerformLayout();
      this.menuStrip1.ResumeLayout(false);
      this.menuStrip1.PerformLayout();
      this.splitContainer1.Panel1.ResumeLayout(false);
      this.splitContainer1.Panel2.ResumeLayout(false);
      this.splitContainer1.ResumeLayout(false);
      this.ResumeLayout(false);
      this.PerformLayout();

    }

    #endregion

    private System.Windows.Forms.ListView listViewCounters;
    private System.Windows.Forms.ColumnHeader columnHeaderName;
    private System.Windows.Forms.ColumnHeader columnHeaderValue;
    private System.Windows.Forms.ColumnHeader columnHeaderDelta;
    private System.Windows.Forms.PictureBox pictureBoxTitle;
    private System.Windows.Forms.Panel panelHeader;
    private System.Windows.Forms.Label label1;
    private System.Windows.Forms.Label labelInterval;
    private System.Windows.Forms.ComboBox comboBoxFilter;
    private System.Windows.Forms.Panel panelControls;
    private System.Windows.Forms.Label labelFilter;
    private System.Windows.Forms.ComboBox comboBoxInterval;
    private System.Windows.Forms.Label labelKills;
    private System.Windows.Forms.Button buttonZero;
    private System.Windows.Forms.Button buttonExport;
    private System.Windows.Forms.SaveFileDialog saveFileDialogExport;
    private System.Windows.Forms.MenuStrip menuStrip1;
    private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
    private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
    private System.Windows.Forms.ToolStripMenuItem closeToolStripMenuItem;
    private System.Windows.Forms.ToolStripMenuItem quitToolStripMenuItem;
    private System.Windows.Forms.ListView listViewRates;
    private System.Windows.Forms.ColumnHeader columnHeaderRateName;
    private System.Windows.Forms.ColumnHeader columnHeaderRateCount;
    private System.Windows.Forms.ColumnHeader columnHeaderRateTotaltime;
    private System.Windows.Forms.ColumnHeader columnHeaderRateAvgTime;
    private System.Windows.Forms.SplitContainer splitContainer1;
  }
}


text:
<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Sentry switch
    |--------------------------------------------------------------------------
    |
    | Set the following value to true to enable logging via Sentry. Of course,
    | you'll have to set your DSN as well. Usually, we put the followig switch
    | along with the environment variables. Like so:
    |
    | 'enabled' => env('SENTRY_ENABLED', false)
    |
    */

    'enabled' => false,

    /*
    |--------------------------------------------------------------------------
    | DSN
    |--------------------------------------------------------------------------
    |
    | In your Sentry dashboard, create a new project and grab your DSN from the
    | settings. Usually, this can be found under Settings -> Client Keys
    |
    | The format of the DSN is usally like this:
    | http://public:secret@example.com/1
    |
    */

    'dsn'     => '',

    /*
    |--------------------------------------------------------------------------
    | Options
    |--------------------------------------------------------------------------
    |
    | You can add Raven options as an array through this variable. A list of
    | available options can be found here:
    |
    | https://github.com/getsentry/raven-php#configuration
    |
    */

    'options' => [

        /*
        |--------------------------------------------------------------------------
        | name
        |--------------------------------------------------------------------------
        |
        | A string to override the default value for the server's hostname.
        |
        | Defaults to Raven_Compat::gethostname().
        |
        */

        'name'          => Raven_Compat::gethostname(),

        /*
        |--------------------------------------------------------------------------
        | tags
        |--------------------------------------------------------------------------
        |
        | An array of tags to apply to events in this context.
        |
        */

        'tags'          => [],

        /*
        |--------------------------------------------------------------------------
        | curl_method
        |--------------------------------------------------------------------------
        |
        | Defaults to 'sync'.
        |
        | Available methods:
        | - sync (default): send requests immediately when they're made
        | - async: uses a curl_multi handler for best-effort asynchronous submissions
        | - exec: asynchronously send events by forking a curl process for each item
        |
        */

        'curl_method'   => 'sync',

        /*
        |--------------------------------------------------------------------------
        | curl_path
        |--------------------------------------------------------------------------
        |
        | Defaults to 'curl'.
        |
        | Specify the path to the curl binary to be used with the 'exec' curl method.
        |
        */

        'curl_path'     => 'curl',

        /*
        |--------------------------------------------------------------------------
        | trace
        |--------------------------------------------------------------------------
        |
        | Set this to false to disable reflection tracing (function calling
        | arguments) in stacktraces.
        |
        */

        'trace'         => true,

        /*
        |--------------------------------------------------------------------------
        | logger
        |--------------------------------------------------------------------------
        |
        | Adjust the default logger name for messages.
        |
        | Defaults to `php`.
        |
        */

        'logger'        => 'php',

        /*
        |--------------------------------------------------------------------------
        | ca_cert
        |--------------------------------------------------------------------------
        |
        | The path to the CA certificate bundle.
        |
        | Defaults to the common bundle which includes getsentry.com:
        | ./data/cacert.pem
        |
        | Caveats:
        | - The CA bundle is ignored unless curl throws an error suggesting it
        | needs a cert.
        | - The option is only currently used within the synchronous curl transport.
        |
        */

        //'ca_cert'     => '',

        /*
        |--------------------------------------------------------------------------
        | curl_ssl_version
        |--------------------------------------------------------------------------
        |
        | The SSL version (2 or 3) to use. By default PHP will try to determine
        | this itself, although in some cases this must be set manually.
        |
        */

        //'curl_ssl_version'     => 3,

        /*
        |--------------------------------------------------------------------------
        | message_limit
        |--------------------------------------------------------------------------
        |
        | Defaults to 1024 characters.
        |
        | This value is used to truncate message and frame variables. However it is not guarantee that length of whole message will be restricted by this value.
        |
        */

        'message_limit' => 1024,

        /*
        |--------------------------------------------------------------------------
        | processors
        |--------------------------------------------------------------------------
        |
        | An array of classes to use to process data before it is sent to Sentry.
        | By default, Raven_SanitizeDataProcessor is used
        |
        */

        //'processors' => [],

        /*
        |--------------------------------------------------------------------------
        | processorOptions
        |--------------------------------------------------------------------------
        |
        | Options that will be passed on to a setProcessorOptions() function in a
        | Raven_Processor sub-class before that Processor is added to the list of
        | processors used by Raven_Client.
        |
        | An example of overriding the regular expressions can be found in the
        | documentation.
        |
        */

        //'processorOptions' => [],

    ]

];


text:
<?php

namespace Botonomous;

use PHPUnit\Framework\TestCase;

/**
 * Class CommandTest.
 */

/** @noinspection PhpUndefinedClassInspection */
class CommandContainerTest extends TestCase
{
    /**
     * Test get.
     */
    public function testGet()
    {
        $commandContainer = new CommandContainer();
        $commandObject = $commandContainer->getAsObject('ping');

        $this->assertTrue($commandObject instanceof Command);

        /* @noinspection PhpUndefinedMethodInspection */
        $this->assertEquals($commandObject->getPlugin(), 'Ping');
    }

    /**
     * Test getAll.
     */
    public function testGetAllAsObject()
    {
        $commands = (new CommandContainer())->getAllAsObject();
        /* @noinspection PhpUndefinedMethodInspection */
        $this->assertEquals($commands['ping']->getPlugin(), 'Ping');
    }

    /**
     * Test getAll.
     */
    public function testGetAllAsObjectUnknownSetter()
    {
        $commands = new CommandContainer();
        $allCommands = $commands->getAll();

        // set unknown attribute / property
        $allCommands['ping']['testKey'] = 'testValue';

        $commands->setAll($allCommands);

        $commandObjects = $commands->getAllAsObject();

        /* @noinspection PhpUndefinedMethodInspection */
        $this->assertEquals($commandObjects['ping']->getPlugin(), 'Ping');
    }

    /**
     * Test getAll.
     */
    public function testGetAllAsObjectEmpty()
    {
        $commands = new CommandContainer();

        $allCommands = $commands->getAll();

        $commands->setAll([]);

        /* @noinspection PhpUndefinedMethodInspection */
        $this->assertEquals([], $commands->getAllAsObject());

        // reset the command container
        $commands->setAll($allCommands);
    }
}


text:
// **********
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
// **********

#ifndef SRC_CORE_JSONS_H_
#define SRC_CORE_JSONS_H_

#include "util/rc.h"
#include "util/string-view.h"
#include "util/string.h"
#include "util/unique.h"
#include "util/vector.h"

class JSONArray;
class JSONObject;

class JSONObject {
 public:
    virtual ~JSONObject() = default;

    virtual Vector<StringView> names() noexcept = 0;

    virtual bool hasBool(StringView name) noexcept = 0;
    virtual bool hasInt(StringView name) noexcept = 0;
    virtual bool hasUnsigned(StringView name) noexcept = 0;
    virtual bool hasFloat(StringView name) noexcept = 0;
    virtual bool hasString(StringView name) noexcept = 0;
    virtual bool hasObject(StringView name) noexcept = 0;
    virtual bool hasArray(StringView name) noexcept = 0;

    virtual bool hasStringFloat(StringView name) noexcept = 0;

    virtual bool boolAt(StringView name) noexcept = 0;
    virtual int intAt(StringView name) noexcept = 0;
    virtual int intAt(StringView name,
                      int lowerBound,
                      int upperBound) noexcept = 0;
    virtual unsigned unsignedAt(StringView name) noexcept = 0;
    virtual float floatAt(StringView name) noexcept = 0;
    virtual StringView stringAt(StringView name) noexcept = 0;
    virtual Unique<JSONObject> objectAt(StringView name) noexcept = 0;
    virtual Unique<JSONArray> arrayAt(StringView name) noexcept = 0;

    virtual float stringFloatAt(StringView name) noexcept = 0;
};

class JSONArray {
 public:
    virtual ~JSONArray() = default;

    virtual size_t size() noexcept = 0;

    virtual bool isBool(size_t index) noexcept = 0;
    virtual bool isInt(size_t index) noexcept = 0;
    virtual bool isUnsigned(size_t index) noexcept = 0;
    virtual bool isFloat(size_t index) noexcept = 0;
    virtual bool isString(size_t index) noexcept = 0;
    virtual bool isObject(size_t index) noexcept = 0;
    virtual bool isArray(size_t index) noexcept = 0;

    virtual bool boolAt(size_t index) noexcept = 0;
    virtual int intAt(size_t index) noexcept = 0;
    virtual unsigned unsignedAt(size_t index) noexcept = 0;
    virtual float floatAt(size_t index) noexcept = 0;
    virtual StringView stringAt(size_t index) noexcept = 0;
    virtual Unique<JSONObject> objectAt(size_t index) noexcept = 0;
    virtual Unique<JSONArray> arrayAt(size_t index) noexcept = 0;
};

class JSONs {
 public:
    //! Load a JSON document.
    static Rc<JSONObject> load(StringView path) noexcept;

    //! Parse a document from the outside world.
    static Unique<JSONObject> parse(String data) noexcept;

    //! Free JSON documents not recently used.
    static void garbageCollect() noexcept;
};

#endif  // SRC_CORE_JSONS_H_


text:
<?php // DONE
$subtitle = 'CY004A';
// CY-4-A KENWORTH BOAT TRANSPORTER, issued 1982
$desc = "Peterbilt Boat";
$year = '1982';

$defaults = ['mod' => $subtitle,
	    'cab' => 'MB103', 'tlr' => 'CYT08', 'mfg' => 'England',
	    'liv' => 'none', 'cod' => '1',
];

$models = [
// 1. Light orange cab, boat with light orange hull & green windows, silver-gray trailer, England casting
    ['var' => '01a', 'mfg' => 'England',
	'cdt' => 'light orange', 'cva' => '005B',
	'tdt' => 'silver-gray, boat with light orange hull and green windows',
    ],
// 2. Light orange cab, boat with dark orange hull & green windows, silver-gray trailer, England casting
    ['var' => '02a', 'mfg' => 'England',
	'cdt' => 'light orange', 'cva' => '005B',
	'tdt' => 'silver-gray, boat with dark orange hull and green windows',
    ],
// 3. Dark orange cab, boat with dark orange hull & green windows, silver-gray trailer, England casting
    ['var' => '03a', 'mfg' => 'England',
	'cdt' => 'dark orange', 'cva' => '006B',
	'tdt' => 'silver-gray, boat with dark orange hull and green windows',
    ],
// 4. Dark orange cab, boat with light orange hull & green windows, silver-gray trailer, England casting
    ['var' => '04a', 'mfg' => 'England',
	'cdt' => 'dark orange', 'cva' => '006B',
	'tdt' => 'silver-gray, boat with light orange hull and green windows',
    ],
// 5. Dark orange cab, boat with dark orange hull & red windows, silver-gray trailer, England casting
    ['var' => '05a', 'mfg' => 'England',
	'cdt' => 'dark orange', 'cva' => '006B',
	'tdt' => 'silver-gray, boat with dark orange hull and red windows',
    ],
// 6. Dark orange cab, boat with dark orange hull & clear windows, silver-gray trailer, England casting
    ['var' => '06a', 'mfg' => 'England',
	'cdt' => 'dark orange', 'cva' => '006B',
	'tdt' => 'silver-gray, boat with dark orange hull and colorless windows',
    ],
// 7. Dark orange cab, boat with dark orange hull & green windows, pearly silver trailer, Macau casting
    ['var' => '07a', 'mfg' => 'Macau',
	'cdt' => 'dark orange', 'cva' => '006B',
	'tdt' => 'pearly silver, boat with dark orange hull and green windows',
    ],
// 8. Very light orange cab, boat with dark orange hull & green windows, pearly silver trailer, Macau casting (S6-8)
    ['var' => '08a', 'mfg' => 'Macau',
	'cdt' => 'very light orange', 'cva' => '016BA',
	'tdt' => 'pearly silver, boat with dark orange hull and green windows',
    ],
    ['var' => '08b', 'mfg' => 'Macau',
	'cdt' => 'very light orange', 'cva' => '016BA',
	'tdt' => 'pearly silver, boat with dark orange hull and colorless windows',
    ],
];

include "cypage.php";

function body() {
    global $models;
    show_table($models);
}
?>


text:
<?php
/**
 * Config-file for Allan. Change settings here to affect installation.
 *
 */

/**
 * Set the error reporting.
 *
 */
error_reporting(-1);              // Report all type of errors
ini_set('display_errors', 1);     // Display all errors
ini_set('output_buffering', 0);   // Do not buffer outputs, write directly

/**
 * Define Allan paths.
 *
 */
define('ALLAN_INSTALL_PATH', __DIR__ . '/..');
define('ALLAN_THEME_PATH', ALLAN_INSTALL_PATH . '/theme/render.php');

/**
 * Include bootstrapping functions.
 *
 */
include(ALLAN_INSTALL_PATH . '/src/bootstrap.php');

/**
 * Start the session.
 *
 */
session_name(preg_replace('/[:\.\/-_]/', '', __DIR__));
session_start();

/**
 * Create the Allan variable.
 *
 */
$allan = array();

/**
 * Site wide settings.
 *
 */
$allan['lang']         = 'sv';
$allan['title_append'] = ' | Allan en webbtemplate';

$allan['header'] = <<<EOD

Allan webbtemplate
Återanvändbara moduler för webbutveckling med PHP
EOD;

$allan['footer'] = <<<EOD
Copyright (c) Emily Elmseld (emily.elmseld@gmail.com) | Unicorn
EOD;

/**
 * Theme related settings.
 *
 */
//$allan['stylesheet'] = 'css/style.css';
$allan['stylesheets'] = array('css/style.css');
$allan['favicon']    = 'favicon.ico';

/**
 * Settings for JavaScript.
 *
 */
$allan['modernizr'] = 'js/modernizr.js';
$allan['jquery'] = '//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js';
//$allan['jquery'] = null; // To disable jQuery
$allan['javascript_include'] = array();
//$allan['javascript_include'] = array('js/main.js'); // To add extra javascript files

/**
 * Google analytics.
 *
 */
$allan['google_analytics'] = 'UA-22093351-1'; // Set to null to disable google analytics


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Ocellularia conglomerata Hale

### Remarks
null


text:
package org.apache.geode.cache.client.internal;

import static org.apache.geode.distributed.ConfigurationProperties.ENABLE_CLUSTER_CONFIGURATION;
import static org.apache.geode.distributed.ConfigurationProperties.GROUPS;
import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
import static org.apache.geode.distributed.ConfigurationProperties.LOG_LEVEL;
import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
import static org.apache.geode.distributed.ConfigurationProperties.START_LOCATOR;

import org.apache.commons.lang.StringUtils;
import org.apache.geode.cache.AttributesFactory;
import org.apache.geode.cache.Cache;
import org.apache.geode.cache.CacheFactory;
import org.apache.geode.cache.DataPolicy;
import org.apache.geode.cache.RegionAttributes;
import org.apache.geode.cache.Scope;
import org.apache.geode.cache.client.Pool;
import org.apache.geode.cache.client.PoolManager;
import org.apache.geode.cache.server.CacheServer;
import org.apache.geode.cache.server.ServerLoadProbe;
import org.apache.geode.distributed.DistributedSystem;
import org.apache.geode.distributed.Locator;
import org.apache.geode.internal.cache.PoolFactoryImpl;
import org.apache.geode.test.dunit.Assert;
import org.apache.geode.test.dunit.Host;
import org.apache.geode.test.dunit.Invoke;
import org.apache.geode.test.dunit.LogWriterUtils;
import org.apache.geode.test.dunit.NetworkUtils;
import org.apache.geode.test.dunit.SerializableCallable;
import org.apache.geode.test.dunit.SerializableRunnable;
import org.apache.geode.test.dunit.VM;
import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;

import java.io.File;
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.UnknownHostException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Properties;
import java.util.Set;

/**
 *
 */
public abstract class LocatorTestBase extends JUnit4DistributedTestCase {
  protected static final String CACHE_KEY = "CACHE";
  protected static final String LOCATOR_KEY = "LOCATOR";
  protected static final String REGION_NAME = "A_REGION";
  protected static final String POOL_NAME = "daPool";
  protected static final Object CALLBACK_KEY = "callback";
  /**
   * A map for storing temporary objects in a remote VM so that they can be used between calls.
   * Cleared after each test.
   */
  protected static final HashMap remoteObjects = new HashMap();

  public LocatorTestBase() {
    super();
  }

  @Override
  public final void preTearDown() throws Exception {

    SerializableRunnable tearDown = new SerializableRunnable("tearDown") {
      public void run() {
        Locator locator = (Locator) remoteObjects.get(LOCATOR_KEY);
        if (locator != null) {
          try {
            locator.stop();
          } catch (Exception e) {
            // do nothing
          }
        }

        Cache cache = (Cache) remoteObjects.get(CACHE_KEY);
        if (cache != null) {
          try {
            cache.close();
          } catch (Exception e) {
            // do nothing
          }
        }
        remoteObjects.clear();

      }
    };
    // We seem to like leaving the DS open if we can for
    // speed, but lets at least destroy our cache and locator.
    Invoke.invokeInEveryVM(tearDown);
    tearDown.run();

    postTearDownLocatorTestBase();
  }

  protected void postTearDownLocatorTestBase() throws Exception {}

  protected void startLocator(final String hostName, final int locatorPort,
      final String otherLocators) {
    final String testName = getUniqueName();
    disconnectFromDS();
    Properties props = new Properties();
    props.setProperty(MCAST_PORT, String.valueOf(0));
    props.setProperty(LOCATORS, otherLocators);
    props.setProperty(LOG_LEVEL, LogWriterUtils.getDUnitLogLevel());
    props.setProperty(ENABLE_CLUSTER_CONFIGURATION, "false");
    try {
      File logFile = new File(testName + "-locator" + locatorPort + ".log");
      InetAddress bindAddr = null;
      try {
        bindAddr = InetAddress.getByName(hostName);
      } catch (UnknownHostException uhe) {
        Assert.fail("While resolving bind address ", uhe);
      }
      Locator locator = Locator.startLocatorAndDS(locatorPort, logFile, bindAddr, props);
      remoteObjects.put(LOCATOR_KEY, locator);
    } catch (IOException ex) {
      Assert.fail("While starting locator on port " + locatorPort, ex);
    }
  }

  protected void startLocatorInVM(final VM vm, final int locatorPort, final String otherLocators) {
    vm.invoke(new SerializableRunnable("Create Locator") {
      public void run() {
        String hostName = NetworkUtils.getServerHostName(vm.getHost());
        startLocator(hostName, locatorPort, otherLocators);
      }
    });
  }

  protected void stopLocatorInVM(VM vm) {
    vm.invoke(new SerializableRunnable("Stop Locator") {
      public void run() {
        stopLocator();
      }
    });
  }

  protected void stopLocator() {
    Locator locator = (Locator) remoteObjects.remove(LOCATOR_KEY);
    locator.stop();
  }

  protected int startBridgeServerInVM(VM vm, String[] groups, String locators) {
    return startBridgeServerInVM(vm, groups, locators, new String[] {REGION_NAME});
  }

  protected int addCacheServer(final String[] groups) throws IOException {
    Cache cache = (Cache) remoteObjects.get(CACHE_KEY);
    CacheServer server = cache.addCacheServer();
    server.setPort(0);
    server.setGroups(groups);
    server.start();
    return new Integer(server.getPort());
  }

  protected int addCacheServerInVM(VM vm, final String[] groups) {
    SerializableCallable connect = new SerializableCallable("Add Bridge server") {
      public Object call() throws Exception {
        return addCacheServer(groups);
      }
    };
    Integer port = (Integer) vm.invoke(connect);
    return port.intValue();
  }

  protected int startBridgeServerInVM(VM vm, final String[] groups, final String locators,
      final String[] regions) {
    return startBridgeServerInVM(vm, groups, locators, regions, CacheServer.DEFAULT_LOAD_PROBE,
        false);
  }

  protected int startBridgeServerInVM(VM vm, String[] groups, String locators,
      boolean useGroupsProperty) {
    return startBridgeServerInVM(vm, groups, locators, new String[] {REGION_NAME},
        CacheServer.DEFAULT_LOAD_PROBE, useGroupsProperty);
  }

  protected int startBridgeServerInVM(VM vm, final String[] groups, final String locators,
      final String[] regions, final ServerLoadProbe probe, final boolean useGroupsProperty) {
    SerializableCallable connect = new SerializableCallable("Start bridge server") {
      public Object call() throws IOException {
        return startBridgeServer(groups, locators, regions, probe, useGroupsProperty);
      }
    };
    Integer port = (Integer) vm.invoke(connect);
    return port.intValue();
  }

  protected int startBridgeServer(String[] groups, String locators) throws IOException {
    return startBridgeServer(groups, locators, new String[] {REGION_NAME});
  }

  protected int startBridgeServer(final String[] groups, final String locators,
      final String[] regions) throws IOException {
    return startBridgeServer(groups, locators, regions, CacheServer.DEFAULT_LOAD_PROBE, false);
  }

  protected int startBridgeServer(final String[] groups, final String locators,
      final String[] regions, final ServerLoadProbe probe, final boolean useGroupsProperty)
      throws IOException {
    Properties props = new Properties();
    props.setProperty(MCAST_PORT, "0");
    props.setProperty(LOCATORS, locators);
    if (useGroupsProperty && groups != null) {
      props.setProperty(GROUPS, StringUtils.join(groups, ","));
    }
    DistributedSystem ds = getSystem(props);
    Cache cache = CacheFactory.create(ds);
    AttributesFactory factory = new AttributesFactory();
    factory.setScope(Scope.DISTRIBUTED_ACK);
    factory.setEnableBridgeConflation(true);
    factory.setDataPolicy(DataPolicy.REPLICATE);
    RegionAttributes attrs = factory.create();
    for (int i = 0; i < regions.length; i++) {
      cache.createRegion(regions[i], attrs);
    }
    CacheServer server = cache.addCacheServer();
    server.setPort(0);
    if (!useGroupsProperty) {
      server.setGroups(groups);
    }
    server.setLoadProbe(probe);
    server.start();

    remoteObjects.put(CACHE_KEY, cache);

    return new Integer(server.getPort());
  }

  protected int startBridgeServerWithEmbeddedLocator(final String[] groups, final String locators,
      final String[] regions, final ServerLoadProbe probe) throws IOException {
    Properties props = new Properties();
    props.setProperty(MCAST_PORT, String.valueOf(0));
    props.setProperty(START_LOCATOR, locators);
    props.setProperty(LOCATORS, locators);
    DistributedSystem ds = getSystem(props);
    Cache cache = CacheFactory.create(ds);
    AttributesFactory factory = new AttributesFactory();
    factory.setScope(Scope.DISTRIBUTED_ACK);
    factory.setEnableBridgeConflation(true);
    factory.setDataPolicy(DataPolicy.REPLICATE);
    RegionAttributes attrs = factory.create();
    for (int i = 0; i < regions.length; i++) {
      cache.createRegion(regions[i], attrs);
    }
    CacheServer server = cache.addCacheServer();
    server.setGroups(groups);
    server.setLoadProbe(probe);
    server.setPort(0);
    server.start();

    remoteObjects.put(CACHE_KEY, cache);

    return new Integer(server.getPort());
  }

  protected int startBridgeServerWithEmbeddedLocatorInVM(VM vm, final String[] groups,
      final String locators, final String[] regions, final ServerLoadProbe probe) {
    SerializableCallable connect = new SerializableCallable("Start bridge server") {
      public Object call() throws IOException {
        return startBridgeServerWithEmbeddedLocator(groups, locators, regions, probe);
      }
    };
    Integer port = (Integer) vm.invoke(connect);
    return port.intValue();
  }

  protected void startBridgeClientInVM(VM vm, final String group, final String host, final int port)
      throws Exception {
    startBridgeClientInVM(vm, group, host, port, new String[] {REGION_NAME});
  }

  protected void startBridgeClientInVM(VM vm, final String group, final String host, final int port,
      final String[] regions) throws Exception {
    PoolFactoryImpl pf = new PoolFactoryImpl(null);
    pf.addLocator(host, port).setServerGroup(group).setPingInterval(200)
        .setSubscriptionEnabled(true).setSubscriptionRedundancy(-1);
    startBridgeClientInVM(vm, pf.getPoolAttributes(), regions);
  }

  protected void startBridgeClientInVM(VM vm, final Pool pool, final String[] regions)
      throws Exception {
    SerializableRunnable connect = new SerializableRunnable("Start bridge client") {
      public void run() throws Exception {
        startBridgeClient(pool, regions);
      }
    };
    if (vm == null) {
      connect.run();
    } else {
      vm.invoke(connect);
    }
  }

  protected void startBridgeClient(final String group, final String host, final int port)
      throws Exception {
    startBridgeClient(group, host, port, new String[] {REGION_NAME});
  }

  protected void startBridgeClient(final String group, final String host, final int port,
      final String[] regions) throws Exception {
    PoolFactoryImpl pf = new PoolFactoryImpl(null);
    pf.addLocator(host, port).setServerGroup(group).setPingInterval(200)
        .setSubscriptionEnabled(true).setSubscriptionRedundancy(-1);
    startBridgeClient(pf.getPoolAttributes(), regions);
  }

  protected void startBridgeClient(final Pool pool, final String[] regions) throws Exception {
    Properties props = new Properties();
    props.setProperty(MCAST_PORT, String.valueOf(0));
    props.setProperty(LOCATORS, "");
    DistributedSystem ds = getSystem(props);
    Cache cache = CacheFactory.create(ds);
    AttributesFactory factory = new AttributesFactory();
    factory.setScope(Scope.LOCAL);
    factory.setPoolName(POOL_NAME);
    PoolFactoryImpl pf = (PoolFactoryImpl) PoolManager.createFactory();
    pf.init(pool);
    LocatorDiscoveryCallback locatorCallback = new MyLocatorCallback();
    remoteObjects.put(CALLBACK_KEY, locatorCallback);
    pf.setLocatorDiscoveryCallback(locatorCallback);
    pf.create(POOL_NAME);

    RegionAttributes attrs = factory.create();
    for (int i = 0; i < regions.length; i++) {
      cache.createRegion(regions[i], attrs);
    }

    remoteObjects.put(CACHE_KEY, cache);
  }

  protected void stopBridgeMemberVM(VM vm) {
    vm.invoke(new SerializableRunnable("Stop bridge member") {
      public void run() {
        Cache cache = (Cache) remoteObjects.remove(CACHE_KEY);
        cache.close();
        disconnectFromDS();
      }
    });
  }

  public String getLocatorString(Host host, int locatorPort) {
    return getLocatorString(host, new int[] {locatorPort});
  }

  public String getLocatorString(Host host, int[] locatorPorts) {
    StringBuffer str = new StringBuffer();
    for (int i = 0; i < locatorPorts.length; i++) {
      str.append(NetworkUtils.getServerHostName(host)).append("[").append(locatorPorts[i])
          .append("]");
      if (i < locatorPorts.length - 1) {
        str.append(",");
      }
    }

    return str.toString();
  }

  protected static class MyLocatorCallback extends LocatorDiscoveryCallbackAdapter {

    private final Set discoveredLocators = new HashSet();
    private final Set removedLocators = new HashSet();

    public synchronized void locatorsDiscovered(List locators) {
      discoveredLocators.addAll(locators);
      notifyAll();
    }

    public synchronized void locatorsRemoved(List locators) {
      removedLocators.addAll(locators);
      notifyAll();
    }

    public boolean waitForDiscovery(InetSocketAddress locator, long time)
        throws InterruptedException {
      return waitFor(discoveredLocators, locator, time);
    }

    public boolean waitForRemove(InetSocketAddress locator, long time) throws InterruptedException {
      return waitFor(removedLocators, locator, time);
    }

    private synchronized boolean waitFor(Set set, InetSocketAddress locator, long time)
        throws InterruptedException {
      long remaining = time;
      long endTime = System.currentTimeMillis() + time;
      while (!set.contains(locator) && remaining >= 0) {
        wait(remaining);
        remaining = endTime - System.currentTimeMillis();
      }
      return set.contains(locator);
    }

    public synchronized Set getDiscovered() {
      return new HashSet(discoveredLocators);
    }

  }

}


text:
package com.thaiopensource.relaxng.edit;

import com.thaiopensource.relaxng.parse.Location;

public class SourceLocation implements Location {
  private final String uri;
  private final int lineNumber;
  private final int columnNumber;

  public SourceLocation(String uri, int lineNumber, int columnNumber) {
    this.uri = uri;
    this.lineNumber = lineNumber;
    this.columnNumber = columnNumber;
  }

  public String getUri() {
    return uri;
  }

  public int getLineNumber() {
    return lineNumber;
  }

  public int getColumnNumber() {
    return columnNumber;
  }
}


text:
title: OLE WIVEL, WEEKENDAVISEN (Danmark) on Nade
date: 2002-04-04 05:00:00 +0000
book: no/books/nade.md
attribution: OLE WIVEL, WEEKENDAVISEN (Danmark)
link_to_original: ''
featured: false
weight: ''

---
Linn Ullmann skriver dilemmaene fram i denne lille stramme romanen som med sine erindringsglimt og lange sceniske dialoger kretser omkring det unevnelige, det umulige. Og gjør det i en stadig pulserende bevegelse … Linn Ullmann \[har\] med _Nåde_ krystallisert sitt talent … Dialogisk lavmælt i formen, sinnsopprivende i innholdet


text:
/*!
 * \file   atomic/detail/fence_arch_ops_gcc_x86.hpp
 *
 * This header contains implementation of the \c fence_arch_operations struct.
 */

#ifndef BOOST_ATOMIC_DETAIL_FENCE_ARCH_OPS_GCC_X86_HPP_INCLUDED_
#define BOOST_ATOMIC_DETAIL_FENCE_ARCH_OPS_GCC_X86_HPP_INCLUDED_

#include <boost/memory_order.hpp>
#include <boost/atomic/detail/config.hpp>
#include <boost/atomic/detail/header.hpp>

#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif

namespace boost {
namespace atomics {
namespace detail {

//! Fence operations for x86
struct fence_arch_operations_gcc_x86
{
    static BOOST_FORCEINLINE void thread_fence(memory_order order) BOOST_NOEXCEPT
    {
        if (order == memory_order_seq_cst)
        {
            // We could generate mfence for a seq_cst fence here, but a dummy lock-prefixed instruction is enough
            // and is faster than mfence on most modern x86 CPUs (as of 2020).
            // Note that we want to apply the atomic operation on any location so that:
            // - It is not shared with other threads. A variable on the stack suits this well.
            // - It is likely in cache. Being close to the top of the stack fits this well.
            // - It does not alias existing data on the stack, so that we don't introduce a false data dependency.
            // See some performance data here: https://shipilev.net/blog/2014/on-the-fence-with-dependencies/
            // Unfortunately, to make tools like valgrind happy, we have to initialize the dummy, which is
            // otherwise not needed.
            unsigned char dummy = 0u;
            __asm__ __volatile__ ("lock; notb %0" : "+m" (dummy) : : "memory");
        }
        else if ((static_cast< unsigned int >(order) & (static_cast< unsigned int >(memory_order_acquire) | static_cast< unsigned int >(memory_order_release))) != 0u)
        {
            __asm__ __volatile__ ("" ::: "memory");
        }
    }

    static BOOST_FORCEINLINE void signal_fence(memory_order order) BOOST_NOEXCEPT
    {
        if (order != memory_order_relaxed)
            __asm__ __volatile__ ("" ::: "memory");
    }
};

typedef fence_arch_operations_gcc_x86 fence_arch_operations;

} // namespace detail
} // namespace atomics
} // namespace boost

#include <boost/atomic/detail/footer.hpp>

#endif // BOOST_ATOMIC_DETAIL_FENCE_ARCH_OPS_GCC_X86_HPP_INCLUDED_


text:
#ifndef WINDOW_H
#define WINDOW_H

#include <QMainWindow>

class QListWidget;
class QListWidgetItem;

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow();

private:
    void setupListItems();

    QListWidget *listWidget;
};

#endif


text:
package com.googlecode.pondskum.gui.swing.notifyer;

import com.googlecode.pinthura.annotation.SuppressionReason;
import com.googlecode.pondskum.client.BigpondConnector;
import com.googlecode.pondskum.client.BigpondConnectorImpl;
import com.googlecode.pondskum.client.BigpondUsageInformation;
import com.googlecode.pondskum.config.Config;
import com.googlecode.pondskum.config.DefaultConfigLoader;
import com.googlecode.pondskum.gui.swing.tablet.ConsoleConnectionListener;
import com.googlecode.pondskum.gui.swing.tablet.StatusUpdatable;

import javax.swing.SwingWorker;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;

/**
 * Base class for all worker classes that need to connect to Bigpond. Essentially all Swing guis will go through the same steps. By
 * creating a template here, we centralize the common code and override what we need in the subclasses.
 *
 * A subclass would typically have to override the following methods:
 *
 *  1. postConnect  (from this class)
 *     This is called following a successful connection.
 *  2. process(final List<String> statusList) (from SwingWorker)
 *     This is called when updates are received.
 *  3. done (from SwingWorker)
 *     This is called once the worker completes either successfully or unsuccessfully.
 *
 * @see javax.swing.SwingWorker
 */
public abstract class BigpondSwingWorker extends SwingWorker<BigpondUsageInformation, String> implements StatusUpdatable {

    private Config config;
    private BigpondUsageInformation usageInformation;
    private Exception exception;
    private List<ConnectionFailureListener> connectionFailureListeners;
    private Logger logger;

    protected BigpondSwingWorker() {
        config = new DefaultConfigLoader().loadConfig();
        logger = config.getLogProvider().provide(getClass());
        connectionFailureListeners = new ArrayList<ConnectionFailureListener>();
    }

    /**
     * Override this method if you need to do any pre-connection processing. At this point both {@link #getConfig()} and
     * {@link #getUsageInformation()} are usable.
     */
    protected abstract void preConnect();

    /**
     * Override this method if you need to do any post-connection processing. At this point both {@link #getConfig()} and
     * {@link #getUsageInformation()} are usable. This method will not be called if there is a connection exception.
     */
    protected abstract void postConnect();

    /**
     * {@inheritDoc}
     * @see javax.swing.SwingWorker#process(java.util.List)
     */
    @Override
    protected abstract void process(List<String> statusList);

    /**
     * {@inheritDoc}
     * @see javax.swing.SwingWorker#done()
     */
    @Override
    protected abstract void done();

    /**
     * The template of any BigpondSwingWorker. A connection is first made followed by a call to {@link #postConnect()}. The
     * retrieved BigpondUsageInformation is then returned. If an exception occurs during the connection, the exception is set
     * (and thus retrievable by {@link #getException()}, the worker is cancelled and a null value is returned.
     * @return BigpondUsageInformation if the connection succeeds or null if it does not.
     * @throws Exception If an java.lang.Error occurs.
     */
    @Override
    protected final BigpondUsageInformation doInBackground() throws Exception {
        try {
            preConnect();
            connect();
            postConnect();
            return usageInformation;
        } catch (Exception e) {
            exception = e;
            cancel(true);
            return null;
        }
    }

    /**
     * Method on the StatusUpdatable interface. This is called whenever there is a connection update.
     * @param update The update.
     */
    @Override
    public final void updateStatus(final String update) {
        publish(update); //this indirectly pushes updates to the {@link SwingWorker#process} method.
    }

    public final void addFailureListener(ConnectionFailureListener connectionFailureListener) {
        connectionFailureListeners.add(connectionFailureListener);
    }

    protected final Config getConfig() {
        return config;
    }

    /**
     * This method should only be called after a call to {@link #connect()}.
     * @return The BigpondUsageInformation retrieved from Bigpond.
     */
    protected final BigpondUsageInformation getUsageInformation() {
        return usageInformation;
    }

    /**
     * Returns the nested Exceptions that occurred during the connection. Each level of exception is nested within the
     * previous.
     * @return Exception that occurred during the connection.
     */
    protected final Exception getException() {
        return exception;
    }

    /**
     * Returns the workers logger.
     * @return The logger in use.
     */
    protected final Logger getLogger() {
        return logger;
    }

    /**
     * Sets the Exception for this connection.
     * @param exception The Exception that occurred during the connection.
     */
    protected final void setException(final Exception exception) {
        this.exception = exception;
    }

    /**
     * Connects to Bigpond with the Config supplied. After call this method both the config used and the
     * BigpondUsageInformation returned can be retrieved via calls to {@link #getConfig()} and
     * {@link #getUsageInformation()} respectively.
     */
    protected final void connect() {
        BigpondConnector bigpondConnector = new BigpondConnectorImpl(config);
        usageInformation = bigpondConnector.connect(new ConsoleConnectionListener(this));
    }

    /**
     * Returns the message of the first Exception that was thrown, in the case of nested exceptions. If only one
     * Exception was thrown, returns that Exception's message.
     * @return The message of the first exception that was thrown.
     */
    @SuppressWarnings({"ThrowableResultOfMethodCallIgnored"})
    @SuppressionReason(value = SuppressionReason.Reason.OTHER, desc = "Exception is stored not thrown.")
    protected final String getSimpleExceptionMessage() {
        Throwable nested = getException();
        while (nested.getCause() != null) {
            nested = nested.getCause();
        }

        return nested.getMessage();
    }

    /**
     * Notify ConnectionFailureListener that the connection has failed.
     */
    protected void notifyFailureListeners() {
        for (ConnectionFailureListener listener : connectionFailureListeners) {
            listener.connectionFailed();
        }
    }
}


text:
package scalar.process;

import java.util.HashMap;
import java.util.Set;
import java.util.TreeSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import scalar.entity.PageProperty;
import scalar.entity.Person;
import scalar.entity.Work;

/**
 * 该类主要用于生成各种要提交到scalar平台的页面内容
 * @author wan jing
 *
 */
public class PageContentGenerator {

	/**
	 * 生成artist列表页面内容。
	 * 根据artist的名字和uri生成html页面的内容,startString为firstname为startString的artist
	 * 该页面包括所有符合条件的artist
	 *
	 * @param result 包含artist的uri和firstName##displayname,格式为(uri,firstname##displayname)
	 * @param startString 指定firstName的首字母
	 * @return String 返回artist列表页面内容,包含首字母为startString的artist
	 */
	public String generateArtistListPageContent(
			HashMap<String, String> result, String startString) {

		//最上方内容
		String header = "
"
				+ "
";

		//A|B|C|...|Z ,生成相应的链接
		for (int k = 0; k <= 25; k++) {
			header = header
					+ "
"
					+ ""
					+ (new Character((char) (65 + k))).toString() + "
";
		}
		header = header + "

";
		String middle = "

";

		Set<String> keysets = result.keySet();

		// 排序firstname
		TreeSet<String> sort = new TreeSet<String>();
		for (Object temp : keysets) {
			String uri = (String) temp;
			String nameString = (String) result.get(temp);
			String name = nameString.substring(0, nameString.indexOf("##"));
			String firstname = nameString.substring(
					nameString.indexOf("##") + 2, nameString.length());
			sort.add(firstname + "##" + name + "$$" + uri);
		}

		//添加每一个作家的姓名和链接
		for (String temp : sort) {
            String uri = temp.substring(temp.indexOf("$$") + 2, temp.length());
			String name = temp.substring(temp.lastIndexOf("##") + 2,
					temp.indexOf("$$"));
			System.out.println(uri);
			System.out.println(name);
			middle = middle
					+ "
";
			middle = middle + name;
			middle = middle + "
";
		}

		middle = middle + "

";
    	return header + middle;
	}

	/**
	 * 生成一个作家的页面内容
	 * @param person 包含作家的所有信息
	 * @param imageUrnScalarVersion 作家照片在scalar平台上对应的version
	 * @param resource 作家照片在scalar平台上对应的resource
	 * @return String 一个作家的页面的内容
	 */
	public  String generateArtistPageContent(Person person,String imageUrnScalarVersion, String resource) {
		//生成图片链接
		String picture = "";
		if (person.getMainRepresentationURI() != null&& person.getMainRepresentationURI().length() > 0)
		{
			picture = "";
		}

		//出生地点和日期
		String birth="";
		if((person.getBirthDate()!=null&&person.getBirthDate().length()>=4)||
				(person.getBirthPlace()!=null&&person.getBirthPlace().length()>0))
		{
		     birth= "
Born:"
				+ convertPlaceURIToPlaceName(person.getBirthPlaceURI())
				+ " "
				+ person.getBirthDate().substring(0,4)
				+ "
";
		}

		//死亡地点和日期
		String death="";
		if((person.getDeathDate()!=null&&person.getDeathDate().length()>=4)||
				(person.getDeathPlace()!=null&&person.getDeathPlace().length()>0))
		{
			death = "
Died:"
		        + convertPlaceURIToPlaceName(person.getDeathPlaceURI())
				+ " "
				+ person.getDeathDate()
				+ "
";
		}

		//活动地点
		String activePlace="";
		if(person.getAssociatePlaceURISet()!=null&&person.getAssociatePlaceURISet().size()>0)
		{
			activePlace = "
"
		        + "Active in:
"
				+ "
";
			for(String temp:person.getAssociatePlaceURISet())
			{
				activePlace=activePlace+ "
"
				+ convertPlaceURIToPlaceName(temp) + "
" ;
			}
			activePlace=activePlace+ "
";
		}

		//作家简介
		String bio = "";
		if(person.getArtistBio()!=null&&person.getArtistBio().length()>0)
		{
		    bio = "
Biography
"
				+ "
"
				+ person.getArtistBio() + "
";
		}

		//smithsonian american art museum链接
		String linkToSmith = "";
		if (person.getId().length() > 0) {
			linkToSmith = "
Links
"
					+ "
"
					+ "Smithsonian American Art Museum
";
		}

		//new york times链接
		String linkToNY = "";
		if (person.getNytimesURI() != null
				&& person.getNytimesURI().length() > 0) {
			linkToNY = "
New York Times
";
		}

		//wikipedia链接
		String linkToWiki = "";
		if (person.getWikipediaURI() != null
				&& person.getWikipediaURI().length() > 0) {
			linkToWiki = "
Wikipedia
";
		}

		//作品
		String work="";
		if(person.getCollectionList()!=null&&person.getCollectionList().size()>0)
		{
			work="
Works
";
			for(Work temp:person.getCollectionList())
			{
				work=work+"
"+temp.getTitle()+ "   "+temp.getProduceDate()+"   ";
				if(temp.getKeeperURI()!=null&&temp.getKeeperURI().indexOf(PageProperty.Smith_Graph)>=0)
					work=work+PageProperty.Smith_Name;
				if(temp.getKeeperURI()!=null&&temp.getKeeperURI().indexOf(PageProperty.Crystal_Graph)>=0)
					work=work+PageProperty.Crystal_Name;
				if(temp.getKeeperURI()!=null&&temp.getKeeperURI().indexOf(PageProperty.Carter_Graph)>=0)
					work=work+PageProperty.Carter_Name;
				work=work+"
";
			}
		}

		String result = picture + birth + death + activePlace + bio
				+ linkToSmith + linkToNY + linkToWiki+work;

		return result;
	}

	/**
	 * 生成一个作品的页面内容
	 * @param collection 包含作品的所有信息
	 * @param imageUrnScalarVersion 作品照片在scalar平台上对应的version
	 * @param resource 作品照片在scalar平台上对应的resource
	 * @return String 一个作品的页面的内容
	 */
	public  String generateCollectionPageContent(Work collection,String imageUrnScalarVersion, String resource) {
		if(collection==null)
			return "";
		//生成图片链接
		String picture = "";
		if (collection.getRepresentationURI()!= null&& collection.getRepresentationURI().length() > 0)
		{
			picture = "";
		}

		//年代
		String produceDate="";
		if((collection.getProduceDate()!=null&&collection.getProduceDate().length()>0))
		{
		     produceDate= "
"
				+ collection.getProduceDate()
				+ "
";
		}

		//作者
		String artist="";
		if((collection.getPersonList()!=null&&collection.getPersonList().size()>0))
		{
			 artist = "
";

			 for(Person temp:collection.getPersonList())
			 {
				 artist=artist+""
						 +temp.getDisplayName()+" "+"";
			 }
			 artist=artist+ " "+ "
";
		}

		//大小
		String dimension="";
		if((collection.getWidth()!=null&&collection.getWidth().length()>0)||
				(collection.getHeight()!=null&&collection.getHeight().length()>0))
		{
			dimension = "
"
		        + collection.getWidth()
				+ "cm * "
				+ collection.getHeight()
				+"cm"
				+ "
";
		}

		//材质
		String medium="";
		if((collection.getMedium()!=null&&collection.getMedium().length()>0))
		{
			 medium = "
"
				        + collection.getMedium()
						+ " "
						+ "
";
		}

		//博物馆
		String museum="";
		if((collection.getKeeper()!=null&&collection.getKeeper().length()>0))
		{
			 museum = "
";
			 if(collection.getKeeper().indexOf("smithsonian")>=0)
				 museum=museum+"";
			 if(collection.getKeeper().indexOf("smithsonian")>=0)
			       museum=museum+"Smithsonian American Art Museum"+"
";
		}

		/*//描述
		String description="";
		if((collection.getMdium()!=null&&collection.getDescription().length()>0))
		{
			 description = "
"
						 + collection.getDescription()
						 + " "
						 + "
";
		}*/

		//关键词
		String keywords="";
		if(collection.getKeywordList()!=null&&collection.getKeywordList().size()>0)
		{
			keywords="
"
					 + collection.getKeywordList().toString()
					 + " "
					 + "
";
		}

		//类别

        String result = picture+produceDate+artist+dimension+medium+museum+keywords;

		return result;
	}

	//将作家名字转换成scalar平台上的url链接格式
	public String convertNameToUrl(String name)
	{
	   String url;
	   //url=name.replace(". ","-").replace(" ","-").replace(".","-").toLowerCase();
	   url=name.replace(":","-").toLowerCase();
	   url=url.replace(" ","-");
	   url=url.replace("--","-").toLowerCase();

	   //url中删除除了空格-,/,字母,数字之外的其他符号
	   String regex = "[^A-Za-z0-9/-]";
       Pattern pattern = Pattern.compile(regex);
       Matcher mp = pattern.matcher(url);
       url=mp.replaceAll("").trim();

	   return url;
	 }

	//将地址uri转换成地址名称,包括所有的名称
	//collection.americanart.si.edu/id/thesauri/place/Madison_none_Georgia_United-States
	//返回Madison,Georgia——United-States
	public String convertPlaceURIToPlaceName(String placeURI)
	{
		String placeName=null;
		if(placeURI.indexOf("/place")>=0)
		{
			placeName=placeURI.substring(placeURI.indexOf("/place")+7,placeURI.length());
		    placeName=placeName.replace("none","").replace("___",", ").replace("__", ", ").replace("_",", ").replace("-", " ");
		}
		return placeName;
	}

}


text:
@interface PodsDummy_Pods_BPNetworkTests : NSObject
@end
@implementation PodsDummy_Pods_BPNetworkTests
@end


text:
const _ = require("lodash"),
      fs = require("fs"),
      util = require("util"),
      debug = require("debug")("clusterluck:lib:dtable"),
      async = require("async"),
      path = require("path"),
      shortid = require("shortid"),
      readline = require("readline"),
      zlib = require("zlib"),
      EventEmitter = require("events").EventEmitter;

const utils = require("./utils"),
      Queue = require("./queue"),
      consts = require("./consts");

const defaults = consts.dtableOpts;

const ops = {
  set: (key, val, table) => {
    table.set(key, val);
    return val;
  },
  sset: (key, val, table) => {
    const out = table.get(key) || new Set();
    if (!(out instanceof Set)) {
      throw DTable.invalidTypeError("sset", key, typeof out);
    }
    out.add(val);
    table.set(key, out);
    return out;
  },
  hset: (key, hkey, val, table) => {
    const out = table.get(key) || new Map();
    if (!(out instanceof Map)) {
      throw DTable.invalidTypeError("hset", key, typeof out);
    }
    out.set(hkey, val);
    table.set(key, out);
    return out;
  },
  del: (key, table) => {
    table.delete(key);
  },
  sdel: (key, val, table) => {
    const out = table.get(key) || new Set();
    if (!(out instanceof Set)) {
      throw DTable.invalidTypeError("sdel", key, typeof out);
    }
    out.delete(val);
    if (out.size === 0) table.delete(key);
  },
  hdel: (key, hkey, table) => {
    const out = table.get(key) || new Map();
    if (!(out instanceof Map)) {
      throw DTable.invalidTypeError("hdel", key, typeof out);
    }
    out.delete(hkey);
    if (out.size === 0) table.delete(key);
  },
  clear: (table) => {
    table.clear();
  }
};

class DTable extends EventEmitter {
  /**
   *
   * In-memory key/value storage. Uses a combination of an AOF file and storage snapshot for persistence. For every "write" action, a corresponding write to the AOF file LATEST.LOG occurs. On an interval, this file is fsynced to disk (by default, 1000 milliseconds). In addition, a storage snapshot is kept and rewritten based on usage of the table. If the table remains inactive for a configurable amount of time (default 180000 milliseconds) or receives a configurable number of write operations before this idle time occurs (default 100 writes), the storage snapshot is resaved based on current state at that point in time. The algorithm is as follows:
   *   - Close the file descriptor on the AOF file LATEST.LOG
   *   - Append contents of LATEST.LOG (AOF file) to PREV.LOG (backup AOF file)
   *   - Delete LATEST.LOG and reopen with a new file descriptor
   *   - Dump state of table to DATA_PREV.SNAP (storage snapshot)
   *   - If succesful, move this to DATA.SNAP, else delete DATA_PREV.SNAP
   *   - Delete PREV.LOG
   *
   * In the time that the AOF file LATEST.LOG is closed, log writes are stored in an internal queue. Once the file descriptor is reopened, the queue is flushed.
   *
   * @class DTable
   * @memberof Clusterluck
   *
   * @param {Object} opts
   * @param {String} opts.path
   * @param {Number} [opts.writeThreshold]
   * @param {Number} [opts.autoSave]
   * @param {Number} [opts.fsyncInterval]
   * @param {Boolean} [opts.compress]
   * @param {Function} [opts.encodeFn]
   * @param {Function} [opts.decodeFn]
   * @param {String} [opts.name]
   *
   */
  constructor(opts = defaults) {
    super();
    opts = _.defaults(_.clone(opts), defaults);
    if (!util.isString(opts.path)) {
      throw new Error("Missing 'path' option in options object.");
    }
    this._prefix = opts.path;

    this._autoSave = opts.autoSave;
    this._writeCount = 0;
    this._writeThreshold = opts.writeThreshold;
    this._table = new Map();
    this._idleTicks = 0;
    this._idleTickInterval = 1000;
    this._idleTickMax = this._autoSave/this._idleTickInterval;
    this._idleInterval = null;
    this._syncInterval = null;
    this._fsyncInterval = opts.fsyncInterval;
    this._queue = new Queue();
    this._flushing = false;
    this._compress = opts.compress !== undefined ? opts.compress : false;
    this._encodeFn = typeof opts.encodeFn === "function" ? opts.encodeFn : DTable.encodeValue;
    this._decodeFn = typeof opts.decodeFn === "function" ? opts.decodeFn : DTable.decodeValue;
    if (typeof opts.name === "string") {
      this._name = opts.name;
      this._path = path.join(this._prefix, this._name + "_DATA.SNAP");
      this._tmpDumpPath = path.join(this._prefix, this._name + "_DATA_PREV.SNAP");
      this._aofPath = path.join(this._prefix, this._name + "_LATEST.LOG");
      this._tmpAOFPath = path.join(this._prefix, this._name + "_PREV.LOG");
    }
  }

  /**
   *
   * Starts dtable instance, which triggers an fopen call to LATEST.LOG, the fsync interval for this log file, as well as other internal intervals to check for storage snapshot flush conditions.
   *
   * @method start
   * @memberof Clusterluck.DTable
   * @instance
   *
   * @param {String} name - Name of table, meant for debugging purposes.
   *
   * @return {Clusterluck.DTable} This instance.
   *
   */
  start(name) {
    if (typeof name === "string" && this._name !== name) {
      this._name = name;
      this._path = path.join(this._prefix, this._name + "_DATA.SNAP");
      this._tmpDumpPath = path.join(this._prefix, this._name + "_DATA_PREV.SNAP");
      this._aofPath = path.join(this._prefix, this._name + "_LATEST.LOG");
      this._tmpAOFPath = path.join(this._prefix, this._name + "_PREV.LOG");
    }
    this._id = shortid.generate();
    this._startDiskOps();
    return this;
  }

  /**
   *
   * Stops the table, including all internal disk-based logic. If the table is idle and has an open file descriptor against LATEST.LOG, it will close immediately. If it's idle but the file descriptor against LATEST.LOG has been closed, this call will wait for a file descriptor to open again before continuing. Otherwise, the table isn't idle and therefore we wait for this condition.
   *
   * @method stop
   * @memberof Clusterluck.DTable
   * @instance
   *
   * @param {Function} cb - Callback called once the table has been stopped.
   *
   */
  stop(cb) {
    if (this.idle() && this._fd) {
      this.emit("stop");
      this._id = null;
      return cb();
    } else if (this.idle() && !this._fd) {
      return this.once("open", _.partial(this.stop, cb).bind(this));
    }
    this.once("idle", _.partial(this.stop, cb).bind(this));
  }

  /**
   *
   * Loads state from disk. The algorithm is as follows:
   *   - DATA.SNAP is loaded and read into the current state of table.
   *   - PREV.LOG is loaded and rerun against the current state.
   *   - LATEST.LOG is loaded and also rerun against the current state.
   *
   * @method load
   * @memberof Clusterluck.DTable
   * @instance
   *
   * @param {Function} cb - Callback called once the snapshot and AOF files have been loaded and rerun.
   *
   */
  load(cb) {
    async.series([
      _.partial(this._loadState, this._path).bind(this),
      _.partial(this._loadState, this._tmpDumpPath).bind(this),
      _.partial(this._loadAOF, this._tmpAOFPath).bind(this),
      _.partial(this._loadAOF, this._aofPath).bind(this)
    ], cb);
  }

  /**
   *
   * Returns whether this table is in an idle state or not.
   *
   * @method idle
   * @memberof Clusterluck.DTable
   * @instance
   *
   * @return {Boolean} Whether this table is idle or not.
   *
   */
  idle() {
    return this._flushing === false;
  }

  /**
   *
   * Acts as a getter/setter for whether this table instance compresses the state snapshot.
   *
   * @method compress
   * @memberof Clusterluck.Dtable
   * @instance
   *
   * @param {Boolean} bool - Boolean to change the compression flag of this instance to.
   *
   * @return {Boolean} Whether this instance compresses it's state snapshots.
   *
   */
  compress(bool) {
    if (bool !== undefined) {
      this._compress = bool;
    }
    return this._compress;
  }

  /**
   *
   * Returns the underlying in-memory map this table writes to.
   *
   * @method raw
   * @memberof Clusterluck.DTable
   * @instance
   *
   * @return {Map} Underlying in-memory map this table writes to.
   *
   */
  raw() {
    return this._table;
  }

  /**
   *
   * Retrieves value stored at `key`, returning `undefined` if no such data exists.
   *
   * @method get
   * @memberof Clusterluck.DTable
   * @instance
   *
   * @param {String} key - Key to retrieve data from.
   *
   * @return {Map|Set|JSON} Value stored at `key`.
   *
   */
  get(key) {
    return this._table.get(key);
  }

  /**
   *
   * Returns whether `val` is a member of the set stored at `key`.
   *
   * @method smember
   * @memberof Clusterluck.DTable
   * @instance
   *
   * @param {String} key - Key to retrieve set from.
   * @param {String} val - Value to check existence of in the set.
   *
   * @return {Boolean} Whether `val` is a member of the set stored at `key`.
   *
   */
  smember(key, val) {
    const out = this._table.get(key) || new Set();
    if (!(out instanceof Set)) {
      throw DTable.invalidTypeError("smember", key, typeof out);
    }
    return out.has(val);
  }

  /**
   *
   * Retrieves value stored at hash key `hkey` under storage key `key`, returning `undefined` if no such data exists.
   *
   * @method hget
   * @memberof Clusterluck.DTable
   * @instance
   *
   * @param {String} key - Key to retrieve hash map from.
   * @param {String} hkey - Hash key to retrieve data from.
   *
   * @return {JSON} - Value stored under hash key `hkey` at the hash map stored under `key`.
   *
   */
  hget(key, hkey) {
    const out = this._table.get(key) || new Map();
    if (!(out instanceof Map)) {
      throw new DTable.invalidTypeError("hget", key, typeof out);
    }
    return out.get(hkey);
  }

  /**
   *
   * Sets value `value` under key `key`.
   *
   * @method set
   * @memberof Clusterluck.DTable
   * @instance
   *
   * @param {String} key
   * @param {Map|Set|JSON} val
   *
   * @return {Map|Set|JSON}
   *
   */
  set(key, val) {
    ops.set(key, val, this._table);
    this._writeToLog("set", key, val);
    this._updateWriteCount();
    return val;
  }

  /**
   *
   * Inserts `val` into the set stored at key `key`.
   *
   * @method sset
   * @memberof Clusterluck.DTable
   * @instance
   *
   * @param {String} key - Key which holds the set to insert `val` under.
   * @param {String} val - Value to insert into the set.
   *
   * @return {String} The set stored at `key`.
   *
   */
  sset(key, val) {
    const out = ops.sset(key, val, this._table);
    this._writeToLog("sset", key, val);
    this._updateWriteCount();
    return out;
  }

  /**
   *
   * Sets `value` under the hash key `hkey` in the hash map stored at `key`.
   *
   * @method hset
   * @memberof Clusterluck.DTable
   * @instance
   *
   * @param {String} key - Key which holds the hash map.
   * @param {String} hkey - Hash key to insert `val` under.
   * @param {JSON} val - Value to set under `hkey` in the hash map.
   *
   * @return {Map} The map stored at `key`.
   *
   */
  hset(key, hkey, val) {
    const out = ops.hset(key, hkey, val, this._table);
    this._writeToLog("hset", key, hkey, val);
    this._updateWriteCount();
    return out;
  }

  /**
   *
   * Removes key `key` from this table.
   *
   * @method del
   * @memberof Clusterluck.DTable
   * @instance
   *
   * @param {String} key - Key to remove from this table.
   *
   * @return {Clusterluck.DTable} This instance.
   *
   */
  del(key) {
    ops.del(key, this._table);
    this._writeToLog("del", key);
    this._updateWriteCount();
    return this;
  }

  /**
   *
   * Deletes `val` from the set stored under `key`.
   *
   * @method sdel
   * @memberof Clusterluck.DTable
   * @instance
   *
   * @param {String} key - Key which olds the set to remove `val` from.
   * @param {String} val - Value to remove from the set.
   *
   * @return {Clusterluck.DTable} This instance.
   *
   */
  sdel(key, val) {
    ops.sdel(key, val, this._table);
    this._writeToLog("sdel", key, val);
    this._updateWriteCount();
    return this;
  }

  /**
   *
   * Removes the hash key `hkey` from the hash map stored under `key`.
   *
   * @method hdel
   * @memberof Clusterluck.DTable
   * @instance
   *
   * @param {String} key - Key which holds the hash map that `hkey` will be removed from.
   * @param {String} hkey - The hash key to remove from the hash map.
   *
   * @return {Clusterluck.DTable} This instance.
   *
   */
  hdel(key, hkey) {
    ops.hdel(key, hkey, this._table);
    this._writeToLog("hdel", key, hkey);
    this._updateWriteCount();
    return this;
  }

  /**
   *
   * Clears the contents of this table.
   *
   * @method clear
   * @memberof Clusterluck.DTable
   * @instance
   *
   * @return {Clusterluck.DTable} This isntance.
   *
   */
  clear() {
    ops.clear(this._table);
    this._writeToLog("clear");
    this._updateWriteCount();
    return this;
  }

  /**
   *
   * Asynchronously iterates over each key/value pair stored in this table at the point of this call.
   *
   * @method forEach
   * @memberof Clusterluck.DTable
   * @instance
   *
   * @param {Function} cb - Function to call on each key/value pair. Has the signature `function (key, val, next) {...}`.
   * @param {Function} fin -Finishing callback to call once iteration has completed. Hash the signature `function (err) {...}`, where `err` is populated if passed into the `next` callback at any point of iteration..
   *
   */
  forEach(cb, fin) {
    const entries = this._table.entries();
    let done = false;
    async.whilst(() => {
      return done !== true;
    }, (next) => {
      const val = entries.next();
      if (val.done === true) {
        done = true;
        return next();
      }
      cb(val.value[0], val.value[1], next);
    }, fin);
  }

  /**
   *
   * Synchronously iterates over each key/value pair stored in this table.
   *
   * @method forEachSync
   * @memberof Clusterluck.DTable
   * @instance
   *
   * @param {Function} cb - Function call on each key/value pair. Has the signature `function (key, val) {...}`.
   *
   * @return {Clusterluck.DTable} This instance.
   *
   */
  forEachSync(cb) {
    this._table.forEach((val, key) => {
      cb(key, val);
    });
    return this;
  }

  /**
   *
   * @method _startDiskOps
   * @memberof Clusterluck.DTable
   * @instance
   * @private
   *
   * @return {Clusterluck.DTable}
   *
   */
  _startDiskOps() {
    if (this._idleInterval !== null) return this;
    this._setupDiskOps();
    return this;
  }

  /**
   *
   * @method _setupDiskOps
   * @memberof Clusterluck.DTable
   * @instance
   * @private
   *
   * @return {Clusterluck.DTable}
   *
   */
  _setupDiskOps() {
    this._setupIdleFlushInterval();
    this._setupAOFSyncInterval();

    this.once("stop", () => {
      this._fd = null;
      this._fstream.end();
      this._fstream = null;
      clearInterval(this._idleInterval);
      this._idleInterval = null;
      clearInterval(this._syncInterval);
      this._syncInterval = null;
    });
    return this;
  }

  /**
   *
   * @method _setupIdleFlushInterval
   * @memberof Clusterluck.DTable
   * @instance
   * @private
   *
   * @return {Clusterluck.DTable}
   *
   */
  _setupIdleFlushInterval() {
    this._idleInterval = setInterval(() => {
      this._idleTicks++;
      if (this._idleTicks >= this._idleTickMax) {
        this._idleTicks = 0;
        this._flush();
      }
    }, this._idleTickInterval);
    return this;
  }

  /**
   *
   * @method _setupAOFSyncInterval
   * @memberof Clusterluck.DTable
   * @instance
   * @private
   *
   * @return {Clusterluck.DTable}
   *
   */
  _setupAOFSyncInterval() {
    this._fstream = fs.createWriteStream(this._aofPath, {
      flags: "a"
    });
    this._fstream.once("open", (fd) => {
      this._fd = fd;
      this._queue.flush().forEach((el) => {
        const args = [el.op].concat(el.args);
        this._writeToLog.apply(this, args);
      });
      this.emit("open");
    });
    this._syncInterval = setInterval(() => {
      if (!this._fd) return;
      fs.fsync(this._fd, (err) => {
        if (err) debug("failed to fsync underlying file descriptor for AOF file on table %s.", this._name);
      });
    }, this._fsyncInterval);
    return this;
  }

  /**
   *
   * @method _updateWriteCount
   * @memberof Clusterluck.DTable
   * @instance
   * @private
   *
   * @return {Clusterluck.DTable}
   *
   */
  _updateWriteCount() {
    this._idleTicks = 0;
    this._writeCount++;
    if (this._writeCount >= this._writeThreshold) {
      this._writeCount = 0;
      this._flush();
    }
    return this;
  }

  /**
   *
   * @method _flush
   * @memberof Clusterluck.DTable
   * @instance
   * @private
   *
   */
  _flush() {
    if (this._flushing || !this._fd) return;
    this._flushing = true;
    clearInterval(this._syncInterval);
    this._syncInterval = null;

    const obj = utils.mapToObject(this._table);
    this._fstream.once("close", () => {
      async.series([
        _.partial(this._flushAOF).bind(this),
        (next) => {
          this._setupAOFSyncInterval();
          async.nextTick(next);
        },
        _.partial(this._flushTable, obj).bind(this),
        _.partial(fs.unlink, this._tmpAOFPath)
      ], (err) => {
        this._flushing = false;
        this.emit("idle");
      });
    });
    this._fstream.end();
    this._fd = null;
    this.emit("close");
  }

  /**
   *
   * @method _flushAOF
   * @memberof Clusterluck.DTable
   * @instance
   * @private
   *
   * @param {Function} cb
   *
   */
  _flushAOF(cb) {
    let called = false;
    const wstream = fs.createWriteStream(this._tmpAOFPath, {
      flags: "a"
    });
    const rstream = fs.createReadStream(this._aofPath);
    rstream.pipe(wstream);
    wstream.on("close", () => {
      if (called) return;
      called = true;
      fs.unlink(this._aofPath, cb);
    });
    wstream.on("error", (err) => {
      if (called) return;
      called = true;
      rstream.resume();
      return cb(err);
    });
  }

  /**
   *
   * @method _flushTable
   * @memberof Clusterluck.DTable
   * @instance
   * @private
   *
   * @param {Object} obj
   * @param {Function} cb
   *
   */
  _flushTable(obj, cb) {
    let called = false;
    const {fstream, wstream} = this._createFlushStreams();
    fstream.on("error", (err) => {
      if (called) return;
      called = true;
      wstream.end();
      fs.unlink(this._tmpDumpPath, _.partial(cb, err));
    });
    fstream.on("close", () => {
      if (called) return;
      called = true;
      fs.rename(this._tmpDumpPath, this._path, cb);
    });
    async.eachLimit(Object.keys(obj), 4, (key, next) => {
      if (called) return next("Closed prematurely.");
      const val = obj[key];
      wstream.write(JSON.stringify({
        key: key,
        value: this._encodeFn(val)
      }) + "\n");
      delete obj[key];
      async.nextTick(next);
    }, (err) => {
      if (called) return;
      wstream.end();
    });
  }

  /**
   *
   * @method _writeToLog
   * @memberof Clusterluck.DTable
   * @instance
   * @private
   *
   * @param {String} op
   *
   * @return {Clusterluck.DTable}
   *
   */
  _writeToLog(op, ...args) {
    if (!this._fd) {
      this._queue.enqueue({op: op, args: args});
      return;
    }
    args = args.map((val) => {
      return this._encodeFn(val);
    });
    const out = JSON.stringify({
      op: op,
      args: args
    }) + "\n";
    this._fstream.write(out);
    return this;
  }

  /**
   *
   * @method _createFlushStreams
   * @memberof Clusterluck.DTable
   * @instance
   * @private
   *
   */
  _createFlushStreams() {
    const fstream = fs.createWriteStream(this._tmpDumpPath);
    let wstream;
    if (this._compress) {
      wstream = zlib.createGzip();
      wstream.pipe(fstream);
    } else {
      wstream = fstream;
    }
    return {fstream, wstream};
  }

  /**
   *
   * @method _loadState
   * @memberof Clusterluck.DTable
   * @instance
   * @private
   *
   * @param {Function} cb
   *
   */
  _loadState(location, cb) {
    fs.stat(location, (err) => {
      if (err && err.code !== "ENOENT") return cb(err);
      else if (err && err.code === "ENOENT") return cb();
      const {fstream, rstream} = this._createLoadStreams(location);

      const rline = readline.createInterface({
        input: rstream
      });
      let called = false;
      rline.once("close", () => {
        if (called) return;
        called = true;
        return cb();
      });
      fstream.on("error", (err) => {
        if (called) return;
        called = true;
        fstream.resume();
        rline.close();
        return cb(err);
      });
      rline.on("line", (line) => {
        const lineObj = JSON.parse(line);
        const val = this._decodeFn(lineObj.value);
        this._table.set(lineObj.key, val);
      });
    });
  }

  /**
   *
   * @method _loadAOF
   * @memberof Clusterluck.DTable
   * @instance
   * @private
   *
   * @param {String} path
   * @param {Function} cb
   *
   */
  _loadAOF(path, cb) {
    fs.stat(path, (err) => {
      if (err && err.code !== "ENOENT") return cb(err);
      else if (err && err.code === "ENOENT") return cb();
      const rstream = fs.createReadStream(path);
      const rline = readline.createInterface({
        input: rstream
      });
      let called = false;
      rline.once("close", () => {
        if (called) return;
        called = true;
        return cb();
      });
      rstream.on("error", (err) => {
        if (called) return;
        called = true;
        rstream.resume();
        rline.close();
        return cb(err);
      });
      rline.on("line", (line) => {
        const lineObj = JSON.parse(line);
        lineObj.args = lineObj.args.map((val) => {
          return this._decodeFn(val);
        });

        try {
          lineObj.args.push(this._table);
          ops[lineObj.op].apply(null, lineObj.args);
        } catch (e) {
          debug("failed to complete operation %s with args " + JSON.stringify(lineObj.args) + " from %s", lineObj.op, path);
        }
      });
    });
  }

  /**
   *
   * @method _CreateLoadStreams
   * @memberof Clusterluck.DTable
   * @instance
   * @private
   *
   * @param {String} location
   *
   */
  _createLoadStreams(location) {
    const fstream = fs.createReadStream(location);
    let rstream;
    if (this._compress) {
      rstream = zlib.createGunzip();
      fstream.pipe(rstream);
    } else {
      rstream = fstream;
    }
    return {fstream, rstream};
  }

  /**
   *
   * @method invalidTypeError
   * @memberof Clusterluck.DTable
   * @static
   *
   * @param {String} command
   * @param {String} key
   * @param {String} type
   *
   * @return {Error}
   *
   */
  static invalidTypeError(command, key, type) {
    let msg = "Invalid command '" + command + "' against key '" + key + "'";
    msg += " of type '" + type +"'";
    return _.extend(new Error(msg), {
      type: "INVALID_TYPE"
    });
  }

  /**
   *
   * @method encodeValue
   * @memberof Clusterluck.DTable
   * @static
   *
   * @param {Map|Set|JSON} value
   *
   * @return {Object}
   *
   */
  static encodeValue(value) {
    if (value instanceof Set) {
      return {
        type: "Set",
        data: utils.setToList(value)
      };
    } else if (value instanceof Map) {
      return {
        type: "Map",
        data: utils.mapToList(value)
      };
    } else {
      return {
        type: typeof value,
        data: value
      };
    }
  }

  /**
   *
   * @method decodeValue
   * @memberof Clusterluck.DTable
   * @static
   *
   * @param {Object} value
   * @param {String} value.type
   * @param {JSON} value.data
   *
   * @return {Map|Set|JSON}
   *
   */
  static decodeValue(value) {
    if (value.type === "Set") {
      return new Set(value.data);
    } else if (value.type === "Map") {
      return new Map(value.data);
    } else {
      return value.data;
    }
  }
}

module.exports = DTable;


text:
(function ($) {
    var Module = core.wirings.Module,
        __super__ = Module.prototype;
    /**
     * The main class that implements offline webapp functionalities using application cache and local storage.
     * Extends core.wirings.Module to have the ability to be instantiated in the same fashion.
     *
     * @class OfflineModule
     * @module addons
     * @namespace core.wirings
     * @extends core.wirings.Module
     * @constructor
     * @param {Object} opts An object containing configurations required by the Core derived class.
     * @param {HTMLElement} opts.el The node element included in the class composition.
     *
     */
    function OfflineModule(opts) {
        if (opts && opts.__inheriting__) return;
        __super__.constructor.call(this, opts);

    }
    OfflineModule.inherits(Module);
    var proto = OfflineModule.prototype;
    proto.dispose = function () {
        //clear
        __super__.dispose.call(this);
        clearInterval(this.cacheStatusTimer);
    };
    proto.construct = function(opts){
        //if cacheUpdateInterval is not overridden from outside, then assign a default value which is 3000
        if (!this.cacheUpdateInterval)
            this.cacheUpdateInterval = 3000;

		__super__.construct.call(this, opts);
        prepare.call(this);
    };
    proto.initialized = function(opts){
        console.warn("OfflineModule subclass requires initialized method.");
    };
    /**
     * The main method handler for checking the application status. Also determines if a web application has gone offline/online
     *
     * @method onApplicationCacheStatus
     * @param {Object} event Contains the information about the current application cache status.
     */
    proto.onApplicationCacheStatus = function(evt){

        switch(evt.type){
            case "error":
                if(this.currentOnlineStatus !== false){
                    this.currentOnlineStatus = false;
                    this.onlineStatus(false);
                }

                break;
            case "cached":
                if(this.currentOnlineStatus !== true){
                    this.currentOnlineStatus = true;
                    this.onlineStatus(true);
                }
                this.cacheStatus("cached");
                break;
            case "checking":
                break;
            case "downloading":
                break;
            case "noupdate":

                if(this.currentOnlineStatus !== true){
                    this.currentOnlineStatus = true;
                    this.onlineStatus(true);
                }
                break;
            case "obsolete":
                if(this.currentOnlineStatus !== true){
                    this.currentOnlineStatus = true;
                    this.onlineStatus(true);
                }
                this.cacheStatus("updateAvailable");
                break;
            case "progress":
                break;
            case "ready":
                if(this.currentOnlineStatus !== true){
                    this.currentOnlineStatus = true;
                    this.onlineStatus(true);
                }
                break;
            default:
                if(this.currentOnlineStatus !== true){
                    this.currentOnlineStatus = true;
                    this.onlineStatus(true);
                }
                break;
        }
    };
    /**
     * Virtual protected function. Should be overridden on subclasses. Called automatically when the cache status has changed.
     *
     * @method cacheStatus
     * @param {String} status The status of the application cache.
     */
    proto.cacheStatus = function(status){

    };
    /**
     * Virtual protected function. Should be overridden on subclasses. Called automatically when the online/offline state of the application changes.
     *
     * @method onlineStatus
     * @param {Boolean} isonline True/false depending on the applications online/offline state.
     */
    proto.onlineStatus = function(isonline){

    };
    var prepare = function(){
        this.currentOnlineStatus = -1;
        if("applicationCache" in window){
            var ac = window.applicationCache;
            ac.addEventListener("error", this._("onApplicationCacheStatus"));
            ac.addEventListener("cached", this._("onApplicationCacheStatus"));
            ac.addEventListener("checking", this._("onApplicationCacheStatus"));
            ac.addEventListener("downloading", this._("onApplicationCacheStatus"));
            ac.addEventListener("noupdate", this._("onApplicationCacheStatus"));
            ac.addEventListener("obsolete", this._("onApplicationCacheStatus"));
            ac.addEventListener("progress", this._("onApplicationCacheStatus"));
            ac.addEventListener("ready", this._("onApplicationCacheStatus"));
            var ref = this;
            this.cacheStatusTimer = setInterval(function(){
                try{
                    window.applicationCache.update();
                }catch(err){
                    console.warn("Using application cache without a manifest. Cache update check and online status check will not work.");
                    clearInterval(ref.cacheStatusTimer);

                }

            }, this.cacheUpdateInterval);
        }
        this.localStorage = core.addons.webapp.LocalStorage.init();

    };
    core.registerNamespace("core.wirings.OfflineModule", OfflineModule);

})(core.selector);


text:
package linenotcat

import (
	"bufio"
	"os"
)

func readFromStdin(lines chan string) {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanLines)
	for scanner.Scan() {
		lines <- scanner.Text()
	}
	close(lines)
}