text:
<?php

namespace Vend\Statsd\Datadog;

use Vend\Statsd\FactoryInterface;
use Vend\Statsd\FactoryInterfaceTest;

class FactoryTest extends FactoryInterfaceTest
{
    /**
     * @return FactoryInterface
     */
    protected function getFactory()
    {
        return new Factory();
    }
}

redpajama_set_name: RedPajamaGithub


text:
* [Alexis Wurth](https://github.com/awurth)
    * Authentication
    * Picture posting
    * Following users
    * User profile view
    * Searching users
    * Hashtags, mentions
    * Comments
    * SQL Conception

* [Xavier Chopin](https://github.com/xchopin)
    * Profile edition
    * Password change
    * Account deletion
    * Picture rating
    * Design
    * SQL Conception

* [Maxence Antoine](https://github.com/MaxAntoine)
    * Password recovery


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

Total Flights by Month

<svg class="chart"></svg>

{% endblock %}


text:
module DataMaps
  module Then
    # A then to filter values
    #
    # @since 0.0.1
    class Filter < Base
      # Return the original data
      #
      # @param [mixed] data
      # @return [mixed] data
      def execute(data)
        data
      end
    end
  end
end


text:
require 'test_helper'

module EpmCatalog
  class ProjectTypeTest < ActiveSupport::TestCase
    # test "the truth" do
    #   assert true
    # end
  end
end


text:
ifeq ($(USE_OPT),)
  USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 --specs=nano.specs
endif

# C specific options here (added to USE_OPT).
ifeq ($(USE_COPT),)
  USE_COPT =
endif

# C++ specific options here (added to USE_OPT).
ifeq ($(USE_CPPOPT),)
  USE_CPPOPT = -fno-rtti -fno-exceptions
endif

# Enable this if you want the linker to remove unused code and data
ifeq ($(USE_LINK_GC),)
  USE_LINK_GC = yes
endif

# Linker extra options here.
ifeq ($(USE_LDOPT),)
  USE_LDOPT =
endif

# Enable this if you want link time optimizations (LTO)
ifeq ($(USE_LTO),)
  USE_LTO = no
endif

# If enabled, this option allows to compile the application in THUMB mode.
ifeq ($(USE_THUMB),)
  USE_THUMB = yes
endif

# Enable this if you want to see the full log while compiling.
ifeq ($(USE_VERBOSE_COMPILE),)
  USE_VERBOSE_COMPILE = no
endif

# If enabled, this option makes the build process faster by not compiling
# modules not used in the current configuration.
ifeq ($(USE_SMART_BUILD),)
  USE_SMART_BUILD = yes
endif

#
# Build global options
##############################################################################

##############################################################################
# Architecture or project specific options
#

# Stack size to be allocated to the Cortex-M process stack. This stack is
# the stack used by the main() thread.
ifeq ($(USE_PROCESS_STACKSIZE),)
  USE_PROCESS_STACKSIZE = 0x400
endif

# Stack size to the allocated to the Cortex-M main/exceptions stack. This
# stack is used for processing interrupts and exceptions.
ifeq ($(USE_EXCEPTIONS_STACKSIZE),)
  USE_EXCEPTIONS_STACKSIZE = 0x400
endif

# Enables the use of FPU (no, softfp, hard).
ifeq ($(USE_FPU),)
  USE_FPU = no
endif

#
# Architecture or project specific options
##############################################################################

##############################################################################
# Project, sources and paths
#

# Define project name here
PROJECT = ch

# Imported source files and paths
COMMON = ../common
PROTOMSGDIR = ../../msg
CHIBIOS = $(COMMON)/ChibiOS
CHIBIOS_CONTRIB = $(COMMON)/ChibiOS-Contrib
# Startup files.
include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32l4xx.mk
# HAL-OSAL files (optional).
include $(CHIBIOS_CONTRIB)/os/hal/hal.mk
include $(CHIBIOS_CONTRIB)/os/hal/ports/STM32/STM32L4xx/platform.mk
include $(CHIBIOS)/os/hal/boards/ST_NUCLEO64_L476RG/board.mk
include $(CHIBIOS)/os/hal/osal/rt/osal.mk
include $(CHIBIOS)/os/hal/lib/streams/streams.mk
# RTOS files (optional).
include $(CHIBIOS)/os/rt/rt.mk
include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
# Other files (optional).
include $(COMMON)/Motor/Motor.mk
include $(COMMON)/Qei/Qei.mk
include $(COMMON)/vl53l0x/vl53l0x.mk
include $(COMMON)/vl53l0x_cpp/vl53l0x_cpp.mk
include $(COMMON)/pca9685/pca9685.mk
include $(COMMON)/tcs34725_adafruit/tcs34725_adafruit.mk
include $(COMMON)/Gpio/Gpio.mk
include $(COMMON)/AdcTimer/AdcTimer.mk
include $(COMMON)/ros_lib/ros.mk
include $(COMMON)/Pid/Pid.mk

# Define linker script file here
LDSCRIPT= $(STARTUPLD)/STM32L476xG.ld

# C sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
CSRC = $(STARTUPSRC) \
       $(KERNSRC) \
       $(PORTSRC) \
       $(OSALSRC) \
       $(HALSRC) \
       $(STREAMSSRC) \
       $(PLATFORMSRC) \
       $(BOARDSRC) \
       $(VL53L0XSRC) \
       $(CHIBIOS)/os/various/syscalls.c

# C++ sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
CPPSRC = $(CHIBIOS)/os/various/cpp_wrappers/syscalls_cpp.cpp \
         $(MOTORSRC) $(QEISRC) $(PCA9685SRC) $(GPIOSRC) \
         $(ADCTIMERSRC) $(PIDSRC) $(ROSSRC) $(VL53L0XCPPSRC) \
         $(TCS34725SRC) \
         src/Board.cpp src/main.cpp

# C sources to be compiled in ARM mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
#       option that results in lower performance and larger code size.
ACSRC =

# C++ sources to be compiled in ARM mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
#       option that results in lower performance and larger code size.
ACPPSRC =

# C sources to be compiled in THUMB mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
#       option that results in lower performance and larger code size.
TCSRC =

# C sources to be compiled in THUMB mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
#       option that results in lower performance and larger code size.
TCPPSRC =

# List ASM source files here
ASMSRC =
ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)

INCDIR = $(CHIBIOS)/os/license \
         $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
         $(HALINC) $(PLATFORMINC) $(BOARDINC) \
         $(STREAMSINC) $(CHIBIOS)/os/various \
         $(CHIBIOS)/os/various/cpp_wrappers \
         $(MOTORINC) $(QEIINC) $(GPIOINC) $(ADCTIMERINC) $(PIDINC) \
         $(PCA9685INC) $(VL53L0XINC) $(VL53L0XCPPINC) $(ROSINC) \
         $(TCS34725INC) \
         src

#
# Project, sources and paths
##############################################################################

##############################################################################
# Compiler settings
#

MCU  = cortex-m4

#TRGT = arm-elf-
TRGT = arm-none-eabi-
CC   = $(TRGT)gcc
CPPC = $(TRGT)g++
# Enable loading with g++ only if you need C++ runtime support.
# NOTE: You can use C++ even without C++ support if you are careful. C++
#       runtime support makes code size explode.
#LD   = $(TRGT)gcc
LD   = $(TRGT)g++
CP   = $(TRGT)objcopy
AS   = $(TRGT)gcc -x assembler-with-cpp
AR   = $(TRGT)ar
OD   = $(TRGT)objdump
SZ   = $(TRGT)size
HEX  = $(CP) -O ihex
BIN  = $(CP) -O binary

# ARM-specific options here
AOPT =

# THUMB-specific options here
TOPT = -mthumb -DTHUMB

# Define C warning options here
CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes -fdiagnostics-color=auto

# Define C++ warning options here
CPPWARN = -std=c++14 -Wall -Wextra -Wundef -fdiagnostics-color=auto

#
# Compiler settings
##############################################################################

##############################################################################
# Start of user section
#

# List all user C define here, like -D_DEBUG=1
UDEFS =

# Define ASM defines here
UADEFS =

# List all user directories here
UINCDIR =

# List the user directory to look for the libraries here
ULIBDIR =

# List all user libraries here
ULIBS =

#
# End of user defines
##############################################################################

RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC
include $(RULESPATH)/rules.mk

.PHONY: flash
flash: build/$(PROJECT).elf
	openocd -f board/st_nucleo_l476rg.cfg -c "program build/$(PROJECT).elf verify reset exit"

# vim: ts=2 sw=2 et


text:
// Copyright © Microsoft Open Technologies, Inc.
//
// All Rights Reserved
//
// 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
//
// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
// ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
// PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
//
// See the Apache License, Version 2.0 for the specific language
// governing permissions and limitations under the License.

#import "ADTokenCacheStoring.h"

@interface ADKeychainTokenCacheStore : NSObject<ADTokenCacheStoring>

/* Initializes the token cache store with default shared group value.
 */
-(id) init;
/*! Initializes the token cache store.
 @param: sharedGroup: Optional. If the application needs to share the cached tokens
 with other applications from the same vendor, the app will need to specify the
 shared group here and add the necessary entitlements to the application.
 See Apple's keychain services documentation for details. */
-(id) initWithGroup: (NSString*) sharedGroup;

/* The shared keychain group, where the ADAL library will keep the tokens.
 May be nil. The cache items from the previous keychain group are not transferred
 automatically. */
@property (getter = getSharedGroup, setter = setSharedGroup:) NSString* sharedGroup;

@end


text:
<script type="text/javascript">
    $(document).ready(function(){
        /* Uploadify Setup */
        $('#file_upload').uploadify(
        {% autoescape off %}
        {{ uploadify_options }}
        {% endautoescape %}
        );
    });
</script>
<input id="file_upload" name="file_upload" type="file" />


text:
import {ModuleWithProviders, NgModule} from '@angular/core';

import {SebmGoogleMapKmlLayer} from './directives/google-map-kml-layer';
import {SebmGoogleMap} from './directives/google-map';
import {SebmGoogleMapCircle} from './directives/google-map-circle';
import {SebmGoogleMapInfoWindow} from './directives/google-map-info-window';
import {SebmGoogleMapMarker} from './directives/google-map-marker';
import {SebmGoogleMapPolygon} from './directives/google-map-polygon';
import {SebmGoogleMapPolyline} from './directives/google-map-polyline';
import {SebmGoogleMapPolylinePoint} from './directives/google-map-polyline-point';
import {SebmGoogleStreetView} from './directives/google-street-view';
import {LazyMapsAPILoader} from './services/maps-api-loader/lazy-maps-api-loader';
import {LAZY_MAPS_API_CONFIG, LazyMapsAPILoaderConfigLiteral} from './services/maps-api-loader/lazy-maps-api-loader';
import {MapsAPILoader} from './services/maps-api-loader/maps-api-loader';
import {BROWSER_GLOBALS_PROVIDERS} from './utils/browser-globals';

/**
 * @internal
 */
export function coreDirectives() {
  return [
    SebmGoogleMap, SebmGoogleStreetView, SebmGoogleMapMarker, SebmGoogleMapInfoWindow, SebmGoogleMapCircle,
    SebmGoogleMapPolygon, SebmGoogleMapPolyline, SebmGoogleMapPolylinePoint, SebmGoogleMapKmlLayer
  ];
};

/**
 * The angular2-google-maps core module. Contains all Directives/Services/Pipes
 * of the core module. Please use `AgmCoreModule.forRoot()` in your app module.
 */
@NgModule({declarations: coreDirectives(), exports: coreDirectives()})
export class AgmCoreModule {
  /**
   * Please use this method when you register the module at the root level.
   */
  static forRoot(lazyMapsAPILoaderConfig?: LazyMapsAPILoaderConfigLiteral): ModuleWithProviders {
    return {
      ngModule: AgmCoreModule,
      providers: [
        ...BROWSER_GLOBALS_PROVIDERS, {provide: MapsAPILoader, useClass: LazyMapsAPILoader},
        {provide: LAZY_MAPS_API_CONFIG, useValue: lazyMapsAPILoaderConfig}
      ],
    };
  }
}


text:
package com.oose.chessgame.darkchessman;

import android.graphics.Bitmap;

import com.oose.darkchess.DarkChessBoard;
import com.oose.darkchess.DarkChessMan;
import com.oose.factory.DarkChessPictureList;
import com.oose.prototype.ChessMan;

public class RedCar extends DarkChessMan {

  private static final long serialVersionUID = -6745629377144249069L;

  public RedCar(int x, int y, DarkChessBoard board) {
    super(x, y, ChessMan.RED, board, 4);
  }

  public RedCar(RedCar rc) {
    super(rc);
  }

  @Override
  public RedCar clone() throws CloneNotSupportedException {
    return new RedCar(this);
  }

  @Override
  public Bitmap getIcon() {

    if (this.visible)
      return DarkChessPictureList.getIcon(this.getClass().getName());

    else
      return DarkChessPictureList.getIcon("com.oose.chessgame.darkchessman.UnFlip");
  }

  @Override
  public Bitmap getSelectedIcon() {
    if (this.visible)
      return DarkChessPictureList.getIcon(this.getClass().getName() + "SELECTED");
    else
      return DarkChessPictureList.getIcon("com.oose.chessgame.darkchessman.UnFlip" + "SELECTED");
  }

}


text:
package vo.goods;

public class ThumbnailVo {
	private String thumbnailId;

	private String goodsId;

	private String path;

	public String getThumbnailId() {
		return thumbnailId;
	}

	public void setThumbnailId(String thumbnailId) {
		this.thumbnailId = thumbnailId;
	}

	public String getGoodsId() {
		return goodsId;
	}

	public void setGoodsId(String goodsId) {
		this.goodsId = goodsId;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}
}


text:
/// <reference path="../../../dist/preview release/babylon.d.ts" />

module BABYLON {
    interface WorkerInfo {
        worker: Worker;
        active: boolean;
    }

    /**
     * Helper class to push actions to a pool of workers.
     */
    export class WorkerPool implements IDisposable {
        private _workerInfos: Array<WorkerInfo>;
        private _pendingActions = new Array<(worker: Worker, onComplete: () => void) => void>();

        /**
         * Constructor
         * @param workers Array of workers to use for actions
         */
        constructor(workers: Array<Worker>) {
            this._workerInfos = workers.map(worker => ({
                worker: worker,
                active: false
            }));
        }

        /**
         * Terminates all workers and clears any pending actions.
         */
        public dispose(): void {
            for (const workerInfo of this._workerInfos) {
                workerInfo.worker.terminate();
            }

            delete this._workerInfos;
            delete this._pendingActions;
        }

        /**
         * Pushes an action to the worker pool. If all the workers are active, the action will be
         * pended until a worker has completed its action.
         * @param action The action to perform. Call onComplete when the action is complete.
         */
        public push(action: (worker: Worker, onComplete: () => void) => void): void {
            for (const workerInfo of this._workerInfos) {
                if (!workerInfo.active) {
                    this._execute(workerInfo, action);
                    return;
                }
            }

            this._pendingActions.push(action);
        }

        private _execute(workerInfo: WorkerInfo, action: (worker: Worker, onComplete: () => void) => void): void {
            workerInfo.active = true;
            action(workerInfo.worker, () => {
                workerInfo.active = false;
                const nextAction = this._pendingActions.shift();
                if (nextAction) {
                    this._execute(workerInfo, nextAction);
                }
            });
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Text;

namespace issue138StackOverflowExceptiononMono
{
	public enum MessagePriority { Low = 0, High }

	public abstract class TrackerBase : IDisposable
	{
		public abstract void Dispose();

		public abstract void Log(string name, string val, MessagePriority priority = MessagePriority.Low);
		public abstract void FlushMessages();

		public void Log(Exception exc)
		{
			Log("Exception", exc.ToString(), MessagePriority.High);
		}

		public void Log(string name, object val, MessagePriority priority = MessagePriority.Low)
		{
			Log(name, val.ToString(), priority);
		}

		public void Log(string name, double val, MessagePriority priority = MessagePriority.Low)
		{
			Log(name, val.ToString(CultureInfo.InvariantCulture), priority);
		}

		public void Log(string name, float val, MessagePriority priority = MessagePriority.Low)
		{
			Log(name, val.ToString(CultureInfo.InvariantCulture), priority);
		}

		public void Log(string name, decimal val, MessagePriority priority = MessagePriority.Low)
		{
			Log(name, val.ToString(CultureInfo.InvariantCulture), priority);
		}

		public void Log(string name, long val, MessagePriority priority = MessagePriority.Low)
		{
			Log(name, val.ToString(CultureInfo.InvariantCulture), priority);
		}

		public void Log(string name, ulong val, MessagePriority priority = MessagePriority.Low)
		{
			Log(name, val.ToString(CultureInfo.InvariantCulture), priority);
		}

		public void LogFormat(string name, MessagePriority priority, string format, params object[] args)
		{
			var text = string.Format(CultureInfo.InvariantCulture, format, args);
			Log(name, text, priority);
		}

		public void LogFormat(string name, string format, params object[] args)
		{
			LogFormat(name, MessagePriority.Low, format, args);
		}

		public Stopwatch StartMeasure()
		{
			return Stopwatch.StartNew();
		}

		public void EndMeasure(Stopwatch watch, string label)
		{
			var diff = watch.Elapsed;
			watch.Stop();

			LogLatency(label, diff.TotalSeconds);
		}

		public void LogLatency(string label, double value)
		{
			Log("Latency " + label, value);
		}
	}
}


text:
package com.cloudhopper.commons.util.windowing;

/**
 * A {@link WindowFuture} is either uncompleted or completed.
 * When an operation begins, a new future object is created.  The new future
 * is uncompleted initially - it is neither succeeded, failed, nor cancelled
 * because the operation is not finished yet.  If the operation is
 * finished either successfully, with failure, or by cancellation, the future is
 * marked as completed with more specific information, such as the cause of the
 * failure.  Please note that even failure and cancellation belong to the
 * completed state.
 *

 *                                      +---------------------------+
 *                                      | Completed successfully    |
 *                                      +---------------------------+
 *                                 +---->      isDone() = true      |
 * +--------------------------+    |    |   isSuccess() = true      |
 * |        Uncompleted       |    |    +===========================+
 * +--------------------------+    |    | Completed with failure    |
 * |      isDone() = false    |    |    +---------------------------+
 * |   isSuccess() = false    |----+---->   isDone() = true         |
 * | isCancelled() = false    |    |    | getCause() = non-null     |
 * |    getCause() = null     |    |    +===========================+
 * +--------------------------+    |    | Completed by cancellation |
 *                                 |    +---------------------------+
 *                                 +---->      isDone() = true      |
 *                                      | isCancelled() = true      |
 *                                      +---------------------------+
 *

 *
 * @author joelauer (twitter: @jjlauer or http://twitter.com/jjlauer)
 */
public interface WindowFuture<K,R,P> {

    /** The caller is not waiting on this entry */
    static public final int CALLER_NOT_WAITING = 0;
    /** The caller is waiting on this entry */
    static public final int CALLER_WAITING = 1;
    /** The caller was waiting, but gave up (timeout) */
    static public final int CALLER_WAITING_TIMEOUT = 2;

    /**
     * Gets the key of the window entry.
     * @return The key of the window entry.
     */
    public K getKey();

    /**
     * Gets the request contained in the window entry.
     * @return The request contained in the window entry.
     */
    public R getRequest();

    /**
     * Gets the response associated with the window entry.
     * @return The response associated with he request or null if no response
     *      has been received.
     */
    public P getResponse();

    /**
     * Returns {@code true} if and only if this future is
     * complete, regardless of whether the operation was successful, failed,
     * or cancelled.
     */
    public boolean isDone();

    /**
     * Returns {@code true} if and only if the operation was completed
     * successfully.
     */
    public boolean isSuccess();

    /**
     * Returns the cause of the failed operation if the operation has
     * failed.
     *
     * @return the cause of the failure.
     *         {@code null} if succeeded or this future is not
     *         completed yet.
     */
    public Throwable getCause();

    /**
     * Returns {@code true} if and only if this future was cancelled by a
     * cancel() method.
     */
    public boolean isCancelled();

    /**
     * Gets a hint of the caller state such as whether the caller is waiting, not
     * waiting, or timed out while waiting for completion.
     * @return The hint of the state of the caller
     */
    public int getCallerStateHint();

    /**
     * Returns {@code true} if and only if the caller hinted at "WAITING" for
     * completion.  Returns {@code false} if the caller either did not hint
     * at planning on "WAITING" or did wait but timed out and gave up. Please
     * note that even if this returns true, it does not mean the caller is
     * actively waiting since this merely represents a hint.
     */
    public boolean isCallerWaiting();

    /**
     * Returns the size of the window (number of requests in it) after this
     * request was added.  Useful for calculating an estimated response time
     * just for this request.
     * @return The size of the window after this request was added.
     */
    public int getWindowSize();

    /**
     * Returns true if an expire timestamp value exists (> 0).
     * @return True if an expire timestamp exists
     */
    public boolean hasExpireTimestamp();

    /**
     * Gets the expire timestamp in milliseconds.  The expire timestamp is when
     * the request expires unless this optional field was not set.
     * @return The expire timestamp or <= 0 if it doesn't exist.
     * @see #hasExpireTimestamp()
     */
    public long getExpireTimestamp();

    /**
     * Gets the offer timestamp in milliseconds.  The offer timestamp is when
     * the request was offered for acceptance to the window.
     * @return The offer timestamp
     */
    public long getOfferTimestamp();

    /**
     * Gets the accept timestamp in milliseconds. The accept timestamp is when
     * the request was accepted by the window.
     * @return The accept timestamp
     */
    public long getAcceptTimestamp();

    /**
     * Gets the amount of time (in ms) from offer to accept.
     * @return The amount of time from offer to accept
     */
    public long getOfferToAcceptTime();

    /**
     * Returns true if a done timestamp value exists (> 0).
     * @return True if a done timestamp exists
     */
    public boolean hasDoneTimestamp();

    /**
     * Gets the done timestamp in milliseconds. The done timestamp is when
     * the request has been completed.
     * @return The done timestamp
     */
    public long getDoneTimestamp();

    /**
     * Gets the amount of time (in ms) from offer to done or -1 if a done
     * timestamp does not yet exist.
     * @return The amount of time from offer to done
     */
    public long getOfferToDoneTime();

    /**
     * Gets the amount of time (in ms) from accept to done or -1 if a done
     * timestamp does not yet exist.
     * @return The amount of time from accept to done
     */
    public long getAcceptToDoneTime();

    /**
     * Completes (as a success) a request by setting the response. This method
     * will set the done timestamp to System.currentTimeMillis().
     * @param response The response for the associated request
     */
    public void complete(P response);

    /**
     * Completes (as a success) a request by setting the response.
     * @param response The response for the associated request
     * @param doneTimestamp The timestamp when the request completed
     */
    public void complete(P response, long doneTimestamp);

    /**
     * Completes (as a failure) a request by setting a throwable as the cause
     * of failure. This method will set the done timestamp to System.currentTimeMillis()
     * @param t The throwable as the cause of failure
     */
    public void fail(Throwable t);

    /**
     * Completes (as a failure) a request by setting a throwable as the cause
     * of failure.
     * @param t The throwable as the cause of failure
     * @param doneTimestamp The timestamp when the request failed
     */
    public void fail(Throwable t, long doneTimestamp);

    /**
     * Completes (as a cancel) a request. This method will set the done timestamp
     * to System.currentTimeMillis().
     */
    public void cancel();

    /**
     * Completes (as a cancel) a request.
     * @param doneTimestamp The timestamp when the request was cancelled
     */
    public void cancel(long doneTimestamp);

    /**
     * Waits for this future to be completed within the amount of time remaining
     * from the original offerTimeoutMillis minus the amount of time it took
     * for the Window to accept the offer. For example, if Window.offer was
     * called with an offerTimeoutMillis of 5000 milliseconds and it took
     * 1000 milliseconds for the Window to accept the offer, then this method
     * would wait for 4000 milliseconds.
     * @return True if and only if the future was completed within the specified
     *      time limit
     * @throws InterruptedException Thrown if the current thread was interrupted
     */
    public boolean await() throws InterruptedException;

    /**
     * Waits for this future to be completed within the specified time limit.
     * @param timeoutMillis The amount of milliseconds to wait
     * @return True if and only if the future was completed within the specified
     *      time limit
     * @throws InterruptedException Thrown if the current thread was interrupted
     */
    public boolean await(long timeoutMillis) throws InterruptedException;
}


text:
from django.conf.urls import patterns, include, url
from session import views as sessionViews
import views as baseViews
from session import views_cache as cacheViews

urlpatterns = patterns('',
    url(r'^$', baseViews.home),

    url(r'^api/createcorpus', sessionViews.startCreateCorpus),
    url(r'^api/exit', sessionViews.exit_application),
    url(r'^api/activesessions', sessionViews.getActiveSessions),
    url(r'^api/sessions', sessionViews.getSessions),
    url(r'^api/session', sessionViews.getSession),
    url(r'^api/corpus/pause', sessionViews.pauseCorpus),
    url(r'^api/corpus/remove', sessionViews.removeCorpus),
    url(r'^api/corpus/resume', sessionViews.resumeCorpus),
    url(r'^api/corpus/download', sessionViews.downloadCorpus),
    url(r'^api/corpus/recreate', sessionViews.recreateCorpus),

    url(r'^api/corpus/cache/status', cacheViews.cacheStatus),
    url(r'^api/corpus/cache/clear', cacheViews.clearCache),

    url(r'^api/settings/tweets_per_xml/get', baseViews.get_tweets_per_xml),
    url(r'^api/settings/tweets_per_xml/set', baseViews.set_tweets_per_xml),

    url(r'^api/converters/', baseViews.converters_list),
    url(r'^st/*', baseViews.static)
)


text:
package org.fcrepo.kernel.impl.models;

import org.fcrepo.kernel.api.identifiers.FedoraId;
import org.fcrepo.kernel.api.models.FedoraResource;
import org.fcrepo.kernel.api.models.ResourceFactory;
import org.fcrepo.kernel.api.models.TimeMap;
import org.fcrepo.kernel.api.services.VersionService;
import org.fcrepo.persistence.api.PersistentStorageSessionManager;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;

import java.time.Instant;
import java.util.ArrayList;

import static org.fcrepo.kernel.api.FedoraTypes.FCR_VERSIONS;
import static org.fcrepo.kernel.api.FedoraTypes.FEDORA_ID_PREFIX;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;

@RunWith(MockitoJUnitRunner.Silent.class)
public class FedoraResourceImplTest {

    @Mock
    private TimeMap timeMap;

    @Mock
    private PersistentStorageSessionManager sessionManager;

    @Mock
    private ResourceFactory resourceFactory;

    private static final String ID = "info:fedora/test";

    private static final FedoraId FEDORA_ID = FedoraId.create(ID);

    @Test
    public void findMementoWhenOnlyOneAndBeforeSearch() {
        final var resource = resourceWithMockedTimeMap();
        expectMementos("20200309172117");
        final var match = resource.findMementoByDatetime(instant("20200309172118"));
        assertEquals(FEDORA_ID_PREFIX + "/0", match.getId());
    }

    @Test
    public void findClosestMementoWhenMultiple() {
        final var resource = resourceWithMockedTimeMap();
        expectMementos("20200309172117", "20200309172118", "20200309172119");
        final var match = resource.findMementoByDatetime(instant("20200309172118"));
        assertEquals(FEDORA_ID_PREFIX + "/1", match.getId());
    }

    @Test
    public void findClosestMementoWhenMultipleNoneExact() {
        final var resource = resourceWithMockedTimeMap();
        expectMementos("20200309172116", "20200309172117", "20200309172119");
        final var match = resource.findMementoByDatetime(instant("20200309172118"));
        assertEquals(FEDORA_ID_PREFIX + "/1", match.getId());
    }

    @Test
    public void findClosestMementoMultipleSameSecond() {
        final var resource = resourceWithMockedTimeMap();
        expectMementos("20200309172117", "20200309172117", "20200309172117");
        final var match = resource.findMementoByDatetime(instant("20200309172118"));
        assertEquals(FEDORA_ID_PREFIX + "/2", match.getId());
    }

    @Test
    public void findMementoWhenNonBeforeSearch() {
        final var resource = resourceWithMockedTimeMap();
        expectMementos("20200309172119", "20200309172120", "20200309172121");
        final var match = resource.findMementoByDatetime(instant("20200309172118"));
        assertEquals(FEDORA_ID_PREFIX + "/0", match.getId());
    }

    @Test
    public void findNoMementoWhenThereAreNone() {
        final var resource = resourceWithMockedTimeMap();
        expectMementos();
        final var match = resource.findMementoByDatetime(instant("20200309172118"));
        assertNull("Should not find a memento", match);
    }

    private void expectMementos(final String... instants) {
        final var mementos = new ArrayList<FedoraResource>(instants.length);
        for (int i = 0; i < instants.length; i++) {
            mementos.add(memento(String.valueOf(i), instant(instants[i])));
        }
        when(timeMap.getChildren()).thenReturn(mementos.stream());
    }

    private FedoraResource resourceWithMockedTimeMap() {
        final var resource = spy(new FedoraResourceImpl(FEDORA_ID, null, sessionManager, resourceFactory));
        doReturn(timeMap).when(resource).getTimeMap();
        return resource;
    }

    private FedoraResource memento(final String id, final Instant instant) {
        final String mementoTime = VersionService.MEMENTO_LABEL_FORMATTER.format(instant);
        final FedoraId fedoraID = FedoraId.create(id, FCR_VERSIONS, mementoTime);
        final var memento = new FedoraResourceImpl(fedoraID, null, sessionManager, resourceFactory);
        memento.setIsMemento(true);
        memento.setMementoDatetime(instant);
        return memento;
    }

    private Instant instant(final String timestamp) {
        return Instant.from(VersionService.MEMENTO_LABEL_FORMATTER.parse(timestamp));
    }

}


text:
'use strict';

const assert = require('assert');
const packets = require('../../../lib/packets/index.js');

let buf = Buffer.from('0a000004000007dd070116010203', 'hex');

let packet = new packets.Packet(4, buf, 0, buf.length);
packet.readInt16(); // unused
let d = packet.readDateTime('Z');

assert.equal(+d, 1358816523000);

buf = Buffer.from(
  '18000006000004666f6f310be00702090f01095d7f06000462617231',
  'hex'
);
packet = new packets.Packet(6, buf, 0, buf.length);

packet.readInt16(); // ignore
const s = packet.readLengthCodedString('cesu8');
assert.equal(s, 'foo1');
d = packet.readDateTime('Z');
assert.equal(+d, 1455030069425);

const s1 = packet.readLengthCodedString('cesu8');
assert.equal(s1, 'bar1');
assert.equal(packet.offset, packet.end);


text:
package org.wso2.andes.jndi;

import javax.naming.CompositeName;
import javax.naming.Name;
import javax.naming.NameParser;
import javax.naming.NamingException;

/**
 * A default implementation of {@link NameParser}
 * <p/>
 * Based on class from ActiveMQ.
 */
public class NameParserImpl implements NameParser
{
    public Name parse(String name) throws NamingException
    {
        return new CompositeName(name);
    }
}


text:
///////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2012-2013 DreamWorks Animation LLC
//
// All rights reserved. This software is distributed under the
// Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ )
//
// Redistributions of source code must retain the above copyright
// and license notice and the following restrictions and disclaimer.
//
// *     Neither the name of DreamWorks Animation nor the names of
// its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY 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.
// IN NO EVENT SHALL THE COPYRIGHT HOLDERS' AND CONTRIBUTORS' AGGREGATE
// LIABILITY FOR ALL CLAIMS REGARDLESS OF THEIR BASIS EXCEED US$250.00.
//
///////////////////////////////////////////////////////////////////////////

#ifndef OPENVDB_MATH_HERMITE_HAS_BEEN_INCLUDED
#define OPENVDB_MATH_HERMITE_HAS_BEEN_INCLUDED

#include <openvdb/Platform.h>
#include <openvdb/version.h>
#include "QuantizedUnitVec.h"
#include "Math.h"

namespace openvdb {
OPENVDB_USE_VERSION_NAMESPACE
namespace OPENVDB_VERSION_NAME {
namespace math {

// Forward declaration
class Hermite;

////////////////////////////////////////

// Utility methods

//@{
/// min and max operations done directly on the compressed data.
OPENVDB_API Hermite min(const Hermite&, const Hermite&);
OPENVDB_API Hermite max(const Hermite&, const Hermite&);
//@}

////////////////////////////////////////

/// @brief Quantized Hermite data object that stores compressed intersection
/// information (offsets and normlas) for the up-wind edges of a voxel. (Size 10 bytes)
class OPENVDB_API Hermite
{
public:

    Hermite();
    Hermite(const Hermite&);
    const Hermite& operator=(const Hermite&);

    /// clears all intersection data
    void clear();

    /// @return true if this Hermite objet has any edge intersection data.
    operator bool() const;

    /// equality operator
    inline bool operator==(const Hermite&) const;
    /// inequality operator
    bool operator!=(const Hermite& rhs) const { return !(*this == rhs); }

    /// unary negation operator, flips inside/outside state and normals.
    Hermite operator-() const;

    //@{
    /// @brief methods to compress and store edge data.
    /// @note @c offset is expected to be in the [0 to 1) range.
    template <typename T>
    void setX(T offset, const Vec3<T>&);

    template <typename T>
    void setY(T offset, const Vec3<T>&);

    template <typename T>
    void setZ(T offset, const Vec3<T>&);
    //@}

    /// @return true if the current Hermite object is classified
    // as being inside a contour.
    bool isInside() const { return MASK_SIGN & mData; }
    /// Set the inside/outside state to reflect if this Hermite object
    /// is located at a point in space that is inside/outside a contour.
    void setIsInside(bool);

    //@{
    /// @return true if this Hermite object has intersection data
    /// for the corresponding edge.
    bool hasOffsetX() const { return mXNormal; };
    bool hasOffsetY() const { return mYNormal; }
    bool hasOffsetZ() const { return MASK_ZFLAG & mData; }
    //@}

    //@{
    /// Edge offset greater-than comparisson operators
    /// @note is @c this offset > than @c other offset
    bool isGreaterX(const Hermite& other) const;
    bool isGreaterY(const Hermite& other) const;
    bool isGreaterZ(const Hermite& other) const;
    //@}

    //@{
    /// Edge offset less-than comparisson operators
    /// @note is @c this offset < than @c other offset
    bool isLessX(const Hermite& other) const;
    bool isLessY(const Hermite& other) const;
    bool isLessZ(const Hermite& other) const;
    //@}

    //@{
    /// @return uncompressed edge intersection offsets
    float getOffsetX() const;
    float getOffsetY() const;
    float getOffsetZ() const;
    //@}

    //@{
    /// @return uncompressed edge intersection normals
    Vec3s getNormalX() const { return QuantizedUnitVec::unpack(mXNormal); }
    Vec3s getNormalY() const { return QuantizedUnitVec::unpack(mYNormal); }
    Vec3s getNormalZ() const { return QuantizedUnitVec::unpack(mZNormal); }
    //@}

    //@{
    /// copy edge data from other Hermite object
    /// @note copies data in the compressed form
    void setX(const Hermite&);
    void setY(const Hermite&);
    void setZ(const Hermite&);
    //@}

    /// String representation.
    std::string str() const;

    /// Unserialize this transform from the given stream.
    void read(std::istream&);
    /// Serialize this transform to the given stream.
    void write(std::ostream&) const;

    //@{
    /// Operators required by OpenVDB.
    /// @note These methods don't perform meaningful operations on Hermite data.
    bool operator< (const Hermite&) const { return false; };
    bool operator> (const Hermite&) const { return false; };
    template<class T> Hermite operator+(const T&) const { return *this; }
    template<class T> Hermite operator-(const T&) const { return *this; }
    //@}

private:
    /// Helper function that quantizes a [0, 1) offset using 10-bits.
    template <typename T>
    static uint32_t quantizeOffset(T offset);

    /// Helper function that returns (signed) compressed-offsets,
    /// used by comparisson operators.
    static void getSignedOffsets(const Hermite& lhs, const Hermite& rhs,
        const uint32_t bitmask, int& lhsV, int& rhsV);

    // Bits masks
    // 10000000000000000000000000000000
    static const uint32_t MASK_SIGN  = 0x80000000;
    // 01000000000000000000000000000000
    static const uint32_t MASK_ZFLAG = 0x40000000;
    // 00111111111100000000000000000000
    static const uint32_t MASK_XSLOT = 0x3FF00000;
    // 00000000000011111111110000000000
    static const uint32_t MASK_YSLOT = 0x000FFC00;
    // 00000000000000000000001111111111
    static const uint32_t MASK_ZSLOT = 0x000003FF;
    // 00111111111111111111111111111111
    static const uint32_t MASK_SLOTS = 0x3FFFFFFF;

    uint16_t mXNormal, mYNormal, mZNormal;
    uint32_t mData;

}; // class Hermite

////////////////////////////////////////

//  output-stream insertion operator

inline std::ostream&
operator<<(std::ostream& ostr, const Hermite& rhs)
{
    ostr << rhs.str();
    return ostr;
}

////////////////////////////////////////

// construction and assignment

inline const Hermite&
Hermite::operator=(const Hermite& rhs)
{
    mData = rhs.mData;
    mXNormal = rhs.mXNormal;
    mYNormal = rhs.mYNormal;
    mZNormal = rhs.mZNormal;
    return *this;
}

inline void
Hermite::clear()
{
    mXNormal = 0;
    mYNormal = 0;
    mZNormal = 0;
    mData = 0;
}

////////////////////////////////////////

//  bool operator and equality

inline
Hermite::operator bool() const
{
    if (0 != (mXNormal | mYNormal)) return true;
    return hasOffsetZ();
}

inline bool
Hermite::operator==(const Hermite& rhs) const
{
    if(mXNormal != rhs.mXNormal) return false;
    if(mYNormal != rhs.mYNormal) return false;
    if(mZNormal != rhs.mZNormal) return false;
    return mData == rhs.mData;
}

////////////////////////////////////////

// unary negation operator

inline Hermite
Hermite::operator-() const
{
    Hermite ret(*this);
    QuantizedUnitVec::flipSignBits(ret.mXNormal);
    QuantizedUnitVec::flipSignBits(ret.mYNormal);
    QuantizedUnitVec::flipSignBits(ret.mZNormal);
    ret.mData = (~MASK_SIGN & ret.mData) | (MASK_SIGN & ~ret.mData);
    return ret;
}

////////////////////////////////////////

// Helper funcions

template <typename T>
inline uint32_t
Hermite::quantizeOffset(T offset)
{
    // the offset is expected to be normalized [0 to 1)
    assert(offset < 1.0);
    assert(offset > -1.0e-8);

    // quantize the offset using 10-bits. (higher bits are masked out)
    return uint32_t(1023 * offset) & MASK_ZSLOT;
}

inline void
Hermite::getSignedOffsets(const Hermite& lhs, const Hermite& rhs,
    const uint32_t bitmask, int& lhsV, int& rhsV)
{
    lhsV = bitmask & lhs.mData;
    rhsV = bitmask & rhs.mData;

    if(lhs.isInside()) lhsV = -lhsV;
    if(rhs.isInside()) rhsV = -rhsV;
}

////////////////////////////////////////

// compress and set edge data

template <typename T>
inline void
Hermite::setX(T offset, const Vec3<T>& n)
{
    mData &= ~MASK_XSLOT; // clear xslot
    mData |= quantizeOffset(offset) << 20;
    mXNormal = QuantizedUnitVec::pack(n);
}

template <typename T>
inline void
Hermite::setY(T offset, const Vec3<T>& n)
{
    mData &= ~MASK_YSLOT; // clear yslot
    mData |= quantizeOffset(offset) << 10;
    mYNormal = QuantizedUnitVec::pack(n);
}

template <typename T>
inline void
Hermite::setZ(T offset, const Vec3<T>& n)
{
    mData &= ~MASK_ZSLOT; // clear zslot
    mData |= MASK_ZFLAG | quantizeOffset(offset);
    mZNormal = QuantizedUnitVec::pack(n);
}

////////////////////////////////////////

// change inside/outside state

inline void
Hermite::setIsInside(bool isInside)
{
    mData &= ~MASK_SIGN; // clear sign-bit
    mData |= uint32_t(isInside) * MASK_SIGN;
}

////////////////////////////////////////

// Uncompress and return the edge intersection-offsets
// 0.000977517 = 1.0 / 1023

inline float
Hermite::getOffsetX() const
{
    return float((mData >> 20) & MASK_ZSLOT) * 0.000977517;
}

inline float
Hermite::getOffsetY() const
{
    return float((mData >> 10) & MASK_ZSLOT) * 0.000977517;
}

inline float
Hermite::getOffsetZ() const
{
    return float(mData & MASK_ZSLOT) * 0.000977517;
}

////////////////////////////////////////

// copy compressed edge data from other object

inline void
Hermite::setX(const Hermite& rhs)
{
    mData &= ~MASK_XSLOT; // clear xslot
    mData |= MASK_XSLOT & rhs.mData; // copy xbits from rhs
    mXNormal = rhs.mXNormal; // copy compressed normal

    // Flip the copied normal if the rhs object has
    // a different inside/outside state.
    if(hasOffsetX() && isInside() != rhs.isInside())
        QuantizedUnitVec::flipSignBits(mXNormal);
}

inline void
Hermite::setY(const Hermite& rhs)
{
    mData &= ~MASK_YSLOT;
    mData |= MASK_YSLOT & rhs.mData;
    mYNormal = rhs.mYNormal;

    if(hasOffsetY() && isInside() != rhs.isInside())
        QuantizedUnitVec::flipSignBits(mYNormal);
}

inline void
Hermite::setZ(const Hermite& rhs)
{
    mData &= ~MASK_ZSLOT;
    mData |= (MASK_ZFLAG | MASK_ZSLOT) & rhs.mData;
    mZNormal = rhs.mZNormal;
    if(hasOffsetZ() && isInside() != rhs.isInside())
        QuantizedUnitVec::flipSignBits(mZNormal);
}

////////////////////////////////////////

// edge comparison operators

inline bool
Hermite::isGreaterX(const Hermite& rhs) const
{
    int lhsV, rhsV;
    getSignedOffsets(*this, rhs, MASK_XSLOT, lhsV, rhsV);
    return lhsV > rhsV;
}

inline bool
Hermite::isGreaterY(const Hermite& rhs) const
{
    int lhsV, rhsV;
    getSignedOffsets(*this, rhs, MASK_YSLOT, lhsV, rhsV);
    return lhsV > rhsV;
}

inline bool
Hermite::isGreaterZ(const Hermite& rhs) const
{
    int lhsV, rhsV;
    getSignedOffsets(*this, rhs, MASK_ZSLOT, lhsV, rhsV);
    return lhsV > rhsV;
}

inline bool
Hermite::isLessX(const Hermite& rhs) const
{
    int lhsV, rhsV;
    getSignedOffsets(*this, rhs, MASK_XSLOT, lhsV, rhsV);
    return lhsV < rhsV;
}

inline bool
Hermite::isLessY(const Hermite& rhs) const
{
    int lhsV, rhsV;
    getSignedOffsets(*this, rhs, MASK_YSLOT, lhsV, rhsV);
    return lhsV < rhsV;
}

inline bool
Hermite::isLessZ(const Hermite& rhs) const
{
    int lhsV, rhsV;
    getSignedOffsets(*this, rhs, MASK_ZSLOT, lhsV, rhsV);
    return lhsV < rhsV;
}

////////////////////////////////////////

inline bool
isApproxEqual(const Hermite& lhs, const Hermite& rhs) { return lhs == rhs; }

inline bool
isApproxEqual(const Hermite& lhs, const Hermite& rhs, const Hermite& /*tolerance*/)
    { return isApproxEqual(lhs, rhs); }

} // namespace math

////////////////////////////////////////

template<> inline math::Hermite zeroVal<math::Hermite>() { return math::Hermite(); }

} // namespace OPENVDB_VERSION_NAME
} // namespace openvdb

#endif // OPENVDB_MATH_HERMITE_HAS_BEEN_INCLUDED

// Copyright (c) 2012-2013 DreamWorks Animation LLC
// All rights reserved. This software is distributed under the
// Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ )


text:
license: >
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you 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.

title: SplashScreen
---

# SplashScreen

> Zeigt und verbirgt Begrüßungsbildschirm der Anwendung.

## Methoden

*   [SplashScreen.Show](splashscreen.show.html)
*   [SplashScreen.Hide](splashscreen.hide.html)

## Zugriff auf die Funktion

Ab Version 3.0 implementiert Cordova Geräteebene APIs als *Plugins*. Verwenden Sie der CLI `plugin` Befehl, beschrieben in der Command-Line Interface, hinzufügen oder Entfernen dieses Feature für ein Projekt:

        $ cordova plugin add org.apache.cordova.splashscreen
        $ cordova plugin ls
        [ 'org.apache.cordova.splashscreen' ]
        $ cordova plugin rm org.apache.cordova.splashscreen

Diese Befehle gelten für alle Zielplattformen, aber die unten beschriebenen Plattform-spezifische Konfigurationseinstellungen ändern:

*   Android (in`app/res/xml/config.xml`)

        <feature name="SplashScreen">
            <param name="android-package" value="org.apache.cordova.SplashScreen" />
        </feature>

*   iOS (in`config.xml`)

        <feature name="SplashScreen">
            <param name="ios-package" value="CDVSplashScreen" />
        </feature>

Einige Plattformen können dieses Feature unterstützen, ohne dass eine besondere Konfiguration. Finden Sie unter *Plattform-Unterstützung* in der [Übersicht](../../guide/overview/index.html).

Informationen zum konfiguriert diese Bilder finden Sie unter [Symbole und Splash-Screens](../../config_ref/images.html).


text:
namespace MuddledManaged
{
    namespace Protocol
    {
        class EnumModel : public Nestable, public OptionModelContainer, public EnumValueModelContainer
        {
        public:
            explicit EnumModel (const std::string & name);

            EnumModel (const EnumModel & src);

            EnumModel & operator = (const EnumModel & rhs);
        };

    } // namespace Protocol

} // namespace MuddledManaged

#endif // Protocol_EnumModel_h


text:
require 'spec_helper'

describe A1508kiIka do
  it 'has a version number' do
    expect(A1508kiIka::VERSION).not_to be nil
  end

  it 'does something useful' do
    expect(false).to eq(true)
  end
end


text: Convenient HTML page generator for debug purposes in C#


text:
require 'spec_helper'

RSpec.describe Packer::DataObject do
  let(:dataobject)            { Packer::DataObject.new }
  let(:some_string)           { 'some string' }
  let(:keys)                  { %w[key1 key2] }
  let(:some_array_of_strings) { %w[value1 value2 value3] }
  let(:some_array_of_ints)    { [1, 2, 3] }
  let(:some_hash_of_mixed)    { { 'a' =>  1,  'b' =>  2  } }
  let(:some_hash_of_strings)  { { 'a' => '1', 'b' => '2' } }
  let(:in_commands_strings)   { [["command1", "1"], ["command2", "2"]] }
  let(:in_commands_mixed)     { [["command1",  1 ], ["command2",  2 ]] }
  let(:out_commands_strings)  { [["command1", "1"], ["command2", "2"]] }

  describe "#initialize" do
    it 'has a data hash' do
      expect(dataobject.data).to eq({})
    end
  end

  describe '#add_required' do
    it 'tracks required settings' do
      dataobject.add_required('a', 'b')
      dataobject.add_required(['c', 'd'])
      expect(dataobject.required).to eq(['a', 'b', ['c', 'd']])
    end
  end

  describe '#validate' do
    it 'returns true when all required settings are present' do
      dataobject.add_required('key')
      dataobject.__add_string('key', 'value')
      expect(dataobject.validate).to be_truthy
      dataobject.data = []
      dataobject.required = []
    end

    it 'raises an error when a required setting is missing' do
      dataobject.add_required('key')
      expect { dataobject.validate }.to raise_error
      dataobject.data = []
      dataobject.required = []
    end

    it 'returns true when exactly one setting from an exclusive set is preset' do
      dataobject.add_required(['key1', 'key2'])
      dataobject.__add_string('key1', 'value')
      expect(dataobject.validate).to be_truthy
      dataobject.data = []
      dataobject.required = []
    end

    it 'raises an error when no settings from an exclusive set are present' do
      dataobject.add_required(['key1', 'key2'])
      expect { dataobject.validate }.to raise_error
      dataobject.data = []
      dataobject.required = []
    end

    it 'raises an error when more than one setting from an exclusive set is present' do
      dataobject.add_required(['key1', 'key2'])
      dataobject.__add_string('key1', 'value')
      dataobject.__add_string('key2', 'value')
      expect { dataobject.validate }.to raise_error
      dataobject.data = []
      dataobject.required = []
    end

    it 'returns true when there are no required settings to validate' do
      expect(dataobject.validate).to be_truthy
    end
  end

  describe '#deep_copy' do
    it 'retuns a full copy of the data structure' do
      dataobject.__add_string('key', 'foo')
      copy = dataobject.deep_copy
      expect(copy).to eq(dataobject.data)
      expect(copy).not_to be(dataobject.data)
      copy['key'] << 'bar'
      expect(copy).not_to eq(dataobject.data)
      dataobject.data.delete('key')
    end
  end

  describe "#__exclusive_key_error" do
    it 'returns true when the key is exclusive' do
      dataobject.data[keys[0]] = 'value'
      expect(dataobject.__exclusive_key_error(keys[0], keys[1..-1])).to be_truthy
      dataobject.data.delete(keys[0])
    end

    it 'raises an error when the key is not exclusive' do
      dataobject.data[keys[0]] = 'value'
      dataobject.data[keys[1]] = 'value'
      expect { dataobject.__exclusive_key_error(keys[0], keys[1..-1]) }.to raise_error
      dataobject.data.delete(keys)
    end
  end

  describe '#__add_array_of_strings' do
    it 'assigns an array of strings to key' do
      dataobject.__add_array_of_strings('key', some_array_of_strings)
      expect(dataobject.data['key']).to eq(some_array_of_strings)
      dataobject.data.delete('key')
    end

    it 'converts an array of non-strings to strings and assigns them to key' do
      dataobject.__add_array_of_strings('key', some_array_of_ints)
      expect(dataobject.data['key']).to eq(some_array_of_ints.map(&:to_s))
      dataobject.data.delete('key')
    end

    it 'raises an error if the values cannot be turned in to an Array' do
      expect { dataobject.__add_array_of_strings('key', 'some string') }.to raise_error
    end
  end

  describe "#__add_array_of_array_of_strings" do
    it 'assigns an array of array of strings to key' do
      dataobject.__add_array_of_array_of_strings('key', in_commands_strings)
      expect(dataobject.data['key']).to eq(out_commands_strings)
      dataobject.data.delete('key')
    end

    it 'converts non-strings to strings in the sub-arrays during assignment to key' do
      dataobject.__add_array_of_array_of_strings('key', in_commands_mixed)
      expect(dataobject.data['key']).to eq(out_commands_strings)
      dataobject.data.delete('key')
    end

    it 'raises an error if the values argument is not an array' do
      expect { dataobject.__add_array_of_array_of_strings('key', 'some string') }.to raise_error
    end

    it 'raises an error if any element in the values argument is not an array' do
      expect { dataobject.__add_array_of_array_of_strings('key', [['legal'], 'illegal']) }.to raise_error
    end
  end

  describe '#__add_string' do
    it 'accepts a string' do
      dataobject.__add_string('key', some_string)
      expect(dataobject.data['key']).to eq(some_string)
      dataobject.data.delete('key')
    end

    it 'converts any argument passed to a string' do
      dataobject.__add_string('key', some_array_of_ints)
      expect(dataobject.data['key']).to eq(some_array_of_ints.to_s)
      dataobject.data.delete('key')
    end
  end

  describe '#__add_integer' do
    it 'accepts anything that can be converted to an integer with #to_i' do
      dataobject.__add_integer(keys[0], 1)
      dataobject.__add_integer(keys[1], "2")
      expect(dataobject.data[keys[0]]).to eq(1)
      expect(dataobject.data[keys[1]]).to eq(2)
      dataobject.data.delete(keys)
    end

    it 'raises an error if the value cannot be converted to an integer with #to_i' do
      expect { dataobject.__add_integer('key', StandardError.new("not convertable")) }.to raise_error
    end
  end

  describe '#__add_boolean' do
    it 'accepts any truthy value and converts it to true' do
      dataobject.__add_boolean('key', some_string)
      expect(dataobject.data['key']).to be_truthy
      dataobject.data.delete('key')
    end

    it 'accepts any non-truthy value and converts it to false' do
      dataobject.__add_boolean('key', false)
      expect(dataobject.data['key']).to be_falsey
      dataobject.data.delete('key')
    end
  end

  describe '#__add_hash' do
    it 'assigns a hash to a key' do
      dataobject.__add_hash('key', some_hash_of_strings)
      expect(dataobject.data['key']).to eq(some_hash_of_strings)
      dataobject.data.delete('key')
    end

    it 'converts a hash of non-strings to strings and assigns them to key' do
      dataobject.__add_hash('key', some_hash_of_mixed)
      expect(dataobject.data['key']).to eq(some_hash_of_strings)
      dataobject.data.delete('key')
    end

    it 'raises an error if the values argument is not a Hash' do
      expect { dataobject.__add_hash('key', 'some string') }.to raise_error
    end
  end

  describe '#__add_array_of_hashes' do
    it 'assigns an array of hashes to a key' do
      array = [some_hash_of_strings, some_hash_of_strings]
      dataobject.__add_array_of_hashes('key', array)
      expect(dataobject.data['key']).to eq(array)
      dataobject.data.delete('key')
    end

    it 'converts non-strings in the hashes to strings during assignment to key' do
      array = [some_hash_of_mixed, some_hash_of_mixed]
      dataobject.__add_array_of_hashes('key', array)
      expect(dataobject.data['key']).to eq([some_hash_of_strings, some_hash_of_strings])
      dataobject.data.delete('key')
    end

    it 'raises an error if the values argument is not an array' do
      expect { dataobject.__add_array_of_hashes('key', 'some string') }.to raise_error
    end

    it 'raises an error if any element in the values argument is not a Hash' do
      expect { dataobject.__add_array_of_hashes('key', [some_hash_of_strings, 'illegal']) }.to raise_error
    end
  end
end


text:
package cli_test

import (
	"os"

	"github.com/mailgun/vulcand/Godeps/_workspace/src/github.com/codegangsta/cli"
)

func Example() {
	app := cli.NewApp()
	app.Name = "todo"
	app.Usage = "task list on the command line"
	app.Commands = []cli.Command{
		{
			Name:      "add",
			ShortName: "a",
			Usage:     "add a task to the list",
			Action: func(c *cli.Context) {
				println("added task: ", c.Args().First())
			},
		},
		{
			Name:      "complete",
			ShortName: "c",
			Usage:     "complete a task on the list",
			Action: func(c *cli.Context) {
				println("completed task: ", c.Args().First())
			},
		},
	}

	app.Run(os.Args)
}

func ExampleSubcommand() {
	app := cli.NewApp()
	app.Name = "say"
	app.Commands = []cli.Command{
		{
			Name:        "hello",
			ShortName:   "hi",
			Usage:       "use it to see a description",
			Description: "This is how we describe hello the function",
			Subcommands: []cli.Command{
				{
					Name:        "english",
					ShortName:   "en",
					Usage:       "sends a greeting in english",
					Description: "greets someone in english",
					Flags: []cli.Flag{
						cli.StringFlag{
							Name:  "name",
							Value: "Bob",
							Usage: "Name of the person to greet",
						},
					},
					Action: func(c *cli.Context) {
						println("Hello, ", c.String("name"))
					},
				}, {
					Name:      "spanish",
					ShortName: "sp",
					Usage:     "sends a greeting in spanish",
					Flags: []cli.Flag{
						cli.StringFlag{
							Name:  "surname",
							Value: "Jones",
							Usage: "Surname of the person to greet",
						},
					},
					Action: func(c *cli.Context) {
						println("Hola, ", c.String("surname"))
					},
				}, {
					Name:      "french",
					ShortName: "fr",
					Usage:     "sends a greeting in french",
					Flags: []cli.Flag{
						cli.StringFlag{
							Name:  "nickname",
							Value: "Stevie",
							Usage: "Nickname of the person to greet",
						},
					},
					Action: func(c *cli.Context) {
						println("Bonjour, ", c.String("nickname"))
					},
				},
			},
		}, {
			Name:  "bye",
			Usage: "says goodbye",
			Action: func(c *cli.Context) {
				println("bye")
			},
		},
	}

	app.Run(os.Args)
}


text:
package org.burroloco.donkey.demo.synchronator;

import au.net.netstorm.boost.sniper.marker.Destroyable;
import au.net.netstorm.boost.sniper.marker.HasFixtures;
import au.net.netstorm.boost.spider.api.runtime.Nu;
import org.burroloco.butcher.fixture.database.SourceDatabase;
import org.burroloco.butcher.util.file.FileComparator;
import org.burroloco.donkey.glue.testcase.DonkeyTestCase;
import org.burroloco.donkey.synchronator.Subject;
import org.burroloco.donkey.synchronator.Synchronator;
import org.burroloco.donkey.synchronator.SynchronatorWirer;

import java.io.File;

/**
 * Using the Donkey to calculate DB data diffs.
 * Good for database source control.
 */
public class SynchronatorDemoTest extends DonkeyTestCase implements HasFixtures, Destroyable {
    private Synchronator subject;
    FileComparator comparator;
    SynchronatorWirer wirer;
    SourceDatabase source;
    Nu nu;

    public void fixtures() {
        source.create();
        wirer.wire();
        subject = nu.nu(Synchronator.class);
    }

    public void testFirstTime() {
        synch("address");
        check("address-insert.sql");
    }

    public void testDelta() {
        synch("employee");
        check("employee-delete.sql");
        check("employee-update.sql");
        check("employee-insert.sql");
    }

    private void synch(String subjectName) {
        Subject s = nu.nu(Subject.class, subjectName, new String[]{"ID"});
        subject.sync(s);
    }

    private void check(String name) {
        File e = new File("data/expected/synchronator/" + name);
        File a = new File("gen/demo/out/" + name);
        comparator.assertEquals(e, a);
    }

    public void destroy() {
        source.drop();
    }
}


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

public partial class MasterPages_OneColumn {

    /// <summary>
    /// head control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.ContentPlaceHolder head;

    /// <summary>
    /// MainContent control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.ContentPlaceHolder MainContent;
}


text:
angular.module('duScroll.scrollHelpers', []).
run(function($window, $q, cancelAnimation, requestAnimation, duScrollEasing) {
  var proto = angular.element.prototype;
  this.$get = function() {
    return proto;
  };

  var isDocument = function(el) {
    return (typeof HTMLDocument !== 'undefined' && el instanceof HTMLDocument) || (el.nodeType && el.nodeType === el.DOCUMENT_NODE);
  };

  var isElement = function(el) {
    return (typeof HTMLElement !== 'undefined' && el instanceof HTMLElement) || (el.nodeType && el.nodeType === el.ELEMENT_NODE);
  };

  var unwrap = function(el) {
    return isElement(el) || isDocument(el) ? el : el[0];
  };

  proto.scrollTo = function(left, top, duration, easing) {
    if(angular.isElement(left)) {
      return this.scrollToElement(left, 0, top, duration);
    }
    if(duration) {
      return this.scrollToAnimated.apply(this, arguments);
    }
    var el = unwrap(this);
    if(isDocument(el)) {
      return $window.scrollTo(left, top);
    }
    el.scrollLeft = left;
    el.scrollTop = top;
  };

  var scrollAnimation, deferred;
  proto.scrollToAnimated = function(left, top, duration, easing) {
    if(duration && !easing) {
      easing = duScrollEasing;
    }
    var startLeft = this.scrollLeft(),
        startTop = this.scrollTop(),
        deltaLeft = Math.round(left - startLeft),
        deltaTop = Math.round(top - startTop);

    if(!deltaLeft && !deltaTop) return;

    var startTime = null;
    if(scrollAnimation) {
      cancelAnimation(scrollAnimation);
      deferred.reject();
    }
    var el = this;
    deferred = $q.defer();

    var animationStep = function(timestamp) {
      if (startTime === null) {
        startTime = timestamp;
      }

      var progress = timestamp - startTime;
      var percent = (progress >= duration ? 1 : easing(progress/duration));

      el.scrollTo(
        startLeft + Math.ceil(deltaLeft * percent),
        startTop + Math.ceil(deltaTop * percent)
      );
      if(percent < 1) {
        scrollAnimation = requestAnimation(animationStep);
      } else {
        scrollAnimation = null;
        deferred.resolve();
      }
    };

    scrollAnimation = requestAnimation(animationStep);
    return deferred.promise;
  };

  proto.scrollToElement = function(target, offset, duration, easing) {
    var el = unwrap(this);
    var top = this.scrollTop() + unwrap(target).getBoundingClientRect().top - offset;
    if(isElement(el)) {
      top -= el.getBoundingClientRect().top;
    }
    return this.scrollTo(0, top, duration, easing);
  };

  proto.scrollLeft = function(value, duration, easing) {
    if(angular.isNumber(value)) {
      return this.scrollTo(value, this.scrollTop(), duration, easing);
    }
    var el = unwrap(this);
    if(isDocument(el)) {
      return $window.scrollX || document.documentElement.scrollLeft || document.body.scrollLeft;
    }
    return el.scrollLeft;
  };

  proto.scrollTop = function(value, duration, easing) {
    if(angular.isNumber(value)) {
      return this.scrollTo(this.scrollTop(), value, duration, easing);
    }
    var el = unwrap(this);
    if(isDocument(el)) {
      return $window.scrollY || document.documentElement.scrollTop || document.body.scrollTop;
    }
    return el.scrollTop;
  };

});


text:
package org.notehub.ntwo.painter;

import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
import java.awt.geom.PathIterator;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;

public class HexagonShape implements Shape{

	private Shape s;
	private HexagonCell cell;
	public HexagonCell getHexagonCell(){ return cell; }

	public HexagonShape(Shape s,HexagonCell cell){
		this.s=s;
		this.cell = cell;
	}
	@Override
	public boolean contains(double x, double y) {
		return s.contains(x,y);
	}
	@Override
	public boolean contains(double x, double y, double w, double h) {
		return s.contains(x,y,w,h);
	}
	@Override
	public boolean contains(Point2D p) {
		return s.contains(p);
	}
	@Override
	public boolean contains(Rectangle2D r) {
		return s.contains(r);
	}
	@Override
	public Rectangle getBounds() {
		return s.getBounds();
	}
	@Override
	public Rectangle2D getBounds2D() {
		return s.getBounds2D();
	}
	@Override
	public PathIterator getPathIterator(AffineTransform at) {
		return s.getPathIterator(at);
	}
	@Override
	public PathIterator getPathIterator(AffineTransform at, double flatness) {
		// TODO Auto-generated method stub
		return s.getPathIterator(at, flatness);
	}
	@Override
	public boolean intersects(double x, double y, double w, double h) {
		return s.intersects(x,y,w,h);
	}
	@Override
	public boolean intersects(Rectangle2D r) {
		return s.intersects(r);
	}

}


text:
package org.apache.http.nio.reactor;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.ReadableByteChannel;
import java.nio.channels.WritableByteChannel;
import java.nio.charset.CharacterCodingException;

import org.apache.http.util.CharArrayBuffer;

/**
 * Session output buffer for non-blocking connections. This interface
 * facilitates intermediate buffering of output data streamed out to
 * a destination channel and writing data to the buffer from a source, usually
 * {@link ByteBuffer} or {@link ReadableByteChannel}. This interface also
 * provides methods for writing lines of text.
 *
 * @since 4.0
 */
public interface SessionOutputBuffer {

    /**
     * Determines if the buffer contains data.
     *
     * @return {@code true} if there is data in the buffer,
     *   {@code false} otherwise.
     */
    boolean hasData();

    /**
     * Returns the length of this buffer.
     *
     * @return buffer length.
     */
    int length();

    /**
     * Makes an attempt to flush the content of this buffer to the given
     * destination {@link WritableByteChannel}.
     *
     * @param channel the destination channel.
     * @return The number of bytes written, possibly zero.
     * @throws IOException in case of an I/O error.
     */
    int flush(WritableByteChannel channel)
        throws IOException;

    /**
     * Copies content of the source buffer into this buffer. The capacity of
     * the destination will be expanded in order to accommodate the entire
     * content of the source buffer.
     *
     * @param src the source buffer.
     */
    void write(ByteBuffer src);

    /**
     * Reads a sequence of bytes from the source channel into this buffer.
     *
     * @param src the source channel.
     */
    void write(ReadableByteChannel src)
        throws IOException;

    /**
     * Copies content of the source buffer into this buffer as one line of text
     * including a line delimiter. The capacity of the destination will be
     * expanded in order to accommodate the entire content of the source buffer.
     *

     * The choice of a char encoding and line delimiter sequence is up to the
     * specific implementations of this interface.
     *
     * @param src the source buffer.
     */
    void writeLine(CharArrayBuffer src)
        throws CharacterCodingException;

    /**
     * Copies content of the given string into this buffer as one line of text
     * including a line delimiter.
     * The capacity of the destination will be expanded in order to accommodate
     * the entire string.
     *

     * The choice of a char encoding and line delimiter sequence is up to the
     * specific implementations of this interface.
     *
     * @param s the string.
     */
    void writeLine(String s)
        throws IOException;

}


text:
package org.perfcake.ide.intellij.settings;

import com.intellij.ide.util.PropertiesComponent;
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
import com.intellij.openapi.ui.TextBrowseFolderListener;
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
import java.awt.Color;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.nio.file.Paths;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import org.perfcake.ide.core.exec.PerfCakeInstallationValidator;
import org.perfcake.ide.core.exec.SimpleInstallationValidator;

/**
 * Forms with PerfCake settings.
 *
 * @author Jakub Knetl
 */
public class PerfCakeSettingsForm extends JPanel {

    public static final String INVALID_PATH_MESSAGE = "Entered path is not valid. Please enter correct path.";
    private TextFieldWithBrowseButton installationField;
    private JLabel installationLabel;
    private JLabel wrongLocationLabel;

    /**
     * Creates new PerfCake settings form.
     */
    public PerfCakeSettingsForm() {
        installationLabel = new JLabel("PerfCake location:");
        installationField = new TextFieldWithBrowseButton();
        FileChooserDescriptor fileChooserDescriptor = new FileChooserDescriptor(false, true, false,
                false, false, false);
        TextBrowseFolderListener browseFolderListener = new TextBrowseFolderListener(fileChooserDescriptor);
        installationField.addBrowseFolderListener(browseFolderListener);
        wrongLocationLabel = new JLabel();
        wrongLocationLabel.setForeground(Color.red);
        String storedInstallation = PropertiesComponent.getInstance().getValue(Pc4ideSettings.INSTALLATION_DIR_KEY, "");
        PerfCakeInstallationValidator validator = new SimpleInstallationValidator();

        if (storedInstallation != null && !validator.isValid(Paths.get(storedInstallation))) {
            wrongLocationLabel.setText(INVALID_PATH_MESSAGE);
        }

        this.setLayout(new GridBagLayout());

        GridBagConstraints c = new GridBagConstraints();
        c.gridx = 0;
        c.gridy = 0;
        c.insets = new Insets(2, 10, 2, 10);
        c.anchor = GridBagConstraints.FIRST_LINE_START;
        c.fill = GridBagConstraints.NONE;

        add(installationLabel, c);

        c.fill = GridBagConstraints.HORIZONTAL;
        c.gridy = 0;
        c.weightx = 1;
        c.weighty = 0;
        c.gridx = 1;

        add(installationField, c);

        installationField.getTextField().getDocument().addDocumentListener(new DocumentListener() {
            @Override
            public void insertUpdate(DocumentEvent e) {
                changedUpdate(e);
            }

            @Override
            public void removeUpdate(DocumentEvent e) {
                changedUpdate(e);
            }

            @Override
            public void changedUpdate(DocumentEvent e) {
                if (validator.isValid(Paths.get(getInstallationFolder()))) {
                    wrongLocationLabel.setText("");
                } else {
                    wrongLocationLabel.setText(INVALID_PATH_MESSAGE);
                }
            }
        });

        c.gridy = 2;
        c.weightx = 0;
        c.weighty = 0;
        add(wrongLocationLabel, c);

        c.weighty = 1;
        c.gridy = 3;
        add(new JPanel(), c);
    }

    public String getInstallationFolder() {
        return installationField.getText();
    }

    public TextFieldWithBrowseButton getInstallationField() {
        return installationField;
    }

    public JLabel getInstallationLabel() {
        return installationLabel;
    }
}


text:
using UnityEngine;

namespace DefaultNamespace
{
    public class UnavailableGoodOrder : MonoBehaviour
    {
        public void Update()
        {
            Vector3 a = new Vector3();
            var x = 5 / 4 * (a /  5) ;
        }
    }
}


text: Port of Arcsynthesis OpenGL Tutorials to OS X using GLFW


text:
const webpack = require('webpack');
module.exports = {
  entry: [
    './src/index.js',
  ],
  output: {
    filename: 'dist/halfpenny.global.browser.min.js',
    library: 'halfpenny',
    libraryTarget: 'umd'
  },
  module: {
    loaders: [
      { test: /\.jsx?$/, loader: 'babel', query: { presets: ['es2015'], compact: false } },
    ],
  },
  plugins: [
    new webpack.optimize.UglifyJsPlugin({ sourceMap: false }),
  ]
};


text:
package org.sqsh.commands;

import org.sqsh.ColumnDescription;
import org.sqsh.ColumnDescription.Alignment;
import org.sqsh.ColumnDescription.OverflowBehavior;
import org.sqsh.Command;
import org.sqsh.HelpTopic;
import org.sqsh.MarkdownFormatter;
import org.sqsh.PagedCommand;
import org.sqsh.Renderer;
import org.sqsh.Session;
import org.sqsh.SqshOptions;
import org.sqsh.Variable;
import org.sqsh.options.Argv;
import org.sqsh.options.OptionProperty;

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

import static org.sqsh.options.ArgumentRequired.REQUIRED;

/**
 * Implements the 'help' command.
 */
public class Help extends Command implements PagedCommand {

    /**
     * Used to contain the command line options that were passed in by the caller.
     */
    private static class Options extends SqshOptions {

        @OptionProperty(option = 'f', longOption = "format", arg = REQUIRED, argName = "style",
                description = "The display format for the help text (markdown, raw, or pretty)")
        public String format = null;

        @Argv(program = "\\help", min = 0, max = 1, usage = "[topics|vars|commands|name]")
        public List<String> arguments = new ArrayList<>();
    }

    /**
     * Return our overridden options.
     */
    @Override
    public SqshOptions getOptions() {
        return new Options();
    }

    @Override
    public int execute(Session session, SqshOptions opts) throws Exception {
        Options options = (Options) opts;

        int nArgs = options.arguments.size();
        if (nArgs > 1) {
            session.err.println("use: help [command]");
            return 1;
        }

        if (options.format != null) {
            if (!(options.format.equals("markdown") || options.format.equals("raw") || options.format.equals("pretty"))) {
                System.err.println("Invalid display format: " + options.format + ".  Valid formats are: \"markdown\", \"raw\", and \"pretty\"");
                return 1;
            }
        }

        if (nArgs == 0) {
            displayHelpCategories(session);
            return 0;
        }

        String word = options.arguments.get(0);
        int rc = 0;
        switch (word) {
            case "topics":
                displayTopics(session);
                break;
            case "vars":
                displayVariables(session);
                break;
            case "commands":
                displayCommands(session);
                break;
            default:
                rc = displayHelpText(session, word, options);
                break;
        }
        return rc;
    }

    public static int displayHelpText(Session session, String word) {
        return displayHelpText(session, word, new Options());
    }

    /**
     * Looks up a specific help topic and displays it.
     *
     * @param session The session to use for display.
     * @param word The topic to look for.
     * @return 0 if the topic was found and displayed, 1 otherwise.
     */
    public static int displayHelpText(Session session, String word, Options options) {
        int rc = 0;
        HelpTopic topic = session.getCommandManager().getCommand(word);

        // If we fail to find the command the user asked for it *could* be because the shell interpreted the backslash
        // in front of the command name, so will append one and try again.
        if (topic == null) {
            topic = session.getCommandManager().getCommand('\\' + word);
        }

        // If we fail that, try to see if it is a variable that we are talking about.
        if (topic == null) {
            topic = (HelpTopic) session.getVariableManager().getVariable(word);
            if (topic != null && topic.getDescription() == null) {
                topic = null;
            }
        }

        // If we're still null, then we'll check to see if it is a general topic that is being requested.
        if (topic == null) {
            topic = session.getHelpManager().getTopic(word);
        }

        // At this point we're S.O.L.
        if (topic == null) {
            session.err.println("No such command or topic '" + word + "'");
            rc = 1;
        } else {
            if (options.format != null && "markdown".equals(options.format)) {
                session.out.println(topic.getHelp());
            } else {
                int width = session.getScreenWidth();
                if (width > 70) {
                    width -= 8;
                } else if (width < 40) {
                    width = 40;
                }

                MarkdownFormatter formatter = new MarkdownFormatter(width, session.out);
                if (options.format != null && "raw".equals(options.format)) {
                    formatter.setDecorationsEnabled(false);
                }
                formatter.format(topic.getHelp());
            }
        }
        return rc;
    }

    /**
     * Displays available help categories.
     *
     * @param session The session to be used for displaying.
     */
    private void displayHelpCategories(Session session) {
        session.out.println("Available help categories. Use " + "\"\\help <category>\" to display topics within that category.");
        session.out.println("For online help, getting started guide, and tutorials, visit " + "https://github.com/scgray/jsqsh/wiki");

        ColumnDescription[] columns = new ColumnDescription[2];
        columns[0] = new ColumnDescription("Category", -1, Alignment.LEFT, OverflowBehavior.WRAP, false);
        columns[1] = new ColumnDescription("Description", -1);

        Renderer renderer = session.getRendererManager().getCommandRenderer(session);

        renderer.header(columns);

        renderer.row(new String[]{"commands", "Help on all avaiable commands"});
        renderer.row(new String[]{"vars", "Help on all avaiable configuration variables"});
        renderer.row(new String[]{"topics", "General help topics for jsqsh"});

        renderer.flush();
    }

    /**
     * Displays available commands.
     *
     * @param session The session to be used for displaying.
     */
    private void displayCommands(Session session) {
        session.out.println("Available commands. " + "Use \"\\help <command>\"" + " to display detailed help for a given command");

        Renderer renderer = session.getRendererManager().getCommandRenderer(session);
        Command[] commands = session.getCommandManager().getCommands();
        Arrays.sort(commands);

        ColumnDescription[] columns = new ColumnDescription[2];
        columns[0] = new ColumnDescription("Command", -1, Alignment.LEFT, OverflowBehavior.WRAP, false);
        columns[1] = new ColumnDescription("Description", -1);

        renderer.header(columns);

        for (int i = 0; i < commands.length; i++) {
            if (!commands[i].isHidden()) {
                String[] row = new String[2];
                row[0] = commands[i].getName();
                row[1] = commands[i].getDescription();
                renderer.row(row);
            }
        }
        renderer.flush();
    }

    /**
     * Displays available variables.
     *
     * @param session The session to be used for displaying.
     */
    private void displayVariables(Session session) {
        session.out.println("Available configuration variables. " + "Use \"\\help <variable>\" to display detailed " + "help for a given variable");

        Renderer renderer = session.getRendererManager().getCommandRenderer(session);
        Variable[] variables = session.getVariableManager().getVariables(true);
        Arrays.sort(variables);

        ColumnDescription[] columns = new ColumnDescription[2];
        columns[0] = new ColumnDescription("Variable", -1, Alignment.LEFT, OverflowBehavior.WRAP, false);
        columns[1] = new ColumnDescription("Description", -1);

        renderer.header(columns);

        for (int i = 0; i < variables.length; i++) {
            if (variables[i].getDescription() != null) {
                String[] row = new String[2];
                row[0] = variables[i].getName();
                row[1] = variables[i].getDescription();
                renderer.row(row);
            }
        }
        renderer.flush();
    }

    /**
     * Displays available topics.
     *
     * @param session The session to be used for displaying.
     */
    private void displayTopics(Session session) {
        session.out.println("Available help topics. " + "Use \"\\help <topic>\" to display detailed " + "help for a given variable");
        Renderer renderer = session.getRendererManager().getCommandRenderer(session);

        ColumnDescription[] columns = new ColumnDescription[2];
        columns[0] = new ColumnDescription("Topic", -1);
        columns[1] = new ColumnDescription("Description", -1);

        renderer.header(columns);

        HelpTopic[] topics = session.getHelpManager().getTopics();
        Arrays.sort(topics);

        for (int i = 0; i < topics.length; i++) {
            String[] row = new String[2];
            row[0] = topics[i].getTopic();
            row[1] = topics[i].getDescription();
            renderer.row(row);
        }
        renderer.flush();
    }
}


text:
function count_adjust(percent) {
	elems = document.getElementsByClassName("count");
        elems[0].width = percent.toString() + "%"
}

function hide_count_bar() {
	elems = document.getElementsByClassName("hidden");
	elems[0].style.display = 'none';
}

function show_count_bar() {
	elems = document.getElementsByClassName("hidden");
	if (elems[0].style.display == 'none') {
        	elems[0].style.display = 'block';
	}
}


text:
import {Component, OnInit, Input, ViewChild} from '@angular/core';
import {ImportService} from '../../../shared/import.service.ts';
import {NotificationsService} from 'angular2-notifications';

@Component({
  selector: 'add-bot-form',
  templateUrl: './import-form.html',
  providers: [ImportService, NotificationsService],
  styleUrls: ['./style.scss'],
})

export class BotComponent implements OnInit {
  @Input() title:string;

  public options = {
    timeOut: 5000,
    lastOnBottom: true,
    clickToClose: true,
    maxLength: 0,
    maxStack: 7,
    showProgressBar: true,
    pauseOnHover: true,
    preventDuplicates: false,
    preventLastDuplicates: 'visible',
    rtl: false,
    animate: 'scale',
    position: ['right', 'bottom']
  };
  private loadingFile:boolean = false
  private formData:FormData = new FormData();

  constructor(private importService:ImportService,
              private _notificationsService:NotificationsService) {
  }

  ngOnInit() {
  }

  fileChange(event) {
    this.formData = null;
    let fileList:FileList = event.target.files;
    if (fileList.length > 0) {
      let file:File = fileList[0];
      this.formData.append('uploadFile', file, file.name);
    }

  }

  add() {
    this._notificationsService.success(
      'Success',
      'Бот успешно добавлен',
      this.options
    )
  }
}


text:
import { Injectable } from '@angular/core';
import { Router } from '@angular/router';
import { Observable, of } from 'rxjs';
import { Http, Response } from '@angular/http';
import { httpErrorHandler, notifyError } from '../http/error-handling';
import { EVENT_TYPE, NotificationService } from '../../components/notifications/notification.service';
import { catchError, map } from 'rxjs/operators';

export const SESSION_API_TOKEN = 'api-token';

@Injectable()
export class AuthService {

  constructor(private router: Router,
              private http: Http,
              private notifyService: NotificationService) {
  }

  checkAuthenticated(): Observable<boolean> {

    return this.http.get('/api/v2/hoverfly/version')
      .pipe(map((res: Response) => res.status === 200),
        catchError(err => {
          notifyError(err, this.notifyService);
          return of(false);
        })
      );
  }

  login(username, password): void {
    this.http.post('/api/token-auth', {
      username: username,
      password: password
    })
      .pipe(map((res: Response) => res.json().token))
      .subscribe(token => {
          sessionStorage.setItem(SESSION_API_TOKEN, token);
          this.notifyService.sendEvent(EVENT_TYPE.LOGIN);
          this.redirectToHome();
        },
        httpErrorHandler(this.notifyService));
  }

  logout() {
    sessionStorage.clear();
    this.notifyService.sendEvent(EVENT_TYPE.LOGOUT);
    this.router.navigateByUrl('/login');
  }

  redirectToHome() {
    this.router.navigateByUrl('/dashboard');
  }

  hasSession(): boolean {
    return !!sessionStorage.getItem(SESSION_API_TOKEN);
  }
}


text:
package org.notehub.ntwo.painter.test;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.image.BufferedImage;

import org.notehub.ntwo.painter.HexagonShape;
import org.notehub.ntwo.painter.HoneycombOne;
import org.notehub.ntwo.painter.HoneycombTwo;
import org.notehub.ntwo.painter.XDimension;
import org.notehub.ntwo.painter.XPoint;

public class HoneycombTwoImageFactory extends AbstractImageFactory
implements ImageFactory{

	/*
	static private Color BG_0=new Color(102,102,102);
	static private Color BG_1=new Color(152,152,152);
	static private Color BG_2=new Color(194,194,194);
	*/

	static private Color BG=Color.WHITE;

	static private Color BORDER=new Color(0x00,0x00,0x00);

	static private Color BG_0=Color.white;//new Color(0x99,0x99,0x99);
	static private Color BG_1=new Color(0xAA,0xAA,0xAA);
	static private Color BG_2=new Color(0xCC,0xCC,0xCC);

	public void paint(Graphics2D g2){

		Dimension size=getSize();

		// paint background as white
		g2.setColor(BG);
		g2.fill(new Rectangle(new Point(),size));

		HoneycombTwo two=new HoneycombTwo(){
			@Override
			public HoneycombOne[] getHoneycombOnes() {

				HoneycombOne[] hos= super.getHoneycombOnes();
				for(int i=0; i<hos.length; i++){
					hos[i].setDistRate(0.9f);
					hos[i].setCellRate(2.8f);
				}
				return hos;
			}
		};
		two.setCellRate(3.1f);
		two.setDistRate(1.1f);

		two.setLocation(new XPoint());
		two.setSize(new XDimension(size.width,size.height));

		HexagonShape[] list=two.getHexagonShapes();
		for(int i=0; i<list.length; i++){
			HexagonShape shape=list[i];

			if(i==0){
				g2.setColor(BG_0);
				g2.fill(shape);
			}
			else if(0<i && i<7){
				g2.setColor(BG_1);
				g2.fill(shape);
			}
			else if(i==7*1 || i==7*2 || i==7*3 || i==7*4 || i==7*5 || i==7*6){
				g2.setColor(BG_1);
				g2.fill(shape);

			}
			else{
				g2.setColor(BG_2);
				g2.fill(shape);
			}

			if(i==0){
				g2.setColor(BORDER);
				g2.draw(shape);
			}

		}
	}

	public Image createImage(){

		Dimension size=getSize();
		BufferedImage bimg=new BufferedImage(size.width,size.height,BufferedImage.TYPE_4BYTE_ABGR);

		Graphics2D g2=(Graphics2D)bimg.getGraphics();
		GResource.setAntialiasOn(g2);
		paint(g2);
		g2.dispose();

		return (bimg);
	}

}


text:
package main

import (
	"errors"
	"strings"
	"time"

	"github.com/golang/glog"
	"github.com/spf13/cobra"
	"github.com/spf13/viper"
)

const (
	CfgFile           = "kube-template"
	CfgMaster         = FlagMaster
	CfgPollTime       = FlagPollTime
	CfgPollPeriod     = FlagPollPeriod
	CfgCommandTimeout = FlagCommandTimeout
)

var cfgFile string

type Config struct {
	// Do not write template output
	DryRun bool
	// Run template processing once and exit
	RunOnce bool
	// Guess Kubernetes API settings from POD environment
	GuessKubeAPISettings bool
	// Kubernetes config file
	KubeConfig string
	// Kubernetes API server address
	Master string
	// Kubernetes API server poll period
	PollPeriod time.Duration
	// Command execution timeout
	CommandTimeout time.Duration

	// Template delimiters
	LeftDelimiter  string
	RightDelimiter string

	// Template paths
	templatePaths map[string]bool

	// Template descriptors
	TemplateDescriptors []*TemplateDescriptor
}

type TemplateDescriptor struct {
	// Template file path
	Path string
	// Template output path
	Output string
	// Optional command to execute after template output updating
	Command string
	// Command timeout
	CommandTimeout time.Duration
}

func readConfig(cmd *cobra.Command) error {
	if cfgFile != "" {
		viper.SetConfigFile(cfgFile) // specify config file set by flag
	} else {
		viper.SetConfigName(CfgFile) // default name of config file (without extension)
		viper.AddConfigPath(".")     // adding home directory as first search path
	}

	viper.AutomaticEnv() // read in environment variables that match

	if err := viper.BindPFlag(CfgMaster, cmd.Flags().Lookup(FlagMaster)); err != nil {
		return err
	}

	if err := viper.BindPFlag(CfgPollPeriod, cmd.Flags().Lookup(FlagPollPeriod)); err != nil {
		return err
	}

	if err := viper.BindPFlag(CfgCommandTimeout, cmd.Flags().Lookup(FlagCommandTimeout)); err != nil {
		return err
	}

	err := viper.ReadInConfig()

	if err == nil {
		glog.V(1).Infof("using config file: %s", viper.ConfigFileUsed())
		return nil
	}

	// raise error if config file used but can't be read
	if viper.ConfigFileUsed() != "" {
		return err
	}

	return nil
}

// Parses a string in format 'templatePath:outputPath[:command]' into a TemplateDescriptor struct
func parseTemplateDescriptor(s string) (*TemplateDescriptor, error) {
	if len(strings.TrimSpace(s)) == 0 {
		return nil, errors.New("empty template descriptor string")
	}

	var path, output, command string
	parts := strings.SplitN(s, ":", 3)

	switch len(parts) {
	case 2:
		path, output = parts[0], parts[1]
	case 3:
		path, output, command = parts[0], parts[1], parts[2]
	default:
		return nil, errors.New("invalid template descriptor, should be 'templatePath:outputPath[:command]'")
	}

	return &TemplateDescriptor{
		Path:    path,
		Output:  output,
		Command: command,
	}, nil
}

func newConfig(cmd *cobra.Command) (*Config, error) {
	// Create empty config
	config := new(Config)
	// Get command-line only options
	dryRun, err := cmd.Flags().GetBool(FlagDryRun)
	if err != nil {
		return nil, err
	}
	config.DryRun = dryRun
	runOnce, err := cmd.Flags().GetBool(FlagRunOnce)
	if err != nil {
		return nil, err
	}
	config.RunOnce = runOnce
	guessKubeAPISettings, err := cmd.Flags().GetBool(FlagGuessKubeApiSettings)
	if err != nil {
		return nil, err
	}
	config.GuessKubeAPISettings = guessKubeAPISettings
	kubeConfig, err := cmd.Flags().GetString(FlagKubeConfig)
	if err != nil {
		return nil, err
	}
	config.KubeConfig = kubeConfig

	leftDelimiter, err := cmd.Flags().GetString(FlagLeftDelim)
	if err != nil {
		return nil, err
	}
	config.LeftDelimiter = leftDelimiter

	rightDelimiter, err := cmd.Flags().GetString(FlagRightDelim)
	if err != nil {
		return nil, err
	}
	config.RightDelimiter = rightDelimiter

	// Read config from file, if present
	err = readConfig(cmd)
	if err != nil {
		return nil, err
	}
	// Get command line / config options
	config.Master = viper.GetString(CfgMaster)
	if viper.IsSet(CfgPollTime) {
		config.PollPeriod = viper.GetDuration(CfgPollTime)
		glog.Warningf("'%s' parameter is deprecated, use '%s' instead", CfgPollTime, CfgPollPeriod)
	} else {
		config.PollPeriod = viper.GetDuration(CfgPollPeriod)
	}
	glog.V(2).Infof("poll period set to %v", config.PollPeriod)
	config.CommandTimeout = viper.GetDuration(FlagCommandTimeout)
	glog.V(2).Infof("command timeout set to %v", config.CommandTimeout)
	// Add template descriptors specified by command line
	cmdTemplates, err := cmd.Flags().GetStringSlice(FlagTemplate)
	if err != nil {
		return nil, err
	}
	config.templatePaths = make(map[string]bool)
	config.TemplateDescriptors = make([]*TemplateDescriptor, 0)
	for _, template := range cmdTemplates {
		d, err := parseTemplateDescriptor(template)
		if err != nil {
			glog.Errorf("can't parse '%s': %v", template, err)
		} else {
			glog.V(2).Infof("adding template from command line: %s", d.Path)
			config.appendTemplateDescriptor(d)
		}
	}
	// Merge template descriptors from config file
	if iCfgTemplates := viper.Get("templates"); iCfgTemplates != nil {
		for _, iCfgTemplate := range iCfgTemplates.([]interface{}) {
			cfgTemplate := iCfgTemplate.(map[interface{}]interface{})
			// Check template path and output path are present
			iPath, pathPresent := cfgTemplate["path"]
			iOutput, outputPresent := cfgTemplate["output"]
			if !pathPresent || !outputPresent {
				glog.Warningf("skipped non-complete template descriptor: %#v", cfgTemplate)
				continue
			}
			path, output := iPath.(string), iOutput.(string)
			// Command and its timeout are optional
			var cmd string
			if iCmd, cmdPresent := cfgTemplate["command"]; cmdPresent {
				cmd = iCmd.(string)
			}
			cmdTimeout := config.CommandTimeout
			if iCmdTimeout, cmdTimeoutPresent := cfgTemplate[FlagCommandTimeout]; cmdTimeoutPresent {
				if i, ok := iCmdTimeout.(int); ok {
					cmdTimeout = time.Duration(i) * time.Second
				} else if d, err := time.ParseDuration(iCmdTimeout.(string)); err == nil {
					cmdTimeout = d
				} else {
					glog.Warningf("ignoring invalid command timeout value: %v", iCmdTimeout)
				}
			}
			// Add template descriptor
			d := &TemplateDescriptor{
				Path:           path,
				Output:         output,
				Command:        cmd,
				CommandTimeout: cmdTimeout,
			}
			glog.V(2).Infof("adding template from config file: %s", d.Path)
			config.appendTemplateDescriptor(d)
		}
	}

	return config, nil
}

func (cfg *Config) appendTemplateDescriptor(d *TemplateDescriptor) {
	if _, added := cfg.templatePaths[d.Path]; !added {
		cfg.templatePaths[d.Path] = true
		cfg.TemplateDescriptors = append(cfg.TemplateDescriptors, d)
	} else {
		glog.Warningf("template already added: %s", d.Path)
	}
}

func (cfg *Config) PollingEnabled() bool {
	return !cfg.RunOnce && cfg.PollPeriod.Nanoseconds() > 0
}


text:
from django.views.generic import TemplateView

from django.contrib.auth.mixins import LoginRequiredMixin

class IndexView(TemplateView):
    template_name = 'public/index.html'

index = IndexView.as_view()


text:
from bluebottle.fsm.triggers import (
    TransitionTrigger, register
)
from bluebottle.funding.triggers import BankAccountTriggers
from bluebottle.funding_lipisha.effects import GenerateLipishaAccountsEffect
from bluebottle.funding_lipisha.models import LipishaBankAccount
from bluebottle.funding_lipisha.states import LipishaBankAccountStateMachine

@register(LipishaBankAccount)
class LipishaBankAccountTriggers(BankAccountTriggers):
    triggers = BankAccountTriggers.triggers + [
        TransitionTrigger(
            LipishaBankAccountStateMachine.verify,
            effects=[
                GenerateLipishaAccountsEffect
            ]
        ),
    ]