text:
package framework

import (
	"bytes"
	"fmt"
	"io/ioutil"
	"os"
	"os/exec"
	"path"
	"strings"
	"sync"
	"time"
)

const (
	// Default value for how long the CPU profile is gathered for.
	DefaultCPUProfileSeconds = 30
)

func getProfilesDirectoryPath() string {
	return path.Join(TestContext.ReportDir, "profiles")
}

func createProfilesDirectoryIfNeeded() error {
	profileDirPath := getProfilesDirectoryPath()
	if _, err := os.Stat(profileDirPath); os.IsNotExist(err) {
		if mkdirErr := os.Mkdir(profileDirPath, 0777); mkdirErr != nil {
			return fmt.Errorf("Failed to create profiles dir: %v", mkdirErr)
		}
	} else if err != nil {
		return fmt.Errorf("Failed to check existence of profiles dir: %v", err)
	}
	return nil
}

func checkProfileGatheringPrerequisites() error {
	if !TestContext.AllowGatheringProfiles {
		return fmt.Errorf("Can't gather profiles as --allow-gathering-profiles is false")
	}
	if TestContext.ReportDir == "" {
		return fmt.Errorf("Can't gather profiles as --report-dir is empty")
	}
	if err := createProfilesDirectoryIfNeeded(); err != nil {
		return fmt.Errorf("Failed to ensure profiles dir: %v", err)
	}
	return nil
}

func gatherProfileOfKind(profileBaseName, kind string) error {
	// Check some prerequisites before gathering the profile.
	if err := checkProfileGatheringPrerequisites(); err != nil {
		return err
	}
	// Get the profile data over SSH.
	getCommand := fmt.Sprintf("curl -s localhost:8080/debug/pprof/%s", kind)
	sshResult, err := SSH(getCommand, GetMasterHost()+":22", TestContext.Provider)
	if err != nil {
		return fmt.Errorf("Failed to execute curl command on master through SSH: %v", err)
	}
	// Write the data to a temp file.
	var tmpfile *os.File
	tmpfile, err = ioutil.TempFile("", "apiserver-profile")
	if err != nil {
		return fmt.Errorf("Failed to create temp file for profile data: %v", err)
	}
	defer os.Remove(tmpfile.Name())
	if _, err := tmpfile.Write([]byte(sshResult.Stdout)); err != nil {
		return fmt.Errorf("Failed to write temp file with profile data: %v", err)
	}
	if err := tmpfile.Close(); err != nil {
		return fmt.Errorf("Failed to close temp file: %v", err)
	}
	// Create a graph from the data and write it to a pdf file.
	var cmd *exec.Cmd
	var profilePrefix string
	switch {
	// TODO: Support other profile kinds if needed (e.g inuse_space, alloc_objects, mutex, etc)
	case kind == "heap":
		cmd = exec.Command("go", "tool", "pprof", "-pdf", "--alloc_space", tmpfile.Name())
		profilePrefix = "ApiserverMemoryProfile_"
	case strings.HasPrefix(kind, "profile"):
		cmd = exec.Command("go", "tool", "pprof", "-pdf", tmpfile.Name())
		profilePrefix = "ApiserverCPUProfile_"
	default:
		return fmt.Errorf("Unknown profile kind provided: %s", kind)
	}
	outfilePath := path.Join(getProfilesDirectoryPath(), profilePrefix+profileBaseName+".pdf")
	var outfile *os.File
	outfile, err = os.Create(outfilePath)
	if err != nil {
		return fmt.Errorf("Failed to create file for the profile graph: %v", err)
	}
	defer outfile.Close()
	cmd.Stdout = outfile
	stderr := bytes.NewBuffer(nil)
	cmd.Stderr = stderr
	if err := cmd.Run(); nil != err {
		return fmt.Errorf("Failed to run 'go tool pprof': %v, stderr: %#v", err, stderr.String())
	}
	return nil
}

// The below exposed functions can take a while to execute as they SSH to the master,
// collect and copy the profile over and then graph it. To allow waiting for these to
// finish before the parent goroutine itself finishes, we accept a sync.WaitGroup
// argument in these functions. Typically you would use the following pattern:
//
// func TestFooBar() {
//		var wg sync.WaitGroup
//		wg.Add(3)
//		go framework.GatherApiserverCPUProfile(&wg, "doing_foo")
//		go framework.GatherApiserverMemoryProfile(&wg, "doing_foo")
//		<<<< some code doing foo >>>>>>
//		go framework.GatherApiserverCPUProfile(&wg, "doing_bar")
//		<<<< some code doing bar >>>>>>
//		wg.Wait()
// }
//
// If you do not wish to exercise the waiting logic, pass a nil value for the
// waitgroup argument instead. However, then you would be responsible for ensuring
// that the function finishes.

func GatherApiserverCPUProfile(wg *sync.WaitGroup, profileBaseName string) {
	GatherApiserverCPUProfileForNSeconds(wg, profileBaseName, DefaultCPUProfileSeconds)
}

func GatherApiserverCPUProfileForNSeconds(wg *sync.WaitGroup, profileBaseName string, n int) {
	if wg != nil {
		defer wg.Done()
	}
	if profileBaseName == "" {
		profileBaseName = time.Now().Format(time.RFC3339)
	}
	if err := gatherProfileOfKind(profileBaseName, fmt.Sprintf("profile?seconds=%v", n)); err != nil {
		Logf("Failed to gather apiserver CPU profile: %v", err)
	}
}

func GatherApiserverMemoryProfile(wg *sync.WaitGroup, profileBaseName string) {
	if wg != nil {
		defer wg.Done()
	}
	if profileBaseName == "" {
		profileBaseName = time.Now().Format(time.RFC3339)
	}
	if err := gatherProfileOfKind(profileBaseName, "heap"); err != nil {
		Logf("Failed to gather apiserver memory profile: %v", err)
	}
}

// StartApiserverCPUProfileGatherer is a polling-based gatherer of the apiserver's
// CPU profile. It takes the delay b/w consecutive gatherings as an argument and
// starts the gathering goroutine. To stop the gatherer, close the returned channel.
func StartApiserverCPUProfileGatherer(delay time.Duration) chan struct{} {
	stopCh := make(chan struct{})
	go func() {
		for {
			select {
			case <-time.After(delay):
				GatherApiserverCPUProfile(nil, "")
			case <-stopCh:
				return
			}
		}
	}()
	return stopCh
}

redpajama_set_name: RedPajamaGithub


text:
package net.johnewart.gearman.server;

import io.netty.channel.Channel;
import net.johnewart.gearman.common.JobStatus;
import net.johnewart.gearman.common.interfaces.Client;
import net.johnewart.gearman.common.interfaces.Worker;
import net.johnewart.gearman.server.core.NetworkClient;
import net.johnewart.gearman.server.core.NetworkWorker;
import net.johnewart.gearman.server.core.QueuedJob;
import net.johnewart.gearman.server.factories.JobFactory;
import net.johnewart.gearman.server.persistence.MemoryQueue;
import net.johnewart.gearman.server.storage.JobManager;
import net.johnewart.gearman.server.storage.JobQueue;
import net.johnewart.gearman.common.Job;
import org.junit.Before;
import org.junit.Test;

import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.*;

public class JobManagerTest {
    private JobManager jobManager;
    private MemoryQueue memoryQueue;
    private NetworkWorker worker;

    public JobManagerTest()
    {
    }

    @Before
    public void initialize() {
        memoryQueue = new MemoryQueue();
        jobManager = new JobManager(memoryQueue);

        worker = new NetworkWorker(mock(Channel.class));
        worker.addAbility("reverseString");
        worker.addAbility("computeBigStuff");
    }

    @Test
    public void insertsJobsIntoJobStore() throws Exception {
        Job job = JobFactory.generateForegroundJob("reverseString");
        jobManager.storeJob(job);

        assertThat("There are no completed jobs",
                jobManager.getCompletedJobsCounter().count(),
                is(0L));

        assertThat("There is one pending job",
                jobManager.getPendingJobsCounter().count(),
                is(1L));

        assertThat("One job has been enqueued",
                jobManager.getQueuedJobsCounter().count(),
                is(1L));
    }

    @Test
    public void fetchesJobsFromStorage() throws Exception {

        Job job = JobFactory.generateForegroundJob("reverseString");
        jobManager.storeJob(job);

        Job nextJob = jobManager.nextJobForWorker(worker);
        byte[] result = {'r','e','s','u','l','t'};

        assertThat("The jobs are the same",
                job.equals(nextJob),
                is(true));

        assertThat("The job store is now empty",
                jobManager.getPendingJobsCounter().count(),
                is(0L));

        assertThat("There is one active job",
                jobManager.getActiveJobsCounter().count(),
                is(1L));

        assertThat("The job store has no complete jobs",
                jobManager.getCompletedJobsCounter().count(),
                is(0L));

        // Complete the job
        jobManager.workComplete(nextJob, result);

        assertThat("The job store has one complete job",
                jobManager.getCompletedJobsCounter().count(),
                is(1L));

    }

    @Test
    public void reQueuesBackgroundJobsWhenWorkersDisconnect() throws Exception {
        Job job = JobFactory.generateBackgroundJob("reverseString");
        jobManager.storeJob(job);

        jobManager.nextJobForWorker(worker);

        assertThat("Job queue has no jobs",
                jobManager.getJobQueue("reverseString").size(),
                is(0));

        // Simulate abort before completion
        jobManager.unregisterWorker(worker);

        assertThat("Job queue has one job",
                jobManager.getJobQueue("reverseString").size(),
                is(1));

        // Re-fetch the job, make sure it's the same one
        Job nextJob = jobManager.nextJobForWorker(worker);

        assertThat("The job was returned to the queue",
                nextJob.equals(job),
                is(true));
    }

    @Test
    public void reQueuesForegroundJobWhenClientConnected() throws Exception
    {
        Client mockClient = mock(NetworkClient.class);

        Job job = JobFactory.generateForegroundJob("reverseString");
        jobManager.storeJobForClient(job, mockClient);

        jobManager.nextJobForWorker(worker);

        assertThat("Job queue has no jobs",
                jobManager.getJobQueue("reverseString").size(),
                is(0));

        // Simulate abort before completion
        jobManager.unregisterWorker(worker);

        assertThat("Job queue has one job",
                jobManager.getJobQueue("reverseString").size(),
                is(1));

        // Re-fetch the job, make sure it's the same one
        Job nextJob = jobManager.nextJobForWorker(worker);

        assertThat("The job was returned to the queue",
                nextJob.equals(job),
                is(true));
    }

    @Test
    public void dropsForegroundJobWhenNoClientAttached() throws Exception
    {
        Job job = JobFactory.generateForegroundJob("reverseString");
        jobManager.storeJob(job);

        jobManager.nextJobForWorker(worker);

        assertThat("Job queue has no jobs",
                jobManager.getJobQueue("reverseString").size(),
                is(0));

        // Simulate abort before completion
        jobManager.unregisterWorker(worker);

        assertThat("Job queue has no jobs",
                jobManager.getJobQueue("reverseString").size(),
                is(0));

    }

    @Test
    public void wakesUpWorkerWhenJobComesIn() throws Exception
    {
        Job job = JobFactory.generateBackgroundJob("reverseString");
        Worker spyWorker = spy(worker);
        jobManager.registerWorkerAbility("reverseString", spyWorker);
        jobManager.sleepingWorker(spyWorker);
        jobManager.storeJob(job);
        verify(spyWorker).wakeUp();
    }

    @Test
    public void handlesExceptionsWhenWakingWorkers() throws Exception
    {
        Job job = JobFactory.generateBackgroundJob("reverseString");
        Worker mockWorker = mock(Worker.class);
        //when(mockWorker.wakeUp()).thenThrow(new Exception("Can't send that packet"));
        //jobManager.registerWorkerAbility("reverseString", spyWorker);
        //jobManager.sleepingWorker(spyWorker);
        //jobManager.storeJob(job);
        //verify(spyWorker).wakeUp();
    }

    @Test
    public void checksAndUpdatesJobStatus() throws Exception
    {
        Job job = JobFactory.generateBackgroundJob("reverseString");
        jobManager.storeJob(job);

        JobStatus jobStatus = jobManager.checkJobStatus(job.getJobHandle());

        assertThat("Job status denominator is 0",
                jobStatus.getDenominator(),
                is(0));

        assertThat("Job status numerator is 0",
                jobStatus.getNumerator(),
                is(0));

        assertThat("Job is not running",
                jobStatus.isRunning(),
                is(false));

        assertThat("Job status is unknown yet",
                jobStatus.isStatusKnown(),
                is(false));

        jobManager.nextJobForWorker(worker);

        jobStatus = jobManager.checkJobStatus(job.getJobHandle());

        assertThat("Job is running",
                jobStatus.isRunning(),
                is(true));

        assertThat("Job status is still not known",
                jobStatus.isStatusKnown(),
                is(false));

        jobManager.updateJobStatus(job.getJobHandle(), 5, 100);

        jobStatus = jobManager.checkJobStatus(job.getJobHandle());

        assertThat("Job status denominator is 100",
                jobStatus.getDenominator(),
                is(100));

        assertThat("Job status numerator is 5",
                jobStatus.getNumerator(),
                is(5));

        assertThat("Job is running",
                jobStatus.isRunning(),
                is(true));

        assertThat("Job status is known",
                jobStatus.isStatusKnown(),
                is(true));

    }

    @Test
    public void loadQueuedJobsFromPersistenceEngine() throws Exception
    {
        final String[] jobQueueNames = {
                "delayedJobs",
                "immediateJobs",
                "gearmanJobs"
        };
        final int jobsCount = 100;
        final Set<QueuedJob> allJobs = new HashSet<>();
        Job currentJob;
        for(String jobQueueName : jobQueueNames)
        {
            for(int i = 0; i < jobsCount; i++)
            {
                currentJob = JobFactory.generateBackgroundJob(jobQueueName);
                memoryQueue.write(currentJob);
                allJobs.add(new QueuedJob(currentJob));
            }
        }

        Set<QueuedJob> jobsInPersistentStorage = new HashSet(memoryQueue.readAll());

        assertThat("The jobs in the persistent engine match what was put in",
                allJobs.equals(jobsInPersistentStorage),
                is(true));

        assertThat("There were 300 jobs put in the storage engine",
                allJobs.size(),
                is(300));

        assertThat("There are 300 jobs read from the storage engine",
                jobsInPersistentStorage.size(),
                is(300));

        jobManager.loadAllJobs();

        Map<String, JobQueue> jobQueueMap = jobManager.getJobQueues();

        assertThat("There are three job queues in the storage",
                jobQueueMap.keySet().size(),
                is(3));

        for(String jobQueueName : jobQueueNames)
        {
            assertThat("The job queues contains a queue named '" + jobQueueName + "'",
                    jobQueueMap.containsKey(jobQueueName),
                    is(true));
        }

        assertThat("There are 300 jobs pending in the job store",
                jobManager.getPendingJobsCounter().count(),
                is(300L));
    }

    @Test
    public void coalescesResultsForMultipleClients() throws Exception {

        Client mockClientOne = mock(NetworkClient.class);
        Client mockClientTwo = mock(NetworkClient.class);

        Job jobOne = JobFactory.generateForegroundJob("reverseString");
        Job jobTwo = JobFactory.generateForegroundJob("reverseString");
        jobTwo.setUniqueID(jobOne.getUniqueID());

        jobManager.storeJobForClient(jobOne, mockClientOne);
        jobManager.storeJobForClient(jobTwo, mockClientTwo);

        assertThat("Job queue has one job because they had the same unique id",
                jobManager.getJobQueue("reverseString").size(),
                is(1));

        assertThat("There is 1 job pending in the job store",
                jobManager.getPendingJobsCounter().count(),
                is(1L));

        assertThat("There has been 1 job queued in the job store",
                jobManager.getQueuedJobsCounter().count(),
                is(1L));

        Job nextJob = jobManager.nextJobForWorker(worker);
        byte[] result = {'r','e','s','u','l','t'};

        assertThat("Job pulled out is equal to job #1",
                nextJob.equals(jobOne),
                is(true));

        // Complete the job
        jobManager.workComplete(nextJob, result);

        verify(mockClientOne).sendWorkResults(jobOne.getJobHandle(), result);
        verify(mockClientTwo).sendWorkResults(jobOne.getJobHandle(), result);
    }

    // TODO: Verify that it will coalesce results if a job is submitted while a worker is working on the same one

    @Test
    public void sendsWorkDataResultsToClients() throws Exception {

        Client mockClient = mock(NetworkClient.class);

        Job jobOne = JobFactory.generateForegroundJob("reverseString");

        jobManager.storeJobForClient(jobOne, mockClient);

        Job nextJob = jobManager.nextJobForWorker(worker);
        byte[] data = {'r','e','s','u','l','t'};

        // Send back some data
        jobManager.workData(nextJob, data);

        verify(mockClient).sendWorkData(jobOne.getJobHandle(), data);
    }

}


text:
"use strict";

const _serializer = _ros_msg_utils.Serialize;
const _arraySerializer = _serializer.Array;
const _deserializer = _ros_msg_utils.Deserialize;
const _arrayDeserializer = _deserializer.Array;
const _finder = _ros_msg_utils.Find;
const _getByteLength = _ros_msg_utils.getByteLength;

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

class Analog {
  constructor(initObj={}) {
    if (initObj === null) {
      // initObj === null is a special case for deserialization where we don't initialize fields
      this.pin = null;
      this.state = null;
    }
    else {
      if (initObj.hasOwnProperty('pin')) {
        this.pin = initObj.pin
      }
      else {
        this.pin = 0;
      }
      if (initObj.hasOwnProperty('state')) {
        this.state = initObj.state
      }
      else {
        this.state = 0.0;
      }
    }
  }

  static serialize(obj, buffer, bufferOffset) {
    // Serializes a message object of type Analog
    // Serialize message field [pin]
    bufferOffset = _serializer.uint8(obj.pin, buffer, bufferOffset);
    // Serialize message field [state]
    bufferOffset = _serializer.float32(obj.state, buffer, bufferOffset);
    return bufferOffset;
  }

  static deserialize(buffer, bufferOffset=[0]) {
    //deserializes a message object of type Analog
    let len;
    let data = new Analog(null);
    // Deserialize message field [pin]
    data.pin = _deserializer.uint8(buffer, bufferOffset);
    // Deserialize message field [state]
    data.state = _deserializer.float32(buffer, bufferOffset);
    return data;
  }

  static getMessageSize(object) {
    return 5;
  }

  static datatype() {
    // Returns string type for a message object
    return 'ur_msgs/Analog';
  }

  static md5sum() {
    //Returns md5sum for a message object
    return '341541c8828d055b6dcc443d40207a7d';
  }

  static messageDefinition() {
    // Returns full string definition for message
    return `
    uint8 pin
    float32 state

    `;
  }

  static Resolve(msg) {
    // deep-construct a valid message object instance of whatever was passed in
    if (typeof msg !== 'object' || msg === null) {
      msg = {};
    }
    const resolved = new Analog(null);
    if (msg.pin !== undefined) {
      resolved.pin = msg.pin;
    }
    else {
      resolved.pin = 0
    }

    if (msg.state !== undefined) {
      resolved.state = msg.state;
    }
    else {
      resolved.state = 0.0
    }

    return resolved;
    }
};

module.exports = Analog;


text:
from minio import Minio
from minio.sseconfig import Rule, SSEConfig

client = Minio(
    "play.min.io",
    access_key="Q3AM3UQ867SPQQA43P2F",
    secret_key="zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG",
)

client.set_bucket_encryption(
    "my-bucket", SSEConfig(Rule.new_sse_s3_rule()),
)


text:
package 'iptables'

service 'iptables' do
  action [:disable, :stop]
  supports status: true, start: true, stop: true, restart: true
  only_if { node['platform_family'] == 'rhel' }
end

# Necessary so that if iptables::disable is used and then later
# it is re-enabled without any rules changes, the templates will run the rebuilt script
directory '/etc/iptables.d' do
  action :delete
  recursive true
end


text:
title : "Cadrythm"
icone: "cadrythm.jpg"
order: 15

desc : "Un instrument de musique expérimental collaboratif"
headerimage: "cadrythm/header-fr.jpg"
displaydate: "Automne 2016"
context: "Université de Technologie de Compiègne"

projectcategories:
   - name : dev
   - name : ux
   - name : product

technologies:
   - arduino
   - processing
   - illustrator

---

Cadrythm est un instrument de musique où la musique dépend des interactions entre les joueurs.
Dans ce projet, je devais construire un prototype avec une expérience sensitive
originale, en utilisant la technologie électronique Arduino, autour du thème
de l'**attention conjointe**.

**Cadrythm** prend la forme d'un cadran avec lequel on peut interagir. Son bord
est tactile et détermine ainsi la position du doigt lorsque celui-ci
le touche

**Plusieurs cadrans** sont **connectés entre eux** et la position de chacun
est indiquée sur chaque cadran, avec un indicateur lumineux.
Ainsi les autres personnes sont conscientes de la position d'autrui

Le déplacement du doigt crée une mélodie sur le cadran. La mélodie est
influencée par plusieurs paramètres :

- La **vitesse** de déplacement module le rythme
- L'**emplacement** module la hauteur de la musique
- Enfin, les **interactions** entre les différents joueurs modifient la mélodie,
par exemple s'ils se suivent ou se croisent, celle-ci peut devenir plus piano ou tonitruante

## Prototypage
Pour tester cette idée, j'ai construit un **prototype** avec des composants
électroniques et une carte Arduino.
Pour simplifier l'interaction avec le matériel à ma disposition, la position
des autres cadrans est indiquée avec un petit indicateur en papier, dont la
position est contrôlée par un servo-moteur. La surface tactile est limitée à 12
touches capacitives.

Un cadran prototype, relié à une carte Arduino et un ordinateur.

Deux programmes ont été développés, le [code Arduino des cadran](https://github.com/TheoDel/cadrythm)
et le code Processing jouant la musique (le prototype nécessite donc
un ordinateur pour fonctionner)


text:
package uk.ac.ebi.quickgo.ontology.traversal.read;

import uk.ac.ebi.quickgo.ontology.model.OntologyRelationType;
import uk.ac.ebi.quickgo.ontology.model.OntologyRelationship;
import uk.ac.ebi.quickgo.ontology.traversal.OntologyGraph;

import java.util.ArrayList;
import java.util.List;
import org.junit.Before;
import org.junit.Test;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;

/**
 * Validate that the {@link OntologyGraphPopulator} populates an {@link OntologyGraph}.
 *
 * Created 20/05/16
 * @author Edd
 */
public class OntologyGraphPopulatorTest {
    private OntologyGraph ontologyGraph;
    private OntologyGraphPopulator ontologyGraphPopulator;

    @Before
    public void setUp() {
        ontologyGraph = new OntologyGraph();
        ontologyGraphPopulator = new OntologyGraphPopulator(ontologyGraph);
    }

    @Test
    public void graphIsPopulated() throws Exception {
        int max = 10;
        List<OntologyRelationship> tuples = createOntologyTuples(max);
        ontologyGraphPopulator.write(tuples);
        assertThat(ontologyGraph.getVertices().size(), is(equalTo(max * 2)));
    }

    private List<OntologyRelationship> createOntologyTuples(int max) {
        List<OntologyRelationship> tuples = new ArrayList<>();
        for (int i = 0; i < max; i++) {
            tuples.add(new OntologyRelationship(
                    "child" + i,
                    "parent" + i,
                    OntologyRelationType.CAPABLE_OF
            ));
        }
        return tuples;
    }
}


text:
/*
Purpose:
    This sample function demonstrates how to create/use lambda UDFs in python
2021-08-01: written by rjvgupta
*/
CREATE OR REPLACE EXTERNAL FUNCTION f_lower_python(varchar) RETURNS varchar IMMUTABLE
LAMBDA 'f-lower-python-varchar' IAM_ROLE ':RedshiftRole';


text:
vim.g.loaded_node_provider = 0
vim.g.loaded_perl_provider = 0
vim.g.loaded_python3_provider = 0
vim.g.loaded_python_provider = 0
vim.g.loaded_ruby_provider = 0

-- vim.g.mapleader = "<space>"
-- vim.g.maplocalleader = "<space>"

-- screen
vim.o.colorcolumn = "80"
vim.o.cursorline = true
vim.o.laststatus = 3
vim.o.number = true
vim.o.relativenumber = true
-- spaces
vim.o.expandtab = true
vim.o.shiftwidth = 2
vim.o.softtabstop = 2
vim.o.tabstop = 2
-- windows
vim.o.splitbelow = true
vim.o.splitright = true
-- search
vim.o.ignorecase = true
vim.o.smartcase = true

require("plugins")

local arrows = {
  ["<right>"] = "Use h instead",
  ["<down>"] = "Use j instead",
  ["<up>"] = "Use k instead",
  ["<left>"] = "Use l instead",
}

for arrow, message in pairs(arrows) do
  vim.keymap.set({ "n", "v" }, arrow, function()
    print(message)
  end, { desc = "Disable arrow" })
end


text:
module EventTimesHelper
end


text:
<!DOCTYPE html>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="msapplication-tap-highlight" content="no">
    <meta name="description" content="Materialize is a modern responsive CSS framework based on Material Design by Google. ">
    <title>Media - Materialize</title>

    <link rel="apple-touch-icon-precomposed" href="images/favicon/apple-touch-icon-152x152.png">
    <meta name="msapplication-TileColor" content="#FFFFFF">
    <meta name="msapplication-TileImage" content="images/favicon/mstile-144x144.png">
    <link rel="icon" href="images/favicon/favicon-32x32.png" sizes="32x32">

    <meta name="theme-color" content="#EE6E73">

    <link href="css/prism.css" rel="stylesheet">
    <link href="css/ghpages-materialize.css" type="text/css" rel="stylesheet" media="screen,projection">
    <link href="https://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

Media

menu

            <object id="front-page-logo" type="image/svg+xml" data="res/materialize.svg">Your browser does not support SVG</object>

            <input id="search" placeholder="Search">search

About

Getting Started

CSS

Color

Grid

Helpers

Media

Pulse

Sass

Shadow

Table

Transitions

Typography

Components

Badges

Buttons

Breadcrumbs

Cards

Collections

Footer

Icons

Navbar

Pagination

Preloader

JavaScript

Carousel

Collapsible

Dropdown

FeatureDiscovery

Media

Modals

Parallax

Pushpin

Scrollspy

Sidenav

Tabs

Toasts

Tooltips

Waves

Forms

Autocomplete

Checkboxes

Chips

Pickers

Radio Buttons

Range

Select

Switches

Text Inputs

Mobile

Showcase

Themes

Become a Patron

Media components include things that have to do with large media objects like Images, Video, Audio, etc.

Material Box

Material box is a material design implementation of the Lightbox plugin. When a user clicks on an image that can be enlarged, Material box centers the image and enlarges it in a smooth, non-jarring manner. To dismiss the image, the user can either click on the image again, scroll away, or press the ESC key.

Creating the above image with the effect is as simple as adding a materialboxed class to the image tag.

    <img class="materialboxed" width="650" src="images/sample-1.jpg">

Initialization

Materialbox is intialized automatically. However, if you add images dynamically, you will have to add this initialization code.

  var elem = document.querySelector('.materialboxed');
  var instance = new M.Materialbox(elem, options);

  // Or with jQuery

  $(document).ready(function(){
    $('.materialboxed').materialbox();
  });

Options

              Name
              Type
              Default
              Description

              inDuration
              Number
              275
              Transition in duration in milliseconds.

              outDuration
              Number
              200
              Transition out duration in milliseconds.

Methods

Because jQuery is no longer a dependency, all the methods are called on the plugin instance. You can get the plugin instance like this:

    var instance = M.Materialbox.getInstance(elem);

    /* jQuery Method Calls
      You can still use the old jQuery plugin method calls.
      But you won't be able to access instance properties.

      $('.materialboxed').materialbox('methodName');
      $('.materialboxed').materialbox('methodName', paramName);
    */

    .open();

Open materialbox

  instance.open();

    .close();

Close materialbox

  instance.close();

    .destroy();

Destroy plugin instance and teardown

  instance.destroy();

Properties

                Name
                Type
                Description

              el
              Element
              The DOM element the plugin was initialized with.

              options
              Object
              The options the instance was initialized with.

              overlayActive
              Boolean
              If the materialbox overlay is showing.

              doneAnimating
              Boolean
              If the carousel is no longer being animated.

              caption
              String
              Caption if specified.

              originalWidth
              Number
              Original width of image.

              originalHeight
              Number
              Original height of image.

Captions

It is very easy to add a short caption to your photo. Just add the caption as a data-caption attribute.

  <img class="materialboxed" data-caption="A picture of a way with a group of trees in a park" width="250" src="https://lorempixel.com/800/400/nature/4">

Slider

Our slider is a simple and elegant image carousel. You can also have captions that will be transitioned on their own depending on their alignment. You can also have indicators that show up on the bottom of the slider.

Note: This is also Hammer.js compatible! Try swiping with your finger to scroll through the slider.

This is our big Tagline!

Here's our small slogan.

Left Aligned Caption

Here's our small slogan.

Right Aligned Caption

Here's our small slogan.

This is our big Tagline!

Here's our small slogan.

  <div class="slider">
    <ul class="slides">
      <li>
        <img src="https://lorempixel.com/580/250/nature/1"> <!-- random image -->
        <div class="caption center-align">
          <h3>This is our big Tagline!</h3>
          <h5 class="light grey-text text-lighten-3">Here's our small slogan.</h5>
        </div>
      </li>
      <li>
        <img src="https://lorempixel.com/580/250/nature/2"> <!-- random image -->
        <div class="caption left-align">
          <h3>Left Aligned Caption</h3>
          <h5 class="light grey-text text-lighten-3">Here's our small slogan.</h5>
        </div>
      </li>
      <li>
        <img src="https://lorempixel.com/580/250/nature/3"> <!-- random image -->
        <div class="caption right-align">
          <h3>Right Aligned Caption</h3>
          <h5 class="light grey-text text-lighten-3">Here's our small slogan.</h5>
        </div>
      </li>
      <li>
        <img src="https://lorempixel.com/580/250/nature/4"> <!-- random image -->
        <div class="caption center-align">
          <h3>This is our big Tagline!</h3>
          <h5 class="light grey-text text-lighten-3">Here's our small slogan.</h5>
        </div>
      </li>
    </ul>
  </div>

Initialization

  var elem = document.querySelector('.slider');
  var instance = new M.Slider(elem, options);

  // Or with jQuery

  $(document).ready(function(){
    $('.slider').slider();
  });

Options

              Name
              Type
              Default
              Description

              indicators
              Boolean
              true
              Set to false to hide slide indicators.

              height
              Number
              400
              Set height of slider.

              duration
              Number
              500
              Set the duration of the transition animation in ms.

              interval
              Number
              6000
              Set the duration between transitions in ms.

Methods

We have methods to pause, start, move to next and move to previous slide.

Because jQuery is no longer a dependency, all the methods are called on the plugin instance. You can get the plugin instance like this:

    var instance = M.Slider.getInstance(elem);

    /* jQuery Method Calls
      You can still use the old jQuery plugin method calls.
      But you won't be able to access instance properties.

      $('.slider').slider('methodName');
      $('.slider').slider('methodName', paramName);
    */

    .pause();

Pause slider autoslide

  instance.pause();

    .start();

Start slider autoslide

  instance.start();

    .next();

Move to next slider

  instance.next();

    .prev();

Move to prev slider

  instance.prev();

    .destroy();

Destroy plugin instance and teardown

  instance.destroy();

Properties

                Name
                Type
                Description

              el
              Element
              The DOM element the plugin was initialized with.

              options
              Object
              The options the instance was initialized with.

              activeIndex
              Number
              Index of current slide.

Fullscreen Slider

You can easliy make this slider a fullscreen slider by adding the class fullscreen to the slider div. Here's a quick demo.

      Open Demo

Material Box

Slider

Help Materialize Grow

We hope you have enjoyed using Materialize and if you feel like it has helped you out and want to support the team you can help us by donating or backing us on Patreon. Any amount would help support and continue development on this project and is greatly appreciated.

                Support Us

Join the Discussion

We have a Gitter chat room set up where you can talk directly with us. Come in and discuss new features, future goals, general problems or questions, or anything else you can think of.

                Chat

Connect

                Follow @MaterializeCSS

              © 2014-2017 Materialize, All rights reserved.
              MIT License


text:
import attr from 'ember-data/attr';
import Model from 'ember-data/model';
import { belongsTo } from 'ember-data/relationships';

export default Model.extend({
  name                 : attr('string'),
  taxId                : attr('string'),
  rate                 : attr('number'),
  shouldSendInvoice    : attr('boolean'),
  country              : attr('string'),
  registeredCompany    : attr('string'),
  address              : attr('string'),
  city                 : attr('string'),
  state                : attr('string'),
  zip                  : attr('string'),
  invoiceFooter        : attr('string'),
  isTaxIncludedInPrice : attr('boolean', { defaultValue: false }),

  event: belongsTo('event')
});


text:
.. RST source for fsv(1) man page. Convert with:
..   rst2man.py fsv.rst > fsv.1
.. rst2man.py comes from the SBo development/docutils package.

.. |version| replace:: 0.9_1
.. |date| date::

===
fsv
===

------------------------
3D filesystem visualizer
------------------------

:Manual section: 1
:Manual group: SlackBuilds.org
:Date: |date|
:Version: |version|

SYNOPSIS
========

fsv [*rootdir*] [*-options*]

DESCRIPTION
===========

fsv (pronounced eff-ess-vee) is a file system visualizer in cyberspace. It
lays out files and directories in three dimensions, geometrically
representing the file system hierarchy to allow visual overview and
analysis. fsv can visualize a modest home directory, a workstation's
hard drive, or any arbitrarily large collection of files, limited only
by the host computer's memory and graphics hardware.

fsv is a clone of SGI's fsn, which was featured in the movie Jurassic Park.

Full documentation is available via the Help -> Contents menu option, or
at file:///usr/doc/fsv-|version|/html/fsv.html

OPTIONS
=======

**rootdir**    Root directory for visualization (defaults to current directory)

--mapv         Start in MapV mode (default)

--treev        Start in TreeV mode

--help         Print built-in help and exit

AUTHORS
=======

fsv originally written by Daniel Richard G. <skunk@mit.edu>.

fsv is now maintained by Maurus Cuelenaere: https://github.com/mcuelenaere

This man page written by B. Watson for the SlackBuilds.org project and
released under the WTFPL.


text:
layout: default
title: CAS - User Interface Customization
category: User Interface
---

# Views

The views are found at `src/main/resources/templates` which is a location within the CAS web application itself.
Views also may be externalized outside the web application conditionally and individually, provided the external path
via CAS settings. If a view template file is not found at the externalized path, the default one that ships with CAS will be used as the fallback.

Views may also be found using an external URL in CAS settings that is responsible to produce the full view body in the response. This URL endpoint will receive
the available request headers as well as the following headers in its request:

| Header
|-------------------------------------
| `owner`
| `template`
| `resource`
| `theme`, if available
| `locale`, if available

Upon a successful `200` status result, the response body is expected to contain the view that will be rendered by CAS.

To see the relevant list of CAS properties, please [review this guide](../configuration/Configuration-Properties.html#views).

## Warning Before Accessing Application

CAS has the ability to warn the user before being redirected to the service. This allows users to be made aware whenever an application uses CAS to log them in.
(If they don't elect the warning, they may not see any CAS screen when accessing an application that successfully relies upon an existing CAS single sign-on session.)
Some CAS adopters remove the 'warn' checkbox in the CAS login view and don't offer this interstitial advisement that single sign-on is happening.

```html
...
<input id="warn"
       name="warn"
       value="true"
       tabindex="3"
       th:accesskey="#{screen.welcome.label.warn.accesskey}"
       type="checkbox" />
<label for="warn" th:utext="#{screen.welcome.label.warn}"/>
...
```

## "I am at a public workstation" authentication

CAS has the ability to allow the user to opt-out of SSO, by indicating on the login page that the authentication
is happening at a public workstation. By electing to do so, CAS will not honor the subsequent SSO session
and will not generate the TGC that is designed to do so.

```html
...
<input id="publicWorkstation"
       name="publicWorkstation"
       value="false" tabindex="4"
       type="checkbox" />
<label for="publicWorkstation" th:utext="#{screen.welcome.label.publicstation}"/>
...
```

## Default Service

In the event that no `service` is submitted to CAS, you may specify a default
service url to which CAS will redirect. Note that this default service, much like
all other services, MUST be authorized and registered with CAS.

To see the relevant list of CAS properties, please [review this guide](../configuration/Configuration-Properties.html#views).


text:
name: cljs.core/dissoc!
see also:
---

## Summary

## Details

## Examples


text:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
             xmlns:tools="http://schemas.android.com/tools"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             tools:context=".subfragment.WebViewFragment">

    <!-- TODO: Update blank fragment layout -->
    <com.sak.ultilviewlib.UltimateRefreshView
        android:id="@+id/refreshView"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <WebView
            android:id="@+id/webview"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>
    </com.sak.ultilviewlib.UltimateRefreshView>

</FrameLayout>


text:
package com.intellij.codeInsight.daemon.lambda;

import com.intellij.codeInsight.daemon.LightDaemonAnalyzerTestCase;
import org.jetbrains.annotations.NonNls;

public class Diamond8HighlightingTest extends LightDaemonAnalyzerTestCase {
  @NonNls static final String BASE_PATH = "/codeInsight/daemonCodeAnalyzer/lambda/diamond";

  public void testAvoidClassRefCachingDuringInference() throws Exception {
    doTest();
  }

  public void testIDEA97294() throws Exception {
    doTest();
  }

  public void testOuterClass() throws Exception {
    doTest();
  }

  public void testVarargs() throws Exception {
    doTest();
  }

  public void testOverloadOuterCall() throws Exception {
    doTest();
  }

  public void testWithConstructorRefInside() throws Exception {
    doTest();
  }

  public void testIDEA140686() throws Exception {
    doTest();
  }

  public void testDiagnosticMessageWhenConstructorIsUnresolved() throws Exception {
    doTest();
  }

  public void testNullTypesInDiamondsInference() throws Exception {
    doTest();
  }

  public void testNoRawTypeInferenceWhenNewExpressionHasSpecifiedType() throws Exception {
    doTest();
  }

  public void testEraseTypeForNewExpressionWithDiamondsIfUncheckedConversionWasPerformedDuringApplicabilityCheck() throws Exception {
    doTest();
  }

  public void testEnsureApplicabilityForDiamondCallIsCheckedBasedOnStaticFactoryApplicability() throws Exception {
    doTest();
  }

  public void testConflictingNamesInConstructorAndClassTypeParameters() throws Exception {
    doTest();
  }

  private void doTest() throws Exception {
    doTest(BASE_PATH + "/" + getTestName(false) + ".java", false, false);
  }
}


text:
package attr

/*

import (
	"github.com/gogo/protobuf/types"
	"github.com/gunsluo/go-example/attribute/acpb"
	"github.com/pkg/errors"
)

func ConvertCondition(c *acpb.Condition) (Condition, error) {
	fn, ok := ConditionFactories[c.Type]
	if !ok {
		return nil, errors.Errorf("Condition %s not found", c.Type)
	}

	nc := fn()
	if c.Options != nil {
		values, err := getAttributeValues(c.Options)
		if err != nil {
			return nil, errors.Wrap(err, "")
		}

		nc.Values(c.Options.Expression, values)
	}

	return nc, nil
}

func ConvertConditions(cs []*acpb.Condition) (Conditions, error) {
	ncs := Conditions{}
	for _, c := range cs {
		nc, err := ConvertCondition(c)
		if err != nil {
			return nil, err
		}
		ncs[c.Name] = nc
	}

	return ncs, nil
}

func getAttributeValues(options *acpb.ConditionOption) (map[string]interface{}, error) {
	values := make(map[string]interface{})
	if options == nil {
		return values, nil
	}

	for _, a := range options.Attributes {
		switch a.Type {
		case acpb.ATTRIBUTE_TYPE_STRING:
			v := &acpb.StringAttributeValue{}
			err := types.UnmarshalAny(a.Default, v)
			if err != nil {
				return nil, err
			}
			values[a.Name] = v.Value
		case acpb.ATTRIBUTE_TYPE_NUMBER:
			v := &acpb.NumberAttributeValue{}
			err := types.UnmarshalAny(a.Default, v)
			if err != nil {
				return nil, err
			}
			values[a.Name] = v.Value
		case acpb.ATTRIBUTE_TYPE_BOOLEAN:
			v := &acpb.BooleanAttributeValue{}
			err := types.UnmarshalAny(a.Default, v)
			if err != nil {
				return nil, err
			}
			values[a.Name] = v.Value
		}
	}

	return values, nil
}
*/

/*
import "github.com/pkg/errors"

type Key struct {
	Name      string `json:"name"`
	Required  bool   `json:"required"`
	Condition string `json:"condition"`
}

type Value interface{}

type Attributes map[Key]Value

func (as Attributes) ConvertConditions() (Conditions, error) {
	cs := Conditions{}
	for k, v := range as {
		fn, ok := ConditionFactories[k.Condition]
		if !ok {
			return nil, errors.Errorf("CCondition %s not found", k.Condition)
		}

		c := fn()
		c.Value(v)

		cs[k.Name] = c
	}

	return cs, nil
}
*/

/*
import "github.com/pkg/errors"

type Attribute struct {
	Name      string
	Value     interface{}
	Required  bool
	Condition string
}

type Attributes []Attribute

func (a *Attribute) ConvertCondition() (Condition, error) {
	fn, ok := ConditionFactories[a.Condition]
	if !ok {
		return nil, errors.Errorf("CCondition %s not found", a.Condition)
	}

	c := fn()
	c.Value(a.Value)

	return c, nil
}

func (as Attributes) ConvertConditions() (Conditions, error) {
	cs := Conditions{}
	for _, a := range as {
		c, e := a.ConvertCondition()
		if e != nil {
			return nil, e
		}
		cs[a.Name] = c
	}

	return cs, nil
}
*/


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Lobivia haagei var. elegantula Rausch

### Remarks
null


text:
* {
	margin: 0;
	padding: 0;
}

body {
	width: 960px;

	color: #000000;
	font-size: 16px;
	font-family: Verdana, Geneva, 'DejaVu Sans', sans-serif;
}

div#wrapper {
	margin-left: 50px;
}

div#wrapper > a {
	color: black;

	font-size: 19px;
	text-decoration: none;
}

div#wrapper > a:hover {
	color: #666666;
}

div#wrapper > a.current {
	font-weight: bold;
}

div#wrapper form {
	width: 450px;

	background: #ffffff;
	background: -moz-linear-gradient(top,  #ffffff 10%, #595959 100%);
	background: -webkit-gradient(linear, left top, left bottom, color-stop(10%,#ffffff), color-stop(100%,#595959));
	background: -webkit-linear-gradient(top,  #020202 10%,#595959 100%);
	background: -o-linear-gradient(top,  #ffffff 10%,#595959 100%);
	background: -ms-linear-gradient(top,  #ffffff 10%,#595959 100%);
	background: linear-gradient(to bottom,  #ffffff 10%,#595959 100%);
	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#595959',GradientType=0 );
}

div#wrapper form.invisible {
	display: none;
}

div#wrapper form fieldset {
	padding: 13px 75px 10px 0;
	text-align: right;

	border: 5px solid black;
	border-radius: 5px;
}

div#wrapper form legend {
	padding: 0 10px;

	font-size: 27px;
	font-weight: bold;
	font-style: italic;
}

div#wrapper form fieldset label {
	font-weight: bold;
}

div#wrapper form fieldset input {
	margin: 0 0 7px 1px;
	padding: 10px 15px;

	color: white;

	border: none;
	border-radius: 15px;

	background: #020202;
	background: -moz-linear-gradient(top,  #020202 0%, #cacaca 100%);
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#020202), color-stop(100%,#cacaca));
	background: -webkit-linear-gradient(top,  #020202 0%,#cacaca 100%);
	background: -o-linear-gradient(top,  #020202 0%,#cacaca 100%);
	background: -ms-linear-gradient(top,  #020202 0%,#cacaca 100%);
	background: linear-gradient(to bottom,  #020202 0%,#cacaca 100%);
	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#020202', endColorstr='#cacaca',GradientType=0 );
}

div#wrapper form fieldset button {
	margin-top: 3px;
	padding: 5px 10px;

	font-size: 19px;

	border: 2px solid black;
	border-radius: 15px;

	background: #020202;
	background: -moz-linear-gradient(top,  #020202 0%, #fcfcfc 100%);
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#020202), color-stop(100%,#fcfcfc));
	background: -webkit-linear-gradient(top,  #020202 0%,#fcfcfc 100%);
	background: -o-linear-gradient(top,  #020202 0%,#fcfcfc 100%);
	background: -ms-linear-gradient(top,  #020202 0%,#fcfcfc 100%);
	background: linear-gradient(to bottom,  #020202 0%,#fcfcfc 100%);
	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#020202', endColorstr='#fcfcfc',GradientType=0 );
}

div#wrapper form fieldset button:hover {
	background: #020202;
	background: -moz-linear-gradient(top,  #020202 0%, #cacaca 100%);
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#020202), color-stop(100%,#cacaca));
	background: -webkit-linear-gradient(top,  #020202 0%,#cacaca 100%);
	background: -o-linear-gradient(top,  #020202 0%,#cacaca 100%);
	background: -ms-linear-gradient(top,  #020202 0%,#cacaca 100%);
	background: linear-gradient(to bottom,  #020202 0%,#cacaca 100%);
	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#020202', endColorstr='#cacaca',GradientType=0 );
}


text:
{{- with .Site.Params.widgets.patreon -}}

		{{- $.Scratch.Set "patreon_banner_url" "images/patreon_white.png" -}}
		{{- with $.Site.Params.widgets.patreon_banner -}}{{- $.Scratch.Set "patreon_banner_url" . -}}{{- end -}}

{{- end -}}


text:
// **********************************************************************
//
// <copyright>
//
//  BBN Technologies
//  10 Moulton Street
//  Cambridge, MA 02138
//  (617) 873-8000
//
//  Copyright (C) BBNT Solutions LLC. All rights reserved.
//
// </copyright>
// **********************************************************************
//
// $Source: /cvs/distapps/openmap/src/openmap/com/bbn/openmap/examples/simple/SimpleMap.java,v $
// $RCSfile: SimpleMap.java,v $
// $Revision: 1.3 $
// $Date: 2004/10/14 18:05:46 $
// $Author: dietrick $
//
// **********************************************************************

package com.bbn.openmap.app.example;

import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Properties;

import javax.swing.JFrame;

import com.bbn.openmap.MapBean;
import com.bbn.openmap.layer.shape.ShapeLayer;

/**
 * This is a simple application that uses the OpenMap MapBean to show
 * a map.
 *

 * This example shows:
 *

 *
MapBean
 *
ShapeLayer with political data
 *

 */
public class SimpleMap {

    public static void main(String args[]) {

        // Create a Swing frame
        JFrame frame = new JFrame("Simple Map");

        // Size the frame appropriately
        frame.setSize(640, 480);

        // Create a MapBean
        MapBean mapBean = new MapBean();

        // Create a ShapeLayer to show world political boundaries.
        // Set the properties of the layer. This assumes that the
        // datafiles "dcwpo-browse.shp" and "dcwpo-browse.ssx" are in
        // a path specified in the CLASSPATH variable. These files
        // are distributed with OpenMap and reside in the toplevel
        // "share" subdirectory.
        ShapeLayer shapeLayer = new ShapeLayer();
        Properties shapeLayerProps = new Properties();
        shapeLayerProps.put("prettyName", "Political Solid");
        shapeLayerProps.put("lineColor", "000000");
        shapeLayerProps.put("fillColor", "BDDE83");
        shapeLayerProps.put("shapeFile", "data/shape/dcwpo-browse.shp");
        shapeLayerProps.put("spatialIndex", "data/shape/dcwpo-browse.ssx");
        shapeLayer.setProperties(shapeLayerProps);

        // Add the political layer to the map
        mapBean.add(shapeLayer);

        // Add the map to the frame
        frame.getContentPane().add(mapBean);

        frame.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        });

        // Display the frame
        frame.setVisible(true);
    }
}


text:
// ------------------------------------------------------------
//  Copyright (c) Microsoft Corporation.  All rights reserved.
//  Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
// ------------------------------------------------------------

using System;
using System.Collections.Concurrent;
using FG.Common.Utils;
using Microsoft.ServiceFabric.Services.Client;
using Microsoft.ServiceFabric.Services.Communication.Client;
using Microsoft.ServiceFabric.Services.Remoting;
using Microsoft.ServiceFabric.Services.Remoting.Client;

namespace FG.ServiceFabric.Testing.Mocks.Services.Remoting.Client
{
    /// <summary>
    /// Wrapper class for the static ServiceProxy.
    /// </summary>
    public class MockServiceProxyFactory : IServiceProxyFactory
    {
        private readonly MockFabricRuntime _fabricRuntime;

        public MockServiceProxyFactory(MockFabricRuntime fabricRuntime)
        {
            _fabricRuntime = fabricRuntime;
        }

        private readonly ConcurrentDictionary<Uri, object> _mockServiceLookupTable = new ConcurrentDictionary<Uri, object>();

        public TServiceInterface CreateServiceProxy<TServiceInterface>(
            Uri serviceUri, ServicePartitionKey partitionKey = null, TargetReplicaSelector targetReplicaSelector = TargetReplicaSelector.Default, string listenerName = null)
            where TServiceInterface : IService
        {
            var serviceProxy = new MockServiceProxy();

            serviceProxy.Supports<TServiceInterface>((mockUri) => _mockServiceLookupTable[serviceUri]);

            var service = serviceProxy.Create<TServiceInterface>(serviceUri, partitionKey, targetReplicaSelector, listenerName);
            // ReSharper disable once SuspiciousTypeConversion.Global

            var target = (object) (service as FG.ServiceFabric.Services.Runtime.StatelessService) ??
                         service as FG.ServiceFabric.Services.Runtime.StatefulService;
            if (target != null)
            {
                target.SetPrivateField("_serviceProxyFactory", _fabricRuntime.ServiceProxyFactory);
                target.SetPrivateField("_actorProxyFactory", _fabricRuntime.ActorProxyFactory);
                target.SetPrivateField("_applicationUriBuilder", _fabricRuntime.ApplicationUriBuilder);
            }
            return service;
        }

        public void AssociateMockServiceAndName(Uri mockServiceUri, object mockService)
        {
            _mockServiceLookupTable.AddOrUpdate(mockServiceUri, mockService, (uri, service) => mockService);
        }

        public TService GetService<TService>(Uri serviceUri)
        {
            if( _mockServiceLookupTable.ContainsKey(serviceUri))
                return (TService)_mockServiceLookupTable[serviceUri];
            return default(TService);
        }
    }

}


text:
module Ebay # :nodoc:
  module Requests # :nodoc:
    # == Attributes
    #  text_node :dispute_explanation, 'DisputeExplanation', :optional => true
    #  text_node :dispute_reason, 'DisputeReason', :optional => true
    #  text_node :item_id, 'ItemID', :optional => true
    #  text_node :transaction_id, 'TransactionID', :optional => true
    #  text_node :order_line_item_id, 'OrderLineItemID', :optional => true
    class AddDispute < Abstract
      include XML::Mapping
      include Initializer
      root_element_name 'AddDisputeRequest'
      text_node :dispute_explanation, 'DisputeExplanation', :optional => true
      text_node :dispute_reason, 'DisputeReason', :optional => true
      text_node :item_id, 'ItemID', :optional => true
      text_node :transaction_id, 'TransactionID', :optional => true
      text_node :order_line_item_id, 'OrderLineItemID', :optional => true
    end
  end
end


text:
package Feb2021Leetcode;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;

public class _0472ConcatenatedWords {

	public static void main(String[] args) {
		System.out.println(findAllConcatenatedWordsInADict(new String[] { "cat", "cats", "catsdogcats", "dog",
				"dogcatsdog", "hippopotamuses", "rat", "ratcatdogcat" }));
		System.out.println(findAllConcatenatedWordsInADict(new String[] { "cat", "dog", "catdog" }));
	}

	public static List<String> findAllConcatenatedWordsInADict(String[] words) {
		HashSet<String> set = new HashSet<String>(new ArrayList<String>(Arrays.asList(words)));
		List<String> output = new ArrayList<String>();

		for (String word : words) {
			set.remove(word);
			if (canSplit(word, set)) {
				output.add(word);
			}
			set.add(word);
		}
		return output;
	}

	public static boolean canSplit(String word, HashSet<String> set) {
		boolean[] dp = new boolean[word.length() + 1];
		dp[0] = true;

		for (int i = 1; i < dp.length; i++) {
			for (int j = 0; j < i; j++) {
				if (dp[j] && set.contains(word.substring(j, i))) {
					dp[i] = true;
					break;
				}
			}
		}
		return dp[word.length()];
	}

}


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

namespace AdvUtils
{
    public class Logger
    {
        public enum Level { err, warn, info};

        public static void WriteLine(string s, params object[] args)
        {
            WriteLine(Level.info, s, args);
        }

        public static void WriteLine(Level level, string s, params object[] args)
        {
            StringBuilder sb = new StringBuilder();
            sb.AppendFormat("{0},{1} ", level.ToString(), DateTime.Now.ToString());

            if (args.Length == 0)
                sb.Append(s);
            else
                sb.AppendFormat(s, args);

            string sLine = sb.ToString();

            if (level != Level.info)
                Console.Error.WriteLine(sLine);
            else
                Console.WriteLine(sLine);

            if (s_sw != null)
                s_sw.WriteLine(sLine);

        }

        public static void WriteLine(Level level, ConsoleColor color, string s, params object[] args)
        {
            StringBuilder sb = new StringBuilder();
            sb.AppendFormat("{0},{1} ", level.ToString(), DateTime.Now.ToString());

            if (args.Length == 0)
                sb.Append(s);
            else
                sb.AppendFormat(s, args);

            string sLine = sb.ToString();

            Console.ForegroundColor = color;

            if (level != Level.info)
                Console.Error.WriteLine(sLine);
            else
                Console.WriteLine(sLine);

            Console.ResetColor();

            if (s_sw != null)
                s_sw.WriteLine(sLine);

        }

        public static void Close()
        {
            if (s_sw != null)
            {
                s_sw.Close();
                s_sw = null;
            }

        }

        public static string LogFile
        {
            get { return s_strLogfile; }
            set
            {
                if (s_strLogfile == value)
                    return;

                if (s_sw != null)
                {
                    s_sw.Close();
                    s_sw = null;
                }

                s_strLogfile = value;
                if (s_strLogfile != null)
                {
                    s_sw = new StreamWriter(s_strLogfile, true, Encoding.UTF8);
                    s_sw.AutoFlush = true;
                }
            }
        }

        private static string s_strLogfile = null;
        private static StreamWriter s_sw = null;
    }
}


text:
namespace Microsoft.Graph
{
    using System;
    using System.Collections.Generic;

    /// <summary>
    /// The interface IOnenoteSectionsCollectionRequestBuilder.
    /// </summary>
    public partial interface IOnenoteSectionsCollectionRequestBuilder
    {
        /// <summary>
        /// Builds the request.
        /// </summary>
        /// <returns>The built request.</returns>
        IOnenoteSectionsCollectionRequest Request();

        /// <summary>
        /// Builds the request.
        /// </summary>
        /// <param name="options">The query and header options for the request.</param>
        /// <returns>The built request.</returns>
        IOnenoteSectionsCollectionRequest Request(IEnumerable<Option> options);

        /// <summary>
        /// Gets an <see cref="IOnenoteSectionRequestBuilder"/> for the specified OnenoteSection.
        /// </summary>
        /// <param name="id">The ID for the OnenoteSection.</param>
        /// <returns>The <see cref="IOnenoteSectionRequestBuilder"/>.</returns>
        IOnenoteSectionRequestBuilder this[string id] { get; }

    }
}


text:
<!DOCTYPE html>

    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title></title>
    <link rel="Stylesheet" href="../css/analysis.css" />

Find lignende steder

Baseret på kriterier, du angiver, måler værktøjet Find lignende steder ligheden mellem steder i dit kandidatsøgningslag og et eller flere referencesteder.  Værktøjet kan besvare spørgsmål såsom:

Hvilke af dine forretninger ligner dine bedste forretninger mest med hensyn til kundeprofiler?

På grundlag af karakteristika for de landsbyer, der blev hårdest ramt af sygdommen, hvilke andre landsbyer er så i højrisikozonen?

        For at få svar på spørgsmål som disse skal du angive de referencesteder, de kandidatsøgesteder og de felter, der repræsenterer de kriterier, som du gerne vil matche.  Det lag, du valgte til analyse (analyselaget), bør indeholde dine referencesteder eller referencepunktsteder.  Det kunne eksempelvis være et lag, som indeholder dine bedste forretninger, eller de landsbyer, som blev hårdest ramt af sygdommen.  Du angiver derefter det lag, som indeholder dine kandidatsøgesteder.  Det kunne f.eks. være alle dine forretninger eller alle andre landsbyer.  Endelig kan du identificere et eller flere felter til brug for måling af lighed.  Værktøjet Find lignende steder vil derefter rangordne alle kandidatsøgestederne efter, i hvor høj grad de matcher dine referencesteder på tværs af alle de felter, du har markeret.

Du kan bruge alle steder eller udvælge:

Brug om nødvendigt markeringsknapperne til at identificere referencestederne.  Hvis input-laget f.eks. indeholder alle stederne - referencestederne samt kandidatsøgestederne - skal du bruge et af markeringsværktøjerne til at identificere referencestederne.  Hvis du opretter to særskilte lag, et med referencesteder og et andet med alle kandidatsøgestederne, behøver du ikke foretage en markering.

Hvis der er mere end et referencested, oprettes der ét enkelt sted ved at tage gennemsnittet af værdierne for hver af de felter, der bruges til at analysere ligheden.

Søg efter lignende steder i:

Kandidatsøgestederne i dette lag rangordnes fra mest til mindst lignende.  Lighed er baseret på, hvor meget det enkelte sted matcher referencestedet på tværs af de felter, du angiver.

Bas\ér ligheden på:

De felter, du vælger, vil være de kriterier, som anvendes for at vurdere ligheden.  Hvis du eksempelvis vælger et befolknings- og indkomstfelt, vil kandidatsøgestederne med de laveste (bedste) rangordninger være dem, der har lignende befolknings- og indkomstværdier i forhold til dine referencesteder.

Vis mig:

Du kan enten få vist alle kandidatsøgestederne rangordnet fra ligner meget til ligner mindst, eller du kan angive det antal resultater, som du vil se.

 alle steder fra mest til mindst lignende—alle objekterne i kandidatsøgelaget medtages i rangordenen i resultatlaget

 toppen  1—du afgør, hvor mange af de mest lignende kandidater, der skal medtages i resultatlaget.

Navn på resultatlag

Angiv et navn på det lag, som oprettes i  Mit indhold og tilføjes kortet. Dette resultatlag vil indeholde referencesteder og antallet af rangordnede kandidatsøgesteder, som du angav.   Hvis navnet på resultatlaget allerede eksisterer, vil du blive bedt om at ændre det.

Ved hjælp af rullelisten  Gem resultat i kan du angive navnet på en mappe i Mit indhold, hvor resultatet skal gemmes.


text:
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.

package com.microsoft.azure.management.sql.models;

import com.microsoft.windowsazure.core.OperationResponse;
import com.microsoft.windowsazure.core.OperationStatus;

/**
* Response for long running Azure Sql Database operations.
*/
public class DatabaseCreateOrUpdateResponse extends OperationResponse {
    private Database database;

    /**
    * Optional. Gets or sets Database object that represents the Azure Sql
    * Database.
    * @return The Database value.
    */
    public Database getDatabase() {
        return this.database;
    }

    /**
    * Optional. Gets or sets Database object that represents the Azure Sql
    * Database.
    * @param databaseValue The Database value.
    */
    public void setDatabase(final Database databaseValue) {
        this.database = databaseValue;
    }

    private ErrorResponse error;

    /**
    * Optional.
    * @return The Error value.
    */
    public ErrorResponse getError() {
        return this.error;
    }

    /**
    * Optional.
    * @param errorValue The Error value.
    */
    public void setError(final ErrorResponse errorValue) {
        this.error = errorValue;
    }

    private String operationStatusLink;

    /**
    * Optional.
    * @return The OperationStatusLink value.
    */
    public String getOperationStatusLink() {
        return this.operationStatusLink;
    }

    /**
    * Optional.
    * @param operationStatusLinkValue The OperationStatusLink value.
    */
    public void setOperationStatusLink(final String operationStatusLinkValue) {
        this.operationStatusLink = operationStatusLinkValue;
    }

    private int retryAfter;

    /**
    * Optional.
    * @return The RetryAfter value.
    */
    public int getRetryAfter() {
        return this.retryAfter;
    }

    /**
    * Optional.
    * @param retryAfterValue The RetryAfter value.
    */
    public void setRetryAfter(final int retryAfterValue) {
        this.retryAfter = retryAfterValue;
    }

    private OperationStatus status;

    /**
    * Optional.
    * @return The Status value.
    */
    public OperationStatus getStatus() {
        return this.status;
    }

    /**
    * Optional.
    * @param statusValue The Status value.
    */
    public void setStatus(final OperationStatus statusValue) {
        this.status = statusValue;
    }
}


text:
from os.path import dirname, join
from pkg_resources import parse_version
from setuptools import setup, find_packages, __version__ as setuptools_version

with open(join(dirname(__file__), 'scrapy/VERSION'), 'rb') as f:
    version = f.read().decode('ascii').strip()

def has_environment_marker_platform_impl_support():
    """Code extracted from 'pytest/setup.py'
    https://github.com/pytest-dev/pytest/blob/7538680c/setup.py#L31

    The first known release to support environment marker with range operators
    it is 18.5, see:
    https://setuptools.readthedocs.io/en/latest/history.html#id235
    """
    return parse_version(setuptools_version) >= parse_version('18.5')

extras_require = {}

if has_environment_marker_platform_impl_support():
    extras_require[':platform_python_implementation == "PyPy"'] = [
        'PyPyDispatcher>=2.1.0',
    ]

setup(
    name='Scrapy',
    version=version,
    url='https://scrapy.org',
    description='A high-level Web Crawling and Web Scraping framework',
    long_description=open('README.rst').read(),
    author='Scrapy developers',
    maintainer='Pablo Hoffman',
    maintainer_email='pablo@pablohoffman.com',
    license='BSD',
    packages=find_packages(exclude=('tests', 'tests.*')),
    include_package_data=True,
    zip_safe=False,
    entry_points={
        'console_scripts': ['scrapy = scrapy.cmdline:execute']
    },
    classifiers=[
        'Framework :: Scrapy',
        'Development Status :: 5 - Production/Stable',
        'Environment :: Console',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: Implementation :: CPython',
        'Programming Language :: Python :: Implementation :: PyPy',
        'Topic :: Internet :: WWW/HTTP',
        'Topic :: Software Development :: Libraries :: Application Frameworks',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ],
    python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
    install_requires=[
        'Twisted>=13.1.0',
        'w3lib>=1.17.0',
        'queuelib',
        'lxml',
        'pyOpenSSL',
        'cssselect>=0.9',
        'six>=1.5.2',
        'parsel>=1.1',
        'PyDispatcher>=2.0.5',
        'service_identity',
    ],
    extras_require=extras_require,
)


text:
//!file
//! \brief floating-point comparison from Boost.Test
// Copyright Paul A. Bristow 2015.
// Copyright John Maddock 2015.

// Use, modification and distribution are subject to 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)

// Note that this file contains Quickbook mark-up as well as code
// and comments, don't change any of the special comment mark-ups!

#include <boost/math/special_functions/relative_difference.hpp>
#include <boost/math/special_functions/next.hpp>

#include <iostream>
#include <limits> // for std::numeric_limits<T>::epsilon().

int main()
{
  std::cout << "Compare floats using Boost.Math functions/classes" << std::endl;

//[compare_floats_using
/*`Some using statements will ensure that the functions we need are accessible.
*/

  using namespace boost::math;

//`or

  using boost::math::relative_difference;
  using boost::math::epsilon_difference;
  using boost::math::float_next;
  using boost::math::float_prior;

//] [/compare_floats_using]

//[compare_floats_example_1
/*`The following examples display values with all possibly significant digits.
Newer compilers should provide `std::numeric_limitsFPT>::max_digits10`
for this purpose, and here we use `float` precision where `max_digits10` = 9
to avoid displaying a distracting number of decimal digits.

[note Older compilers can use this formula to calculate `max_digits10`
from `std::numeric_limits<FPT>::digits10`:[br]
__spaces `int max_digits10 = 2 + std::numeric_limits<FPT>::digits10 * 3010/10000;`
] [/note]

One can set the display including all trailing zeros
(helpful for this example to show all potentially significant digits),
and also to display `bool` values as words rather than integers:
*/
  std::cout.precision(std::numeric_limits<float>::max_digits10);
  std::cout << std::boolalpha << std::showpoint << std::endl;

//] [/compare_floats_example_1]

//[compare_floats_example_2]
/*`
When comparing values that are ['quite close] or ['approximately equal],
we could use either `float_distance` or `relative_difference`/`epsilon_difference`, for example
with type `float`, these two values are adjacent to each other:
*/

  float a = 1;
  float b = 1 + std::numeric_limits<float>::epsilon();
  std::cout << "a = " << a << std::endl;
  std::cout << "b = " << b << std::endl;
  std::cout << "float_distance = " << float_distance(a, b) << std::endl;
  std::cout << "relative_difference = " << relative_difference(a, b) << std::endl;
  std::cout << "epsilon_difference = " << epsilon_difference(a, b) << std::endl;

/*`
Which produces the output:

[pre
a = 1.00000000
b = 1.00000012
float_distance = 1.00000000
relative_difference = 1.19209290e-007
epsilon_difference = 1.00000000
]
*/
  //] [/compare_floats_example_2]

//[compare_floats_example_3]
/*`
In the example above, it just so happens that the edit distance as measured by `float_distance`, and the
difference measured in units of epsilon were equal.  However, due to the way floating point
values are represented, that is not always the case:*/

  a = 2.0f / 3.0f;   // 2/3 inexactly represented as a float
  b = float_next(float_next(float_next(a))); // 3 floating point values above a
  std::cout << "a = " << a << std::endl;
  std::cout << "b = " << b << std::endl;
  std::cout << "float_distance = " << float_distance(a, b) << std::endl;
  std::cout << "relative_difference = " << relative_difference(a, b) << std::endl;
  std::cout << "epsilon_difference = " << epsilon_difference(a, b) << std::endl;

/*`
Which produces the output:

[pre
a = 0.666666687
b = 0.666666865
float_distance = 3.00000000
relative_difference = 2.68220901e-007
epsilon_difference = 2.25000000
]

There is another important difference between `float_distance` and the
`relative_difference/epsilon_difference` functions in that `float_distance`
returns a signed result that reflects which argument is larger in magnitude,
where as `relative_difference/epsilon_difference` simply return an unsigned
value that represents how far apart the values are.  For example if we swap
the order of the arguments:
*/

  std::cout << "float_distance = " << float_distance(b, a) << std::endl;
  std::cout << "relative_difference = " << relative_difference(b, a) << std::endl;
  std::cout << "epsilon_difference = " << epsilon_difference(b, a) << std::endl;

  /*`
  The output is now:

  [pre
  float_distance = -3.00000000
  relative_difference = 2.68220901e-007
  epsilon_difference = 2.25000000
  ]
*/
  //] [/compare_floats_example_3]

//[compare_floats_example_4]
/*`
Zeros are always treated as equal, as are infinities as long as they have the same sign:*/

  a = 0;
  b = -0;  // signed zero
  std::cout << "relative_difference = " << relative_difference(a, b) << std::endl;
  a = b = std::numeric_limits<float>::infinity();
  std::cout << "relative_difference = " << relative_difference(a, b) << std::endl;
  std::cout << "relative_difference = " << relative_difference(a, -b) << std::endl;

/*`
Which produces the output:

[pre
relative_difference = 0.000000000
relative_difference = 0.000000000
relative_difference = 3.40282347e+038
]
*/
//] [/compare_floats_example_4]

//[compare_floats_example_5]
/*`
Note that finite values are always infinitely far away from infinities even if those finite values are very large:*/

  a = (std::numeric_limits<float>::max)();
  b = std::numeric_limits<float>::infinity();
  std::cout << "a = " << a << std::endl;
  std::cout << "b = " << b << std::endl;
  std::cout << "relative_difference = " << relative_difference(a, b) << std::endl;
  std::cout << "epsilon_difference = " << epsilon_difference(a, b) << std::endl;

/*`
Which produces the output:

[pre
a = 3.40282347e+038
b = 1.#INF0000
relative_difference = 3.40282347e+038
epsilon_difference = 3.40282347e+038
]
*/
//] [/compare_floats_example_5]

//[compare_floats_example_6]
/*`
Finally, all denormalized values and zeros are treated as being effectively equal:*/

  a = std::numeric_limits<float>::denorm_min();
  b = a * 2;
  std::cout << "a = " << a << std::endl;
  std::cout << "b = " << b << std::endl;
  std::cout << "float_distance = " << float_distance(a, b) << std::endl;
  std::cout << "relative_difference = " << relative_difference(a, b) << std::endl;
  std::cout << "epsilon_difference = " << epsilon_difference(a, b) << std::endl;
  a = 0;
  std::cout << "a = " << a << std::endl;
  std::cout << "b = " << b << std::endl;
  std::cout << "float_distance = " << float_distance(a, b) << std::endl;
  std::cout << "relative_difference = " << relative_difference(a, b) << std::endl;
  std::cout << "epsilon_difference = " << epsilon_difference(a, b) << std::endl;

/*`
Which produces the output:

[pre
a = 1.40129846e-045
b = 2.80259693e-045
float_distance = 1.00000000
relative_difference = 0.000000000
epsilon_difference = 0.000000000
a = 0.000000000
b = 2.80259693e-045
float_distance = 2.00000000
relative_difference = 0.000000000
epsilon_difference = 0.000000000]

Notice how, in the above example, two denormalized values that are a factor of 2 apart are
none the less only one representation apart!

*/
//] [/compare_floats_example_6]

#if 0
//[old_compare_floats_example_3
//`The simplest use is to compare two values with a tolerance thus:

  bool is_close = is_close_to(1.F, 1.F + epsilon, epsilon); // One epsilon apart is close enough.
  std::cout << "is_close_to(1.F, 1.F + epsilon, epsilon); is " << is_close << std::endl; // true

  is_close = is_close_to(1.F, 1.F + 2 * epsilon, epsilon); // Two epsilon apart isn't close enough.
  std::cout << "is_close_to(1.F, 1.F + epsilon, epsilon); is " << is_close << std::endl; // false

/*`
[note The type FPT of the tolerance and the type of the values [*must match].

So `is_close(0.1F, 1., 1.)` will fail to compile because "template parameter 'FPT' is ambiguous".
Always provide the same type, using `static_cast<FPT>` if necessary.]
*/

/*`An instance of class `close_at_tolerance` is more convenient
when multiple tests with the same conditions are planned.
A class that stores a tolerance of three epsilon (and the default ['strong] test) is:
*/

  close_at_tolerance<float> three_rounds(3 * epsilon); // 'strong' by default.

//`and we can confirm these settings:

  std::cout << "fraction_tolerance = "
    << three_rounds.fraction_tolerance()
    << std::endl; // +3.57627869e-007
  std::cout << "strength = "
    << (three_rounds.strength() == FPC_STRONG ? "strong" : "weak")
    << std::endl; // strong

//`To start, let us use two values that are truly equal (having identical bit patterns)

  float a = 1.23456789F;
  float b = 1.23456789F;

//`and make a comparison using our 3*epsilon `three_rounds` functor:

  bool close = three_rounds(a, b);
  std::cout << "three_rounds(a, b) = " << close << std::endl; // true

//`Unsurprisingly, the result is true, and the failed fraction is zero.

  std::cout << "failed_fraction = " << three_rounds.failed_fraction() << std::endl;

/*`To get some nearby values, it is convenient to use the Boost.Math __next_float functions,
for which we need an include

  #include <boost/math/special_functions/next.hpp>

and some using declarations:
*/

  using boost::math::float_next;
  using boost::math::float_prior;
  using boost::math::nextafter;
  using boost::math::float_distance;

//`To add a few __ulp to one value:
  b = float_next(a); // Add just one ULP to a.
  b = float_next(b); // Add another one ULP.
  b = float_next(b); // Add another one ULP.
  // 3 epsilon would pass.
  b = float_next(b); // Add another one ULP.

//`and repeat our comparison:

  close = three_rounds(a, b);
  std::cout << "three_rounds(a, b) = " << close << std::endl; // false
  std::cout << "failed_fraction = " << three_rounds.failed_fraction()
    << std::endl;  // abs(u-v) / abs(v) = 3.86237957e-007

//`We can also 'measure' the number of bits different using the `float_distance` function:

  std::cout << "float_distance = " << float_distance(a, b) << std::endl; // 4

/*`Now consider two values that are much further apart
than one might expect from ['computational noise],
perhaps the result of two measurements of some physical property like length
where an uncertainty of a percent or so might be expected.
*/
  float fp1 = 0.01000F;
  float fp2 = 0.01001F; // Slightly different.

  float tolerance = 0.0001F;

  close_at_tolerance<float> strong(epsilon); // Default is strong.
  bool rs = strong(fp1, fp2);
  std::cout << "strong(fp1, fp2) is " << rs << std::endl;

//`Or we could contrast using the ['weak] criterion:
  close_at_tolerance<float> weak(epsilon, FPC_WEAK); // Explicitly weak.
  bool rw = weak(fp1, fp2); //
  std::cout << "weak(fp1, fp2) is " << rw << std::endl;

//`We can also construct, setting tolerance and strength, and compare in one statement:

  std::cout << a << " #= " << b << " is "
    << close_at_tolerance<float>(epsilon, FPC_STRONG)(a, b) << std::endl;
  std::cout << a << " ~= " << b << " is "
    << close_at_tolerance<float>(epsilon, FPC_WEAK)(a, b) << std::endl;

//`but this has little advantage over using function `is_close_to` directly.

//] [/old_compare_floats_example_3]

/*When the floating-point values become very small and near zero, using
//a relative test becomes unhelpful because one is dividing by zero or tiny,

//Instead, an absolute test is needed, comparing one (or usually both) values with zero,
//using a tolerance.
//This is provided by the `small_with_tolerance` class and `is_small` function.

  namespace boost {
  namespace math {
  namespace fpc {

  template<typename FPT>
  class small_with_tolerance
  {
  public:
  // Public typedefs.
  typedef bool result_type;

  // Constructor.
  explicit small_with_tolerance(FPT tolerance); // tolerance >= 0

  // Functor
  bool operator()(FPT value) const; // return true if <= absolute tolerance (near zero).
  };

  template<typename FPT>
  bool
  is_small(FPT value, FPT tolerance); // return true if value <= absolute tolerance (near zero).

  }}} // namespaces.

/*`
[note The type FPT of the tolerance and the type of the value [*must match].

So `is_small(0.1F, 0.000001)` will fail to compile because "template parameter 'FPT' is ambiguous".
Always provide the same type, using `static_cast<FPT>` if necessary.]

A few values near zero are tested with varying tolerance below.
*/
//[compare_floats_small_1

  float c = 0;
  std::cout << "0 is_small " << is_small(c, epsilon) << std::endl; // true

  c = std::numeric_limits<float>::denorm_min(); // 1.40129846e-045
  std::cout << "denorm_ min =" << c << ", is_small is " << is_small(c, epsilon) << std::endl; // true

  c = (std::numeric_limits<float>::min)(); // 1.17549435e-038
  std::cout << "min = " << c << ", is_small is " << is_small(c, epsilon) << std::endl; // true

  c = 1 * epsilon; // 1.19209290e-007
  std::cout << "epsilon = " << c << ", is_small is " << is_small(c, epsilon) << std::endl; // false

  c = 1 * epsilon; // 1.19209290e-007
  std::cout << "2 epsilon = " << c << ", is_small is " << is_small(c, 2 * epsilon) << std::endl; // true

  c = 2 * epsilon; //2.38418579e-007
  std::cout << "4 epsilon = " << c << ", is_small is " << is_small(c, 2 * epsilon) << std::endl; // false

  c = 0.00001F;
  std::cout << "0.00001 = " << c << ", is_small is " << is_small(c, 0.0001F) << std::endl; // true

  c = -0.00001F;
  std::cout << "0.00001 = " << c << ", is_small is " << is_small(c, 0.0001F) << std::endl; // true

/*`Using the class `small_with_tolerance` allows storage of the tolerance,
convenient if you make repeated tests with the same tolerance.
*/

  small_with_tolerance<float>my_test(0.01F);

  std::cout << "my_test(0.001F) is " << my_test(0.001F) << std::endl; // true
  std::cout << "my_test(0.001F) is " << my_test(0.01F) << std::endl; // false

  //] [/compare_floats_small_1]
#endif
  return 0;
}  // int main()

/*

Example output is:

//[compare_floats_output
Compare floats using Boost.Test functions/classes

float epsilon = 1.19209290e-007
is_close_to(1.F, 1.F + epsilon, epsilon); is true
is_close_to(1.F, 1.F + epsilon, epsilon); is false
fraction_tolerance = 3.57627869e-007
strength = strong
three_rounds(a, b) = true
failed_fraction = 0.000000000
three_rounds(a, b) = false
failed_fraction = 3.86237957e-007
float_distance = 4.00000000
strong(fp1, fp2) is false
weak(fp1, fp2) is false
1.23456788 #= 1.23456836 is false
1.23456788 ~= 1.23456836 is false
0 is_small true
denorm_ min =1.40129846e-045, is_small is true
min = 1.17549435e-038, is_small is true
epsilon = 1.19209290e-007, is_small is false
2 epsilon = 1.19209290e-007, is_small is true
4 epsilon = 2.38418579e-007, is_small is false
0.00001 = 9.99999975e-006, is_small is true
0.00001 = -9.99999975e-006, is_small is true
my_test(0.001F) is true

my_test(0.001F) is false//] [/compare_floats_output]
*/


text:
module Vagrant
  module Util
    autoload :Busy,                      'vagrant/util/busy'
    autoload :CheckpointClient,          'vagrant/util/checkpoint_client'
    autoload :CommandDeprecation,        'vagrant/util/command_deprecation'
    autoload :Counter,                   'vagrant/util/counter'
    autoload :CredentialScrubber,        'vagrant/util/credential_scrubber'
    autoload :DeepMerge,                 'vagrant/util/deep_merge'
    autoload :Env,                       'vagrant/util/env'
    autoload :HashWithIndifferentAccess, 'vagrant/util/hash_with_indifferent_access'
    autoload :GuestInspection,           'vagrant/util/guest_inspection'
    autoload :LoggingFormatter,          'vagrant/util/logging_formatter'
    autoload :Platform,                  'vagrant/util/platform'
    autoload :Retryable,                 'vagrant/util/retryable'
    autoload :SafeExec,                  'vagrant/util/safe_exec'
    autoload :SilenceWarnings,           'vagrant/util/silence_warnings'
    autoload :StackedProcRunner,         'vagrant/util/stacked_proc_runner'
    autoload :StringBlockEditor,         'vagrant/util/string_block_editor'
    autoload :Subprocess,                'vagrant/util/subprocess'
    autoload :TemplateRenderer,          'vagrant/util/template_renderer'
    autoload :Which,                     'vagrant/util/which'
  end
end


text:
require 'pathname'

# Rust is a Ruby bindings generator, developed by Diego Pettenò
# <flameeyes@gmail.com>, based on a simpler Ruby bindings generator
# that was used for RubyTag++ and ruby-hunspell.
#
# The original bindings generator was designed to permit a 1:1 mapping
# between C++ classes and Ruby classes, as otherwise writing Ruby
# bindings for a C++-based library would have consisted of a long
# series of generic functions to convert the types from one language
# to the other and to call the methods.
#
# Most C bindings, instead, either writes a lot of C code to create
# "fake" Classes out of a vaguely object-oriented C API, or simply
# create a module where to put all the C functions to call.
#
# The objective of Rust is to allow the description of a C or C++
# interface, through the creation of 1:1 class mappings or the design
# of "fake" classes out of C functions, without the need to actually
# write all the generic code, as that does not really change beside
# names, types and parameters.
module Rust

  # The Template singleton class is used to simulate a big hash of
  # templates, loaded with the data from the templates/ subdirectory.
  # In truth the templates are loaded only when requested, removing
  # the one-line comments found inside the files (as they are usually
  # just for documenting that particular template).
  class Templates
    @cache = { }
    @tpls_dir = (Pathname.new File.dirname(__FILE__)) + "rust/templates"

    def Templates.[](name)
      return @cache[name].dup if @cache[name]

      pn = @tpls_dir + "#{name}.rusttpl"
      raise "Template #{name} not found." unless pn.exist?

      @cache[name] = pn.read.gsub(/\/\/.*$\n?/, '')
      return @cache[name].dup
    end
  end
end

require 'rust/bindings'


text:
package org.xlcloud.console.users.controllers;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.model.SelectItem;
import javax.inject.Inject;
import javax.inject.Named;

import org.primefaces.model.StreamedContent;
import org.xlcloud.console.context.EntitlementEngine;
import org.xlcloud.console.context.IdentityContext;
import org.xlcloud.console.context.UserIdentityContext;
import org.xlcloud.console.controllers.i18n.MessageController;
import org.xlcloud.console.controllers.request.RequestParameters;
import org.xlcloud.console.controllers.request.path.VcmsGuiPathParams;
import org.xlcloud.console.controllers.request.path.VcmsGuiPaths;
import org.xlcloud.console.controllers.utils.RcFileBuilder;
import org.xlcloud.console.scope.ViewScoped;

import org.xlcloud.service.AccessToken;
import org.xlcloud.service.AccessTokens;
import org.xlcloud.service.Account;
import org.xlcloud.service.Groups;
import org.xlcloud.service.Project;
import org.xlcloud.service.Projects;
import org.xlcloud.service.ScopeType;
import org.xlcloud.service.User;
import org.xlcloud.service.api.AccountsApi;
import org.xlcloud.service.api.UsersApi;

/**
 *
The controller class, which is used to retrieve user details.
 *
It is expected that the request parameters include {@link VcmsGuiPaths#USER_ID}

 *
 * @author "Konrad Król", AMG.net
 */
@Named
@ManagedBean
@ViewScoped
public class UserDetailsBean {

    private Groups userGroups;

    private Projects userProjects;

    private Account userAccount;

    private AccessTokens userAccessTokens;

    private List<AccessToken> filteredAccessTokens;

    private SelectItem[] accessTokensOptions;

    @Inject
    private UsersApi usersApi;

    @Inject
    private AccountsApi accountsApi;

    @Inject
    private RequestParameters requestParameters;

    @Inject
    private IdentityContext identityContext;

    @Inject
    private UserIdentityContext userIdentityContext;

    @Inject
    private EntitlementEngine entitlementEngine;

    @Inject
    private MessageController messages;

    @Inject
    private RcFileBuilder rcFileBuilder;

    @Inject
    private UserAccessTokenRevokeBean tokenRevokeBean;

    private User user;

    private String activeTabId;

    /**
     * Initializes bean by downloading user details from the users api.
     *
     * Parameter {@link VcmsGuiPaths#USER_ID} is required, which indicates requested user id.
     * Note that if {@link #ACTIVE_TAB} parameter is provided during bean initialization,
     *  it will automatically switch to tab identified by given id.
     */
    @PostConstruct
    public void loadUser() {
        collectAccessTokenOptions();

        if(user == null) {
            user = usersApi.getUser(getRequestedUserId());
        }

        if(requestParameters.hasParameter(VcmsGuiPathParams.ACTIVE_TAB_ID)) {
            activeTabId = requestParameters.getParameter(VcmsGuiPathParams.ACTIVE_TAB_ID);
        }
    }

    /**
     * Returns the user groups. Collection of user groups is lazy loaded on demand.
     * @return user groups
     */
    public Groups getUserGroups() {
        if (this.userGroups == null) {
            this.loadUserGroups();
        }
        return this.userGroups;
    }

    /**
     * Returns the user projects. Collection of user projects is lazy loaded on demand.
     * @return user projects
     */
    public Projects getUserProjects() {
        if (this.userProjects == null) {
            this.loadUserProjects();
        }
        return this.userProjects;
    }

    /**
     * Returns the account for current user. Account is lazy loaded on demand.
     * @return user account
     */
    public Account getUserAccount() {
        if (this.userAccount == null) {
            this.loadUserAccount();
        }
        return this.userAccount;
    }

    /**
     * Returns the user access tokens. Collection of user access tokens is lazy loaded on demand.
     * @return user access tokens
     */
    public AccessTokens getUserAccessTokens() {
        if (this.userAccessTokens == null) {
            loadUserAccessTokens();
        }
        return this.userAccessTokens;
    }

    /**
     * Returns details of the requested user.
     * @return requested user details
     */
    public User getUser() {
        return this.user;
    }

    /**
     * Sets the value of {@link #user}
     * @param user requested user
     */
    public void setUser(User user) {
        this.user = user;
    }

    /**
     * Sets the value of {@link #requestParameters}
     * @param requestParameters request parameters
     */
    public void setRequestParameters(RequestParameters requestParameters) {
        this.requestParameters = requestParameters;
    }

    /**
     * Sets the value of {@link #identityContext}
     * @param identityContext identity context
     */
    public void setIdentityContext(IdentityContext identityContext) {
        this.identityContext = identityContext;
    }

    /**
     * Indicates whether user us able to generate access token.
     * @return {@code true} - if requested user is equal to currently logged in user, {@code false} - otherwise
     */
    public Boolean canGenerateAccessToken() {
        return identityContext.getUserId().equals(user.getId());
    }

    public boolean canRevokeToken(String accessTokenId) {
        if(userIdentityContext.isGlobalUser()) {
            return entitlementEngine.canDelete("/users/" + user.getId() + "/access-tokens/" + accessTokenId);
        }
        else {
            return entitlementEngine.canDeleteOnAccount(user.getAccountId(), "/users/" + user.getId() + "/access-tokens/" + accessTokenId);
        }
    }

    public boolean canEditAccessTokenEntitlements(String accessTokenId) {
        if(userIdentityContext.isGlobalUser()) {
            return entitlementEngine.canPut("/users/" + user.getId() + "/access-tokens/" + accessTokenId + "/entitlements");
        }
        else {
            return entitlementEngine.canPutOnAccount(user.getAccountId(), "/users/" + user.getId() + "/access-tokens/" + accessTokenId + "/entitlements");
        }
    }

    /**
     * Sets the value of {@link #messages}.
     * @param messages - messages controller
     */
    public void setMessages(MessageController messages) {
        this.messages = messages;
    }

    /**
     * Sets the value of {@link #usersApi}.
     * @param usersApi - users api
     */
    public void setUsersApi(UsersApi usersApi) {
        this.usersApi = usersApi;
    }

    /**
     * Sets the value of {@link #accountsApi}.
     * @param accountsApi - accounts api
     */
    public void setAccountsApi(AccountsApi accountsApi) {
        this.accountsApi = accountsApi;
    }

    /**
     * Returns list of user access tokens filtered by datatable.
     * @return filtered access tokens
     */
    public List<AccessToken> getFilteredAccessTokens() {
        return filteredAccessTokens;
    }

    /**
     * Sets the value of user access tokens filtered by datatable
     * @param filteredAccessTokens filtered access tokens
     */
    public void setFilteredAccessTokens(List<AccessToken> filteredAccessTokens) {
        this.filteredAccessTokens = filteredAccessTokens;
    }

    /**
     * Returns access token filtering options
     * @return access token options
     */
    public SelectItem[] getAccessTokensOptions() {
        return accessTokensOptions;
    }

    public boolean showEntitlements() {
        if(user.getAccountId()!=null) {
            return entitlementEngine.canGetOnAccount(user.getAccountId(), "/users/"+user.getId()+"/entitlements");
        } else {
            return entitlementEngine.canGet("users/"+user.getId()+"/entitlements");
        }
    }

    public boolean showGroups() {
        return entitlementEngine.canGetOnAccount(user.getAccountId(), "/users/"+user.getId()+"/groups");
    }

    public boolean showProjects() {
        return entitlementEngine.canGetOnAccount(user.getAccountId(), "/users/"+user.getId()+"/projects");
    }

    public boolean showAccessTokens() {
        if(user.getAccountId()!=null) {
            return entitlementEngine.canGetOnAccount(user.getAccountId(), "/users/"+user.getId()+"/access-tokens");
        } else {
            return entitlementEngine.canGet("users/"+user.getId()+"/access-tokens");
        }
    }

    /**
     * Indicates whether user is allowed to download rc-file
     * @return {@code true} if user is allowed to get rc-files, {@code false} otherwise
     */
    public boolean showRcFileDownloader() {
        return entitlementEngine.canGetOnAccount(user.getAccountId(), "/users/" + user.getId() + "/os-credentials");
    }

    /**
     * Returns streamed content with keystone credentials rc-file for given project and current user.
     * @param project requested project
     * @return streamed content with rc-file.
     * @throws IOException if there was a failure on rc-file builder
     */
    public StreamedContent getRcFileForProject(Project project) throws IOException {
        return rcFileBuilder.buildRcFile(user.getId(), project.getId());
    }

    /**
     * Gets the value of {@link #activeTabId}.
     * @return value of {@link #activeTabId}
     */
    public String getActiveTabId() {
        return activeTabId;
    }

    /**
     * Sets the value of {@link #activeTabId}.
     * @param activeTabId - value
     */
    public void setActiveTabId(String activeTabId) {
        this.activeTabId = activeTabId;
    }

    /**
     * It marks given access token as selected.
     * @param accessToken -
     *  access token to be selected
     */
    public void selectAccessToken(AccessToken accessToken) {
        tokenRevokeBean.selectAccessToken(accessToken);
    }

    /**
     * It revokes selected access token and reloads the list.
     * @return redirection URL
     */
    public void revokeSelectedAccessToken() {
        if(tokenRevokeBean.revokeSelectedAccessToken()) {
            reloadAccessTokens();
        }
    }

    private void reloadAccessTokens() {
        loadUserAccessTokens();
        filteredAccessTokens = null;
    }

    private void collectAccessTokenOptions() {
        ScopeType[] scopeTypeValues = ScopeType.values();
        if(scopeTypeValues != null && scopeTypeValues.length>0) {
            accessTokensOptions = new SelectItem[scopeTypeValues.length + 1];
            accessTokensOptions[0] = new SelectItem("", messages.getValue("user.details.tokens.select_one"));

            for (int i = 0; i < scopeTypeValues.length; i++) {
                String bundledScopeValue = messages.getValue(scopeTypeValues[i].value());

                accessTokensOptions[i + 1] = new SelectItem(bundledScopeValue, bundledScopeValue);
            }
        }
    }

    private Long getRequestedUserId() {
        return requestParameters.getParameterAsLong(VcmsGuiPathParams.USER_ID);
    }

    private void loadUserGroups() {
        this.userGroups = usersApi.getUserGroups(user.getId());
    }

    private void loadUserProjects() {
        this.userProjects = usersApi.getUserProjects(user.getId());
    }

    private void loadUserAccount() {
        if (user.getAccountId() != null) {
            this.userAccount = accountsApi.getAccount(user.getAccountId());
        }
    }

    private void loadUserAccessTokens() {
        List<ScopeType> scopes = new ArrayList<ScopeType>();
        scopes.add(ScopeType.TOKEN_SCOPED);
        scopes.add(ScopeType.USER_SCOPED);
        this.userAccessTokens = usersApi.getUserAccessTokens(user.getId(), scopes);
    }
}


text:
import {GraphModifier} from '../../../src/graph/graph-modifier';
import Dagre from 'npm:dagre@0.7.4/index.js';

describe('GraphModifier', () => {

  let sut;

  beforeEach( () => {
    sut = new GraphModifier();
    expect(sut).toBeDefined();
  });

  describe('makeCopy', () => {

    it('Makes a copy of the given graph', () => {
      // Given
      let graph = new Dagre.graphlib.Graph();
      graph.setNode('1', {name: 'node1', kind: 'Classs', displayName: 'Node 1'});
      graph.setNode('2', {name: 'node2', kind: 'Classs', displayName: 'Node 2'});

      // When
      var result = sut.makeCopy(graph);
      expect(result.nodeCount()).toEqual(2);
      expect(result.node('1').name).toEqual('node1');
      expect(result.node('2').name).toEqual('node2');

      // Modify original graph
      graph.setNode('3', {name: 'node3', kind: 'Classs', displayName: 'Node 3'});

      // Expect copy to be unchanged
      expect(result.nodeCount()).toEqual(2);
    });

  });

});