text:
package command

import (
	"github.com/S-Shimotori/ninjin/model"
	"github.com/S-Shimotori/ninjin/function"
	"strings"
	"fmt"
)

type SwitchAtLeastCommand struct {
	Meta
}

func (c *SwitchAtLeastCommand) Run(args []string) int {
	if len(args) == 0 {
		fmt.Printf(FailInGetVersion)
		return 1
	}

	xcodeList, xcodeError := function.GetXcodeList(function.ApplicationsPath)
	if xcodeError != nil {
		fmt.Printf(FailInMakingAListOfXcodes)
		return 1
	}

	if model.IsShortVersion(args[0]) {
		v, _ := model.NewShortVersion(args[0])

		for i := len(xcodeList) - 1; i >= 0; i-- {
			if model.EqualsForShortVersion(v, xcodeList[i].Version.Short) || model.LessForShortVersion(v, xcodeList[i].Version.Short) {
				_, execError := function.ExecXcodeSelectSwitchOutput(xcodeList[i].AppPath + function.PathToDeveloperDirectoryPath)
				if execError == nil {
					fmt.Printf(SucceedInSwitching, model.GetShortVersionInString(xcodeList[i].Version.Short), model.GetProductBuildVersionInString(xcodeList[i].Version.ProductBuild))
					return 0
				} else {
					fmt.Printf(FailInSwitching, model.GetShortVersionInString(xcodeList[i].Version.Short))
					return 1
				}
			}
		}
		fmt.Printf(FailInFindingXcodeAtLeast, model.GetShortVersionInString(v))

	} else if model.IsProductBuildVersion(args[0]) {
		v, _ := model.NewProductBuildVersion(args[0])

		for i := len(xcodeList) - 1; i >= 0; i-- {
			if model.EqualsForProductBuildVersion(v, xcodeList[i].Version.ProductBuild) || model.LessForProductBuildVersion(v, xcodeList[i].Version.ProductBuild) {
				_, execError := function.ExecXcodeSelectSwitchOutput(xcodeList[i].AppPath + function.PathToDeveloperDirectoryPath)
				if execError == nil {
					fmt.Printf(SucceedInSwitching, model.GetShortVersionInString(xcodeList[i].Version.Short), model.GetProductBuildVersionInString(xcodeList[i].Version.ProductBuild))
					return 0
				} else {
					fmt.Printf(FailInSwitching, model.GetProductBuildVersionInString(xcodeList[i].Version.ProductBuild))
					return 1
				}
			}
		}
		fmt.Printf(FailInFindingXcodeAtLeast, model.GetProductBuildVersionInString(v))

	} else {
		fmt.Printf(FailInGetVersion)
	}
	return 1
}

func (c *SwitchAtLeastCommand) Synopsis() string {
	return "switch Xcode (at least [version])"
}

func (c *SwitchAtLeastCommand) Help() string {
	helpText := `

`
	return strings.TrimSpace(helpText)
}


text:
package com.outworkers.phantom.keys

import com.outworkers.phantom.column.AbstractColumn

/**
 * A trait mixable into a Column to allow clustering order.
 */
trait ClusteringOrder extends PrimaryKey {
  self: AbstractColumn[_] =>
  override val isClusteringKey = true

}

trait Ascending {
  self: AbstractColumn[_] with ClusteringOrder =>
  override val isAscending = true
}

trait Descending {
  self: AbstractColumn[_] with ClusteringOrder =>
}

redpajama_set_name: RedPajamaGithub


text:
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */

/*
 Copyright (C) 2006 Mark Joshi

 This file is part of QuantLib, a free-software/open-source library
 for financial quantitative analysts and developers - http://quantlib.org/

 QuantLib is free software: you can redistribute it and/or modify it
 under the terms of the QuantLib license.  You should have received a
 copy of the license along with this program; if not, please email
 <quantlib-dev@lists.sf.net>. The license is also available online at
 <http://quantlib.org/license.shtml>.

 This program is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE.  See the license for more details.
*/

#include <ql/models/marketmodels/callability/nothingexercisevalue.hpp>
#include <ql/models/marketmodels/utilities.hpp>
#include <ql/errors.hpp>

namespace QuantLib {

    NothingExerciseValue::NothingExerciseValue(
                                          const std::vector<Time>& rateTimes)
    : numberOfExercises_(rateTimes.empty() ? 0 : rateTimes.size()-1),
      rateTimes_(rateTimes),
      currentIndex_(0) {

        checkIncreasingTimes(rateTimes);
        QL_REQUIRE(numberOfExercises_>0,
                   "Rate times must contain at least two values");
        cf_.amount = 0.0;
        std::vector<Time> evolutionTimes(rateTimes_);
        evolutionTimes.pop_back();
        evolution_= EvolutionDescription(rateTimes_, evolutionTimes);
    }

    Size NothingExerciseValue::numberOfExercises() const {
        return numberOfExercises_;
    }

    const EvolutionDescription& NothingExerciseValue::evolution() const {
        return evolution_;
    }

    std::vector<Time> NothingExerciseValue::possibleCashFlowTimes() const {
        return rateTimes_;
    }

    void NothingExerciseValue::reset() {
        currentIndex_=0;
    }

    void NothingExerciseValue::nextStep(const CurveState&) {
        cf_.timeIndex = currentIndex_;
        ++currentIndex_;
    }

    std::valarray<bool> NothingExerciseValue::isExerciseTime() const {
        return std::valarray<bool>(true, numberOfExercises_); // opposite way round from vector constructor
    }

    MarketModelMultiProduct::CashFlow
    NothingExerciseValue::value(const CurveState&) const {
         return cf_;
    }

    std::auto_ptr<MarketModelExerciseValue>
    NothingExerciseValue::clone() const {
        return std::auto_ptr<MarketModelExerciseValue>(
                                             new NothingExerciseValue(*this));
    }

}


text:
/*
 * 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.
 */
package com.facebook.presto.operator.aggregation;

import com.facebook.presto.block.Block;
import com.facebook.presto.block.BlockAssertions;
import com.facebook.presto.block.BlockBuilder;
import com.facebook.presto.block.BlockCursor;
import com.facebook.presto.block.rle.RunLengthEncodedBlock;
import com.facebook.presto.block.uncompressed.UncompressedBlock;
import com.facebook.presto.operator.AggregationOperator.Aggregator;
import com.facebook.presto.operator.Page;
import com.facebook.presto.sql.planner.plan.AggregationNode.Step;
import com.facebook.presto.sql.tree.Input;
import com.facebook.presto.tuple.Tuple;
import com.facebook.presto.tuple.TupleInfo;
import com.google.common.collect.Iterables;
import org.testng.annotations.Test;

import java.util.Arrays;

import static com.facebook.presto.operator.AggregationFunctionDefinition.aggregation;
import static com.facebook.presto.operator.AggregationOperator.createAggregator;
import static com.facebook.presto.tuple.Tuples.nullTuple;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;

public abstract class AbstractTestAggregationFunction
{
    public abstract Block getSequenceBlock(int start, int length);

    public abstract AggregationFunction getFunction();

    public abstract Object getExpectedValue(int start, int length);

    @Test
    public void testNoPositions()
            throws Exception
    {
        testMultiplePositions(getSequenceBlock(0, 10), getExpectedValue(0, 0), 0);
    }

    @Test
    public void testSinglePosition()
            throws Exception
    {
        testMultiplePositions(getSequenceBlock(0, 10), getExpectedValue(0, 1), 1);
    }

    @Test
    public void testMultiplePositions()
    {
        testMultiplePositions(getSequenceBlock(0, 10), getExpectedValue(0, 5), 5);
    }

    @Test
    public void testAllPositionsNull()
            throws Exception
    {
        Block block = new RunLengthEncodedBlock(nullTuple(getSequenceBlock(0, 10).getTupleInfo()), 11);
        testMultiplePositions(block, getExpectedValue(0, 0), 10);
    }

    @Test
    public void testMixedNullAndNonNullPositions()
    {
        Block alternatingNullsBlock = createAlternatingNullsBlock(getSequenceBlock(0, 10));
        testMultiplePositions(alternatingNullsBlock, getExpectedValue(0, 5), 10);
    }

    protected void testMultiplePositions(Block block, Object expectedValue, int positions)
    {
        // test with input at field 0
        testMultiplePositions(block, expectedValue, positions, 0);

        // test with input and field != 0
        testMultiplePositions(block, expectedValue, positions, 1);
    }

    private void testMultiplePositions(Block block, Object expectedValue, int positions, int field)
    {
        BlockCursor cursor = createCompositeTupleBlock(block, field).cursor();
        Aggregator function = createAggregator(aggregation(getFunction(), new Input(0, field)), Step.SINGLE);

        for (int i = 0; i < positions; i++) {
            assertTrue(cursor.advanceNextPosition());
            function.addValue(cursor);
        }

        Object actualValue = getActualValue(function);
        assertEquals(actualValue, expectedValue);
        if (positions > 0) {
            assertEquals(cursor.getPosition(), positions - 1);
        }
    }

    private Object getActualValue(Aggregator function)
    {
        return BlockAssertions.toValues(function.getResult()).get(0).get(0);
    }

    // todo enable when empty blocks are supported
    @Test(enabled = false)
    public void testVectorNoPositions()
            throws Exception
    {
        testVectorMultiplePositions(getSequenceBlock(0, 0), getExpectedValue(0, 0));
    }

    @Test
    public void testVectorSinglePosition()
            throws Exception
    {
        testVectorMultiplePositions(getSequenceBlock(0, 1), getExpectedValue(0, 1));
    }

    @Test
    public void testVectorMultiplePositions()
    {
        testVectorMultiplePositions(getSequenceBlock(0, 5), getExpectedValue(0, 5));
    }

    @Test
    public void testVectorAllPositionsNull()
            throws Exception
    {
        Block nullsBlock = new RunLengthEncodedBlock(nullTuple(getSequenceBlock(0, 1).getTupleInfo()), 11);
        testVectorMultiplePositions(nullsBlock, getExpectedValue(0, 0));
    }

    @Test
    public void testVectorMixedNullAndNonNullPositions()
    {
        Block alternatingNullsBlock = createAlternatingNullsBlock(getSequenceBlock(0, 5));
        testVectorMultiplePositions(alternatingNullsBlock, getExpectedValue(0, 5));
    }

    protected void testVectorMultiplePositions(Block block, Object expectedValue)
    {
        // test with input at field 0
        testVectorMultiplePositions(block, expectedValue, 0);

        // test with input and field != 0
        testVectorMultiplePositions(block, expectedValue, 1);
    }

    private void testVectorMultiplePositions(Block block, Object expectedValue, int field)
    {
        Aggregator function = createAggregator(aggregation(getFunction(), new Input(0, field)), Step.SINGLE);

        function.addValue(new Page(createCompositeTupleBlock(block, field)));
        assertEquals(getActualValue(function), expectedValue);
    }

    @Test
    public void testPartialWithMultiplePositions()
    {
        testPartialWithMultiplePositions(getSequenceBlock(0, 10), getExpectedValue(0, 10));
    }

    @Test
    public void testPartialWithMixedNullAndNonNullPositions()
    {
        Block alternatingNullsBlock = createAlternatingNullsBlock(getSequenceBlock(0, 10));
        testPartialWithMultiplePositions(alternatingNullsBlock, getExpectedValue(0, 10));
    }

    protected void testPartialWithMultiplePositions(Block block, Object expectedValue)
    {
        UncompressedBlock partialsBlock = performPartialAggregation(block);
        Aggregator function = createAggregator(aggregation(getFunction(), new Input(0, 0)), Step.FINAL);
        BlockCursor partialsCursor = partialsBlock.cursor();
        while (partialsCursor.advanceNextPosition()) {
            function.addValue(partialsCursor);
        }

        assertEquals(getActualValue(function), expectedValue);
    }

    @Test
    public void testVectorPartialWithMultiplePositions()
    {
        testVectorPartialWithMultiplePositions(getSequenceBlock(0, 10), getExpectedValue(0, 10));
    }

    @Test
    public void testVectorPartialWithMixedNullAndNonNullPositions()
    {
        Block alternatingNullsBlock = createAlternatingNullsBlock(getSequenceBlock(0, 10));
        testVectorPartialWithMultiplePositions(alternatingNullsBlock, getExpectedValue(0, 10));
    }

    public Block createAlternatingNullsBlock(Block sequenceBlock)
    {
        BlockBuilder blockBuilder = new BlockBuilder(sequenceBlock.getTupleInfo());
        BlockCursor cursor = sequenceBlock.cursor();
        while (cursor.advanceNextPosition()) {
            blockBuilder.appendNull().append(cursor.getTuple());
        }
        return blockBuilder.build();
    }

    /**
     * Produce a block with "field" number of columns and place column 0 from the
     * provided block into the last column of the resulting block
     * <p/>
     * Fields 0 to "field - 1" are set to null
     */
    private Block createCompositeTupleBlock(Block sequenceBlock, int field)
    {
        TupleInfo.Type[] types = new TupleInfo.Type[field + 1];
        Arrays.fill(types, TupleInfo.Type.VARIABLE_BINARY);

        types[field] = Iterables.getOnlyElement(sequenceBlock.getTupleInfo().getTypes());

        BlockBuilder blockBuilder = new BlockBuilder(new TupleInfo(types));
        BlockCursor cursor = sequenceBlock.cursor();
        while (cursor.advanceNextPosition()) {
            for (int i = 0; i < field; i++) {
                blockBuilder.appendNull();
            }
            blockBuilder.append(cursor.getTuple());
        }

        return blockBuilder.build();
    }

    protected void testVectorPartialWithMultiplePositions(Block block, Object expectedValue)
    {
        UncompressedBlock partialsBlock = performPartialAggregation(block);
        Aggregator function = createAggregator(aggregation(getFunction(), new Input(0, 0)), Step.FINAL);

        BlockCursor blockCursor = partialsBlock.cursor();
        while (blockCursor.advanceNextPosition()) {
            function.addValue(blockCursor);
        }
        assertEquals(getActualValue(function), expectedValue);
    }

    private UncompressedBlock performPartialAggregation(Block block)
    {
        BlockBuilder blockBuilder = new BlockBuilder(getFunction().getIntermediateTupleInfo());
        BlockCursor cursor = block.cursor();
        while (cursor.advanceNextPosition()) {
            Aggregator function = createAggregator(aggregation(getFunction(), new Input(0, 0)), Step.PARTIAL);
            function.addValue(cursor);
            BlockCursor result = function.getResult().cursor();
            assertTrue(result.advanceNextPosition());
            Tuple tuple = result.getTuple();
            blockBuilder.append(tuple);
        }
        return blockBuilder.build();
    }

//    @Test
//    public void testCombinerWithMultiplePositions()
//    {
//        testCombinerWithMultiplePositions(getSequenceBlock(0, 10).cursor(), getExpectedValue(0, 5), 5);
//    }
//
//    @Test
//    public void testCombinerWithMixedNullAndNonNullPositions()
//    {
//        AlternatingNullsBlockCursor cursor = new AlternatingNullsBlockCursor(getSequenceBlock(0, 10).cursor());
//        testCombinerWithMultiplePositions(cursor, getExpectedValue(0, 5), 10);
//    }
//
//    protected void testCombinerWithMultiplePositions(BlockCursor cursor, Object expectedValue, int positions)
//    {
//        // "aggregate" each input value into a partial result
//        List<Block> blocks = new ArrayList<>();
//        for (int i = 0; i < positions; i++) {
//            Aggregator function = createAggregator(aggregation(getFunction(), 0), Step.FINAL);
//            assertTrue(cursor.advanceNextPosition());
//            function.addValue(new BlockCursor[]{cursor});
//            BlockCursor result = function.getResult().cursor();
//            assertTrue(result.advanceNextPosition());
//            Tuple tuple = result.getTuple();
//
//            blocks.add(new BlockBuilder(getFunction().getIntermediateTupleInfo())
//                    .append(tuple)
//                    .build());
//        }
//        if (positions > 0) {
//            assertEquals(cursor.getPosition(), positions - 1);
//        }
//        assertCombineFinalAggregation(blocks, expectedValue);
//    }
//
//    private void assertCombineFinalAggregation(List<Block> blocks, Object expectedValue)
//    {
//        // combine partial results together row at a time
//        Block combinedBlock = null;
//        for (Block block : blocks) {
//            AggregationFunctionStep function = combinerAggregation(getFunction());
//            if (combinedBlock != null) {
//                BlockCursor intermediateCursor = combinedBlock.cursor();
//                assertTrue(intermediateCursor.advanceNextPosition());
//                function.add(intermediateCursor);
//            }
//
//            BlockCursor intermediateCursor = block.cursor();
//            assertTrue(intermediateCursor.advanceNextPosition());
//            function.add(intermediateCursor);
//
//            Tuple tuple = function.evaluate();
//            combinedBlock = new BlockBuilder(getFunction().getIntermediateTupleInfo())
//                    .append(tuple)
//                    .build();
//        }
//
//        // produce final result using combine block
//        assertFinalAggregation(combinedBlock, expectedValue);
//    }
//
//    private void assertFinalAggregation(Block partialsBlock, Object expectedValue)
//    {
//        AggregationFunctionStep function = finalAggregation(getFunction());
//        BlockCursor partialsCursor = partialsBlock.cursor();
//        while (partialsCursor.advanceNextPosition()) {
//            function.add(partialsCursor);
//        }
//
//        assertEquals(getActualValue(function), expectedValue);
//    }

    @Test
    public void testNegativeOnlyValues()
            throws Exception
    {
        testVectorMultiplePositions(getSequenceBlock(-10, 5), getExpectedValue(-10, 5));
    }

    @Test
    public void testPositiveOnlyValues()
            throws Exception
    {
        testVectorMultiplePositions(getSequenceBlock(2, 4), getExpectedValue(2, 4));
    }
}


text:
class Docker < Formula
  desc "Pack, ship and run any application as a lightweight container"
  homepage "https://www.docker.com/"
  url "https://github.com/docker/docker-ce.git",
      :tag => "v18.02.0-ce",
      :revision => "fc4de447b563498eb4da89f56fb858bbe761d91b"

  bottle do
    cellar :any_skip_relocation
    sha256 "bffb3b5e1cc8293fdfe22346eadc0f4550aa0b80f3112a328906a663d47467cd" => :high_sierra
    sha256 "f6714ac9b9031397332e9a45559e6a4161fe00d906324415f5e4b77fdb825533" => :sierra
    sha256 "1bf8f7d1293155560ee2861f2580eef8bc861a20d4e112f88cb8ec489706a1dc" => :el_capitan
  end

  option "with-experimental", "Enable experimental features"
  option "without-completions", "Disable bash/zsh completions"

  depends_on "go" => :build

  if build.with? "experimental"
    depends_on "libtool" => :run
    depends_on "yubico-piv-tool" => :recommended
  end

  def install
    ENV["DOCKER_EXPERIMENTAL"] = "1" if build.with? "experimental"
    ENV["GOPATH"] = buildpath
    dir = buildpath/"src/github.com/docker/cli"
    dir.install (buildpath/"components/cli").children
    cd dir do
      commit = Utils.popen_read("git rev-parse --short HEAD").chomp
      ldflags = ["-X github.com/docker/cli/cli.GitCommit=#{commit}",
                 "-X github.com/docker/cli/cli.Version=#{version}-ce"]
      system "go", "build", "-o", bin/"docker", "-ldflags", ldflags.join(" "),
             "github.com/docker/cli/cmd/docker"

      if build.with? "completions"
        bash_completion.install "contrib/completion/bash/docker"
        fish_completion.install "contrib/completion/fish/docker.fish"
        zsh_completion.install "contrib/completion/zsh/_docker"
      end
    end
  end

  test do
    system "#{bin}/docker", "--version"
  end
end


text:
class RedirectDetail < DomainModel

  belongs_to :site_node
  belongs_to :redirect_site_node,:class_name => 'SiteNode'
  def destination
    if self.redirect_type == 'external'
      self.redirect_url
    elsif self.site_node
      self.redirect_site_node.node_path
    else
      '/'
    end
  end

  def validate_on_update
  	if redirect_type == 'site_node'
  		unless redirect_site_node_id
  			errors.add(:redirect_site_node_id,"Please select a redirection page")
  		end
  	elsif redirect_type == 'external'
  		unless redirect_url
  			errors.add(:redirect_url,"Please enter a redirection url")
  		end
  	else
  		errors.add(:redirect_type,"Please select the redirection type")
  	end

  end

  has_options :redirect_type, [ [ 'A Different Page', 'site_node' ], ['An External URL','external' ]]

end


text:
#pragma once
#include <aws/backup/Backup_EXPORTS.h>
#include <aws/backup/model/Lifecycle.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace Backup
{
namespace Model
{

  /**
   *
The details of the copy operation.

See Also:
   AWS
   * API Reference

   */
  class AWS_BACKUP_API CopyAction
  {
  public:
    CopyAction();
    CopyAction(Aws::Utils::Json::JsonView jsonValue);
    CopyAction& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    inline const Lifecycle& GetLifecycle() const{ return m_lifecycle; }

    inline bool LifecycleHasBeenSet() const { return m_lifecycleHasBeenSet; }

    inline void SetLifecycle(const Lifecycle& value) { m_lifecycleHasBeenSet = true; m_lifecycle = value; }

    inline void SetLifecycle(Lifecycle&& value) { m_lifecycleHasBeenSet = true; m_lifecycle = std::move(value); }

    inline CopyAction& WithLifecycle(const Lifecycle& value) { SetLifecycle(value); return *this;}

    inline CopyAction& WithLifecycle(Lifecycle&& value) { SetLifecycle(std::move(value)); return *this;}

    /**
     *
An Amazon Resource Name (ARN) that uniquely identifies the destination backup
     * vault for the copied backup. For example,
     * arn:aws:backup:us-east-1:123456789012:vault:aBackupVault.

     */
    inline const Aws::String& GetDestinationBackupVaultArn() const{ return m_destinationBackupVaultArn; }

    /**
     *
An Amazon Resource Name (ARN) that uniquely identifies the destination backup
     * vault for the copied backup. For example,
     * arn:aws:backup:us-east-1:123456789012:vault:aBackupVault.

     */
    inline bool DestinationBackupVaultArnHasBeenSet() const { return m_destinationBackupVaultArnHasBeenSet; }

    /**
     *
An Amazon Resource Name (ARN) that uniquely identifies the destination backup
     * vault for the copied backup. For example,
     * arn:aws:backup:us-east-1:123456789012:vault:aBackupVault.

     */
    inline void SetDestinationBackupVaultArn(const Aws::String& value) { m_destinationBackupVaultArnHasBeenSet = true; m_destinationBackupVaultArn = value; }

    /**
     *
An Amazon Resource Name (ARN) that uniquely identifies the destination backup
     * vault for the copied backup. For example,
     * arn:aws:backup:us-east-1:123456789012:vault:aBackupVault.

     */
    inline void SetDestinationBackupVaultArn(Aws::String&& value) { m_destinationBackupVaultArnHasBeenSet = true; m_destinationBackupVaultArn = std::move(value); }

    /**
     *
An Amazon Resource Name (ARN) that uniquely identifies the destination backup
     * vault for the copied backup. For example,
     * arn:aws:backup:us-east-1:123456789012:vault:aBackupVault.

     */
    inline void SetDestinationBackupVaultArn(const char* value) { m_destinationBackupVaultArnHasBeenSet = true; m_destinationBackupVaultArn.assign(value); }

    /**
     *
An Amazon Resource Name (ARN) that uniquely identifies the destination backup
     * vault for the copied backup. For example,
     * arn:aws:backup:us-east-1:123456789012:vault:aBackupVault.

     */
    inline CopyAction& WithDestinationBackupVaultArn(const Aws::String& value) { SetDestinationBackupVaultArn(value); return *this;}

    /**
     *
An Amazon Resource Name (ARN) that uniquely identifies the destination backup
     * vault for the copied backup. For example,
     * arn:aws:backup:us-east-1:123456789012:vault:aBackupVault.

     */
    inline CopyAction& WithDestinationBackupVaultArn(Aws::String&& value) { SetDestinationBackupVaultArn(std::move(value)); return *this;}

    /**
     *
An Amazon Resource Name (ARN) that uniquely identifies the destination backup
     * vault for the copied backup. For example,
     * arn:aws:backup:us-east-1:123456789012:vault:aBackupVault.

     */
    inline CopyAction& WithDestinationBackupVaultArn(const char* value) { SetDestinationBackupVaultArn(value); return *this;}

  private:

    Lifecycle m_lifecycle;
    bool m_lifecycleHasBeenSet;

    Aws::String m_destinationBackupVaultArn;
    bool m_destinationBackupVaultArnHasBeenSet;
  };

} // namespace Model
} // namespace Backup
} // namespace Aws


text:
.. _api:

#############
API Reference
#############

Plot creation
=============

.. currentmodule:: plotnine

.. autosummary::
   :toctree: generated/
   :nosignatures:
   :template: members-example.rst

   ggplot
   qplot
   ~watermark.watermark
   ~layer.layer
   ~animation.PlotnineAnimation
   ~ggplot.save_as_pdf_pages

Mapping Aesthetics
------------------

Aesthetics are the visual properties of a plot. The following functions control
how the data (and calculations based on the data) is mapped to the aesthetics.

.. currentmodule:: plotnine.mapping

.. autosummary::
   :toctree: generated/
   :nosignatures:
   :template: members-example.rst

   aes
   after_stat
   after_scale
   stage

geoms
=====

Geometric objects (geoms) are responsible for the visual representation
of data points. ``geom_*`` classes determine the kind of geometric
objects and every plot must have at least one ``geom`` added to it. The
distinct visual aspects of the representation are controlled by the
:class:`~plotnine.aes` mapping.

.. currentmodule:: plotnine.geoms

.. autosummary::
   :toctree: generated/
   :nosignatures:
   :template: members-example.rst

   ~geom.geom

.. autosummary::
   :toctree: generated/
   :nosignatures:
   :template: main.rst

   geom_abline
   geom_area
   geom_bar
   geom_blank
   geom_boxplot
   geom_col
   geom_count
   geom_crossbar
   geom_density
   geom_density_2d
   geom_dotplot
   geom_errorbar
   geom_errorbarh
   geom_freqpoly
   geom_bin_2d
   geom_histogram
   geom_hline
   geom_jitter
   geom_label
   geom_line
   geom_linerange
   geom_map
   geom_path
   geom_point
   geom_pointdensity
   geom_pointrange
   geom_polygon
   geom_quantile
   geom_qq
   geom_qq_line
   geom_raster
   geom_rect
   geom_ribbon
   geom_rug
   geom_segment
   geom_sina
   geom_smooth
   geom_spoke
   geom_step
   geom_text
   geom_tile
   geom_violin
   geom_vline

Related to geoms
----------------

.. autosummary::
   :toctree: generated/
   :template: main.rst

   annotate
   annotation_logticks
   annotation_stripes
   arrow

Labels
------
.. currentmodule:: plotnine.labels

.. autosummary::
   :toctree: generated/
   :template: main.rst

   labs
   xlab
   ylab
   ggtitle

stats
=====

Statistical transformations (stats) do aggregations and other
computations on data before it is drawn out. ``stat_*`` determine
the type of computation done on the data. Different types of
computations yield varied results, so a ``stat`` must be paired
with a ``geom`` that can represent all or some of the computations.

.. currentmodule:: plotnine.stats

.. autosummary::
   :toctree: generated/
   :nosignatures:
   :template: members-example.rst

   ~stat.stat

.. autosummary::
   :toctree: generated/
   :nosignatures:
   :template: main.rst

   stat_bin
   stat_bin_2d
   stat_bindot
   stat_boxplot
   stat_count
   stat_density
   stat_density_2d
   stat_ecdf
   stat_ellipse
   stat_function
   stat_hull
   stat_identity
   stat_qq
   stat_qq_line
   stat_quantile
   stat_sina
   stat_smooth
   stat_sum
   stat_summary
   stat_summary_bin
   stat_unique
   stat_ydensity

facets
======

Faceting is a way to subset data and plot it on different panels.

.. currentmodule:: plotnine.facets

.. autosummary::
   :toctree: generated/
   :nosignatures:
   :template: members-example.rst

   ~facet.facet

.. autosummary::
   :toctree: generated/
   :template: main.rst

   facet_grid
   facet_null
   facet_wrap
   ~labelling.labeller
   ~labelling.as_labeller
   ~labelling.label_value
   ~labelling.label_both
   ~labelling.label_context

scales
======

Scales control the mapping from data to aesthetics. They take data and
adjust it to fit the different aspects of the visual sense i.e. length,
colour, size and shape.

.. currentmodule:: plotnine.scales

Base scales
-----------
.. autosummary::
   :toctree: generated/
   :template: members-example.rst

   ~scale.scale
   ~scale.scale_discrete
   ~scale.scale_continuous
   ~scale.scale_datetime

Alpha scales
------------
.. autosummary::
   :toctree: generated/
   :template: main.rst

   scale_alpha
   scale_alpha_discrete
   scale_alpha_continuous
   scale_alpha_datetime

Identity Scales
---------------
.. autosummary::
   :toctree: generated/
   :template: main.rst

   scale_alpha_identity
   scale_color_identity
   scale_colour_identity
   scale_fill_identity
   scale_linetype_identity
   scale_shape_identity
   scale_size_identity

Color and fill scales
---------------------
.. autosummary::
   :toctree: generated/
   :template: main.rst

   scale_color_brewer
   scale_color_cmap
   scale_color_continuous
   scale_color_desaturate
   scale_color_datetime
   scale_color_discrete
   scale_color_distiller
   scale_color_gradient
   scale_color_gradient2
   scale_color_gradientn
   scale_color_gray
   scale_color_grey
   scale_color_hue
   scale_fill_brewer
   scale_fill_cmap
   scale_fill_continuous
   scale_fill_datetime
   scale_fill_desaturate
   scale_fill_discrete
   scale_fill_distiller
   scale_fill_gradient
   scale_fill_gradient2
   scale_fill_gradientn
   scale_fill_gray
   scale_fill_grey
   scale_fill_hue

Manual scales
-------------
.. autosummary::
   :toctree: generated/
   :template: main.rst

   scale_alpha_manual
   scale_color_manual
   scale_colour_manual
   scale_fill_manual
   scale_linetype_manual
   scale_shape_manual
   scale_size_manual

Linetype scales
---------------
.. autosummary::
   :toctree: generated/
   :template: main.rst

   scale_linetype
   scale_linetype_discrete

Shape scales
------------
.. autosummary::
   :toctree: generated/
   :template: main.rst

   scale_shape
   scale_shape_discrete

Size scales
-----------
.. autosummary::
   :toctree: generated/
   :template: main.rst

   scale_size
   scale_size_area
   scale_size_continuous
   scale_size_discrete
   scale_size_radius
   scale_size_datetime

Position scales
---------------
.. autosummary::
   :toctree: generated/
   :template: main.rst

   scale_x_continuous
   scale_x_date
   scale_x_datetime
   scale_x_discrete
   scale_x_log10
   scale_x_reverse
   scale_x_sqrt
   scale_x_timedelta
   scale_y_continuous
   scale_y_date
   scale_y_datetime
   scale_y_discrete
   scale_y_log10
   scale_y_reverse
   scale_y_sqrt
   scale_y_timedelta

Scale limits
------------
.. currentmodule:: plotnine.scales

.. autosummary::
   :toctree: generated/
   :template: main.rst

   lims
   xlim
   ylim
   expand_limits

Scale guides
------------
Guides allow you to interpret data represented on a scales.
Guides include the ``x`` and ``y`` axes, legends and colorbars.

.. currentmodule:: plotnine.guides

.. autosummary::
   :toctree: generated/
   :template: main.rst

   guides
   ~guide.guide
   guide_legend
   guide_colorbar

positions
=========

Overlapping objects can be visualized better if their positions
are adjusted. That is what the ``position_*`` class do. Each
``geom`` is associated with one position adjustment class.

.. currentmodule:: plotnine.positions

.. autosummary::
   :toctree: generated/
   :template: main.rst

   position_dodge
   position_dodge2
   position_fill
   position_identity
   position_jitter
   position_jitterdodge
   position_nudge
   position_stack

themes
======

Themes control the visual appearance of the non-data elements the plot.

.. currentmodule:: plotnine.themes

.. autosummary::
   :toctree: generated/
   :template: main.rst

   theme
   theme_538
   theme_bw
   theme_classic
   theme_dark
   theme_gray
   theme_grey
   theme_light
   theme_linedraw
   theme_matplotlib
   theme_minimal
   theme_seaborn
   theme_tufte
   theme_void
   theme_xkcd

.. _themeables:

Themeables
----------

These define aspects of a plot that can be themed. They
can be used to create a new theme or modify an existing theme.
They define the keyword arguments to :class:`~plotnine.themes.theme`.
Users should never create instances of *themeable*.

.. currentmodule:: plotnine.themes.themeable

.. autosummary::
   :toctree: generated/
   :nosignatures:
   :template: themeables.rst

   aspect_ratio
   axis_line
   axis_line_x
   axis_line_y
   axis_text
   axis_text_x
   axis_text_y
   axis_ticks
   axis_ticks_direction
   axis_ticks_direction_x
   axis_ticks_direction_y
   axis_ticks_length
   axis_ticks_length_major
   axis_ticks_length_minor
   axis_ticks_major
   axis_ticks_major_x
   axis_ticks_major_y
   axis_ticks_minor
   axis_ticks_minor_x
   axis_ticks_minor_y
   axis_ticks_pad
   axis_ticks_pad_major
   axis_ticks_pad_minor
   axis_title
   axis_title_x
   axis_title_y
   dpi
   figure_size
   legend_background
   legend_box
   legend_box_background
   legend_box_just
   legend_box_margin
   legend_box_spacing
   legend_direction
   legend_entry_spacing
   legend_entry_spacing_x
   legend_entry_spacing_y
   legend_key
   legend_key_height
   legend_key_size
   legend_key_width
   legend_margin
   legend_position
   legend_spacing
   legend_text
   legend_text_colorbar
   legend_text_legend
   legend_title
   legend_title_align
   line
   panel_background
   panel_border
   panel_grid
   panel_grid_major
   panel_grid_major_x
   panel_grid_major_y
   panel_grid_minor
   panel_grid_minor_x
   panel_grid_minor_y
   panel_ontop
   panel_spacing
   panel_spacing_x
   panel_spacing_y
   plot_background
   plot_margin
   plot_title
   rect
   strip_background
   strip_background_x
   strip_background_y
   strip_margin
   strip_margin_x
   strip_margin_y
   strip_text
   strip_text_x
   strip_text_y
   subplots_adjust
   text
   title
   themeable

Theme helper functions and classes
----------------------------------

.. currentmodule:: plotnine.themes

.. autosummary::
   :toctree: generated/
   :template: main.rst

   theme_set
   theme_get
   theme_update
   element_line
   element_rect
   element_text

coordinates
===========

Coordinate systems put together the two position scales to produce
a 2d location.

.. currentmodule:: plotnine.coords

.. autosummary::
   :toctree: generated/
   :template: main.rst

   coord_cartesian
   coord_equal
   coord_fixed
   coord_flip
   coord_trans

options
=======

When working interactively, some of the options make it convenient to
create plots that have a common look and feel. Another way to do it,
to set a default theme using :func:`~plotnine.themes.theme_set`.

.. currentmodule:: plotnine.options

.. autosummary::
   :toctree: generated/
   :template: main.rst

   aspect_ratio
   base_family
   close_all_figures
   current_theme
   dpi
   figure_size
   get_option
   set_option

datasets
========

These datasets ship with the plotnine and you can import them
with from the ``plotnine.data`` sub-package.

.. currentmodule:: plotnine.data

.. autosummary::
   :toctree: generated/
   :template: data.rst

   diamonds
   economics
   economics_long
   faithful
   faithfuld
   huron
   luv_colours
   meat
   midwest
   mpg
   msleep
   mtcars
   pageviews
   presidential
   seals
   txhousing


text:
import {NgModule} from '@angular/core';
import {Route, RouterModule} from '@angular/router';
import {DEFAULT_ACTIONBAR} from '@common/components/actionbars/routing';
import {BREADCRUMBS} from '../../../index.messages';

import {CLUSTER_ROUTE} from '../routing';

import {RoleDetailComponent} from './detail/component';
import {RoleListComponent} from './list/component';

const ROLE_LIST_ROUTE: Route = {
  path: '',
  component: RoleListComponent,
  data: {
    breadcrumb: BREADCRUMBS.Roles,
    parent: CLUSTER_ROUTE,
  },
};

const ROLE_DETAIL_ROUTE: Route = {
  path: ':resourceNamespace/:resourceName',
  component: RoleDetailComponent,
  data: {
    breadcrumb: '{{ resourceName }}',
    parent: ROLE_LIST_ROUTE,
  },
};

@NgModule({
  imports: [RouterModule.forChild([ROLE_LIST_ROUTE, ROLE_DETAIL_ROUTE, DEFAULT_ACTIONBAR])],
  exports: [RouterModule],
})
export class RoleRoutingModule {}


text:
@rem Licensed to the Apache Software Foundation (ASF) under one
@rem or more contributor license agreements.  See the NOTICE file
@rem distributed with this work for additional information
@rem regarding copyright ownership.  The ASF licenses this file
@rem to you under the Apache License, Version 2.0 (the
@rem "License"); you may not use this file except in compliance
@rem with the License.  You may obtain a copy of the License at
@rem
@rem   http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing,
@rem software distributed under the License is distributed on an
@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@rem KIND, either express or implied.  See the License for the
@rem specific language governing permissions and limitations
@rem under the License.

@echo on

@rem Building Gandiva in the wheels is disabled for now to make the wheels
@rem smaller.

@rem --file=arrow\ci\conda_env_gandiva.yml ^

@rem create conda environment for compiling
call conda.bat create -n wheel-build -q -y -c conda-forge ^
    --file=arrow\ci\conda_env_cpp.yml ^
    --file=arrow\ci\conda_env_python.yml ^
    "vs2015_runtime<14.16" ^
    python=%PYTHON_VERSION% || exit /B

call conda.bat activate wheel-build

set ARROW_HOME=%CONDA_PREFIX%\Library
set PARQUET_HOME=%CONDA_PREFIX%\Library
echo %ARROW_HOME%

@rem Build Arrow C++ libraries
mkdir arrow\cpp\build
pushd arrow\cpp\build

@rem ARROW-6938(wesm): bz2 is disabled on Windows because the build
@rem currently selects the shared lib for linking. Using the zstd lib from
@rem conda-forge also results in a broken build so we use the BUNDLED
@rem dependency resolution strategy for now

cmake -A "%ARCH%" ^
      -G "%GENERATOR%" ^
      -DCMAKE_INSTALL_PREFIX=%ARROW_HOME% ^
      -DARROW_BOOST_USE_SHARED=OFF ^
      -DARROW_BUILD_STATIC=OFF ^
      -DARROW_BUILD_TESTS=OFF ^
      -DCMAKE_BUILD_TYPE=Release ^
      -DARROW_DEPENDENCY_SOURCE=CONDA ^
      -DOPENSSL_ROOT_DIR=%CONDA_PREFIX%/Library ^
      -DARROW_CXXFLAGS="/MP" ^
      -DARROW_WITH_BZ2=OFF ^
      -DARROW_WITH_ZLIB=ON ^
      -DARROW_WITH_ZSTD=ON ^
      -DARROW_WITH_LZ4=ON ^
      -DARROW_WITH_SNAPPY=ON ^
      -DARROW_WITH_BROTLI=ON ^
      -DARROW_DATASET=ON ^
      -DARROW_FLIGHT=ON ^
      -DARROW_GANDIVA=OFF ^
      -DARROW_LZ4_USE_SHARED=OFF ^
      -DARROW_MIMALLOC=ON ^
      -DARROW_PARQUET=ON ^
      -DARROW_PYTHON=ON ^
      -DARROW_SNAPPY_USE_SHARED=OFF ^
      -DARROW_VERBOSE_THIRDPARTY_BUILD=ON ^
      -DBrotli_SOURCE=BUNDLED ^
      -Dzstd_SOURCE=BUNDLED ^
      -Dutf8proc_SOURCE=BUNDLED ^
      .. || exit /B
cmake ^
  --build . ^
  --config Release ^
  --parallel %NUMBER_OF_PROCESSORS% ^
  --target install || exit /B
popd

set PYARROW_BUILD_TYPE=Release
set PYARROW_BUNDLE_ARROW_CPP=1
set PYARROW_CMAKE_GENERATOR=%GENERATOR%
set PYARROW_CMAKE_OPTIONS=-A %ARCH%
set PYARROW_INSTALL_TESTS=1
set PYARROW_PARALLEL=%NUMBER_OF_PROCESSORS%
set PYARROW_WITH_DATASET=1
set PYARROW_WITH_FLIGHT=1
set PYARROW_WITH_GANDIVA=0
set PYARROW_WITH_PARQUET=1
set PYARROW_WITH_STATIC_BOOST=1
set SETUPTOOLS_SCM_PRETEND_VERSION=%PYARROW_VERSION%

pushd arrow\python
python setup.py bdist_wheel || exit /B
popd

call conda.bat deactivate

set ARROW_TEST_DATA=arrow\testing\data

@rem install the test dependencies
python -m pip install -r arrow\python\requirements-wheel-test.txt || exit /B

@rem install the produced wheel in a non-conda environment
python -m pip install --no-index --find-links=arrow\python\dist\ pyarrow || exit /B

@rem test the imports
python -c "import pyarrow" || exit /B
python -c "import pyarrow.parquet" || exit /B
python -c "import pyarrow.flight" || exit /B
python -c "import pyarrow.dataset" || exit /B

@rem run the python tests, but disable the cython because there is a linking
@rem issue on python 3.8
set PYARROW_TEST_CYTHON=OFF
python -m pytest -rs --pyargs pyarrow || exit /B


text:
const cheerio = require('cheerio');

const fallback = require('./fallback');
const fields = require('./fields');
const media = require('./media');
const utils = require('./utils');

/**
 * extract all of the meta tags needed for ogs
 *
 * @param {object} body - the body of the got request
 * @param {object} options - options for ogs
 * @return {object} object with ogs results
 *
 */
exports.extractMetaTags = (body, options) => {
  let ogObject = {};
  const $ = cheerio.load(body);
  const metaFields = fields.concat(options.customMetaTags);

  // find all of the open graph info in the meta tags
  $('meta').each((index, meta) => {
    if (!meta.attribs || (!meta.attribs.property && !meta.attribs.name)) return;
    const property = meta.attribs.property || meta.attribs.name;
    const content = meta.attribs.content || meta.attribs.value;
    metaFields.forEach((item) => {
      if (item && property.toLowerCase() === item.property.toLowerCase()) {
        if (!item.multiple) {
          ogObject[item.fieldName] = content;
        } else if (!ogObject[item.fieldName]) {
          ogObject[item.fieldName] = [content];
        } else if (Array.isArray(ogObject[item.fieldName])) {
          ogObject[item.fieldName].push(content);
        }
      }
    });
  });

  // set ogImage to ogImageSecureURL/ogImageURL if there is no ogImage
  if (!ogObject.ogImage && ogObject.ogImageSecureURL) {
    ogObject.ogImage = ogObject.ogImageSecureURL;
  } else if (!ogObject.ogImage && ogObject.ogImageURL) {
    ogObject.ogImage = ogObject.ogImageURL;
  }

  // formats the multiple media values
  ogObject = media.mediaSetup(ogObject, options);

  // if onlyGetOpenGraphInfo isn't set, run the open graph fallbacks
  if (!options.onlyGetOpenGraphInfo) {
    ogObject = fallback(ogObject, options, $);
  }

  // removes any undefs
  ogObject = utils.removeNestedUndefinedValues(ogObject);

  return ogObject;
};


text:
flipcss
=======

This Tool flip CSS rules direction from LTR to RTL or vice versa


text:
package elasta.composer.flow.holder;

import elasta.core.flow.Flow;
import lombok.Builder;
import lombok.Value;

import java.util.Objects;

/**
 * Created by sohan on 6/30/2017.
 */
@Value
@Builder
final public class DeleteFlowHolder {
    final Flow flow;

    public DeleteFlowHolder(Flow flow) {
        Objects.requireNonNull(flow);
        this.flow = flow;
    }
}


text:
.SUFFIXES:
.PHONY: default clean

include environment.mk

# Python command to convert sources list in constants.bzl
BZL_CMD = 'exec(open("constants.bzl").read()); print(" ".join(CONSTANTS_JSR_305_PATHS))'
JAVA_SOURCES = $(shell python -c $(BZL_CMD))

EXTRACTED_JAVA = $(JAVA_SOURCES:%=$(JAVA_SRC_DIR)/%)
JAVA_SOURCES_MANIFEST = $(BUILD_DIR)/java_sources.mf
OBJC_SOURCES_MANIFEST = $(BUILD_DIR)/objc_sources.mf

CREATE_JAR_NAME = j2objc_jsr305
CREATE_JAR_SOURCES = $(EXTRACTED_JAVA)
include ../make/create_jar.mk

TRANSLATE_JAVA_FULL = $(JAVA_SOURCES:%=$(JAVA_SRC_DIR)/%)
TRANSLATE_JAVA_RELATIVE = $(JAVA_SOURCES)
# Batch translate is turned off due to an open JDT bug.
TRANSLATE_ARGS = -sourcepath $(JAVA_SRC_DIR)
include ../make/translate.mk

ARCH_HEADERS = $(TRANSLATE_HEADERS:$(GEN_OBJC_DIR)/%=$(ARCH_INCLUDE_DIR)/%)

FAT_LIB_NAME = jsr305
FAT_LIB_SOURCES_RELATIVE = $(TRANSLATE_SOURCES:$(GEN_OBJC_DIR)/%=%)
FAT_LIB_SOURCE_DIRS = $(GEN_OBJC_DIR)
FAT_LIB_COMPILE = $(J2OBJCC) -fobjc-abi-version=2 -fobjc-legacy-dispatch
include ../make/fat_lib.mk

STATIC_FRAMEWORK_NAME = JSR305
include ../make/static_framework.mk

JSR305_LICENSE = LICENSE
JSR305_LICENSE_DIST = $(DIST_LICENSE_DIR)/jsr305_license.txt

default: lib

java: classes jar

# TODO(kstanger): Remove this.
classes: $(JAVA_SOURCES_MANIFEST)
	@echo Building class files
	@mkdir -p $(CLASSES_DIR)
	@$(JAVAC) -d $(CLASSES_DIR) \
	    -sourcepath $(SOURCE_PATH) -classpath $(CLASS_PATH) \
	    $$(cat $(JAVA_SOURCES_MANIFEST))

lib: $(FAT_LIBS)
	@:

$(JSR305_SRC_JAR): | java_deps_dist

$(BUILD_DIR)/.extracted: $(JSR305_SRC_JAR) | $(BUILD_DIR)
	@mkdir -p $(JAVA_SRC_DIR)
	@unzip -q -o -d $(JAVA_SRC_DIR) $(JSR305_SRC_JAR) $(JAVA_SOURCES)
	@touch $(EXTRACTED_JAVA)
	@touch $@

$(EXTRACTED_JAVA): $(BUILD_DIR)/.extracted
	@:

$(ARCH_INCLUDE_DIR)/%.h: $(GEN_OBJC_DIR)/%.h
	@mkdir -p $(@D)
	install -m 0644 $< $@

$(JSR305_LICENSE_DIST): $(JSR305_LICENSE)
	@mkdir -p $(@D)
	@install -m 0644 $< $@

$(JAVA_SOURCES_MANIFEST): $(EXTRACTED_JAVA) | $(BUILD_DIR)
	@echo "Building $$(basename $@)"
	@if [ -e $@ ]; then rm $@; fi
	@for i in $^; do echo $$i >> $@; done

java_sources_manifest: $(JAVA_SOURCES_MANIFEST)
	@:

$(OBJC_SOURCES_MANIFEST): $(TRANSLATE_JAVA_FULL) | $(BUILD_DIR)
	@echo "Building $$(basename $@)"
	@if [ -e $@ ]; then rm $@; fi
	@files='$(sort $(TRANSLATE_OBJC))' && for i in $$files; do \
	  echo $$i >> $@; \
	done

objc_sources_manifest: $(OBJC_SOURCES_MANIFEST)
	@:

$(BUILD_DIR):
	@mkdir -p $@

clean:
	@rm -rf $(BUILD_DIR) $(FAT_LIBS_DIST)
	@rm -rf $(JSR305_LICENSE_DIST) $(ARCH_INCLUDE_DIR)/javax/annotation
	@rm -rf $(STATIC_FRAMEWORK_DIR)

dist: $(FAT_LIBS_DIST) $(ARCH_HEADERS) $(JSR305_LICENSE_DIST)


text:
package com.sap.hcp.cf.logging.common;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.TimeZone;

/**
 * A {@link Value} implementation representing a date.
 *

 * When serialized into a String, the value will be formatted using timezone
 * "UTC" and format "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'".
 *
 */
public class DateTimeValue implements Value {
    private static final TimeZone UTC_TZ = TimeZone.getTimeZone("UTC");
    private static final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");

    static {
        DATE_FORMAT.setTimeZone(UTC_TZ);
    }

    private long timestamp;

    public DateTimeValue(long timestamp) {
        this.timestamp = timestamp;
    }

    public DateTimeValue(String dt) {
        try {
            synchronized (DATE_FORMAT) {
                timestamp = DATE_FORMAT.parse(dt).getTime();
            }
        } catch (ParseException pex) {
            timestamp = 0;
        }
    }

    @Override
    public String toString() {
        synchronized (DATE_FORMAT) {
            return DATE_FORMAT.format(timestamp);
        }
    }

    @Override
    public Object getValue() {
        try {
            synchronized (DATE_FORMAT) {
                return DATE_FORMAT.parse(DATE_FORMAT.format(timestamp));
            }
        } catch (ParseException pex) {
            return null;
        }
    }

    @Override
    public long asLong() {
        return timestamp;
    }

    @Override
    public double asDouble() {
        return timestamp;
    }

    @Override
    public String asString() {
        return toString();
    }

}


text:
import os
import unittest
from unittest.mock import MagicMock, patch

from dbt.adapters.postgres import Plugin as PostgresPlugin
from dbt.adapters.factory import reset_adapters, register_adapter
import dbt.clients.system
import dbt.compilation
import dbt.exceptions
import dbt.flags
import dbt.parser
import dbt.config
import dbt.utils
import dbt.parser.manifest
from dbt import tracking
from dbt.contracts.files import SourceFile, FileHash, FilePath
from dbt.contracts.graph.manifest import MacroManifest, ManifestStateCheck
from dbt.graph import NodeSelector, parse_difference

try:
    from queue import Empty
except ImportError:
    from Queue import Empty

from .utils import config_from_parts_or_dicts, generate_name_macros, inject_plugin

class GraphTest(unittest.TestCase):

    def tearDown(self):
        self.mock_filesystem_search.stop()
        self.mock_hook_constructor.stop()
        self.load_state_check.stop()
        self.load_source_file_patcher.stop()
        reset_adapters()

    def setUp(self):
        # create various attributes
        self.graph_result = None
        tracking.do_not_track()
        self.profile = {
            'outputs': {
                'test': {
                    'type': 'postgres',
                    'threads': 4,
                    'host': 'thishostshouldnotexist',
                    'port': 5432,
                    'user': 'root',
                    'pass': 'password',
                    'dbname': 'dbt',
                    'schema': 'dbt_test'
                }
            },
            'target': 'test'
        }
        self.macro_manifest = MacroManifest(
            {n.unique_id: n for n in generate_name_macros('test_models_compile')})
        self.mock_models = []  # used by filesystem_searcher

        # Create file filesystem searcher
        self.filesystem_search = patch('dbt.parser.read_files.filesystem_search')
        def mock_filesystem_search(project, relative_dirs, extension):
            if 'sql' not in extension:
                return []
            if 'models' not in relative_dirs:
                return []
            return [model.path for model in self.mock_models]
        self.mock_filesystem_search = self.filesystem_search.start()
        self.mock_filesystem_search.side_effect = mock_filesystem_search

        # Create HookParser patcher
        self.hook_patcher = patch.object(
            dbt.parser.hooks.HookParser, '__new__'
        )
        def create_hook_patcher(cls, project, manifest, root_project):
            result = MagicMock(project=project, manifest=manifest, root_project=root_project)
            result.__iter__.side_effect = lambda: iter([])
            return result
        self.mock_hook_constructor = self.hook_patcher.start()
        self.mock_hook_constructor.side_effect = create_hook_patcher

        # Create the Manifest.state_check patcher
        @patch('dbt.parser.manifest.ManifestLoader.build_manifest_state_check')
        def _mock_state_check(self):
            config = self.root_project
            all_projects = self.all_projects
            return ManifestStateCheck(
                project_env_vars_hash=FileHash.from_contents(''),
                profile_env_vars_hash=FileHash.from_contents(''),
                vars_hash=FileHash.from_contents('vars'),
                project_hashes={name: FileHash.from_contents(name) for name in all_projects},
                profile_hash=FileHash.from_contents('profile'),
            )
        self.load_state_check = patch('dbt.parser.manifest.ManifestLoader.build_manifest_state_check')
        self.mock_state_check = self.load_state_check.start()
        self.mock_state_check.side_effect = _mock_state_check

        # Create the source file patcher
        self.load_source_file_patcher = patch('dbt.parser.read_files.load_source_file')
        self.mock_source_file = self.load_source_file_patcher.start()
        def mock_load_source_file(path, parse_file_type, project_name, saved_files):
            for sf in self.mock_models:
                if sf.path == path:
                    source_file = sf
            source_file.project_name = project_name
            source_file.parse_file_type = parse_file_type
            return source_file
        self.mock_source_file.side_effect = mock_load_source_file

        @patch('dbt.parser.hooks.HookParser.get_path')
        def _mock_hook_path(self):
            path = FilePath(
                searched_path='.',
                project_root=os.path.normcase(os.getcwd()),
                relative_path='dbt_project.yml',
                modification_time=0.0,
            )
            return path

    def get_config(self, extra_cfg=None):
        if extra_cfg is None:
            extra_cfg = {}

        cfg = {
            'name': 'test_models_compile',
            'version': '0.1',
            'profile': 'test',
            'project-root': os.path.abspath('.'),
            'config-version': 2,
        }
        cfg.update(extra_cfg)

        config = config_from_parts_or_dicts(project=cfg, profile=self.profile)
        dbt.flags.set_from_args({}, config)
        dbt.flags.PARTIAL_PARSE = False
        return config

    def get_compiler(self, project):
        return dbt.compilation.Compiler(project)

    def use_models(self, models):
        for k, v in models.items():
            path = FilePath(
                searched_path='models',
                project_root=os.path.normcase(os.getcwd()),
                relative_path='{}.sql'.format(k),
                modification_time=0.0,
            )
            # FileHash can't be empty or 'search_key' will be None
            source_file = SourceFile(path=path, checksum=FileHash.from_contents('abc'))
            source_file.contents = v
            self.mock_models.append(source_file)

    def load_manifest(self, config):
        inject_plugin(PostgresPlugin)
        register_adapter(config)
        loader = dbt.parser.manifest.ManifestLoader(config, {config.project_name: config})
        loader.manifest.macros = self.macro_manifest.macros
        loader.load()
        return loader.manifest

    def test__single_model(self):
        self.use_models({
            'model_one': 'select * from events',
        })

        config = self.get_config()
        manifest = self.load_manifest(config)

        compiler = self.get_compiler(config)
        linker = compiler.compile(manifest)

        self.assertEqual(
            list(linker.nodes()),
            ['model.test_models_compile.model_one'])

        self.assertEqual(
            list(linker.edges()),
            [])

    def test__two_models_simple_ref(self):
        self.use_models({
            'model_one': 'select * from events',
            'model_two': "select * from {{ref('model_one')}}",
        })

        config = self.get_config()
        manifest = self.load_manifest(config)
        compiler = self.get_compiler(config)
        linker = compiler.compile(manifest)

        self.assertCountEqual(
            linker.nodes(),
            [
                'model.test_models_compile.model_one',
                'model.test_models_compile.model_two',
            ]
        )

        self.assertCountEqual(
            linker.edges(),
            [('model.test_models_compile.model_one', 'model.test_models_compile.model_two',)]
        )

    def test__model_materializations(self):
        self.use_models({
            'model_one': 'select * from events',
            'model_two': "select * from {{ref('model_one')}}",
            'model_three': "select * from events",
            'model_four': "select * from events",
        })

        cfg = {
            "models": {
                "materialized": "table",
                "test_models_compile": {
                    "model_one": {"materialized": "table"},
                    "model_two": {"materialized": "view"},
                    "model_three": {"materialized": "ephemeral"}
                }
            }
        }

        config = self.get_config(cfg)
        manifest = self.load_manifest(config)
        compiler = self.get_compiler(config)
        linker = compiler.compile(manifest)

        expected_materialization = {
            "model_one": "table",
            "model_two": "view",
            "model_three": "ephemeral",
            "model_four": "table"
        }

        for model, expected in expected_materialization.items():
            key = 'model.test_models_compile.{}'.format(model)
            actual = manifest.nodes[key].config.materialized
            self.assertEqual(actual, expected)

    def test__model_incremental(self):
        self.use_models({
            'model_one': 'select * from events'
        })

        cfg = {
            "models": {
                "test_models_compile": {
                    "model_one": {
                        "materialized": "incremental",
                        "unique_key": "id"
                    },
                }
            }
        }

        config = self.get_config(cfg)
        manifest = self.load_manifest(config)
        compiler = self.get_compiler(config)
        linker = compiler.compile(manifest)

        node = 'model.test_models_compile.model_one'

        self.assertEqual(list(linker.nodes()), [node])
        self.assertEqual(list(linker.edges()), [])

        self.assertEqual(manifest.nodes[node].config.materialized, 'incremental')

    def test__dependency_list(self):
        self.use_models({
            'model_1': 'select * from events',
            'model_2': 'select * from {{ ref("model_1") }}',
            'model_3': '''
                select * from {{ ref("model_1") }}
                union all
                select * from {{ ref("model_2") }}
            ''',
            'model_4': 'select * from {{ ref("model_3") }}'
        })

        config = self.get_config()
        manifest = self.load_manifest(config)
        compiler = self.get_compiler(config)
        graph = compiler.compile(manifest)

        models = ('model_1', 'model_2', 'model_3', 'model_4')
        model_ids = ['model.test_models_compile.{}'.format(m) for m in models]

        manifest = MagicMock(nodes={
            n: MagicMock(
                unique_id=n,
                name=n.split('.')[-1],
                package_name='test_models_compile',
                fqn=['test_models_compile', n],
                empty=False,
                config=MagicMock(enabled=True),
            )
            for n in model_ids
        })
        manifest.expect.side_effect = lambda n: MagicMock(unique_id=n)
        selector = NodeSelector(graph, manifest)
        queue = selector.get_graph_queue(parse_difference(None, None))

        for model_id in model_ids:
            self.assertFalse(queue.empty())
            got = queue.get(block=False)
            self.assertEqual(got.unique_id, model_id)
            with self.assertRaises(Empty):
                queue.get(block=False)
            queue.mark_done(got.unique_id)
        self.assertTrue(queue.empty())

    def test__partial_parse(self):
        config = self.get_config()

        manifest = self.load_manifest(config)

        # we need a loader to compare the two manifests
        loader = dbt.parser.manifest.ManifestLoader(config, {config.project_name: config})
        loader.manifest = manifest.deepcopy()

        is_partial_parsable, _ = loader.is_partial_parsable(manifest)
        self.assertTrue(is_partial_parsable)
        manifest.metadata.dbt_version = '0.0.1a1'
        is_partial_parsable, _ = loader.is_partial_parsable(manifest)
        self.assertFalse(is_partial_parsable)
        manifest.metadata.dbt_version = '99999.99.99'
        is_partial_parsable, _ = loader.is_partial_parsable(manifest)
        self.assertFalse(is_partial_parsable)


text:
![Zen Audio Player](img/zen-audio-player-113.png)

[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/zen-audio-player/zen-audio-player.github.io?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Build Status](https://travis-ci.org/zen-audio-player/zen-audio-player.github.io.svg?branch=master)](https://travis-ci.org/zen-audio-player/zen-audio-player.github.io)

Listen to YouTube videos, without the distracting visuals.

## Chrome Extension

Install the [Chrome extension](https://chrome.google.com/webstore/detail/zen-youtube-audio-player/jlkomkpeedajclllhhfkloddbihmcjlm) ([source code](https://github.com/zen-audio-player/extension-chrome)) so you can add `&zen` or `/zen` to the end of any YouTube URL to redirect this app!

## Demo

* Listen to [Starve the Ego, Feed the Soul by The Glitch Mob](http://zen-audio-player.github.io/?v=koJv-j1usoI)
* Try it out on [zen-audio-player.github.io](http://zen-audio-player.github.io)
* Clone the project and open `index.html`.

## Screenshot

![screenshot](img/screenshot.png)

## Contributing to Zen Audio Player

If you would like to contribute to this project please read the [guidelines on contributing](CONTRIBUTING.md) before doing so.


text:
{% extends "layout.html" %}

{% block content %}

Edit the appointment

    {% if done == "done" %}

You have sucessfully edited the appointment.

    {% endif %}

The current appointment is on {{day}} at {{time}} with {{sname}} in {{sub}}.

        <form method="post">

Edit the Appointment:

Day of the week: <select name="newDay">
				<option>Monday</option>
				<option>Tuesday</option>
				<option>Wednesday</option>
				<option>Thursday</option>
				<option>Friday</option>
				<option>Saturday</option>
				<option>Sunday</option>
			</select>

Time: <select name="newTime">
				<option>1</option>
				<option>2</option>
				<option>3</option>
				<option>4</option>
				<option>5</option>
				<option>6</option>
				<option>7</option>
				<option>8</option>
				<option>9</option>
				<option>10</option>
				<option>11</option>
				<option>12</option>
			</select>

<input type="radio" name="part" value="AM" checked> AM
            <input type="radio" name="part" value="PM"> PM

Delete Appointment:

<input type="checkbox" name="delete" value="true"> Delete

<input type="submit" name="submit" value="Submit" />
		</form>
{% endblock %}


text:
package com.jfixby.r3.fokker.unit.anim;

import com.jfixby.r3.api.ui.unit.animation.FrameAnimationSpecs;
import com.jfixby.r3.api.ui.unit.animation.LayersAnimationSpecs;
import com.jfixby.scarabei.api.collections.Collections;
import com.jfixby.scarabei.api.collections.List;
import com.jfixby.scarabei.api.time.TimeStream;

public class RedLayerAnimationSpecs implements LayersAnimationSpecs {

	List<FrameAnimationSpecs> frames = Collections.newList();
	// List<Anchor> anchors = JUtils.newList();
	private TimeStream clock;
	private boolean is_looped;
	// private boolean is_simple_animation;

	// private boolean is_positions_modifyer_animation;

	@Override
	public void addFrame (final FrameAnimationSpecs child) {
		this.frames.add(child);
	}

	@Override
	public List<FrameAnimationSpecs> getFrames () {
		return this.frames;
	}

	@Override
	public void setTimeStream (final TimeStream clock) {
		this.clock = clock;
	}

	@Override
	public TimeStream getTimeStream () {
		return this.clock;
	}

	@Override
	public void setIsLooped (final boolean is_looped) {
		this.is_looped = is_looped;
	}

	@Override
	public boolean isLooped () {
		return this.is_looped;
	}

	@Override
	public FrameAnimationSpecs newFrameSpecs () {
		return new RedFrameAnimationSpecs();
	}

}


text:
import bcolz
import numpy as np

def field_type(c_dtyep, field, dt_orig):
    try:
        return c_dtyep[field][0]
    except KeyError:
        return dt_orig

float64 = np.dtype('float64')

cdtype = {
    'open': (float64, 1 / 10000.0, 4),
    'close': (float64, 1 / 10000.0, 4),
    'high': (float64, 1 / 10000.0, 4),
    'low': (float64, 1 / 10000.0, 4),
    'limit_up': (float64, 1 / 10000.0, 4),
    'limit_down': (float64, 1 / 10000.0, 4),
}

if __name__ == '__main__':
    bc = bcolz.open('/home/eshufan/project/bundle/stocks.bcolz', 'r')

    # Access /home/eshufan/project/bundle/stocks.bcolz/__attrs__
    se = bc.attrs['line_map']
    print('Get the lines for 600000.XSHG')
    s, e = se['600000.XSHG']
    print('Start from {}, end to {}'.format(s, e))

    print('Get all column names')
    print(bc.names)
    print('Exclude the first column for date')
    fields = bc.names[1:]
    print(fields)

    print('Print original data type for each column')
    print([bc.cols[f].dtype for f in fields])

    print('Construct the data type for each column')
    dtype = np.dtype([('datetime', np.uint64)] + [(f, field_type(cdtype, f, bc.cols[f].dtype)) for f in fields])
    print(dtype)

    print('Create an empty numpy list with random valume, size is row: e - s, column: len(dtype) (Include datetime)')
    result = np.empty(shape=(e - s,), dtype=dtype)

    print('Feed the real data')
    for f in fields:
        result[f][:] = bc.cols[f][s:e]
    print(result)

    print('Update column datetime')
    result['datetime'][:] = bc.cols['date'][s:e].astype(np.uint64) * 1000000
    print(result)


text:
<?php

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

class CreateStatsTable extends Migration
{

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('stats', function (Blueprint $table) {

            $table->increments('id');
            $table->integer('reussite');
            $table->integer('temps');
            $table->integer('avancement');
            $table->integer('cours_id')->unsigned();
            $table->integer('user_id')->unsigned();
            $table->integer('exercice_id')->unsigned();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('stats');
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

        <title>School Management System</title>

    <link rel="shortcut icon" type="image/x-icon" href="1.ico" />
        <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
        <link href="hello.css" rel="stylesheet">
        <link rel="stylesheet" href="css/style.css">
        <link rel="stylesheet" href="css/reg.css">
        <link rel="stylesheet" href="css/bootstrap1.css">
        <link href="css/font-awesome.min.css" rel="stylesheet">
        <link href="css/prettyPhoto.css" rel="stylesheet">
        <link href="css/animate.css" rel="stylesheet">
        <link href="css/main.css" rel="stylesheet">
        <link rel="stylesheet" href="css/style2.css">
        <link href="css/font-awesome.min.css" rel="stylesheet">
        <link href="css/prettyPhoto.css" rel="stylesheet">
        <link href="css/animate.css" rel="stylesheet">
        <link href="css/main.css" rel="stylesheet">
        <link href="css/main.css" rel="stylesheet">
        <link href="hello.css" rel="stylesheet">

    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css" rel='stylesheet' type='text/css'>
    <link href="https://fonts.googleapis.com/css?family=Lato:100,300,400,700" rel='stylesheet' type='text/css'>

    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
    {{-- <link href="{{ elixir('css/app.css') }}" rel="stylesheet"> --}}

            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                Toggle navigation

            </button>

                @foreach ($teacher as $task)
                &nbsp&nbsp{{ $task->first_name }}'s Portal&nbsp&nbsp
                @endforeach

                      Upload Result

                      Class Tests

                      Club Management

                      Present Activities

                      Study Materials

                         &nbsp{{ Auth::user()->username }}

                              Change Profile Picture

                              Change Password

                              Logout

    @yield('content')

    {{--  --}}


text:
package io.joynr.examples.android_example;

import io.joynr.provider.ProviderAnnotations;
import io.joynr.accesscontrol.StaticDomainAccessControlProvisioning;
import io.joynr.accesscontrol.StaticDomainAccessControlProvisioningModule;
import io.joynr.exceptions.JoynrRuntimeException;
import io.joynr.messaging.AtmosphereMessagingModule;
import io.joynr.messaging.MessagingPropertyKeys;
import io.joynr.messaging.websocket.WebsocketModule;
import io.joynr.runtime.AbstractJoynrApplication;
import io.joynr.runtime.CCInProcessRuntimeModule;
import io.joynr.runtime.JoynrApplication;
import io.joynr.runtime.JoynrApplicationModule;
import io.joynr.runtime.JoynrInjectorFactory;
import io.joynr.runtime.LibjoynrWebSocketRuntimeModule;

import java.io.IOException;
import java.util.Properties;

import jline.console.ConsoleReader;
import joynr.infrastructure.DacTypes.MasterAccessControlEntry;
import joynr.infrastructure.DacTypes.Permission;
import joynr.infrastructure.DacTypes.TrustLevel;
import joynr.types.ProviderQos;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectMapper.DefaultTyping;
import com.google.inject.Module;
import com.google.inject.util.Modules;

import edu.umd.cs.findbugs.annotations.SuppressWarnings;

public class MyGpsProviderApplication extends AbstractJoynrApplication {
    private static final Logger LOG = LoggerFactory.getLogger(MyGpsProviderApplication.class);
    public static final String STATIC_PERSISTENCE_FILE = "gps-provider-joynr.properties";

    private MyGpsProvider provider = null;

    public static void main(String[] args) throws Exception {
        // run application from cmd line using Maven:
        // mvn exec:java -Dexec.mainClass="io.joynr.demo.MyRadioProviderApplication" -Dexec.args="<local-domain>"
        // Get the provider domain from the command line
        if (args.length != 1 && args.length != 2) {
            LOG.error("\n\nUSAGE: java {} <local-domain> [websocket] \n\n NOTE: Providers are registered on the local domain.",
                      MyGpsProviderApplication.class.getName());
            return;
        }
        String localDomain = args[0];
        LOG.debug("Registering provider on domain \"{}\"", localDomain);

        // joynr config properties are used to set joynr configuration at
        // compile time. They are set on the
        // JoynrInjectorFactory.
        Properties joynrConfig = new Properties();
        // Set a custom static persistence file (default is joynr.properties in
        // the working dir) to store
        // joynr configuration. It allows for changing the joynr configuration
        // at runtime. Custom persistence
        // files support running the consumer and provider applications from
        // within the same directory.
        joynrConfig.setProperty(MessagingPropertyKeys.PERSISTENCE_FILE, STATIC_PERSISTENCE_FILE);

        // How to use custom infrastructure elements:

        // 1) Set them programmatically at compile time using the joynr
        // configuration properties at the
        // JoynInjectorFactory. E.g. uncomment the following lines to set a
        // certain joynr server
        // instance.
        // joynrConfig.setProperty(MessagingPropertyKeys.BOUNCE_PROXY_URL,
        // "http://localhost:8080/bounceproxy/");
        // joynrConfig.setProperty(MessagingPropertyKeys.DISCOVERYDIRECTORYURL,
        // "http://localhost:8080/discovery/channels/discoverydirectory_channelid/");

        // Each joynr instance has a local domain. It identifies the execution
        // device/platform, e.g. the
        // vehicle. Normally, providers on that instance are registered for the
        // local domain.
        joynrConfig.setProperty(PROPERTY_JOYNR_DOMAIN_LOCAL, localDomain);

        // NOTE: When running this application to test the android-location-provider, you must use
        //       the concrete hostname (and _not_ localhost) in the bounceproxy URL, since this URL
        //       is registered in the global discovery directory and must be resolvable by the Android
        //       device.
        joynrConfig.setProperty(MessagingPropertyKeys.BOUNCE_PROXY_URL, "http://<concrete host>:8080/bounceproxy/");

        // 2) Or set them in the static persistence file (default:
        // joynr.properties in working dir) at
        // runtime. If not available in the working dir, it will be created
        // during the first launch
        // of the application. Copy the following lines to the custom
        // persistence file to set a
        // certain joynr server instance.
        // NOTE: This application uses a custom static persistence file
        // provider-joynr.properties.
        // Copy the following lines to the custom persistence file to set a
        // certain joynr server
        // instance.
        // joynr.messaging.bounceproxyurl=http://localhost:8080/bounceproxy/
        // joynr.messaging.discoverydirectoryurl=http://localhost:8080/discovery/channels/discoverydirectory_channelid/

        // 3) Or set them in Java System properties.
        // -Djoynr.messaging.bounceProxyUrl=http://localhost:8080/bounceproxy/
        // -Djoynr.messaging.capabilitiesDirectoryUrl=http://localhost:8080/discovery/channels/discoverydirectory_channelid/

        // NOTE:
        // Programmatically set configuration properties override properties set
        // in the static persistence file.
        // Java system properties override both

        // Application-specific configuration properties are injected to the
        // application by setting
        // them on the JoynApplicationModule.
        Properties appConfig = new Properties();
        provisionAccessControl(joynrConfig, localDomain);

        Module runtimeModule = null;
        if (args.length == 2 && args[1].equalsIgnoreCase("websocket")) {
            joynrConfig.setProperty(WebsocketModule.PROPERTY_WEBSOCKET_MESSAGING_HOST, "localhost");
            joynrConfig.setProperty(WebsocketModule.PROPERTY_WEBSOCKET_MESSAGING_PORT, "4242");
            joynrConfig.setProperty(WebsocketModule.PROPERTY_WEBSOCKET_MESSAGING_PROTOCOL, "ws");
            joynrConfig.setProperty(WebsocketModule.PROPERTY_WEBSOCKET_MESSAGING_PATH, "");
            runtimeModule = new LibjoynrWebSocketRuntimeModule();
        } else {
            runtimeModule = Modules.override(new CCInProcessRuntimeModule()).with(new AtmosphereMessagingModule());
        }
        LOG.debug("Using the following runtime module: " + runtimeModule.getClass().getSimpleName());

        JoynrApplication joynrApplication = new JoynrInjectorFactory(joynrConfig,
                                                                     new StaticDomainAccessControlProvisioningModule(),
                                                                     runtimeModule).createApplication(new JoynrApplicationModule(MyGpsProviderApplication.class,
                                                                                appConfig));
        joynrApplication.run();

        joynrApplication.shutdown();
    }

    @Override
    public void run() {
        ProviderQos providerQos = new ProviderQos();
        provider = new MyGpsProvider();
        providerQos.setPriority(System.currentTimeMillis());
        runtime.registerProvider(localDomain, provider, providerQos);

        ConsoleReader console;
        try {
            console = new ConsoleReader();
            int key;
            while ((key = console.readCharacter()) != 'q') {
                switch (key) {
                case 'l':
                    provider.notifyLocationUpdate();
                    break;
                default:
                    LOG.info("\n\nUSAGE press\n" + " q\tto quit\n" + " l\tto update location\n");
                    break;
                }
            }
        } catch (IOException e) {
            LOG.error("error reading input from console", e);
        }
    }

    @Override
    @SuppressWarnings(value = "DM_EXIT", justification = "WORKAROUND to be removed")
    public void shutdown() {
        LOG.info("shutting down");
        if (provider != null) {
            try {
                runtime.unregisterProvider(localDomain, provider);
            } catch (JoynrRuntimeException e) {
                LOG.error("unable to unregister capabilities", e);
            }
        }
        runtime.shutdown(true);
        // TODO currently there is a bug preventing all threads being stopped
        // WORKAROUND
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
        }
        System.exit(0);
    }

    private static void provisionAccessControl(Properties properties, String domain) throws Exception {
        ObjectMapper objectMapper = new ObjectMapper();
        objectMapper.enableDefaultTypingAsProperty(DefaultTyping.JAVA_LANG_OBJECT, "_typeName");
        MasterAccessControlEntry newMasterAccessControlEntry = new MasterAccessControlEntry("*",
                                                                                domain,
                                                                                ProviderAnnotations.getInterfaceName(MyGpsProvider.class),
                                                                                TrustLevel.LOW,
                                                                                new TrustLevel[]{ TrustLevel.LOW },
                                                                                TrustLevel.LOW,
                                                                                new TrustLevel[]{ TrustLevel.LOW },
                                                                                "*",
                                                                                Permission.YES,
                                                                                new Permission[]{ Permission.YES });

        MasterAccessControlEntry[] provisionedAccessControlEntries = { newMasterAccessControlEntry };
        String provisionedAccessControlEntriesAsJson = objectMapper.writeValueAsString(provisionedAccessControlEntries);
        properties.setProperty(StaticDomainAccessControlProvisioning.PROPERTY_PROVISIONED_MASTER_ACCESSCONTROLENTRIES,
                               provisionedAccessControlEntriesAsJson);
    }

}


text:
package be.pzbethanienhuis.kadans.createeditactionplan;

import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.media.MediaPlayer;
import android.media.MediaRecorder;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageButton;
import android.widget.RelativeLayout;
import android.widget.TextView;

import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.Timer;
import java.util.TimerTask;

import be.pzbethanienhuis.kadans.R;

import static android.Manifest.permission.RECORD_AUDIO;
import static android.Manifest.permission.WRITE_EXTERNAL_STORAGE;

public class ActionAudioActivity extends AppCompatActivity {

    ImageButton mRecord, mPlay, mStop;
    String AudioSavePathInDevice = null;
    TextView StopWatchMin, StopWatchSec;
    MediaRecorder mediaRecorder ;
    int recording = 0;
    String FileName = null;
    public static final int RequestPermissionCode = 1;
    MediaPlayer mMediaPlayer;
    final Handler myHandler = new Handler();
    Timer myTimer;
    int sec = 0;
    int min= 0;
    boolean recording_state = false;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_actionaudio);

        if(!checkPermission()){
            requestPermission();
        }
        mRecord = (ImageButton) findViewById(R.id.button);
        mPlay = (ImageButton) findViewById(R.id.button3);
        mStop = (ImageButton) findViewById(R.id.button4);
        StopWatchMin = (TextView) findViewById(R.id.timerMin);
        StopWatchSec = (TextView) findViewById(R.id.timerSec);

        mRecord.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if(checkPermission()) {
                    if(!recording_state){
                        RelativeLayout layout = (RelativeLayout) findViewById(R.id.audio_layout);
                        layout.setVisibility(View.GONE);
                        recording++;
                        boolean deleted = true;
                        if (recording == 2) {
                            File root = getApplicationContext().getFilesDir();
                            String audio_path = root.toString() + "/" + FileName;
                            File audio_file = new File(audio_path);
                            deleted = audio_file.delete();
                            recording--;
                        }
                        if(deleted) {
                            //AudioSavePathInDevice = Environment.getExternalStorageDirectory().getAbsolutePath() + "/" + CreateRandomAudioFileName(5) + "AudioRecording.3gp";
                            String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.getDefault()).format(new Date()) + ".3gp";
                            File root = getApplicationContext().getFilesDir();
                            AudioSavePathInDevice = root.toString() + "/" + timeStamp;
                            FileName = AudioSavePathInDevice.substring(AudioSavePathInDevice.lastIndexOf('/') + 1);

                            myTimer = new Timer();
                            myTimer.schedule(new TimerTask() {
                                @Override
                                public void run() {UpdateGUI();}
                            }, 0, 1000);

                            mediaRecorder = new MediaRecorder();
                            mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
                            mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
                            //Advanced Audio Coding (AAC) is the successor format to MP3, and is defined in MPEG-4
                            mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
                            mediaRecorder.setAudioEncodingBitRate(16000); //the audio encoding bit rate in bits per second.
                            mediaRecorder.setAudioSamplingRate(44100); //the sampling rate for audio in samples per second
                            mediaRecorder.setOutputFile(AudioSavePathInDevice);

                            try {
                                mediaRecorder.prepare();
                                mediaRecorder.start();
                                recording_state = true;
                            } catch (IllegalStateException | IOException e) {
                                recording_state = false;
                                e.printStackTrace();
                            }
                            mRecord.setImageDrawable(ContextCompat.getDrawable(getApplicationContext(), R.drawable.ic_stop_white_36dp));
                        }
                    }
                    else{
                        mediaRecorder.stop();
                        recording_state = false;
                        mRecord.setImageDrawable(ContextCompat.getDrawable(getApplicationContext(), R.drawable.ic_mic_white_36dp));
                        myTimer.cancel();
                        min = 0;
                        sec = 0;
                        RelativeLayout layout = (RelativeLayout) findViewById(R.id.audio_layout);
                        layout.setVisibility(View.VISIBLE);
                        initializeAudioButtons(FileName);
                    }
                } else {
                    requestPermission();
                }

            }
        });
    }

    private void initializeAudioButtons(String audio){
        prepareMP(audio);

        mPlay.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) throws IllegalArgumentException, SecurityException, IllegalStateException {
                boolean playing = mMediaPlayer.isPlaying();
                if (!playing) {
                    mPlay.setImageDrawable(ContextCompat.getDrawable(getApplicationContext(), R.drawable.ic_pause_white_36dp));
                    mMediaPlayer.start();
                } else {
                    mPlay.setImageDrawable(ContextCompat.getDrawable(getApplicationContext(), R.drawable.ic_play_arrow_white_36dp));
                    mMediaPlayer.pause();
                }

                mMediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
                    @Override
                    public void onCompletion(MediaPlayer mp) {
                        mPlay.setImageDrawable(ContextCompat.getDrawable(getApplicationContext(), R.drawable.ic_play_arrow_white_36dp));
                    }
                });
            }
        });

        mStop.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (mMediaPlayer != null) {
                    mMediaPlayer.stop();
                    mPlay.setImageDrawable(ContextCompat.getDrawable(getApplicationContext(), R.drawable.ic_play_arrow_white_36dp));
                    prepareMP(FileName);
                }
            }
        });
    }

    private void prepareMP(String audio){
        mMediaPlayer = new MediaPlayer();
        try {
            File root = getApplicationContext().getFilesDir();
            String audio_path = root.toString() + "/" + audio;
            mMediaPlayer.setDataSource(audio_path);
            mMediaPlayer.prepare();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private void UpdateGUI() {
        sec++;
        myHandler.post(myRunnable);
    }

    final Runnable myRunnable = new Runnable() {
        public void run() {
            if(sec == 60){
                min++;
                if(min < 10){
                    StopWatchMin.setText("0" + String.valueOf(min) + ":");
                }else StopWatchMin.setText(String.valueOf(min) + ":");

                sec = 0;
            }
            if(sec < 10) {
                StopWatchSec.setText("0" + sec);
            } else StopWatchSec.setText(String.valueOf(sec));
        }
    };

    //menu with a checkmark at the right, this is pressed when the creation of an action is finished
    @Override
    public boolean onCreateOptionsMenu(Menu menu){
        getMenuInflater().inflate(R.menu.menu_done,menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        int id = item.getItemId();

        switch (id){
            case R.id.action_done: {
                Intent returnIntent = new Intent();
                returnIntent.putExtra(AddEditActionActivity.AUDIO, FileName);
                setResult(Activity.RESULT_OK, returnIntent);
                this.finish();
                break;
            }
            case android.R.id.home: {
                if(AudioSavePathInDevice != null) {
                    File file = new File(AudioSavePathInDevice);
                    file.delete();
                }
                break;
            }
        }

        return super.onOptionsItemSelected(item);
    }

    private void requestPermission() {
        ActivityCompat.requestPermissions(ActionAudioActivity.this, new String[]{WRITE_EXTERNAL_STORAGE, RECORD_AUDIO}, RequestPermissionCode);
    }

    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String permissions[],@NonNull int[] grantResults) {
        switch (requestCode) {
            case RequestPermissionCode:
                if (grantResults.length> 0) {
                    boolean StoragePermission = grantResults[0] == PackageManager.PERMISSION_GRANTED;
                    boolean RecordPermission = grantResults[1] == PackageManager.PERMISSION_GRANTED;
                    //TODO: Elke, wat is dit? Lijkt overbodig
                }
                break;
        }
    }

    public boolean checkPermission() {
        int result = ContextCompat.checkSelfPermission(getApplicationContext(),
                WRITE_EXTERNAL_STORAGE);
        int result1 = ContextCompat.checkSelfPermission(getApplicationContext(), RECORD_AUDIO);
        return result == PackageManager.PERMISSION_GRANTED &&
                result1 == PackageManager.PERMISSION_GRANTED;
    }

    @Override
    public void onBackPressed() {
        if(AudioSavePathInDevice != null) {
            File file = new File(AudioSavePathInDevice);
            file.delete();
        }
        super.onBackPressed();
    }

    @Override
    public void onStop() {
        super.onStop();
        if(mMediaPlayer!=null){
            try{
                if(mMediaPlayer.isPlaying()){
                    mMediaPlayer.pause();
                    mPlay.setImageDrawable(ContextCompat.getDrawable(getApplicationContext(), R.drawable.ic_play_arrow_white_36dp));

                }
            } catch (IllegalStateException e){
                Log.e("ActionAudioActivity","Exception encoutered while checking if mediaplayer was playing: " + e);
            }
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        if(mMediaPlayer !=null) mMediaPlayer.release();
    }
}


text:
/**
 * @file
 * SNMP thread synchronization implementation.
 */

/*
 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
 * 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.
 * 3. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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.
 *
 * Author: Dirk Ziegelmeier <dziegel@gmx.de>
 */

#include "lwip/apps/snmp_opts.h"

#if LWIP_SNMP && (NO_SYS == 0)	/* don't build if not configured for use in lwipopts.h */

#include "lwip/apps/snmp_threadsync.h"
#include "lwip/apps/snmp_core.h"
#include "lwip/sys.h"
#include <string.h>

static void call_synced_function(struct threadsync_data *call_data, snmp_threadsync_called_fn fn)
{
	sys_mutex_lock(&call_data->threadsync_node->instance->sem_usage_mutex);
	call_data->threadsync_node->instance->sync_fn(fn, call_data);
	sys_sem_wait(&call_data->threadsync_node->instance->sem);
	sys_mutex_unlock(&call_data->threadsync_node->instance->sem_usage_mutex);
}

static void threadsync_get_value_synced(void *ctx)
{
	struct threadsync_data *call_data = (struct threadsync_data *)ctx;

	call_data->retval.s16 = call_data->proxy_instance.get_value(&call_data->proxy_instance, call_data->arg1.value);

	sys_sem_signal(&call_data->threadsync_node->instance->sem);
}

static s16_t threadsync_get_value(struct snmp_node_instance *instance, void *value)
{
	struct threadsync_data *call_data = (struct threadsync_data *)instance->reference.ptr;

	call_data->arg1.value = value;
	call_synced_function(call_data, threadsync_get_value_synced);

	return call_data->retval.s16;
}

static void threadsync_set_test_synced(void *ctx)
{
	struct threadsync_data *call_data = (struct threadsync_data *)ctx;

	call_data->retval.err = call_data->proxy_instance.set_test(&call_data->proxy_instance, call_data->arg2.len, call_data->arg1.value);

	sys_sem_signal(&call_data->threadsync_node->instance->sem);
}

static snmp_err_t threadsync_set_test(struct snmp_node_instance *instance, u16_t len, void *value)
{
	struct threadsync_data *call_data = (struct threadsync_data *)instance->reference.ptr;

	call_data->arg1.value = value;
	call_data->arg2.len = len;
	call_synced_function(call_data, threadsync_set_test_synced);

	return call_data->retval.err;
}

static void threadsync_set_value_synced(void *ctx)
{
	struct threadsync_data *call_data = (struct threadsync_data *)ctx;

	call_data->retval.err = call_data->proxy_instance.set_value(&call_data->proxy_instance, call_data->arg2.len, call_data->arg1.value);

	sys_sem_signal(&call_data->threadsync_node->instance->sem);
}

static snmp_err_t threadsync_set_value(struct snmp_node_instance *instance, u16_t len, void *value)
{
	struct threadsync_data *call_data = (struct threadsync_data *)instance->reference.ptr;

	call_data->arg1.value = value;
	call_data->arg2.len = len;
	call_synced_function(call_data, threadsync_set_value_synced);

	return call_data->retval.err;
}

static void threadsync_release_instance_synced(void *ctx)
{
	struct threadsync_data *call_data = (struct threadsync_data *)ctx;

	call_data->proxy_instance.release_instance(&call_data->proxy_instance);

	sys_sem_signal(&call_data->threadsync_node->instance->sem);
}

static void threadsync_release_instance(struct snmp_node_instance *instance)
{
	struct threadsync_data *call_data = (struct threadsync_data *)instance->reference.ptr;

	if (call_data->proxy_instance.release_instance != NULL) {
		call_synced_function(call_data, threadsync_release_instance_synced);
	}
}

static void get_instance_synced(void *ctx)
{
	struct threadsync_data *call_data = (struct threadsync_data *)ctx;
	const struct snmp_leaf_node *leaf = (const struct snmp_leaf_node *)(const void *)call_data->proxy_instance.node;

	call_data->retval.err = leaf->get_instance(call_data->arg1.root_oid, call_data->arg2.root_oid_len, &call_data->proxy_instance);

	sys_sem_signal(&call_data->threadsync_node->instance->sem);
}

static void get_next_instance_synced(void *ctx)
{
	struct threadsync_data *call_data = (struct threadsync_data *)ctx;
	const struct snmp_leaf_node *leaf = (const struct snmp_leaf_node *)(const void *)call_data->proxy_instance.node;

	call_data->retval.err = leaf->get_next_instance(call_data->arg1.root_oid, call_data->arg2.root_oid_len, &call_data->proxy_instance);

	sys_sem_signal(&call_data->threadsync_node->instance->sem);
}

static snmp_err_t do_sync(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance *instance, snmp_threadsync_called_fn fn)
{
	const struct snmp_threadsync_node *threadsync_node = (const struct snmp_threadsync_node *)(const void *)instance->node;
	struct threadsync_data *call_data = &threadsync_node->instance->data;

	if (threadsync_node->node.node.oid != threadsync_node->target->node.oid) {
		LWIP_DEBUGF(SNMP_DEBUG, ("Sync node OID does not match target node OID"));
		return SNMP_ERR_NOSUCHINSTANCE;
	}

	memset(&call_data->proxy_instance, 0, sizeof(call_data->proxy_instance));

	instance->reference.ptr = call_data;
	snmp_oid_assign(&call_data->proxy_instance.instance_oid, instance->instance_oid.id, instance->instance_oid.len);

	call_data->proxy_instance.node = &threadsync_node->target->node;
	call_data->threadsync_node = threadsync_node;

	call_data->arg1.root_oid = root_oid;
	call_data->arg2.root_oid_len = root_oid_len;
	call_synced_function(call_data, fn);

	if (call_data->retval.err == SNMP_ERR_NOERROR) {
		instance->access = call_data->proxy_instance.access;
		instance->asn1_type = call_data->proxy_instance.asn1_type;
		instance->release_instance = threadsync_release_instance;
		instance->get_value = (call_data->proxy_instance.get_value != NULL) ? threadsync_get_value : NULL;
		instance->set_value = (call_data->proxy_instance.set_value != NULL) ? threadsync_set_value : NULL;
		instance->set_test = (call_data->proxy_instance.set_test != NULL) ? threadsync_set_test : NULL;
		snmp_oid_assign(&instance->instance_oid, call_data->proxy_instance.instance_oid.id, call_data->proxy_instance.instance_oid.len);
	}

	return call_data->retval.err;
}

snmp_err_t snmp_threadsync_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance *instance)
{
	return do_sync(root_oid, root_oid_len, instance, get_instance_synced);
}

snmp_err_t snmp_threadsync_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance *instance)
{
	return do_sync(root_oid, root_oid_len, instance, get_next_instance_synced);
}

/** Initializes thread synchronization instance */
void snmp_threadsync_init(struct snmp_threadsync_instance *instance, snmp_threadsync_synchronizer_fn sync_fn)
{
	err_t err = sys_mutex_new(&instance->sem_usage_mutex);
	LWIP_ASSERT("Failed to set up mutex", err == ERR_OK);
	err = sys_sem_new(&instance->sem, 0);
	LWIP_UNUSED_ARG(err);		/* in case of LWIP_NOASSERT */
	LWIP_ASSERT("Failed to set up semaphore", err == ERR_OK);
	instance->sync_fn = sync_fn;
}

#endif							/* LWIP_SNMP */