text:
using namespace rapidjson;

namespace chrono {
namespace vehicle {

// -----------------------------------------------------------------------------
// These utility functions return a ChVector and a ChQuaternion, respectively,
// from the specified JSON array.
// -----------------------------------------------------------------------------
static ChVector<> loadVector(const Value& a) {
    assert(a.IsArray());
    assert(a.Size() == 3);
    return ChVector<>(a[0u].GetDouble(), a[1u].GetDouble(), a[2u].GetDouble());
}

static ChQuaternion<> loadQuaternion(const Value& a) {
    assert(a.IsArray());
    assert(a.Size() == 4);
    return ChQuaternion<>(a[0u].GetDouble(), a[1u].GetDouble(), a[2u].GetDouble(), a[3u].GetDouble());
}

// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
void WheeledVehicle::LoadChassis(const std::string& filename) {
    FILE* fp = fopen(filename.c_str(), "r");

    char readBuffer[65536];
    FileReadStream is(fp, readBuffer, sizeof(readBuffer));

    fclose(fp);

    Document d;
    d.ParseStream<ParseFlag::kParseCommentsFlag>(is);

    // Check that the given file is a chassis specification file.
    assert(d.HasMember("Type"));
    std::string type = d["Type"].GetString();
    assert(type.compare("Chassis") == 0);

    // Extract the chassis type.
    assert(d.HasMember("Template"));
    std::string subtype = d["Template"].GetString();

    // Create the steering using the appropriate template.
    if (subtype.compare("RigidChassis") == 0) {
        m_chassis = std::make_shared<RigidChassis>(d);
    }

    GetLog() << "  Loaded JSON: " << filename.c_str() << "\n";
}

// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
void WheeledVehicle::LoadSteering(const std::string& filename, int which) {
    FILE* fp = fopen(filename.c_str(), "r");

    char readBuffer[65536];
    FileReadStream is(fp, readBuffer, sizeof(readBuffer));

    fclose(fp);

    Document d;
    d.ParseStream<ParseFlag::kParseCommentsFlag>(is);

    // Check that the given file is a steering specification file.
    assert(d.HasMember("Type"));
    std::string type = d["Type"].GetString();
    assert(type.compare("Steering") == 0);

    // Extract the steering type.
    assert(d.HasMember("Template"));
    std::string subtype = d["Template"].GetString();

    // Create the steering using the appropriate template.
    if (subtype.compare("PitmanArm") == 0) {
        m_steerings[which] = std::make_shared<PitmanArm>(d);
    } else if (subtype.compare("RackPinion") == 0) {
        m_steerings[which] = std::make_shared<RackPinion>(d);
    }

    GetLog() << "  Loaded JSON: " << filename.c_str() << "\n";
}

// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
void WheeledVehicle::LoadDriveline(const std::string& filename) {
    FILE* fp = fopen(filename.c_str(), "r");

    char readBuffer[65536];
    FileReadStream is(fp, readBuffer, sizeof(readBuffer));

    fclose(fp);

    Document d;
    d.ParseStream<ParseFlag::kParseCommentsFlag>(is);

    // Check that the given file is a driveline specification file.
    assert(d.HasMember("Type"));
    std::string type = d["Type"].GetString();
    assert(type.compare("Driveline") == 0);

    // Extract the driveline type.
    assert(d.HasMember("Template"));
    std::string subtype = d["Template"].GetString();

    // Create the driveline using the appropriate template.
    if (subtype.compare("ShaftsDriveline2WD") == 0) {
        m_driveline = std::make_shared<ShaftsDriveline2WD>(d);
    } else if (subtype.compare("ShaftsDriveline4WD") == 0) {
        m_driveline = std::make_shared<ShaftsDriveline4WD>(d);
    } else if (subtype.compare("SimpleDriveline") == 0) {
        m_driveline = std::make_shared<SimpleDriveline>(d);
    }

    GetLog() << "  Loaded JSON: " << filename.c_str() << "\n";
}

// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
void WheeledVehicle::LoadSuspension(const std::string& filename, int axle) {
    FILE* fp = fopen(filename.c_str(), "r");

    char readBuffer[65536];
    FileReadStream is(fp, readBuffer, sizeof(readBuffer));

    fclose(fp);

    Document d;
    d.ParseStream<ParseFlag::kParseCommentsFlag>(is);

    // Check that the given file is a suspension specification file.
    assert(d.HasMember("Type"));
    std::string type = d["Type"].GetString();
    assert(type.compare("Suspension") == 0);

    // Extract the suspension type.
    assert(d.HasMember("Template"));
    std::string subtype = d["Template"].GetString();

    // Create the suspension using the appropriate template.
    if (subtype.compare("DoubleWishbone") == 0) {
        m_suspensions[axle] = std::make_shared<DoubleWishbone>(d);
    } else if (subtype.compare("DoubleWishboneReduced") == 0) {
        m_suspensions[axle] = std::make_shared<DoubleWishboneReduced>(d);
    } else if (subtype.compare("SolidAxle") == 0) {
        m_suspensions[axle] = std::make_shared<SolidAxle>(d);
    } else if (subtype.compare("MultiLink") == 0) {
        m_suspensions[axle] = std::make_shared<MultiLink>(d);
    } else if (subtype.compare("MacPhersonStrut") == 0) {
        m_suspensions[axle] = std::make_shared<MacPhersonStrut>(d);
    } else if (subtype.compare("SemiTrailingArm") == 0) {
        m_suspensions[axle] = std::make_shared<SemiTrailingArm>(d);
    } else if (subtype.compare("ThreeLinkIRS") == 0) {
        m_suspensions[axle] = std::make_shared<ThreeLinkIRS>(d);
    }

    GetLog() << "  Loaded JSON: " << filename.c_str() << "\n";
}

// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
void WheeledVehicle::LoadAntirollbar(const std::string& filename) {
    FILE* fp = fopen(filename.c_str(), "r");

    char readBuffer[65536];
    FileReadStream is(fp, readBuffer, sizeof(readBuffer));

    fclose(fp);

    Document d;
    d.ParseStream<ParseFlag::kParseCommentsFlag>(is);

    // Check that the given file is an antirollbar specification file.
    assert(d.HasMember("Type"));
    std::string type = d["Type"].GetString();
    assert(type.compare("Antirollbar") == 0);

    // Extract the antirollbar type.
    assert(d.HasMember("Template"));
    std::string subtype = d["Template"].GetString();

    if (subtype.compare("AntirollBarRSD") == 0) {
        m_antirollbars.push_back(std::make_shared<AntirollBarRSD>(d));
    }

    GetLog() << "  Loaded JSON: " << filename.c_str() << "\n";
}

// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
void WheeledVehicle::LoadWheel(const std::string& filename, int axle, int side) {
    FILE* fp = fopen(filename.c_str(), "r");

    char readBuffer[65536];
    FileReadStream is(fp, readBuffer, sizeof(readBuffer));

    fclose(fp);

    Document d;
    d.ParseStream<ParseFlag::kParseCommentsFlag>(is);

    // Check that the given file is a wheel specification file.
    assert(d.HasMember("Type"));
    std::string type = d["Type"].GetString();
    assert(type.compare("Wheel") == 0);

    // Extract the wheel type.
    assert(d.HasMember("Template"));
    std::string subtype = d["Template"].GetString();

    // Create the wheel using the appropriate template.
    if (subtype.compare("Wheel") == 0) {
        m_wheels[2 * axle + side] = std::make_shared<Wheel>(d);
    }

    GetLog() << "  Loaded JSON: " << filename.c_str() << "\n";
}

// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
void WheeledVehicle::LoadBrake(const std::string& filename, int axle, int side) {
    FILE* fp = fopen(filename.c_str(), "r");

    char readBuffer[65536];
    FileReadStream is(fp, readBuffer, sizeof(readBuffer));

    fclose(fp);

    Document d;
    d.ParseStream<ParseFlag::kParseCommentsFlag>(is);

    // Check that the given file is a brake specification file.
    assert(d.HasMember("Type"));
    std::string type = d["Type"].GetString();
    assert(type.compare("Brake") == 0);

    // Extract the brake type.
    assert(d.HasMember("Template"));
    std::string subtype = d["Template"].GetString();

    // Create the brake using the appropriate template.
    if (subtype.compare("BrakeSimple") == 0) {
        m_brakes[2 * axle + side] = std::make_shared<BrakeSimple>(d);
    }

    GetLog() << "  Loaded JSON: " << filename.c_str() << "\n";
}

// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
WheeledVehicle::WheeledVehicle(const std::string& filename, ChMaterialSurface::ContactMethod contact_method)
    : ChWheeledVehicle("", contact_method) {
    Create(filename);
}

WheeledVehicle::WheeledVehicle(ChSystem* system, const std::string& filename) : ChWheeledVehicle("", system) {
    Create(filename);
}

// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
void WheeledVehicle::Create(const std::string& filename) {
    // -------------------------------------------
    // Open and parse the input file
    // -------------------------------------------
    FILE* fp = fopen(filename.c_str(), "r");

    char readBuffer[65536];
    FileReadStream is(fp, readBuffer, sizeof(readBuffer));

    fclose(fp);

    Document d;
    d.ParseStream<ParseFlag::kParseCommentsFlag>(is);

    // Read top-level data
    assert(d.HasMember("Type"));
    assert(d.HasMember("Template"));
    assert(d.HasMember("Name"));

    std::string name = d["Name"].GetString();
    std::string type = d["Type"].GetString();
    std::string subtype = d["Template"].GetString();
    assert(type.compare("Vehicle") == 0);
    assert(subtype.compare("WheeledVehicle") == 0);

    SetName(name);

    // ----------------------------
    // Validations of the JSON file
    // ----------------------------

    assert(d.HasMember("Steering Subsystems"));
    assert(d.HasMember("Driveline"));
    assert(d.HasMember("Axles"));
    assert(d["Axles"].IsArray());
    assert(d["Steering Subsystems"].IsArray());

    // Extract the number of axles.
    m_num_axles = d["Axles"].Size();

    // Extract the number of steering subsystems
    m_num_strs = d["Steering Subsystems"].Size();

    // Resize arrays
    m_suspensions.resize(m_num_axles);
    m_suspLocations.resize(m_num_axles);
    m_suspSteering.resize(m_num_axles, -1);
    m_wheels.resize(2 * m_num_axles);
    m_brakes.resize(2 * m_num_axles);

    m_steerings.resize(m_num_strs);
    m_strLocations.resize(m_num_strs);
    m_strRotations.resize(m_num_strs);

    // -------------------------------------------
    // Create the chassis system
    // -------------------------------------------
    assert(d.HasMember("Chassis"));

    {
        std::string file_name = d["Chassis"]["Input File"].GetString();
        LoadChassis(vehicle::GetDataFile(file_name));
    }

    // ------------------------------
    // Create the steering subsystems
    // ------------------------------

    for (int i = 0; i < m_num_strs; i++) {
        std::string file_name = d["Steering Subsystems"][i]["Input File"].GetString();
        LoadSteering(vehicle::GetDataFile(file_name), i);
        m_strLocations[i] = loadVector(d["Steering Subsystems"][i]["Location"]);
        m_strRotations[i] = loadQuaternion(d["Steering Subsystems"][i]["Orientation"]);
    }

    // --------------------
    // Create the driveline
    // --------------------

    {
        std::string file_name = d["Driveline"]["Input File"].GetString();
        LoadDriveline(vehicle::GetDataFile(file_name));
        SizeType num_driven_susp = d["Driveline"]["Suspension Indexes"].Size();
        m_driven_susp.resize(num_driven_susp);
        for (SizeType i = 0; i < num_driven_susp; i++) {
            m_driven_susp[i] = d["Driveline"]["Suspension Indexes"][i].GetInt();
        }

        assert(num_driven_susp == GetDriveline()->GetNumDrivenAxles());
    }

    // ---------------------------------------------------
    // Create the suspension, wheel, and brake subsystems.
    // ---------------------------------------------------

    for (int i = 0; i < m_num_axles; i++) {
        // Suspension
        std::string file_name = d["Axles"][i]["Suspension Input File"].GetString();
        LoadSuspension(vehicle::GetDataFile(file_name), i);
        m_suspLocations[i] = loadVector(d["Axles"][i]["Suspension Location"]);

        // Index of steering subsystem (if applicable)
        if (d["Axles"][i].HasMember("Steering Index")) {
            m_suspSteering[i] = d["Axles"][i]["Steering Index"].GetInt();
        }

        // Antirollbar (if applicable)
        if (d["Axles"][i].HasMember("Antirollbar Input File")) {
            assert(m_suspensions[i]->IsIndependent());
            assert(d["Axles"][i].HasMember("Antirollbar Location"));
            file_name = d["Axles"][i]["Antirollbar Input File"].GetString();
            LoadAntirollbar(vehicle::GetDataFile(file_name));
            m_arbLocations.push_back(loadVector(d["Axles"][i]["Antirollbar Location"]));
            m_arbSuspension.push_back(i);
        }

        // Left and right wheels
        file_name = d["Axles"][i]["Left Wheel Input File"].GetString();
        LoadWheel(vehicle::GetDataFile(file_name), i, 0);
        file_name = d["Axles"][i]["Right Wheel Input File"].GetString();
        LoadWheel(vehicle::GetDataFile(file_name), i, 1);

        // Left and right brakes
        file_name = d["Axles"][i]["Left Brake Input File"].GetString();
        LoadBrake(vehicle::GetDataFile(file_name), i, 0);

        file_name = d["Axles"][i]["Right Brake Input File"].GetString();
        LoadBrake(vehicle::GetDataFile(file_name), i, 1);
    }

    GetLog() << "Loaded JSON: " << filename.c_str() << "\n";
}

// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
void WheeledVehicle::Initialize(const ChCoordsys<>& chassisPos, double chassisFwdVel) {
    // Invoke base class method to initialize the chassis.
    ChWheeledVehicle::Initialize(chassisPos, chassisFwdVel);

    // Initialize the steering subsystems.
    for (int i = 0; i < m_num_strs; i++) {
        m_steerings[i]->Initialize(m_chassis->GetBody(), m_strLocations[i], m_strRotations[i]);
    }

    // Initialize the suspension, wheel, and brake subsystems.
    for (int i = 0; i < m_num_axles; i++) {
        if (m_suspSteering[i] >= 0)
            m_suspensions[i]->Initialize(m_chassis->GetBody(), m_suspLocations[i],
                                         m_steerings[m_suspSteering[i]]->GetSteeringLink(), m_suspSteering[i]);
        else
            m_suspensions[i]->Initialize(m_chassis->GetBody(), m_suspLocations[i], m_chassis->GetBody(), -1);

        m_wheels[2 * i]->Initialize(m_suspensions[i]->GetSpindle(LEFT));
        m_wheels[2 * i + 1]->Initialize(m_suspensions[i]->GetSpindle(RIGHT));

        m_brakes[2 * i]->Initialize(m_suspensions[i]->GetRevolute(LEFT));
        m_brakes[2 * i + 1]->Initialize(m_suspensions[i]->GetRevolute(RIGHT));
    }

    // Initialize the antirollbar subsystems.
    for (unsigned int i = 0; i < m_antirollbars.size(); i++) {
        int j = m_arbSuspension[i];
        m_antirollbars[i]->Initialize(m_chassis->GetBody(), m_arbLocations[i], m_suspensions[j]->GetLeftBody(),
                                      m_suspensions[j]->GetRightBody());
    }

    // Initialize the driveline
    m_driveline->Initialize(m_chassis->GetBody(), m_suspensions, m_driven_susp);
}

}  // end namespace vehicle
}  // end namespace chrono


text:
upload {
  display: block;
  margin-bottom: 15px; }
  upload .uploadedWrap {
    margin-top: 10px; }
  upload .uploaded {
    display: inline-block;
    vertical-align: middle;
    width: 250px;
    height: 150px;
    margin-right: 10px;
    background-size: cover;
    background-position: center center; }
  upload label {
    cursor: pointer; }
  upload form {
    display: none; }

redpajama_set_name: RedPajamaGithub


text:
namespace XDay
{
using string = std::basic_string<char, std::char_traits<char>, allocator<char>>;
using stringc = string const;

using wstring = std::basic_string<wchar_t, std::char_traits<wchar_t>, allocator<wchar_t>>;
using wstringc = wstring const;

using u16string = std::basic_string<char16_t, std::char_traits<char16_t>, allocator<char16_t>>;
using u16stringc = u16string const;

using u32string = std::basic_string<char32_t, std::char_traits<char32_t>, allocator<char32_t>>;
using u32stringc = u32string const;
}


text:
UPDATE `line_item_categories` SET `title` = 'personnel and wages' WHERE `line_item_categories`.`id` =5 LIMIT 1 ;
UPDATE `line_item_categories` SET `title` = 'materials and equipment' WHERE `line_item_categories`.`id` =3 LIMIT 1 ;
DELETE FROM `line_item_categories` WHERE `line_item_categories`.`id` =7 LIMIT 1 ;
DELETE FROM `line_item_categories` WHERE `line_item_categories`.`id` =9 LIMIT 1 ;
UPDATE `line_items` SET line_item_category_id =5 WHERE line_item_category_id =9;
UPDATE `line_items` SET line_item_category_id =3 WHERE line_item_category_id =7;


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('pdl', '0002_proyecto_legislatura'),
    ]

    operations = [
        migrations.AlterField(
            model_name='proyecto',
            name='legislatura',
            field=models.IntegerField(),
        ),
    ]


text:
namespace SharePortfolioManager.OwnMessageBoxForm
{
    partial class OwnMessageBox
    {
        /// <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(OwnMessageBox));
            this.btnCancel = new System.Windows.Forms.Button();
            this.btnOk = new System.Windows.Forms.Button();
            this.tblLayPnlOnwMessageBox = new System.Windows.Forms.TableLayoutPanel();
            this.tblLayPnlOnwMessageBox.SuspendLayout();
            this.SuspendLayout();
            //
            // btnCancel
            //
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.Dock = System.Windows.Forms.DockStyle.Fill;
            this.btnCancel.Location = new System.Drawing.Point(285, 3);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(174, 30);
            this.btnCancel.TabIndex = 2;
            this.btnCancel.Text = "_Cancel";
            this.btnCancel.UseVisualStyleBackColor = true;
            this.btnCancel.Click += new System.EventHandler(this.OnBtnCancel_Click);
            //
            // btnOk
            //
            this.btnOk.Dock = System.Windows.Forms.DockStyle.Fill;
            this.btnOk.Location = new System.Drawing.Point(105, 3);
            this.btnOk.Name = "btnOk";
            this.btnOk.Size = new System.Drawing.Size(174, 30);
            this.btnOk.TabIndex = 1;
            this.btnOk.Text = "_Ok";
            this.btnOk.UseVisualStyleBackColor = true;
            this.btnOk.Click += new System.EventHandler(this.OnBtnOk_Click);
            //
            // tblLayPnlOnwMessageBox
            //
            this.tblLayPnlOnwMessageBox.ColumnCount = 3;
            this.tblLayPnlOnwMessageBox.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tblLayPnlOnwMessageBox.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 180F));
            this.tblLayPnlOnwMessageBox.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 180F));
            this.tblLayPnlOnwMessageBox.Controls.Add(this.btnOk, 1, 0);
            this.tblLayPnlOnwMessageBox.Controls.Add(this.btnCancel, 2, 0);
            this.tblLayPnlOnwMessageBox.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.tblLayPnlOnwMessageBox.Location = new System.Drawing.Point(0, 159);
            this.tblLayPnlOnwMessageBox.Name = "tblLayPnlOnwMessageBox";
            this.tblLayPnlOnwMessageBox.RowCount = 1;
            this.tblLayPnlOnwMessageBox.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tblLayPnlOnwMessageBox.Size = new System.Drawing.Size(462, 36);
            this.tblLayPnlOnwMessageBox.TabIndex = 3;
            //
            // OwnMessageBox
            //
            this.AcceptButton = this.btnOk;
            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackColor = System.Drawing.SystemColors.InactiveCaption;
            this.CancelButton = this.btnCancel;
            this.ClientSize = new System.Drawing.Size(462, 195);
            this.Controls.Add(this.tblLayPnlOnwMessageBox);
            this.Font = new System.Drawing.Font("Consolas", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.MinimumSize = new System.Drawing.Size(478, 234);
            this.Name = "OwnMessageBox";
            this.ShowInTaskbar = false;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            this.Text = "_MessageBox";
            this.TopMost = true;
            this.Load += new System.EventHandler(this.OwnMessageBox_Load);
            this.Shown += new System.EventHandler(this.OwnMessageBox_Shown);
            this.Paint += new System.Windows.Forms.PaintEventHandler(this.OwnMessageBox_Paint);
            this.tblLayPnlOnwMessageBox.ResumeLayout(false);
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.Button btnCancel;
        private System.Windows.Forms.Button btnOk;
        private System.Windows.Forms.TableLayoutPanel tblLayPnlOnwMessageBox;
    }
}


text:
<?php

namespace AppBundle\DBAL\Types;

use Fresh\DoctrineEnumBundle\DBAL\Types\AbstractEnumType;

/**
 * Class ArticleType
 *
 * @author Andrey Nilov <nilov@glavweb.ru>
 */
class ArticleType extends AbstractEnumType
{
    const NEWS         = 'news';
    const PHOTO_REPORT = 'photo_report';
    const ARTICLE      = 'article';

    /**
     * @var array
     */
    protected static $choices = array(
        self::NEWS         => 'News',
        self::PHOTO_REPORT => 'Photo report',
        self::ARTICLE      => 'Article'
    );
}


text:
<?php

namespace Ekyna\Component\Commerce\Quote\Model;

use Ekyna\Component\Commerce\Common\Model\SaleAddressInterface;

/**
 * Interface QuoteAddressInterface
 * @package Ekyna\Component\Commerce\Quote\Model
 * @author  Etienne Dauvergne <contact@ekyna.com>
 */
interface QuoteAddressInterface extends SaleAddressInterface
{
    /**
     * Returns the quote this address is the invoice one.
     *
     * @return QuoteInterface|null
     */
    public function getInvoiceQuote();

    /**
     * Sets the quote this address is the invoice one.
     *
     * @param QuoteInterface $quote
     *
     * @return $this|QuoteAddressInterface
     */
    public function setInvoiceQuote(QuoteInterface $quote = null);

    /**
     * Returns the quote this address is the delivery one.
     *
     * @return QuoteInterface|null
     */
    public function getDeliveryQuote();

    /**
     * Sets the quote this address is the delivery one.
     *
     * @param QuoteInterface $quote
     *
     * @return $this|QuoteAddressInterface
     */
    public function setDeliveryQuote(QuoteInterface $quote = null);

    /**
     * Returns the related quote.
     *
     * @return QuoteInterface|null
     */
    public function getQuote();
}


text:
module Thredded
  module HtmlPipeline
    module Utils
      private

      # If the given block element is contained in a paragraph, splits the paragraph and removes unnecessary whitespace.
      # @param [Nokogiri::HTML::Node] element the block element that may be inside a paragraph.
      def extract_block_from_paragraph!(element)
        p = element.parent
        return unless node_name?(p, 'p')
        children_after = p.children[p.children.index(element) + 1..-1]
        remove_leading_blanks! children_after
        # Move the element out of and after the paragraph
        p.add_next_sibling element
        # Move all the elements after the onebox to a new paragraph
        unless children_after.empty?
          new_p = Nokogiri::XML::Node.new 'p', doc
          element.add_next_sibling new_p
          children_after.each { |child| new_p.add_child child }
        end
        # The original paragraph might have been split just after a <br> or whitespace, remove them if so:
        remove_leading_blanks! p.children.reverse
        p.remove if p.children.empty?
      end

      # @param children [Nokogiri::XML::NodeSet]
      def remove_leading_blanks!(children)
        to_remove = children.take_while do |c|
          if node_name?(c, 'br') || c.text? && c.content.blank?
            c.remove
            true
          else
            c.content = c.content.lstrip
            false
          end
        end
        to_remove.each { |c| children.delete(c) }
      end

      def node_name?(node, node_name)
        node&.node_name && node.node_name.casecmp(node_name).zero?
      end
    end
  end
end


text:
package org.gradle.test.performance.mediummonolithicjavaproject.p485;

import org.gradle.test.performance.mediummonolithicjavaproject.p481.Production9634;
import org.gradle.test.performance.mediummonolithicjavaproject.p483.Production9674;

import org.junit.Test;
import static org.junit.Assert.*;

public class Test9715 {
    Production9715 objectUnderTest = new Production9715();

    @Test
    public void testProperty0() {
        Production9634 value = new Production9634();
        objectUnderTest.setProperty0(value);
        assertEquals(value, objectUnderTest.getProperty0());
    }

    @Test
    public void testProperty1() {
        Production9674 value = new Production9674();
        objectUnderTest.setProperty1(value);
        assertEquals(value, objectUnderTest.getProperty1());
    }

    @Test
    public void testProperty2() {
        Production9714 value = new Production9714();
        objectUnderTest.setProperty2(value);
        assertEquals(value, objectUnderTest.getProperty2());
    }

    @Test
    public void testProperty3() {
        String value = "value";
        objectUnderTest.setProperty3(value);
        assertEquals(value, objectUnderTest.getProperty3());
    }

    @Test
    public void testProperty4() {
        String value = "value";
        objectUnderTest.setProperty4(value);
        assertEquals(value, objectUnderTest.getProperty4());
    }

    @Test
    public void testProperty5() {
        String value = "value";
        objectUnderTest.setProperty5(value);
        assertEquals(value, objectUnderTest.getProperty5());
    }

    @Test
    public void testProperty6() {
        String value = "value";
        objectUnderTest.setProperty6(value);
        assertEquals(value, objectUnderTest.getProperty6());
    }

    @Test
    public void testProperty7() {
        String value = "value";
        objectUnderTest.setProperty7(value);
        assertEquals(value, objectUnderTest.getProperty7());
    }

    @Test
    public void testProperty8() {
        String value = "value";
        objectUnderTest.setProperty8(value);
        assertEquals(value, objectUnderTest.getProperty8());
    }

    @Test
    public void testProperty9() {
        String value = "value";
        objectUnderTest.setProperty9(value);
        assertEquals(value, objectUnderTest.getProperty9());
    }

}


text:
        <app-customer [customer]="c" ></app-customer>

boop! bind to observable array

        <app-customer [customer]="c" ></app-customer>

badoop..bind to promise of array

        <app-customer [customer]="c" ></app-customer>

bading! bind to plain array - returned after our subscription to an observable finished it's thang!


text:
title: "Crew Wechsel"
date: 2012-08-23 20:15
---
Bereits um 08:00 Uhr waren die ersten auf den Beinen und begannen zu packen. Währenddessen fuhren wir zum tanken und anschliessen an Ponton Nummer 1, der näher zum Hafeneingang liegt.

<!--more-->

Nach dem gemeinsamen Frühstück gings weiter mit packen und Bootsreinigung, sowie letzten technischen Checks. Die Stopfbuchse haben wir um eine Nut angezogen, da doch einiges an Wasser in den Bilgen stand. In den nächsten Tagen ist das zu kontrollieren.

Das Jugendtörn Team wurde überpünktlich um 13:30 Uhr vom Taxibus nach Aberdeen abgeholt.

Nach 13 Tagen quasi rund um die Uhr mit einer Gruppe zusammen und nun ganz alleine auf der [Moby Dick III]. Man könnte meinen jemand hätte massiv auf die Bremse getreten.

Nach dem verzehr der Reste vom Vortag hab ich meine Wäsche in den Waschautomaten gestopft und danach in den Trockner. Der Kartentisch eignet sich auch zum Wäsche zusammenlegen. Jedenfalls könnte ich nun weit mehr als die geplanten 4 Wochen Wäschetechnisch durchhalten.

Nach ein paar Blogeinträgen tippen und IT-Support in der Heimat hab ich mich zu einkaufen für die nächste Crew aufgemacht. Der erste Supermarkt war eher der Flop. Keinerlei Wurst. Also zurück zum Boot und dann nochmal los zum LIDL, eine Ecke weiter. Nudeln, Bockwürste, Salami, Aufschnitt und Schinken eingekauft.

Jetzt gönn ich mir ein Paulaner und schmier mir mein Abendbrot und warte bis die nächste Crew gegen 21 Uhr landet und hier ankommt.

Aus der Bordanlage kommen zufällige Titel von meinem USB Stick.

Weiter geht es mit dem Bericht [Orkney Inseln 2012](/2012/08/25/orkney_inseln_2012/)

{% include _references.md %}


text:
package org.arakhne.afc.math.geometry.d3;

import java.util.Iterator;

import org.arakhne.afc.math.geometry.PathElementType;
import org.arakhne.afc.math.geometry.PathWindingRule;
import org.arakhne.afc.math.geometry.d3.continuous.PathIterator3d;
import org.arakhne.afc.math.geometry.d3.continuous.PathIterator3f;
import org.eclipse.xtext.xbase.lib.Pure;

/** 3D Path.
 *
 * @param <PT> is the type of the path implementation.
 * @param  is the type of the bounding box.
 * @param <E> is the type of the elements of the path.
 * @param  is the type of the iterator used to obtain the elements of the path.
 * @author $Author: hjaffali$
 * @version $FullVersion$
 * @mavengroupid $GroupId$
 * @mavenartifactid $ArtifactId$
 */
public interface Path3D<PT extends Shape3D<? super PT>, B extends Shape3D<?>, E extends PathElement3D, I extends Iterator<E>> extends Shape3D<PT> {

	/**
	 * Replies the bounds of this path.
	 *
	 * @return the bounds
	 */
	public B toBoundingBox();

	/** Replies the winding rule for the path.
	 *
	 * @return the winding rule for the path.
	 */
	@Pure
	public PathWindingRule getWindingRule();

	/** Replies the path is composed only by
	 * MOVE_TO, LINE_TO
	 * or CLOSE primitives (no curve).
	 *
	 * @return true if the path does not
	 * contain curve primitives, false
	 * otherwise.
	 */
	public boolean isPolyline();

	/** Replies an iterator on the path elements.
	 *

	 * Only {@link PathElementType#MOVE_TO},
	 * {@link PathElementType#LINE_TO}, and
	 * {@link PathElementType#CLOSE} types are returned by the iterator.
	 *

	 * The amount of subdivision of the curved segments is controlled by the
	 * flatness parameter, which specifies the maximum distance that any point
	 * on the unflattened transformed curve can deviate from the returned
	 * flattened path segments. Note that a limit on the accuracy of the
	 * flattened path might be silently imposed, causing very small flattening
	 * parameters to be treated as larger values. This limit, if there is one,
	 * is defined by the particular implementation that is used.
	 *

	 * The iterator for this class is not multi-threaded safe.
	 *
	 * @param flatness is the maximum distance that the line segments used to approximate
	 * the curved segments are allowed to deviate from any point on the original curve.
	 * @return an iterator on the path elements.
	 */
	@Pure
	public PathIterator3f getPathIterator(double flatness);

	/** Replies an iterator on the path elements.
	 *

	 * The iterator for this class is not multi-threaded safe.
	 *
	 * @return an iterator on the path elements.
	 */
	@Pure
	public PathIterator3f getPathIterator();

	/** Replies an iterator on the path elements.
	 *

	 * Only {@link PathElementType#MOVE_TO},
	 * {@link PathElementType#LINE_TO}, and
	 * {@link PathElementType#CLOSE} types are returned by the iterator.
	 *

	 * The amount of subdivision of the curved segments is controlled by the
	 * flatness parameter, which specifies the maximum distance that any point
	 * on the unflattened transformed curve can deviate from the returned
	 * flattened path segments. Note that a limit on the accuracy of the
	 * flattened path might be silently imposed, causing very small flattening
	 * parameters to be treated as larger values. This limit, if there is one,
	 * is defined by the particular implementation that is used.
	 *

	 * The iterator for this class is not multi-threaded safe.
	 *
	 * @param flatness is the maximum distance that the line segments used to approximate
	 * the curved segments are allowed to deviate from any point on the original curve.
	 * @return an iterator on the path elements.
	 */
	@Pure
	public PathIterator3d getPathIteratorProperty(double flatness);

	/** Replies an iterator on the path elements.
	 *

	 * The iterator for this class is not multi-threaded safe.
	 *
	 * @return an iterator on the path elements.
	 */
	@Pure
	public PathIterator3d getPathIteratorProperty();

}


text:
@class FLUtilityPaneController;

@interface FLUtilityPaneStreamsViewController : NSViewController<NSComboBoxDataSource, NSComboBoxDelegate>

@property (weak) IBOutlet FLUtilityPaneController *utilityPaneController;
@property (weak) IBOutlet NSComboBox *streamIDComboBox;
@property (weak) IBOutlet NSPopUpButton *streamTypePopupButton;
@property (weak) IBOutlet NSPopUpButton *streamVisualPopupButton;
@property (weak) IBOutlet NSPopUpButton *streamInterpolationPopupButton;
@property (weak) IBOutlet NSTextField *anchorPointsCountLabel;
@property (weak) IBOutlet NSColorWell *streamColorPicker;
@property (weak) IBOutlet NSButton *streamsVisibilityCheckBox;
@property (weak) IBOutlet NSButton *streamsSelectabilityCheckBox;
//@property (weak) IBOutlet NSButton *visualizationButton;
//@property (weak) IBOutlet NSTextField *visualizationTime;

- (IBAction)appendStream:(id)sender;

- (IBAction)removeSelectedStream:(id)sender;
- (IBAction)streamTypeChanged:(id)sender;
- (IBAction)streamVisualAidChanged:(id)sender;
- (IBAction)streamsVisibilityChanged:(id)sender;
- (IBAction)streamsSelectabilityChanged:(id)sender;
- (IBAction)streamColorChanged:(id)sender;
- (IBAction)streamInterpolationChanged:(id)sender;

@end


text:
#include "MocoMarkerTrackingGoal.h"

#include <OpenSim/Common/TableUtilities.h>
#include <OpenSim/Moco/MocoUtilities.h>
#include <OpenSim/Simulation/Model/Marker.h>
#include <OpenSim/Simulation/Model/Model.h>

using namespace OpenSim;
using RefPtrMSF = SimTK::ReferencePtr<const MocoScaleFactor>;

void MocoMarkerTrackingGoal::addScaleFactor(const std::string& name,
    const std::string& marker, int index, const MocoBounds &bounds) {

    // Check that the marker exists in the MarkersReference.
    const auto& markerWeights = get_markers_reference().getMarkerWeightSet();
    OPENSIM_THROW_IF_FRMOBJ(!markerWeights.contains(marker), Exception,
                "Marker '{}' not found in the MarkersReference.", marker);

    // Check that the index is in the correct range.
    OPENSIM_THROW_IF_FRMOBJ((index < 0) || (index > 2), Exception,
                "Expected marker scale factor index to be in the range [0, 2], "
                "but received '{}'.", index);

    // Update the scale factor map so we can retrieve the correct MocoScaleFactor
    // for this marker during initialization.
    m_scaleFactorMap[std::pair<std::string, int>(marker, index)] = name;

    // Append the scale factor to the MocoGoal.
    appendScaleFactor(MocoScaleFactor(name, bounds));
}

void MocoMarkerTrackingGoal::initializeOnModelImpl(const Model& model) const {

    // TODO: When should we load a markers file?
    if (get_markers_reference().get_marker_file() != "") {
        auto* mutableThis = const_cast<MocoMarkerTrackingGoal*>(this);
        mutableThis->upd_markers_reference()
                .initializeFromMarkersFile(
                        get_markers_reference().get_marker_file(),
                        Set<MarkerWeight>());
    }

    // Check that there are no redundant columns in the reference data.
    TableUtilities::checkNonUniqueLabels(
            get_markers_reference().getMarkerTable().getColumnLabels());

    // Cache reference pointers to model markers.
    const auto& markRefNames = get_markers_reference().getNames();
    const auto& markerSet = model.getMarkerSet();
    const auto& scaleFactors = getModel().getComponentList<MocoScaleFactor>();
    int iset = -1;
    for (int i = 0; i < (int)markRefNames.size(); ++i) {
        if (model.hasComponent<Marker>(markRefNames[i])) {
            const auto& m = model.getComponent<Marker>(markRefNames[i]);
            // Store a pointer to the current model marker.
            m_model_markers.emplace_back(&m);
            // Store the reference index corresponding to the current model
            // marker.
            m_refindices.push_back(i);
        } else if ((iset = markerSet.getIndex(markRefNames[i])) != -1) {
            // Allow the marker ref names to be names of markers in the
            // MarkerSet.
            m_model_markers.emplace_back(&markerSet.get(iset));
            m_refindices.push_back(i);
        } else {
            if (!get_allow_unused_references()) {
                OPENSIM_THROW_FRMOBJ(Exception,
                        "Marker '{}' unrecognized by the specified model.",
                        markRefNames[i]);
            }
        }

        // Check to see if the model contains a MocoScaleFactor associated with
        // this marker.
        std::array<RefPtrMSF, 3> theseScaleFactorRefs;
        for (int j = 0; j < 3; ++j) {
            bool foundScaleFactor = false;
            std::pair<std::string, int> key(markRefNames[i], j);
            for (const auto& scaleFactor : scaleFactors) {
                if (m_scaleFactorMap[key] == scaleFactor.getName()) {
                    theseScaleFactorRefs[j] = &scaleFactor;
                    foundScaleFactor = true;
                }
            }
            // If we didn't find a MocoScaleFactor for this marker direction, set
            // the reference pointer to null.
            if (!foundScaleFactor) {
                theseScaleFactorRefs[j] = nullptr;
            }
        }
        m_scaleFactorRefs.push_back(theseScaleFactorRefs);
    }

    // Get the marker weights. The MarkersReference constructor automatically
    // sets a default value of 1.0 to each marker if not provided by the user,
    // so this is generic.
    const SimTK::State& s = model.getWorkingState();
    get_markers_reference().getWeights(s, m_marker_weights);
    m_marker_names = get_markers_reference().getNames();

    // Get and flatten TimeSeriesTableVec3 to doubles and create a set of
    // reference splines, one for each component of the coordinate
    // trajectories.
    m_refsplines =
            GCVSplineSet(get_markers_reference().getMarkerTable().flatten());

    setRequirements(1, 1, SimTK::Stage::Position);
}

void MocoMarkerTrackingGoal::calcIntegrandImpl(
        const IntegrandInput& input, SimTK::Real& integrand) const {
     const auto& time = input.state.getTime();
     getModel().realizePosition(input.state);
     SimTK::Vector timeVec(1, time);

    for (int i = 0; i < (int)m_model_markers.size(); ++i) {
         const auto& modelValue =
                 m_model_markers[i]->getLocationInGround(input.state);
         SimTK::Vec3 refValue;

        // Get the markers reference index corresponding to the current
        // model marker and get the reference value.
        int refidx = m_refindices[i];
        refValue[0] = m_refsplines[3 * refidx].calcValue(timeVec);
        refValue[1] = m_refsplines[3 * refidx + 1].calcValue(timeVec);
        refValue[2] = m_refsplines[3 * refidx + 2].calcValue(timeVec);

        // Apply scale factors for this marker, if they exist.
        const auto& scaleFactorRef = m_scaleFactorRefs[i];
        for (int j = 0; j < 3; ++j) {
            if (scaleFactorRef[j] != nullptr) {
                refValue[j] *= scaleFactorRef[j]->getScaleFactor();
            }
        }

        double distance = (modelValue - refValue).normSqr();

        integrand += m_marker_weights[refidx] * distance;
    }
}

void MocoMarkerTrackingGoal::printDescriptionImpl() const {
    log_cout(
            "        allow unused references: ", get_allow_unused_references());
    log_cout("        tracked marker(s):");
    int weightIndex = 0;
    for (const auto& name : m_marker_names) {
        log_cout("            {}, weight: {}", name,
                m_marker_weights[weightIndex]);
        weightIndex++;
    }

}

void MocoMarkerTrackingGoal::setMarkersReference(const MarkersReference& ref) {
    upd_markers_reference() = ref;
}


text:
package com.awcoleman.BouncyCastleGenericCDRHadoopWithWritable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Enumeration;

import org.apache.hadoop.io.Writable;
import org.bouncycastle.asn1.ASN1Encodable;
import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.DERApplicationSpecific;

/**
 *
 * A Writable container class for a "Simple Generic CDR".
 *
 * @author awcoleman
 * @version 20140702
 * license: Apache License 2.0; http://www.apache.org/licenses/LICENSE-2.0
 *
 */
public class CallDetailRecord extends ASN1Object implements Writable {

	ASN1Sequence cdr;

	int recordNumber;      //APPLICATION  2
	String callingNumber;  //APPLICATION  8
	String calledNumber;   //APPLICATION  9
	String startDate;      //APPLICATION 16
	String startTime;      //APPLICATION 18
	int duration;          //APPLICATION 19

	public CallDetailRecord() {
		clearFields();
	}

	public CallDetailRecord(ASN1Sequence inSeq) throws UnsupportedEncodingException {
		cdr = inSeq;

		for (@SuppressWarnings("unchecked")
		Enumeration<ASN1Encodable> en = cdr.getObjects(); en.hasMoreElements();) {
			ASN1Encodable em = en.nextElement();
			ASN1Primitive emp = em.toASN1Primitive();
			DERApplicationSpecific emt = (DERApplicationSpecific)emp;

			//System.out.println("emt.getApplicationTag(): "+emt.getApplicationTag());

			switch (emt.getApplicationTag()) {
				case 2: recordNumber = emt.getContents()[0];
					break;
				case 8: callingNumber = new String(emt.getContents(), "UTF-8");
					break;
				case 9: calledNumber = new String(emt.getContents(), "UTF-8");
					break;
				case 16: startDate = new String(emt.getContents(), "UTF-8");
					break;
				case 18: startTime = new String(emt.getContents(), "UTF-8");
					break;
				case 19: duration = emt.getContents()[0];
					break;
				default:
					//Unknown application number. In production would either log or error.
					break;
			}
		}

	}

	public void clearFields() {
		cdr=null;
		recordNumber=0;
		callingNumber=null;
		calledNumber=null;
		startDate=null;
		startTime=null;
		duration=0;
	}

	@Override
	public ASN1Primitive toASN1Primitive() {
		return null; //Once we have read in the original ASN.1 we are done with it.
	}

	public int getRecordNumber() {
		return recordNumber;
	}

	public void setRecordNumber(int recordNumber) {
		this.recordNumber = recordNumber;
	}

	public String getCallingNumber() {
		return callingNumber;
	}

	public void setCallingNumber(String callingNumber) {
		this.callingNumber = callingNumber;
	}

	public String getCalledNumber() {
		return calledNumber;
	}

	public void setCalledNumber(String calledNumber) {
		this.calledNumber = calledNumber;
	}

	public String getStartDate() {
		return startDate;
	}

	public void setStartDate(String startDate) {
		this.startDate = startDate;
	}

	public String getStartTime() {
		return startTime;
	}

	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}

	public int getDuration() {
		return duration;
	}

	public void setDuration(int duration) {
		this.duration = duration;
	}

	@Override
	public void readFields(DataInput in) throws IOException {

		recordNumber = in.readInt();
		callingNumber = in.readUTF();
		calledNumber = in.readUTF();
		startDate = in.readUTF();
		startTime = in.readUTF();
		duration = in.readInt();

	}

	@Override
	public void write(DataOutput out) throws IOException {

		out.writeInt(recordNumber);
		out.writeUTF(callingNumber);  //writeUTF includes length info
		out.writeUTF(calledNumber);
		out.writeUTF(startDate);
		out.writeUTF(startTime);
		out.writeInt(duration);

	}

}


text:
require 'spec_helper'

describe AdminUser do
  it "saving AdminUser should increase count by 1" do
    count = AdminUser.count
    FactoryGirl.create(:admin_user)
    AdminUser.count.should eq(count + 1)
  end
end


text:
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class EditAdditionalNoteInShipments extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('shipments', function (Blueprint $table) {
            $table->text('additional_note')->nullable()->change();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('shipments', function (Blueprint $table) {
            $table->text('additional_note')->nullable(false)->change();
        });
    }
}


text:
var gllist = express.Router();

gllist.get("/",listControl.li);

module.exports = gllist;


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <integer name="keyguard_max_notification_count">3</integer>
    <integer name="quick_settings_num_columns">3</integer>
</resources>


text:
///////////////////////////////////////////////////////////////////////////////
//
//  Module: MailMsg.h
//
//    Desc: This class encapsulates the MAPI and CMC mail functions.
//
// Copyright (c) 2003 Michael Carruth
//
///////////////////////////////////////////////////////////////////////////////

#ifndef _MAILMSG_H_
#define _MAILMSG_H_

#include "stdafx.h"

typedef std::map<std::string, std::string> TStrStrMap;

//
// Define CMC entry points
//
typedef CMC_return_code (FAR PASCAL *LPCMCLOGON) \
(CMC_string, CMC_string, CMC_string, CMC_object_identifier, \
 CMC_ui_id, CMC_uint16, CMC_flags, CMC_session_id FAR*, \
 CMC_extension FAR*);

typedef CMC_return_code (FAR PASCAL *LPCMCSEND) \
(CMC_session_id, CMC_message FAR*, CMC_flags, \
 CMC_ui_id, CMC_extension FAR*);

typedef CMC_return_code (FAR PASCAL *LPCMCLOGOFF) \
(CMC_session_id, CMC_ui_id, CMC_flags, CMC_extension FAR*);

typedef CMC_return_code (FAR PASCAL *LPCMCQUERY) \
(CMC_session_id, CMC_enum, CMC_buffer, CMC_extension FAR*);

////////////////////////////// Class Definitions /////////////////////////////

// ===========================================================================
// CMailMsg
//
// See the module comment at top of file.
//
class CMailMsg
{
public:

    // Construction/destruction
    CMailMsg();
    virtual ~CMailMsg();

    // Operations
    void SetTo(CString sAddress);
    void SetFrom(CString sAddress);
    void SetSubject(CString sSubject);
    void SetMessage(CString sMessage);
    void AddAttachment(CString sAttachment, CString sTitle = _T(""));

    BOOL MAPIInitialize();
    void MAPIFinalize();

    static BOOL DetectMailClient(CString& sMailClientName);
    CString GetEmailClientName();
    BOOL Send();
    BOOL MAPISend();
    BOOL CMCSend();
    CString GetLastErrorMsg(){ return m_sErrorMsg; }

protected:

    std::string    m_from;                       // From <address,name>
    std::string    m_to;                         // To <address,name>
    TStrStrMap     m_attachments;                // Attachment <file,title>
    std::string    m_sSubject;                   // EMail subject
    std::string    m_sMessage;                   // EMail message

    HMODULE        m_hMapi;                      // Handle to MAPI32.DLL
    LPCMCQUERY     m_lpCmcQueryConfiguration;    // Cmc func pointer
    LPCMCLOGON     m_lpCmcLogon;                 // Cmc func pointer
    LPCMCSEND      m_lpCmcSend;                  // Cmc func pointer
    LPCMCLOGOFF    m_lpCmcLogoff;                // Cmc func pointer
    LPMAPILOGON    m_lpMapiLogon;                // Mapi func pointer
    LPMAPISENDMAIL m_lpMapiSendMail;             // Mapi func pointer
    LPMAPILOGOFF   m_lpMapiLogoff;               // Mapi func pointer

    BOOL           m_bReady;                     // MAPI is loaded
    CString        m_sEmailClientName;

    CString        m_sErrorMsg;
};

#endif	// _MAILMSG_H_


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

namespace SqlSugar
{
    public class KdbndpDbFirst : DbFirstProvider
    {
    }
}


text:
using System;
using System.Xml.XPath;
using OpenADK.Library.Tools.XPath;

namespace OpenADK.Library.Impl.Surrogates
{
    /// <summary>
    /// Represents a node pointer that points to a path supported by the ADK from SIF 1.x, but
    /// for which there is no actual element. For Example, the GradYear/@Type attribute exists in SIF1.x,
    /// but doesn't exist in SIF 2.x. FauxElementPointer could be built based on a SIF 1.x XPath, but
    /// will actually point to the in-memory SIF 2.x field.
    /// </summary>
    public abstract class FauxElementPointer : AbstractNodePointer
    {
        private String fFieldName;
        private bool fIsAttribute;

        protected FauxElementPointer( INodePointer parent, String fauxName, bool isAttribute ) : base( parent )
        {
            fFieldName = fauxName;
            fIsAttribute = isAttribute;
        }

        public bool IsAttribute
        {
            get { return fIsAttribute; }
        }

        /// <summary>
        /// One of the XPathNodeType values representing the current node.
        /// </summary>
        public override XPathNodeType NodeType
        {
            get
            {
                if ( IsAttribute )
                {
                    return XPathNodeType.Attribute;
                }
                else
                {
                    return XPathNodeType.Element;
                }
            }
        }

        /// <summary>
        /// When overridden in a derived class, gets a value indicating whether the current node
        /// is an empty element without an end element tag.
        /// </summary>
        public override bool IsEmptyElement
        {
            get { return false; }
        }

        public override string Name
        {
            get { return fFieldName; }
        }

        protected void SetFieldValue( Element field, Object value )
        {
            SifSimpleType sifValue = null;
            if ( value is SifSimpleType )
            {
                sifValue = (SifSimpleType) value;
            }
            else
            {
                sifValue = field.ElementDef.TypeConverter.GetSifSimpleType( value );
            }

            field.SifValue = sifValue;
        }
    }
}


text:
set -ev;
cd target/jsdoc
git init
git config user.name ${GH_NAME}
git config user.email ${GH_EMAIL}
git add .
git commit -m "Deployed to Github Pages"
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1


text:
using System;
using System.Linq;
using NUnit.Framework;
using TestSharp;

namespace BuxferSharp.FunctionalTests
{
    [TestFixture]
    [Category("Accounts")]
    public class AccountsTest
    {
        [Test]
        public void GetAccounts_NoArgs_AllAccounts()
        {
            var target = TestHelper.CreateClient();
            var actual = target.GetAccounts();

            Assert.AreNotEqual(0, actual.TotalCount);
            Assert.AreNotEqual(0, actual.Entities.Count());
            Assert.AreEqual(actual.TotalCount, actual.Entities.Count);

            foreach (var account in actual.Entities)
            {
                Assert.IsNotNull(account.Id);
                Assert.IsNotNull(account.Name);
                Assert.IsNotNull(account.Currency);
            }
        }
    }
}


text:
//
//  Generated by the J2ObjC translator.  DO NOT EDIT!
//  source: /Volumes/Personal/Documents/raspi-config/client-framework/build/j2oSources/javax/jmdns/impl/tasks/state/Renewer.java
//

#include "J2ObjC_header.h"

#pragma push_macro("INCLUDE_ALL_JavaxJmdnsImplTasksStateRenewer")
#ifdef RESTRICT_JavaxJmdnsImplTasksStateRenewer
#define INCLUDE_ALL_JavaxJmdnsImplTasksStateRenewer 0
#else
#define INCLUDE_ALL_JavaxJmdnsImplTasksStateRenewer 1
#endif
#undef RESTRICT_JavaxJmdnsImplTasksStateRenewer

#if !defined (JavaxJmdnsImplTasksStateRenewer_) && (INCLUDE_ALL_JavaxJmdnsImplTasksStateRenewer || defined(INCLUDE_JavaxJmdnsImplTasksStateRenewer))
#define JavaxJmdnsImplTasksStateRenewer_

#define RESTRICT_JavaxJmdnsImplTasksStateDNSStateTask 1
#define INCLUDE_JavaxJmdnsImplTasksStateDNSStateTask 1
#include "javax/jmdns/impl/tasks/state/DNSStateTask.h"

@class JavaUtilLoggingLogger;
@class JavaUtilTimer;
@class JavaxJmdnsImplDNSOutgoing;
@class JavaxJmdnsImplJmDNSImpl;
@class JavaxJmdnsImplServiceInfoImpl;

@interface JavaxJmdnsImplTasksStateRenewer : JavaxJmdnsImplTasksStateDNSStateTask

#pragma mark Public

- (instancetype)initWithJavaxJmdnsImplJmDNSImpl:(JavaxJmdnsImplJmDNSImpl *)jmDNSImpl;

- (jboolean)cancel;

- (NSString *)getName;

- (NSString *)getTaskDescription;

- (void)startWithJavaUtilTimer:(JavaUtilTimer *)timer;

- (NSString *)description;

#pragma mark Protected

- (void)advanceTask;

- (JavaxJmdnsImplDNSOutgoing *)buildOutgoingForDNSWithJavaxJmdnsImplDNSOutgoing:(JavaxJmdnsImplDNSOutgoing *)outArg;

- (JavaxJmdnsImplDNSOutgoing *)buildOutgoingForInfoWithJavaxJmdnsImplServiceInfoImpl:(JavaxJmdnsImplServiceInfoImpl *)info
                                                       withJavaxJmdnsImplDNSOutgoing:(JavaxJmdnsImplDNSOutgoing *)outArg;

- (jboolean)checkRunCondition;

- (JavaxJmdnsImplDNSOutgoing *)createOugoing;

- (void)recoverTaskWithNSException:(NSException *)e;
#define recoverTaskWithJavaLangThrowable recoverTaskWithNSException

@end

J2OBJC_STATIC_INIT(JavaxJmdnsImplTasksStateRenewer)

inline JavaUtilLoggingLogger *JavaxJmdnsImplTasksStateRenewer_get_logger();
inline JavaUtilLoggingLogger *JavaxJmdnsImplTasksStateRenewer_set_logger(JavaUtilLoggingLogger *value);
/*! INTERNAL ONLY - Use accessor function from above. */
FOUNDATION_EXPORT JavaUtilLoggingLogger *JavaxJmdnsImplTasksStateRenewer_logger;
J2OBJC_STATIC_FIELD_OBJ(JavaxJmdnsImplTasksStateRenewer, logger, JavaUtilLoggingLogger *)

FOUNDATION_EXPORT void JavaxJmdnsImplTasksStateRenewer_initWithJavaxJmdnsImplJmDNSImpl_(JavaxJmdnsImplTasksStateRenewer *self, JavaxJmdnsImplJmDNSImpl *jmDNSImpl);

FOUNDATION_EXPORT JavaxJmdnsImplTasksStateRenewer *new_JavaxJmdnsImplTasksStateRenewer_initWithJavaxJmdnsImplJmDNSImpl_(JavaxJmdnsImplJmDNSImpl *jmDNSImpl) NS_RETURNS_RETAINED;

FOUNDATION_EXPORT JavaxJmdnsImplTasksStateRenewer *create_JavaxJmdnsImplTasksStateRenewer_initWithJavaxJmdnsImplJmDNSImpl_(JavaxJmdnsImplJmDNSImpl *jmDNSImpl);

J2OBJC_TYPE_LITERAL_HEADER(JavaxJmdnsImplTasksStateRenewer)

#endif

#pragma pop_macro("INCLUDE_ALL_JavaxJmdnsImplTasksStateRenewer")


text:
<?xml version="1.0" encoding="UTF-8"?>
<workingSetManager>
<workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1439054705050_0" label="Window Working Set" name="Aggregate for window 1439054705050"/>
</workingSetManager>


text:
/* Based on Alex Arnell's inheritance implementation. */

/** section: Language
 * class Class
 *
 *  Manages Prototype's class-based OOP system.
 *
 *  Refer to Prototype's web site for a [tutorial on classes and
 *  inheritance](http://prototypejs.org/learn/class-inheritance).
**/
var Class = (function() {

  // Some versions of JScript fail to enumerate over properties, names of which
  // correspond to non-enumerable properties in the prototype chain
  var IS_DONTENUM_BUGGY = (function(){
    for (var p in { toString: 1 }) {
      // check actual property name, so that it works with augmented Object.prototype
      if (p === 'toString') return false;
    }
    return true;
  })();

  /**
   *  Class.create([superclass][, methods...]) -> Class
   *    - superclass (Class): The optional superclass to inherit methods from.
   *    - methods (Object): An object whose properties will be "mixed-in" to the
   *        new class. Any number of mixins can be added; later mixins take
   *        precedence.
   *
   *  [[Class.create]] creates a class and returns a constructor function for
   *  instances of the class. Calling the constructor function (typically as
   *  part of a `new` statement) will invoke the class's `initialize` method.
   *
   *  [[Class.create]] accepts two kinds of arguments. If the first argument is
   *  a [[Class]], it's used as the new class's superclass, and all its methods
   *  are inherited. Otherwise, any arguments passed are treated as objects,
   *  and their methods are copied over ("mixed in") as instance methods of the
   *  new class. In cases of method name overlap, later arguments take
   *  precedence over earlier arguments.
   *
   *  If a subclass overrides an instance method declared in a superclass, the
   *  subclass's method can still access the original method. To do so, declare
   *  the subclass's method as normal, but insert `$super` as the first
   *  argument. This makes `$super` available as a method for use within the
   *  function.
   *
   *  To extend a class after it has been defined, use [[Class#addMethods]].
   *
   *  For details, see the
   *  [inheritance tutorial](http://prototypejs.org/learn/class-inheritance)
   *  on the Prototype website.
  **/
  function subclass() {};
  function create() {
    var parent = null, properties = $A(arguments);
    if (Object.isFunction(properties[0]))
      parent = properties.shift();

    function klass() {
      this.initialize.apply(this, arguments);
    }

    Object.extend(klass, Class.Methods);
    klass.superclass = parent;
    klass.subclasses = [];

    if (parent) {
      subclass.prototype = parent.prototype;
      klass.prototype = new subclass;
      parent.subclasses.push(klass);
    }

    for (var i = 0, length = properties.length; i < length; i++)
      klass.addMethods(properties[i]);

    if (!klass.prototype.initialize)
      klass.prototype.initialize = Prototype.emptyFunction;

    klass.prototype.constructor = klass;
    return klass;
  }

  /**
   *  Class#addMethods(methods) -> Class
   *    - methods (Object): The methods to add to the class.
   *
   *  Adds methods to an existing class.
   *
   *  [[Class#addMethods]] is a method available on classes that have been
   *  defined with [[Class.create]]. It can be used to add new instance methods
   *  to that class, or overwrite existing methods, after the class has been
   *  defined.
   *
   *  New methods propagate down the inheritance chain. If the class has
   *  subclasses, those subclasses will receive the new methods — even in
   *  the context of `$super` calls. The new methods also propagate to instances
   *  of the class and of all its subclasses, even those that have already been
   *  instantiated.
   *
   *  ##### Examples
   *
   *      var Animal = Class.create({
   *        initialize: function(name, sound) {
   *          this.name  = name;
   *          this.sound = sound;
   *        },
   *
   *        speak: function() {
   *          alert(this.name + " says: " + this.sound + "!");
   *        }
   *      });
   *
   *      // subclassing Animal
   *      var Snake = Class.create(Animal, {
   *        initialize: function($super, name) {
   *          $super(name, 'hissssssssss');
   *        }
   *      });
   *
   *      var ringneck = new Snake("Ringneck");
   *      ringneck.speak();
   *
   *      //-> alerts "Ringneck says: hissssssss!"
   *
   *      // adding Snake#speak (with a supercall)
   *      Snake.addMethods({
   *        speak: function($super) {
   *          $super();
   *          alert("You should probably run. He looks really mad.");
   *        }
   *      });
   *
   *      ringneck.speak();
   *      //-> alerts "Ringneck says: hissssssss!"
   *      //-> alerts "You should probably run. He looks really mad."
   *
   *      // redefining Animal#speak
   *      Animal.addMethods({
   *        speak: function() {
   *          alert(this.name + 'snarls: ' + this.sound + '!');
   *        }
   *      });
   *
   *      ringneck.speak();
   *      //-> alerts "Ringneck snarls: hissssssss!"
   *      //-> alerts "You should probably run. He looks really mad."
  **/
  function addMethods(source) {
    var ancestor   = this.superclass && this.superclass.prototype,
        properties = Object.keys(source);

    // IE6 doesn't enumerate `toString` and `valueOf` (among other built-in `Object.prototype`) properties,
    // Force copy if they're not Object.prototype ones.
    // Do not copy other Object.prototype.* for performance reasons
    if (IS_DONTENUM_BUGGY) {
      if (source.toString != Object.prototype.toString)
        properties.push("toString");
      if (source.valueOf != Object.prototype.valueOf)
        properties.push("valueOf");
    }

    for (var i = 0, length = properties.length; i < length; i++) {
      var property = properties[i], value = source[property];
      if (ancestor && Object.isFunction(value) &&
          value.argumentNames()[0] == "$super") {
        var method = value;
        value = (function(m) {
          return function() { return ancestor[m].apply(this, arguments); };
        })(property).wrap(method);

        // We used to use `bind` to ensure that `toString` and `valueOf`
        // methods were called in the proper context, but now that we're
        // relying on native bind and/or an existing polyfill, we can't rely
        // on the nuanced behavior of whatever `bind` implementation is on
        // the page.
        //
        // MDC's polyfill, for instance, doesn't like binding functions that
        // haven't got a `prototype` property defined.
        value.valueOf = (function(method) {
          return function() { return method.valueOf.call(method); };
        })(method);

        value.toString = (function(method) {
          return function() { return method.toString.call(method); };
        })(method);
      }
      this.prototype[property] = value;
    }

    return this;
  }

  return {
    create: create,
    Methods: {
      addMethods: addMethods
    }
  };
})();


text:
date: 2014-05-12T10:09:34Z
menu:
  main:
    parent: themes
next: /themes/creation
prev: /themes/usage
title: Customizing a Theme
weight: 40
---

Hugo themes permit you to supplement or override any template or file
from within your working directory.

## Replacing Static files

If you would like to include a different file than the theme ships
with.. For example you would like to use a more recent version of jquery
then the theme happens to include simply place an identically name file in the same
relative location but in your working directory. For example if the
theme has jquery 1.6 in /themes/themename/static/js/jQuery.min.js, simply place your file
in the same relative path /static/js/jQuery.min.js.

## Replace a single template file

Anytime Hugo looks for a matching template it will first check the
working directory before looking in the theme directory. If you would
like to modify a template simply create that template in your local
layouts directory. In the [template documentation](/templates/overview)
each different template type explains the rules it uses to determine
which template to use.

This is especially helpful when the theme creator used [partial
templates](/templates/partials). These partial templates are perfect for easy
injection into the theme with minimal maintenance to ensure future
compatibility.

**warning.. This only works for templates that Hugo knows about. If the
theme imports template files in a creatively named directory
Hugo won't know to look for the local /layouts first**

## Replace an archetype

If the archetype that ships with the theme for a given content type (or
all content types) doesn't fit with how you are using the theme, feel
free to copy it to your /archetypes directory and make modifications as
you see fit.

## Beware of the default

**Default** is a very powerful force in Hugo... Especially as it pertains to
overwriting theme files. If a default is located in the local archetype
directory or /layouts/\_default/ directory it will be used instead of
any of the similar files in the theme.

It is usually better to override specific files rather than using the
default in your working directory.


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>de.unibw.datamining</groupId>
    <artifactId>mauscrawler</artifactId>
    <version>1.0-SNAPSHOT</version>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>edu.uci.ics</groupId>
            <artifactId>crawler4j</artifactId>
            <version>4.1</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.7.10</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.4</version>
        </dependency>
    </dependencies>
</project>


text:
#ifndef ADD_HOOK_SCREEN_OUT
#define ADD_HOOK_SCREEN_OUT

#include "AddHook.h"

#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <cassert>

/** \brief This class is designed to print convergence information on
	the screen after each iteration of the algorithm.
*/
class AddHookScreenOut : public AddHook {
	public:

		/** @param precision (default value is 10)  number of digits to print on the screen.
		*/
		AddHookScreenOut(int precision = 10) : precision_(precision) {
			assert(precision >= 1 && precision < 17);
		};

		virtual ~AddHookScreenOut() {};

		/** Prints convergence on screen.
			@param timePassed time passed since last measurement.
			@param gap current value of convergence measure.
		*/
		virtual void produceOut(FPType timePassed, FPType gap){
			std::cout << std::setprecision(precision_) << timePassed << " " << gap << std::endl;
		};

	private:
		int precision_;

};

#endif


text:
var request = require('request');
var parseString = require('xml2js').parseString;
var jsdom = require('jsdom');
var colors = require('colors');
var mongoose = require('mongoose');
var fs = require('fs');
var _ = require('underscore');
readline = require('readline');

var	Cancertype = require('../../app/models/cancertype.server.model');

var cancerTypesArr = [];
var nctIdLocks = 0;
var urlIndex = 0;
var clinicalTrials = [];
var savingToDB = false;

main();

function main() {
    //getUrlsConditions(getListOfCancerTrialsFromClinicalTrialsGov);
    readNctIdsFile();
}

function getListOfCancerTrialsFromClinicalTrialsGov(urls) {
    checkNctLocks(urls);
}

function checkNctLocks(urls) {
    setTimeout(function(){
        if(nctIdLocks !== 0) {
            checkNctLocks(urls);
        }else {
            if(urlIndex < urls.length) {
                checkNctLocks(urls);
                console.log('\n-----------------------------------------------');
                console.log('URL: ', urls[urlIndex].url);
                console.log('Number of conditions: ', urls[urlIndex].count);
                console.log('URL index: ', urlIndex, ' Fnished: ', (urlIndex/urls.length * 100).toFixed(2), '%');
                getNctIds(urls[urlIndex], 1, function(){
                    --nctIdLocks;
                    ++urlIndex;
                });
            }else {
                console.log('\n\nFINISHIED. ');
                //var uniqueNctIds = _.uniq(nctIds);
                //console.log(uniqueNctIds.length, ' unique trials have been found.\n');
                //writeNctIdsIntoFile(nctIds);
            }
        }
    },500);
}

function readNctIdsFile() {
    var rd = readline.createInterface({
        input: fs.createReadStream('./cancertype_nctIds.txt'),
        output: process.stdout,
        terminal: false
    });

    var index = -1,  currentCancer = '', currentNctId = '';
    rd.on('line', function(line) {
        var cancerIndex = -1,
        index = line.indexOf('results?cond=%22');
        currentCancer = line.substr(index + 16, line.length - index - 19);
        currentNctId = line.substr(0, index - 6);
        currentCancer = currentCancer.replace(/(\%2C)/g, '');
        currentCancer = currentCancer.replace(/(\+)/g, ' ');

        for(var i = 0;i < cancerTypesArr.length;i++) {
            if (cancerTypesArr[i].cancer === currentCancer)
            {
                cancerIndex = i;
                break;
            }
        }
        if(cancerIndex === -1)
        {
            cancerTypesArr.push({cancer: currentCancer, nctIds: [currentNctId]});
        }
        else
        {
            cancerTypesArr[cancerIndex].nctIds.push(currentNctId);
        }
    });

    rd.on('close', function(){
        mongoose.connect('mongodb://localhost/firstDB');
        mongoose.connection.on('error', console.error.bind(console, 'connection error:'));
        mongoose.connection.once('open', function callback () {

        saveNextCancer(0);

        });

    });
}

function saveNextCancer(index){
    if(index < cancerTypesArr.length)
    {
        var cancerType = new Cancertype(cancerTypesArr[index]);
        cancerType.save(function(err, cancerTypeItem){
            index = index + 1;
            saveNextCancer(index);
        });
    }
    else
    {
        console.log('Done saving to database ');
        mongoose.connection.close();
    }

}

function getNctIds(url, page, callback) {
    var _url = 'http://clinicaltrials.gov'+url.url+'&displayxml=true&pg='+page;
    ++nctIdLocks;
    request(_url, function(error, response, body){
        parseString(body, {trim: true}, function (err, result) {
            var searchResults = result.search_results || {};
            if(searchResults.hasOwnProperty('clinical_study') && searchResults.clinical_study instanceof Array && searchResults.clinical_study.length > 0) {
                searchResults.clinical_study.forEach(function(e, i) {

                    fs.appendFile('./cancertype_nctIds.txt', e.nct_id[0] + ',' + url.url + '\n' , function (err) {
                        return 'error message is ' + err;
                    });

                    //nctIds.push({nctId: e.nct_id[0], category: url.url});
                });

                getNctIds(url, ++page, function(){--nctIdLocks;});
            }
            callback();
        });
    });
}

function getUrlsConditions(callback) {
    var urlConditions = [];
    jsdom.env(
        'http://clinicaltrials.gov/ct2/search/browse?brwse=cond_cat_BC04&brwse-force=true',
        ["http://code.jquery.com/jquery.js"],
        function (errors, window) {
            window.$("#conditions").find('li').each(function(e, i){
                var _attr = window.$(this).find('a').attr('href');

                if (typeof _attr !== 'undefined' && _attr !== false) {
                    var _datum = {
                        url: _attr,
                        count: window.$(this).text().trim().match(/\d* study|\d* studies/)[0].replace(/studies|study/, '').trim()
                    }
                    urlConditions.push(_datum);
                }else {
                    console.log('There is not any href link in:'.color, window.$(this).html());
                }
            })
            console.log("Total in ", urlConditions.length, " conditions");
            callback(urlConditions);
        }
    );
}

function importTrials(nctIds) {

}

function checkNctIndex(nctIds, nctIdIndex) {

    if(nctIdIndex < nctIds.length) {
        if(savingToDB) {
            setTimeout(function(){
                checkNctIndex(nctIds, nctIdIndex);
            },500);
        }else {
            parseClinicalTrialsGov(nctIds, nctIdIndex, checkNctIndex);
        }
        if ((nctIdIndex+1) % 1000 === 0) {
            console.log('Saving data to MongoDB....');
            savingToDB = true;
            saveClinicalTrialMetadata(clinicalTrials);
        }
    }else {
        console.log('Final saving data to MongoDB....');
        savingToDB = true;
        saveClinicalTrialMetadata(clinicalTrials,function(){
            mongoose.connection.close();
        });
    }
}


text:
<?php
namespace Czim\CmsModels\Contracts\Repositories;

use Czim\CmsModels\Contracts\ModelInformation\Data\ModelInformationInterface;

interface ActivateStrategyResolverInterface
{

    /**
     * Resolves and returns activate strategy.
     *
     * @param ModelInformationInterface $information
     * @return ActivateStrategyInterface
     */
    public function resolve(ModelInformationInterface $information);

}


text:
<?php

namespace Yosymfony\Spress\Core\ContentManager\Converter;

/**
 * This converter maps an extension to another using the
 * mapping table passed in the constructor. If the extension not
 * exists, this converter returns the same input extension.
 *
 * This converter does not alter the content.
 *
 * @author Victor Pueras <vpgugr@gmail.com>
 */
class MapConverter implements ConverterInterface
{
    private $extensionMap = [];

    /**
     * Constructor.
     *
     * @param array $fileExtensionMap An extension map. e.g:
     *
     * ```php
     * $converter = new MappingConverter([
     *   'twig'      => 'html',
     *   'twig.html' => 'html',
     * ]);
     * ```
     */
    public function __construct(array $fileExtensionMap = [])
    {
        $this->extensionMap = $fileExtensionMap;
    }

    /**
     * Get the converter priority.
     *
     * @return int
     */
    public function getPriority()
    {
        return 0;
    }

    /**
     * If file's extension is support by converter.
     *
     * @param string $extension Extension without dot
     *
     * @return bool
     */
    public function matches($extension)
    {
        return true;
    }

    /**
     * Convert the input data.
     *
     * @param string $input The raw content without Front-matter
     *
     * @return string
     */
    public function convert($input)
    {
        return $input;
    }

    /**
     * The extension of filename result (without dot). E.g: 'html'.
     *
     * @param string $extension File's extension
     *
     * @return string
     */
    public function getOutExtension($extension)
    {
        if (isset($this->extensionMap[$extension])) {
            return $this->extensionMap[$extension];
        }

        return $extension;
    }
}


text:
using System;
using System.Text.RegularExpressions;

public class ExtractEmails
{
    public static void Main()
    {
        string text = Console.ReadLine();

        string pattern = @"(\w+[-|_|.])*([a-zA-Z]+)@([a-zA-Z0-9_-]+)(\.[a-zA-Z0-9_-]+)+";
        Regex regex = new Regex(pattern);
        var matches = regex.Matches(text);

        foreach (Match match in matches)
        {
            Console.WriteLine(match.Value);
        }
    }
}


text:
\thispagestyle{empty}

\begin{center}
\huge\bfseries
\thesistitle
\end{center}
  \vfill
  \begin{center}%
    by\\
\myname \\
    \degrees
  \end{center}
  \vfill
  \begin{center}
    A Dissertation submitted in partial fulfillment of the\\
    requirements for the Degree of Doctor of Philosophy\\
    in the \department~at Brown University
  \end{center}
  \vfill
  \begin{center}
    Providence, Rhode Island\\
    \thesismonth~\thesisyear
  \end{center}


text:
#ifndef SQLTransactionClient_h
#define SQLTransactionClient_h

#include "wtf/Allocator.h"
#include "wtf/Noncopyable.h"

namespace blink {

class Database;

// A client to the SQLTransaction class. Allows SQLTransaction to notify interested
// parties that certain things have happened in a transaction.
class SQLTransactionClient {
    WTF_MAKE_NONCOPYABLE(SQLTransactionClient); USING_FAST_MALLOC(SQLTransactionClient);
public:
    SQLTransactionClient() { }
    void didCommitWriteTransaction(Database*);
    bool didExceedQuota(Database*);
};

} // namespace blink

#endif // SQLTransactionClient_h


text:
(function(mod) {
  if (typeof exports == "object" && typeof module == "object") // CommonJS
    mod(require("../../lib/codemirror"));
  else if (typeof define == "function" && define.amd) // AMD
    define(["../../lib/codemirror"], mod);
  else // Plain browser env
    mod(CodeMirror);
})(function(CodeMirror) {
  var defaults = {
    pairs: "()[]{}''\"\"",
    closeBefore: ")]}'\":;>",
    triples: "",
    explode: "[]{}"
  };

  var Pos = CodeMirror.Pos;

  CodeMirror.defineOption("autoCloseBrackets", false, function(cm, val, old) {
    if (old && old != CodeMirror.Init) {
      cm.removeKeyMap(keyMap);
      cm.state.closeBrackets = null;
    }
    if (val) {
      ensureBound(getOption(val, "pairs"))
      cm.state.closeBrackets = val;
      cm.addKeyMap(keyMap);
    }
  });

  function getOption(conf, name) {
    if (name == "pairs" && typeof conf == "string") return conf;
    if (typeof conf == "object" && conf[name] != null) return conf[name];
    return defaults[name];
  }

  var keyMap = {Backspace: handleBackspace, Enter: handleEnter};
  function ensureBound(chars) {
    for (var i = 0; i < chars.length; i++) {
      var ch = chars.charAt(i), key = "'" + ch + "'"
      if (!keyMap[key]) keyMap[key] = handler(ch)
    }
  }
  ensureBound(defaults.pairs + "`")

  function handler(ch) {
    return function(cm) { return handleChar(cm, ch); };
  }

  function getConfig(cm) {
    var deflt = cm.state.closeBrackets;
    if (!deflt || deflt.override) return deflt;
    var mode = cm.getModeAt(cm.getCursor());
    return mode.closeBrackets || deflt;
  }

  function handleBackspace(cm) {
    var conf = getConfig(cm);
    if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass;

    var pairs = getOption(conf, "pairs");
    var ranges = cm.listSelections();
    for (var i = 0; i < ranges.length; i++) {
      if (!ranges[i].empty()) return CodeMirror.Pass;
      var around = charsAround(cm, ranges[i].head);
      if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass;
    }
    for (var i = ranges.length - 1; i >= 0; i--) {
      var cur = ranges[i].head;
      cm.replaceRange("", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1), "+delete");
    }
  }

  function handleEnter(cm) {
    var conf = getConfig(cm);
    var explode = conf && getOption(conf, "explode");
    if (!explode || cm.getOption("disableInput")) return CodeMirror.Pass;

    var ranges = cm.listSelections();
    for (var i = 0; i < ranges.length; i++) {
      if (!ranges[i].empty()) return CodeMirror.Pass;
      var around = charsAround(cm, ranges[i].head);
      if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass;
    }
    cm.operation(function() {
      var linesep = cm.lineSeparator() || "\n";
      cm.replaceSelection(linesep + linesep, null);
      cm.execCommand("goCharLeft");
      ranges = cm.listSelections();
      for (var i = 0; i < ranges.length; i++) {
        var line = ranges[i].head.line;
        cm.indentLine(line, null, true);
        cm.indentLine(line + 1, null, true);
      }
    });
  }

  function contractSelection(sel) {
    var inverted = CodeMirror.cmpPos(sel.anchor, sel.head) > 0;
    return {anchor: new Pos(sel.anchor.line, sel.anchor.ch + (inverted ? -1 : 1)),
            head: new Pos(sel.head.line, sel.head.ch + (inverted ? 1 : -1))};
  }

  function handleChar(cm, ch) {
    var conf = getConfig(cm);
    if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass;

    var pairs = getOption(conf, "pairs");
    var pos = pairs.indexOf(ch);
    if (pos == -1) return CodeMirror.Pass;

    var closeBefore = getOption(conf,"closeBefore");

    var triples = getOption(conf, "triples");

    var identical = pairs.charAt(pos + 1) == ch;
    var ranges = cm.listSelections();
    var opening = pos % 2 == 0;

    var type;
    for (var i = 0; i < ranges.length; i++) {
      var range = ranges[i], cur = range.head, curType;
      var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1));
      if (opening && !range.empty()) {
        curType = "surround";
      } else if ((identical || !opening) && next == ch) {
        if (identical && stringStartsAfter(cm, cur))
          curType = "both";
        else if (triples.indexOf(ch) >= 0 && cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == ch + ch + ch)
          curType = "skipThree";
        else
          curType = "skip";
      } else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 &&
                 cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch) {
        if (cur.ch > 2 && /\bstring/.test(cm.getTokenTypeAt(Pos(cur.line, cur.ch - 2)))) return CodeMirror.Pass;
        curType = "addFour";
      } else if (identical) {
        var prev = cur.ch == 0 ? " " : cm.getRange(Pos(cur.line, cur.ch - 1), cur)
        if (!CodeMirror.isWordChar(next) && prev != ch && !CodeMirror.isWordChar(prev)) curType = "both";
        else return CodeMirror.Pass;
      } else if (opening && (next.length === 0 || /\s/.test(next) || closeBefore.indexOf(next) > -1)) {
        curType = "both";
      } else {
        return CodeMirror.Pass;
      }
      if (!type) type = curType;
      else if (type != curType) return CodeMirror.Pass;
    }

    var left = pos % 2 ? pairs.charAt(pos - 1) : ch;
    var right = pos % 2 ? ch : pairs.charAt(pos + 1);
    cm.operation(function() {
      if (type == "skip") {
        cm.execCommand("goCharRight");
      } else if (type == "skipThree") {
        for (var i = 0; i < 3; i++)
          cm.execCommand("goCharRight");
      } else if (type == "surround") {
        var sels = cm.getSelections();
        for (var i = 0; i < sels.length; i++)
          sels[i] = left + sels[i] + right;
        cm.replaceSelections(sels, "around");
        sels = cm.listSelections().slice();
        for (var i = 0; i < sels.length; i++)
          sels[i] = contractSelection(sels[i]);
        cm.setSelections(sels);
      } else if (type == "both") {
        cm.replaceSelection(left + right, null);
        cm.triggerElectric(left + right);
        cm.execCommand("goCharLeft");
      } else if (type == "addFour") {
        cm.replaceSelection(left + left + left + left, "before");
        cm.execCommand("goCharRight");
      }
    });
  }

  function charsAround(cm, pos) {
    var str = cm.getRange(Pos(pos.line, pos.ch - 1),
                          Pos(pos.line, pos.ch + 1));
    return str.length == 2 ? str : null;
  }

  function stringStartsAfter(cm, pos) {
    var token = cm.getTokenAt(Pos(pos.line, pos.ch + 1))
    return /\bstring/.test(token.type) && token.start == pos.ch &&
      (pos.ch == 0 || !/\bstring/.test(cm.getTokenTypeAt(pos)))
  }
});


text:
class CreateBusinessActivities < ActiveRecord::Migration
  def change
    create_table :business_activities do |t|
      t.string :name, :limit => 100
      t.boolean :enabled,  :default => true
      t.references :business_segment
      t.string :notes, :limit => 500
      t.timestamps
    end

    add_index :business_activities, :business_segment_id
  end
end


text:
Pong::Pong(int _gameSpeed, Joystick& _joystick, Adafruit_PCD8544& _display)
  : joystick(_joystick), display(_display)
{
  ballWidth       = 2;
  paddleWidth     = 2;
  paddleHeight    = 10;
  boundaryHeight  = 2;
  maxScore        = 5;
  debugEnabled    = false;
  gameSpeed       = _gameSpeed;

  onStartScreen   = true;
  inGame          = false;
  isGameOver      = false;
  gamePaused      = false;

  paddleYLock     = (display.width() - 2);
  paddle1Y        = (display.height() / 2) - (10 / paddleWidth);
  paddle2Y        = (display.height() / 2) - (10 / paddleWidth);
  ballX           = display.width()/2;
  ballY           = display.height()/2;
  ballSpeedX      = -1;
  ballSpeedY      = 1;
  player1Score    = 0;
  player2Score    = 0;

  unsigned long lastDebounceTime    = 0;

  collision_bottomY   = display.height() - 2;
  collision_rightX    = display.width() - 2;
  collision_topY      = 2;
  collision_leftX     = 2;
  halfBallWidth       = ballWidth / 2;
}

void Pong::gameLoop() {
  readButtons();
  showGameOver();
  showStartScreen();
  runGameLoop();

  delay(gameSpeed);
}

void Pong::readButtons() {
  joystick.update();

  // super simple button press limiting
  if( joystick.btn == 1 && (millis() - lastDebounceTime) > 200 ) {
    lastDebounceTime = millis();

    if( inGame == true ) {
      gamePaused = !gamePaused;
    }

    if( onStartScreen == true ) {
      onStartScreen = false;
      inGame = true;
    }
  }
}

void Pong::showGameOver() {
  if( !isGameOver ) {
    return;
  }

  gamePaused = true;
  inGame = false;
  onStartScreen = true;
  isGameOver = false;
  player1Score = 0;
  player2Score = 0;

  display.clearDisplay();

  display.println();
  display.println("  GAME OVER");
  display.println();

  if( player1Score >= maxScore ) {
    display.println("  YOU win!");
  } else {
    display.println("  CPU wins!");
  }

  display.display();
  delay(2000);
}

void Pong::showStartScreen() {
  //screens->showStart();

  if( !onStartScreen ) {
    return;
  }

  display.clearDisplay();

  display.println();
  display.println("  PONG (1.0)");
  display.println();
  display.println(" Press START");

  display.display();
}

void Pong::runGameLoop() {
  if( gamePaused || !inGame ) {
    return;
  }

  display.clearDisplay();

  moveAiPaddle();
  movePlayerPaddle();
  moveBall();

  drawBoundaries();
  drawPaddles();
  drawBall();

  display.display();
}

void Pong::movePlayerPaddle() {
  // Player has pressed the UP button
  if( joystick.xDirection == UP ) {
    // Check to see if we are colliding with the top boundary
    if( paddle1Y > boundaryHeight ) {
      paddle1Y -= 1;
    }
  }

  // Player has pressed the DOWN button
  if( joystick.xDirection == DOWN ) {
    // Check to see if we are colliding with the bottom boundary
    if( (paddle1Y + paddleHeight) < (display.height() - boundaryHeight) ) {
      paddle1Y += 1;
    }
  }
}

void Pong::moveAiPaddle() {
  if( ballY > paddle2Y && ballSpeedX > 0 ) {
    paddle2Y += 1;
    return;
  }

  if( ballY < paddle2Y && ballSpeedX > 0 ) {
    paddle2Y -= 1;
    return;
  }
}

void Pong::drawBoundaries() {
  display.drawLine(0, 0, display.width(), 0, BLACK);
  display.drawLine(0, 1, display.width(), 1, BLACK);

  display.drawLine(0, display.height()-2, display.width(), display.height()-2, BLACK);
  display.drawLine(0, display.height()-1, display.width(), display.height()-1, BLACK);
}

void Pong::drawPaddles() {
  // Left paddle
  // x, y, width, height, color
  display.drawRect(0, paddle1Y, paddleWidth, paddleHeight, BLACK);

  // Right paddle
  display.drawRect(paddleYLock, paddle2Y, paddleWidth, paddleHeight, BLACK);
}

void Pong::drawBall() {
  // x0, y0, r, color
  display.fillCircle(ballX, ballY, ballWidth, BLACK);
}

void Pong::moveBall() {
  checkCollisions();

  ballX += ballSpeedX;
  ballY += ballSpeedY;
}

void Pong::pauseGame() {
  if( !inGame ) return;
  gamePaused = true;
}

void Pong::resumeGame() {
  if( !inGame ) return;
  gamePaused = false;
}

void Pong::resetBall() {
  ballX = display.width()/2;
  ballY = display.height()/2;
}

void Pong::showScores() {
  pauseGame();
  display.clearDisplay();

  display.println();

  display.print("Player: ");
  display.print(player1Score);
  display.println();

  display.print("CPU:    ");
  display.print(player2Score);
  display.println();

  display.display();
  delay(1000);

  // Check to see if it is Game Over
  if( player1Score >= maxScore || player2Score >= maxScore ) {
    isGameOver = true;
  }

  display.clearDisplay();
  resumeGame();
}

void Pong::checkCollisions() {
  // printBallPos();

  checkCollisionBottom();
  checkCollisionRight();
  checkCollisionTop();
  checkCollisionLeft();
}

void Pong::checkCollisionBottom() {
  // If the ball is above the boundaries there is no need to check
  if( ballY + (ballWidth) < collision_bottomY ){
    return;
  }

  // Flip the speed of the ball to change direction
  ballSpeedY = ballSpeedY * -1;
}

void Pong::checkCollisionRight() {
  // Check if the ball is close to the right
  if( (ballX + ballWidth) < collision_rightX ) {
    return;
  }

  // Check if we went over the top of the paddle
  if( (ballY + halfBallWidth) < paddle2Y ) {
    player1Score += 1;
    resetBall();
    showScores();
    return;
  }

  // Check if we went under the bottom of the paddle
  if( (ballY - halfBallWidth) > (paddle2Y + paddleHeight) ) {
    player1Score += 1;
    resetBall();
    showScores();
    return;
  }

  // Ball collided with the paddle
  ballSpeedX = ballSpeedX * -1;
}

void Pong::checkCollisionTop() {
  // Check to see if the ball is at the top
  if( ballY > collision_topY ) {
    return;
  }

  ballSpeedY = ballSpeedY * -1;
}

void Pong::checkCollisionLeft() {
  // Check if the ball is close to the left
  if( (ballX + ballWidth) > collision_leftX ) {
    return;
  }

  // Check if we went over the top of the paddle
  if( (ballY + halfBallWidth) < paddle1Y ) {
    player2Score += 1;
    resetBall();
    showScores();
    return;
  }

  // Check if we went under the bottom of the paddle
  if( (ballY - halfBallWidth) > (paddle1Y + paddleHeight) ) {
    player2Score += 1;
    resetBall();
    showScores();
    return;
  }

  // Ball collided with the paddle
  ballSpeedX = ballSpeedX * -1;
}


text:
XV Lidar Controller
===================

Control the Neato XV Lidar with an Arduino compatible board

Used as an interface board to connect directly to the Neato XV Lidar and control the rotation speed through Pulse Width Modulation (PWM).

Copyright 2014 James LeRoy getSurreal.com
v1.2.2 - Updated 2015/02/23
* http://www.getsurreal.com/products/xv-lidar-controller
* https://github.com/getSurreal/XV_Lidar_Controller

Based on the following work:
* Nicolas "Xevel" Saugnier https://github.com/bombilee/NXV11/
* Cheng-Lung Lee https://github.com/bombilee/NXV11/tree/master/ArduinoMegaAdapter

##Description
The XV Lidar Controller receives the serial data from the XV Lidar looking for the RPM data embedded in the stream and uses a PID controller to regulate the speed to 300RPMs.  The data received from the Lidar is relayed to the USB connection for some upstream host device (PC, BeagleBone, Raspberry Pi) to process the data.

##Requirements

###Hardware
* Neato XV Lidar - Available on eBay
* Teensy 2.0 http://www.pjrc.com/teensy
* XV Lidar Controller Board by getSurreal http://www.getsurreal.com/xv-lidar-controller
* Firmware https://github.com/getSurreal/XV_Lidar_Controller

###Software to build from source
* Arduino IDE (v1.0.6 tested. Newer or older may work)
* Teensyduino - Software add-on to run Arduino sketches on the Teensy (v1.19 tested. Newer or older may work)
 http://www.pjrc.com/teensy/teensyduino.html
* Copy the included libraries to the Arduino libraries directory

##Usage
Connect to the Teensy USB port at 115200 baud.  When sending commands use the newline character to signify the end of a command.

##Commands
Commands are case sensitive.
* Help - Show the list of commands available
* ShowConfig    - Show the running configuration
* SaveConfig    - Save the running configuration to EEPROM
* ResetConfig   - Restore the original configuration
* SetRPM        - Set the desired rotation speed (min: 200, max: 300)
* SetKp         - Set the proportional gain
* SetKi         - Set the integral gain
* SetKd         - Set the derivative gain
* SetSampleTime - Set the frequency the PID is calculated (ms)
* ShowRPM       - Show the rotation speed
* HideRPM       - Hide the rotation speed
* ShowDist      - Show the distance data
* HideDist      - Hide the distance data
* ShowAngle     - Show distance data for a specific angle (0 - 359 or 360 for all)
* MotorOff      - Stop spinning the lidar
* MotorOn       - Enable spinning of the lidar
* HideRaw       - Stop outputting the raw data from the lidar
* ShowRaw       - Enable the output of the raw lidar data


text:
package com.hpe.application.automation.tools.octane.actions.dto;

/**
 * Base class for (de)serialization of reference entities in Octane
 */
@SuppressWarnings({"squid:S2699", "squid:S3658", "squid:S2259", "squid:S1872", "squid:S2925", "squid:S109"})
public class BaseRefEntity {

    private String type;
    private String id;

    public static BaseRefEntity create(String type, String id) {
        BaseRefEntity baseRefEntity = new BaseRefEntity();
        baseRefEntity.setType(type);
        baseRefEntity.setId(id);
        return baseRefEntity;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }
}


text:
@interface VuforiaBackgroundPlugin : CDVPlugin

- (void) launchVuforia:(CDVInvokedUrlCommand *)command;
- (void) cordovaStopVuforia:(CDVInvokedUrlCommand *)command;
- (void) cordovaStopTrackers:(CDVInvokedUrlCommand *)command;
- (void) cordovaStartTrackers:(CDVInvokedUrlCommand *)command;
- (void) cordovaUpdateTargets:(CDVInvokedUrlCommand *)command;
- (void) pauseAR:(CDVInvokedUrlCommand *)command;
- (void) resumeAR:(CDVInvokedUrlCommand *)command;
- (void) prepareVuforiaMarkerEvent:(CDVInvokedUrlCommand *)command;

+ (void) triggerReadyEvent;

+ (ViewController*) imageRecViewController;
+ (void) setImageRecViewController:(ViewController*)viewCtrl;
+ (CDVInvokedUrlCommand*) markerCommand;
+ (void) setMarkerCommand:(CDVInvokedUrlCommand*)markerCommand;
+ (id) markerCommandDelegate;
+ (void) setMarkerCommandDelegate:(id)markerCommandDelegate;
+ (id) readyCommandDelegate;
+ (void) setReadyCommandDelegate:(id)readyCommandDelegate;
+ (CDVInvokedUrlCommand*) readyCommand;
+ (void) setReadyCommand:(CDVInvokedUrlCommand*)readyCommand;

@end


text:
{% raw %}
{% extends "account/base.html" %}

{% load i18n %}
{% load account %}
{% load foundation_tags %}

{% block head_title %}{% trans "Password Reset" %}{% endblock %}

{% block content %}

{% trans "Password Reset" %}

            {% if user.is_authenticated %}
            {% include "account/snippets/already_logged_in.html" %}
            {% endif %}

{% trans "Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it." %}

            <form method="POST" action="" class="password_reset">
                {% csrf_token %}
                {{ form|as_foundation }}
                <button class="tiny radius" type="submit">{% trans "Reset My Password" %}</button>
            </form>

{% blocktrans %}Please contact us if you have any trouble resetting your password.{% endblocktrans %}

{% endblock %}

{% block extra_body %}

{% endblock %}
{% endraw %}