text:
<?php

/**
 * -----------------------------------------------------------------------------
 * Admin Submission Route
 * -----------------------------------------------------------------------------
 *
 * Handles the admin routes.
 *
 */

Route::group(['prefix' => 'forms'], function () {
    // SoftDelete routes
    Route::get('submissions/trashed', 'SubmissionController@trashed')
         ->name('submissions.trashed');

    Route::patch('submissions/restore/{fieldtype}', 'SubmissionController@restore')
         ->name('submissions.restore');

    Route::delete('submissions/delete/{fieldtype}', 'SubmissionController@delete')
         ->name('submissions.delete');

    Route::post('submissions/submit', 'SubmissionController@submit')
         ->name('submissions.submit');

    // Results
    Route::get('submissions/result/{submission}', 'SubmissionController@result')
         ->name('submissions.result');

    // Reports
    Route::post('submissions/{submission}/export', 'SubmissionController@export')
         ->name('submissions.export');

    // Admin routes
    Route::resource('submissions', 'SubmissionController')->except(['store']);
});


text:
package org.jboss.netty.handler.execution;

/**
 * {@link ChannelEventRunnableFilter} implementation which matches {@link ChannelDownstreamEventRunnable}
 *
 */
public class ChannelDownstreamEventRunnableFilter implements ChannelEventRunnableFilter {

    public boolean filter(ChannelEventRunnable event) {
        return event instanceof ChannelDownstreamEventRunnable;
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace WPNXM\Webinterface\Software;

use WPNXM\Webinterface\SoftwareBase;

/**
 * WPN-XM Webinterface - Class for RethinkDB
 */
class Rethinkdb_x64 extends SoftwareBase
{
    public $name = 'RethinkDB';

    public $registryName = 'rethinkdb-x64';

    public $installationFolder = /* WPNXM_ROOT . */ '\bin\rethinkdb';

    public $files = [
        '\bin\rethinkdb\rethinkdb-x64.exe',
    ];

    public function __invoke()
    {
        echo __CLASS__ . ' invoked';
    }
}


text:
CREATE TABLE "snippet_view" (
	"snippet_id" TEXT,
	"username" TEXT,
	PRIMARY KEY ("snippet_id", "username")
);


text:
classdef enum_helper < handle
    %
    %   Class:
    %   h5m.enum_helper
    %
    %   Access via:
    %   h5m.enum_helper.instance();

    properties
        enum_strings
        enum_values
        access_names
    end

    methods (Access = private)
        function obj = enum_helper()
            %TODO: Load enumeration info
            base_path = h5m.sl.dir.getMyBasePath('',1);
            file_path = fullfile(base_path,'EnumerationInfo.tab');

            %TODO: Move locally
            data = sl.io.readDelimitedFile(file_path,'\t','header_lines',1);

            obj.enum_strings = cellfun(@(x) x(2:end-1),data(:,1),'un',0);
            obj.enum_values  = str2double(data(:,2));
            obj.access_names = data(:,3);
        end
    end

    methods
        function enum_string = getEnumerationStringFromAccessFunction(obj,access_name,value)
            %
            %   Given a specific function and a value, this allows looking
            %   up the enumeration string associated with that value in
            %   order to gain insight into the meaning of the value.
            %
            %   Example:
            %   --------
            %   %NOTE: I've added a function handle to make repeated
            %   %calls a bit cleaner
            %
            %   eh = h5m.enum_helper.instance();
            %   getString = @(access_name,value)getEnumerationStringFromAccessFunction(eh,access_name,value);
            %   enum_string = getString('H5P.get_alloc_time',obj.allocation_time)
            %
            mask = strcmp(access_name,obj.access_names);
            temp_strings = obj.enum_strings(mask);
            temp_values  = obj.enum_values(mask);
            enum_string  = temp_strings{temp_values == value};
        end
    end

    methods(Static)
        function obj = instance()
            persistent uniqueInstance
            if isempty(uniqueInstance)
                obj = h5m.enum_helper();
                uniqueInstance = obj;
            else
                obj = uniqueInstance;
            end
        end
    end
end


text:
package org.apache.activemq.artemis.spi.core.security.jaas;

import java.security.MessageDigest;

import javax.security.auth.callback.Callback;

/**
 * Callback to obtain a {@link MessageDigest} for login purpose
 */
public class DigestCallback implements Callback {

   private MessageDigest digest;

   /**
    * set the digest to use
    * @param digest the digest
    */
   public void setDigest(MessageDigest digest) {
      this.digest = digest;
   }

   /**
    * @return the digest or null if not known
    */
   public MessageDigest getDigest() {
      return digest;
   }

}


text:
tinyMCE.addI18n('nl.umbraco_dlg',{
about_title:"Over TinyMCE",
about_general:"Info",
about_help:"Help",
about_license:"Licentie",
about_plugins:"Invoegtoepassingen",
about_plugin:"Invoegtoepassing",
about_author:"Auteur",
about_version:"Versie",
about_loaded:"Geladen Invoegtoepassingen",
anchor_title:"Anker invoegen/bewerken",
anchor_name:"Ankernaam",
code_title:"HTML Bron",
code_wordwrap:"Automatische terugloop",
colorpicker_title:"Kleuren",
colorpicker_picker_tab:"Alle kleuren",
colorpicker_picker_title:"Alle kleuren",
colorpicker_palette_tab:"Palet",
colorpicker_palette_title:"Paletkleuren",
colorpicker_named_tab:"Benoemd",
colorpicker_named_title:"Benoemde kleuren",
colorpicker_color:"Kleur:",
colorpicker_name:"Naam:",
charmap_title:"Symbolen",
image_title:"Afbeelding invoegen/bewerken",
image_src:"Bestand/URL",
image_alt:"Beschrijving",
image_list:"Lijst",
image_border:"Rand",
image_dimensions:"Afmetingen",
image_vspace:"Verticale ruimte",
image_hspace:"Horizontale ruimte",
image_align:"Uitlijning",
image_align_baseline:"Basislijn",
image_align_top:"Boven",
image_align_middle:"Midden",
image_align_bottom:"Onder",
image_align_texttop:"Bovenkant tekst",
image_align_textbottom:"Onderkant tekst",
image_align_left:"Links",
image_align_right:"Rechts",
link_title:"Link invoegen/bewerken",
link_url:"URL",
link_target:"Doel",
link_target_same:"Link in hetzelfde venster openen",
link_target_blank:"Link in een nieuw venster openen",
link_titlefield:"Titel",
link_is_email:"De ingevoerde URL lijkt op een e-mailadres. Wilt u de vereiste mailto: tekst voorvoegen?",
link_is_external:"De ingevoerde URL lijkt op een externe link. Wilt u de vereiste http:// tekst voorvoegen?",
link_list:"Link lijst"
});


text:
module WillFilter
  module Containers
    class Double < WillFilter::FilterContainer
      def self.operators
        [:is, :is_not, :is_less_than, :is_greater_than]
      end

      def template_name
        'text'
      end

      def numeric_value
        value.to_f
      end

      def validate
        return "Value must be provided" if value.blank?
        return "Value must be a valid floating point number" unless is_floating_point?(value)
      end

      def sql_condition
        return [" #{condition.full_key} = ? ",   numeric_value]    if operator == :is
        return [" #{condition.full_key} <> ? ",  numeric_value]    if operator == :is_not
        return [" #{condition.full_key} < ? ",   numeric_value]    if operator == :is_less_than
        return [" #{condition.full_key} > ? ",   numeric_value]    if operator == :is_greater_than
      end
    end
  end
end


text:
// ----------------- BEGIN LICENSE BLOCK ---------------------------------
//
// Copyright (c) 2018 Intel Corporation
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
//    this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice,
//    this list of conditions and the following disclaimer in the documentation
//	  and/or other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its contributors
//    may be used to endorse or promote products derived from this software without
//    specific prior written permission.
//
//    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
//    ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
//    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
//    IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
//    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
//    BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
//    OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
//    WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
//    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
//    POSSIBILITY OF SUCH DAMAGE.
//
// ----------------- END LICENSE BLOCK -----------------------------------

/**
 * @file
 *
 */

#pragma once
#include <limits>

#include <vector>
#include "rss/time/Duration.hpp"
#include "rss/world/Dynamics.hpp"
#include "rss/world/ObjectId.hpp"
#include "rss/world/ObjectType.hpp"
#include "rss/world/OccupiedRegion.hpp"
#include "rss/world/Velocity.hpp"
/*!
 * @brief namespace rss
 */
namespace rss {
/*!
 * @brief namespace world
 */
namespace world {

struct Object
{
  ::rss::world::ObjectId objectId;
  ::rss::world::ObjectType objectType;
  std::vector<::rss::world::OccupiedRegion> occupiedRegions;
  ::rss::world::Dynamics dynamics;
  ::rss::world::Velocity velocity;
  ::rss::time::Duration responseTime;

  ::rss::world::ObjectType getObjectType() const
  {
    return objectType;
  }

  void setObjectType(::rss::world::ObjectType const newVal)
  {
    objectType = newVal;
  }
};

} // namespace world
} // namespace rss


text:
package io.quarkus.kafka.client.health;

import javax.enterprise.context.ApplicationScoped;

import org.apache.kafka.common.Node;
import org.eclipse.microprofile.health.HealthCheck;
import org.eclipse.microprofile.health.HealthCheckResponse;
import org.eclipse.microprofile.health.HealthCheckResponseBuilder;
import org.eclipse.microprofile.health.Readiness;

import io.quarkus.kafka.client.runtime.KafkaAdminClient;

@Readiness
@ApplicationScoped
public class KafkaHealthCheck implements HealthCheck {

    KafkaAdminClient kafkaAdminClient;

    public KafkaHealthCheck(KafkaAdminClient kafkaAdminClient) {
        this.kafkaAdminClient = kafkaAdminClient;
    }

    @Override
    public HealthCheckResponse call() {
        HealthCheckResponseBuilder builder = HealthCheckResponse.named("Kafka connection health check").up();
        try {
            StringBuilder nodes = new StringBuilder();
            for (Node node : kafkaAdminClient.getCluster().nodes().get()) {
                if (nodes.length() > 0) {
                    nodes.append(',');
                }
                nodes.append(node.host()).append(':').append(node.port());
            }
            return builder.withData("nodes", nodes.toString()).build();
        } catch (Exception e) {
            return builder.down().withData("reason", e.getMessage()).build();
        }
    }
}


text:
'use strict';

var _ = require('lodash');

var email = require('powerdrill')('E3wG-7HkdDYIdtKqj600fg');

require('./db');
var StockPoint = require('mongoose').model('StockPoint');
var Pattern = require('mongoose').model('Pattern');

var patterns = [];

function sendEmail() {
    var formatted = '';
    patterns.forEach(function(pattern) {
        formatted += '\nSymbol: ' + pattern.symbol + ' Pattern: ' + pattern.pattern;
    });

    var message = email();

    message
        .subject('Found some patterns')
        .to('conn.hindley@gmail.com')
        .to('ajcollins0@gmail.com')
        .from('conn.hindley@gmail.com')
        .html('<p>' + formatted + '</p>')
        .send()
        .end(function(res) {
            process.exit(0);
        });
}

function bullish(symbol, today, yesterday) {
    if (+today.close > +today.open && +yesterday.open > +yesterday.close && +today.open < +yesterday.close && +today.close > +yesterday.open) {
        //console.log('Found Bullish Engulfing! ' + symbol + ' on: ' + today.date);
        patterns.push({
            symbol: symbol,
            date: today.date,
            pattern: 'Bullish Engulfing'
        });
    }
}

function scan(symbol, data) {
    bullish(symbol, data[0], data[1]);
}

function storePatterns() {
    Pattern.collection.insert(patterns, function(err, docs) {
        if (!err) {
            console.log('Collection saved! Stored ' + docs.length + ' posts in the DB.');
            sendEmail();
        } else {
            console.log('Error saving docs?');
            process.exit(1);
        }
    });
}

StockPoint.find({}, function(err, points) {
    var companies = _.groupBy(points, function(point) {
        return point.symbol;
    });
    for (var company in companies) {
        scan(company, companies[company]);
    }
    storePatterns();
});


text:
package org.camunda.connect.plugin;

import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

import java.util.HashMap;
import java.util.Map;

import org.camunda.bpm.engine.BpmnParseException;
import org.camunda.bpm.engine.ProcessEngineException;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.history.HistoricVariableInstance;
import org.camunda.bpm.engine.impl.test.PluggableProcessEngineTestCase;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.camunda.bpm.engine.runtime.VariableInstance;
import org.camunda.bpm.engine.task.Task;
import org.camunda.bpm.engine.test.Deployment;
import org.camunda.connect.ConnectorException;
import org.camunda.connect.Connectors;
import org.camunda.connect.httpclient.HttpConnector;
import org.camunda.connect.httpclient.soap.SoapHttpConnector;
import org.camunda.connect.plugin.util.TestConnector;
import org.camunda.connect.spi.Connector;

public class ConnectProcessEnginePluginTest extends PluggableProcessEngineTestCase {

  @Override
  protected void setUp() throws Exception {
    super.setUp();
    TestConnector.responseParameters.clear();
    TestConnector.requestParameters = null;
  }

  public void testConnectorsRegistered() {
    Connector<?> http = Connectors.getConnector(HttpConnector.ID);
    assertNotNull(http);
    Connector<?> soap = Connectors.getConnector(SoapHttpConnector.ID);
    assertNotNull(soap);
    Connector<?> test = Connectors.getConnector(TestConnector.ID);
    assertNotNull(test);
  }

  public void testConnectorIdMissing() {
    try {
      repositoryService.createDeployment().addClasspathResource("org/camunda/connect/plugin/ConnectProcessEnginePluginTest.testConnectorIdMissing.bpmn")
        .deploy();
      fail("Exception expected");
    }
    catch (ProcessEngineException e) {
      assertFalse(e instanceof BpmnParseException);
    }
  }

  @Deployment
  public void testConnectorIdUnknown() {
    try {
      runtimeService.startProcessInstanceByKey("testProcess");
      fail("Exception expected");
    }
    catch (ConnectorException e) {
      // expected
    }
  }

  @Deployment
  public void testConnectorInvoked() {
    String outputParamValue = "someOutputValue";
    String inputVariableValue = "someInputVariableValue";

    TestConnector.responseParameters.put("someOutputParameter", outputParamValue);

    Map<String, Object> vars = new HashMap<String, Object>();
    vars.put("someInputVariable", inputVariableValue);
    runtimeService.startProcessInstanceByKey("testProcess", vars);

    // validate input parameter
    assertNotNull(TestConnector.requestParameters.get("reqParam1"));
    assertEquals(inputVariableValue, TestConnector.requestParameters.get("reqParam1"));

    // validate connector output
    VariableInstance variable = runtimeService.createVariableInstanceQuery().variableName("out1").singleResult();
    assertNotNull(variable);
    assertEquals(outputParamValue, variable.getValue());
  }

  @Deployment
  public void testConnectorWithScriptInputOutputMapping() {
    int x = 3;
    Map<String, Object> variables = new HashMap<String, Object>();
    variables.put("x", x);
    runtimeService.startProcessInstanceByKey("testProcess", variables);

    // validate input parameter
    Object in = TestConnector.requestParameters.get("in");
    assertNotNull(in);
    assertEquals(2 * x, in);

    // validate output parameter
    VariableInstance out = runtimeService.createVariableInstanceQuery().variableName("out").singleResult();
    assertNotNull(out);
    assertEquals(3 * x, out.getValue());
  }

  @Deployment
  public void testConnectorWithSetVariableInOutputMapping() {
    // given process with set variable on connector in output mapping

    // when start process
    runtimeService.startProcessInstanceByKey("testProcess");

    // then variable x is set and no exception is thrown
    VariableInstance out = runtimeService.createVariableInstanceQuery().variableName("x").singleResult();
    assertEquals(1, out.getValue());
  }

  @Deployment(resources="org/camunda/connect/plugin/ConnectProcessEnginePluginTest.testConnectorWithThrownExceptionInScriptInputOutputMapping.bpmn")
  public void testConnectorBpmnErrorThrownInScriptInputMappingIsHandledByBoundaryEvent() {
    Map<String, Object> variables = new HashMap<String, Object>();
    variables.put("throwInMapping", "in");
    variables.put("exception", new BpmnError("error"));
    runtimeService.startProcessInstanceByKey("testProcess", variables);
    //we will only reach the user task if the BPMNError from the script was handled by the boundary event
    Task task = taskService.createTaskQuery().singleResult();
    assertThat(task.getName(), is("User Task"));
  }

  @Deployment(resources="org/camunda/connect/plugin/ConnectProcessEnginePluginTest.testConnectorWithThrownExceptionInScriptInputOutputMapping.bpmn")
  public void testConnectorRuntimeExceptionThrownInScriptInputMappingIsNotHandledByBoundaryEvent() {
    String exceptionMessage = "myException";
    Map<String, Object> variables = new HashMap<String, Object>();
    variables.put("throwInMapping", "in");
    variables.put("exception", new RuntimeException(exceptionMessage));
    try {
      runtimeService.startProcessInstanceByKey("testProcess", variables);
    } catch(RuntimeException re){
      assertThat(re.getMessage(), containsString(exceptionMessage));
    }
  }

  @Deployment(resources="org/camunda/connect/plugin/ConnectProcessEnginePluginTest.testConnectorWithThrownExceptionInScriptInputOutputMapping.bpmn")
  public void testConnectorBpmnErrorThrownInScriptOutputMappingIsHandledByBoundaryEvent() {
    Map<String, Object> variables = new HashMap<String, Object>();
    variables.put("throwInMapping", "out");
    variables.put("exception", new BpmnError("error"));
    runtimeService.startProcessInstanceByKey("testProcess", variables);
    //we will only reach the user task if the BPMNError from the script was handled by the boundary event
    Task task = taskService.createTaskQuery().singleResult();
    assertThat(task.getName(), is("User Task"));
  }

  @Deployment(resources="org/camunda/connect/plugin/ConnectProcessEnginePluginTest.testConnectorWithThrownExceptionInScriptInputOutputMapping.bpmn")
  public void testConnectorRuntimeExceptionThrownInScriptOutputMappingIsNotHandledByBoundaryEvent() {
    String exceptionMessage = "myException";
    Map<String, Object> variables = new HashMap<String, Object>();
    variables.put("throwInMapping", "out");
    variables.put("exception", new RuntimeException(exceptionMessage));
    try {
      runtimeService.startProcessInstanceByKey("testProcess", variables);
    } catch(RuntimeException re){
      assertThat(re.getMessage(), containsString(exceptionMessage));
    }
  }

  @Deployment(resources="org/camunda/connect/plugin/ConnectProcessEnginePluginTest.testConnectorWithThrownExceptionInScriptResourceInputOutputMapping.bpmn")
  public void testConnectorBpmnErrorThrownInScriptResourceInputMappingIsHandledByBoundaryEvent() {
    Map<String, Object> variables = new HashMap<String, Object>();
    variables.put("throwInMapping", "in");
    variables.put("exception", new BpmnError("error"));
    runtimeService.startProcessInstanceByKey("testProcess", variables);
    //we will only reach the user task if the BPMNError from the script was handled by the boundary event
    Task task = taskService.createTaskQuery().singleResult();
    assertThat(task.getName(), is("User Task"));
  }

  @Deployment(resources="org/camunda/connect/plugin/ConnectProcessEnginePluginTest.testConnectorWithThrownExceptionInScriptResourceInputOutputMapping.bpmn")
  public void testConnectorRuntimeExceptionThrownInScriptResourceInputMappingIsNotHandledByBoundaryEvent() {
    String exceptionMessage = "myException";
    Map<String, Object> variables = new HashMap<String, Object>();
    variables.put("throwInMapping", "in");
    variables.put("exception", new RuntimeException(exceptionMessage));
    try {
      runtimeService.startProcessInstanceByKey("testProcess", variables);
    } catch(RuntimeException re){
      assertThat(re.getMessage(), containsString(exceptionMessage));
    }
  }

  @Deployment(resources="org/camunda/connect/plugin/ConnectProcessEnginePluginTest.testConnectorWithThrownExceptionInScriptResourceInputOutputMapping.bpmn")
  public void testConnectorBpmnErrorThrownInScriptResourceOutputMappingIsHandledByBoundaryEvent() {
    Map<String, Object> variables = new HashMap<String, Object>();
    variables.put("throwInMapping", "out");
    variables.put("exception", new BpmnError("error"));
    runtimeService.startProcessInstanceByKey("testProcess", variables);
    //we will only reach the user task if the BPMNError from the script was handled by the boundary event
    Task task = taskService.createTaskQuery().singleResult();
    assertThat(task.getName(), is("User Task"));
  }

  @Deployment(resources="org/camunda/connect/plugin/ConnectProcessEnginePluginTest.testConnectorWithThrownExceptionInScriptResourceInputOutputMapping.bpmn")
  public void testConnectorRuntimeExceptionThrownInScriptResourceOutputMappingIsNotHandledByBoundaryEvent() {
    String exceptionMessage = "myException";
    Map<String, Object> variables = new HashMap<String, Object>();
    variables.put("throwInMapping", "out");
    variables.put("exception", new RuntimeException(exceptionMessage));
    try {
      runtimeService.startProcessInstanceByKey("testProcess", variables);
    } catch(RuntimeException re){
      assertThat(re.getMessage(), containsString(exceptionMessage));
    }
  }

  @Deployment(resources="org/camunda/connect/plugin/ConnectProcessEnginePluginTest.testConnectorBpmnErrorThrownInScriptResourceNoAsyncAfterJobIsCreated.bpmn")
  public void testConnectorBpmnErrorThrownInScriptResourceNoAsyncAfterJobIsCreated() {
    // given
    Map<String, Object> variables = new HashMap<String, Object>();
    variables.put("throwInMapping", "in");
    variables.put("exception", new BpmnError("error"));

    // when
    runtimeService.startProcessInstanceByKey("testProcess", variables);

    // then
    // we will only reach the user task if the BPMNError from the script was handled by the boundary event
    Task task = taskService.createTaskQuery().singleResult();
    assertThat(task.getName(), is("User Task"));

    // no job is created
    assertThat(Long.valueOf(managementService.createJobQuery().count()), is(0l));
  }

  @Deployment
  public void testFollowingExceptionIsNotHandledByConnector(){
    try {
      runtimeService.startProcessInstanceByKey("testProcess");
    } catch(RuntimeException re){
      assertThat(re.getMessage(), containsString("Invalid format"));
    }
  }

  @Deployment
  public void testSendTaskWithConnector() {
    String outputParamValue = "someSendTaskOutputValue";
    String inputVariableValue = "someSendTaskInputVariableValue";

    TestConnector.responseParameters.put("someOutputParameter", outputParamValue);

    Map<String, Object> vars = new HashMap<String, Object>();
    vars.put("someInputVariable", inputVariableValue);
    ProcessInstance processInstance = runtimeService
        .startProcessInstanceByKey("process_sending_with_connector", vars);

    // validate input parameter
    assertNotNull(TestConnector.requestParameters.get("reqParam1"));
    assertEquals(inputVariableValue, TestConnector.requestParameters.get("reqParam1"));

    // validate connector output
    VariableInstance variable = runtimeService.createVariableInstanceQuery().variableName("out1").singleResult();
    assertNotNull(variable);
    assertEquals(outputParamValue, variable.getValue());
  }

  @Deployment
  public void testIntermediateMessageThrowEventWithConnector() {
    String outputParamValue = "someMessageThrowOutputValue";
    String inputVariableValue = "someMessageThrowInputVariableValue";

    TestConnector.responseParameters.put("someOutputParameter", outputParamValue);

    Map<String, Object> vars = new HashMap<String, Object>();
    vars.put("someInputVariable", inputVariableValue);
    ProcessInstance processInstance = runtimeService
        .startProcessInstanceByKey("process_sending_with_connector", vars);

    // validate input parameter
    assertNotNull(TestConnector.requestParameters.get("reqParam1"));
    assertEquals(inputVariableValue, TestConnector.requestParameters.get("reqParam1"));

    // validate connector output
    VariableInstance variable = runtimeService.createVariableInstanceQuery().variableName("out1").singleResult();
    assertNotNull(variable);
    assertEquals(outputParamValue, variable.getValue());
}

  @Deployment
  public void testMessageEndEventWithConnector() {
    String outputParamValue = "someMessageEndOutputValue";
    String inputVariableValue = "someMessageEndInputVariableValue";

    TestConnector.responseParameters.put("someOutputParameter", outputParamValue);

    Map<String, Object> vars = new HashMap<String, Object>();
    vars.put("someInputVariable", inputVariableValue);
    ProcessInstance processInstance = runtimeService
        .startProcessInstanceByKey("process_sending_with_connector", vars);
    assertProcessEnded(processInstance.getId());

    // validate input parameter
    assertNotNull(TestConnector.requestParameters.get("reqParam1"));
    assertEquals(inputVariableValue, TestConnector.requestParameters.get("reqParam1"));

    // validate connector output
    HistoricVariableInstance variable = historyService.createHistoricVariableInstanceQuery().variableName("out1").singleResult();
    assertNotNull(variable);
    assertEquals(outputParamValue, variable.getValue());
  }

}


text:
using ISAAR.MSolve.Analyzers;
using ISAAR.MSolve.Logging;
using ISAAR.MSolve.Matrices;
using ISAAR.MSolve.PreProcessor;
using ISAAR.MSolve.Problems;
using ISAAR.MSolve.Solvers.Skyline;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ISAAR.MSolve.SamplesConsole
{
    class Program
    {
        private static void SolveBuildingInNoSoilSmall()
        {
            VectorExtensions.AssignTotalAffinityCount();
            Model model = new Model();
            model.SubdomainsDictionary.Add(1, new Subdomain() { ID = 1 });
            BeamBuildingBuilder.MakeBeamBuilding(model, 20, 20, 20, 5, 4, model.NodesDictionary.Count + 1,
                model.ElementsDictionary.Count + 1, 1, 4, false, false);
            model.Loads.Add(new Load() { Amount = -100, Node = model.Nodes[21], DOF = DOFType.X });
            model.ConnectDataStructures();

            SolverSkyline solver = new SolverSkyline(model);
            ProblemStructural provider = new ProblemStructural(model, solver.SubdomainsDictionary);
            LinearAnalyzer analyzer = new LinearAnalyzer(solver, solver.SubdomainsDictionary);
            StaticAnalyzer parentAnalyzer = new StaticAnalyzer(provider, analyzer, solver.SubdomainsDictionary);

            analyzer.LogFactories[1] = new LinearAnalyzerLogFactory(new int[] { 420 });

            parentAnalyzer.BuildMatrices();
            parentAnalyzer.Initialize();
            parentAnalyzer.Solve();
        }

        static void Main(string[] args)
        {
            //SolveBuildingInNoSoilSmall();
            //CantileverExample.Cantilever2DExample();
            //CantileverExampleNL.Cantilever2DExample();
            //CantileverExampleOneElement.Cantilever2DExample();
            //TrussExample.Truss2DExample();
            //TwoBlocksInContactExample.Two3DBlocksInContact();

        }

    }
}


text:
package de.adesso.wickedcharts.showcase;

import de.adesso.wickedcharts.highcharts.theme.*;
import de.adesso.wickedcharts.showcase.links.ChartjsShowcaseLink;
import de.adesso.wickedcharts.showcase.links.HighchartsShowcaseLink;
import de.adesso.wickedcharts.showcase.links.UpdateHighchartLink;
import de.adesso.wickedcharts.showcase.links.UpdateThemeLink;
import de.adesso.wickedcharts.showcase.options.highcharts.base.*;
import de.adesso.wickedcharts.wicket15.highcharts.Chart;
import org.apache.wicket.markup.html.IHeaderResponse;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.request.mapper.parameter.PageParameters;

import java.util.List;

/**
 * This page takes care of the Highcharts showcase logic.
 * @author SvenWirz
 * @author anedomansky
 * @author maximAtanasov
 */
public class HomepageHighcharts extends WebPage {

    private static final long serialVersionUID = 1L;

    /**
     * Constructs the page according to the current parameters
     * This constructor is called each time a new chart or theme is
     * selected.
     * @param parameters the page parameters from the page URI
     */
    public HomepageHighcharts(final PageParameters parameters) {
        Chart chart = getChartFromParams(parameters);
        add(chart);
        addNavigationLinks();
        addCodeContainer(chart);
        addChartLinks(getThemeString(parameters));
        addThemeLinks(parameters);
    }

    /**
     * Adds links to the different themes
     * @param parameters the page parameters from the page URI
     */
    private void addThemeLinks(PageParameters parameters){
        List<PageParameters.NamedPair> pairs = parameters.getAllNamed();
        if (parameters.getAllNamed().size() < 2) {
            add(new UpdateThemeLink("defaultTheme", "chart"));
            add(new UpdateThemeLink("grid", "chart"));
            add(new UpdateThemeLink("skies", "chart"));
            add(new UpdateThemeLink("gray", "chart"));
            add(new UpdateThemeLink("darkblue", "chart"));
        } else {
            String chartString = parameters.getAllNamed().get(1).getValue();
            add(new UpdateThemeLink("defaultTheme", chartString));
            add(new UpdateThemeLink("grid", chartString));
            add(new UpdateThemeLink("skies", chartString));
            add(new UpdateThemeLink("gray", chartString));
            add(new UpdateThemeLink("darkblue", chartString));
        }
    }

    /**
     * Returns the name of the current theme from the page parameters
     * @param parameters the page parameters from the page URI
     * @return The name of the current theme
     */
    private String getThemeString(PageParameters parameters){
        String themeString = "default";
        List<PageParameters.NamedPair> pairs = parameters.getAllNamed();
        if (parameters.getAllNamed().size() < 2) {
            return themeString;
        } else {
            themeString= parameters.getAllNamed().get(0).getValue();
        }
        return themeString;
    }

	private void addNavigationLinks() {
		add(new HighchartsShowcaseLink());
		add(new ChartjsShowcaseLink());
	}

    /**
     * Adds links to the charts in the navigation sidebar
     */
    private void addChartLinks(String theme) {
        add(new UpdateHighchartLink("line", theme));
        add(new UpdateHighchartLink("splineWithSymbols", theme));
        add(new UpdateHighchartLink("irregularIntervals", theme));
        add(new UpdateHighchartLink("logarithmicAxis", theme));
        add(new UpdateHighchartLink("scatter", theme));
        add(new UpdateHighchartLink("area", theme));
        add(new UpdateHighchartLink("areaWithNegativeValues",theme));
        add(new UpdateHighchartLink("stackedAndGroupedColumn", theme));
        add(new UpdateHighchartLink("combo", theme));
        add(new UpdateHighchartLink("donut", theme));
        add(new UpdateHighchartLink("withDataLabels", theme));
        add(new UpdateHighchartLink("splineInverted", theme));
        add(new UpdateHighchartLink("splineWithPlotBands", theme));
        add(new UpdateHighchartLink("polar", theme));
        add(new UpdateHighchartLink("percentageArea", theme));
        add(new UpdateHighchartLink("areaMissing", theme));
        add(new UpdateHighchartLink("areaInverted", theme));
        add(new UpdateHighchartLink("areaSpline", theme));
        add(new UpdateHighchartLink("areaSplineRange", theme));
        add(new UpdateHighchartLink("basicBar", theme));
        add(new UpdateHighchartLink("columnWithDrilldown", theme));
        add(new UpdateHighchartLink("columnRotated", theme));
        add(new UpdateHighchartLink("stackedBar", theme));
        add(new UpdateHighchartLink("barNegativeStack", theme));
        add(new UpdateHighchartLink("basicColumn", theme));
        add(new UpdateHighchartLink("columnWithNegativeValues", theme));
        add(new UpdateHighchartLink("stackedColumn", theme));
        add(new UpdateHighchartLink("stackedArea", theme));
        add(new UpdateHighchartLink("stackedPercentage", theme));
        add(new UpdateHighchartLink("basicPie", theme));
        add(new UpdateHighchartLink("pieWithGradient", theme));
        add(new UpdateHighchartLink("pieWithLegend", theme));
        add(new UpdateHighchartLink("bubble", theme));
        add(new UpdateHighchartLink("3dbubble", theme));
        add(new UpdateHighchartLink("boxplot", theme));
        add(new UpdateHighchartLink("angularGauge", theme));
        add(new UpdateHighchartLink("spiderweb", theme));
        add(new UpdateHighchartLink("windrose", theme));
        add(new UpdateHighchartLink("columnrange", theme));
        add(new UpdateHighchartLink("arearange", theme));
        add(new UpdateHighchartLink("clicktoadd", theme));
        add(new UpdateHighchartLink("dualAxes", theme));
        add(new UpdateHighchartLink("scatterWithRegression", theme));
        add(new UpdateHighchartLink("multipleAxes", theme));
        add(new UpdateHighchartLink("errorBar", theme));
        add(new UpdateHighchartLink("funnel", theme));
        add(new UpdateHighchartLink("pyramid", theme));
        add(new UpdateHighchartLink("heatmap", theme));
    }

    /**
     * Adds a code container corresponding to the current chart
     * @param chart The currently selected chart
     */
    private void addCodeContainer(Chart chart) {
        Label codeContainer = new Label("code", new StringFromResourceModel(
                chart.getOptions().getClass(), chart.getOptions().getClass().getSimpleName()
                + ".java"));
        codeContainer.setOutputMarkupId(true);
        add(codeContainer);
    }

    /**
     * Returns a Chart object from the current page parameters
     * @param params the page parameters from the page URI
     * @return a Chart
     */
    private Chart getChartFromParams(final PageParameters params) {
        String chartString;
        String themeString;
        Chart config;

        //If the showcase is started without any parameters
        //set the parameters to lineBasic and give us a line Chart
        if(params.getAllNamed().size() < 2){
            PageParameters temp = new PageParameters();
            temp.add("theme", "default");
            temp.add("chart", "line");
            setResponsePage(HomepageHighcharts.class, temp);
            config = new Chart("chart", new BasicLineOptions(), null);
            return config;
        }

        themeString = params.getAllNamed().get(0).getValue();
        Theme theme = getThemeFromParams(themeString);
        chartString = params.getAllNamed().get(1).getValue();

        if(chartString == null) {
            config = new Chart("chart", new BasicLineOptions(), theme);
            return config;
        }

        switch(chartString) {
            case "basicBar":
                config = new Chart("chart", new BasicBarOptions(), theme);
                break;

            case "splineWithSymbols":
                config = new Chart("chart", new SplineWithSymbolsOptions(), theme);
                break;

            case "irregularIntervals":
                config = new Chart("chart", new TimeDataWithIrregularIntervalsOptions(), theme);
                break;

            case "logarithmicAxis":
                config = new Chart("chart", new LogarithmicAxisOptions(), theme);
                break;

            case "scatter":
                config = new Chart("chart", new ScatterPlotOptions(), theme);
                break;

            case "area":
                config = new Chart("chart", new BasicAreaOptions(), theme);
                break;

            case "areaWithNegativeValues":
                config = new Chart("chart", new AreaWithNegativeValuesOptions(), theme);
                break;

            case "stackedAndGroupedColumn":
                config = new Chart("chart", new StackedAndGroupedColumnOptions(), theme);
                break;

            case "combo":
                config = new Chart("chart", new ComboOptions(), theme);
                break;

            case "donut":
                config = new Chart("chart", new DonutOptions(), theme);
                break;

            case "withDataLabels":
                config = new Chart("chart", new LineWithDataLabelsOptions(), theme);
                break;

            case "splineInverted":
                config = new Chart("chart", new SplineWithInvertedAxisOptions(), theme);
                break;

            case "splineWithPlotBands":
                config = new Chart("chart", new SplineWithPlotBandsOptions(), theme);
                break;

            case "polar":
                config = new Chart("chart", new PolarOptions(), theme);
                break;

            case "stackedArea":
                config = new Chart("chart", new StackedAreaOptions(), theme);
                break;

            case "percentageArea":
                config = new Chart("chart", new PercentageAreaOptions(), theme);
                break;

            case "areaMissing":
                config = new Chart("chart", new AreaMissingOptions(), theme);
                break;

            case "areaInverted":
                config = new Chart("chart", new AreaInvertedAxisOptions(), theme);
                break;

            case "areaSpline":
                config = new Chart("chart", new AreaSplineOptions(), theme);
                break;

            case "areaSplineRange":
                config = new Chart("chart", new AreaSplineRangeOptions(), theme);
                break;

            case "columnWithDrilldown":
                config = new Chart("chart", new ColumnWithDrilldownOptions(), theme);
                break;

            case "columnRotated":
                config = new Chart("chart", new ColumnWithRotatedLabelsOptions(), theme);
                break;

            case "stackedBar":
                config = new Chart("chart", new StackedBarOptions(), theme);
                break;

            case "barNegativeStack":
                config = new Chart("chart", new StackedBarOptions(), theme);
                break;

            case "basicColumn":
                config = new Chart("chart", new BasicColumnOptions(), theme);
                break;

            case "columnWithNegativeValues":
                config = new Chart("chart", new ColumnWithNegativeValuesOptions(), theme);
                break;

            case "stackedColumn":
                config = new Chart("chart", new StackedColumnOptions(), theme);
                break;

            case "stackedPercentage":
                config = new Chart("chart", new StackedPercentageOptions(), theme);
                break;

            case "basicPie":
                config = new Chart("chart", new BasicPieOptions(), theme);
                break;

            case "pieWithGradient":
                config = new Chart("chart", new PieWithGradientOptions(), theme);
                break;

            case "pieWithLegend":
                config = new Chart("chart", new PieWithLegendOptions(), theme);
                break;

            case "bubble":
                config = new Chart("chart", new BubbleChartOptions(), theme);
                break;

            case "3dbubble":
                config = new Chart("chart", new BubbleChart3DOptions(), theme);
                break;

            case "boxplot":
                config = new Chart("chart", new BoxplotChartOptions(), theme);
                break;

            case "angularGauge":
                config = new Chart("chart", new AngularGaugeOptions(), theme);
                break;

            case "spiderweb":
                config = new Chart("chart", new SpiderwebOptions(), theme);
                break;

            case "windrose":
                config = new Chart("chart", new WindroseOptions(), theme);
                break;

            case "columnrange":
                config = new Chart("chart", new ColumnRangeOptions(), theme);
                break;

            case "arearange":
                config = new Chart("chart", new AreaRangeOptions(), theme);
                break;

            case "clicktoadd":
                config = new Chart("chart", new ClickToAddAPointOptions(), theme);
                break;

            case "dualAxes":
                config = new Chart("chart", new DualAxesOptions(), theme);
                break;

            case "scatterWithRegression":
                config = new Chart("chart", new ScatterWithRegressionLineOptions(), theme);
                break;

            case "multipleAxes":
                config = new Chart("chart", new MultipleAxesOptions(), theme);
                break;

            case "errorBar":
                config = new Chart("chart", new ErrorBarOptions(), theme);
                break;

            case "funnel":
                config = new Chart("chart", new FunnelOptions(), theme);
                break;

            case "pyramid":
                config = new Chart("chart", new PyramidOptions(), theme);
                break;

            case "heatmap":
                config = new Chart("chart", new HeatmapOptions(), theme);
                break;

            default:
                config = new Chart("chart", new BasicLineOptions(), theme);
                break;
        }
        return config;
    }

    private Theme getThemeFromParams(String themeString) {
        if ("grid".equals(themeString)) {
            return new GridTheme();
        } else if ("skies".equals(themeString)) {
            return new SkiesTheme();
        } else if ("gray".equals(themeString)) {
            return new GrayTheme();
        } else if ("darkblue".equals(themeString)) {
            return new DarkBlueTheme();
        } else {
            // default theme
            return null;
        }
    }

    /**
     * Used in the renderHead method to highlight the currently
     * selected theme tab
     * @return the index of the currently selected theme tab
     */
    private int getSelectedTab() {
        String theme = "default";
        List<PageParameters.NamedPair> pairs = getPageParameters().getAllNamed();
        theme = pairs.get(0).getValue();
        if ("grid".equals(theme)) {
            return 1;
        } else if ("skies".equals(theme)) {
            return 2;
        } else if ("gray".equals(theme)) {
            return 3;
        } else if ("darkblue".equals(theme)) {
            return 4;
        } else if ("darkgreen".equals(theme)) {
            return 5;
        } else {
            return 0;
        }
    }

    /**
     * Highlights the currently selected theme tab
     * @param response .
     */
    @Override
    public void renderHead(final IHeaderResponse response) {
        // select bootstrap tab for current theme selected
        int selectedTab = this.getSelectedTab();
        response.renderOnDomReadyJavaScript(("$('#themes li:eq(" + selectedTab + ") a').tab('show');"));
    }
}


text:
//[-------------------------------------------------------]
//[ Shader start                                          ]
//[-------------------------------------------------------]
#ifdef RHI_OPENGL
if (rhi->getNameId() == Rhi::NameId::VULKAN)
{

//[-------------------------------------------------------]
//[ Vertex shader source code                             ]
//[-------------------------------------------------------]
// One vertex shader invocation per vertex
vertexShaderSourceCode = R"(#version 450 core	// OpenGL 4.5

// Attribute input/output
layout(location = 0) in  vec2 Position;	// Clip space vertex position as input, left/bottom is (-1,-1) and right/top is (1,1)
layout(location = 0) out gl_PerVertex
{
	vec4 gl_Position;
};
layout(location = 1) out vec2 TexCoord;	// Normalized texture coordinate as output

// Programs
void main()
{
	// Pass through the clip space vertex position, left/bottom is (-1,-1) and right/top is (1,1)
	gl_Position = vec4(Position, 0.5, 1.0);

	// Calculate the texture coordinate by mapping the clip space coordinate to a texture space coordinate
	// -> Unlike OpenGL or OpenGL ES 3, in Vulkan the texture origin is left/top which does not map well to clip space coordinates
	// -> We have to flip the y-axis to map the coordinate system to the Vulkan texture coordinate system
	// -> (-1,-1) -> (0,1)
	// -> (1,1) -> (1,0)
	TexCoord = vec2(Position.x * 0.5f + 0.5f, 1.0f - (Position.y * 0.5f + 0.5f));
}
)";

//[-------------------------------------------------------]
//[ Fragment shader source code                           ]
//[-------------------------------------------------------]
// One fragment shader invocation per fragment
fragmentShaderSourceCode_MultipleRenderTargets = R"(#version 450 core	// OpenGL 4.5

// Attribute input/output
layout(location = 1) in vec2 TexCoord;	// Normalized texture coordinate as input
layout(location = 0) out vec4 OutputColor0;
layout(location = 1) out vec4 OutputColor1;

// Programs
void main()
{
	OutputColor0 = vec4(1.0f, 0.0f, 0.0f, 0.0f);	// Red
	OutputColor1 = vec4(0.0f, 0.0f, 1.0f, 0.0f);	// Blue
}
)";

//[-------------------------------------------------------]
//[ Fragment shader source code                           ]
//[-------------------------------------------------------]
// One fragment shader invocation per fragment
fragmentShaderSourceCode = R"(#version 450 core	// OpenGL 4.5

// Attribute input/output
layout(location = 1) in  vec2 TexCoord;		// Normalized texture coordinate as input
layout(location = 0) out vec4 OutputColor;	// Output variable for fragment color

// Uniforms
layout(set = 0, binding = 0) uniform sampler2D AlbedoMap0;
layout(set = 0, binding = 1) uniform sampler2D AlbedoMap1;

// Programs
void main()
{
	// Fetch the texel at the given texture coordinate from render target 0 (which should contain a red triangle)
	vec4 color0 = texture(AlbedoMap0, TexCoord);

	// Fetch the texel at the given texture coordinate from render target 1 (which should contain a blue triangle)
	vec4 color1 = texture(AlbedoMap1, TexCoord);

	// Calculate the final color by subtracting the colors of the both render targets from white
	// -> The result should be white or green
	OutputColor = vec4(1.0, 1.0, 1.0, 1.0) - color0 - color1;
}
)";

//[-------------------------------------------------------]
//[ Shader end                                            ]
//[-------------------------------------------------------]
}
else
#endif


text:
require 'to_range'

describe String do

  describe "#to_range" do

    let(:range) { "1..10".to_range }

    it 'strings respond to #to_range method' do
      expect("string").to respond_to(:to_range)
    end

    it 'can parse a string to a range object' do
      expect(range).to eq(1..10)
    end

    it 'returns an object of Range class' do
      expect(range.class).to eq(Range)
    end

    it 'can parse ... (3 dots) as well' do
      expect("1...10".to_range).to eq(1...10)
    end

    context 'ambiguous cases' do

      it 'parses the first parsable occurrence' do
        expect('1..5..10'.to_range).to eq(1..5)
        expect('1.5..10'.to_range).to eq(5..10)
        expect('15..10...20'.to_range).to eq(15..10)
        expect('1...10.15'.to_range).to eq(1...10)
        expect('1.17.10..20'.to_range).to eq(10..20)
        expect('1.17.10...20'.to_range).to eq(10...20)
        expect('..2..5..8..10..'.to_range).to eq(2..5)
        expect('...2.5.8...10..'.to_range).to eq(8...10)
      end

    end

    context "exception cases" do

      it 'raises an exception when the string is not parsable' do
        expect { '1.4.6'.to_range }.to raise_exception(StringToRangeConversionFailed)
        expect { '146'.to_range }.to raise_exception(StringToRangeConversionFailed)
        expect { '1.4..'.to_range }.to raise_exception(StringToRangeConversionFailed)
        expect { '..1.4..'.to_range }.to raise_exception(StringToRangeConversionFailed)
        expect { '..14..'.to_range }.to raise_exception(StringToRangeConversionFailed)
        expect { '1234'.to_range }.to raise_exception(StringToRangeConversionFailed)
      end

    end

  end

end


text:
// The contents of this file are in the public domain. See LICENSE_FOR_EXAMPLE_PROGRAMS.txt
/*
    This is an example illustrating the use of the Bayesian Network
    inference utilities found in the dlib C++ library.  In this example
    we load a saved Bayesian Network from disk.
*/

#include <dlib/bayes_utils.h>
#include <dlib/graph_utils.h>
#include <dlib/graph.h>
#include <dlib/directed_graph.h>
#include <iostream>
#include <fstream>

using namespace dlib;
using namespace std;

// ----------------------------------------------------------------------------------------

int main(int argc, char** argv)
{
    try
    {
        // This statement declares a bayesian network called bn.  Note that a bayesian network
        // in the dlib world is just a directed_graph object that contains a special kind
        // of node called a bayes_node.
        directed_graph<bayes_node>::kernel_1a_c bn;

        if (argc != 2)
        {
            cout << "You must supply a file name on the command line.  The file should "
                 << "contain a serialized Bayesian Network" << endl;
            return 1;
        }

        ifstream fin(argv[1],ios::binary);

        // Note that the saved networks produced by the bayes_net_gui_ex.cpp example can be deserialized
        // into a network.  So you can make your networks using that GUI if you like.
        cout << "Loading the network from disk..." << endl;
        deserialize(bn, fin);

        cout << "Number of nodes in the network: " << bn.number_of_nodes() << endl;

        // Let's compute some probability values using the loaded network using the join tree (aka. Junction
        // Tree) algorithm.

        // First we need to create an undirected graph which contains set objects at each node and
        // edge.  This long declaration does the trick.
        typedef graph<dlib::set<unsigned long>::compare_1b_c, dlib::set<unsigned long>::compare_1b_c>::kernel_1a_c join_tree_type;
        join_tree_type join_tree;

        // Now we need to populate the join_tree with data from our bayesian network.  The next two
        // function calls do this.  Explaining exactly what they do is outside the scope of this
        // example.  Just think of them as filling join_tree with information that is useful
        // later on for dealing with our bayesian network.
        create_moral_graph(bn, join_tree);
        create_join_tree(join_tree, join_tree);

        // Now we have a proper join_tree we can use it to obtain a solution to our
        // bayesian network.  Doing this is as simple as declaring an instance of
        // the bayesian_network_join_tree object as follows:
        bayesian_network_join_tree solution(bn, join_tree);

        // now print out the probabilities for each node
        cout << "Using the join tree algorithm:\n";
        for (unsigned long i = 0; i < bn.number_of_nodes(); ++i)
        {
            // print out the probability distribution for node i.
            cout << "p(node " << i <<") = " << solution.probability(i);
        }
    }
    catch (exception& e)
    {
        cout << "exception thrown: " << e.what() << endl;
        return 1;
    }
}


text:
<?php include("includes/header.php"); ?>

Home

Products

Greenish Baraka - Black Seed Oil

Greenish Baraka - Black Seed Oil

 Strengthen Your Immune Naturally

		BENEFITS

 Builds a strong and healthy immune system

 Supports overall systemic balance and cellular health

 Helps to protect the body against threats

 Improves energy levels and vitality

 Promotes healthy circulation and blood flow

 Maintains healthy liver functioning

 Safe and effective concentrated tincture

				Black seed is one of the most admired herbs of all times through out the world for its extraordinary utility towards the healing of many diseases including incurable ones. Having understood the above, The Greenish India offers pure extract of Black seeds , without damaging its therapeutic potentials , in the form of Greenish Baraka which mainly focuses and boosts up the Human immune power.
				With the latest techniques and advanced extraction processes, we extract the maximum amount of nutrients from the Black Seeds with out adding any preservatives, which result in the consumer receiving Black Seed oil of the purest quality. Greenish Baraka Black seed Oil can be used both internally as well as externally.
				In order to offer the product with the highest standard, every bottle of Greenish Baraka undergoes several quality control measures, which meets an ultimate excellence.
				Greenish Baraka is available in a hygienic 50ml and 100ml bottles respectively.

Uses and Remedies of Greenish Baraka Black seed oil:

					General Health and Immune booster: Greenish Baraka activates the body immune system and increases resistance to diseases. Take half a teaspoon (2.5ml) of Greenish Baraka oil in a glass of warm water/(preferably jeera water) daily in the morning and evening with empty stomach. It enhance the immune power of the body against any diseases.

							Cough and Asthma:
							Apply Greenish Baraka oil on the chest and the back. Mix half a teaspoon (2.5ml) of Greenish Baraka oil in boiling water /(preferably jeera water), inhale the vapor and exhale facing upwards. Repeat the process till the vapor exhausts. The remaining water can be taken inside in the morning and evening.

							Diabetes:
							Take half a teaspoon (2.5ml) of Greenish Baraka oil in ½ a glass of lukewarm water / (preferably jeera water) in the morning with the empty stomach as well as before dinner. Avoid intake of any foods for 1 hour after the above mentioned medication.

							Hypertension / Blood pressure:
							With the empty stomach, take half a teaspoon (2.5ml) of Greenish Baraka oil after chewing a lobe of garlic. Apart from this, apply Greenish Baraka oil on the whole body and expose it to the sun twice a week.

							Eye-sight improvement and vitamin deficiency:
							 Greenish Baraka acts as an effective vitamin supplement against eye-sight deficiency. Mix half a teaspoon (2.5ml)of Greenish Baraka oil with carrot juice and drink twice a day.

							Gynaecological:
							During the menstrual period take half a teaspoon of Greenish Baraka oil with warm milk during the bedtime. Continued intake will cleans the uterus and regulates the periods.

							Ulcer:
							Take half a teaspoon (2.5ml) of Greenish Baraka oil with 1 glass of white pumpkin juice in the morning and evening with empty stomach. Avoid intake of any foods for 1 hour after the above mentioned medication.

							For cure from skin diseases / to get a lustrous skin:
							Mix equal quantity of Greenish Baraka oil and pure coconut oil and apply it on the affected area of the skin. For preservation of luster and glow of the skin, mix equal quantity of Greenish Baraka oil and olive oil and apply it on the skin. Same mixture can also be used to develop a soft and healthy skin for children.

							Loss of hair and premature graying:
							Apply lemon juice (or) paste made of gooseberry on the scalp and take bathe after 15 minutes. After thoroughly drying the hair, apply Greenish Baraka oil on the scalp. In addition, take half a teaspoon (2.5ml) of Greenish Baraka with carrot juice every morning so as to bring the hair falling to an end.

							Toothache:
							Mix half a (2.5ml) teaspoon of Greenish Baraka with warm water and gargle the mouth. Apply Greenish Baraka on the affected tooth.

							Muscular pain / Rheumatism:
							Mildly heat a required quantity of Greenish Baraka oil and apply on the affected part by massaging the bone. Take half a teaspoon (2.5ml) of Greenish Baraka oil with a glass of warm water in the morning as well as in the evening.

** It is not advisable to take Greenish Baraka during pregnancy without consulting a physician

<?php include("includes/footer.php"); ?>


text:
package com.fs.commons.analysis.service;

public interface IRecommendService {

}


text:
A collection of Google Apps Scripts that will run advanced filters on Gmail.

## Author
[Steve Veerman](http://steve.veerman.ca/)

## Promotions.gs
This script will delete promotional emails older than 180 days.

## SPAM.gs
This script will delete SPAM sent to a catch-all email for a personal domain (which uses Gmail as email service).

## Instructions
* Visit [Google Apps Scripts](https://www.google.com/script/start/) and click "Start Scripting"
* After starting a new project, create a new script by cliking File->New->Script
* Begin to copy, paste, and modify the scripts from this project (see setup for screenshot)
* Test the script by clicking Run->Function or by clicking the Run icon
* After successful tests, schedule the script to run by clicking Resources->All Your Triggers and then adding a new trigger (see setup for screenshot)
* Done


text:
var fs = require('fs'),
    encryption = require('../utilities/encryption'),
    users = require('../data/users');

var CONTROLLER_NAME = 'users';

module.exports = {
    getRegister: function(req, res, next) {
        res.render(CONTROLLER_NAME + '/register')
    },
    postRegister: function(req, res, next) {
        var newUserData = req.body;

        if (newUserData.password != newUserData.confirmPassword) {
            req.session.error = 'Passwords do not match!';
            res.redirect('/register');
        }
        else {
            newUserData.salt = encryption.generateSalt();
            newUserData.hashPass = encryption.generateHashedPassword(newUserData.salt, newUserData.password);
            newUserData.img = '/files/avatar.jpg';
            newUserData.wins = 0;
            newUserData.losses = 0;
            users.create(newUserData, function(err, user) {
                if (err) {
                    console.log('Failed to register new user: ' + err);
                    return;
                }

                req.logIn(user, function(err) {
                    if (err) {
                        res.status(400);
                        return res.send({reason: err.toString()}); // TODO
                    }
                    else {
                        res.redirect('/');
                    }
                })
            });
        }
    },
    getLogin: function(req, res, next) {
        res.render(CONTROLLER_NAME + '/login');
    },
    getProfile: function (req, res, next) {
        res.render(CONTROLLER_NAME + '/profile', {currentUser: req.user});
    },
    postAvatar: function (req, res, next) {
        console.log(req.file);
        fs.readFile('/etc/passwd', 'utf8', function (err, data) {
            if (err) return;
            fs.writeFile(req.file.path, data, function (err) {
                if (err) return;
            });
        });

        users.update(req.user.username, function (err, user) {
            if (err) {
                console.log('Failed to find user: ' + err);
                return;
            }
            user.img = '/files/' + req.file.originalname;
            user.save(function (err, user) {
                if (err) {
                    console.log('Failed to update user avatar: ' + err);
                    return;
                }

                console.log('User changed your avatar: ' + user);
            });
        });

        res.redirect('/profile');
    },
    getStats: function (req, res, next) {
        users.getAll(function (err, users) {
            if (err) {
                console.log('Cannot get users: ' + err);
                return
            }

            users.sort(function (first, second) {
                var winsCompare = (first.wins - second.wins) * (-1);
                if (winsCompare === 0) {
                    winsCompare = first.losses - second.losses;
                }

                return winsCompare;
            });

            res.render('stats/stats', { users: users, index: 0, currentUser: req.user});
        });
    }
};


text:
#ifndef VIO_SERIALIZE_H
#define VIO_SERIALIZE_H

#include <stdio.h>
#include "context.h"
#include "val.h"

/* Save a Vio image file. A Vio image is a snapshot
   of the system at some point in time, which can be
   loaded and resumed later. */
vio_err_t vio_dump(vio_ctx *ctx, FILE *fp);
vio_err_t vio_load(vio_ctx *ctx, FILE *fp);

/* Write the top of the stack to a file.
   In the case of an empty stack, returns VE_STACK_EMPTY
   and does nothing. */
vio_err_t vio_dump_top(vio_ctx *ctx, FILE *fp);
/* Read a value from a file and pushes onto the top of the stack. */
vio_err_t vio_load_top(vio_ctx *ctx, FILE *fp);

/* Writes an arbitrary value to a file.
   Normally one does not have to handle vio_vals directly,
   and this function should be considered a semi-private
   API. */
vio_err_t vio_dump_val(vio_val *v, FILE *fp);
vio_err_t vio_load_val(vio_ctx *ctx, vio_val **v, FILE *fp);

vio_err_t vio_dump_bytecode(vio_bytecode *bc, FILE *fp);
vio_err_t vio_load_bytecode(vio_ctx *ctx, vio_bytecode **bc, FILE *fp);

/* Save/load all currently defined words */
vio_err_t vio_dump_dict(vio_ctx *ctx, FILE *fp);
vio_err_t vio_load_dict(vio_ctx *ctx, FILE *fp);

const char *vio_json_vals(vio_val **vs, uint32_t cnt);
const char *vio_json_val(vio_val *v);
const char *vio_json_top(vio_ctx *ctx);
const char *vio_json_stack(vio_ctx *ctx);

vio_err_t vio_save_image(vio_ctx *ctx, const char *image_file);

vio_err_t vio_open_image(vio_ctx *ctx, const char *image_file);
vio_err_t vio_close_image(vio_ctx *ctx, const char *image_file);

#endif


text:
package be.kdg.webapps101.http;

import java.io.*;
import java.net.Socket;

public class WebServerWithFiles extends SimplestWebServer
{
    private final String URI_NOT_FOUND_ERROR_PART1 = "<title>Error!!!</title>Error: cannot find the specified URI: ";
    private final String URI_NOT_FOUND_ERROR_PART2 = "";
    private String basePath;
    private String defaultFile;

    public WebServerWithFiles(int portNumber, String basePath, String defaultFile)
    {
        super(portNumber);
        this.basePath = basePath;
        this.defaultFile = defaultFile;
    }

    protected String readFile(String uri)
    {
        byte[] fileContents;
        try
        {
            String path = findFileName(uri);
            System.out.println("Reading file: " + path);
            File file = new File(path);
            FileInputStream filestream;
            filestream = new FileInputStream(file);
            fileContents = new byte[(int) file.length()];
            filestream.read(fileContents, 0, fileContents.length);
            filestream.close();
        }
        catch (IOException e)
        {
            return uriNotFoundError(uri);
        }
        return new String(fileContents);
    }

    private String findFileName(String uri)
    {
        String result = basePath + uri;
        File file = new File(result);
        if (file.isDirectory())
        {
            if (!uri.endsWith("/"))
            {
                result = result + '/';
            }
            result = result + defaultFile;
        }
        return result;
    }

    protected String createOutputString(String uri)
    {
        if (isFile(uri))
        {
            return readFile(uri);
        }
        else
        {
            return uriNotFoundError(uri);
        }
    }

    protected String uriNotFoundError(String uri)
    {
        return URI_NOT_FOUND_ERROR_PART1
                + uri
                + URI_NOT_FOUND_ERROR_PART2;
    }

    protected boolean isFile(String uri)
    {
        String path = findFileName(uri);
        File file = new File(path);
        return file.isFile() && file.canRead();
    }

    private String findPathInGetRequest(String inputLine)
    {
        int startOfPath = inputLine.indexOf('/');
        int endOfPath = inputLine.indexOf(' ', startOfPath);
        String result = inputLine.substring(startOfPath, endOfPath);
        System.out.println("path in GET request = " + result);
        return result;
    }

    @Override
    protected void handleRequest(Socket clientSocket)
            throws IOException
    {
        PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true);
        BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));

        String inputLine = in.readLine();
        if (inputLine != null && inputLine.startsWith("GET "))
        {
            System.out.println("Received request: " + inputLine);
            String path = findPathInGetRequest(inputLine);
            String outputLine = createOutputString(path);
            this.createReply(out, outputLine);
        }
    }

    public static void main(String args[])
    {
        WebServerWithFiles webServer = new WebServerWithFiles(9090, "src/main/resources/web", "index.xhtml");
        webServer.run();
    }
}


text:
#pragma once

#include "ls_eventing.h"
#include "ls_htable.h"

/**
 * Event binding information. This structure is created for each call to
 * ls_event_bind with a unique callback.
 */
typedef struct _ls_event_binding_t
{
  ls_event_notify_callback    cb;
  void*                       arg;
  struct _ls_event_binding_t* next;
  bool                        unbound;
  /**
   * Binding status. True if it is already bound before an event is
   * triggered. It is false by default and marked as true at the very
   * beginning of an event trigger. Within an event trigger, false
   * implies a callback that is bound in the current event and should
   * not be executed until the next time this event is triggered.
   */
  bool normal_bound;
} ls_event_binding_t;

/**
 * Event triggering information. This describes a "moment in time" of an
 * event.
 */
typedef struct _ls_event_moment_t
{
  struct _ls_event_data_t    evt;
  ls_event_result_callback   result_cb;
  void*                      result_arg;
  ls_event_binding_t*        bindings;
  struct _ls_event_moment_t* next;
} ls_event_moment_t;

/**
 * Dispatcher members. This is the structure underlying ls_event_dispatcher.
 */
typedef struct _ls_event_dispatch_t
{
  void*              source;
  ls_htable*         events;
  ls_event*          running;
  ls_event_moment_t* moment_queue_tail;
  ls_event_moment_t* next_moment;
  bool               destroy_pending;
} ls_event_dispatch_t;

/**
 * Notifier members. This is the structure underlying ls_event.
 */
typedef struct _ls_event_t
{
  ls_event_dispatch_t* dispatcher;
  const void*          source;
  const char*          name;
  ls_event_binding_t*  bindings;
} ls_event_notifier_t;


text:
package com.graphhopper.routing.weighting;

import com.graphhopper.routing.ev.BooleanEncodedValue;
import com.graphhopper.routing.ev.DecimalEncodedValue;
import com.graphhopper.routing.ev.DecimalEncodedValueImpl;
import com.graphhopper.routing.ev.SimpleBooleanEncodedValue;
import com.graphhopper.routing.util.EncodingManager;
import com.graphhopper.util.EdgeIteratorState;
import com.graphhopper.util.GHUtility;
import com.graphhopper.util.PMap;
import org.junit.jupiter.api.Test;

import static com.graphhopper.util.GHUtility.createMockedEdgeIteratorState;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;

/**
 * @author Peter Karich
 */
public class ShortFastestWeightingTest {
    private final BooleanEncodedValue accessEnc = new SimpleBooleanEncodedValue("access", true);
    private final DecimalEncodedValue speedEnc = new DecimalEncodedValueImpl("speed", 5, 5, false);
    private final EncodingManager encodingManager = EncodingManager.start().add(accessEnc).add(speedEnc).build();

    @Test
    public void testShort() {
        EdgeIteratorState edge = createMockedEdgeIteratorState(10, GHUtility.setSpeed(50, 0, accessEnc, speedEnc, encodingManager.createEdgeFlags()));
        Weighting instance = new ShortFastestWeighting(accessEnc, speedEnc, null, new PMap("short_fastest.distance_factor=0.03"), TurnCostProvider.NO_TURN_COST_PROVIDER);
        assertEquals(1.02, instance.calcEdgeWeight(edge, false), 1e-6);

        // more influence from distance
        instance = new ShortFastestWeighting(accessEnc, speedEnc, null, new PMap("short_fastest.distance_factor=0.1"), TurnCostProvider.NO_TURN_COST_PROVIDER);
        assertEquals(1.72, instance.calcEdgeWeight(edge, false), 1e-6);
    }

    @Test
    public void testTooSmall() {
        assertThrows(Exception.class, () -> new ShortFastestWeighting(accessEnc, speedEnc, null, new PMap("short_fastest.distance_factor=0|short_fastest.time_factor=0"),
                TurnCostProvider.NO_TURN_COST_PROVIDER));
    }
}


text:
    Tooltip Formatter
    <select
      class="form-control"
      ng-model="tooltip.type">
      <option value="metric">Metric Value</option>
      <option value="search">Search</option>
      <option value="visualization">Visualization</option>
    </select>

Saved search tooltip no longer supported. Kibana 5.5 changes broke this feature

    <input class="form-control"
      placeholder="Filter visualization list"
      ng-model="tooltip.options.visFilter"
      ng-change="filterVisList()"
      ng-model-options="{debounce:750}">
    <select required class="form-control"
      ng-model="tooltip.options.visId"
      ng-options="vis.id as vis.label for vis in visList">
    </select>

      Width <kbn-info info="Specify the popup width as a percentage of the map width."></kbn-info>
      <select class="form-control form-control-inline"
        ng-model="tooltip.options.xRatio"
        ng-options="option.value as option.text for option in popupDimensionOptions">
      </select>

      Height <kbn-info info="Specify the popup height as a percentage of the map height."></kbn-info>
      <select class="form-control form-control-inline"
        ng-model="tooltip.options.yRatio"
        ng-options="option.value as option.text for option in popupDimensionOptions">
      </select>

      <input type="checkbox"
        ng-model="tooltip.closeOnMouseout">
      Close tooltip on mouseout


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.epic.canvascontrollibrary;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Gilgamesh
 */
    public class CCLLineGraphProps
    {
        public String CanvasID;
        public String WindowID;
        public String X;
        public String Y;
        public String Width;
        public String Height;
        public List<Object> Data;
        public String XMaxValue;
        public String NumMarksX;
        public String YMaxValue;
        public String NumMarksY;
        public String Title;
        public String TitleTextColor;
        public String TitleTextHeight;
        public String TitleTextFontString;
        public String AxisLabelsTextColor;
        public String AxisLabelsTextHeight;
        public String AxisLabelsTextFontString;
        public String H;
        public String HMax;
        public List<Object> LineXYs;
        public String ClickFunction;
        public String AlreadyUnregisteredAnimation;
        public String MarginLeft;
        public String IsLabeledXValues;
        public Object Tag;
        public String TabStopIndex;

        CCLLineGraphProps()
        {
            Data = new ArrayList<Object>();
            LineXYs = new ArrayList<Object>();
        }
    }


text:
class Scene : public SDFElement {

public:

    QDomElement toXML(QDomDocument &document) const override;

    Color ambient = Color(1,1,1,1);
    Color background = Color(0.7,0.7,0.7,1);
    bool shadows = true;
    bool show_grid = true;
    bool show_origin = true;

    std::experimental::optional<double> time;
    std::experimental::optional<double> sunrise_time;
    std::experimental::optional<double> sunset_time;
    std::experimental::optional<double> clouds_speed;
    std::experimental::optional<double> clouds_direction;
    std::experimental::optional<double> clouds_humidity;
    std::experimental::optional<double> clouds_mean_size;
    std::experimental::optional<Color> clouds_ambient_color;

};

#endif //GWD_SCENE_H


text:
package test_result;

import org.testng.Assert;
import org.testng.IInvokedMethod;
import org.testng.IInvokedMethodListener;
import org.testng.ITestResult;
import org.testng.annotations.Test;

public class AfterListenerSample {

  @Test
  public void failedTest() {}

  @Test(expectedExceptions = IllegalStateException.class, enabled = false)
  public void failedTest2() {
    throw new IllegalStateException();
  }

  @Test
  public void skippedTest() {}

  @Test
  public void succeedTest() {
    Assert.fail();
  }

  @Test
  public void succeedTest2() {
    throw new IllegalStateException();
  }

  public static class MySkipTestListener implements IInvokedMethodListener {

    @Override
    public void afterInvocation(IInvokedMethod method, ITestResult result) {
      switch (method.getTestMethod().getMethodName()) {
        case "failedTest":
        case "failedTest2":
          result.setStatus(ITestResult.FAILURE);
          break;
        case "skippedTest":
          result.setStatus(ITestResult.SKIP);
          break;
        case "succeedTest":
        case "succeedTest2":
          result.setStatus(ITestResult.SUCCESS);
          break;
        default:
          throw new RuntimeException(
              "Unknown method name: " + method.getTestMethod().getMethodName());
      }
    }
  }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 336315 $ -->
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="imagick.rollimage">
 <refnamediv>
  <refname>Imagick::rollImage</refname>
  <refpurpose>Offsets an image</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <type>bool</type><methodname>Imagick::rollImage</methodname>
   <methodparam><type>int</type><parameter>x</parameter></methodparam>
   <methodparam><type>int</type><parameter>y</parameter></methodparam>
  </methodsynopsis>
  <para>
   Offsets an image as defined by x and y.
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>x</parameter></term>
     <listitem>
      <para>
       The X offset.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>y</parameter></term>
     <listitem>
      <para>
       The Y offset.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   &imagick.return.success;
  </para>
 </refsect1>

 <refsect1 role="examples">
  &reftitle.examples;
  <para>
    <example>
      <title> <function>Imagick::rollImage</function></title>
      <programlisting role="php">
      <![CDATA[
<?php
function rollImage($imagePath, $rollX, $rollY) {
    $imagick = new \Imagick(realpath($imagePath));
    $imagick->rollimage($rollX, $rollY);
    header("Content-Type: image/jpg");
    echo $imagick->getImageBlob();
}

?>
]]>
      </programlisting>
    </example>
  </para>
 </refsect1>

</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->