text:
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Threading.Tasks.Dataflow;

namespace FluentDataflow.Tests.Console
{
    class Program
    {
        private static readonly IDataflowFactory _factory = new DataflowFactory();

        static void Main(string[] args)
        {
            TestIfElseBranchingAndMerging();
            System.Console.ReadLine();
        }

        private static ITargetBlock<string> GetAggregatorFlow(out Dictionary<string, int> result)
        {
            var splitter = new TransformBlock<string, KeyValuePair<string, int>>(input =>
            {
                string[] splitted = input.Split('=');
                return new KeyValuePair<string, int>(splitted[0], int.Parse(splitted[1]));
            });

            var dict = new Dictionary<string, int>();

            var aggregater = new ActionBlock<KeyValuePair<string, int>>(pair =>
            {
                int oldValue;
                dict[pair.Key] = dict.TryGetValue(pair.Key, out oldValue) ? oldValue + pair.Value : pair.Value;
            });

            var dataflow = _factory.FromPropagator(splitter)
                .LinkToTarget(aggregater)
                .Create();

            result = dict;
            return dataflow;
        }

        private static void TestAggregatorFlow()
        {
            var dataflow = GetAggregatorFlow(out Dictionary<string, int> result);
            dataflow.Post("a=1");
            dataflow.Post("b=2");
            dataflow.Post("a=5");
            dataflow.Complete();

            Task.WaitAll(dataflow.Completion);

            System.Console.WriteLine("sum(a) = {0}", result["a"]); //prints sum(a) = 6
        }

        private static ITargetBlock<string> GetLineAggregatorFlow(out Dictionary<string, int> result)
        {
            var aggregator = GetAggregatorFlow(out result);
            var splitter = new TransformManyBlock<string, string>(line => line.Split(' '));
            var dataflow = _factory.FromPropagator(splitter)
                .LinkToTarget(aggregator)
                .Create();

            return dataflow;
        }

        private static void TestLineAggregatorFlow()
        {
            var dataflow = GetLineAggregatorFlow(out Dictionary<string, int> result);
            dataflow.Post("a=1 b=2 a=5");
            dataflow.Post("c=6 b=8");
            dataflow.Complete();

            Task.WaitAll(dataflow.Completion);

            System.Console.WriteLine("sum(b) = {0}", result["b"]); //prints sum(b) = 10
        }

        private static void TestAggregatorFlowOnError()
        {
            var dataflow = GetAggregatorFlow(out Dictionary<string, int> result);
            dataflow.Post("a=1");
            dataflow.Post("b=2");
            dataflow.Post("a=badstring");
            dataflow.Complete();

            Task.WaitAll(dataflow.Completion);
        }

        private static ITargetBlock<string> GetBroadcastFlow()
        {
            var printer1 = new ActionBlock<string>(s => System.Console.WriteLine("Printer1: {0}", s));
            var printer2 = new ActionBlock<string>(s => System.Console.WriteLine("Printer2: {0}", s));
            var printer3 = new ActionBlock<string>(s => System.Console.WriteLine("Printer3: {0}", s));

            var dataflow = _factory.FromBroadcast<string>()
                .LinkTo(printer1)
                .LinkTo(printer2)
                .LinkTo(printer3)
                .Create();

            return dataflow;
        }

        private static void TestBroadcastFlow()
        {
            var dataflow = GetBroadcastFlow();
            dataflow.Post("first message");
            dataflow.Post("second message");
            dataflow.Post("third message");
            dataflow.Complete();

            Task.WaitAll(dataflow.Completion);
        }

        private static void TestMultipleSourcesFlow()
        {
            // by default, with native TPL, if multiple sources link to the same target,
            // if set PropagateCompletion=true,
            // as long as one of the source complets, the target complets.
            // the target will miss some of the messages from the other sources.

            // BUT, with our dataflow factory here, when set PropagateCompletion=true,
            // dataflow.Complete() internally waits for all the sources to complete,
            // so the target is guaranteed to receive all the messages from all the sources

            var source1 = new BufferBlock<string>();
            var source2 = new BufferBlock<string>();
            var source3 = new BufferBlock<string>();
            var printer = new ActionBlock<string>(s => System.Console.WriteLine(s));

            var dataflow = _factory.FromMultipleSources(source1, source2, source3)
                .LinkToTarget(printer)
                .Create();

            for (var i = 0; i < 3; ++i)
            {
                var s = i.ToString();
                source1.Post(s);
                source2.Post(s);
                source3.Post(s);
            }

            dataflow.Complete();

            Task.WaitAll(dataflow.Completion);
        }

        private static void TestDataflowLinkWithFilter()
        {
            // the filter only accepts even numbers,
            // so odd numbers goes to declined printer
            var filter = new Predicate<int>(i =>
            {
                return i % 2 == 0;
            });
            var printer = new ActionBlock<int>(s => System.Console.WriteLine("printer: " + s.ToString()));
            var declinedPrinter = new ActionBlock<int>(s => System.Console.WriteLine("declined: " + s.ToString()));
            var inputBlock = new BufferBlock<int>();

            var dataflow = _factory.FromPropagator(inputBlock)
                .LinkToTarget(printer
                    , filter
                    // when linking with filter, you have to specify a declined block
                    // otherwise, because there will be messages declined still in the queue,
                    // the current block will not be able to COMPLETE (waits on its Completion will never return)
                    , declinedPrinter)
                .Create();

            for (int i = 0; i < 10; ++i)
            {
                dataflow.Post(i);
            }

            dataflow.Complete();

            Task.WaitAll(dataflow.Completion);
        }

        private static void TestBatch()
        {
            var source = new BufferBlock<string>();
            var printer = new ActionBlock<IEnumerable<string>>(s => System.Console.WriteLine("printer: " +string.Join("|", s)));

            var dataflow = _factory.FromSource(source)
                .Batch(2)
                .LinkToTarget(printer)
                .Create();

            for (var i = 0; i < 6; ++i)
            {
                var s = i.ToString();
                source.Post(s);
            }

            dataflow.Complete();

            Task.WaitAll(dataflow.Completion);
        }

        private static void TestJoin()
        {
            var source1 = new BufferBlock<string>();
            var source2 = new BufferBlock<string>();
            var printer = new ActionBlock<Tuple<string, string>>(s => System.Console.WriteLine("printer: {0},{1}", s.Item1, s.Item2));

            var dataflow = _factory.Join(source1, source2)
                .LinkToTarget(printer)
                .Create();

            for (var i = 0; i < 3; ++i)
            {
                var s = i.ToString();
                source1.Post(s);
                source2.Post(s);
            }

            dataflow.Complete();

            Task.WaitAll(dataflow.Completion);
        }

        private static void TestBatchedJoin()
        {
            var source1 = new BufferBlock<string>();
            var source2 = new BufferBlock<string>();
            var printer = new ActionBlock<Tuple<IList<string>, IList<string>>>(s => System.Console.WriteLine("printer: {0},{1}", string.Join("|", s.Item1), string.Join("|", s.Item2)));

            var dataflow = _factory.BatchedJoin(source1, source2, 2)
                .LinkToTarget(printer)
                .Create();

            for (var i = 0; i < 4; ++i)
            {
                var s = i.ToString();
                source1.Post(s);
                source2.Post(s);
            }

            dataflow.Complete();

            Task.WaitAll(dataflow.Completion);
        }

        private static void TestIfElseBranchingAndMerging()
        {
            // the ifFilter only accepts even numbers,
            // so odd numbers goes to elseBlock
            var ifFilter = new Predicate<int>(i =>
            {
                return i % 2 == 0;
            });
            var printer = new ActionBlock<int>(s => System.Console.WriteLine("printer: " + s.ToString()));
            var inputBlock = new BufferBlock<int>();
            // if meet ifFilter, convert to: i -> i * 10
            var ifBlock = new TransformBlock<int, int>(i => i * 10);
            // else, convert to: i -> i * 100
            var elseBlock = new TransformBlock<int, int>(i => i * 100);

            var branchingDataflow = _factory.FromPropagator(inputBlock)
                .LinkToPropagator(ifBlock, ifFilter, elseBlock)
                .Create();

            var mergeingDataflow = _factory.FromMultipleSources(ifBlock, elseBlock)
                .LinkToTarget(printer)
                .Create();

            //encapsulate branchingDataflow and mergeingDataflow
            var dataflow = _factory.EncapsulateTargetDataflow(branchingDataflow, mergeingDataflow);

            for (int i = 0; i < 10; ++i)
            {
                dataflow.Post(i);
            }

            dataflow.Complete();

            Task.WaitAll(dataflow.Completion);
        }

        private static void TestFluentOptions()
        {
            var joinOptions = new DataflowJoinOptions(
                join => join.BoundedCapacity(11).EnsureOrdered().MaxNumberOfGroups(1)
                , target2: _ => _.Append().MaxMessages(1).PropagateCompletion());

            var batchOptions = new DataflowBatchOptions(
                batch => batch.BoundedCapacity(2).Greedy().MaxNumberOfGroups(3)
                , link => link.MaxMessages(1).PropagateCompletion(false)
                );

            var linkOptions = new DataflowLinkOptions().PropagateCompletion(false).MaxMessages(2);
        }
    }
}


text:
int main( int argc, char * argv[] )
{
   ::cfeyer::cpp_lib_dwf::Library cpp_lib_dwf;

   ::cfeyer::cpp_api_dwf::Device_Enumerator_Interface & device_enumerator = cpp_lib_dwf.get_device_enumerator();

   const int device_index = 0;
   ::cfeyer::cpp_api_dwf::Device_Interface & device =
         device_enumerator.get_device( device_index );

   std::cerr << "name: " << device.get_name() << "\n"
             << "user: "<< device.get_user_name() << "\n"
             << "serial: " << device.get_serial_number() << "\n"
             << "busy: " << device.is_busy()
             << std::endl;

   ::cfeyer::cpp_api_dwf::Open_Device_Interface * p_open_device = device.open();

   ::cfeyer::cpp_api_dwf::analog_output::Channel_Interface & ao1 =
      p_open_device->get_analog_outputs().get_channel(0);

   ::cfeyer::cpp_api_dwf::analog_output::Carrier_Component_Interface & ao1_carrier =
      *(ao1.get_carrier_component());

   std::cout << "min_data_samples = " << ao1_carrier.get_min_data_samples() << std::endl;
   std::cout << "max_data_samples = " << ao1_carrier.get_max_data_samples() << std::endl;

   const int sample_count = 4096;
   double samples[sample_count];
   for( int n = 0; n < sample_count; n++ )
   {
      samples[n] = 2.0*n/4095-1;
   }

   ao1_carrier.enable();
   ao1_carrier.set_waveform_shape( ::cfeyer::cpp_api_dwf::analog_output::Waveform_Shape::custom );
   ao1_carrier.set_data( samples, sample_count );
   ao1_carrier.set_frequency_hz( 10.0e3 );
   ao1_carrier.set_amplitude_volts( 2.0 );

   ao1.start();

   for( unsigned int duration_seconds = 5; (duration_seconds = sleep( duration_seconds )) > 0; );

   delete p_open_device;
   p_open_device = 0;

   return 0;
}

redpajama_set_name: RedPajamaGithub


text:
package rod;

class TestCommand extends TerminalCommand {

    public TestCommand(final Builder<?> builder) {
        super(builder);
    }

}


text:
#include <glua/lprefix.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string>
#include <utility>
#include <list>
#include <set>
#include <map>
#include <unordered_map>
#include <memory>
#include <mutex>
#include <thread>

#include <glua/thinkyoung_lua_api.h>
#include <glua/thinkyoung_lua_lib.h>

#include <glua/glua_lutil.h>
#include <glua/lobject.h>
#include <glua/lzio.h>
#include <glua/lundump.h>
#include <glua/lvm.h>
#include <glua/lapi.h>
#include <glua/lopcodes.h>
#include <glua/lparser.h>
#include <glua/lstate.h>
#include <glua/ldo.h>
#include <glua/ldebug.h>
#include <glua/lauxlib.h>
#include <glua/lualib.h>

using thinkyoung::lua::api::global_glua_chain_api;

namespace thinkyoung
{
    namespace lua
    {
        namespace lib
        {
            GluaStateScope::GluaStateScope(bool use_contract)
                :_use_contract(use_contract) {
                this->_L = create_lua_state(use_contract);
            }
            GluaStateScope::GluaStateScope(const GluaStateScope &other) : _L(other._L) {}
            GluaStateScope::~GluaStateScope() {
                if (nullptr != _L)
                    close_lua_state(_L);
            }

            void GluaStateScope::change_in_file(FILE *in)
            {
                if (nullptr == in)
                    in = stdin;
                _L->in = in;
            }

            void GluaStateScope::change_out_file(FILE *out)
            {
                if (nullptr == out)
                    out = stdout;
                _L->out = out;
            }

            void GluaStateScope::change_err_file(FILE *err)
            {
                if (nullptr == err)
                    err = stderr;
                _L->err = err;
            }

            bool GluaStateScope::in_sandbox() const {
                return check_in_lua_sandbox(_L);
            }

            void GluaStateScope::enter_sandbox() {
                enter_lua_sandbox(_L);
            }

            void GluaStateScope::exit_sandbox() {
                exit_lua_sandbox(_L);
            }

            bool GluaStateScope::commit_storage_changes()
            {
                return thinkyoung::lua::lib::commit_storage_changes(_L);
            }

            GluaStateValueNode GluaStateScope::get_value_node(const char *key)
            {
                return get_lua_state_value_node(_L, key);
            }
            GluaStateValue GluaStateScope::get_value(const char *key)
            {
                return get_lua_state_value(_L, key);
            }

            void GluaStateScope::set_value(const char *key, GluaStateValue value, enum GluaStateValueType type)
            {
                set_lua_state_value(_L, key, value, type);
            }

            void GluaStateScope::set_instructions_limit(int limit)
            {
                return set_lua_state_instructions_limit(_L, limit);
            }
            int GluaStateScope::get_instructions_limit()
            {
                return get_lua_state_instructions_limit(_L);
            }
            int GluaStateScope::get_instructions_executed_count()
            {
                return get_lua_state_instructions_executed_count(_L);
            }
            int GluaStateScope::check_thinkyoung_contract_api_instructions_over_limit()
            {
                return global_glua_chain_api->check_contract_api_instructions_over_limit(_L);
            }

            void GluaStateScope::notify_stop()
            {
                notify_lua_state_stop(_L);
            }
            bool GluaStateScope::check_notified_stop()
            {
                return check_lua_state_notified_stop(_L);
            }
            void GluaStateScope::resume_running()
            {
                resume_lua_state_running(_L);
            }

            bool GluaStateScope::run_compiledfile(const char *filename)
            {
                return thinkyoung::lua::lib::run_compiledfile(_L, filename);
            }
            bool GluaStateScope::run_compiled_bytestream(void *stream_addr)
            {
                return thinkyoung::lua::lib::run_compiled_bytestream(_L, stream_addr);
            }
            void GluaStateScope::add_global_c_function(const char *name, lua_CFunction func)
            {
                thinkyoung::lua::lib::add_global_c_function(_L, name, func);
            }
            void GluaStateScope::add_global_string_variable(const char *name, const char *str)
            {
                thinkyoung::lua::lib::add_global_string_variable(_L, name, str);
            }
            void GluaStateScope::add_global_int_variable(const char *name, lua_Integer num)
            {
                thinkyoung::lua::lib::add_global_int_variable(_L, name, num);
            }
            void GluaStateScope::add_global_number_variable(const char *name, lua_Number num)
            {
                thinkyoung::lua::lib::add_global_number_variable(_L, name, num);
            }
            void GluaStateScope::add_global_bool_variable(const char *name, bool value)
            {
                thinkyoung::lua::lib::add_global_bool_variable(_L, name, value);
            }
            void GluaStateScope::register_module(const char *name, lua_CFunction openmodule_func)
            {
                thinkyoung::lua::lib::register_module(_L, name, openmodule_func);
            }
            int GluaStateScope::execute_contract_api(const char *contract_name, const char *api_name, const char *arg1, std::string *result_json_string)
            {
                return thinkyoung::lua::lib::execute_contract_api(_L, contract_name, api_name, arg1, result_json_string);
            }

            int GluaStateScope::execute_contract_api_by_address(const char *address, const char *api_name, const char *arg1, std::string *result_json_string)
            {
                return thinkyoung::lua::lib::execute_contract_api_by_address(_L, address, api_name, arg1, result_json_string);
            }

            bool GluaStateScope::execute_contract_init_by_address(const char *contract_address, const char *arg1, std::string *result_json_string)
            {
                return thinkyoung::lua::lib::execute_contract_init_by_address(_L, contract_address, arg1, result_json_string);
            }
            bool GluaStateScope::execute_contract_start_by_address(const char *contract_address, const char *arg1, std::string *result_json_string)
            {
                return thinkyoung::lua::lib::execute_contract_start_by_address(_L, contract_address, arg1, result_json_string);
            }

            bool GluaStateScope::execute_contract_init(GluaModuleByteStream *stream, const char *arg1, std::string *result_json_string)
            {
                return thinkyoung::lua::lib::execute_contract_init(_L, "tmp", stream, arg1, result_json_string);
            }
            bool GluaStateScope::execute_contract_start(GluaModuleByteStream *stream, const char *arg1, std::string *result_json_string)
            {
                return thinkyoung::lua::lib::execute_contract_start(_L, "tmp", stream, arg1, result_json_string);
            }

            bool GluaStateScope::check_contract_bytecode_stream(GluaModuleByteStream *stream)
            {
                return thinkyoung::lua::lib::check_contract_bytecode_stream(_L, stream);
            }

            bool GluaStateScope::start_repl()
            {
                return thinkyoung::lua::lib::start_repl(_L);
            }
            bool GluaStateScope::stop_repl()
            {
                return thinkyoung::lua::lib::stop_repl(_L);
            }
            bool GluaStateScope::start_repl_async()
            {
                return thinkyoung::lua::lib::start_repl_async(_L);
            }
            bool GluaStateScope::check_repl_running()
            {
                return thinkyoung::lua::lib::check_repl_running(_L);
            }
            int *GluaStateScope::get_repl_state()
            {
                return thinkyoung::lua::lib::get_repl_state(_L);
            }

			void GluaStateScope::add_system_extra_libs()
            {
				thinkyoung::lua::lib::add_system_extra_libs(_L);
            }

        }
    }
}


text:
package org.bigtesting.fixd.core.body;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import org.simpleframework.http.Response;

/**
 *
 * @author Luis Antunes
 */
public class InputStreamResponseBody extends ResponseBody {

    private final InputStream in;

    public InputStreamResponseBody(InputStream in) {
        this.in = in;
    }

    @Override
    public void send(Response resp, String contentType) {
        try {
            sendContent(resp, contentType);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public void sendAndCommit(Response resp, String contentType) {
        try {
            OutputStream out = sendContent(resp, contentType);
            out.close();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    private OutputStream sendContent(Response resp, String contentType) throws IOException {

        OutputStream out = resp.getOutputStream();
        addStandardHeaders(resp, contentType);
        byte[] buffer = new byte[1024];
        int len;
        while ((len = in.read(buffer)) != -1) {
            out.write(buffer, 0, len);
        }
        out.flush();
        return out;
    }

    @Override
    public boolean hasContent() {
        try {
            return in != null && in.available() > 0;
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}


text:
package org.seckill.dto;

/**
 * Created by andy on 16/7/17.
 */
//所有json 返回数据,封装json结果
public class SeckillResult<T> {
    private boolean success;
    private T data;
    private String error;

    public SeckillResult(boolean success, T data) {
        this.success = success;
        this.data = data;
    }

    public SeckillResult(boolean success, String error) {
        this.success = success;
        this.error = error;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getError() {
        return error;
    }

    public void setError(String error) {
        this.error = error;
    }
}


text:
package com.nibado.graph.traverse;

import java.util.List;

import com.nibado.graph.Node;

public interface PathFind<T> {
    List<Node<T>> findPath(final Node<T> from, final Node<T> to);
}


text:
package org.pentaho.di.trans.steps.calculator;

import org.pentaho.di.core.row.RowMetaInterface;
import org.pentaho.di.trans.step.BaseStepData;
import org.pentaho.di.trans.step.StepDataInterface;

/**
 * @author Matt
 * @since 8-sep-2005
 *
 */
public class CalculatorData extends BaseStepData implements StepDataInterface {
  public RowMetaInterface outputRowMeta;
  public RowMetaInterface calcRowMeta;

  public Calculator.FieldIndexes[] fieldIndexes;

  public int[] tempIndexes;

  public CalculatorData() {
    super();
  }

}


text:
#import <MSRightsManagement/MSProtection.h>
#import "MSCustomProtectedData.h"
#import "MSMutableCustomProtectedData.h"


text:
import React from 'react';
import ReactDOM from 'react-dom';
import Canvas from './components/canvas/Canvas';

ReactDOM.render(
	<Canvas/>,
	document.getElementById('container')
);


text:
Function.RegisterNamespace("Test.xUnit.js");

[Fixture]
Test.xUnit.js.RecordTest=function(){

	[Fixture]
	function Exception(){
		[Fact]
		function ThrowsOnNullDelegate(){
			var expected=new Error("Record.Exception: 'delegate' must be a valid Function pointer.");

			var actual=Assert.Throws(expected,function(){
				Record.Exception(null);
			});

			Assert.Equal(expected,actual);
		}
		[Fact]
		function ThrowsOnInvalidDelegate(){
			var expected=new Error("Record.Exception: 'delegate' must be a valid Function pointer.");

			var actual=Assert.Throws(expected,function(){
				Record.Exception(new Object());
			});

			Assert.Equal(expected,actual);
		}

		[Fact]
		function CallsDelegate(){
			var actual=false;

			Record.Exception(function(){
				actual=true;
			});

			Assert.True(actual);
		}

		[Fact]
		function ReturnsNullIfNoExceptionThrown(){
			var actual=null;

			actual=Record.Exception(function(){});

			Assert.Null(actual);
		}
		[Fact]
		function ReturnsThrownException(){
			var expected=new Error("ReturnsThrownException");

			var actual=Record.Exception(function(){
				throw expected;
			});

			Assert.Equal(expected,actual);
		}
	}
}


text:
#include "El.hpp"

namespace El {

template<typename Real>
void SOCMaxEig
( const Matrix<Real>& x,
        Matrix<Real>& maxEigs,
  const Matrix<Int>& orders,
  const Matrix<Int>& firstInds )
{
    DEBUG_ONLY(CSE cse("SOCMaxEig"))
    SOCLowerNorms( x, maxEigs, orders, firstInds );
    const Int height = x.Height();
    for( Int i=0; i<height; ++i )
        if( i == firstInds.Get(i,0) )
            maxEigs.Set( i, 0, x.Get(i,0)+maxEigs.Get(i,0) );
}

template<typename Real>
void SOCMaxEig
( const AbstractDistMatrix<Real>& xPre,
        AbstractDistMatrix<Real>& maxEigsPre,
  const AbstractDistMatrix<Int>& ordersPre,
  const AbstractDistMatrix<Int>& firstIndsPre,
  Int cutoff )
{
    DEBUG_ONLY(CSE cse("SOCMaxEig"))
    AssertSameGrids( xPre, maxEigsPre, ordersPre, firstIndsPre );

    ProxyCtrl ctrl;
    ctrl.colConstrain = true;
    ctrl.colAlign = 0;

    auto xPtr         = ReadProxy<Real,VC,STAR>(&xPre,ctrl);
    auto maxEigsPtr   = WriteProxy<Real,VC,STAR>(&maxEigsPre,ctrl);
    auto ordersPtr    = ReadProxy<Int,VC,STAR>(&ordersPre,ctrl);
    auto firstIndsPtr = ReadProxy<Int,VC,STAR>(&firstIndsPre,ctrl);
    auto& x = *xPtr;
    auto& maxEigs = *maxEigsPtr;
    auto& orders = *ordersPtr;
    auto& firstInds = *firstIndsPtr;

    const Int height = x.Height();
    const Int localHeight = x.LocalHeight();
    if( x.Width() != 1 || orders.Width() != 1 || firstInds.Width() != 1 )
        LogicError("x, orders, and firstInds should be column vectors");
    if( orders.Height() != height || firstInds.Height() != height )
        LogicError("orders and firstInds should be of the same height as x");

    SOCLowerNorms( x, maxEigs, orders, firstInds, cutoff );
    for( Int iLoc=0; iLoc<localHeight; ++iLoc )
        if( maxEigs.GlobalRow(iLoc) == firstInds.GetLocal(iLoc,0) )
            maxEigs.SetLocal
            ( iLoc, 0, x.GetLocal(iLoc,0)+maxEigs.GetLocal(iLoc,0) );
}

template<typename Real>
void SOCMaxEig
( const DistMultiVec<Real>& x,
        DistMultiVec<Real>& maxEigs,
  const DistMultiVec<Int>& orders,
  const DistMultiVec<Int>& firstInds, Int cutoff )
{
    DEBUG_ONLY(CSE cse("SOCMaxEig"))
    const Int height = x.Height();
    const Int localHeight = x.LocalHeight();
    if( x.Width() != 1 || orders.Width() != 1 || firstInds.Width() != 1 )
        LogicError("x, orders, and firstInds should be column vectors");
    if( orders.Height() != height || firstInds.Height() != height )
        LogicError("orders and firstInds should be of the same height as x");

    SOCLowerNorms( x, maxEigs, orders, firstInds, cutoff );
    for( Int iLoc=0; iLoc<localHeight; ++iLoc )
        if( maxEigs.GlobalRow(iLoc) == firstInds.GetLocal(iLoc,0) )
            maxEigs.SetLocal
            ( iLoc, 0, x.GetLocal(iLoc,0)+maxEigs.GetLocal(iLoc,0) );
}

template<typename Real>
Real SOCMaxEig
( const Matrix<Real>& x,
  const Matrix<Int>& orders,
  const Matrix<Int>& firstInds )
{
    DEBUG_ONLY(CSE cse("SOCMaxEig"))
    Matrix<Real> maxEigs;
    SOCMaxEig( x, maxEigs, orders, firstInds );

    Real maxEig = std::numeric_limits<Real>::min();
    const Int height = x.Height();
    for( Int i=0; i<height; ++i )
        if( i == firstInds.Get(i,0) )
            maxEig = Max(maxEigs.Get(i,0),maxEig);
    return maxEig;
}

template<typename Real>
Real SOCMaxEig
( const AbstractDistMatrix<Real>& xPre,
  const AbstractDistMatrix<Int>& ordersPre,
  const AbstractDistMatrix<Int>& firstIndsPre,
  Int cutoff )
{
    DEBUG_ONLY(CSE cse("SOCMaxEig"))
    AssertSameGrids( xPre, ordersPre, firstIndsPre );

    ProxyCtrl ctrl;
    ctrl.colConstrain = true;
    ctrl.colAlign = 0;

    auto xPtr         = ReadProxy<Real,VC,STAR>(&xPre,ctrl);
    auto ordersPtr    = ReadProxy<Int,VC,STAR>(&ordersPre,ctrl);
    auto firstIndsPtr = ReadProxy<Int,VC,STAR>(&firstIndsPre,ctrl);
    auto& x = *xPtr;
    auto& orders = *ordersPtr;
    auto& firstInds = *firstIndsPtr;

    DistMatrix<Real,VC,STAR> maxEigs(x.Grid());
    SOCMaxEig( x, maxEigs, orders, firstInds, cutoff );

    const Int localHeight = x.LocalHeight();
    Real maxEigLocal = std::numeric_limits<Real>::min();
    for( Int iLoc=0; iLoc<localHeight; ++iLoc )
        if( maxEigs.GlobalRow(iLoc) == firstInds.GetLocal(iLoc,0) )
            maxEigLocal = Max(maxEigLocal,maxEigs.GetLocal(iLoc,0));
    return mpi::AllReduce( maxEigLocal, mpi::MAX, x.DistComm() );
}

template<typename Real>
Real SOCMaxEig
( const DistMultiVec<Real>& x,
  const DistMultiVec<Int>& orders,
  const DistMultiVec<Int>& firstInds,
  Int cutoff )
{
    DEBUG_ONLY(CSE cse("SOCMaxEig"))
    DistMultiVec<Real> maxEigs(x.Comm());
    SOCMaxEig( x, maxEigs, orders, firstInds, cutoff );

    const Int localHeight = x.LocalHeight();
    Real maxEigLocal = std::numeric_limits<Real>::min();
    for( Int iLoc=0; iLoc<localHeight; ++iLoc )
        if( maxEigs.GlobalRow(iLoc) == firstInds.GetLocal(iLoc,0) )
            maxEigLocal = Max(maxEigLocal,maxEigs.GetLocal(iLoc,0));
    return mpi::AllReduce( maxEigLocal, mpi::MAX, x.Comm() );
}

#define PROTO(Real) \
  template void SOCMaxEig \
  ( const Matrix<Real>& x, \
          Matrix<Real>& maxEigs, \
    const Matrix<Int>& orders, \
    const Matrix<Int>& firstInds ); \
  template void SOCMaxEig \
  ( const AbstractDistMatrix<Real>& x, \
          AbstractDistMatrix<Real>& maxEigs, \
    const AbstractDistMatrix<Int>& orders, \
    const AbstractDistMatrix<Int>& firstInds, Int cutoff ); \
  template void SOCMaxEig \
  ( const DistMultiVec<Real>& x, \
          DistMultiVec<Real>& maxEigs, \
    const DistMultiVec<Int>& orders, \
    const DistMultiVec<Int>& firstInds, Int cutoff ); \
  template Real SOCMaxEig \
  ( const Matrix<Real>& x, \
    const Matrix<Int>& orders, \
    const Matrix<Int>& firstInds ); \
  template Real SOCMaxEig \
  ( const AbstractDistMatrix<Real>& x, \
    const AbstractDistMatrix<Int>& orders, \
    const AbstractDistMatrix<Int>& firstInds, Int cutoff ); \
  template Real SOCMaxEig \
  ( const DistMultiVec<Real>& x, \
    const DistMultiVec<Int>& orders, \
    const DistMultiVec<Int>& firstInds, Int cutoff );

#define EL_NO_INT_PROTO
#define EL_NO_COMPLEX_PROTO
#include "El/macros/Instantiate.h"

} // namespace El


text:
import DS from 'ember-data';

import { module, test } from 'qunit';

module('unit/transform - DS.StringTransform');

test('#serialize', function(assert) {
  let transform = new DS.StringTransform();

  assert.strictEqual(transform.serialize(null), null);
  assert.strictEqual(transform.serialize(undefined), null);

  assert.equal(transform.serialize('foo'), 'foo');
  assert.equal(transform.serialize(1), '1');
});

test('#deserialize', function(assert) {
  let transform = new DS.StringTransform();

  assert.strictEqual(transform.deserialize(null), null);
  assert.strictEqual(transform.deserialize(undefined), null);

  assert.equal(transform.deserialize('foo'), 'foo');
  assert.equal(transform.deserialize(1), '1');
});


text:
// Copyright (c) 2017 Jan Pluskal, Martin Mares, Martin Kmet
//
//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.

using Netfox.Core.Interfaces.Views;

namespace Netfox.Detective.Views.Workspaces
{
    /// <summary>
    ///     Interaction logic for WorkspacesManagerView.xaml
    /// </summary>
    public partial class WorkspacesManagerView : DetectiveApplicationPaneViewBase, IWorkspacesManagerView
    {
        public WorkspacesManagerView() { this.InitializeComponent(); }
    }
}


text:
UCLASS()
class WAVES_API ABullet_Pawn : public APawn
{
	GENERATED_BODY()

public:
	// Sets default values for this pawn's properties
	ABullet_Pawn();

	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

	// Called every frame
	virtual void Tick( float DeltaSeconds ) override;

	// Called to bind functionality to input
	virtual void SetupPlayerInputComponent(class UInputComponent* InputComponent) override;

	//Return mesh
	FORCEINLINE class UStaticMeshComponent* GetMesh() const { return BulletMesh; }

	void SetHeading(FVector f);

	void SetWeapons(bool b1, bool b2, bool b3);

	FString getWeaponType();

private:
	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Bullet", meta = (AllowPrivateAccess = "true"))
	class UStaticMeshComponent* BulletMesh;

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Bullet", meta = (AllowPrivateAccess = "true"))
		class UBoxComponent * boxComponent;

	UFUNCTION()
		void OnOverlap(class UPrimitiveComponent* OverlappingComp, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);

	UFUNCTION()
		void OnHit(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComponent, FVector NormalImpulse, const FHitResult& Hit);

	float fSpeed;
	FVector vHeading;

	//The type of bullet (Red, Greeb, Blue)
	UPROPERTY(EditAnywhere, Category = "Enemy")
	FString sType;

	ConstructorHelpers::FObjectFinder <UMaterialInterface>* Material_Red;
	ConstructorHelpers::FObjectFinder <UMaterialInterface>* Material_Green;
	ConstructorHelpers::FObjectFinder <UMaterialInterface>* Material_Blue;
};


text:
const Logger = require('Logger');
const Utils = require('Utils');

function TableHelper(templates, arrayTemplates) {

    this.addTableRow = addTableRow;
    this.updateTableMandoryStarsVisibility = updateTableMandoryStarsVisibility;
    this.updateAllTablesMandoryStarsVisibility = updateAllTablesMandoryStarsVisibility;

    function addTableRow($tableBody) {
        let key = Utils.trimIdPrefix($tableBody.attr("id"));
        let index = $j.data($tableBody.get(0), "index") || 0;
        index++;
        Logger.logDebug("Adding row #" + index + " to table " + key + ".");

        let newRow = '
' + arrayTemplates[key].replace(/IDX/g, index) + '' + templates.deleteCell + '
';

        let $table = $tableBody.closest("table");
        // Add the new line as the last line before the table controls, or as the last table line if no
        // controls are available.
        let $lastRow = $tableBody.children('tr').last();
        if ($lastRow.hasClass('dockerCloudAddItem')) {
            $lastRow.before(newRow);
        } else {
            $tableBody.append(newRow);
        }
        $j.data($tableBody.get(0), "index", index);
        updateTableMandoryStarsVisibility($table);
    }

    function updateTableMandoryStarsVisibility($table) {
        $j(".mandatoryAsterix", $table).toggle($j('input, select', $table).length > 0)
    }

    function updateAllTablesMandoryStarsVisibility($tables) {
        $tables.each(function(i, table) {
            updateTableMandoryStarsVisibility($j(table));
        });
    }
}

module.exports = TableHelper;


text:
using CloudConfVarnaEdition4._0.Entities;
using CloudConfVarnaEdition4._0.Repositories.interfaces;
using MongoDB.Driver;
using MongoDB.Driver.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CloudConfVarnaEdition4._0.Repositories
{
    public class MongoDbMatchRepository : MongoDbRepository<Match>, IMatchRepository
    {
        public const string collectionName = "Matches";

        public MongoDbMatchRepository() : base(collectionName)
        {

        }

        public IEnumerable<Match> GetAllMatches()
        {
            return this.GetAllEntities();
        }

        public Match GetMatch(string MatchID)
        {
            return this.GetEntity(MatchID);
        }

        public Match AddMatch(Match item)
        {
            _entities.Insert(item);

            return item;
        }

        public bool RemoveMatch(string MatchID)
        {
            return this.RemoveEntity(MatchID);
        }

        public bool UpdateMatch(string MatchID, Match item)
        {
            IMongoQuery query = Query.EQ("_id", MatchID);
            item.UpdatedAt = DateTime.UtcNow;
            IMongoUpdate update = Update
                .Set("HomeTeam", item.HomeTeam)
                .Set("AwayTeam", item.AwayTeam)
                .Set("HomeTeamResult", item.HomeTeamResult)
                .Set("AwayTeamResult", item.AwayTeamResult);
            WriteConcernResult result = _entities.Update(query, update);

            return result.UpdatedExisting;
        }

        /// <summary>
        /// Add couple of dummy matches.
        /// We use latest Champion Results (Results from 21 October 2015)
        /// </summary>
        public void AddDummyMatches()
        {
            // Reset database
            _entities.RemoveAll();
            List<Match> listMatches = new List<Match>();

            listMatches.Add(new Match("Malmoe FF", "Shakhtar Donetsk", 1, 0));
            listMatches.Add(new Match("Paris Saint Germain", "Real Madrid", 0, 0));
            listMatches.Add(new Match("CSKA Moscow", "Manchester United", 1, 1));
            listMatches.Add(new Match("Wolfsburg", "PSV Eindhoven", 2, 0));
            listMatches.Add(new Match("Atletico Madrid", "Atletico Madrid", 4, 0));
            listMatches.Add(new Match("Galatasaray", "Benfica", 2, 1));
            listMatches.Add(new Match("Juventus", "Borussia Moenchengladbach", 0, 0));
            listMatches.Add(new Match("Manchester City", "Sevilla", 2, 1));

            foreach (var match in listMatches)
            {
                AddMatch(match);
            }
        }
    }
}


text:
namespace Mojo
{
namespace Core
{

ID3D11CudaTexture* D3D11CudaTextureMap::Get( std::string key )
{
    RELEASE_ASSERT( mD3D11CudaTextures.find( key ) != mD3D11CudaTextures.end() );
    return mD3D11CudaTextures[ key ];
};

void D3D11CudaTextureMap::Set( std::string key, ID3D11CudaTexture* value )
{
    mD3D11CudaTextures[ key ] = value;
};

stdext::hash_map< std::string, ID3D11CudaTexture* >& D3D11CudaTextureMap::GetHashMap()
{
    return mD3D11CudaTextures;
};

//void D3D11CudaTextureMap::MapCudaArrays()
//{
//    RELEASE_ASSERT( mCudaGraphicsResources.empty() );
//
//    MOJO_FOR_EACH_KEY_VALUE( std::string key, ID3D11CudaTexture* d3d11CudaTexture, mD3D11CudaTextures )
//    {
//        mCudaGraphicsResources.push_back( d3d11CudaTexture->GetCudaGraphicsResource() );
//    }
//
//    MOJO_CUDA_SAFE( cudaGraphicsMapResources( mCudaGraphicsResources.size(), &mCudaGraphicsResources[ 0 ], 0 ) );
//}

//void D3D11CudaTextureMap::UnmapCudaArrays()
//{
//    MOJO_CUDA_SAFE( cudaGraphicsUnmapResources( mCudaGraphicsResources.size(), &mCudaGraphicsResources[ 0 ], 0 ) );
//    mCudaGraphicsResources.clear();
//}

}
}


text:
// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// 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.

/**
 * @file Time_t.h
 */

#ifndef TIME_T_H_
#define TIME_T_H_

#include <fastdds/rtps/common/Time_t.h>

#endif /* TIME_T_H_ */


text:
package com.qxcmp.web.view.elements.segment;

/**
 * 上升样式片段
 *
 * @author aaric
 * @see Segment
 */
public class RaisedSegment extends AbstractSegment {
    @Override
    public String getClassContent() {
        return super.getClassContent() + " raised";
    }
}


text:
package main

import (
	"encoding/json"
	"io/ioutil"
	"os"
	"regexp"
	"strings"
)

type Graph struct {
	Namespace string
	Children  map[string][]Edge
	Parents   map[string][]Edge
}

func NewGraph(namespace string) *Graph {
	return &Graph{
		Namespace: namespace,
		Children:  make(map[string][]Edge),
		Parents:   make(map[string][]Edge),
	}
}

// Walk the nodes
func (g *Graph) walkParents(root string, depth int, visitor func(Edge)) {
	visited := make(map[string]struct{})
	g.walkEdges(root, g.Parents, visited, depth, func(e Edge) string {
		visitor(e)
		return e.From
	})
}

func (g *Graph) walkChildren(root string, depth int, visitor func(Edge)) {
	visited := make(map[string]struct{})
	g.walkEdges(root, g.Children, visited, depth, func(e Edge) string {
		visitor(e)
		return e.To
	})
}

// Walks all edges from the root node.
// Nodes are not visited twice.
// A negative depth will cause all edges to be walked.
func (g *Graph) walkEdges(root string, edges map[string][]Edge, visited map[string]struct{}, depth int, visitor func(Edge) string) {
	if depth == 0 {
		return
	}
	nextEdges := edges[root]
	for _, nextEdge := range nextEdges {
		nextRoot := visitor(nextEdge)
		verbosef("walking edge %s -> %s", root, nextRoot)
		if _, ok := visited[nextRoot]; !ok {
			visited[nextRoot] = struct{}{}
			g.walkEdges(nextRoot, edges, visited, depth-1, visitor)
		} else {
			verbosef("breaking cycle; already visited %s", nextRoot)
		}
	}
}

func (g *Graph) addEdge(parent, child string, collection bool) {
	verbosef("discovered edge %s -> %s", parent, child)
	e := Edge{
		From:       parent,
		To:         child,
		Collection: collection,
	}
	g.Children[parent] = append(g.Children[parent], e)
	g.Parents[child] = append(g.Parents[child], e)
}

func (g *Graph) visitPDSC(path string, info os.FileInfo, err error) error {
	if info.IsDir() {
		return nil
	}
	name := info.Name()
	if !strings.HasSuffix(name, ".pdsc") {
		return nil
	}
	buf, err := ioutil.ReadFile(path)
	if err != nil {
		fatalf("unable to read %s because %s\n", path, err)
	}

	// Strip out end of line comments since they aren't valid json.
	buf = stripRegex(buf, `//[^"\n]*`)

	// Strip out block comments since they aren't valid json.
	buf = stripRegex(buf, `/\*(\*[^/]|[^*])*\*/`)

	var pdsc PDSC
	if err := json.Unmarshal(buf, &pdsc); err != nil {
		verbosef("%s", buf)
		fatalf("unable to parse %s because %s\n", path, err)
	}
	parent := g.displayName(pdsc.fullyQualifiedName())
	for _, tr := range pdsc.typeRefs() {
		child := g.displayName(tr.Name)
		g.addEdge(parent, child, tr.Collection)
	}
	return nil
}

func stripRegex(buf []byte, re string) []byte {
	return regexp.MustCompile(re).ReplaceAllLiteral(buf, nil)
}

func (g *Graph) displayName(name string) string {
	return strings.TrimPrefix(name, g.Namespace)
}


text:
package com.allattentionhere.fabulousfiltersample;

import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;

import com.allattentionhere.fabulousfilter.AAH_FabulousFragment;

import static com.allattentionhere.fabulousfiltersample.R.id.fab;

public class MenuActivity extends AppCompatActivity {

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

        findViewById(R.id.btn_bottom).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent(MenuActivity.this, MainActivity.class);
                i.putExtra("fab", 1);
                startActivity(i);
            }
        });

        findViewById(R.id.btn_top).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent(MenuActivity.this, MainActivity.class);
                i.putExtra("fab", 2);
                startActivity(i);
            }
        });

        findViewById(R.id.btn_understanding).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent(MenuActivity.this, MainSampleActivity.class);
                startActivity(i);
            }
        });

        findViewById(R.id.btn_fragment).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent(MenuActivity.this, FragmentExampleActivity.class);
                startActivity(i);
            }
        });
    }

}


text:
/**
 * app/script/app
 * Application main script.
 * @author Keenan Staffieri
 */

console.log('Main application script loaded.')


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
    <item
        android:state_checked="false"
        android:drawable="@drawable/moving_lock_off" />
    <item
        android:state_checked="true"
        android:drawable="@drawable/moving_lock_on" />
</selector>


text:
<?php

declare(strict_types=1);

namespace Doctrine\Migrations\Tests\Tools\Console;

use Doctrine\Migrations\Tools\Console\ConsoleRunner;
use Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper;
use PHPUnit\Framework\TestCase;
use PHPUnit_Framework_MockObject_MockObject;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\HelperSet;

/**
 * @covers \Doctrine\Migrations\Tools\Console\ConsoleRunner
 */
class ConsoleRunnerTest extends TestCase
{
    /** @var PHPUnit_Framework_MockObject_MockObject|EntityManagerHelper */
    private $entityManagerHelper;

    /** @var Application */
    private $application;

    public function testRun() : void
    {
        $helperSet = new HelperSet([]);

        $application = $this->createMock(Application::class);

        ConsoleRunnerStub::$application = $application;

        $application->expects(self::once())
            ->method('run');

        ConsoleRunnerStub::run($helperSet, []);
    }

    public function testHasExecuteCommand() : void
    {
        ConsoleRunner::addCommands($this->application);

        self::assertTrue($this->application->has('migrations:execute'));
    }

    public function testHasGenerateCommand() : void
    {
        ConsoleRunner::addCommands($this->application);

        self::assertTrue($this->application->has('migrations:generate'));
    }

    public function testHasLatestCommand() : void
    {
        ConsoleRunner::addCommands($this->application);

        self::assertTrue($this->application->has('migrations:latest'));
    }

    public function testHasMigrateCommand() : void
    {
        ConsoleRunner::addCommands($this->application);

        self::assertTrue($this->application->has('migrations:migrate'));
    }

    public function testHasStatusCommand() : void
    {
        ConsoleRunner::addCommands($this->application);

        self::assertTrue($this->application->has('migrations:status'));
    }

    public function testHasVersionCommand() : void
    {
        ConsoleRunner::addCommands($this->application);

        self::assertTrue($this->application->has('migrations:version'));
    }

    public function testHasUpToDateCommand() : void
    {
        ConsoleRunner::addCommands($this->application);

        self::assertTrue($this->application->has('migrations:up-to-date'));
    }

    public function testHasDiffCommand() : void
    {
        $this->application->setHelperSet(new HelperSet([
            'em' => $this->entityManagerHelper,
        ]));

        ConsoleRunner::addCommands($this->application);

        self::assertTrue($this->application->has('migrations:diff'));
    }

    public function testNotHasDiffCommand() : void
    {
        $this->application->setHelperSet(new HelperSet([]));

        ConsoleRunner::addCommands($this->application);

        self::assertFalse($this->application->has('migrations:diff'));
    }

    public function testCreateApplication() : void
    {
        $helperSet = new HelperSet();

        $application = ConsoleRunner::createApplication($helperSet);

        self::assertSame($helperSet, $application->getHelperSet());
    }

    protected function setUp() : void
    {
        parent::setUp();

        $this->application         = new Application();
        $this->entityManagerHelper = $this->getMockBuilder(EntityManagerHelper::class)
            ->disableOriginalConstructor()
            ->getMock();
    }
}

class ConsoleRunnerStub extends ConsoleRunner
{
    /** @var Application */
    public static $application;

    /**
     * @param Command[] $commands
     */
    public static function createApplication(HelperSet $helperSet, array $commands = []) : Application
    {
        return static::$application;
    }
}


text:
YUI.add('button-test', function (Y) {

var Assert      = Y.Assert,
    ArrayAssert = Y.ArrayAssert,
    suite;

// -- Suite --------------------------------------------------------------------
suite = new Y.Test.Suite('button');

// -- Widget ----------------------------------------------------------------
suite.add(new Y.Test.Case({
    name: 'Basic',

    setUp : function () {
        Y.one("#container").setContent('<button id="testButton" data-foo="foobar" class="test-class">Hello</button><button id="testToggleButton">Hello</button><button id="testCheckButton">Hello</button>');
        this.button = new Y.Button({
            srcNode: '#testButton'
        }).render();
        this.toggleButton = new Y.ToggleButton({
            srcNode: '#testToggleButton'
        }).render();
        this.checkButton = new Y.ToggleButton({
            srcNode: '#testCheckButton',
            type: 'checkbox'
        }).render();
    },

    tearDown: function () {
        this.button.destroy();
        this.toggleButton.destroy();
        this.checkButton.destroy();
        delete this.button;
        delete this.toggleButton;
        delete this.checkButton;
    },

    'Rendering should preserve Node attributes': function () {
        var button = this.button,
            node = button.getNode();

        Assert.areEqual('foobar', node.getData('foo'));
        Assert.isTrue(node.hasClass('test-class'));
    },

    'Rendering a button should add the `yui3-button` class': function () {
        var button = this.button,
            node = button.getNode();

        Assert.isTrue(node.hasClass('yui3-button'));
    },

    'Should render as a single-box widget': function () {
        var button = this.button,
            bb = button.get("boundingBox"),
            cb = button.get("contentBox");

        Assert.isTrue(bb.compareTo(cb));
    },

    'Changing the label atrribute should trigger labelChange and labelHTMLChange': function () {
        var button = this.button,
            labelEventsTriggered = 0,
            labelHTMLEventsTriggered = 0;

        button.on('labelChange', function(){
            labelEventsTriggered+=1;
        });

        button.on('labelHTMLChange', function(){
            labelHTMLEventsTriggered+=1;
        });

        Assert.areEqual(0, labelEventsTriggered);
        Assert.areEqual(0, labelHTMLEventsTriggered);

        button.set('label', 'foobar');
        Assert.areEqual(1, labelEventsTriggered);
        Assert.areEqual(1, labelHTMLEventsTriggered);
    },

    'ToggleButton should have `toggle` role': function () {
        var button = this.button,
            toggleButton = this.toggleButton,
            role = toggleButton.get('contentBox').get('role');

        Assert.areEqual('toggle', role);
    },

    'Selecting a toggleButton should add class `yui3-button-selected`': function () {
        var button = this.toggleButton,
            cb = button.get('contentBox');

        Assert.isFalse(cb.hasClass('yui3-button-selected'));

        cb.simulate('click');
        Assert.isTrue(cb.hasClass('yui3-button-selected'));

        // Simulate the button click
        cb.simulate('click');
        Assert.isFalse(cb.hasClass('yui3-button-selected'));

        cb.simulate('click');
        Assert.isTrue(cb.hasClass('yui3-button-selected'));

        cb.simulate('click');
        Assert.isFalse(cb.hasClass('yui3-button-selected'));
    },

    'Select toggling a button should fire pressedChange': function () {
        var toggleButton = this.toggleButton,
            cb = toggleButton.get('contentBox'),
            eventsTriggered = 0;

        toggleButton.on('pressedChange', function(){
            eventsTriggered+=1;
        });

        Assert.areEqual(0, eventsTriggered);

        cb.simulate('click');
        Assert.areEqual(1, eventsTriggered);

        cb.simulate('click');
        Assert.areEqual(2, eventsTriggered);
    },

    'disable() should set the disabled attribute to true': function () {
        var button = this.button;

        Assert.isFalse(button.get('disabled'));

        button.disable();
        Assert.isTrue(button.get('disabled'));
        Assert.isTrue(button.get('boundingBox').get('disabled'));
    },

    'enable() should set the disabled attribute to false': function () {
        var button = this.button;

        Assert.isFalse(button.get('disabled'));

        button.disable();
        Assert.isTrue(button.get('disabled'));

        button.enable();
        Assert.isFalse(button.get('disabled'));
    },

    'Setting `pressed` should toggle the `pressed` attribute': function () {
        var button = this.toggleButton;

        Assert.isFalse(button.get('pressed'));

        button.set('pressed', true);
        Assert.isTrue(button.get('pressed'));

        button.set('pressed', false);
        Assert.isFalse(button.get('pressed'));
    },

    'Setting `checked` should toggle the `checked` attribute': function () {
        var button = this.checkButton;

        Assert.isFalse(button.get('checked'));

        button.set('checked', true);
        Assert.isTrue(button.get('checked'));

        button.set('checked', false);
        Assert.isFalse(button.get('checked'));
    },

    'Toggle buttons should have proper ARIA data': function () {
        var button = this.toggleButton,
            cb = button.get('contentBox');

        Assert.areSame('toggle', cb.get('role'));
        Assert.areSame('false', cb.get('aria-pressed'));

        cb.simulate('click');
        //button.set('pressed', true);
        Assert.areSame('true', cb.get('aria-pressed'));
    },

    'Checkbox buttons should have proper ARIA data': function () {
        var button = this.checkButton,
            cb = button.get('contentBox');

        Assert.areSame('checkbox', cb.get('role'));
        Assert.areSame('false', cb.get('aria-checked'));

        cb.simulate('click');

        Assert.areSame('true', cb.get('aria-checked'));
    },

    'hide() and show() should behave correctly': function () {
        var button = this.button,
            cb = button.get('contentBox'),
            origStyle = cb.getStyle('display');

        button.hide();

        Assert.isTrue(cb.hasClass('yui3-button-hidden'));
        Assert.areSame('none', cb.getComputedStyle('display'));

        button.show();

        Assert.isFalse(cb.hasClass('yui3-button-hidden'));
        Assert.areSame(origStyle, cb.getStyle('display'));
    },

    'Rendering should preserve nested HTML': function() {

        var Test = this,
            content = '
foo

bar
',
            button,
            expected,
            actual;

        Y.one("#container").setContent('<button>' + content + '</button>');

        button = new Y.Button({
            srcNode: Y.one("#container button"),
            render: true
        });

        expected = button.getNode().getHTML(),
        actual = button.get('labelHTML');

        Assert.areSame(expected, actual);
    }
}));

// -- Config tests ----------------------------------------------------------------
suite.add(new Y.Test.Case({
    name: 'Config',

    setUp : function () {

    },

    tearDown: function () {
        Y.one("#container").empty(true);
    },

    'Passing `pressed=true` in with the config will default the button to a `pressed` state': function() {
        var button;

        Y.one("#container").setContent('<input type="button" value="foo">');

        button = new Y.ToggleButton({
            srcNode: Y.one("#container input"),
            pressed: true,
            render: true
        });

        Assert.isTrue(button.get('pressed'));
        Assert.isUndefined(button.get('checked'));

        button.toggle();

        Assert.isFalse(button.get('pressed'));
        Assert.isUndefined(button.get('checked'));
    },

    'Passing `checked=true` in with the config will default the button to a `checked` state': function() {
        var button;

        Y.one("#container").setContent('<input type="button" value="foo">');

        button = new Y.ToggleButton({
            srcNode: Y.one("#container input"),
            checked: true,
            type: 'checkbox',
            render: true
        });

        Assert.isTrue(button.get('checked'));
        Assert.isUndefined(button.get('pressed'));

        button.toggle();

        Assert.isFalse(button.get('checked'));
        Assert.isUndefined(button.get('pressed'));
    },

    'Passing `disabled=true` in with the config will default the button to a `disabled` state': function() {
        var Test = this,
            button;

        Y.one("#container").setContent('<button></button>');

        button = new Y.Button({
            srcNode: Y.one("#container button"),
            disabled: true,
            render: true
        });

        Y.later(500, null, function(){
            Test.resume(function(){
                Assert.isTrue(button.get('disabled'));
                Assert.isTrue(button.get('boundingBox').get('disabled'));
            });
        });

        Test.wait(2000);
    },

    'Passing a label attribute in with the config should default the button text': function() {
        var Test = this,
            label = 'YUI is awesome',
            button;

        Y.one("#container").setContent('<button></button>');

        button = new Y.Button({
            srcNode: Y.one("#container button"),
            label: label,
            render: true
        });

        Y.later(500, null, function(){
            Test.resume(function(){
                Assert.areEqual(label, button.get('label'));
            });
        });

        Test.wait(2000);
    }
}));

// -- HTML Parser tests ----------------------------------------------------------------
suite.add(new Y.Test.Case({
    name: 'Parser',

    setUp : function () {

    },

    tearDown: function () {
        Y.one("#container").empty(true);
    },

    'The HTML parser for the `labelHTML` attribute should reference the button text': function() {

        var Test = this,
            label = 'YUI is awesome',
            button;

        Y.one("#container").setContent('<button>' + label + '</button>');

        button = new Y.Button({
            srcNode: Y.one("#container button"),
            render: true
        });

        Y.later(100, null, function(){
            Test.resume(function(){
                Assert.areEqual(label, button.get('labelHTML'));
            });
        });

        Test.wait(1000);
    },

    'Using `disabled=true` in the markup will default the button to a `disabled` state': function() {
        Y.one("#container").setContent('<button disabled></button>');

        var Test = this,
            button = new Y.Button({
                srcNode: Y.one("#container button"),
                render: true
            });

        Y.later(100, null, function(){
            Test.resume(function(){
                Assert.isTrue(button.get('disabled'));
                Assert.isTrue(button.get('boundingBox').get('disabled'));
            });
        });

        Test.wait(1000);
    }
}));

Y.Test.Runner.add(suite);

}, '@VERSION@', {
    requires: ['button', 'test', 'node-event-simulate']
});


text:
import Ember from 'ember';

export default Ember.Component.extend({
  icon: 'ss-help',
  tooltip: '',
  enabled: true,
  actionArg: null,
  altActionArg: null,

  tagName: 'button',
  type: 'button',
  classNames: ['btn','btn-link'],
  classNameBindings: ['enabled::hide'],
  attributeBindings: ['tooltip'],

  click : function(event) {
    if ( event.altKey && this.get('altActionArg'))
    {
      this.sendAction('action', this.get('altActionArg'));
    }
    else
    {
      this.sendAction('action', this.get('actionArg'));
    }
  },

  render: function(buffer) {
    buffer.push('<i class="'+ this.get('icon') + '"></i>');
  },

  iconChanged: function() {
    this.rerender();
  }.observes('icon'),
});


text:
import os
import pastie
import config
import gtk
import gtk.glade

class Window():

    def __init__(self, gladefile):
        self._glade = gtk.glade.XML( os.path.dirname( __file__ ) + "/" + gladefile )
        self._window = self._glade.get_widget("window")
        self._window.connect("delete_event", self._hide)

    def _hide(self, widget, event):
        widget.hide()
        return True

    def show(self, dummy=None):
        self._window.show()

class PastieWindow(Window):

    def __init__(self,):
        Window.__init__(self, "PasteWindow.glade")

        for lang in pastie.LANGS:
            self._glade.get_widget("syntax").append_text(lang)

        self._glade.get_widget("syntax").set_active(0) #sets active posision in syntax list
        self._glade.get_widget("ok_button").connect("clicked", self._ok_button)
        self._glade.get_widget("cancel_button").connect("clicked", lambda a: self._window.hide())

        self.inform = Inform()
        self.config = config.Configuration()

        self.set_from_defaults()
        self.config.call_when_configuration_changes = self.set_from_defaults

    def set_from_defaults(self):
        self._glade.get_widget("syntax").set_active(config.SYNTAXES.index(self.config.syntax))

        if self.config.private == "True":
            to_set = True
        else:
            to_set = False

        self._glade.get_widget("private").set_active(to_set)

    def _ok_button(self, event=None):
        text = self.get_text()
        combox = self._glade.get_widget("syntax")
        model = combox.get_model()
        active = combox.get_active()
        syntax = model[active][0]
        priv = self._glade.get_widget("private").get_active()
        self._window.hide()
        self._paste(syntax, priv, text, self.config.link)

    def paste_defaults(self, bla):
        if self.config.private == "True":
            private = True
        else:
            private = False

        self._paste(self.config.syntax, private, self.get_text(), self.config.link)

    def _paste(self, syntax, priv, text, link):
        "pastes selected text and displays window with link"
        p = pastie.Pastie(text, syntax, priv)
        paste = p.paste()
        if link == "Window":
            self.inform.entry.set_text("please wait")
            self.inform.show() #shows window
            self.inform.entry.set_text(paste)
        else:
            clipboard = gtk.clipboard_get('CLIPBOARD')
            clipboard.set_text(paste)
            clipboard.store()

class Inform(Window):

    def __init__(self):
        Window.__init__(self, "Inform.glade")
        self.entry = self._glade.get_widget("link")
        self._glade.get_widget("ok_button").connect("clicked", lambda a: self._window.hide())


text:
/*global Favcount:true*/
var NilavuResolver = require('nilavu/ember/resolver').default;

// Allow us to import Ember
define('ember', ['exports'], function(__exports__) {
  __exports__.default = Ember;
});

window.Nilavu = Ember.Application.createWithMixins(Nilavu.Ajax, {
  LOG_ACTIVE_GENERATION: true,
  LOG_VIEW_LOOKUPS: true,
  LOG_BINDINGS: true,
  LOG_TRANSITIONS: true,
  LOG_TRANSITIONS_INTERNAL: true,
  LOG_STACKTRCE_ON_DEPRECATION: true,

  rootElement: '#main',
  _docTitle: document.title,

  getURL: function(url) {
    if (!url) return url;

    // if it's a non relative URL, return it.
    if (url !== '/' && !/^\/[^\/]/.test(url)) return url;

    if (url.indexOf(Nilavu.BaseUri) !== -1) return url;
    if (url[0] !== "/") url = "/" + url;

    return Nilavu.BaseUri + url;
  },

  getURLWithCDN: function(url) {
    url = this.getURL(url);
    // only relative urls
    if (Nilavu.CDN && /^\/[^\/]/.test(url)) {
      url = Nilavu.CDN + url;
    } else if (Nilavu.S3CDN) {
      url = url.replace(Nilavu.S3BaseUrl, Nilavu.S3CDN);
    }
    return url;
  },

  Resolver: NilavuResolver,

  _titleChanged: function() {
    var title = this.get('_docTitle') || Nilavu.SiteSettings.title;

    // if we change this we can trigger changes on document.title
    // only set if changed.
    if($('title').text() !== title) {
      $('title').text(title);
    }

    var notifyCount = this.get('notifyCount');
    if (notifyCount > 0 && !Nilavu.User.currentProp('dynamic_favicon')) {
      title = "(" + notifyCount + ") " + title;
    }

    document.title = title;
  }.observes('_docTitle', 'hasFocus', 'notifyCount'),

  faviconChanged: function() {
    if(Nilavu.User.currentProp('dynamic_favicon')) {
      var url = Nilavu.SiteSettings.favicon_url;
      if (/^http/.test(url)) {
        url = Nilavu.getURL("/favicon/proxied?" + encodeURIComponent(url));
      }
      new Favcount(url).set(
        this.get('notifyCount')
      );
    }
  }.observes('notifyCount'),

  // The classes of buttons to show on a post
  postButtons: function() {
    return Nilavu.SiteSettings.post_menu.split("|").map(function(i) {
      return i.replace(/\+/, '').capitalize();
    });
  }.property(),

  notifyTitle: function(count) {
    this.set('notifyCount', count);
  },

  notifyBackgroundCountIncrement: function() {
    if (!this.get('hasFocus')) {
      this.set('backgroundNotify', true);
      this.set('notifyCount', (this.get('notifyCount') || 0) + 1);
    }
  },

  resetBackgroundNotifyCount: function() {
    if (this.get('hasFocus') && this.get('backgroundNotify')) {
      this.set('notifyCount', 0);
    }
    this.set('backgroundNotify', false);
  }.observes('hasFocus'),

  authenticationComplete: function(options) {
    // TODO, how to dispatch this to the controller without the container?
    var loginController = Nilavu.__container__.lookup('controller:login');
    return loginController.authenticationComplete(options);
  },

  /**
    Start up the Nilavu application by running all the initializers we've defined.

    @method start
  **/
  start: function() {
    console.log("--- Nilevu ...");
    console.log(Ember.keys(Ember.TEMPLATES));

    $('noscript').remove();

    Ember.keys(requirejs._eak_seen).forEach(function(key) {
      if (/\/pre\-initializers\//.test(key)) {
        var module = require(key, null, null, true);
        if (!module) { throw new Error(key + ' must export an initializer.'); }
        Nilavu.initializer(module.default);
      }
    });

    Ember.keys(requirejs._eak_seen).forEach(function(key) {
      if (/\/initializers\//.test(key)) {
        var module = require(key, null, null, true);
        if (!module) { throw new Error(key + ' must export an initializer.'); }

        var init = module.default;
        var oldInitialize = init.initialize;
        init.initialize = function(app) {
          oldInitialize.call(this, app.container, Nilavu);
        };

        Nilavu.instanceInitializer(init);
      }
    });

  },

  requiresRefresh: function(){
    var desired = Nilavu.get("desiredAssetVersion");
    return desired && Nilavu.get("currentAssetVersion") !== desired;
  }.property("currentAssetVersion", "desiredAssetVersion"),

  assetVersion: Ember.computed({
    get: function() {
      return this.get("currentAssetVersion");
    },
    set: function(key, val) {
      if(val) {
        if (this.get("currentAssetVersion")) {
          this.set("desiredAssetVersion", val);
        } else {
          this.set("currentAssetVersion", val);
        }
      }
      return this.get("currentAssetVersion");
    }
  })
});

function RemovedObject(name) {
  this._removedName = name;
}

function methodMissing() {
  console.warn("The " + this._removedName + " object has been removed from Nilavu " +
               "and your plugin needs to be updated.");
};

Nilavu.RemovedObject = RemovedObject;

['reopen', 'registerButton', 'on', 'off'].forEach(function(m) { RemovedObject.prototype[m] = methodMissing; });


text:
package shared.ui.actionscontentview;

import shared.ui.actionscontentview.EffectsController.Effect;
import android.view.animation.Animation;

public interface ContainerController {

  /**
   * Setter for ignore touch events key.
   * @param ignore
   */
  public void setIgnoreTouchEvents(boolean ignore);

  /**
   * Getter for ignore touch events key.
   * @return
   */
  public boolean isIgnoringTouchEvents();

  /**
   * Setter for effects.
   * @param resId - id to load effects from resources.
   */
  public void setEffects(int resId);

  /**
   * Setter for effects.
   * @param effects - animation will be used as effect for current layout while swipping.
   */
  public void setEffects(Animation effects);

  /**
   * Getter for effects.
   * @return animation that is used as effect for current layout while swipping.
   */
  public Effect[] getEffects();
}


text:
void
Digits2Raw()
{
  // AliLog::SetModuleDebugLevel("FMD", 10);
  AliLog::SetModuleDebugLevel("RAW", 1);
  AliRunLoader* runLoader = AliRunLoader::Open("galice.root", "Alice", "read");
  if (!runLoader) {
    AliError("Coulnd't read the file galice.root");
    return;
  }

  if  (runLoader->LoadgAlice()) return;
  AliRun* run = runLoader->GetAliRun();

  // Get the FMD
  AliFMD* fmd = static_cast<AliFMD*>(run->GetDetector("FMD"));
  if (!fmd) {
    AliError("Failed to get detector FMD from loader");
    return;
  }

  // Get the FMD loader
  AliLoader* loader = runLoader->GetLoader("FMDLoader");
  if (!loader) {
    AliError("Failed to get detector FMD loader from loader");
    return;
  }
  if (runLoader->LoadHeader()) {
    AliError("Failed to get event header information from loader");
    return;
  }
  TTree* treeE = runLoader->TreeE();

  AliCDBManager::Instance()->SetRun(0);
  AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");

  AliFMDParameters::Instance()->Init(kFALSE,
				     (AliFMDParameters::kPulseGain|
				     (AliFMDParameters::kPedestal|
				      AliFMDParameters::kDeadMap|
				      AliFMDParameters::kSampleRate|
				      AliFMDParameters::kAltroMap|
				      AliFMDParameters::kStripRange)));
  AliFMDParameters::Instance()->SetZeroSuppression(1);
  // AliFMDParameters::Instance()->SetPedestal(100);
  // AliFMDParameters::Instance()->SetPedestalWidth(0);
  // AliFMDParameters::Instance()->SetZSPreSamples(0);
  // AliFMDParameters::Instance()->SetZSPostSamples(0);

  fmd->Digits2Raw();
}


text:
  <?php include '../cabecera.php'; ?>

Inserte sus datos

    <?php

        //FORM SUBMITTED
        //Si esxiste el login (name= formulario) por $ POST conectarse a la base de datos.
        if (isset($_POST["login"])) {
          //CREATING THE CONNECTION
          $connection = new mysqli($host, $usuario, $clave, $nombre);
          //Conexion a la base de datos (localhost, usuario, contraseña, bd).

          if ($connection->connect_errno) {
              printf("Connection failed: %s\n", $connection->connect_error);
              exit();
          }
          //Validacion de la base de datos, en caso de error que lo muestre.

          $consulta="select * from usuarios where
          email='".$_POST["email"]."' and clave=md5('".$_POST["clave"]."');";
          //Email y clave encriptada, datos que paso para el Login.

          if ($result = $connection->query($consulta)) {

              if ($result->num_rows===0) {
              //Si el resultado de la consulta = 0 mostrarme "LOGIN INVALIDO".
                echo "LOGIN INVALIDO";
              } else {

                //Recuperamos el resultado de la consulta.
                $obj = $result->fetch_object();

                //Incluimos cada campo en session.
                //Incluimos en la $SESSION cada uno de los resultados del formulario.
                $_SESSION["id_usuario"] = $obj->id_usuario;
                $_SESSION["email"] = $obj->email;
                $_SESSION["nombre"] = $obj->nombre;
                $_SESSION["apellidos"] = $obj->apellidos;
                $_SESSION["dni"] = $obj->dni;
                $_SESSION["rol"] = $obj->rol;
                $_SESSION['tema'] = $obj->tema;
                $_SESSION["language"]="es";

                header("Location: index.php");
                //Redireccion a index.php
              }
          } else {
            echo "Wrong Query";
          }

      }
    ?>

    <form action="login.php" method="post">

EMAIL: <input name="email" required>

CONTRASEÑA: <input name="clave" type="password" required>

<input type="submit" value="Identificarme" class="btn btn-primary" name="login">

    </form>

    <?php include '../piepagina.php'; ?>


text:
module StatsD
  module Instrument
    # @note This class is part of the new Client implementation that is intended
    #   to become the new default in the next major release of this library.
    class CaptureSink
      attr_reader :parent, :datagrams, :datagram_class

      def initialize(parent:, datagram_class: StatsD::Instrument::Datagram)
        @parent = parent
        @datagram_class = datagram_class
        @datagrams = []
      end

      def sample?(_sample_rate)
        true
      end

      def <<(datagram)
        @datagrams << datagram_class.new(datagram)
        parent << datagram
        self
      end

      def clear
        @datagrams.clear
      end
    end
  end
end


text:
<?php defined('SYSPATH') OR die('Kohana bootstrap needs to be included before tests run');

class Kohana_CookieTest extends Unittest_TestCase
{

	protected $_default_salt = 'AdaoidadnA£ASDNadnaoiwdnawd';
	/**
	 * Sets up the environment
	 */
	// @codingStandardsIgnoreStart
	public function setUp()
	// @codingStandardsIgnoreEnd
	{
		parent::setUp();

		Cookie::$salt = $this->_default_salt;
	}

	/**
	 * Tears down the environment
	 */
	// @codingStandardsIgnoreStart
	public function tearDown()
	// @codingStandardsIgnoreEnd
	{
		parent::tearDown();

		Cookie::$salt = NULL;
	}

	/**
	 * Provides test data for test_set()
	 *
	 * @return array
	 */
	public function provider_set()
	{
		return array(
			array('foo', 'bar', NULL, TRUE),
			array('foo', 'bar', 10, TRUE),
		);
	}

	/**
	 * Tests cookie::set()
	 *
	 * @test
	 * @dataProvider provider_set
	 * @covers cookie::set
	 * @param mixed   $key      key to use
	 * @param mixed   $value    value to set
	 * @param mixed   $exp      exp to set
	 * @param boolean $expected Output for cookie::set()
	 */
	public function test_set($key, $value, $exp, $expected)
	{
		if (headers_sent()) {
			$this->markTestSkipped('Cannot test setting cookies as headers have already been sent');
		}

		$this->assertSame($expected, cookie::set($key, $value, $exp));
	}

	/**
	 * Provides test data for test_get()
	 *
	 * @return array
	 */
	public function provider_get()
	{
		// setUp is called after the provider so we need to specify a
		// salt here in order to use it in the provider
		Cookie::$salt = $this->_default_salt;

		return array(
			array('foo', Cookie::salt('foo', 'bar').'~bar', 'bar'),
			array('bar', Cookie::salt('foo', 'bar').'~bar', NULL),
			array(NULL, Cookie::salt('foo', 'bar').'~bar', NULL),
		);
	}

	/**
	 * Tests cookie::set()
	 *
	 * @test
	 * @dataProvider provider_get
	 * @covers cookie::get
	 * @param mixed   $key      key to use
	 * @param mixed   $value    value to set
	 * @param boolean $expected Output for cookie::get()
	 */
	public function test_get($key, $value, $expected)
	{
		if (headers_sent()) {
			$this->markTestSkipped('Cannot test setting cookies as headers have already been sent');
		}

		// Force $_COOKIE
		if ($key !== NULL)
		{
			$_COOKIE[$key] = $value;
		}

		$this->assertSame($expected, cookie::get($key));
	}

	/**
	 * Provides test data for test_delete()
	 *
	 * @return array
	 */
	public function provider_delete()
	{
		return array(
			array('foo', TRUE),
		);
	}

	/**
	 * Tests cookie::delete()
	 *
	 * @test
	 * @dataProvider provider_delete
	 * @covers cookie::delete
	 * @param mixed   $key      key to use
	 * @param boolean $expected Output for cookie::delete()
	 */
	public function test_delete($key, $expected)
	{
		if (headers_sent()) {
			$this->markTestSkipped('Cannot test setting cookies as headers have already been sent');
		}

		$this->assertSame($expected, cookie::delete($key));
	}

	/**
	 * Provides test data for test_salt()
	 *
	 * @return array
	 */
	public function provider_salt()
	{
		return array(
			array('foo', 'bar', 'b5773a6255d1deefc23f9f69bcc40fdc998e5802'),
		);
	}

	/**
	 * Tests cookie::salt()
	 *
	 * @test
	 * @dataProvider provider_salt
	 * @covers cookie::salt
	 * @param mixed   $key      key to use
	 * @param mixed   $value    value to salt with
	 * @param boolean $expected Output for cookie::delete()
	 */
	public function test_salt($key, $value, $expected)
	{
		$this->assertSame($expected, cookie::salt($key, $value));
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
    Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable

    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.
-->
<!DOCTYPE Test SYSTEM "test.dtd">
<!--
Author:  Alexander D. Shipilov
Version: $Revision: 1.3 $
-->
<Test
  ID="fconst_10202"
  date-of-creation="2004-12-14"
  timeout="1"
  >
  <Author value="Alexander D. Shipilov"/>
  <Description>
    Tests fconst_1 java virtual machine instruction.
    fconst_1. Push 2. Push 1. Sub values. Compare values.

    Covered assertions assert_instr24a099
  </Description>

  <Source name="fconst_10202p.j"/>

  <Runner ID="Runtime">
    <Param name="toRun" value="org.apache.harmony.vts.test.vm.jvms.instructions.loadStore.fconst_1.fconst_102.fconst_10202.fconst_10202p"/>
  </Runner>
</Test>


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Hedwigia 8: 40 (1869)

#### Original name
Hydnum sulfureum Saut., 1869

### Remarks
null


text: Author: Brandon Ragsdale