text:
//  ----------------------------------------------------------------------------------
//  Copyright Microsoft Corporation
//  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at
//  http://www.apache.org/licenses/LICENSE-2.0
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
//  ----------------------------------------------------------------------------------

namespace DurableTask.Emulator.Tests
{
    using System;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.Linq;
    using System.Threading;
    using System.Threading.Tasks;
    using DurableTask.Core;
    using DurableTask.Core.Exceptions;
    using DurableTask.Emulator;
    using DurableTask.Test.Orchestrations;
    using Microsoft.VisualStudio.TestTools.UnitTesting;

    /// <summary>
    /// Test the core dtfx via the emulator local orchestration service and client provider
    /// </summary>
    [TestClass]
    public class EmulatorFunctionalTests
    {
        public TestContext TestContext { get; set; }

        // Disabled while investigating CI timeout issues
        ////[TestMethod]
        public async Task MockOrchestrationTest()
        {
            var orchestrationService = new LocalOrchestrationService();

            var worker = new TaskHubWorker(orchestrationService);

            await worker.AddTaskOrchestrations(typeof(SimplestGreetingsOrchestration))
                .AddTaskActivities(typeof(SimplestGetUserTask), typeof(SimplestSendGreetingTask))
                .StartAsync();

            var client = new TaskHubClient(orchestrationService);

            OrchestrationInstance id = await client.CreateOrchestrationInstanceAsync(typeof(SimplestGreetingsOrchestration), null);

            OrchestrationState result = await client.WaitForOrchestrationAsync(id, TimeSpan.FromSeconds(30), new CancellationToken());
            Assert.AreEqual(OrchestrationStatus.Completed, result.OrchestrationStatus);

            Assert.AreEqual("Greeting send to Gabbar", SimplestGreetingsOrchestration.Result, "Orchestration Result is wrong!!!");

            await worker.StopAsync(true);
        }

        // Disabled while investigating CI timeout issues
        ////[TestMethod]
        public async Task MockRecreateOrchestrationTest()
        {
            var orchestrationService = new LocalOrchestrationService();

            var worker = new TaskHubWorker(orchestrationService);

            await worker.AddTaskOrchestrations(typeof(SimplestGreetingsOrchestration))
                .AddTaskActivities(typeof(SimplestGetUserTask), typeof(SimplestSendGreetingTask))
                .StartAsync();

            var client = new TaskHubClient(orchestrationService);

            OrchestrationInstance id = await client.CreateOrchestrationInstanceAsync(typeof(SimplestGreetingsOrchestration), null);

            OrchestrationState result = await client.WaitForOrchestrationAsync(id, TimeSpan.FromSeconds(30), new CancellationToken());
            Assert.AreEqual(OrchestrationStatus.Completed, result.OrchestrationStatus);

            await Assert.ThrowsExceptionAsync<OrchestrationAlreadyExistsException>(() => client.CreateOrchestrationInstanceAsync(typeof(SimplestGreetingsOrchestration), id.InstanceId, null));

            await Assert.ThrowsExceptionAsync<OrchestrationAlreadyExistsException>(() => client.CreateOrchestrationInstanceAsync(typeof(SimplestGreetingsOrchestration), id.InstanceId, null, new[] { OrchestrationStatus.Completed }));

            SimplestGreetingsOrchestration.Result = String.Empty;

            OrchestrationInstance id2 = await client.CreateOrchestrationInstanceAsync(typeof(SimplestGreetingsOrchestration), id.InstanceId, null, new OrchestrationStatus[] { });
            result = await client.WaitForOrchestrationAsync(id2, TimeSpan.FromSeconds(30), new CancellationToken());
            Assert.AreEqual(OrchestrationStatus.Completed, result.OrchestrationStatus);

            Assert.AreEqual("Greeting send to Gabbar", SimplestGreetingsOrchestration.Result,
                "Orchestration Result on Re-Create is wrong!!!");

            await worker.StopAsync(true);
        }

        [TestMethod]
        public async Task MockTimerTest()
        {
            var orchestrationService = new LocalOrchestrationService();

            var worker = new TaskHubWorker(orchestrationService);

            await worker.AddTaskOrchestrations(typeof(SimplestGreetingsOrchestration))
                .AddTaskActivities(typeof(SimplestGetUserTask), typeof(SimplestSendGreetingTask))
                .StartAsync();

            var client = new TaskHubClient(orchestrationService);

            OrchestrationInstance id = await client.CreateOrchestrationInstanceAsync(typeof(SimplestGreetingsOrchestration), "6");

            Stopwatch sw = Stopwatch.StartNew();
            OrchestrationState result = await client.WaitForOrchestrationAsync(id, TimeSpan.FromSeconds(40), new CancellationToken());
            Assert.AreEqual(OrchestrationStatus.Completed, result.OrchestrationStatus);

            Assert.IsTrue(sw.Elapsed.Seconds > 6);

            Assert.AreEqual("Greeting send to Gabbar", SimplestGreetingsOrchestration.Result,
                "Orchestration Result is wrong!!!");

            await worker.StopAsync(true);
        }

        [TestMethod]
        public async Task MockRepeatTimerTest()
        {
            var orchestrationService = new LocalOrchestrationService();

            var worker = new TaskHubWorker(orchestrationService);

            await worker.AddTaskOrchestrations(typeof(GreetingsRepeatWaitOrchestration))
                .AddTaskActivities(typeof(SimplestGetUserTask), typeof(SimplestSendGreetingTask))
                .StartAsync();

            var client = new TaskHubClient(orchestrationService);

            OrchestrationInstance id = await client.CreateOrchestrationInstanceAsync(typeof(GreetingsRepeatWaitOrchestration), "1");

            Stopwatch sw = Stopwatch.StartNew();
            OrchestrationState result = await client.WaitForOrchestrationAsync(id, TimeSpan.FromSeconds(40), new CancellationToken());
            Assert.AreEqual(OrchestrationStatus.Completed, result.OrchestrationStatus);

            Assert.IsTrue(sw.Elapsed.Seconds > 3);

            Assert.AreEqual("Greeting send to Gabbar", GreetingsRepeatWaitOrchestration.Result,
                "Orchestration Result is wrong!!!");

            await worker.StopAsync(true);
        }

        // Disabled while investigating CI timeout issues
        ////[TestMethod]
        public async Task MockGenerationTest()
        {
            GenerationBasicOrchestration.Result = 0;
            GenerationBasicTask.GenerationCount = 0;

            var orchestrationService = new LocalOrchestrationService();

            var worker = new TaskHubWorker(orchestrationService);
            var client = new TaskHubClient(orchestrationService);

            await worker.AddTaskOrchestrations(typeof(GenerationBasicOrchestration))
                .AddTaskActivities(new GenerationBasicTask())
                .StartAsync();

            OrchestrationInstance id = await client.CreateOrchestrationInstanceAsync(typeof(GenerationBasicOrchestration), 4);

            // strip out the eid so we wait for the latest one always
            var masterId = new OrchestrationInstance { InstanceId = id.InstanceId };

            OrchestrationState result1 = await client.WaitForOrchestrationAsync(id, TimeSpan.FromSeconds(10), CancellationToken.None);

            OrchestrationState result2 = await client.WaitForOrchestrationAsync(masterId, TimeSpan.FromSeconds(20), CancellationToken.None);

            Assert.AreEqual(OrchestrationStatus.ContinuedAsNew, result1.OrchestrationStatus);
            Assert.AreEqual(OrchestrationStatus.Completed, result2.OrchestrationStatus);

            Assert.AreEqual(4, GenerationBasicOrchestration.Result, "Orchestration Result is wrong!!!");
        }

        // Disabled while investigating CI timeout issues
        ////[TestMethod]
        public async Task MockSubOrchestrationTest()
        {
            var orchestrationService = new LocalOrchestrationService();

            var worker = new TaskHubWorker(orchestrationService);
            var client = new TaskHubClient(orchestrationService);

            await worker.AddTaskOrchestrations(typeof(ParentWorkflow), typeof(ChildWorkflow))
                .StartAsync();

            OrchestrationInstance id = await client.CreateOrchestrationInstanceAsync(typeof(ParentWorkflow), true);

            OrchestrationState result = await client.WaitForOrchestrationAsync(id,
                TimeSpan.FromSeconds(40), CancellationToken.None);

            Assert.AreEqual(OrchestrationStatus.Completed, result.OrchestrationStatus);
            Assert.AreEqual(
                "Child '0' completed.Child '1' completed.Child '2' completed.Child '3' completed.Child '4' completed.",
                ParentWorkflow.Result, "Orchestration Result is wrong!!!");

            ParentWorkflow.Result = string.Empty;

            id = await client.CreateOrchestrationInstanceAsync(typeof(ParentWorkflow), false);

            result = await client.WaitForOrchestrationAsync(id, TimeSpan.FromSeconds(40), CancellationToken.None);

            Assert.AreEqual(OrchestrationStatus.Completed, result.OrchestrationStatus);
            Assert.AreEqual(
                "Child '0' completed.Child '1' completed.Child '2' completed.Child '3' completed.Child '4' completed.",
                ParentWorkflow.Result, "Orchestration Result is wrong!!!");

            await worker.StopAsync(true);
        }

        [TestMethod]
        public async Task MockRaiseEventTest()
        {
            var orchestrationService = new LocalOrchestrationService();

            var worker = new TaskHubWorker(orchestrationService);
            var client = new TaskHubClient(orchestrationService);

            await worker.AddTaskOrchestrations(typeof(GenerationSignalOrchestration))
                .StartAsync();

            OrchestrationInstance id = await client.CreateOrchestrationInstanceAsync(
                typeof(GenerationSignalOrchestration), 5);

            var signalId = new OrchestrationInstance { InstanceId = id.InstanceId };

            await Task.Delay(2 * 500);
            await client.RaiseEventAsync(signalId, "Count", "1");
            GenerationSignalOrchestration.Signal.Set();

            await Task.Delay(2 * 500);
            GenerationSignalOrchestration.Signal.Reset();
            await client.RaiseEventAsync(signalId, "Count", "2");
            await Task.Delay(2 * 500);
            await client.RaiseEventAsync(signalId, "Count", "3"); // will be received by next generation
            GenerationSignalOrchestration.Signal.Set();

            await Task.Delay(2 * 500);
            GenerationSignalOrchestration.Signal.Reset();
            await client.RaiseEventAsync(signalId, "Count", "4");
            await Task.Delay(2 * 500);
            await client.RaiseEventAsync(signalId, "Count", "5"); // will be received by next generation
            await client.RaiseEventAsync(signalId, "Count", "6"); // lost
            await client.RaiseEventAsync(signalId, "Count", "7"); // lost
            GenerationSignalOrchestration.Signal.Set();

            OrchestrationState result = await client.WaitForOrchestrationAsync(new OrchestrationInstance { InstanceId = id.InstanceId },
                TimeSpan.FromSeconds(40), CancellationToken.None);

            Assert.AreEqual(OrchestrationStatus.Completed, result.OrchestrationStatus);
            Assert.AreEqual("5", GenerationSignalOrchestration.Result, "Orchestration Result is wrong!!!");
        }

        ////[TestMethod]
        ////public async Task TerminateOrchestrationTest()
        ////{
        ////    var orchestrationService = new LocalOrchestrationService();

        ////    await orchestrationService.StartAsync();

        ////    TaskHubWorker worker = new TaskHubWorker(orchestrationService, "test", new TaskHubWorkerSettings());

        ////    worker.AddTaskOrchestrations(typeof(SimplestGreetingsOrchestration))
        ////        .AddTaskActivities(typeof(SimplestGetUserTask), typeof(SimplestSendGreetingTask))
        ////        .Start();

        ////    TaskHubClient client = new TaskHubClient(orchestrationService, "test", new TaskHubClientSettings());

        ////    OrchestrationInstance id = await client.CreateOrchestrationInstanceAsync(typeof(SimplestGreetingsOrchestration), "60");

        ////    OrchestrationState result = await client.WaitForOrchestrationAsync(id, TimeSpan.FromSeconds(10), new CancellationToken());
        ////    Assert.AreEqual("Greeting send to Gabbar", SimplestGreetingsOrchestration.Result,
        ////        "Orchestration Result is wrong!!!");

        ////    await orchestrationService.StopAsync();
        ////}

        [TestMethod]
        public async Task MockOrchestrationTagsTest()
        {
            var orchestrationService = new LocalOrchestrationService();

            var worker = new TaskHubWorker(orchestrationService);

            var orchestrationType = typeof(SimplestGreetingsOrchestration);
            await worker.AddTaskOrchestrations(orchestrationType)
                .AddTaskActivities(typeof(SimplestGetUserTask), typeof(SimplestSendGreetingTask))
                .StartAsync();

            var client = new TaskHubClient(orchestrationService);

            var instanceId = Guid.NewGuid().ToString("N");
            var tags = new Dictionary<string, string>
            {
                { "tag1", "value1" },
                { "tag2", "value2" },
            };

            OrchestrationInstance id = await client.CreateOrchestrationInstanceAsync(NameVersionHelper.GetDefaultName(orchestrationType),
                NameVersionHelper.GetDefaultVersion(orchestrationType), instanceId, input: null, tags);
            Assert.AreEqual(instanceId, id.InstanceId);

            OrchestrationState state = await client.GetOrchestrationStateAsync(id);
            AssertTagsEqual(tags, state.Tags);

            state = await client.WaitForOrchestrationAsync(id, TimeSpan.FromSeconds(30), CancellationToken.None);
            AssertTagsEqual(tags, state.Tags);

            await worker.StopAsync(true);
        }

        private static void AssertTagsEqual(IDictionary<string, string> expectedTags, IDictionary<string, string> actualTags)
        {
            Assert.IsNotNull(actualTags);
            Assert.AreEqual(expectedTags.Count, actualTags.Count);
            Assert.IsTrue(expectedTags.All(tag => actualTags.TryGetValue(tag.Key, out var value) && value == tag.Value));
        }
    }
}


text:
    <title>Paradoxical - Sound Transfer</title>

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
    <link rel="stylesheet" href="/style.css">

Paradoxical

A computer science blog.

Code

Author

Dialogue Graphs

Sound Transfer

Tie-Dye Algorithm

Games

Berry Hop

The Land of Stuff

Mister Man

Odyssey

Music

Compositions

Covers

Sound Transfer

Sound Transfer is a system to send a message from your computer to a friend's with speaker and mic. It uses a melodic pitch-based protocol, which means you can hear your message converted into a musical ditty in the process!

Check out the source code on GitHub: Sound Transfer.

Method: The outgoing message is converted into its binary ASCII representation, then converted to pitches with the melodic protocol. The receiver picks up the pitches with Fourier transforms and decodes from binary to ASCII text.

Here's the protocol.

Pitch   Symbol  Meaning
---------------------------------------
1976 Hz  '!'    Begin transmission.
1174 Hz  '0'    Send a binary 0.
784 Hz   '1'    Send a binary 1.
988 Hz   '*'    Used as a separator between repeated digits.
1568 Hz  '.'    End transmission.

Wow! So musical!

Create your own message melodies.

Return to home.

	    Copyright Andrew Wang. Powered by nanosite.

redpajama_set_name: RedPajamaGithub


text:
RecordInfo::RecordInfo(BTree *btree) : NodeContent(btree) {
}

int RecordInfo::getLength() {
	return length;
}

void RecordInfo::toBytes(uint8_t *bytes) {
	memcpy(bytes, data, length);
}

void RecordInfo::fromBytes(uint8_t *bytes, int length, BTreeElement *parent) {
	data = (uint8_t*)malloc(length);
	memcpy(data, bytes, length);
	this->length = length;
}


text:
A Syntax theme for atom editor.

- Recommended UI theme is [Atom Material UI](https://atom.io/themes/atom-material-ui)
- Recommended Font family is [Ubutnu Mono](http://font.ubuntu.com/)

Also you can install it with `apm install creative-dark-syntax`

#### PHP

![Atom Creative Theme](https://raw.githubusercontent.com/Mehdi-Hp/atom-creative-dark-syntax/master/php.png)

#### SASS

![Atom Creative Theme](https://raw.githubusercontent.com/Mehdi-Hp/atom-creative-dark-syntax/master/sass.png)

#### JS

![Atom Creative Theme](https://raw.githubusercontent.com/Mehdi-Hp/atom-creative-dark-syntax/master/js.png)


text:
<!DOCTYPE html>

	@@include("./part/head_bak.html")
	<title>HUD界面</title>

HUD界面

全屏显示

		  	<input type="text" class="message" name="message" placeholder="请输入需要执行的指令" />
		  	<input type="button" class="btn" value="发送指令" />

接收服务器响应消息:

		  	<textarea class="textarea"></textarea>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MezunBilgiSistemi.Models;
using MezunBilgiSistemi.ADT.Heap;

namespace MezunBilgiSistemi.ADT.HashTable
{
    public class HashTableADT
    {
        Dictionary<string, HeapADT> bolumlerTablosu;
        public HashTableADT()
        {
            bolumlerTablosu = new Dictionary<string, HeapADT>();
        }
        public HeapADT BolumHeapiniGetir(string bolumAdi)
        {
            return bolumlerTablosu[bolumAdi];
        }
        public void BolumEkle(string bolumAdi, HeapADT bolumHeap)
        {
            this.bolumlerTablosu[bolumAdi] = bolumHeap;
        }
        public void BolumSil(string bolumAdi)
        {
            this.bolumlerTablosu.Remove(bolumAdi);
        }
    }
}


text:
package com.bwyap.engine.gui.element;

import com.bwyap.engine.gui.element.base.Button;
import com.bwyap.engine.gui.element.vector.VectorButton;
import com.bwyap.engine.gui.interfaces.IVectorRect;

/**
 * A rectangular button that is drawn by the graphics rendering system.
 * See {@link Button}.
 * @author bwyap
 *
 */
public abstract class RectangularButton extends VectorButton implements IVectorRect {

	public RectangularButton(int x, int y, float width, float height) {
		super(x, y, width, height);
	}

}


text:
package com.zavtech.morpheus.frame;

import org.apache.commons.math3.linear.RealMatrix;

import com.zavtech.morpheus.jama.Matrix;

/**
 * An interface that can export a DataFrame as other common used representations
 *
 *
This is open source software released under the Apache 2.0 License

 *
 * @author  Xavier Witdouck
 */
public interface DataFrameExport {

    /**
     * Returns a Jama Matrix representation of the DataFrame
     * @return      the Jama Matrix representation of the DataFrame
     */
    Matrix asMatrix();

    /**
     * Returns a Apache Commons Math RealMatrix representation of this DataFrame
     * @return      the RealMatrix representing this DataFrame
     */
    RealMatrix asApacheMatrix();

}


text:
class Calculator
  def initialize
    @stack = []
  end

  def push(arg)
    @stack.push arg
  end

  def result
    @stack.last
  end

  def +
    @stack.push @stack.pop + @stack.pop
  end

  def /
    divisor = @stack.pop
    dividend = @stack.pop # Hm, @stack.pop(2) doesn't work
    @stack.push dividend / divisor
  end
end


text:
package com.att.research.xacml.api;

import java.util.Properties;

import com.att.research.xacml.util.FactoryException;
import com.att.research.xacml.util.FactoryFinder;

/**
 * Abstract class for mapping data type {@link com.att.research.xacml.api.Identifier}s to
 * {@link com.att.research.xacml.api.DataType} objects.
 *
 * The static newInstance method looks for the class name of the class extending DataTypeFactory by looking for the
 * property: {@code xacml.dataTypeFactory} in the following places (in order):
 * 		1. System properties
 * 		2. The xacml.properties file which is located by:
 * 			a) {@code System.getProperty("xacml.properties")}
 * 			b) {@code java.home/xacml.properties}
 * 		3. If the class name is not found in one of these properties, the default is: {@code com.att.research.xacml.std.StdDataTypeFactory}
 *
 * @author Christopher A. Rath
 * @version $Revision: 1.2 $
 */
public abstract class DataTypeFactory {
	private static final String	FACTORYID					= "xacml.dataTypeFactory";
	private static final String	DEFAULT_FACTORY_CLASSNAME	= "com.att.research.xacml.std.StdDataTypeFactory";

	/**
	 * Protected constructor so this class cannot be instantiated.
	 */
	protected DataTypeFactory() {

	}

	/**
	 * Protected constructor so this class cannot be instantiated.
	 */
	protected DataTypeFactory(Properties properties) {
	}

	/**
	 * Maps the given {@link com.att.research.xacml.api.Identifier} representing a XACML data type id to a {@link com.att.research.xacml.api.DataType}
	 * object implementing that data type.
	 *
	 * @param dataTypeId the Identifier of the DataType to retrieve.
	 * @return the DataType with the given Identifier or null if there is no match.
	 */
	public abstract DataType<?> getDataType(Identifier dataTypeId);

	/**
	 * Creates an instance of the DataTypeFactory using default configuration information.
	 *
	 * @return the default DataTypeFactory
	 * @throws FactoryException
	 */
	public static DataTypeFactory newInstance() throws FactoryException {
		return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, DataTypeFactory.class);
	}

	/**
	 * Creates an instance of the DataTypeFactory using default configuration information.
	 *
	 * @param properties
	 * @return the default DataTypeFactory
	 * @throws FactoryException
	 */
	public static DataTypeFactory newInstance(Properties properties) throws FactoryException {
		return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, DataTypeFactory.class, properties);
	}

	/**
	 * Creates an instance of the DataTypeFactory using the given class name.
	 *
	 * @param className the String class name of the DataTypeFactory to create
	 * @return the DataTypeFactory for the given class name.
	 * @throws FactoryException Factory Exception
	 */
	public static DataTypeFactory newInstance(String className) throws FactoryException {
		return FactoryFinder.newInstance(className, DataTypeFactory.class, null, true);
	}

	/**
	 * Creates an instance of the DataTypeFactory using the given class name using the given ClassLoader.
	 *
	 * @param className the String class name of the DataTypeFactory to create
	 * @param classLoader the ClassLoader to use to load the class with the given class name
	 * @return the DataTypeFactory for the given class name
	 * @throws FactoryException Factory Exception
	 */
	public static DataTypeFactory newInstance(String className, ClassLoader classLoader) throws FactoryException {
		return FactoryFinder.newInstance(className, DataTypeFactory.class, classLoader, false);
	}
}


text:
var MapController = (function() {

  function MapController(stations, services, element) {
    this.services = services;
    this.stations = stations;
    this.el = element;

    Backbone.Mediator.subscribe('map:station:findAndShow', this.findAndAdd, this);
    Backbone.Mediator.subscribe('map:user:locate', this.locateUser, this);

    this.build();
  };

  MapController.prototype.build = function() {
    var mv = new MapView({'collection': this.stations, 'services': this.services});
    mv.setElement(this.el);
    mv.render();
    mv.drawStations(); //TODO necessary?
  };

  MapController.prototype.findAndAdd = function (latlng) {
    var lat = latlng.lat;
    var lng = latlng.lng;

    var matches = this.stations.getByCoordinates([lng, lat]);
    var stationsView = new StationsView({'collection': matches});

    $('#temp-modals').html(stationsView.render().el);
    $(stationsView.el).modal('show');
  };

  MapController.prototype.locateUser = function () {
    var geolocationSuccess = function(location) {
      Backbone.Mediator.publish('map:user:locate:success', location);
    };
    var geolocationError = function(error) {
      Backbone.Mediator.publish('map:user:locate:error', error);
      Helpers.showErrorMessage("Positioning error", error.message);
    };

    navigator.geolocation.getCurrentPosition(geolocationSuccess, geolocationError, { timeout: 60000, enableHighAccuracy: true });
  };

  return MapController;

})();


text:
using TestUnium.Settings;
using Xunit;

namespace xUnitDemoProject.Tests.ContextIndependentTests.CustomSettingsTests
{
    /// <summary>
    /// TestSuite decorated with nosettings attribute doesn't load settings and ignores all customizations related to it.
    /// </summary>
    [NoSettings]
    public class NoSettingsTestSuite : TestBase
    {
       [Fact]
        public void OpenGitHubTestCase()
        {
            // Settings field equals null in this case
           if (Settings != null) return;
           Driver.Manage().Window.Maximize();
           Driver.Navigate().GoToUrl("http://github.com");
        }
    }
}


text:
//*******************************************************************************************//
//                                                                                //
// Download Free Evaluation Version From: https://bytescout.com/download/web-installer       //
//                                                                                //
// Also available as Web API! Get Your Free API Key: https://app.pdf.co/signup               //
//                                                                                //
// Copyright © 2017-2020 ByteScout, Inc. All rights reserved.                                //
// https://www.bytescout.com                                                                 //
// https://pdf.co                                                                            //
//                                                                                //
//*******************************************************************************************//

// Please NOTE: In this sample we're assuming Cloud Api Server is hosted at "https://localhost".
// If it's not then please replace this with with your hosting url.

var https = require("https");
var path = require("path");
var fs = require("fs");

// Result image file name
const DestinationFile = "./barcode.png";
// Barcode type.
const BarcodeType = "Code128";
// Barcode value
const BarcodeValue = "qweasd123456";

// Prepare request to `Barcode Generator` API endpoint
var queryPath = `/barcode/generate?name=${path.basename(DestinationFile)}&type=${BarcodeType}&value=${BarcodeValue}&async=True`;
var reqOptions = {
    host: "localhost",
    path: encodeURI(queryPath)
};
// Send request
https.get(reqOptions, (response) => {
    response.on("data", (d) => {
        // Parse JSON response
        var data = JSON.parse(d);

        if (data.error == false) {
            console.log(`Job #${data.jobId} has been created!`);
            checkIfJobIsCompleted(data.jobId, data.url);
        }
        else {
            // Service reported error
            console.log(data.message);
        }
    });
}).on("error", (e) => {
    // Request error
    console.error(e);
});

function checkIfJobIsCompleted(jobId, resultFileUrl) {
    let queryPath = `/job/check?jobid=${jobId}`;
    let reqOptions = {
        host: "localhost",
        path: encodeURI(queryPath),
        method: "GET"
    };

    https.get(reqOptions, (response) => {
        response.on("data", (d) => {
            response.setEncoding("utf8");
            // Parse JSON response
            let data = JSON.parse(d);

            console.log(`Checking Job #${jobId}, Status: ${data.status}, Time: ${new Date().toLocaleString()}`);

            if (data.status == "working") {
                // Check again after 3 seconds
				setTimeout(function(){ checkIfJobIsCompleted(jobId, resultFileUrl);}, 3000);
            }
            else if (data.status == "success") {
                // Download image file
                var file = fs.createWriteStream(DestinationFile);
                https.get(resultFileUrl, (response2) => {
                    response2.pipe(file)
                        .on("close", () => {
                            console.log(`Generated image file saved as "${DestinationFile}" file.`);
                        });
                });
            }
            else {
                console.log(`Operation ended with status: "${data.status}".`);
            }
        })
    });
}


text:
\section{Related Work}\label{sec:related}

\paragraph{Higher order Logics and Dependent Type Systems}
%
including
NuPRL~\citep{Constable86},
Coq~\citep{coq-book}, Agda~\citep{norell07},
and even to some extent, \haskell~\citep{JonesVWW06, McBride02},
occupy the maximal extreme of the expressiveness spectrum.
However, in these settings, checking requires explicit
proof terms which can add considerable programmer overhead.
%
Our goal is to eliminate the programmer overhead of
proof construction by restricting specifications to
decidable, first order logics and to see how far
we can go without giving up on expressiveness.
%
The \fstar system enables full dependent typing via
SMT solvers via a higher-order universally quantified
logic that permit specifications similar to ours
(\eg @compose@, @filter@ and @foldr@).
%% https://github.com/FStarLang/FStar/
%
While this approach is at least as expressive
as bounded refinements it has two drawbacks.
%
First, due to the quantifiers, the generated VCs
fall outside the SMT decidable theories.
This renders the type system undecidable (in theory),
forcing a dependency on the solver's unpredictable
quantifier instantiation heuristics (in practice).
%
Second, more importantly, % perhaps more importantly,
the higher order
predicates must be \emph{explicitly} instantiated,
placing a heavy annotation burden on the programmer.
%
In contrast, bounds permit decidable
checking, and are automatically instantiated
via Liquid Types.

\paragraph{Our notion of Refinement Types}
%
has its roots in the predicate subtyping
of PVS~\cite{Rushby98} and \emph{indexed types}
(DML~\cite{pfenningxi98}) where types are constrained
by predicates drawn from a logic.
%
To ensure decidable checking several refinement
type systems including~\citep{pfenningxi98,Dunfield07,Vazou14}
restrict refinements to decidable, quantifier free logics.
%
While this ensures predictable checking and inference~\cite{LiquidPLDI08}
it severely limits the language of specifications, and makes it hard to
fashion simple higher order abstractions like @filter@ (let alone the more
complex ones like relational algebras and state transformers.)

\paragraph{To Reconcile Expressiveness and Decidability}
%
\catalyst~\citep{catalyst} permits a form of
higher order specifications where refinements
are relations which may themselves be parameterized
by other relations, which allows for example, a
way to precisely type @filter@ by suitably
composing relations.
%
However, to ensure decidable checking, \catalyst
is limited to relations that can be specified as
catamorphisms over inductive types, precluding
for example, theories like arithmetic.
More importantly, (like \fstar), \catalyst provides
no inference: higher order relations must be
\emph{explicitly} instantiated.
%
Bounded refinements build directly upon
abstract refinements~\citep{vazou13},
a form of refinement polymorphism
analogous to parametric polymorphism.
%
While \cite{vazou13} adds expressiveness via
abstract refinements, without bounds we cannot
specify any \emph{relationships between} the
abstract refinements. The addition of bounds
makes it possible to specify and verify the examples
shown in this paper,
while preserving decidability and inference.

\paragraph{Our Relational Algebra Library} builds on a long
line of work on type safe database access.
%
The HaskellDB~\citep{haskellDB}
showed how phantom types could be used to eliminate
certain classes of errors.
%
Haskell's HList library~\citep{heterogeneous}
extends this work with type-level computation
features to encode heterogeneous lists, which
can be used to encode database schema, and
(unlike HaskellDB) statically reject accesses
of ``missing'' fields.
%
The HList implementation is non-trivial,
requiring new type-classes for new operations
(\eg @append@ing lists); \citep{thepipower}
shows how a dependently typed language greatly
simplifies the implementation.
%
Much of this simplicity can be recovered in
Haskell using the @singleton@ library~\citep{Weirich12}.
%
Our goal is to show that bounded refinements
are expressive enough to permit the construction
of rich abstractions like a relational algebra
and generic combinators for safe database access
while using SMT solvers to provide decidable
checking and inference. Further, unlike the
HList based approaches, refinements they can
be used to \emph{retroactively} or \emph{gradually}
verify safety; if we erase the types we still
get a valid Haskell program operating over
homogeneous lists.

\paragraph{Our Approach for Verifying Stateful Computations} using monads
indexed by pre- and post-conditions is inspired by the method of
Filli\^atre~\citep{Filliatre98}, which was later enriched with
separation logic in Ynot~\citep{ynot}. In future work it would
be interesting to use separation logic based refinements to specify
and verify the complex sharing and aliasing patterns allowed by Ynot.
%
\fstar encodes stateful computations in a special Dijkstra
Monad~\citep{dijkstramonad} that replaces the two assertions with
a single (weakest-precondition) predicate transformer which
can be composed across sub-computations to yield a transformer
for the entire computation.
%
Our \RIO approach uses the idea of indexed monads but
has two concrete advantages.
%
First, we show how bounded refinements alone suffice to
let us fashion the \RIO abstraction from scratch.
%
Consequently, second, we automate inference of pre- and
post-conditions and loop invariants as refinement instantiation
via Liquid Typing~\citep{LiquidPLDI08}.


text:
<?php

//
// Copyright (c) 2021 Oliver Lehmann <lehmann@ans-netz.de>
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
//

namespace api\model\transport;

class EtfSummaryTransport extends AbstractTransport {
	public $isin;
	public $name;
	public $chartUrl;
	public $amount;
	public $spentValue;
	public $buyPrice;
	public $sellPrice;
	public $pricesTimestamp;

	/**
	 * @return mixed
	 */
	public final function getIsin() {
		return $this->isin;
	}

	/**
	 * @param mixed $isin
	 */
	public final function setIsin($isin) {
		$this->isin = $isin;
	}

	/**
	 * @return mixed
	 */
	public final function getName() {
		return $this->name;
	}

	/**
	 * @param mixed $name
	 */
	public final function setName($name) {
		$this->name = $name;
	}

	/**
	 * @return mixed
	 */
	public final function getChartUrl() {
		return $this->chartUrl;
	}

	/**
	 * @param mixed $chartUrl
	 */
	public final function setChartUrl($chartUrl) {
		$this->chartUrl = $chartUrl;
	}

	/**
	 * @return mixed
	 */
	public final function getAmount() {
		return $this->amount;
	}

	/**
	 * @param mixed $amount
	 */
	public final function setAmount($amount) {
		$this->amount = $amount;
	}

	/**
	 * @return mixed
	 */
	public final function getSpentValue() {
		return $this->spentValue;
	}

	/**
	 * @param mixed $spentValue
	 */
	public final function setSpentValue($spentValue) {
		$this->spentValue = $spentValue;
	}

	/**
	 * @return mixed
	 */
	public final function getBuyPrice() {
		return $this->buyPrice;
	}

	/**
	 * @param mixed $buyPrice
	 */
	public final function setBuyPrice($buyPrice) {
		$this->buyPrice = $buyPrice;
	}

	/**
	 * @return mixed
	 */
	public final function getSellPrice() {
		return $this->sellPrice;
	}

	/**
	 * @param mixed $sellPrice
	 */
	public final function setSellPrice($sellPrice) {
		$this->sellPrice = $sellPrice;
	}

	/**
	 * @return mixed
	 */
	public final function getPricesTimestamp() {
		return $this->pricesTimestamp;
	}

	/**
	 * @param mixed $pricesTimestamp
	 */
	public final function setPricesTimestamp($pricesTimestamp) {
		$this->pricesTimestamp = $pricesTimestamp;
	}

}


text:
#import "MDCFeatureHighlightLayer.h"

#import <UIKit/UIKit.h>

@implementation MDCFeatureHighlightLayer {
  CGFloat _radius;
}

- (void)setPosition:(CGPoint)position animated:(BOOL)animated {
  if (CGPointEqualToPoint(self.position , position)) {
    return;
  }
  if (animated) {
    CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"position"];
    animation.duration = [CATransaction animationDuration];
    animation.timingFunction = [CATransaction animationTimingFunction];
    animation.fromValue = [NSValue valueWithCGPoint:self.position];
    animation.toValue = [NSValue valueWithCGPoint:position];
    [self addAnimation:animation forKey:@"position"];
  }
  self.position = position;
}

- (void)setRadius:(CGFloat)radius animated:(BOOL)animated {
  if (_radius == radius) {
    return;
  }
  _radius = radius;

  CGRect circleRect = CGRectMake(-radius, -radius, radius * 2, radius * 2);
  if (animated) {
    CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"path"];
    animation.duration = [CATransaction animationDuration];
    animation.timingFunction = [CATransaction animationTimingFunction];
    if (self.path) {
      animation.fromValue = (__bridge id)self.path;
    } else {
      animation.fromValue = CFBridgingRelease(
          CGPathCreateWithEllipseInRect(CGRectMake(0, 0, 0, 0), NULL));
    }
    self.path = (__bridge CGPathRef _Nullable)CFBridgingRelease(
        CGPathCreateWithEllipseInRect(circleRect, NULL));
    [self addAnimation:animation forKey:@"path"];
  } else {
    self.path = (__bridge CGPathRef _Nullable)CFBridgingRelease(
        CGPathCreateWithEllipseInRect(circleRect, NULL));
  }
}

- (void)setFillColor:(CGColorRef)fillColor animated:(BOOL)animated {
  if (animated) {
    CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"fillColor"];
    animation.duration = [CATransaction animationDuration];
    animation.timingFunction = [CATransaction animationTimingFunction];
    animation.fromValue = (__bridge id)self.fillColor;
    self.fillColor = fillColor;
    [self addAnimation:animation forKey:@"fillColor"];
  } else {
    self.fillColor = fillColor;
  }
}

- (void)animateRadiusOverKeyframes:(NSArray *)radii
                          keyTimes:(NSArray *)keyTimes {
  NSMutableArray *values = [NSMutableArray arrayWithCapacity:radii.count];
  for (NSNumber *radius in radii) {
    CGFloat r = radius.floatValue;
    CGRect circleRect = CGRectMake(-r, -r, r * 2, r * 2);
    [values addObject:CFBridgingRelease(CGPathCreateWithEllipseInRect(circleRect, NULL))];
  }
  CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"path"];
  animation.duration = [CATransaction animationDuration];
  animation.timingFunction = [CATransaction animationTimingFunction];
  animation.values = values;
  animation.keyTimes = keyTimes;
  [self addAnimation:animation forKey:@"path"];
}

- (void)animateFillColorOverKeyframes:(NSArray *)colors keyTimes:(NSArray *)keyTimes {
  CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"fillColor"];
  animation.duration = [CATransaction animationDuration];
  animation.timingFunction = [CATransaction animationTimingFunction];
  animation.values = colors;
  animation.keyTimes = keyTimes;
  [self addAnimation:animation forKey:@"fillColor"];
}

@end


text:
package org.example;

import griffon.core.i18n.MessageSource;
import org.codehaus.griffon.runtime.core.artifact.AbstractGriffonService;

import static griffon.util.GriffonNameUtils.isBlank;
import static java.util.Arrays.asList;

public class SampleService extends AbstractGriffonService {
    public String sayHello(String input) {
        MessageSource messageSource = getApplication().getMessageSource();
        if (isBlank(input)) {
            return messageSource.getMessage("greeting.default");
        } else {
            return messageSource.getMessage("greeting.parameterized", asList(input));
        }
    }
}


text:
{
  var _this6 = this;

  class Qux {
    constructor() {
      var _this5 = this;

      Object.defineProperty(this, "fn", {
        configurable: true,
        enumerable: true,
        writable: true,
        value: function() {
          return console.log(_this5);
        }
      });
    }
  }

  Object.defineProperty(Qux, "fn", {
    configurable: true,
    enumerable: true,
    writable: true,
    value: function() {
      return console.log(_this6);
    }
  });
}


text:
<?php

namespace Kronos\Log;

use Kronos\Log\Exception\InvalidLogLevel;
use Kronos\Log\Traits\Interpolate;
use Psr\Log\LogLevel;

abstract class AbstractWriter implements WriterInterface
{

    use Interpolate;

    protected $min_level = LogLevel::DEBUG;
    protected $max_level = LogLevel::EMERGENCY;
    protected $can_log = true;

    /**
     * @param string $level
     * @return bool
     * @throws InvalidLogLevel
     */
    public function canLogLevel($level): bool
    {
        $this->validateLogLevel($level);

        if (!$this->can_log
            || $this->isLevelLower($this->min_level, $level)
            || $this->isLevelHigher($this->max_level, $level)) {
            return false;
        }

        return true;
    }

    /**
     * @param string $level
     * @throws InvalidLogLevel
     */
    protected function validateLogLevel($level)
    {
        LogLevelHelper::validateLogLevel((string)$level);
    }

    /**
     * @param string $level
     * @throws InvalidLogLevel
     */
    public function setMinLevel($level)
    {
        $this->validateLogLevel($level);

        $this->min_level = $level;
    }

    /**
     * @param string $base_level
     * @param string $compared_level
     * @return bool
     */
    protected function isLevelLower($base_level, $compared_level): bool
    {
        return LogLevelHelper::isLower((string)$base_level, (string)$compared_level);
    }

    /**
     * @param string $level
     * @throws InvalidLogLevel
     */
    public function setMaxLevel($level)
    {
        $this->validateLogLevel($level);

        $this->max_level = (string)$level;
    }

    public function canLog(): bool
    {
        return $this->can_log;
    }

    /**
     * @param bool $can_log
     */
    public function setCanLog($can_log = true)
    {
        $this->can_log = (bool)$can_log;
    }

    /**
     * @param string $base_level
     * @param string $compared_level
     * @return bool
     */
    protected function isLevelHigher($base_level, $compared_level): bool
    {
        return LogLevelHelper::isHigher($base_level, $compared_level);
    }
}


text:
package com.microsoft.azure.management.network.implementation;

import com.microsoft.azure.management.network.ExpressRouteCircuitPeeringType;
import com.microsoft.azure.management.network.ExpressRouteCircuitPeeringState;
import com.microsoft.azure.management.network.ExpressRouteCircuitPeeringConfig;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.microsoft.rest.serializer.JsonFlatten;
import com.microsoft.azure.SubResource;

/**
 * Peering in an ExpressRouteCircuit resource.
 */
@JsonFlatten
public class ExpressRouteCircuitPeeringInner extends SubResource {
    /**
     * The PeeringType. Possible values are: 'AzurePublicPeering',
     * 'AzurePrivatePeering', and 'MicrosoftPeering'. Possible values include:
     * 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering'.
     */
    @JsonProperty(value = "properties.peeringType")
    private ExpressRouteCircuitPeeringType peeringType;

    /**
     * The state of peering. Possible values are: 'Disabled' and 'Enbaled'.
     * Possible values include: 'Disabled', 'Enabled'.
     */
    @JsonProperty(value = "properties.state")
    private ExpressRouteCircuitPeeringState state;

    /**
     * The Azure ASN.
     */
    @JsonProperty(value = "properties.azureASN")
    private Integer azureASN;

    /**
     * The peer ASN.
     */
    @JsonProperty(value = "properties.peerASN")
    private Integer peerASN;

    /**
     * The primary address prefix.
     */
    @JsonProperty(value = "properties.primaryPeerAddressPrefix")
    private String primaryPeerAddressPrefix;

    /**
     * The secondary address prefix.
     */
    @JsonProperty(value = "properties.secondaryPeerAddressPrefix")
    private String secondaryPeerAddressPrefix;

    /**
     * The primary port.
     */
    @JsonProperty(value = "properties.primaryAzurePort")
    private String primaryAzurePort;

    /**
     * The secondary port.
     */
    @JsonProperty(value = "properties.secondaryAzurePort")
    private String secondaryAzurePort;

    /**
     * The shared key.
     */
    @JsonProperty(value = "properties.sharedKey")
    private String sharedKey;

    /**
     * The VLAN ID.
     */
    @JsonProperty(value = "properties.vlanId")
    private Integer vlanId;

    /**
     * The Microsoft peering configuration.
     */
    @JsonProperty(value = "properties.microsoftPeeringConfig")
    private ExpressRouteCircuitPeeringConfig microsoftPeeringConfig;

    /**
     * Gets peering stats.
     */
    @JsonProperty(value = "properties.stats")
    private ExpressRouteCircuitStatsInner stats;

    /**
     * Gets the provisioning state of the public IP resource. Possible values
     * are: 'Updating', 'Deleting', and 'Failed'.
     */
    @JsonProperty(value = "properties.provisioningState")
    private String provisioningState;

    /**
     * The GatewayManager Etag.
     */
    @JsonProperty(value = "properties.gatewayManagerEtag")
    private String gatewayManagerEtag;

    /**
     * Gets whether the provider or the customer last modified the peering.
     */
    @JsonProperty(value = "properties.lastModifiedBy")
    private String lastModifiedBy;

    /**
     * Gets name of the resource that is unique within a resource group. This
     * name can be used to access the resource.
     */
    private String name;

    /**
     * A unique read-only string that changes whenever the resource is updated.
     */
    private String etag;

    /**
     * Get the peeringType value.
     *
     * @return the peeringType value
     */
    public ExpressRouteCircuitPeeringType peeringType() {
        return this.peeringType;
    }

    /**
     * Set the peeringType value.
     *
     * @param peeringType the peeringType value to set
     * @return the ExpressRouteCircuitPeeringInner object itself.
     */
    public ExpressRouteCircuitPeeringInner withPeeringType(ExpressRouteCircuitPeeringType peeringType) {
        this.peeringType = peeringType;
        return this;
    }

    /**
     * Get the state value.
     *
     * @return the state value
     */
    public ExpressRouteCircuitPeeringState state() {
        return this.state;
    }

    /**
     * Set the state value.
     *
     * @param state the state value to set
     * @return the ExpressRouteCircuitPeeringInner object itself.
     */
    public ExpressRouteCircuitPeeringInner withState(ExpressRouteCircuitPeeringState state) {
        this.state = state;
        return this;
    }

    /**
     * Get the azureASN value.
     *
     * @return the azureASN value
     */
    public Integer azureASN() {
        return this.azureASN;
    }

    /**
     * Set the azureASN value.
     *
     * @param azureASN the azureASN value to set
     * @return the ExpressRouteCircuitPeeringInner object itself.
     */
    public ExpressRouteCircuitPeeringInner withAzureASN(Integer azureASN) {
        this.azureASN = azureASN;
        return this;
    }

    /**
     * Get the peerASN value.
     *
     * @return the peerASN value
     */
    public Integer peerASN() {
        return this.peerASN;
    }

    /**
     * Set the peerASN value.
     *
     * @param peerASN the peerASN value to set
     * @return the ExpressRouteCircuitPeeringInner object itself.
     */
    public ExpressRouteCircuitPeeringInner withPeerASN(Integer peerASN) {
        this.peerASN = peerASN;
        return this;
    }

    /**
     * Get the primaryPeerAddressPrefix value.
     *
     * @return the primaryPeerAddressPrefix value
     */
    public String primaryPeerAddressPrefix() {
        return this.primaryPeerAddressPrefix;
    }

    /**
     * Set the primaryPeerAddressPrefix value.
     *
     * @param primaryPeerAddressPrefix the primaryPeerAddressPrefix value to set
     * @return the ExpressRouteCircuitPeeringInner object itself.
     */
    public ExpressRouteCircuitPeeringInner withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) {
        this.primaryPeerAddressPrefix = primaryPeerAddressPrefix;
        return this;
    }

    /**
     * Get the secondaryPeerAddressPrefix value.
     *
     * @return the secondaryPeerAddressPrefix value
     */
    public String secondaryPeerAddressPrefix() {
        return this.secondaryPeerAddressPrefix;
    }

    /**
     * Set the secondaryPeerAddressPrefix value.
     *
     * @param secondaryPeerAddressPrefix the secondaryPeerAddressPrefix value to set
     * @return the ExpressRouteCircuitPeeringInner object itself.
     */
    public ExpressRouteCircuitPeeringInner withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) {
        this.secondaryPeerAddressPrefix = secondaryPeerAddressPrefix;
        return this;
    }

    /**
     * Get the primaryAzurePort value.
     *
     * @return the primaryAzurePort value
     */
    public String primaryAzurePort() {
        return this.primaryAzurePort;
    }

    /**
     * Set the primaryAzurePort value.
     *
     * @param primaryAzurePort the primaryAzurePort value to set
     * @return the ExpressRouteCircuitPeeringInner object itself.
     */
    public ExpressRouteCircuitPeeringInner withPrimaryAzurePort(String primaryAzurePort) {
        this.primaryAzurePort = primaryAzurePort;
        return this;
    }

    /**
     * Get the secondaryAzurePort value.
     *
     * @return the secondaryAzurePort value
     */
    public String secondaryAzurePort() {
        return this.secondaryAzurePort;
    }

    /**
     * Set the secondaryAzurePort value.
     *
     * @param secondaryAzurePort the secondaryAzurePort value to set
     * @return the ExpressRouteCircuitPeeringInner object itself.
     */
    public ExpressRouteCircuitPeeringInner withSecondaryAzurePort(String secondaryAzurePort) {
        this.secondaryAzurePort = secondaryAzurePort;
        return this;
    }

    /**
     * Get the sharedKey value.
     *
     * @return the sharedKey value
     */
    public String sharedKey() {
        return this.sharedKey;
    }

    /**
     * Set the sharedKey value.
     *
     * @param sharedKey the sharedKey value to set
     * @return the ExpressRouteCircuitPeeringInner object itself.
     */
    public ExpressRouteCircuitPeeringInner withSharedKey(String sharedKey) {
        this.sharedKey = sharedKey;
        return this;
    }

    /**
     * Get the vlanId value.
     *
     * @return the vlanId value
     */
    public Integer vlanId() {
        return this.vlanId;
    }

    /**
     * Set the vlanId value.
     *
     * @param vlanId the vlanId value to set
     * @return the ExpressRouteCircuitPeeringInner object itself.
     */
    public ExpressRouteCircuitPeeringInner withVlanId(Integer vlanId) {
        this.vlanId = vlanId;
        return this;
    }

    /**
     * Get the microsoftPeeringConfig value.
     *
     * @return the microsoftPeeringConfig value
     */
    public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() {
        return this.microsoftPeeringConfig;
    }

    /**
     * Set the microsoftPeeringConfig value.
     *
     * @param microsoftPeeringConfig the microsoftPeeringConfig value to set
     * @return the ExpressRouteCircuitPeeringInner object itself.
     */
    public ExpressRouteCircuitPeeringInner withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) {
        this.microsoftPeeringConfig = microsoftPeeringConfig;
        return this;
    }

    /**
     * Get the stats value.
     *
     * @return the stats value
     */
    public ExpressRouteCircuitStatsInner stats() {
        return this.stats;
    }

    /**
     * Set the stats value.
     *
     * @param stats the stats value to set
     * @return the ExpressRouteCircuitPeeringInner object itself.
     */
    public ExpressRouteCircuitPeeringInner withStats(ExpressRouteCircuitStatsInner stats) {
        this.stats = stats;
        return this;
    }

    /**
     * Get the provisioningState value.
     *
     * @return the provisioningState value
     */
    public String provisioningState() {
        return this.provisioningState;
    }

    /**
     * Set the provisioningState value.
     *
     * @param provisioningState the provisioningState value to set
     * @return the ExpressRouteCircuitPeeringInner object itself.
     */
    public ExpressRouteCircuitPeeringInner withProvisioningState(String provisioningState) {
        this.provisioningState = provisioningState;
        return this;
    }

    /**
     * Get the gatewayManagerEtag value.
     *
     * @return the gatewayManagerEtag value
     */
    public String gatewayManagerEtag() {
        return this.gatewayManagerEtag;
    }

    /**
     * Set the gatewayManagerEtag value.
     *
     * @param gatewayManagerEtag the gatewayManagerEtag value to set
     * @return the ExpressRouteCircuitPeeringInner object itself.
     */
    public ExpressRouteCircuitPeeringInner withGatewayManagerEtag(String gatewayManagerEtag) {
        this.gatewayManagerEtag = gatewayManagerEtag;
        return this;
    }

    /**
     * Get the lastModifiedBy value.
     *
     * @return the lastModifiedBy value
     */
    public String lastModifiedBy() {
        return this.lastModifiedBy;
    }

    /**
     * Set the lastModifiedBy value.
     *
     * @param lastModifiedBy the lastModifiedBy value to set
     * @return the ExpressRouteCircuitPeeringInner object itself.
     */
    public ExpressRouteCircuitPeeringInner withLastModifiedBy(String lastModifiedBy) {
        this.lastModifiedBy = lastModifiedBy;
        return this;
    }

    /**
     * Get the name value.
     *
     * @return the name value
     */
    public String name() {
        return this.name;
    }

    /**
     * Set the name value.
     *
     * @param name the name value to set
     * @return the ExpressRouteCircuitPeeringInner object itself.
     */
    public ExpressRouteCircuitPeeringInner withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Get the etag value.
     *
     * @return the etag value
     */
    public String etag() {
        return this.etag;
    }

    /**
     * Set the etag value.
     *
     * @param etag the etag value to set
     * @return the ExpressRouteCircuitPeeringInner object itself.
     */
    public ExpressRouteCircuitPeeringInner withEtag(String etag) {
        this.etag = etag;
        return this;
    }

}


text:
set -ex

if [ ! -f "/etc/init.d/riemann" ]; then
    wget https://aphyr.com/riemann/riemann_0.2.11_all.deb
    sudo dpkg -i riemann_0.2.11_all.deb
fi
if [ -f "/home/vagrant/riemann.config" ]; then
    sudo mv /home/vagrant/riemann.config /etc/riemann/riemann.config
    sudo service riemann restart
fi


text:
package org.apache.hadoop.fs.s3a;

import com.amazonaws.services.s3.transfer.Upload;

/**
 * Simple struct that contains information about a S3 upload.
 */
public class UploadInfo {
  private final Upload upload;
  private final long length;

  public UploadInfo(Upload upload, long length) {
    this.upload = upload;
    this.length = length;
  }

  public Upload getUpload() {
    return upload;
  }

  public long getLength() {
    return length;
  }

}


text:
'use strict';

const path = require('path');

const appPath = require('app-module-path');
appPath.addPath(__dirname);
appPath.addPath(path.join(__dirname, 'node_modules'));

const { migrate, init } = require('./launch-tools');

const injector = require('./injector');

injector.log.info = () => {};
injector.log.debug = () => {};

injector('mongo')
    .then((mongo) => migrate(mongo.connection, 'Ignite', path.join(__dirname, 'migrations')))
    .then(() => Promise.all([injector('settings'), injector('api-server'), injector('agents-handler'), injector('browsers-handler')]))
    .then(init)
    .catch((err) => {
        console.error(err);

        process.exit(1);
    });


text:
package xyz.cloudkeeper.linker.examples;

import cloudkeeper.serialization.IntegerMarshaler;
import xyz.cloudkeeper.model.bare.element.module.BareInputModule;
import xyz.cloudkeeper.model.bare.element.module.BareLoopModule;
import xyz.cloudkeeper.model.beans.element.module.MutableChildOutToParentOutConnection;
import xyz.cloudkeeper.model.beans.element.module.MutableCompositeModule;
import xyz.cloudkeeper.model.beans.element.module.MutableCompositeModuleDeclaration;
import xyz.cloudkeeper.model.beans.element.module.MutableConnection;
import xyz.cloudkeeper.model.beans.element.module.MutableIOPort;
import xyz.cloudkeeper.model.beans.element.module.MutableInPort;
import xyz.cloudkeeper.model.beans.element.module.MutableInputModule;
import xyz.cloudkeeper.model.beans.element.module.MutableLoopModule;
import xyz.cloudkeeper.model.beans.element.module.MutableModule;
import xyz.cloudkeeper.model.beans.element.module.MutableOutPort;
import xyz.cloudkeeper.model.beans.element.module.MutableParentInToChildInConnection;
import xyz.cloudkeeper.model.beans.element.module.MutablePort;
import xyz.cloudkeeper.model.beans.element.module.MutableProxyModule;
import xyz.cloudkeeper.model.beans.element.module.MutableShortCircuitConnection;
import xyz.cloudkeeper.model.beans.element.module.MutableSiblingConnection;
import xyz.cloudkeeper.model.beans.element.serialization.MutableSerializationNode;
import xyz.cloudkeeper.model.beans.element.serialization.MutableSerializationRoot;
import xyz.cloudkeeper.model.beans.element.serialization.MutableSerializedString;
import xyz.cloudkeeper.model.beans.type.MutableDeclaredType;
import xyz.cloudkeeper.model.immutable.element.NoKey;

import java.util.Arrays;
import java.util.Collections;

public final class Fibonacci {
    private Fibonacci() { }

    public static MutableCompositeModule template() {
        // It is OK to share instances, but note that setters in this package do *not* create defensive copies.
        final MutableDeclaredType integer = new MutableDeclaredType()
            .setDeclaration(Integer.class.getName());

        // Values. Omit empty token for first value, but not for second.
        final MutableSerializationRoot zero = new MutableSerializationRoot()
            .setDeclaration(IntegerMarshaler.class.getName())
            .setEntries(Collections.<MutableSerializationNode<?>>singletonList(
                new MutableSerializedString().setString("0")
            ));
        final MutableSerializationRoot one = new MutableSerializationRoot()
            .setKey(NoKey.instance())
            .setDeclaration(IntegerMarshaler.class.getName())
            .setEntries(Collections.<MutableSerializationNode<?>>singletonList(
                new MutableSerializedString().setString("1")
            ));

        return new MutableCompositeModule()
            .setDeclaredPorts(Arrays.<MutablePort<?>>asList(
                new MutableInPort()
                    .setSimpleName("n")
                    .setType(integer),
                new MutableOutPort()
                    .setSimpleName("result")
                    .setType(integer)
            ))
            .setModules(Arrays.<MutableModule<?>>asList(
                new MutableInputModule()
                    .setSimpleName("zero")
                    .setOutPortType(integer)
                    .setRaw(zero),
                new MutableInputModule()
                    .setSimpleName("one")
                    .setOutPortType(integer)
                    .setRaw(one),

                new MutableLoopModule()
                    .setSimpleName("loop")
                    .setDeclaredPorts(Arrays.<MutablePort<?>>asList(
                        new MutableIOPort().setSimpleName("count").setType(integer),
                        new MutableIOPort().setSimpleName("last").setType(integer),
                        new MutableIOPort().setSimpleName("secondLast").setType(integer)
                    ))
                    .setModules(Arrays.<MutableModule<?>>asList(
                        new MutableInputModule()
                            .setSimpleName("one")
                            .setOutPortType(integer)
                            .setRaw(one),

                        new MutableProxyModule()
                            .setSimpleName("sum")
                            .setDeclaration(BinarySum.class.getName()),
                        new MutableProxyModule()
                            .setSimpleName("decr")
                            .setDeclaration(Decrease.class.getName()),
                        new MutableProxyModule()
                            .setSimpleName("gt")
                            .setDeclaration(GreaterThan.class.getName())
                    ))
                    .setConnections(Arrays.<MutableConnection<?>>asList(
                        new MutableParentInToChildInConnection()
                            .setFromPort("last")
                            .setToModule("sum").setToPort("num1"),
                        new MutableParentInToChildInConnection()
                            .setFromPort("secondLast")
                            .setToModule("sum").setToPort("num2"),
                        new MutableParentInToChildInConnection()
                            .setFromPort("count")
                            .setToModule("decr").setToPort("num"),
                        new MutableSiblingConnection()
                            .setFromModule("decr").setFromPort("result")
                            .setToModule("gt").setToPort("num1"),
                        new MutableSiblingConnection()
                            .setFromModule("one").setFromPort(BareInputModule.OUT_PORT_NAME)
                            .setToModule("gt").setToPort("num2"),

                        new MutableChildOutToParentOutConnection()
                            .setFromModule("decr").setFromPort("result")
                            .setToPort("count"),
                        new MutableChildOutToParentOutConnection()
                            .setFromModule("sum").setFromPort("result")
                            .setToPort("last"),
                        new MutableShortCircuitConnection()
                            .setFromPort("last")
                            .setToPort("secondLast"),

                        new MutableChildOutToParentOutConnection()
                            .setFromModule("gt").setFromPort("result")
                            .setToPort(BareLoopModule.CONTINUE_PORT_NAME)
                    ))
            ))
            .setConnections(Arrays.<MutableConnection<?>>asList(
                new MutableParentInToChildInConnection()
                    .setFromPort("n")
                    .setToModule("loop").setToPort("count"),
                new MutableSiblingConnection()
                    .setFromModule("one").setFromPort(BareInputModule.OUT_PORT_NAME)
                    .setToModule("loop").setToPort("last"),
                new MutableSiblingConnection()
                    .setFromModule("zero").setFromPort(BareInputModule.OUT_PORT_NAME)
                    .setToModule("loop").setToPort("secondLast"),

                new MutableChildOutToParentOutConnection()
                    .setFromModule("loop").setFromPort("last")
                    .setToPort("result")
            ));
    }

    public static MutableCompositeModuleDeclaration declaration() {
        return new MutableCompositeModuleDeclaration()
            .setSimpleName(Fibonacci.class.getSimpleName())
            .setTemplate(template());
    }
}


text: <script>opener.focus();opener.postMessage("", "*");</script>


text:
package co.cask.tephra.persist;

import com.google.common.base.Objects;
import com.google.common.collect.Sets;
import org.apache.hadoop.io.Writable;
import org.apache.tephra.ChangeId;
import org.apache.tephra.TransactionManager;
import org.apache.tephra.TransactionType;
import org.apache.tephra.persist.TransactionLog;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.Set;

/**
 * Represents a transaction state change in the {@link TransactionLog}.
 * This class was included for backward compatibility reasons. It will be removed in future releases.
 */
@Deprecated
public class TransactionEdit implements Writable {

  /**
   * The possible state changes for a transaction.
   */
  public enum State {
    INPROGRESS, COMMITTING, COMMITTED, INVALID, ABORTED, MOVE_WATERMARK, TRUNCATE_INVALID_TX, CHECKPOINT
  }

  private long writePointer;

  /**
   * stores the value of visibility upper bound
   * (see {@link TransactionManager.InProgressTx#getVisibilityUpperBound()})
   * for edit of {@link State#INPROGRESS} only
   */
  private long visibilityUpperBound;
  private long commitPointer;
  private long expirationDate;
  private State state;
  private Set<ChangeId> changes;
  /** Whether or not the COMMITTED change should be fully committed. */
  private boolean canCommit;
  private TransactionType type;
  private Set<Long> truncateInvalidTx;
  private long truncateInvalidTxTime;
  private long parentWritePointer;
  private long[] checkpointPointers;

  // for Writable
  public TransactionEdit() {
    this.changes = Sets.newHashSet();
    this.truncateInvalidTx = Sets.newHashSet();
  }

  // package private for testing
  TransactionEdit(long writePointer, long visibilityUpperBound, State state, long expirationDate,
                  Set<ChangeId> changes, long commitPointer, boolean canCommit, TransactionType type,
                  Set<Long> truncateInvalidTx, long truncateInvalidTxTime, long parentWritePointer,
                  long[] checkpointPointers) {
    this.writePointer = writePointer;
    this.visibilityUpperBound = visibilityUpperBound;
    this.state = state;
    this.expirationDate = expirationDate;
    this.changes = changes != null ? changes : Collections.<ChangeId>emptySet();
    this.commitPointer = commitPointer;
    this.canCommit = canCommit;
    this.type = type;
    this.truncateInvalidTx = truncateInvalidTx != null ? truncateInvalidTx : Collections.<Long>emptySet();
    this.truncateInvalidTxTime = truncateInvalidTxTime;
    this.parentWritePointer = parentWritePointer;
    this.checkpointPointers = checkpointPointers;
  }

  /**
   * Returns the transaction write pointer assigned for the state change.
   */
  public long getWritePointer() {
    return writePointer;
  }

  void setWritePointer(long writePointer) {
    this.writePointer = writePointer;
  }

  public long getVisibilityUpperBound() {
    return visibilityUpperBound;
  }

  void setVisibilityUpperBound(long visibilityUpperBound) {
    this.visibilityUpperBound = visibilityUpperBound;
  }

  /**
   * Returns the type of state change represented.
   */
  public State getState() {
    return state;
  }

  void setState(State state) {
    this.state = state;
  }

  /**
   * Returns any expiration timestamp (in milliseconds) associated with the state change.  This should only
   * be populated for changes of type {@link State#INPROGRESS}.
   */
  public long getExpiration() {
    return expirationDate;
  }

  void setExpiration(long expirationDate) {
    this.expirationDate = expirationDate;
  }

  /**
   * @return the set of changed row keys associated with the state change.  This is only populated for edits
   * of type {@link State#COMMITTING} or {@link State#COMMITTED}.
   */
  public Set<ChangeId> getChanges() {
    return changes;
  }

  void setChanges(Set<ChangeId> changes) {
    this.changes = changes;
  }

  /**
   * Returns the write pointer used to commit the row key change set.  This is only populated for edits of type
   * {@link State#COMMITTED}.
   */
  public long getCommitPointer() {
    return commitPointer;
  }

  void setCommitPointer(long commitPointer) {
    this.commitPointer = commitPointer;
  }

  /**
   * Returns whether or not the transaction should be moved to the committed set.  This is only populated for edits
   * of type {@link State#COMMITTED}.
   */
  public boolean getCanCommit() {
    return canCommit;
  }

  void setCanCommit(boolean canCommit) {
    this.canCommit = canCommit;
  }

  /**
   * Returns the transaction type. This is only populated for edits of type {@link State#INPROGRESS} or
   * {@link State#ABORTED}.
   */
  public TransactionType getType() {
    return type;
  }

  void setType(TransactionType type) {
    this.type = type;
  }

  /**
   * Returns the transaction ids to be removed from invalid transaction list. This is only populated for
   * edits of type {@link State#TRUNCATE_INVALID_TX}
   */
  public Set<Long> getTruncateInvalidTx() {
    return truncateInvalidTx;
  }

  void setTruncateInvalidTx(Set<Long> truncateInvalidTx) {
    this.truncateInvalidTx = truncateInvalidTx;
  }

  /**
   * Returns the time until which the invalid transactions need to be truncated from invalid transaction list.
   * This is only populated for  edits of type {@link State#TRUNCATE_INVALID_TX}
   */
  public long getTruncateInvalidTxTime() {
    return truncateInvalidTxTime;
  }

  void setTruncateInvalidTxTime(long truncateInvalidTxTime) {
    this.truncateInvalidTxTime = truncateInvalidTxTime;
  }

  /**
   * Returns the parent write pointer for a checkpoint operation.  This is only populated for edits of type
   * {@link State#CHECKPOINT}
   */
  public long getParentWritePointer() {
    return parentWritePointer;
  }

  void setParentWritePointer(long parentWritePointer) {
    this.parentWritePointer = parentWritePointer;
  }

  /**
   * Returns the checkpoint write pointers for the edit.  This is only populated for edits of type
   * {@link State#ABORTED}.
   */
  public long[] getCheckpointPointers() {
    return checkpointPointers;
  }

  void setCheckpointPointers(long[] checkpointPointers) {
    this.checkpointPointers = checkpointPointers;
  }

  /**
   * Creates a new instance in the {@link State#INPROGRESS} state.
   */
  public static TransactionEdit createStarted(long writePointer, long visibilityUpperBound,
                                              long expirationDate, TransactionType type) {
    return new TransactionEdit(writePointer, visibilityUpperBound, State.INPROGRESS,
                               expirationDate, null, 0L, false, type, null, 0L, 0L, null);
  }

  /**
   * Creates a new instance in the {@link State#COMMITTING} state.
   */
  public static TransactionEdit createCommitting(long writePointer, Set<ChangeId> changes) {
    return new TransactionEdit(writePointer, 0L, State.COMMITTING, 0L, changes, 0L, false, null, null, 0L, 0L, null);
  }

  /**
   * Creates a new instance in the {@link State#COMMITTED} state.
   */
  public static TransactionEdit createCommitted(long writePointer, Set<ChangeId> changes, long nextWritePointer,
                                                boolean canCommit) {
    return new TransactionEdit(writePointer, 0L, State.COMMITTED, 0L, changes, nextWritePointer, canCommit, null,
                               null, 0L, 0L, null);
  }

  /**
   * Creates a new instance in the {@link State#ABORTED} state.
   */
  public static TransactionEdit createAborted(long writePointer, TransactionType type, long[] checkpointPointers) {
    return new TransactionEdit(writePointer, 0L, State.ABORTED, 0L, null, 0L, false, type, null, 0L, 0L,
                               checkpointPointers);
  }

  /**
   * Creates a new instance in the {@link State#INVALID} state.
   */
  public static TransactionEdit createInvalid(long writePointer) {
    return new TransactionEdit(writePointer, 0L, State.INVALID, 0L, null, 0L, false, null, null, 0L, 0L, null);
  }

  /**
   * Creates a new instance in the {@link State#MOVE_WATERMARK} state.
   */
  public static TransactionEdit createMoveWatermark(long writePointer) {
    return new TransactionEdit(writePointer, 0L, State.MOVE_WATERMARK, 0L, null, 0L, false, null, null, 0L, 0L, null);
  }

  /**
   * Creates a new instance in the {@link State#TRUNCATE_INVALID_TX} state.
   */
  public static TransactionEdit createTruncateInvalidTx(Set<Long> truncateInvalidTx) {
    return new TransactionEdit(0L, 0L, State.TRUNCATE_INVALID_TX, 0L, null, 0L, false, null, truncateInvalidTx,
                               0L, 0L, null);
  }

  /**
   * Creates a new instance in the {@link State#TRUNCATE_INVALID_TX} state.
   */
  public static TransactionEdit createTruncateInvalidTxBefore(long truncateInvalidTxTime) {
    return new TransactionEdit(0L, 0L, State.TRUNCATE_INVALID_TX, 0L, null, 0L, false, null, null,
                               truncateInvalidTxTime, 0L, null);
  }

  /**
   * Creates a new instance in the {@link State#CHECKPOINT} state.
   */
  public static TransactionEdit createCheckpoint(long writePointer, long parentWritePointer) {
    return new TransactionEdit(writePointer, 0L, State.CHECKPOINT, 0L, null, 0L, false, null, null, 0L,
                               parentWritePointer, null);
  }

  @Override
  public void write(DataOutput out) throws IOException {
    TransactionEditCodecs.encode(this, out);
  }

  @Override
  public void readFields(DataInput in) throws IOException {
    TransactionEditCodecs.decode(this, in);
  }

  @Override
  public final boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (!(o instanceof TransactionEdit)) {
      return false;
    }

    TransactionEdit that = (TransactionEdit) o;

    return Objects.equal(this.writePointer, that.writePointer) &&
      Objects.equal(this.visibilityUpperBound, that.visibilityUpperBound) &&
      Objects.equal(this.commitPointer, that.commitPointer) &&
      Objects.equal(this.expirationDate, that.expirationDate) &&
      Objects.equal(this.state, that.state) &&
      Objects.equal(this.changes, that.changes) &&
      Objects.equal(this.canCommit, that.canCommit) &&
      Objects.equal(this.type, that.type) &&
      Objects.equal(this.truncateInvalidTx, that.truncateInvalidTx) &&
      Objects.equal(this.truncateInvalidTxTime, that.truncateInvalidTxTime) &&
      Objects.equal(this.parentWritePointer, that.parentWritePointer) &&
      Arrays.equals(this.checkpointPointers, that.checkpointPointers);
  }

  @Override
  public final int hashCode() {
    return Objects.hashCode(writePointer, visibilityUpperBound, commitPointer, expirationDate, state, changes,
                            canCommit, type, parentWritePointer, checkpointPointers);
  }

  @Override
  public String toString() {
    return Objects.toStringHelper(this)
      .add("writePointer", writePointer)
      .add("visibilityUpperBound", visibilityUpperBound)
      .add("commitPointer", commitPointer)
      .add("expiration", expirationDate)
      .add("state", state)
      .add("changesSize", changes != null ? changes.size() : 0)
      .add("canCommit", canCommit)
      .add("type", type)
      .add("truncateInvalidTx", truncateInvalidTx)
      .add("truncateInvalidTxTime", truncateInvalidTxTime)
      .add("parentWritePointer", parentWritePointer)
      .add("checkpointPointers", checkpointPointers)
      .toString();
  }

}


text:
@interface OverRecordHistoryCell : UITableViewCell

@property (nonatomic, strong) TodoComeOverRecordStore *comeoverStore;

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *heightCOnstraint;
@property (weak, nonatomic) IBOutlet UIImageView *clockIconImageView;

@property (weak, nonatomic) IBOutlet UIView *sideView;
@property (weak, nonatomic) IBOutlet UILabel *locationIconLabel;
@property (weak, nonatomic) IBOutlet UIImageView *locationIconImageView;
@property (weak, nonatomic) IBOutlet UIView *locationBGView;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *locationViewConstriant;

@property (weak, nonatomic) IBOutlet UILabel *peopleLabel;
@property (weak, nonatomic) IBOutlet UIButton *locationButton;
@property (weak, nonatomic) IBOutlet UILabel *dateLabel;
@property (weak, nonatomic) IBOutlet UILabel *dateBetweenLabel; ///<多少天之前
@property (weak, nonatomic) IBOutlet UILabel *localLabel;
@property (weak, nonatomic) IBOutlet UILabel *targetLabel; ///<联系的目的
@property (weak, nonatomic) IBOutlet UILabel *noteLabel; ///<联系的备注
@property (weak, nonatomic) IBOutlet UIButton *openButton;

@property (nonatomic, strong) UIColor *iconColor;
@property (nonatomic) NSInteger btnTag;
@property (nonatomic) BOOL isOpen;
@property (nonatomic) BOOL needToJump;
@property (nonatomic) int typeState; ///< 0.沟通 1.出行 2.往来

@property (strong, nonatomic) void (^openBlock)(NSInteger tag);
@property (strong, nonatomic) void (^locationBlock)(NSString *, NSString *);

@end


text:
//package net.cloudkit.ecological.enterprises.experiment;
//
//import org.apache.log4j.Logger;
//import org.junit.Test;
//import org.junit.runner.RunWith;
//import org.springframework.beans.factory.config.PropertiesFactoryBean;
//import org.springframework.dao.DataAccessException;
//import org.springframework.data.redis.connection.RedisConnection;
//import org.springframework.data.redis.core.RedisCallback;
//import org.springframework.data.redis.core.RedisTemplate;
//import org.springframework.data.redis.serializer.RedisSerializer;
//import org.springframework.test.context.ActiveProfiles;
//import org.springframework.test.context.ContextConfiguration;
//import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
//
//import javax.annotation.Resource;
//
//@RunWith(SpringJUnit4ClassRunner.class)
//// ApplicationContext will be loaded from "classpath:/app-config.xml"
//@ContextConfiguration(locations = {"classpath*:application-context*.xml"})
//@ActiveProfiles("development")
////@SpringApplicationConfiguration(classes = Application.class)
////@WebAppConfiguration
////@IntegrationTest("server.port=0")
////@DirtiesContext
//public class RedisTemplateTest {
//
//    private static final Logger logger = Logger.getLogger(RedisTemplateTest.class);
//
//    @Resource
//    protected RedisTemplate<String, String> redisTemplate;
//
//    @SuppressWarnings(value = "unchecked")
//    @Test
//    public void test() {
//        // production development
//        System.setProperty("spring.profiles.active", "development");
//
//        /*
//        // TODO
//        // 新增
//        Boolean result = (Boolean) redisTemplate.execute(new RedisCallback<Boolean>() {
//
//            @Override
//            public Boolean doInRedis(RedisConnection connection) throws DataAccessException {
//                RedisSerializer<String> serializer = getRedisSerializer();
//                byte[] key  = serializer.serialize("test");
//                byte[] name = serializer.serialize("Coffee");
//                return connection.setNX(key, name);
//            }
//        });
//        */
//
//        // 批量新增
//        /*
//        Assert.notEmpty(list);
//        boolean result = redisTemplate.execute(new RedisCallback<Boolean>() {
//            public Boolean doInRedis(RedisConnection connection)
//                    throws DataAccessException {
//                RedisSerializer<String> serializer = getRedisSerializer();
//                for (User user : list) {
//                    byte[] key  = serializer.serialize(user.getId());
//                    byte[] name = serializer.serialize(user.getName());
//                    connection.setNX(key, name);
//                }
//                return true;
//            }
//        }, false, true);
//        */
//
//        // 删除多个
//        // redisTemplate.delete(keys);
//
//        // 修改
//        /*
//        String key = user.getId();
//        if (get(key) == null) {
//            throw new NullPointerException("数据行不存在, key = " + key);
//        }
//        boolean result = redisTemplate.execute(new RedisCallback<Boolean>() {
//            public Boolean doInRedis(RedisConnection connection)
//                    throws DataAccessException {
//                RedisSerializer<String> serializer = getRedisSerializer();
//                byte[] key  = serializer.serialize(user.getId());
//                byte[] name = serializer.serialize(user.getName());
//                connection.set(key, name);
//                return true;
//            }
//        });
//        */
//
//        // 通过key获取
//        String result2 = (String) redisTemplate.execute(new RedisCallback<String>() {
//            public String doInRedis(RedisConnection connection)
//                    throws DataAccessException {
//                RedisSerializer<String> serializer = getRedisSerializer();
//                byte[] key = serializer.serialize("test");
//                byte[] value = connection.get(key);
//                if (value == null) {
//                    return null;
//                }
//                String name = serializer.deserialize(value);
//                return name;
//            }
//        });
//        System.out.println(result2);
//    }
//
//    /**
//     * 设置redisTemplate
//     * @param redisTemplate the redisTemplate to set
//     */
//    @SuppressWarnings(value = "unchecked")
//    public void setRedisTemplate(RedisTemplate<String, String> redisTemplate) {
//        this.redisTemplate = redisTemplate;
//    }
//
//    /**
//     * 获取 RedisSerializer
//     */
//    protected RedisSerializer<String> getRedisSerializer() {
//        return redisTemplate.getStringSerializer();
//    }
//}


text:
> see https://aka.ms/autorest

This is the AutoRest configuration file for StorageSync.

---

## Getting Started

To build the SDK for Storage, simply [Install AutoRest](https://aka.ms/autorest/install) and in this folder, run:

> `autorest`

To see additional help and options, run:

> `autorest --help`

---

## Configuration

### Basic Information

These are the global settings for the Storage Sync API.

``` yaml
openapi-type: arm
tag: package-2019-02-01
```

### Tag: package-2019-02-01

These settings apply only when `--tag=package-2019-02-01` is specified on the command line.

```yaml $(tag) == 'package-2019-02-01'
input-file:
  - Microsoft.StorageSync/stable/2019-02-01/storagesync.json
```

### Tag: package-2018-10-01

These settings apply only when `--tag=package-2018-07-01` is specified on the command line.

``` yaml $(tag) == 'package-2018-10-01'
input-file:
- Microsoft.StorageSync/stable/2018-10-01/storagesync.json
```

### Tag: package-2018-07-01

These settings apply only when `--tag=package-2018-07-01` is specified on the command line.

``` yaml $(tag) == 'package-2018-07-01'
input-file:
- Microsoft.StorageSync/stable/2018-07-01/storagesync.json
```

### Tag: package-2018-04-02

These settings apply only when `--tag=package-2018-04-02` is specified on the command line.

``` yaml $(tag) == 'package-2018-04-02'
input-file:
- Microsoft.StorageSync/stable/2018-04-02/storagesync.json
```

### Tag: package-2017-06-05-preview

These settings apply only when `--tag=package-2017-06-05-preview` is specified on the command line.

``` yaml $(tag) == 'package-2017-06-05-preview'
input-file:
- Microsoft.StorageSync/preview/2017-06-05-preview/storagesync.json
```

---

# Code Generation

## Swagger to SDK

This section describes what SDK should be generated by the automatic system.
This is not used by Autorest itself.

``` yaml $(swagger-to-sdk)
swagger-to-sdk:
  - repo: azure-sdk-for-python
  - repo: azure-sdk-for-java
  - repo: azure-sdk-for-go
  - repo: azure-sdk-for-js
  - repo: azure-sdk-for-node
```

## C#

These settings apply only when `--csharp` is specified on the command line.
Please also specify `--csharp-sdks-folder=<path to "SDKs" directory of your azure-sdk-for-net clone>`.

``` yaml $(csharp)
csharp:
  azure-arm: true
  license-header: MICROSOFT_MIT_NO_VERSION
  namespace: Microsoft.Azure.Management.StorageSync
  payload-flattening-threshold: 1
  output-folder: $(csharp-sdks-folder)/StorageSync/Management.StorageSync/Generated
  clear-output-folder: true
```

## Python

These settings apply only when `--python` is specified on the command line.
Please also specify `--python-sdks-folder=<path to the root directory of your azure-sdk-for-python clone>`.
Use `--python-mode=update` if you already have a setup.py and just want to update the code itself.

``` yaml $(python)
python-mode: create
python:
  azure-arm: true
  license-header: MICROSOFT_MIT_NO_VERSION
  payload-flattening-threshold: 2
  namespace: azure.mgmt.storagesync
  package-name: azure-mgmt-storagesync
  package-version: 1.0.0
  clear-output-folder: true
```

``` yaml $(python) && $(python-mode) == 'update'
python:
  no-namespace-folders: true
  output-folder: $(python-sdks-folder)/azure-mgmt-storagesync/azure/mgmt/storagesync
```

``` yaml $(python) && $(python-mode) == 'create'
python:
  basic-setup-py: true
  output-folder: $(python-sdks-folder)/azure-mgmt-storagesync
```

## Go

See configuration in [readme.go.md](./readme.go.md)

## Java

See configuration in [readme.java.md](./readme.java.md)


text:
use cgmath::Point2;
pub enum Shape {
    Circle{radius: f32},
    Polygon{points: Vec<Point2>}
}


text:
<?php
/**
 * Date Functions
 *
 * Display functions (template-tags) for use in WordPress templates.
 */

// Don't load directly
if ( !defined('ABSPATH') ) { die('-1'); }

if( class_exists( 'TribeEvents' ) ) {

	/**
	 * Start Date
	 *
	 * Returns the event start date and time
	 *
	 * @param int $event (optional)
	 * @param bool $displayTime If true shows date and time, if false only shows date
	 * @param string $dateFormat Allows date and time formating using standard php syntax (http://php.net/manual/en/function.date.php)
	 * @return string Date
	 */
	function tribe_get_start_date( $event = null, $displayTime = true, $dateFormat = '' )  {
		if ( is_null( $event ) ) {
			global $post;
			$event = $post;
		}
		if ( is_numeric( $event ) )
			$event = get_post( $event );

		if( tribe_event_is_all_day( $event ) )
			 $displayTime = false;

		if( empty($event->EventStartDate) && is_object( $event ) )
			$event->EventStartDate = tribe_get_event_meta( $event->ID, '_EventStartDate', true );

		if( isset($event->EventStartDate) ){
			$date = strtotime( $event->EventStartDate );
		}else{
			return;
		}

		return tribe_event_format_date($date, $displayTime, $dateFormat );
	}

	/**
	 * End Date
	 *
	 * Returns the event end date
	 *
	 * @param int $event (optional)
	 * @param bool $displayTime If true shows date and time, if false only shows date
	 * @param string $dateFormat Allows date and time formating using standard php syntax (http://php.net/manual/en/function.date.php)
	 * @return string Date
	 */
	function tribe_get_end_date( $event = null, $displayTime = true, $dateFormat = '' )  {
		if( is_null( $event ) ) {
			global $post;
			$event = $post;
		}
		if( is_numeric( $event ) ) {
			$event = get_post( $event );
		}

		if( tribe_event_is_all_day( $event ) ) {
			 $displayTime = false;
		}

		if( empty($event->EventEndDate) && is_object( $event ) ) {
			$event->EventEndDate = tribe_get_event_meta( $event->ID, '_EventEndDate', true );
		}

		if( isset($event->EventEndDate) ){
			if ( tribe_event_is_all_day( $event ) && empty( $event->_end_date_fixed ) && TribeDateUtils::timeOnly( $event->EventEndDate ) != '23:59:59' && TribeDateUtils::timeOnly( tribe_event_end_of_day() ) != '23:59' ) {
				// set the event end date to be one day earlier, if it's an all day event and the cutoff is past midnight
				// @todo remove this once we can have all day events without a start / end time
				$event->EventEndDate = date_create( $event->EventEndDate );
				$event->EventEndDate->modify( '-1 day' );
				$event->EventEndDate = $event->EventEndDate->format( TribeDateUtils::DBDATEFORMAT );
				$event->_end_date_fixed = true;
			}
			$date = strtotime( $event->EventEndDate );
		} else{
			return;
		}

		return tribe_event_format_date( $date, $displayTime, $dateFormat );
	}

	/**
	 * Formatted Date
	 *
	 * Returns formatted date
	 *
	 * @param string $date
	 * @param bool $displayTime If true shows date and time, if false only shows date
	 * @param string $dateFormat Allows date and time formating using standard php syntax (http://php.net/manual/en/function.date.php)
	 * @return string
	 */
	function tribe_event_format_date($date, $displayTime = true,  $dateFormat = '')  {

		if ( ! TribeDateUtils::isTimestamp( $date ) ) {
			$date = strtotime( $date );
		}

		if ( $dateFormat ) {
			$format = $dateFormat;
		} else {
			$date_year = date( 'Y', $date );
			$cur_year = date( 'Y', current_time( 'timestamp' ) );

			// only show the year in the date if it's not in the current year
			$with_year = $date_year == $cur_year ? false : true;

			if ( $displayTime ) {
				$format = tribe_get_datetime_format( $with_year );
			} else {
				$format = tribe_get_date_format( $with_year );
			}
		}

		$date = date_i18n( $format, $date );

		return apply_filters( 'tribe_event_formatted_date', $date, $displayTime, $dateFormat );

	}

	/**
	 * Returns formatted date for the official beginning of the day according to the Multi-day cutoff time option
	 *
	 * @param string $date The date to find the beginning of the day, defaults to today
	 * @param string $format Allows date and time formating using standard php syntax (http://php.net/manual/en/function.date.php)
	 * @return string
	 */
	function tribe_event_beginning_of_day( $date = null, $format = 'Y-m-d H:i:s' ){
		$multiday_cutoff = explode( ':', tribe_get_option( 'multiDayCutoff', '00:00' ) );
		$hours_to_add = $multiday_cutoff[0];
		$minutes_to_add = $multiday_cutoff[1];
		if( is_null($date) || empty($date) ) {
			return apply_filters( 'tribe_event_beginning_of_day', Date($format, strtotime( date( 'Y-m-d' ) . ' +' . $hours_to_add . ' hours ' . $minutes_to_add . ' minutes' ) ) );
		} else {
			return apply_filters( 'tribe_event_beginning_of_day', Date($format, strtotime( date( 'Y-m-d', strtotime($date) ) . ' +' . $hours_to_add . ' hours ' . $minutes_to_add . ' minutes' ) ) );
		}
	}

	/**
	 * Returns formatted date for the official end of the day according to the Multi-day cutoff time option
	 *
	 * @param string $date The date to find the end of the day, defaults to today
	 * @param string $format Allows date and time formating using standard php syntax (http://php.net/manual/en/function.date.php)
	 * @return string
	 */
	function tribe_event_end_of_day( $date = null, $format = 'Y-m-d H:i:s' ){
		$multiday_cutoff = explode( ':', tribe_get_option( 'multiDayCutoff', '00:00' ) );
		$hours_to_add = $multiday_cutoff[0];
		$minutes_to_add = $multiday_cutoff[1];
		if( is_null($date) || empty($date) ) {
			return apply_filters( 'tribe_event_end_of_day', Date($format, strtotime('tomorrow ' . ' +' . $hours_to_add . ' hours ' . $minutes_to_add . ' minutes' ) - 1 ) );
		} else {
			return apply_filters( 'tribe_event_end_of_day', Date($format, strtotime( date( 'Y-m-d', strtotime($date) ) . ' +1 day ' . $hours_to_add . ' hours ' . $minutes_to_add . ' minutes' ) - 1 ) );
		}
	}

}
?>


text:
{-# LANGUAGE OverloadedStrings #-}

module FS (
    collect
  , fuzzySort
  , socketPath
) where

import           Control.Applicative          ((<$>), (<*>))
import           Control.Concurrent.STM       (STM, TMVar, atomically, putTMVar,
                                               takeTMVar)
import           Control.Monad                (liftM, (>=>))
import           Data.List                    (isPrefixOf, isSuffixOf)
import           Data.Monoid                  ((<>))
import           Data.Text                    (Text)
import qualified Data.Text                    as T
import           Data.Vector                  (Vector, filterM, mapM, mapM_)
import qualified Data.Vector                  as V
import           Data.Vector.Algorithms.Intro (sortBy)
import           Prelude                      hiding (mapM, mapM_)
import           System.Directory             (doesDirectoryExist,
                                               getDirectoryContents,
                                               getUserDocumentsDirectory)
import           System.FilePath              ((</>))

modifyTMVar :: TMVar a -> (a -> a) -> STM ()
modifyTMVar v f = takeTMVar v >>= putTMVar v . f

-- | Recursively collects every file under `base` into the TMVar.
collect :: TMVar (Vector Text) -> Text -> IO ()
collect cs base = do
  fs <- qualify =<< contentsOf base
  atomically $ modifyTMVar cs $ flip (<>) fs
  directories fs
 where qualify     = mapM $ return . ((base <> "/") <>)
       directories = filterM (doesDirectoryExist . T.unpack) >=> mapM_ (collect cs)

contentsOf :: Text -> IO (Vector Text)
contentsOf = contentsOf' >=> validate >=> pack
 where contentsOf' = liftM V.fromList . getDirectoryContents . T.unpack
       validFile   = (&&) <$> (not . isPrefixOf ".") <*> (not . isSuffixOf ".pyc")
       validate    = filterM $ return . validFile
       pack        = mapM $ return . T.pack

fuzzyMatch :: String -> Text -> (Bool, Double, Text)
fuzzyMatch s p = fuzzyMatch' s p 0

fuzzyMatch' :: String -> Text -> Double -> (Bool, Double, Text)
fuzzyMatch'    []  p n = (True, n, p)
fuzzyMatch' (x:xs) p n = maybe (False, n, p) match $ x `elemIndex` p
 where match i   = let (b', n', _) = fuzzyMatch' xs (T.drop i p) (n + fromIntegral i)
                    in (b', n', p)
       elemIndex = T.findIndex . (==)

fuzzySort :: String -> Vector Text -> Vector Text
fuzzySort [] xs = xs
fuzzySort  s xs = V.map ext $ V.modify (sortBy cmp) $ V.filter flt $ V.map (fuzzyMatch s) xs
 where cmp (_, n, _) (_, n', _) = n `compare` n'
       flt (b, _, _) = b
       ext (_, _, t) = t

socketPath :: IO FilePath
socketPath = liftM (</> ".ff.socket") getUserDocumentsDirectory