text:
package com.istavrak.vocabrecommender.handler;

import com.istavrak.vocabrecommender.PropertiesLoader;
import com.istavrak.vocabrecommender.core.extractor.CoreNlpExtractor;
import com.istavrak.vocabrecommender.core.extractor.StaticPartsExtractor;
import com.istavrak.vocabrecommender.core.recommender.LOVRecommender;
import com.istavrak.vocabrecommender.core.recommender.StaticRecommender;
import com.istavrak.vocabrecommender.model.RecommendationFailure;
import com.istavrak.vocabrecommender.model.RecommendationResponse;
import com.istavrak.vocabrecommender.model.RecommendationResultVocabulary;
import com.istavrak.vocabrecommender.model.TargetPage;
import com.istavrak.vocabrecommender.model.vsearch.Query;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

public class RecommendationHandler {
    private static final Logger logger = Logger.getLogger(RecommendationHandler.class.getName());
    private static final PropertiesLoader loader = PropertiesLoader.INSTANCE;

    public RecommendationResponse generateRecommendationsFor(String bodyHtml, String url, Boolean includeStatic) {
        // Parse the content of the URL for further analysis.
        TargetPage page;
        try {
            page = generateTargetPageFromHtml(bodyHtml, url);
        } catch (IOException e) {
            return new RecommendationFailure("Failed to parse the stored HTML.");
        }
        return generateRecommendationsFor(page, includeStatic);
    }

    public RecommendationResponse generateRecommendationsFor(String url, Boolean includeStatic) {
        // Parse the content of the URL for further analysis.
        TargetPage page;
        try {
            page = generateTargetPage(url);
        } catch (IOException e) {
            return new RecommendationFailure("Failed to parse the URL.");
        }

        if (page == null) {
            return new RecommendationFailure("Failed to extract the content of the URL.");
        }
        return generateRecommendationsFor(page, includeStatic);
    }

    /**
     * Handles the generation of recommendations for a TargetPage.
     * @param page The TargetPage object for the target webpage.
     * @param includeStatic Flag to disable the inclusion of terms for static elements.
     * @return A successful response or failure.
     */
    private RecommendationResponse generateRecommendationsFor(TargetPage page, Boolean includeStatic) {
        List<String> keywords = new ArrayList<>();

        // Extract static parts (images)
        if (includeStatic) {
            StaticPartsExtractor staticExtractor = new StaticPartsExtractor();
            keywords.addAll(staticExtractor.getTokens(page));
        }
        Boolean nlpEnabled = Boolean.parseBoolean(loader.getProperty("nlp.enabled"));
        if (nlpEnabled) {
            CoreNlpExtractor coreNlpExtractor = new CoreNlpExtractor();
            List<String> nlpTokens = coreNlpExtractor.getTokens(page);
            keywords.addAll(nlpTokens);
            logger.log(Level.INFO, "The extracted keywords using NLP: " + nlpTokens);
        }

        // Generate the recommendation results
        List<Query> results = resultsForKeywords(keywords);

        // Return the results.
        RecommendationResultVocabulary vocab = new RecommendationResultVocabulary(results);
        return vocab;
    }

    /**
     * Handles the generation of recommendations for a list of keywords.
     * @param keywords List of keywords.
     * @return A successful response.
     */
    public RecommendationResponse generateRecommendationsFor(List<String> keywords) {
        // Generate the recommendation results
        List<Query> results = resultsForKeywords(keywords);

        // Return the results.
        RecommendationResultVocabulary vocab = new RecommendationResultVocabulary(results);
        return vocab;
    }

    private List<Query> resultsForKeywords(List<String> keywords) {
        List<Query> finalResults = new ArrayList<>();

        // Generate the static recommendations
        StaticRecommender staticRecommender = new StaticRecommender();
        List<Query> staticResults = staticRecommender.recommendVocabularyFor(keywords);
        if (!staticResults.isEmpty()) {
            finalResults.addAll(staticResults);
        }

        // Generate the LOV recommendations
        LOVRecommender lovRecommender = new LOVRecommender();
        List<Query> lovResults = lovRecommender.recommendVocabularyFor(keywords);
        if (!lovResults.isEmpty()) {
            finalResults.addAll(lovResults);
        }
        return finalResults;
    }

    public TargetPage generateTargetPage(String url) throws IOException {
        Document doc = Jsoup.connect(url).get();
        TargetPage page = new TargetPage();
        page.setPageURL(url);
        page.setPageDocument(doc);

        return page;
    }

    private TargetPage generateTargetPageFromHtml(String bodyHtml, String url) throws IOException {
        Document doc = Jsoup.parseBodyFragment(bodyHtml);

        TargetPage page = new TargetPage();
        page.setPageURL(url);
        page.setPageDocument(doc);

        return page;
    }
}


text:
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>potri</title>
<link rel="stylesheet" href="../../../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="../../../../index.html" title="Chapter 1. Boost.Numeric_Bindings">
<link rel="up" href="../computational_routines.html" title="Computational Routines">
<link rel="prev" href="potrf.html" title="potrf">
<link rel="next" href="potrs.html" title="potrs">

potri

            Prototype

            There is one prototype of potri
            available, please see below.

potri( MatrixA& a );

            Description

            potri (short for $FRIENDLY_NAME)
            provides a C++ interface to LAPACK routines SPOTRI, DPOTRI, CPOTRI, and
            ZPOTRI. potri computes
            the inverse of a complex Hermitian positive definite matrix A using the
            Cholesky factorization A = U**H*U or A = LL*H
            computed by ZPOTRF.

            The selection of the LAPACK routine is done during compile-time, and
            is determined by the type of values contained in type MatrixA.
            The type of values is obtained through the value_type
            meta-function typename value_type<MatrixA>::type. The dispatching table below illustrates
            to which specific routine the code path will be generated.

Table 1.273. Dispatching of potri

<colgroup>
<col>
<col>
</colgroup>

                      Value type of MatrixA

                      LAPACK routine

                      float

                      SPOTRI

                      double

                      DPOTRI

                      complex<float>

                      CPOTRI

                      complex<double>

                      ZPOTRI

            Definition

            Defined in header boost/numeric/bindings/lapack/computational/potri.hpp.

            Parameters
            or Requirements on Types

Parameters

MatrixA

                  The definition of term 1

MatrixB

                  The definition of term 2

MatrixC

                  The definition of term 3.

                  Definitions may contain paragraphs.

            Complexity

            Example

#include <boost/numeric/bindings/lapack/computational/potri.hpp>
using namespace boost::numeric::bindings;

lapack::potri( x, y, z );

            this will output

[5] 0 1 2 3 4 5

            Notes

            See
            Also

                Originating Fortran source files spotri.f,
                dpotri.f,
                cpotri.f,
                and zpotri.f
                at Netlib.

Copyright © 2002 -2009 Rutger ter Borg, Krešimir Fresl, Thomas Klimpel,
      Toon Knapen, Karl Meerbergen

        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

redpajama_set_name: RedPajamaGithub


text:
<?php
if ( !class_exists( 'FooGallery_FooBox_Free_Extension' ) ) {

	class FooGallery_FooBox_Free_Extension {

		function __construct() {
			if ( class_exists( 'fooboxV2' ) ) {
				//FooBox PRO is already running!
			} else {
				//integration with FooGallery
				add_filter( 'foogallery_gallery_template_field_lightboxes', array($this, 'add_lightbox') );
				add_filter( 'foogallery_album_stack_link_class_name', array($this, 'album_stack_link_class_name'));
			}
		}

		function add_lightbox($lightboxes) {
			$lightboxes['foobox-free'] = __( 'FooBox Free', 'foobox-image-lightbox' );
			return $lightboxes;
		}

		function album_stack_link_class_name( $class_name ) {
			return str_replace( 'foobox-free', 'foobox', $class_name );
		}
	}
}


text:
require_relative 'test_helper'
require_relative '../lib/wall_e/components/button'

class ButtonTest < MiniTest::Unit::TestCase
  DummyPin = Class.new do
    def set_mode(mode); end
    def start_reporting; end
    def number; 7; end
    def on(*args); end
  end

  def test_sets_up_pin
    pin = MiniTest::Mock.new
    pin.expect(:set_mode, 1, [WallE::Pin::INPUT])
    pin.expect(:start_reporting, 1)
    pin.expect(:number, 7)
    pin.expect(:on, 1, ['digital-read-7', Method])

    WallE::Button.new(pin)

    pin.verify
  end

  def test_pressed
    blk = MiniTest::Mock.new
    blk.expect(:run, nil)

    button = WallE::Button.new(DummyPin.new)
    button.pressed { blk.run }

    button.handler(1)

    blk.verify
  end

  def test_released
    blk = MiniTest::Mock.new
    blk.expect(:run, nil)

    button = WallE::Button.new(DummyPin.new)
    button.released { blk.run }

    button.pressed {  }
    button.handler(1)

    button.handler(0)

    blk.verify
  end

  def test_held
    blk = MiniTest::Mock.new
    blk.expect(:run, nil)

    button = WallE::Button.new(DummyPin.new, 0.2)
    button.held { blk.run }
    button.released { }
    button.pressed { }
    button.handler(1)
    sleep 0.2
    button.handler(0)

    blk.verify
  end
end


text:
/* global DISQUS */

export default class Disqus {
  constructor() {
    this.isScriptLoading = false;
    this.currentIdentifier = '';
  }

  setup(identifier) {
    this.currentIdentifier = identifier;

    window.disqus_shortname = 'argshood';
    window.disqus_identifier = this.currentIdentifier;
    window.disqus_url = window.location.href;
    window.disqus_title = document.title;

    if (!this.ready()) {
      return;
    }

    setTimeout(this.resetDisqus.bind(this), 80);
  }

  ready() {
    if (!this.isScriptLoading) {
      this.isScriptLoading = true;
      this.loadDisqus();
      return false;
    }

    return typeof window.DISQUS !== 'undefined';
  }

  loadDisqus() {
    const d = document;
    const s = d.createElement('script');

    s.src = '//argshood.disqus.com/embed.js';

    s.onload = () => this.setup(this.currentIdentifier);

    s.setAttribute('data-timestamp', +new Date());
    (d.head || d.body).appendChild(s);
  }

  resetDisqus() {
    let identifier = this.currentIdentifier;

    window.disqus_config = function() {
      this.page.identifier = identifier;
    };

    console.log(this.currentIdentifier);
    DISQUS.reset({
      reload: true,
      config: function() {
        this.page.identifier = identifier;
      }
    });
  }
}


text:
namespace Spectrum {
    partial class SettingsForm {
        /// <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() {
            this.components = new System.ComponentModel.Container();
            System.Windows.Forms.TreeNode treeNode1 = new System.Windows.Forms.TreeNode("General");
            System.Windows.Forms.TreeNode treeNode2 = new System.Windows.Forms.TreeNode("Arduino");
            System.Windows.Forms.TreeNode treeNode3 = new System.Windows.Forms.TreeNode("Updates");
            System.Windows.Forms.TreeNode treeNode4 = new System.Windows.Forms.TreeNode("Advnaced");
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SettingsForm));
            this.applySettingsButton = new System.Windows.Forms.Button();
            this.windowsCheckbox = new System.Windows.Forms.CheckBox();
            this.startupConnectCheckBox = new System.Windows.Forms.CheckBox();
            this.closeToTrayCheckbox = new System.Windows.Forms.CheckBox();
            this.startMinCheckbox = new System.Windows.Forms.CheckBox();
            this.updateComboBox = new System.Windows.Forms.ComboBox();
            this.label1 = new System.Windows.Forms.Label();
            this.treeView1 = new System.Windows.Forms.TreeView();
            this.generalSettingsGroupBox = new System.Windows.Forms.GroupBox();
            this.advancedSettingsButton = new System.Windows.Forms.Button();
            this.defaultSettingsButton = new System.Windows.Forms.Button();
            this.offOnClose = new System.Windows.Forms.CheckBox();
            this.cancelButton = new System.Windows.Forms.Button();
            this.okButton = new System.Windows.Forms.Button();
            this.updatesGroupBox = new System.Windows.Forms.GroupBox();
            this.label2 = new System.Windows.Forms.Label();
            this.defaultLocationButton = new System.Windows.Forms.Button();
            this.fileExplorerButton = new System.Windows.Forms.Button();
            this.fileExplorerTextBox = new System.Windows.Forms.TextBox();
            this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
            this.arduinoSettingsGroupBox = new System.Windows.Forms.GroupBox();
            this.responsiveLightingCheckbox = new System.Windows.Forms.CheckBox();
            this.rememberLightCheckbox = new System.Windows.Forms.CheckBox();
            this.label4 = new System.Windows.Forms.Label();
            this.stripLengthUpDown = new System.Windows.Forms.NumericUpDown();
            this.defaultPortComboBox = new System.Windows.Forms.ComboBox();
            this.label3 = new System.Windows.Forms.Label();
            this.advancedSettingsGroupBox = new System.Windows.Forms.GroupBox();
            this.label6 = new System.Windows.Forms.Label();
            this.advancedLightingCheckbox = new System.Windows.Forms.CheckBox();
            this.resetSettingsButton = new System.Windows.Forms.Button();
            this.label5 = new System.Windows.Forms.Label();
            this.devBuildsCheckbox = new System.Windows.Forms.CheckBox();
            this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
            this.advancedSettingsPanel = new System.Windows.Forms.Panel();
            this.generalSettingsGroupBox.SuspendLayout();
            this.updatesGroupBox.SuspendLayout();
            this.arduinoSettingsGroupBox.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.stripLengthUpDown)).BeginInit();
            this.advancedSettingsGroupBox.SuspendLayout();
            this.advancedSettingsPanel.SuspendLayout();
            this.SuspendLayout();
            //
            // applySettingsButton
            //
            this.applySettingsButton.Enabled = false;
            this.applySettingsButton.Location = new System.Drawing.Point(583, 631);
            this.applySettingsButton.Name = "applySettingsButton";
            this.applySettingsButton.Size = new System.Drawing.Size(79, 23);
            this.applySettingsButton.TabIndex = 18;
            this.applySettingsButton.Tag = "";
            this.applySettingsButton.Text = "Apply";
            this.applySettingsButton.UseVisualStyleBackColor = true;
            this.applySettingsButton.Click += new System.EventHandler(this.applySettingsButton_Click);
            //
            // windowsCheckbox
            //
            this.windowsCheckbox.AutoSize = true;
            this.windowsCheckbox.Location = new System.Drawing.Point(80, 112);
            this.windowsCheckbox.Name = "windowsCheckbox";
            this.windowsCheckbox.Size = new System.Drawing.Size(120, 17);
            this.windowsCheckbox.TabIndex = 17;
            this.windowsCheckbox.Tag = "";
            this.windowsCheckbox.Text = "Start With Windows";
            this.toolTip1.SetToolTip(this.windowsCheckbox, "Starts Spectrum With Windows");
            this.windowsCheckbox.UseVisualStyleBackColor = true;
            this.windowsCheckbox.CheckedChanged += new System.EventHandler(this.settingsCheckboxes_CheckedChanged);
            //
            // startupConnectCheckBox
            //
            this.startupConnectCheckBox.AutoSize = true;
            this.startupConnectCheckBox.Enabled = false;
            this.startupConnectCheckBox.Location = new System.Drawing.Point(80, 46);
            this.startupConnectCheckBox.Name = "startupConnectCheckBox";
            this.startupConnectCheckBox.Size = new System.Drawing.Size(120, 17);
            this.startupConnectCheckBox.TabIndex = 16;
            this.startupConnectCheckBox.Tag = "";
            this.startupConnectCheckBox.Text = "Connect On Startup";
            this.toolTip1.SetToolTip(this.startupConnectCheckBox, "Connects to the Arduino Board On Startup");
            this.startupConnectCheckBox.UseVisualStyleBackColor = true;
            this.startupConnectCheckBox.CheckedChanged += new System.EventHandler(this.settingsCheckboxes_CheckedChanged);
            //
            // closeToTrayCheckbox
            //
            this.closeToTrayCheckbox.AutoSize = true;
            this.closeToTrayCheckbox.Location = new System.Drawing.Point(80, 89);
            this.closeToTrayCheckbox.Name = "closeToTrayCheckbox";
            this.closeToTrayCheckbox.Size = new System.Drawing.Size(92, 17);
            this.closeToTrayCheckbox.TabIndex = 15;
            this.closeToTrayCheckbox.Tag = "";
            this.closeToTrayCheckbox.Text = "Close To Tray";
            this.toolTip1.SetToolTip(this.closeToTrayCheckbox, "Closes Spectrum To Tray");
            this.closeToTrayCheckbox.UseVisualStyleBackColor = true;
            this.closeToTrayCheckbox.CheckedChanged += new System.EventHandler(this.settingsCheckboxes_CheckedChanged);
            //
            // startMinCheckbox
            //
            this.startMinCheckbox.AutoSize = true;
            this.startMinCheckbox.Location = new System.Drawing.Point(80, 69);
            this.startMinCheckbox.Name = "startMinCheckbox";
            this.startMinCheckbox.Size = new System.Drawing.Size(97, 17);
            this.startMinCheckbox.TabIndex = 19;
            this.startMinCheckbox.Tag = "";
            this.startMinCheckbox.Text = "Start Minimized";
            this.toolTip1.SetToolTip(this.startMinCheckbox, "Start Spectrum Minimized");
            this.startMinCheckbox.UseVisualStyleBackColor = true;
            this.startMinCheckbox.CheckedChanged += new System.EventHandler(this.settingsCheckboxes_CheckedChanged);
            //
            // updateComboBox
            //
            this.updateComboBox.FormattingEnabled = true;
            this.updateComboBox.Items.AddRange(new object[] {
            "Never",
            "On Startup",
            "On Startup Daily",
            "On Startup Weekly",
            "On Startup Monthly"});
            this.updateComboBox.Location = new System.Drawing.Point(120, 64);
            this.updateComboBox.Name = "updateComboBox";
            this.updateComboBox.Size = new System.Drawing.Size(117, 21);
            this.updateComboBox.TabIndex = 20;
            this.updateComboBox.SelectedIndexChanged += new System.EventHandler(this.comboBox_SelectedIndexChanged);
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(6, 67);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(114, 13);
            this.label1.TabIndex = 21;
            this.label1.Text = "Check Updates Every:";
            //
            // treeView1
            //
            this.treeView1.BorderStyle = System.Windows.Forms.BorderStyle.None;
            this.treeView1.Indent = 10;
            this.treeView1.ItemHeight = 20;
            this.treeView1.Location = new System.Drawing.Point(8, 44);
            this.treeView1.Name = "treeView1";
            treeNode1.Name = "generalNode";
            treeNode1.Text = "General";
            treeNode2.Name = "arduinoNode";
            treeNode2.Text = "Arduino";
            treeNode3.Name = "updatesNode";
            treeNode3.Text = "Updates";
            treeNode4.Name = "advancedNode";
            treeNode4.Text = "Advnaced";
            this.treeView1.Nodes.AddRange(new System.Windows.Forms.TreeNode[] {
            treeNode1,
            treeNode2,
            treeNode3,
            treeNode4});
            this.treeView1.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.treeView1.Size = new System.Drawing.Size(66, 198);
            this.treeView1.TabIndex = 22;
            this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect);
            //
            // generalSettingsGroupBox
            //
            this.generalSettingsGroupBox.Controls.Add(this.startupConnectCheckBox);
            this.generalSettingsGroupBox.Controls.Add(this.closeToTrayCheckbox);
            this.generalSettingsGroupBox.Controls.Add(this.windowsCheckbox);
            this.generalSettingsGroupBox.Controls.Add(this.startMinCheckbox);
            this.generalSettingsGroupBox.Controls.Add(this.defaultSettingsButton);
            this.generalSettingsGroupBox.Location = new System.Drawing.Point(82, 34);
            this.generalSettingsGroupBox.Name = "generalSettingsGroupBox";
            this.generalSettingsGroupBox.Size = new System.Drawing.Size(276, 208);
            this.generalSettingsGroupBox.TabIndex = 23;
            this.generalSettingsGroupBox.TabStop = false;
            this.generalSettingsGroupBox.Text = "General Settings";
            this.generalSettingsGroupBox.Visible = false;
            //
            // advancedSettingsButton
            //
            this.advancedSettingsButton.Location = new System.Drawing.Point(59, 29);
            this.advancedSettingsButton.Name = "advancedSettingsButton";
            this.advancedSettingsButton.Size = new System.Drawing.Size(163, 23);
            this.advancedSettingsButton.TabIndex = 21;
            this.advancedSettingsButton.Text = "Enable Advanced Settings";
            this.toolTip1.SetToolTip(this.advancedSettingsButton, "Reset Settings To Default");
            this.advancedSettingsButton.UseVisualStyleBackColor = true;
            this.advancedSettingsButton.Click += new System.EventHandler(this.advancedSettingsButton_Click);
            //
            // defaultSettingsButton
            //
            this.defaultSettingsButton.Location = new System.Drawing.Point(80, 170);
            this.defaultSettingsButton.Name = "defaultSettingsButton";
            this.defaultSettingsButton.Size = new System.Drawing.Size(97, 23);
            this.defaultSettingsButton.TabIndex = 20;
            this.defaultSettingsButton.Text = "Default Settings";
            this.toolTip1.SetToolTip(this.defaultSettingsButton, "Reset Settings To Default");
            this.defaultSettingsButton.UseVisualStyleBackColor = true;
            this.defaultSettingsButton.Click += new System.EventHandler(this.defaultSettingsButton_Click);
            //
            // offOnClose
            //
            this.offOnClose.AutoSize = true;
            this.offOnClose.Location = new System.Drawing.Point(78, 111);
            this.offOnClose.Name = "offOnClose";
            this.offOnClose.Size = new System.Drawing.Size(111, 17);
            this.offOnClose.TabIndex = 20;
            this.offOnClose.Text = "Turn Off On Close";
            this.toolTip1.SetToolTip(this.offOnClose, "Turn off the Neopixels when Spectrum closes");
            this.offOnClose.UseVisualStyleBackColor = true;
            this.offOnClose.CheckedChanged += new System.EventHandler(this.settingsCheckboxes_CheckedChanged);
            //
            // cancelButton
            //
            this.cancelButton.Location = new System.Drawing.Point(498, 631);
            this.cancelButton.Name = "cancelButton";
            this.cancelButton.Size = new System.Drawing.Size(79, 23);
            this.cancelButton.TabIndex = 24;
            this.cancelButton.Tag = "";
            this.cancelButton.Text = "Cancel";
            this.cancelButton.UseVisualStyleBackColor = true;
            this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
            //
            // okButton
            //
            this.okButton.Location = new System.Drawing.Point(413, 631);
            this.okButton.Name = "okButton";
            this.okButton.Size = new System.Drawing.Size(79, 23);
            this.okButton.TabIndex = 25;
            this.okButton.Tag = "";
            this.okButton.Text = "OK";
            this.okButton.UseVisualStyleBackColor = true;
            this.okButton.Click += new System.EventHandler(this.okButton_Click);
            //
            // updatesGroupBox
            //
            this.updatesGroupBox.Controls.Add(this.label2);
            this.updatesGroupBox.Controls.Add(this.defaultLocationButton);
            this.updatesGroupBox.Controls.Add(this.fileExplorerButton);
            this.updatesGroupBox.Controls.Add(this.fileExplorerTextBox);
            this.updatesGroupBox.Controls.Add(this.updateComboBox);
            this.updatesGroupBox.Controls.Add(this.label1);
            this.updatesGroupBox.Location = new System.Drawing.Point(381, 34);
            this.updatesGroupBox.Name = "updatesGroupBox";
            this.updatesGroupBox.Size = new System.Drawing.Size(276, 208);
            this.updatesGroupBox.TabIndex = 22;
            this.updatesGroupBox.TabStop = false;
            this.updatesGroupBox.Text = "Updates Settings";
            //
            // label2
            //
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(9, 99);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(102, 13);
            this.label2.TabIndex = 25;
            this.label2.Text = "Download Location:";
            //
            // defaultLocationButton
            //
            this.defaultLocationButton.Location = new System.Drawing.Point(83, 149);
            this.defaultLocationButton.Name = "defaultLocationButton";
            this.defaultLocationButton.Size = new System.Drawing.Size(108, 23);
            this.defaultLocationButton.TabIndex = 24;
            this.defaultLocationButton.Text = "Default Location";
            this.defaultLocationButton.UseVisualStyleBackColor = true;
            this.defaultLocationButton.Click += new System.EventHandler(this.defaultLocationButton_Click);
            //
            // fileExplorerButton
            //
            this.fileExplorerButton.Location = new System.Drawing.Point(228, 121);
            this.fileExplorerButton.Name = "fileExplorerButton";
            this.fileExplorerButton.Size = new System.Drawing.Size(42, 23);
            this.fileExplorerButton.TabIndex = 23;
            this.fileExplorerButton.Text = "...";
            this.fileExplorerButton.UseVisualStyleBackColor = true;
            this.fileExplorerButton.Click += new System.EventHandler(this.fileExplorerButton_Click);
            //
            // fileExplorerTextBox
            //
            this.fileExplorerTextBox.Location = new System.Drawing.Point(9, 123);
            this.fileExplorerTextBox.Name = "fileExplorerTextBox";
            this.fileExplorerTextBox.Size = new System.Drawing.Size(213, 20);
            this.fileExplorerTextBox.TabIndex = 22;
            this.fileExplorerTextBox.TextChanged += new System.EventHandler(this.fileExplorerTextBox_TextChanged);
            //
            // folderBrowserDialog1
            //
            this.folderBrowserDialog1.RootFolder = System.Environment.SpecialFolder.MyComputer;
            //
            // arduinoSettingsGroupBox
            //
            this.arduinoSettingsGroupBox.Controls.Add(this.responsiveLightingCheckbox);
            this.arduinoSettingsGroupBox.Controls.Add(this.rememberLightCheckbox);
            this.arduinoSettingsGroupBox.Controls.Add(this.label4);
            this.arduinoSettingsGroupBox.Controls.Add(this.stripLengthUpDown);
            this.arduinoSettingsGroupBox.Controls.Add(this.offOnClose);
            this.arduinoSettingsGroupBox.Controls.Add(this.defaultPortComboBox);
            this.arduinoSettingsGroupBox.Controls.Add(this.label3);
            this.arduinoSettingsGroupBox.Location = new System.Drawing.Point(82, 248);
            this.arduinoSettingsGroupBox.Name = "arduinoSettingsGroupBox";
            this.arduinoSettingsGroupBox.Size = new System.Drawing.Size(276, 208);
            this.arduinoSettingsGroupBox.TabIndex = 24;
            this.arduinoSettingsGroupBox.TabStop = false;
            this.arduinoSettingsGroupBox.Text = "Arduino Settings";
            this.arduinoSettingsGroupBox.Visible = false;
            //
            // responsiveLightingCheckbox
            //
            this.responsiveLightingCheckbox.AutoSize = true;
            this.responsiveLightingCheckbox.Location = new System.Drawing.Point(78, 134);
            this.responsiveLightingCheckbox.Name = "responsiveLightingCheckbox";
            this.responsiveLightingCheckbox.Size = new System.Drawing.Size(122, 17);
            this.responsiveLightingCheckbox.TabIndex = 27;
            this.responsiveLightingCheckbox.Text = "Responsive Lighting";
            this.toolTip1.SetToolTip(this.responsiveLightingCheckbox, "Allows for Responsive Lighting");
            this.responsiveLightingCheckbox.UseVisualStyleBackColor = true;
            this.responsiveLightingCheckbox.CheckedChanged += new System.EventHandler(this.settingsCheckboxes_CheckedChanged);
            //
            // rememberLightCheckbox
            //
            this.rememberLightCheckbox.AutoSize = true;
            this.rememberLightCheckbox.Location = new System.Drawing.Point(78, 157);
            this.rememberLightCheckbox.Name = "rememberLightCheckbox";
            this.rememberLightCheckbox.Size = new System.Drawing.Size(165, 17);
            this.rememberLightCheckbox.TabIndex = 26;
            this.rememberLightCheckbox.Text = "Turn On NeoPixels At Startup";
            this.toolTip1.SetToolTip(this.rememberLightCheckbox, "Turns on Neopixels with last sent command");
            this.rememberLightCheckbox.UseVisualStyleBackColor = true;
            this.rememberLightCheckbox.CheckedChanged += new System.EventHandler(this.settingsCheckboxes_CheckedChanged);
            //
            // label4
            //
            this.label4.AutoSize = true;
            this.label4.Location = new System.Drawing.Point(22, 74);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(112, 13);
            this.label4.TabIndex = 25;
            this.label4.Text = "NeoPixel Strip Length:";
            //
            // stripLengthUpDown
            //
            this.stripLengthUpDown.Location = new System.Drawing.Point(140, 72);
            this.stripLengthUpDown.Name = "stripLengthUpDown";
            this.stripLengthUpDown.Size = new System.Drawing.Size(76, 20);
            this.stripLengthUpDown.TabIndex = 24;
            this.toolTip1.SetToolTip(this.stripLengthUpDown, "Amount of Neopixels connected to the Arduino");
            this.stripLengthUpDown.Value = new decimal(new int[] {
            10,
            0,
            0,
            0});
            this.stripLengthUpDown.ValueChanged += new System.EventHandler(this.stripLengthUpDown_ValueChanged);
            this.stripLengthUpDown.KeyUp += new System.Windows.Forms.KeyEventHandler(this.stripLengthUpDown_KeyUp);
            //
            // defaultPortComboBox
            //
            this.defaultPortComboBox.FormattingEnabled = true;
            this.defaultPortComboBox.Location = new System.Drawing.Point(119, 45);
            this.defaultPortComboBox.Name = "defaultPortComboBox";
            this.defaultPortComboBox.Size = new System.Drawing.Size(117, 21);
            this.defaultPortComboBox.TabIndex = 22;
            this.toolTip1.SetToolTip(this.defaultPortComboBox, "Default COM Port Spectrum Connects to");
            this.defaultPortComboBox.SelectedIndexChanged += new System.EventHandler(this.comboBox_SelectedIndexChanged);
            //
            // label3
            //
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(20, 48);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(93, 13);
            this.label3.TabIndex = 23;
            this.label3.Text = "Default COM Port:";
            //
            // advancedSettingsGroupBox
            //
            this.advancedSettingsGroupBox.Controls.Add(this.advancedSettingsPanel);
            this.advancedSettingsGroupBox.Controls.Add(this.advancedSettingsButton);
            this.advancedSettingsGroupBox.Location = new System.Drawing.Point(381, 248);
            this.advancedSettingsGroupBox.Name = "advancedSettingsGroupBox";
            this.advancedSettingsGroupBox.Size = new System.Drawing.Size(276, 208);
            this.advancedSettingsGroupBox.TabIndex = 27;
            this.advancedSettingsGroupBox.TabStop = false;
            this.advancedSettingsGroupBox.Text = "Advanced Settings";
            this.advancedSettingsGroupBox.Visible = false;
            //
            // label6
            //
            this.label6.AutoSize = true;
            this.label6.Font = new System.Drawing.Font("Microsoft Tai Le", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label6.Location = new System.Drawing.Point(5, 72);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(236, 32);
            this.label6.TabIndex = 25;
            this.label6.Text = "Do Not Click Unless \r\nYou Want to Completely Reset Spectrum";
            this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            //
            // advancedLightingCheckbox
            //
            this.advancedLightingCheckbox.AutoSize = true;
            this.advancedLightingCheckbox.Location = new System.Drawing.Point(79, 6);
            this.advancedLightingCheckbox.Name = "advancedLightingCheckbox";
            this.advancedLightingCheckbox.Size = new System.Drawing.Size(115, 17);
            this.advancedLightingCheckbox.TabIndex = 24;
            this.advancedLightingCheckbox.Text = "Advanced Lighting";
            this.toolTip1.SetToolTip(this.advancedLightingCheckbox, "Allows the user to select what each individule NeoPixel displays");
            this.advancedLightingCheckbox.UseVisualStyleBackColor = true;
            this.advancedLightingCheckbox.CheckedChanged += new System.EventHandler(this.settingsCheckboxes_CheckedChanged);
            //
            // resetSettingsButton
            //
            this.resetSettingsButton.Location = new System.Drawing.Point(79, 110);
            this.resetSettingsButton.Name = "resetSettingsButton";
            this.resetSettingsButton.Size = new System.Drawing.Size(97, 23);
            this.resetSettingsButton.TabIndex = 23;
            this.resetSettingsButton.Text = "Reset Settings";
            this.resetSettingsButton.UseVisualStyleBackColor = true;
            this.resetSettingsButton.Click += new System.EventHandler(this.resetSettingsButton_Click);
            //
            // label5
            //
            this.label5.AutoSize = true;
            this.label5.Location = new System.Drawing.Point(51, 49);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(173, 13);
            this.label5.TabIndex = 22;
            this.label5.Text = "This feature is currently not avalible";
            //
            // devBuildsCheckbox
            //
            this.devBuildsCheckbox.AutoSize = true;
            this.devBuildsCheckbox.Enabled = false;
            this.devBuildsCheckbox.Location = new System.Drawing.Point(79, 29);
            this.devBuildsCheckbox.Name = "devBuildsCheckbox";
            this.devBuildsCheckbox.Size = new System.Drawing.Size(113, 17);
            this.devBuildsCheckbox.TabIndex = 21;
            this.devBuildsCheckbox.Text = "Enable Dev Builds";
            this.toolTip1.SetToolTip(this.devBuildsCheckbox, "Feature Currently Not Avalible");
            this.devBuildsCheckbox.UseVisualStyleBackColor = true;
            //
            // advancedSettingsPanel
            //
            this.advancedSettingsPanel.Controls.Add(this.devBuildsCheckbox);
            this.advancedSettingsPanel.Controls.Add(this.label6);
            this.advancedSettingsPanel.Controls.Add(this.label5);
            this.advancedSettingsPanel.Controls.Add(this.advancedLightingCheckbox);
            this.advancedSettingsPanel.Controls.Add(this.resetSettingsButton);
            this.advancedSettingsPanel.Enabled = false;
            this.advancedSettingsPanel.Location = new System.Drawing.Point(12, 58);
            this.advancedSettingsPanel.Name = "advancedSettingsPanel";
            this.advancedSettingsPanel.Size = new System.Drawing.Size(248, 140);
            this.advancedSettingsPanel.TabIndex = 28;
            //
            // SettingsForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(666, 666);
            this.Controls.Add(this.advancedSettingsGroupBox);
            this.Controls.Add(this.arduinoSettingsGroupBox);
            this.Controls.Add(this.updatesGroupBox);
            this.Controls.Add(this.okButton);
            this.Controls.Add(this.cancelButton);
            this.Controls.Add(this.generalSettingsGroupBox);
            this.Controls.Add(this.treeView1);
            this.Controls.Add(this.applySettingsButton);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "SettingsForm";
            this.Text = "Settings";
            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.SettingsForm_FormClosing);
            this.Shown += new System.EventHandler(this.SettingsForm_Shown);
            this.generalSettingsGroupBox.ResumeLayout(false);
            this.generalSettingsGroupBox.PerformLayout();
            this.updatesGroupBox.ResumeLayout(false);
            this.updatesGroupBox.PerformLayout();
            this.arduinoSettingsGroupBox.ResumeLayout(false);
            this.arduinoSettingsGroupBox.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.stripLengthUpDown)).EndInit();
            this.advancedSettingsGroupBox.ResumeLayout(false);
            this.advancedSettingsPanel.ResumeLayout(false);
            this.advancedSettingsPanel.PerformLayout();
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.Button applySettingsButton;
        private System.Windows.Forms.CheckBox windowsCheckbox;
        private System.Windows.Forms.CheckBox closeToTrayCheckbox;
        public System.Windows.Forms.CheckBox startupConnectCheckBox;
        private System.Windows.Forms.CheckBox startMinCheckbox;
        private System.Windows.Forms.ComboBox updateComboBox;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.TreeView treeView1;
        private System.Windows.Forms.GroupBox generalSettingsGroupBox;
        private System.Windows.Forms.Button cancelButton;
        private System.Windows.Forms.Button okButton;
        private System.Windows.Forms.GroupBox updatesGroupBox;
        private System.Windows.Forms.CheckBox offOnClose;
        private System.Windows.Forms.Button fileExplorerButton;
        private System.Windows.Forms.TextBox fileExplorerTextBox;
        private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
        private System.Windows.Forms.Button defaultLocationButton;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.GroupBox arduinoSettingsGroupBox;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.Label label3;
        public System.Windows.Forms.NumericUpDown stripLengthUpDown;
        public System.Windows.Forms.ComboBox defaultPortComboBox;
        private System.Windows.Forms.CheckBox rememberLightCheckbox;
        private System.Windows.Forms.Button defaultSettingsButton;
        private System.Windows.Forms.GroupBox advancedSettingsGroupBox;
        private System.Windows.Forms.CheckBox devBuildsCheckbox;
        private System.Windows.Forms.ToolTip toolTip1;
        private System.Windows.Forms.Label label5;
        private System.Windows.Forms.Button resetSettingsButton;
        private System.Windows.Forms.CheckBox responsiveLightingCheckbox;
        private System.Windows.Forms.CheckBox advancedLightingCheckbox;
        private System.Windows.Forms.Label label6;
        private System.Windows.Forms.Button advancedSettingsButton;
        private System.Windows.Forms.Panel advancedSettingsPanel;
    }
}


text:
@interface IFAPurgeableObject : NSObject <NSDiscardableContent> {

	@private
	NSInteger contentAccessCount;
	BOOL contentDiscarded;

}

@property (nonatomic, strong) id obj;

- (id)initWithObject:(id)anObj;

@end


text:
IrrOculusVR
===========

Oculus Rift SDK 0.4.3 support for Irrlicht 1.8.1 using DirectX 9 and OpenGL (Windows).

Supports both Oculus Rift DK1 and DK2.

For DK2 only the extended mode is supported for now which means that the application should be launched in fullscreen to the secondary adapter. This can be done in Irrlicht's creation parameters.

The renderer can either take player's position and rotation around Y-axis as a parameter during
rendering or alternatively it's possible to link to player's head node. The linking is a good
solution for example for simulators while the other approach works nicely for FPS games.

main.cpp contains simple example using the FPS-approach.

Feel free to contact me about this through Twitter:
@Suvidriel

You can get the Oculus Rift SDK here:
https://developer.oculusvr.com/?action=dl


text:
import os
import subprocess
import sys
import tempfile

from string import Template

_TEMPLATE = """<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="../visualizer/static/index.css">
<link rel="stylesheet"
  href="../visualizer/static/third_party/jqTree/jqtree.css">

Deep Memory Profiler Visulaizer

"""

def main(argv):
  # Read json data.
  data_file = open(argv[1], 'r')
  data = data_file.read()
  data_file.close()

  # Fill in the template of index.js.
  dmprof_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  html_dir = os.path.join(dmprof_path, 'graphs')
  if not os.path.exists(html_dir):
    os.mkdir(html_dir)

  html_handle, html_path = tempfile.mkstemp('.html', 'graph', html_dir)
  html_file = os.fdopen(html_handle, 'w')
  html_file.write(Template(_TEMPLATE).safe_substitute({ 'DATA': data }))
  html_file.close()

  # Open index page in chrome automatically if permitted.
  if sys.platform.startswith('linux'):
    try:
      subprocess.call(['xdg-open', html_path])
    except OSError, exception:
      print >> sys.stderr, 'xdg-open failed:', exception
      print 'generated html file is at ' + html_path
  else:
    print 'generated html file is at ' + html_path

if __name__ == '__main__':
  sys.exit(main(sys.argv))


text:
using Org.Apache.Reef.Common.Context;
using Org.Apache.Reef.Common.Evaluator;
using Org.Apache.Reef.Driver.Context;
using Org.Apache.Reef.Driver.Evaluator;
using Org.Apache.Reef.Driver.Task;
using Org.Apache.Reef.Utilities.Logging;
using Org.Apache.Reef.Tang.Annotations;
using Org.Apache.Reef.Tang.Formats;
using Org.Apache.Reef.Tang.Util;
using Org.Apache.Reef.Wake.Time;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;

[module: SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:FieldsMustBePrivate", Justification = "static field, typical usage in configurations")]

namespace Org.Apache.Reef.Driver.Bridge
{
    public class DriverBridgeConfiguration : ConfigurationModuleBuilder
    {
        /// <summary>
        ///  The event handler invoked right after the driver boots up.
        /// </summary>
        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
        public static readonly RequiredImpl<IStartHandler> OnDriverStarted = new RequiredImpl<IStartHandler>();

        /// <summary>
        ///  The event handler invoked when driver restarts
        /// </summary>
        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
        public static readonly OptionalImpl<IObserver<StartTime>> OnDriverRestarted = new OptionalImpl<IObserver<StartTime>>();

        /// <summary>
        /// The event handler for requesting evaluator
        /// </summary>
        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
        public static readonly OptionalImpl<IObserver<IEvaluatorRequestor>> OnEvaluatorRequested = new OptionalImpl<IObserver<IEvaluatorRequestor>>();

        /// <summary>
        /// Event handler for allocated evaluators. Defaults to returning the evaluator if not bound.
        /// </summary>
        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
        public static readonly OptionalImpl<IObserver<IAllocatedEvaluator>> OnEvaluatorAllocated = new OptionalImpl<IObserver<IAllocatedEvaluator>>();

        /// <summary>
        /// Event handler for completed evaluators. Defaults to logging if not bound.
        /// </summary>
        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
        public static readonly OptionalImpl<IObserver<ICompletedEvaluator>> OnEvaluatorCompleted = new OptionalImpl<IObserver<ICompletedEvaluator>>();

        /// <summary>
        /// Event handler for failed evaluators. Defaults to job failure if not bound.
        /// </summary>
        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
        public static readonly OptionalImpl<IObserver<IFailedEvaluator>> OnEvaluatorFailed = new OptionalImpl<IObserver<IFailedEvaluator>>();

        /// <summary>
        /// Event handler for failed evaluators. Defaults to job failure if not bound.
        /// </summary>
        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
        public static readonly OptionalImpl<IHttpHandler> OnHttpEvent = new OptionalImpl<IHttpHandler>();

        /// <summary>
        /// Event handler for task messages. Defaults to logging if not bound.
        /// </summary>
        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
        public static readonly OptionalImpl<IObserver<ITaskMessage>> OnTaskMessage = new OptionalImpl<IObserver<ITaskMessage>>();

        /// <summary>
        /// Event handler for completed tasks. Defaults to closing the context the task ran on if not bound.
        /// </summary>
        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
        public static readonly OptionalImpl<IObserver<ICompletedTask>> OnTaskCompleted = new OptionalImpl<IObserver<ICompletedTask>>();

        /// <summary>
        /// Event handler for failed tasks. Defaults to job failure if not bound.
        /// </summary>
        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
        public static readonly OptionalImpl<IObserver<IFailedTask>> OnTaskFailed = new OptionalImpl<IObserver<IFailedTask>>();

        ///// <summary>
        ///// Event handler for running tasks. Defaults to logging if not bound.
        ///// </summary>
        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
        public static readonly OptionalImpl<IObserver<IRunningTask>> OnTaskRunning = new OptionalImpl<IObserver<IRunningTask>>();

        ///// <summary>
        ///// Event handler for running task received during driver restart. Defaults to logging if not bound.
        ///// </summary>
        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
        public static readonly OptionalImpl<IObserver<IRunningTask>> OnDriverRestartTaskRunning = new OptionalImpl<IObserver<IRunningTask>>();

        /// <summary>
        /// Event handler for suspended tasks. Defaults to job failure if not bound. Rationale: many jobs don't support
        /// task suspension. Hence, this parameter should be optional. The only sane default is to crash the job, then.
        /// </summary>
        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
        public static readonly OptionalImpl<IObserver<ISuspendedTask>> OnTaskSuspended = new OptionalImpl<IObserver<ISuspendedTask>>();

        /// <summary>
        /// Event handler for active context. Defaults to closing the context if not bound.
        /// </summary>
        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
        public static readonly OptionalImpl<IObserver<IActiveContext>> OnContextActive = new OptionalImpl<IObserver<IActiveContext>>();

        /// <summary>
        /// Event handler for active context received during driver restart. Defaults to closing the context if not bound.
        /// </summary>
        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
        public static readonly OptionalImpl<IObserver<IActiveContext>> OnDirverRestartContextActive = new OptionalImpl<IObserver<IActiveContext>>();

        /// <summary>
        /// Event handler for closed context. Defaults to logging if not bound.
        /// </summary>
        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
        public static readonly OptionalImpl<IObserver<IClosedContext>> OnContextClosed = new OptionalImpl<IObserver<IClosedContext>>();

        /// <summary>
        ///  Event handler for closed context. Defaults to job failure if not bound.
        /// </summary>
        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
        public static readonly OptionalImpl<IObserver<IFailedContext>> OnContextFailed = new OptionalImpl<IObserver<IFailedContext>>();

        /// <summary>
        ///  Event handler for context messages. Defaults to logging if not bound.
        /// </summary>
        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
        public static readonly OptionalImpl<IObserver<IContextMessage>> OnContextMessage = new OptionalImpl<IObserver<IContextMessage>>();

        /// <summary>
        /// Additional set of string arguments that can be pssed to handlers through client
        /// </summary>
        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
        public static readonly OptionalParameter<string> CommandLineArguments = new OptionalParameter<string>();

        /// <summary>
        /// The trace level of the TraceListner
        /// </summary>
        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
        public static readonly OptionalParameter<string> CustomTraceLevel = new OptionalParameter<string>();

        /// <summary>
        /// Additional set of trace listners provided by client
        /// </summary>
        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
        public static readonly OptionalParameter<TraceListener> CustomTraceListeners = new OptionalParameter<TraceListener>();

        /// <summary>
        ///  The implemenation for (attempting to) re-establish connection to driver
        /// </summary>
        [SuppressMessage("Microsoft.Security", "CA2104:Do not declare read only mutable reference types", Justification = "not applicable")]
        public static readonly OptionalImpl<IDriverConnection> OnDriverReconnect = new OptionalImpl<IDriverConnection>();

        // This is currently not needed in Bridge/Driver model
        ///// <summary>
        ///// The event handler invoked right before the driver shuts down. Defaults to ignore.
        ///// </summary>
        //public static readonly OptionalImpl<IObserver<StopTime>> OnDriverStop = new OptionalImpl<IObserver<StopTime>>();

        // Client handlers only needed when client interactions are expeceted. Not enabled for now.
        ///// <summary>
        ///// Event handler for client messages. Defaults to logging if not bound.
        ///// </summary>
        //public static readonly OptionalImpl<IObserver<byte[]>> OnClientMessage = new OptionalImpl<IObserver<byte[]>>();

        // Client handlers only needed when client interactions are expeceted. Not enabled for now.
        ///// <summary>
        ///// Event handler for close messages sent by the client. Defaults to job failure if not bound.
        ///// Note: in java the type is void, but IObserver does not take void as a type
        ///// </summary>
        //public static readonly OptionalImpl<IObserver<byte[]>> OnClientClosed = new OptionalImpl<IObserver<byte[]>>();

        // Client handlers only needed when client interactions are expeceted. Not enabled for now.
        ///// <summary>
        ///// Event handler for close messages sent by the client. Defaults to job failure if not bound.
        ///// </summary>
        //public static readonly OptionalImpl<IObserver<byte[]>> OnClientClosedMessage = new OptionalImpl<IObserver<byte[]>>();

        public static ConfigurationModule ConfigurationModule
        {
            get
            {
                return new DriverBridgeConfiguration()
                .BindImplementation(GenericType<IStartHandler>.Class, OnDriverStarted)
                .BindNamedParameter(GenericType<DriverBridgeConfigurationOptions.DriverRestartHandler>.Class, OnDriverRestarted)
                .BindImplementation(GenericType<IDriverConnection>.Class, OnDriverReconnect)
                .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.EvaluatorRequestHandlers>.Class, OnEvaluatorRequested)
                .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.AllocatedEvaluatorHandlers>.Class, OnEvaluatorAllocated)
                .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.ActiveContextHandlers>.Class, OnContextActive)
                .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.TaskMessageHandlers>.Class, OnTaskMessage)
                .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.FailedTaskHandlers>.Class, OnTaskFailed)
                .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.RunningTaskHandlers>.Class, OnTaskRunning)
                .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.SuspendedTaskHandlers>.Class, OnTaskSuspended)
                .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.FailedEvaluatorHandlers>.Class, OnEvaluatorFailed)
                .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.CompletedEvaluatorHandlers>.Class, OnEvaluatorCompleted)
                .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.CompletedTaskHandlers>.Class, OnTaskCompleted)
                .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.ClosedContextHandlers>.Class, OnContextClosed)
                .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.FailedContextHandlers>.Class, OnContextFailed)
                .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.ContextMessageHandlers>.Class, OnContextMessage)
                .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.ArgumentSets>.Class, CommandLineArguments)
                .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.HttpEventHandlers>.Class, OnHttpEvent)
                .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.TraceListenersSet>.Class, CustomTraceListeners)
                .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.DriverRestartActiveContextHandlers>.Class, OnDirverRestartContextActive)
                .BindSetEntry(GenericType<DriverBridgeConfigurationOptions.DriverRestartRunningTaskHandlers>.Class, OnDriverRestartTaskRunning)
                .BindNamedParameter(GenericType<DriverBridgeConfigurationOptions.TraceLevel>.Class, CustomTraceLevel)
                .Build();
            }
        }
    }

    public class CommandLineArguments
    {
        [Inject]
        public CommandLineArguments([Parameter(typeof(DriverBridgeConfigurationOptions.ArgumentSets))] ISet<string> arguments)
        {
            Arguments = arguments;
        }

        public ISet<string> Arguments { get; set; }
    }

    public class CustomTraceListeners
    {
        [Inject]
        public CustomTraceListeners([Parameter(typeof(DriverBridgeConfigurationOptions.TraceListenersSet))] ISet<TraceListener> listeners)
        {
            Listeners = listeners;
        }

        public ISet<TraceListener> Listeners { get; set; }
    }

    public class CustomTraceLevel
    {
        [Inject]
        public CustomTraceLevel([Parameter(typeof(DriverBridgeConfigurationOptions.TraceLevel))] string traceLevel)
        {
            Level level = Level.Verbose;
            if (Enum.TryParse(traceLevel.ToString(CultureInfo.InvariantCulture), out level))
            {
                Logger.SetCustomLevel(level);
            }
            else
            {
                Console.WriteLine("Cannot parse trace level" + traceLevel);
            }
            TraceLevel = level;
        }

        public Level TraceLevel { get; set; }
    }
}


text:
title: "Composter"
date: 2015-05-28 20:21:15
tags:
  - compost
  - forsythia
---

- 5/28—Temp: 60–82F, Precip: 0.37"

Rained last night briefly and a little harder (but just as brief) today.

Received [dual tumbler composter](http://www.goodideasinc.com/products/composters/compost-wizard-dual-senior/)
ordered on 15 April.

Cleared forsythia near garden to make a space for it. Also dug out a nasty
thorny vine growing in there. Going to fight forsythia back on all fronts and
try to take down some vertical height to keep it out of utility lines.


text:
package com.sequenceiq.cloudbreak.orchestrator.salt.poller.checker;

import java.util.Set;

import com.sequenceiq.cloudbreak.common.orchestration.Node;
import com.sequenceiq.cloudbreak.orchestrator.salt.states.SaltStateService;

public class GrainRemoveRunner extends ModifyGrainBase {

    public GrainRemoveRunner(SaltStateService saltStateService, Set<String> target, Set<Node> allNode, String role) {
        this(saltStateService, target, allNode, "roles", role);
    }

    public GrainRemoveRunner(SaltStateService saltStateService, Set<String> target, Set<Node> allNode, String key, String value) {
        super(saltStateService, target, allNode, key, value, false);
    }
}


text:
package org.apache.cassandra.cql3.statements;

import org.apache.cassandra.auth.Permission;
import org.apache.cassandra.config.*;
import org.apache.cassandra.cql3.*;
import org.apache.cassandra.cql3.functions.Function;
import org.apache.cassandra.db.marshal.*;
import org.apache.cassandra.exceptions.*;
import org.apache.cassandra.service.ClientState;
import org.apache.cassandra.service.MigrationManager;
import org.apache.cassandra.transport.Event;

public class DropTypeStatement extends SchemaAlteringStatement
{
    private final UTName name;
    private final boolean ifExists;

    public DropTypeStatement(UTName name, boolean ifExists)
    {
        super();
        this.name = name;
        this.ifExists = ifExists;
    }

    @Override
    public void prepareKeyspace(ClientState state) throws InvalidRequestException
    {
        if (!name.hasKeyspace())
            name.setKeyspace(state.getKeyspace());
    }

    public void checkAccess(ClientState state) throws UnauthorizedException, InvalidRequestException
    {
        state.hasKeyspaceAccess(keyspace(), Permission.DROP);
    }

    public void validate(ClientState state) throws RequestValidationException
    {
        KSMetaData ksm = Schema.instance.getKSMetaData(name.getKeyspace());
        if (ksm == null)
            throw new InvalidRequestException(String.format("Cannot drop type in unknown keyspace %s", name.getKeyspace()));

        if (!ksm.types.get(name.getUserTypeName()).isPresent())
        {
            if (ifExists)
                return;
            else
                throw new InvalidRequestException(String.format("No user type named %s exists.", name));
        }

        // We don't want to drop a type unless it's not used anymore (mainly because
        // if someone drops a type and recreates one with the same name but different
        // definition with the previous name still in use, things can get messy).
        // We have two places to check: 1) other user type that can nest the one
        // we drop and 2) existing tables referencing the type (maybe in a nested
        // way).

        for (Function function : ksm.functions)
        {
            if (isUsedBy(function.returnType()))
                throw new InvalidRequestException(String.format("Cannot drop user type %s as it is still used by function %s", name, function));

            for (AbstractType<?> argType : function.argTypes())
                if (isUsedBy(argType))
                    throw new InvalidRequestException(String.format("Cannot drop user type %s as it is still used by function %s", name, function));
        }

        for (UserType ut : ksm.types)
            if (!ut.name.equals(name.getUserTypeName()) && isUsedBy(ut))
                throw new InvalidRequestException(String.format("Cannot drop user type %s as it is still used by user type %s", name, ut.asCQL3Type()));

        for (CFMetaData cfm : ksm.tables)
            for (ColumnDefinition def : cfm.allColumns())
                if (isUsedBy(def.type))
                    throw new InvalidRequestException(String.format("Cannot drop user type %s as it is still used by table %s.%s", name, cfm.ksName, cfm.cfName));
    }

    private boolean isUsedBy(AbstractType<?> toCheck) throws RequestValidationException
    {
        if (toCheck instanceof UserType)
        {
            UserType ut = (UserType)toCheck;
            if (name.getKeyspace().equals(ut.keyspace) && name.getUserTypeName().equals(ut.name))
                return true;

            for (AbstractType<?> subtype : ut.fieldTypes())
                if (isUsedBy(subtype))
                    return true;
        }
        else if (toCheck instanceof CompositeType)
        {
            CompositeType ct = (CompositeType)toCheck;
            for (AbstractType<?> subtype : ct.types)
                if (isUsedBy(subtype))
                    return true;
        }
        else if (toCheck instanceof CollectionType)
        {
            if (toCheck instanceof ListType)
                return isUsedBy(((ListType)toCheck).getElementsType());
            else if (toCheck instanceof SetType)
                return isUsedBy(((SetType)toCheck).getElementsType());
            else
                return isUsedBy(((MapType)toCheck).getKeysType()) || isUsedBy(((MapType)toCheck).getValuesType());
        }
        return false;
    }

    public Event.SchemaChange changeEvent()
    {
        return new Event.SchemaChange(Event.SchemaChange.Change.DROPPED, Event.SchemaChange.Target.TYPE, keyspace(), name.getStringTypeName());
    }

    @Override
    public String keyspace()
    {
        return name.getKeyspace();
    }

    public boolean announceMigration(boolean isLocalOnly) throws InvalidRequestException, ConfigurationException
    {
        KSMetaData ksm = Schema.instance.getKSMetaData(name.getKeyspace());
        assert ksm != null;

        UserType toDrop = ksm.types.getNullable(name.getUserTypeName());
        // Can be null with ifExists
        if (toDrop == null)
            return false;

        MigrationManager.announceTypeDrop(toDrop, isLocalOnly);
        return true;
    }
}


text:
package org.xbib.netty.http.server.endpoint.service;

import org.xbib.netty.http.server.api.Resource;
import org.xbib.netty.http.server.api.ServerRequest;
import org.xbib.netty.http.server.api.ServerResponse;

import java.io.IOException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.time.Instant;

public class FileService extends ResourceService {

    private final Path prefix;

    private final String indexFileName;

    public FileService(Path prefix) {
        this(prefix, "index.html");
    }

    public FileService(Path prefix, String indexFileName) {
        this.prefix = prefix;
        this.indexFileName = indexFileName;
    }

    @Override
    protected Resource createResource(ServerRequest serverRequest, ServerResponse serverResponse) throws IOException {
        return new ChunkedFileResource(serverRequest);
    }

    @Override
    protected boolean isETagResponseEnabled() {
        return true;
    }

    @Override
    protected boolean isCacheResponseEnabled() {
        return true;
    }

    @Override
    protected boolean isRangeResponseEnabled() {
        return true;
    }

    @Override
    protected int getMaxAgeSeconds() {
        return 24 * 3600;
    }

    class ChunkedFileResource implements Resource {

        private final String resourcePath;

        private final URL url;

        private final boolean isDirectory;

        private final Instant lastModified;

        private final long length;

        ChunkedFileResource(ServerRequest serverRequest) throws IOException {
            String effectivePath = serverRequest.getEffectiveRequestPath();
            this.resourcePath = effectivePath.startsWith("/") ? effectivePath.substring(1) : effectivePath;
            Path path = prefix.resolve(resourcePath);
            this.url = path.toUri().toURL();
            boolean isExists = Files.exists(path);
            this.isDirectory = Files.isDirectory(path);
            if (isExists) {
                this.lastModified = Files.getLastModifiedTime(path).toInstant();
                this.length = Files.size(path);
            } else {
                this.lastModified = Instant.now();
                this.length = 0;
            }
        }

        @Override
        public String getResourcePath() {
            return resourcePath;
        }

        @Override
        public URL getURL() {
            return url;
        }

        @Override
        public boolean isDirectory() {
            return isDirectory;
        }

        @Override
        public String indexFileName() {
            return indexFileName;
        }

        @Override
        public Instant getLastModified() {
            return lastModified;
        }

        @Override
        public long getLength() {
            return length;
        }

        @Override
        public String toString() {
            return "[FileResource:resourcePath=" + resourcePath +
                    ",url=" + url +
                    ",lastmodified=" + lastModified +
                    ",length=" + length +
                    ",isDirectory=" + isDirectory() + "]";
        }
    }
}


text:
<?php
namespace OkZhu\WebAdminBundle\Services;

use Doctrine\ORM\EntityManager;

class TestServices
{

	protected $em;

	public function __construct(EntityManager $entityManager)
    {
        $this->em = $entityManager;
    }

    public function sssss()
    {
		return "ssssssssssssss";
    }
}

?>


text:
<?php
	namespace App\Facades\Backend;

	use Illuminate\Support\Facades\Facade;

	class UserFacade extends Facade{
		protected static function getFacadeAccessor(){
			return 'userrepository';
		}
	}
?>


text:
package org.jabsorb.ng.serializer.impl;

import java.util.Iterator;

import org.jabsorb.ng.JSONSerializer;
import org.jabsorb.ng.serializer.AbstractSerializer;
import org.jabsorb.ng.serializer.MarshallException;
import org.jabsorb.ng.serializer.ObjectMatch;
import org.jabsorb.ng.serializer.SerializerState;
import org.jabsorb.ng.serializer.UnmarshallException;
import org.json.JSONException;
import org.json.JSONObject;

/**
 * Formats the Java JSONObject object.
 */
public class RawJSONObjectSerializer extends AbstractSerializer {

    /**
     * Classes that this can serialise to.
     */
    private static Class<?>[] _JSONClasses = new Class<?>[] { JSONObject.class };

    /**
     * Classes that this can serialise.
     */
    private static Class<?>[] _serializableClasses = new Class<?>[] { JSONObject.class };

    /**
     * Unique serialisation id.
     */
    private static final long serialVersionUID = 2;

    @Override
    public Class<?>[] getJSONClasses() {

        return _JSONClasses;
    }

    @Override
    public Class<?>[] getSerializableClasses() {

        return _serializableClasses;
    }

    @Override
    public Object marshall(final SerializerState state, final Object p,
            final Object o) throws MarshallException {

        // reprocess the raw json in order to fixup circular references and
        // duplicates
        final JSONObject jsonIn = (JSONObject) o;
        final JSONObject jsonOut = new JSONObject();
        String key = null;
        try {
            final Iterator<?> i = jsonIn.keys();
            while (i.hasNext()) {
                key = (String) i.next();

                final Object j = ser.marshall(state, o, jsonIn.get(key), key);

                // omit the object entirely if it's a circular reference or
                // duplicate
                // it will be regenerated in the fixups phase
                if (JSONSerializer.CIRC_REF_OR_DUPLICATE != j) {
                    jsonOut.put(key, j);
                }
            }
        } catch (final MarshallException e) {
            throw new MarshallException("JSONObject key " + key + " "
                    + e.getMessage(), e);
        } catch (final JSONException e) {
            throw new MarshallException("JSONObject key " + key + " "
                    + e.getMessage(), e);
        }
        return jsonOut;
    }

    @Override
    public ObjectMatch tryUnmarshall(final SerializerState state,
            final Class<?> clazz, final Object jso) throws UnmarshallException {

        state.setSerialized(jso, ObjectMatch.OKAY);
        return ObjectMatch.OKAY;
    }

    @Override
    public Object unmarshall(final SerializerState state, final Class<?> clazz,
            final Object jso) throws UnmarshallException {

        state.setSerialized(jso, jso);
        return jso;
    }

}


text:
#ifndef REALM_COLUMN_BINARY_HPP
#define REALM_COLUMN_BINARY_HPP

#include <realm/column.hpp>
#include <realm/array_binary.hpp>
#include <realm/array_blobs_big.hpp>

namespace realm {

/// A binary column (ColumnBinary) is a single B+-tree, and the root
/// of the column is the root of the B+-tree. Leaf nodes are either of
/// type ArrayBinary (array of small blobs) or ArrayBigBlobs (array of
/// big blobs).
class ColumnBinary: public ColumnBaseSimple {
public:
    typedef BinaryData value_type;

    ColumnBinary(Allocator&, ref_type, bool nullable = false);

    std::size_t size() const REALM_NOEXCEPT final;
    bool is_empty() const REALM_NOEXCEPT { return size() == 0; }
    bool is_nullable() const REALM_NOEXCEPT override;

    BinaryData get(std::size_t ndx) const REALM_NOEXCEPT;
    bool is_null(std::size_t ndx) const REALM_NOEXCEPT override;
    StringData get_index_data(std::size_t, char*) const REALM_NOEXCEPT final;

    void add(BinaryData value);
    void set(std::size_t ndx, BinaryData value, bool add_zero_term = false);
    void set_null(std::size_t ndx) override;
    void insert(std::size_t ndx, BinaryData value);
    void erase(std::size_t row_ndx);
    void erase(std::size_t row_ndx, bool is_last);
    void move_last_over(std::size_t row_ndx);
    void clear();
    size_t find_first(BinaryData value) const;

    // Requires that the specified entry was inserted as StringData.
    StringData get_string(std::size_t ndx) const REALM_NOEXCEPT;

    void add_string(StringData value);
    void set_string(std::size_t ndx, StringData value) override;
    void insert_string(std::size_t ndx, StringData value);

    /// Compare two binary columns for equality.
    bool compare_binary(const ColumnBinary&) const;

    static ref_type create(Allocator&, std::size_t size = 0);

    static std::size_t get_size_from_ref(ref_type root_ref, Allocator&) REALM_NOEXCEPT;

    // Overrriding method in ColumnBase
    ref_type write(std::size_t, std::size_t, std::size_t,
                   _impl::OutputStream&) const override;

    void insert_rows(size_t, size_t, size_t) override;
    void erase_rows(size_t, size_t, size_t, bool) override;
    void move_last_row_over(size_t, size_t, bool) override;
    void clear(std::size_t, bool) override;
    void update_from_parent(std::size_t) REALM_NOEXCEPT override;
    void refresh_accessor_tree(std::size_t, const Spec&) override;

#ifdef REALM_DEBUG
    void Verify() const override;
    void to_dot(std::ostream&, StringData title) const override;
    void do_dump_node_structure(std::ostream&, int) const override;
#endif

private:
    /// \param row_ndx Must be `realm::npos` if appending.
    void do_insert(std::size_t row_ndx, BinaryData value, bool add_zero_term,
                   std::size_t num_rows);

    // Called by Array::bptree_insert().
    static ref_type leaf_insert(MemRef leaf_mem, ArrayParent&, std::size_t ndx_in_parent,
                                Allocator&, std::size_t insert_ndx,
                                Array::TreeInsert<ColumnBinary>& state);

    struct InsertState: Array::TreeInsert<ColumnBinary> {
        bool m_add_zero_term;
    };

    class EraseLeafElem;
    class CreateHandler;
    class SliceHandler;

    void do_move_last_over(std::size_t row_ndx, std::size_t last_row_ndx);
    void do_clear();

    /// Root must be a leaf. Upgrades the root leaf if
    /// necessary. Returns true if, and only if the root is a 'big
    /// blobs' leaf upon return.
    bool upgrade_root_leaf(std::size_t value_size);

    bool m_nullable = false;

#ifdef REALM_DEBUG
    void leaf_to_dot(MemRef, ArrayParent*, std::size_t ndx_in_parent,
                     std::ostream&) const override;
#endif

    friend class Array;
    friend class ColumnBase;
};

// Implementation

inline StringData ColumnBinary::get_index_data(std::size_t, char*) const REALM_NOEXCEPT
{
    REALM_ASSERT(false && "Index not implemented for ColumnBinary.");
    REALM_UNREACHABLE();
}

inline std::size_t ColumnBinary::size() const  REALM_NOEXCEPT
{
    if (root_is_leaf()) {
        bool is_big = m_array->get_context_flag();
        if (!is_big) {
            // Small blobs root leaf
            ArrayBinary* leaf = static_cast<ArrayBinary*>(m_array.get());
            return leaf->size();
        }
        // Big blobs root leaf
        ArrayBigBlobs* leaf = static_cast<ArrayBigBlobs*>(m_array.get());
        return leaf->size();
    }
    // Non-leaf root
    return m_array->get_bptree_size();
}

inline bool ColumnBinary::is_nullable() const REALM_NOEXCEPT
{
    return m_nullable;
}

inline void ColumnBinary::update_from_parent(std::size_t old_baseline) REALM_NOEXCEPT
{
    if (root_is_leaf()) {
        bool is_big = m_array->get_context_flag();
        if (!is_big) {
            // Small blobs root leaf
            ArrayBinary* leaf = static_cast<ArrayBinary*>(m_array.get());
            leaf->update_from_parent(old_baseline);
            return;
        }
        // Big blobs root leaf
        ArrayBigBlobs* leaf = static_cast<ArrayBigBlobs*>(m_array.get());
        leaf->update_from_parent(old_baseline);
        return;
    }
    // Non-leaf root
    m_array->update_from_parent(old_baseline);
}

inline BinaryData ColumnBinary::get(std::size_t ndx) const REALM_NOEXCEPT
{
    REALM_ASSERT_DEBUG(ndx < size());
    if (root_is_leaf()) {
        bool is_big = m_array->get_context_flag();
        if (!is_big) {
            // Small blobs root leaf
            ArrayBinary* leaf = static_cast<ArrayBinary*>(m_array.get());
            return leaf->get(ndx);
        }
        // Big blobs root leaf
        ArrayBigBlobs* leaf = static_cast<ArrayBigBlobs*>(m_array.get());
        return leaf->get(ndx);
    }

    // Non-leaf root
    std::pair<MemRef, std::size_t> p = m_array->get_bptree_leaf(ndx);
    const char* leaf_header = p.first.m_addr;
    std::size_t ndx_in_leaf = p.second;
    Allocator& alloc = m_array->get_alloc();
    bool is_big = Array::get_context_flag_from_header(leaf_header);
    if (!is_big) {
        // Small blobs
        return ArrayBinary::get(leaf_header, ndx_in_leaf, alloc);
    }
    // Big blobs
    return ArrayBigBlobs::get(leaf_header, ndx_in_leaf, alloc);
}

inline bool ColumnBinary::is_null(std::size_t ndx) const REALM_NOEXCEPT
{
    return get(ndx).is_null();
}

inline StringData ColumnBinary::get_string(std::size_t ndx) const REALM_NOEXCEPT
{
    BinaryData bin = get(ndx);
    REALM_ASSERT_3(0, <, bin.size());
    return StringData(bin.data(), bin.size()-1);
}

inline void ColumnBinary::set_string(std::size_t ndx, StringData value)
{
    if (value.is_null() && !m_nullable)
        throw LogicError(LogicError::column_not_nullable);

    BinaryData bin(value.data(), value.size());
    bool add_zero_term = true;
    set(ndx, bin, add_zero_term);
}

inline void ColumnBinary::add(BinaryData value)
{
    if (value.is_null() && !m_nullable)
        throw LogicError(LogicError::column_not_nullable);

    std::size_t row_ndx = realm::npos;
    bool add_zero_term = false;
    std::size_t num_rows = 1;
    do_insert(row_ndx, value, add_zero_term, num_rows); // Throws
}

inline void ColumnBinary::insert(std::size_t row_ndx, BinaryData value)
{
    if (value.is_null() && !m_nullable)
        throw LogicError(LogicError::column_not_nullable);

    std::size_t size = this->size(); // Slow
    REALM_ASSERT_3(row_ndx, <=, size);
    std::size_t row_ndx_2 = row_ndx == size ? realm::npos : row_ndx;
    bool add_zero_term = false;
    std::size_t num_rows = 1;
    do_insert(row_ndx_2, value, add_zero_term, num_rows); // Throws
}

inline void ColumnBinary::set_null(std::size_t row_ndx)
{
    set(row_ndx, BinaryData{});
}

inline size_t ColumnBinary::find_first(BinaryData value) const
{
    for (size_t t = 0; t < size(); t++)
        if (get(t) == value)
            return t;

    return not_found;
}

inline void ColumnBinary::erase(std::size_t row_ndx)
{
    std::size_t last_row_ndx = size() - 1; // Note that size() is slow
    bool is_last = row_ndx == last_row_ndx;
    erase(row_ndx, is_last); // Throws
}

inline void ColumnBinary::move_last_over(std::size_t row_ndx)
{
    std::size_t last_row_ndx = size() - 1; // Note that size() is slow
    do_move_last_over(row_ndx, last_row_ndx); // Throws
}

inline void ColumnBinary::clear()
{
    do_clear(); // Throws
}

// Implementing pure virtual method of ColumnBase.
inline void ColumnBinary::insert_rows(size_t row_ndx, size_t num_rows_to_insert,
                                      size_t prior_num_rows)
{
    REALM_ASSERT_DEBUG(prior_num_rows == size());
    REALM_ASSERT(row_ndx <= prior_num_rows);

    size_t row_ndx_2 = (row_ndx == prior_num_rows ? realm::npos : row_ndx);
    BinaryData value = m_nullable ? BinaryData() : BinaryData("", 0);
    bool add_zero_term = false;
    do_insert(row_ndx_2, value, add_zero_term, num_rows_to_insert); // Throws
}

// Implementing pure virtual method of ColumnBase.
inline void ColumnBinary::erase_rows(size_t row_ndx, size_t num_rows_to_erase,
                                     size_t prior_num_rows, bool)
{
    REALM_ASSERT_DEBUG(prior_num_rows == size());
    REALM_ASSERT(num_rows_to_erase <= prior_num_rows);
    REALM_ASSERT(row_ndx <= prior_num_rows - num_rows_to_erase);

    bool is_last = (row_ndx + num_rows_to_erase == prior_num_rows);
    for (size_t i = num_rows_to_erase; i > 0; --i) {
        size_t row_ndx_2 = row_ndx + i - 1;
        erase(row_ndx_2, is_last); // Throws
    }
}

// Implementing pure virtual method of ColumnBase.
inline void ColumnBinary::move_last_row_over(size_t row_ndx, size_t prior_num_rows, bool)
{
    REALM_ASSERT_DEBUG(prior_num_rows == size());
    REALM_ASSERT(row_ndx < prior_num_rows);

    size_t last_row_ndx = prior_num_rows - 1;
    do_move_last_over(row_ndx, last_row_ndx); // Throws
}

// Implementing pure virtual method of ColumnBase.
inline void ColumnBinary::clear(std::size_t, bool)
{
    do_clear(); // Throws
}

inline void ColumnBinary::add_string(StringData value)
{
    std::size_t row_ndx = realm::npos;
    BinaryData value_2(value.data(), value.size());
    bool add_zero_term = true;
    std::size_t num_rows = 1;
    do_insert(row_ndx, value_2, add_zero_term, num_rows); // Throws
}

inline void ColumnBinary::insert_string(std::size_t row_ndx, StringData value)
{
    std::size_t size = this->size(); // Slow
    REALM_ASSERT_3(row_ndx, <=, size);
    std::size_t row_ndx_2 = row_ndx == size ? realm::npos : row_ndx;
    BinaryData value_2(value.data(), value.size());
    bool add_zero_term = false;
    std::size_t num_rows = 1;
    do_insert(row_ndx_2, value_2, add_zero_term, num_rows); // Throws
}

inline std::size_t ColumnBinary::get_size_from_ref(ref_type root_ref,
                                                   Allocator& alloc) REALM_NOEXCEPT
{
    const char* root_header = alloc.translate(root_ref);
    bool root_is_leaf = !Array::get_is_inner_bptree_node_from_header(root_header);
    if (root_is_leaf) {
        bool is_big = Array::get_context_flag_from_header(root_header);
        if (!is_big) {
            // Small blobs leaf
            return ArrayBinary::get_size_from_header(root_header, alloc);
        }
        // Big blobs leaf
        return ArrayBigBlobs::get_size_from_header(root_header);
    }
    return Array::get_bptree_size_from_header(root_header);
}

} // namespace realm

#endif // REALM_COLUMN_BINARY_HPP


text:
 This file has been truncated, but you can view the full file.
View Raw

(Sorry about that, but we can't show files that are this big right now.)


text:
title: Docs
onpage_menu: false
body_classes: "modular header-image header-lite fullwidth services"

content:
    items: @self.modular
    order:
        by: default
        dir: asc
---


text:
import json
import urllib2

### For monitoring the performance metrics of your Mesos Agents using Site24x7 Server Monitoring Plugins.

### 1. Have the site24x7 server monitoring agent up and running.
### 2. Download the plugin from github
### 3. Create a folder in name of the plugin under agent plugins directory (/opt/site24x7/monagent/plugins/)
### 4. Place the plugin inside the folder

### Language : Python
### Author: Anita, Zoho Corp
### Tested in Ubuntu

# Change the mesos agents stats accordingly here.
HOST="localhost"
PORT="5050"
URL = "http://"+HOST+":"+PORT+"/metrics/snapshot"
USERNAME = None
PASSWORD = None

# If any changes done in the plugin, plugin_version must be incremented by 1. For. E.g 2,3,4..
PLUGIN_VERSION = "1"

# Setting this to true will alert you when there is a communication problem while posting plugin data to server
HEARTBEAT = "true"

class MesosAgents():
    def __init__(self):
        self.data = {}
        self.data['plugin_version'] = PLUGIN_VERSION
        self.data['heartbeat_required'] = HEARTBEAT

    def getData(self):
        try:
            ### Create Authentication Handler for the HTTP Request
            pwdmgr = urllib2.HTTPPasswordMgr()
            pwdmgr.add_password(None, URL, USERNAME, PASSWORD)
            auth = urllib2.HTTPBasicAuthHandler(pwdmgr)

            ### Create Proxy Handler for the HTTP Request
            proxy = urllib2.ProxyHandler({}) # Uses NO Proxy

            ### Create a HTTP Request with the authentication and proxy handlers
            opener = urllib2.build_opener(proxy, auth)
            urllib2.install_opener(opener)

            ### Get HTTP Response
            response = urllib2.urlopen(URL, timeout=10)

            ### Parse the response data
            if response.getcode() == 200:
                bytedata = response.read()
                output = bytedata.decode()
                self.data = self.parseClusterData(output)

            else:
                self.data['msg'] = str(response.getcode())
                self.status = 0

        except Exception as e:
            self.data['msg'] = str(e)
            self.status = 0

        return self.data

    def parseClusterData(self, output):

        try:
            data = json.loads(output.decode('UTF-8'))
            self.data['dropped_messages'] = data['master/dropped_messages']
            self.data['elected'] = data['master/elected']
            self.data['event_queue_dispatches'] = data['master/event_queue_dispatches']
            self.data['event_queue_http_requests'] = data['master/event_queue_http_requests']
            self.data['event_queue_messages'] = data['master/event_queue_messages']
            self.data['frameworks_active'] = data['master/frameworks_active']
            self.data['frameworks_connected'] = data['master/frameworks_connected']
            self.data['frameworks_disconnected'] = data['master/frameworks_disconnected']
            self.data['frameworks_inactive'] = data['master/frameworks_inactive']

        except Exception as e:
            self.data['msg'] = str(e)
            self.status = 0

        return self.data

if __name__ == '__main__':
    mesosagt = MesosAgents()
    result = mesosagt.getData()
    print(json.dumps(result, indent=4, sort_keys=True))


text:
/**
 *
 */package org.nutz.lang.stream;


text:
@implementation DBSHARINGTransferFolderError

@synthesize accessError = _accessError;

#pragma mark - Constructors

- (instancetype)initWithAccessError:(DBSHARINGSharedFolderAccessError *)accessError {
  self = [super init];
  if (self) {
    _tag = DBSHARINGTransferFolderErrorAccessError;
    _accessError = accessError;
  }
  return self;
}

- (instancetype)initWithInvalidDropboxId {
  self = [super init];
  if (self) {
    _tag = DBSHARINGTransferFolderErrorInvalidDropboxId;
  }
  return self;
}

- (instancetype)initWithDNewOwnerNotAMember {
  self = [super init];
  if (self) {
    _tag = DBSHARINGTransferFolderErrorDNewOwnerNotAMember;
  }
  return self;
}

- (instancetype)initWithDNewOwnerUnmounted {
  self = [super init];
  if (self) {
    _tag = DBSHARINGTransferFolderErrorDNewOwnerUnmounted;
  }
  return self;
}

- (instancetype)initWithDNewOwnerEmailUnverified {
  self = [super init];
  if (self) {
    _tag = DBSHARINGTransferFolderErrorDNewOwnerEmailUnverified;
  }
  return self;
}

- (instancetype)initWithTeamFolder {
  self = [super init];
  if (self) {
    _tag = DBSHARINGTransferFolderErrorTeamFolder;
  }
  return self;
}

- (instancetype)initWithNoPermission {
  self = [super init];
  if (self) {
    _tag = DBSHARINGTransferFolderErrorNoPermission;
  }
  return self;
}

- (instancetype)initWithOther {
  self = [super init];
  if (self) {
    _tag = DBSHARINGTransferFolderErrorOther;
  }
  return self;
}

#pragma mark - Instance field accessors

- (DBSHARINGSharedFolderAccessError *)accessError {
  if (![self isAccessError]) {
    [NSException raise:@"IllegalStateException"
                format:@"Invalid tag: required DBSHARINGTransferFolderErrorAccessError, but was %@.", [self tagName]];
  }
  return _accessError;
}

#pragma mark - Tag state methods

- (BOOL)isAccessError {
  return _tag == DBSHARINGTransferFolderErrorAccessError;
}

- (BOOL)isInvalidDropboxId {
  return _tag == DBSHARINGTransferFolderErrorInvalidDropboxId;
}

- (BOOL)isDNewOwnerNotAMember {
  return _tag == DBSHARINGTransferFolderErrorDNewOwnerNotAMember;
}

- (BOOL)isDNewOwnerUnmounted {
  return _tag == DBSHARINGTransferFolderErrorDNewOwnerUnmounted;
}

- (BOOL)isDNewOwnerEmailUnverified {
  return _tag == DBSHARINGTransferFolderErrorDNewOwnerEmailUnverified;
}

- (BOOL)isTeamFolder {
  return _tag == DBSHARINGTransferFolderErrorTeamFolder;
}

- (BOOL)isNoPermission {
  return _tag == DBSHARINGTransferFolderErrorNoPermission;
}

- (BOOL)isOther {
  return _tag == DBSHARINGTransferFolderErrorOther;
}

- (NSString *)tagName {
  switch (_tag) {
  case DBSHARINGTransferFolderErrorAccessError:
    return @"DBSHARINGTransferFolderErrorAccessError";
  case DBSHARINGTransferFolderErrorInvalidDropboxId:
    return @"DBSHARINGTransferFolderErrorInvalidDropboxId";
  case DBSHARINGTransferFolderErrorDNewOwnerNotAMember:
    return @"DBSHARINGTransferFolderErrorDNewOwnerNotAMember";
  case DBSHARINGTransferFolderErrorDNewOwnerUnmounted:
    return @"DBSHARINGTransferFolderErrorDNewOwnerUnmounted";
  case DBSHARINGTransferFolderErrorDNewOwnerEmailUnverified:
    return @"DBSHARINGTransferFolderErrorDNewOwnerEmailUnverified";
  case DBSHARINGTransferFolderErrorTeamFolder:
    return @"DBSHARINGTransferFolderErrorTeamFolder";
  case DBSHARINGTransferFolderErrorNoPermission:
    return @"DBSHARINGTransferFolderErrorNoPermission";
  case DBSHARINGTransferFolderErrorOther:
    return @"DBSHARINGTransferFolderErrorOther";
  }

  @throw([NSException exceptionWithName:@"InvalidTag" reason:@"Tag has an unknown value." userInfo:nil]);
}

#pragma mark - Serialization methods

+ (NSDictionary *)serialize:(id)instance {
  return [DBSHARINGTransferFolderErrorSerializer serialize:instance];
}

+ (id)deserialize:(NSDictionary *)dict {
  return [DBSHARINGTransferFolderErrorSerializer deserialize:dict];
}

#pragma mark - Description method

- (NSString *)description {
  return [[DBSHARINGTransferFolderErrorSerializer serialize:self] description];
}

@end

#pragma mark - Serializer Object

@implementation DBSHARINGTransferFolderErrorSerializer

+ (NSDictionary *)serialize:(DBSHARINGTransferFolderError *)valueObj {
  NSMutableDictionary *jsonDict = [[NSMutableDictionary alloc] init];

  if ([valueObj isAccessError]) {
    jsonDict[@"access_error"] =
        [[DBSHARINGSharedFolderAccessErrorSerializer serialize:valueObj.accessError] mutableCopy];
    jsonDict[@".tag"] = @"access_error";
  } else if ([valueObj isInvalidDropboxId]) {
    jsonDict[@".tag"] = @"invalid_dropbox_id";
  } else if ([valueObj isDNewOwnerNotAMember]) {
    jsonDict[@".tag"] = @"new_owner_not_a_member";
  } else if ([valueObj isDNewOwnerUnmounted]) {
    jsonDict[@".tag"] = @"new_owner_unmounted";
  } else if ([valueObj isDNewOwnerEmailUnverified]) {
    jsonDict[@".tag"] = @"new_owner_email_unverified";
  } else if ([valueObj isTeamFolder]) {
    jsonDict[@".tag"] = @"team_folder";
  } else if ([valueObj isNoPermission]) {
    jsonDict[@".tag"] = @"no_permission";
  } else if ([valueObj isOther]) {
    jsonDict[@".tag"] = @"other";
  } else {
    @throw([NSException exceptionWithName:@"InvalidTag"
                                   reason:@"Object not properly initialized. Tag has an unknown value."
                                 userInfo:nil]);
  }

  return jsonDict;
}

+ (DBSHARINGTransferFolderError *)deserialize:(NSDictionary *)valueDict {
  NSString *tag = valueDict[@".tag"];

  if ([tag isEqualToString:@"access_error"]) {
    DBSHARINGSharedFolderAccessError *accessError =
        [DBSHARINGSharedFolderAccessErrorSerializer deserialize:valueDict[@"access_error"]];
    return [[DBSHARINGTransferFolderError alloc] initWithAccessError:accessError];
  } else if ([tag isEqualToString:@"invalid_dropbox_id"]) {
    return [[DBSHARINGTransferFolderError alloc] initWithInvalidDropboxId];
  } else if ([tag isEqualToString:@"new_owner_not_a_member"]) {
    return [[DBSHARINGTransferFolderError alloc] initWithDNewOwnerNotAMember];
  } else if ([tag isEqualToString:@"new_owner_unmounted"]) {
    return [[DBSHARINGTransferFolderError alloc] initWithDNewOwnerUnmounted];
  } else if ([tag isEqualToString:@"new_owner_email_unverified"]) {
    return [[DBSHARINGTransferFolderError alloc] initWithDNewOwnerEmailUnverified];
  } else if ([tag isEqualToString:@"team_folder"]) {
    return [[DBSHARINGTransferFolderError alloc] initWithTeamFolder];
  } else if ([tag isEqualToString:@"no_permission"]) {
    return [[DBSHARINGTransferFolderError alloc] initWithNoPermission];
  } else if ([tag isEqualToString:@"other"]) {
    return [[DBSHARINGTransferFolderError alloc] initWithOther];
  }

  @throw([NSException
      exceptionWithName:@"InvalidTag"
                 reason:[NSString stringWithFormat:@"Tag has an invalid value: \"%@\".", valueDict[@".tag"]]
               userInfo:nil]);
}

@end


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2004 The Apache Software Foundation

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
 -->
<todolist xmlns="http://xmlbeans.apache.org/samples/validation/todolist">
    <item id="001">
      <name>Buy a south Pacific island.</name>
      <description>Contingent on inheriting lots of money.</description>
      <due_by>2005-05-01T23:36:28</due_by>
      <action>someday_maybe_defer</action>
    </item>
    <item id="002">
      <name>Get that new PowerBook I've been eyeing.</name>
      <description>Resulting productivity increase will be exponential!</description>
      <due_by>2005-05-01T23:36:28</due_by>
      <action>do</action>
    </item>
    <item id="003">
      <name>Clean the garage.</name>
      <description>Remove at least enough junk so that my bicycle fits.</description>
      <due_by>2005-05-30T23:36:28</due_by>
      <action>delegate</action>
    </item>
</todolist>


text:
package gis.iwacu_new.rit.edu.main.gps.map;

public abstract class Layer {

	public abstract int getId();

	public abstract String getDescription();

	public abstract String getURLPattern();

}


text:
package org.optaplanner.benchmark.impl.statistic.stepscore;

import java.util.List;

import org.optaplanner.benchmark.config.statistic.ProblemStatisticType;
import org.optaplanner.benchmark.impl.result.SubSingleBenchmarkResult;
import org.optaplanner.benchmark.impl.statistic.ProblemBasedSubSingleStatistic;
import org.optaplanner.core.api.solver.Solver;
import org.optaplanner.core.impl.phase.event.PhaseLifecycleListenerAdapter;
import org.optaplanner.core.impl.phase.scope.AbstractStepScope;
import org.optaplanner.core.impl.score.definition.ScoreDefinition;
import org.optaplanner.core.impl.solver.DefaultSolver;

public class StepScoreSubSingleStatistic extends ProblemBasedSubSingleStatistic<StepScoreStatisticPoint> {

    private final StepScoreSubSingleStatisticListener listener;

    public StepScoreSubSingleStatistic(SubSingleBenchmarkResult subSingleBenchmarkResult) {
        super(subSingleBenchmarkResult, ProblemStatisticType.STEP_SCORE);
        listener = new StepScoreSubSingleStatisticListener();
    }

    // ************************************************************************
    // Lifecycle methods
    // ************************************************************************

    public void open(Solver solver) {
        ((DefaultSolver) solver).addPhaseLifecycleListener(listener);
    }

    public void close(Solver solver) {
        ((DefaultSolver) solver).removePhaseLifecycleListener(listener);
    }

    private class StepScoreSubSingleStatisticListener extends PhaseLifecycleListenerAdapter {

        @Override
        public void stepEnded(AbstractStepScope stepScope) {
            if (stepScope.hasNoUninitializedVariables()) {
                long timeMillisSpent = stepScope.getPhaseScope().calculateSolverTimeMillisSpent();
                pointList.add(new StepScoreStatisticPoint(timeMillisSpent, stepScope.getScore()));
            }
        }

    }

    // ************************************************************************
    // CSV methods
    // ************************************************************************

    @Override
    protected String getCsvHeader() {
        return StepScoreStatisticPoint.buildCsvLine("timeMillisSpent", "score");
    }

    @Override
    protected StepScoreStatisticPoint createPointFromCsvLine(ScoreDefinition scoreDefinition,
            List<String> csvLine) {
        return new StepScoreStatisticPoint(Long.valueOf(csvLine.get(0)),
                scoreDefinition.parseScore(csvLine.get(1)));
    }

}