text:
package routes

import (
	"context"
	"fmt"
	"net/http"

	"github.com/google/exposure-notifications-server/pkg/keys"
	"github.com/google/exposure-notifications-server/pkg/logging"
	"github.com/google/exposure-notifications-verification-server/pkg/cache"
	"github.com/google/exposure-notifications-verification-server/pkg/config"
	"github.com/google/exposure-notifications-verification-server/pkg/controller"
	"github.com/google/exposure-notifications-verification-server/pkg/controller/codes"
	"github.com/google/exposure-notifications-verification-server/pkg/controller/issueapi"
	"github.com/google/exposure-notifications-verification-server/pkg/controller/middleware"
	"github.com/google/exposure-notifications-verification-server/pkg/controller/stats"
	"github.com/google/exposure-notifications-verification-server/pkg/database"
	"github.com/google/exposure-notifications-verification-server/pkg/ratelimit/limitware"
	"github.com/google/exposure-notifications-verification-server/pkg/render"
	"github.com/sethvargo/go-limiter"

	"github.com/gorilla/mux"
)

// AdminAPI defines routes for the adminapi service.
func AdminAPI(
	ctx context.Context,
	cfg *config.AdminAPIServerConfig,
	db *database.Database,
	cacher cache.Cacher,
	smsSigner keys.KeyManager,
	limiterStore limiter.Store,
) (http.Handler, error) {
	// Create the router
	r := mux.NewRouter()

	// Common observability context
	ctx, obs := middleware.WithObservability(ctx)
	r.Use(obs)

	// Create the renderer
	h, err := render.New(ctx, nil, cfg.DevMode)
	if err != nil {
		return nil, fmt.Errorf("failed to create renderer: %w", err)
	}

	// Request ID injection
	populateRequestID := middleware.PopulateRequestID(h)
	r.Use(populateRequestID)

	// Trace ID injection
	populateTraceID := middleware.PopulateTraceID()
	r.Use(populateTraceID)

	// Logger injection
	populateLogger := middleware.PopulateLogger(logging.FromContext(ctx))
	r.Use(populateLogger)

	// Recovery injection
	recovery := middleware.Recovery(h)
	r.Use(recovery)

	httplimiter, err := limitware.NewMiddleware(ctx, limiterStore,
		limitware.APIKeyFunc(ctx, db, "adminapi:ratelimit:", cfg.RateLimit.HMACKey),
		limitware.AllowOnError(false))
	if err != nil {
		return nil, fmt.Errorf("failed to create limiter middleware: %w", err)
	}
	rateLimit := httplimiter.Handle

	// Install common security headers
	r.Use(middleware.SecureHeaders(cfg.DevMode, "json"))

	// Enable debug headers
	processDebug := middleware.ProcessDebug()
	r.Use(processDebug)

	// Other common middlewares
	requireAdminAPIKey := middleware.RequireAPIKey(cacher, db, h, []database.APIKeyType{
		database.APIKeyTypeAdmin,
	})
	requireStatsAPIKey := middleware.RequireAPIKey(cacher, db, h, []database.APIKeyType{
		database.APIKeyTypeStats,
	})
	processFirewall := middleware.ProcessFirewall(h, "adminapi")

	// Health route
	r.Handle("/health", controller.HandleHealthz(db, h, cfg.IsMaintenanceMode())).Methods(http.MethodGet)

	// API routes
	{
		sub := r.PathPrefix("/api").Subrouter()
		sub.Use(requireAdminAPIKey)
		sub.Use(rateLimit)
		sub.Use(processFirewall)

		issueapiController := issueapi.New(cfg, db, limiterStore, smsSigner, h)
		sub.Handle("/issue", issueapiController.HandleIssueAPI()).Methods(http.MethodPost)
		sub.Handle("/batch-issue", issueapiController.HandleBatchIssueAPI()).Methods(http.MethodPost)

		codesController := codes.NewAPI(cfg, db, h)
		sub.Handle("/checkcodestatus", codesController.HandleCheckCodeStatus()).Methods(http.MethodPost)
		sub.Handle("/expirecode", codesController.HandleExpireAPI()).Methods(http.MethodPost)
	}

	// Stats routes
	{
		sub := r.PathPrefix("/api/stats").Subrouter()
		sub.Use(requireStatsAPIKey)
		sub.Use(rateLimit)
		sub.Use(processFirewall)

		statsController := stats.New(cacher, db, h)
		sub.Handle("/realm.csv", statsController.HandleRealmStats(stats.TypeCSV)).Methods(http.MethodGet)
		sub.Handle("/realm.json", statsController.HandleRealmStats(stats.TypeJSON)).Methods(http.MethodGet)

		sub.Handle("/realm/composite.csv", statsController.HandleComposite(stats.TypeCSV)).Methods(http.MethodGet)
		sub.Handle("/realm/composite.json", statsController.HandleComposite(stats.TypeJSON)).Methods(http.MethodGet)

		sub.Handle("/realm/users.csv", statsController.HandleRealmUsersStats(stats.TypeCSV)).Methods(http.MethodGet)
		sub.Handle("/realm/users.json", statsController.HandleRealmUsersStats(stats.TypeJSON)).Methods(http.MethodGet)

		sub.Handle("/realm/users/{id}.csv", statsController.HandleRealmUserStats(stats.TypeCSV)).Methods(http.MethodGet)
		sub.Handle("/realm/users/{id}.json", statsController.HandleRealmUserStats(stats.TypeJSON)).Methods(http.MethodGet)

		sub.Handle("/realm/api-keys/{id}.csv", statsController.HandleRealmAuthorizedAppStats(stats.TypeCSV)).Methods(http.MethodGet)
		sub.Handle("/realm/api-keys/{id}.json", statsController.HandleRealmAuthorizedAppStats(stats.TypeJSON)).Methods(http.MethodGet)

		sub.Handle("/realm/external-issuers.csv", statsController.HandleRealmExternalIssuersStats(stats.TypeCSV)).Methods(http.MethodGet)
		sub.Handle("/realm/external-issuers.json", statsController.HandleRealmExternalIssuersStats(stats.TypeJSON)).Methods(http.MethodGet)

		sub.Handle("/realm/sms-errors.csv", statsController.HandleRealmSMSErrorStats(stats.TypeCSV)).Methods(http.MethodGet)
		sub.Handle("/realm/sms-errors.json", statsController.HandleRealmSMSErrorStats(stats.TypeJSON)).Methods(http.MethodGet)

		sub.Handle("/realm/key-server.csv", statsController.HandleKeyServerStats(stats.TypeCSV)).Methods(http.MethodGet)
		sub.Handle("/realm/key-server.json", statsController.HandleKeyServerStats(stats.TypeJSON)).Methods(http.MethodGet)
	}

	// Wrap the main router in the mutating middleware method. This cannot be
	// inserted as middleware because gorilla processes the method before
	// middleware.
	mux := http.NewServeMux()
	mux.Handle("/", middleware.MutateMethod()(r))
	return mux, nil
}


text:
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
#import <OCMock/OCMock.h>

#import "HSTSCache.h"

#define TRACE_HSTS

@interface HSTSCache_Tests : XCTestCase
@end

@implementation HSTSCache_Tests {
	HSTSCache *hstsCache;
}

- (void)setUp
{
	[super setUp];

	hstsCache = [[HSTSCache alloc] init];
}

- (void)testParseHSTSHeader
{
	[hstsCache parseHSTSHeader:@"max-age=12345; includeSubDomains" forHost:@"example.com"];

	NSDictionary *params = [hstsCache objectForKey:@"example.com"];
	XCTAssertNotNil(params);
	XCTAssertNotNil([params objectForKey:HSTS_KEY_ALLOW_SUBDOMAINS]);
	XCTAssertNotNil([params objectForKey:HSTS_KEY_EXPIRATION]);

	XCTAssertTrue([(NSDate *)[params objectForKey:HSTS_KEY_EXPIRATION] timeIntervalSince1970] - [[NSDate date] timeIntervalSince1970] >= 12340);
}

- (void)testIgnoreIPAddresses
{
	[hstsCache parseHSTSHeader:@"max-age=12345; includeSubDomains" forHost:@"127.0.0.1"];

	NSDictionary *params = [hstsCache objectForKey:@"127.0.0.1"];
	XCTAssertNil(params);
}

- (void)testParseUpdatedHSTSHeader
{
	[hstsCache parseHSTSHeader:@"max-age=12345; includeSubDomains" forHost:@"example.com"];

	NSDictionary *params = [hstsCache objectForKey:@"example.com"];
	XCTAssertNotNil(params);
	XCTAssertNotNil([params objectForKey:HSTS_KEY_ALLOW_SUBDOMAINS]);

	/* now a new request presents without includeSubDomains */
	[hstsCache parseHSTSHeader:@"max-age=12345" forHost:@"example.com"];

	params = [hstsCache objectForKey:@"example.com"];
	XCTAssertNotNil(params);
	XCTAssertNil([params objectForKey:HSTS_KEY_ALLOW_SUBDOMAINS]);
}

- (void)testParseEFFHSTSHeader
{
	/* weirdo header that eff sends (to cover old spec?) */
	[hstsCache parseHSTSHeader:@"max-age=31536000; includeSubdomains, max-age=31536000; includeSubdomains" forHost:@"www.EFF.org"];

	NSDictionary *params = [hstsCache objectForKey:@"www.eff.org"];
	XCTAssertNotNil(params);
	XCTAssertNotNil([params objectForKey:HSTS_KEY_ALLOW_SUBDOMAINS]);
	XCTAssertNotNil([params objectForKey:HSTS_KEY_EXPIRATION]);
}

- (void)testURLRewriting
{
	[hstsCache parseHSTSHeader:@"max-age=31536000; includeSubdomains, max-age=31536000; includeSubdomains" forHost:@"www.EFF.org"];

	NSURL *output = [hstsCache rewrittenURI:[NSURL URLWithString:@"http://www.eff.org/test"]];
	XCTAssertTrue([[output absoluteString] isEqualToString:@"https://www.eff.org/test"]);

	/* we didn't see the header for "eff.org", so subdomains have to be of www */
	output = [hstsCache rewrittenURI:[NSURL URLWithString:@"http://subdomain.eff.org/test"]];
	XCTAssertNotEqualObjects([output absoluteString], @"https://subdomain.eff.org/test");

	output = [hstsCache rewrittenURI:[NSURL URLWithString:@"http://subdomain.www.eff.org/test"]];
	XCTAssertEqualObjects([output absoluteString], @"https://subdomain.www.eff.org/test");

	output = [hstsCache rewrittenURI:[NSURL URLWithString:@"http://www.eff.org:1234/?what#hi"]];
	XCTAssertEqualObjects([output absoluteString], @"https://www.eff.org:1234/?what#hi");

	output = [hstsCache rewrittenURI:[NSURL URLWithString:@"http://www.eff.org:80/?what#hi"]];
	XCTAssertEqualObjects([output absoluteString], @"https://www.eff.org/?what#hi");
}

- (void)testExpiring
{
	[hstsCache parseHSTSHeader:@"max-age=2; includeSubDomains" forHost:@"example.com"];

	NSURL *output = [hstsCache rewrittenURI:[NSURL URLWithString:@"http://www.example.com/"]];
	XCTAssertEqualObjects([output absoluteString], @"https://www.example.com/");

	NSDate *timeoutDate = [NSDate dateWithTimeIntervalSinceNow:4];

	do {
		[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:timeoutDate];
		if ([timeoutDate timeIntervalSinceNow] < 0)
			break;
	} while (TRUE);

	/* expired */
	output = [hstsCache rewrittenURI:[NSURL URLWithString:@"http://www.example.com/"]];
	XCTAssertEqualObjects([output absoluteString], @"http://www.example.com/");
}

@end

redpajama_set_name: RedPajamaGithub


text:
using System;

namespace Xwt
{
	public class SegmentedButtonTests: WidgetTests
	{
		public override Widget CreateWidget ()
		{
			return new SegmentedButton ();
		}
	}
}


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

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    >

  <LinearLayout
      android:id="@+id/linearLayout"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="vertical"
      >

    <ImageView
        android:id="@+id/image"
        android:layout_width="64dp"
        android:layout_height="64dp"
        android:layout_gravity="center"
        android:src="@drawable/tab_contact_select"
        />

    <TextView
        android:id="@+id/text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:text="联系人"
        />

  </LinearLayout>

  <SeekBar
      android:id="@+id/seekBar"
      android:layout_width="120dp"
      android:layout_height="wrap_content"
      android:layout_gravity="center"
      android:layout_marginTop="16dp"
      android:max="255"
      android:progress="255"
      />

</LinearLayout>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DataGen.NumberToWords.Common
{
    public class Numeral
    {
        public int Value { get; set; }

        public string Word { get; set; }

        public NumeralOrderOfMagnitude? OrderOfMagnitude { get; set; }

        public NumeralGrammaticalCase? GrammaticalCase { get; set; }
    }
}


text:
seven_zip Cookbook CHANGELOG
========================
This file is used to list changes made in each version of the seven_zip cookbook.

v2.0.1
------
- [GH Issue 21 - NoMethodError: Undefined method or attribute `kernel' on `node'](https://github.com/daptiv/seven_zip/issues/21).

v2.0.0
------
- [Upgrade to 7-Zip 15.14](https://github.com/daptiv/seven_zip/pull/9).
- [7-Zip now installed to the default MSI location by default](https://github.com/daptiv/seven_zip/pull/11).
- [7z.exe is located using the Windows registry unless the home attribute is explicitly set](https://github.com/daptiv/seven_zip/pull/10).
- [7-Zip is only added to the Windows PATH if the syspath attribute is set](https://github.com/daptiv/seven_zip/pull/11).
- [Installation idempotence check was fixed](https://github.com/daptiv/seven_zip/pull/14), package name was corrected.
- [TravisCI build added](https://github.com/daptiv/seven_zip/pull/12).
- [ServerSpec tests added](https://github.com/daptiv/seven_zip/pull/9)
- [Document Archive LRWP](https://github.com/daptiv/seven_zip/pull/6)

v1.0.2
------
- [COOK-3476 - Upgrade to 7-zip 9.22](https://tickets.opscode.com/browse/COOK-3476)

1.0.0
-----
- initial release


text:
@ECHO OFF
setlocal DISABLEDELAYEDEXPANSION
SET BIN_TARGET=%~dp0/../zendframework/zend-servicemanager/bin/generate-deps-for-config-factory
php "%BIN_TARGET%" %*


text:
NSString * const kGlobalDecorStylesKey = @"kGlobalDecorStylesKey";

@implementation DStyle

- (instancetype)init
{
    if (self = [super init])
    {
        [self reset];
    }
    return self;
}

- (void)reset
{
    _padding = [DEdgeMeasurement zeroEdgeMeasurement];
    _margin = [DEdgeMeasurement zeroEdgeMeasurement];
    _width = percent(100);
    _height = percent(100);
    _top = _left = _right = _bottom = nil;
    _position = relative;
    _center = none;
    _lineBreak = 0U;
}

- (void)setLeft:(DMeasurement *)left
{
    _left = left;
    _right = nil;
}

- (void)setRight:(DMeasurement *)right
{
    _right = right;
    _left = nil;
}

- (void)setTop:(DMeasurement *)top
{
    _top = top;
    _bottom = nil;
}

- (void)setBottom:(DMeasurement *)bottom
{
    _bottom = bottom;
    _top = nil;
}

- (void)setHeight:(DMeasurement *)height
{
    if (!height)
    {
        height = percent(100);
    }
    _height = height;
}

- (void)setWidth:(DMeasurement *)width
{
    if (!width)
    {
        width = percent(100);
    }
    _width = width;
}

- (void)setPadding:(DEdgeMeasurement *)padding
{
    if (!padding)
    {
        padding = [DEdgeMeasurement zeroEdgeMeasurement];
    }
    _padding = padding;
}

- (void)setMargin:(DEdgeMeasurement *)margin
{
    if (!margin)
    {
        margin = [DEdgeMeasurement zeroEdgeMeasurement];
    }
    _margin = margin;
}

+ (NSMutableDictionary *)allStyles
{
    static NSMutableDictionary *theValue = nil;
    @synchronized([self class]) // in a single threaded app you can omit the sync block
    {
        if (!theValue)
        {
            theValue = [NSMutableDictionary dictionary];
        }
    }
    return theValue;
}

+ (void)setStyle:(DStyle *)style forClass:(NSString *)class
{
    NSMutableDictionary *globalDecorStyles = [[self class] allStyles];
    if (!style)
    {
        [globalDecorStyles removeObjectForKey:class];
    }
    else
    {
        globalDecorStyles[class] = style;
    }
}

@end


text:
/*
Team 1
Name      Student Number
- James Byrne   C11393906
- Juozas Dapkunas   C12432832
*/

import lejos.nxt.*;
import lejos.nxt.Button;
import lejos.nxt.ButtonListener;
import lejos.nxt.SensorPort;
import lejos.robotics.subsumption.Arbitrator;
import lejos.robotics.subsumption.Behavior;

public class Main{

    public static void main(String [] args) {

        Button.ESCAPE.addButtonListener(new ButtonListener() {
            public void buttonPressed(Button b) {
                System.exit(0);
            }

            public void buttonReleased(Button b) {
                LCD.clear();
            }
        });

        Behavior carpet = new CarpetSensor();
        Behavior collision = new Touch();
        Behavior vacuum = new Sonar();
        Behavior [] bArray = {collision, carpet, vacuum};
        Arbitrator arby = new Arbitrator(bArray);
        arby.start();

        // Creates a new instance of the MyMap class
        MyMap map = new MyMap();
        // Holds the logic for getting the map of the room
        // i.e. its dimensions in units
        map.getOutline();
        // "Fills In" the map that was plotted beforehand
        map.fillIn();
    }

}


text:
package com.youcan.base.content;

public enum ContentGroup {
	WCL(1, "wcl", "网络摄像头直播内容"), VIDEO(2, "video", "视频内容"), JOURNALS(3,
			"journals", "报纸期刊内容");

	private final int id;
	private final String name;
	private final String label;

	private ContentGroup(int id, String name, String label) {
		this.id = id;
		this.name = name;
		this.label = label;
	}

	public int getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public String getLabel() {
		return label;
	}

	public static StringBuffer getJson() {
		StringBuffer json = new StringBuffer("{\"cgs\":[");
		ContentGroup[] cgs = ContentGroup.values();
		for (int i = 0; i < cgs.length; i++) {
			json.append("{\"id\":").append(cgs[i].getId())
					.append(",\"name\":\"").append(cgs[i].getName())
					.append("\",\"label\":\"").append(cgs[i].getLabel())
					.append("\"}");
			if (i < cgs.length - 1) {
				json.append(",");
			}
		}
		json.append("]}");
		return json;
	}
}


text:
package org.rapidnewsawards.messages;

import java.io.Serializable;
import java.util.LinkedList;

public class RecentSocials implements Serializable {
	private static final long serialVersionUID = 1L;
	public int numEditions;
	public EditionMessage edition;
	public boolean isNext;
	public boolean isCurrent;
	public boolean isStoryList = false;
	public boolean isNetworkList = true;
	public String order = "recent";
	public LinkedList<SocialInfo> list;
}


text:
package container_daemon

import (
	"github.com/docker/docker/pkg/term"
)

type TermPkg struct{}

func (TermPkg) GetWinsize(fd uintptr) (*term.Winsize, error) {
	return term.GetWinsize(fd)
}

func (TermPkg) SetWinsize(fd uintptr, size *term.Winsize) error {
	return term.SetWinsize(fd, size)
}

func (TermPkg) SetRawTerminal(fd uintptr) (*term.State, error) {
	return term.SetRawTerminal(fd)
}

func (TermPkg) RestoreTerminal(fd uintptr, state *term.State) error {
	return term.RestoreTerminal(fd, state)
}


text:
package com.github.pockethub.core.issue;

import com.github.pockethub.core.ResourcePager;

import org.eclipse.egit.github.core.Issue;

/**
 * Helper class for showing more and more pages of issues
 */
public abstract class IssuePager extends ResourcePager<Issue> {

    /**
     * Store to add loaded issues to
     */
    protected final IssueStore store;

    /**
     * Create issue pager
     *
     * @param store
     */
    public IssuePager(final IssueStore store) {
        this.store = store;
    }

    @Override
    protected Issue register(Issue resource) {
        return store.addIssue(resource);
    }

    @Override
    protected Object getId(Issue resource) {
        return resource.getId();
    }
}


text:
def test_integration(case, monkeypatch, pytestconfig):
    case.run()


text:
/* (c) British Telecommunications plc, 2009, All Rights Reserved */
package com.bt.pi.api.servlet;

import javax.servlet.http.HttpServletResponse;

public class WSSecurityHandlerException extends RuntimeException {
    private static final long serialVersionUID = -3108752903669563236L;
    private final int httpCode;

    public WSSecurityHandlerException(String message) {
        super(message);
        httpCode = HttpServletResponse.SC_BAD_REQUEST;
    }

    public WSSecurityHandlerException(String message, int theHttpCode) {
        super(message);
        this.httpCode = theHttpCode;
    }

    public WSSecurityHandlerException(Throwable t) {
        super(t);
        httpCode = HttpServletResponse.SC_BAD_REQUEST;

    }

    public int getHttpCode() {
        return httpCode;
    }

}


text:
package app.services.impl;

import app.dto.seedingDtos.CustomerDto;
import app.dto.viewDtos.CustomerDetailsViewDto;
import app.dto.viewDtos.CustomerViewDto;
import app.entities.Customer;
import app.repositories.CustomerRepository;
import app.services.api.CustomerService;
import app.utilities.io.EntityConverter;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

@Service
public class CustomerServiceImpl implements CustomerService {

    private CustomerRepository repository;

    public CustomerServiceImpl(CustomerRepository repository) {
        this.repository = repository;
    }

    @Override
    public void save(CustomerDto customerDto) {
        Customer customer = EntityConverter.convert(customerDto, Customer.class);
        repository.saveAndFlush(customer);
    }

    @Override
    public CustomerDto findById(Long id) {
        Customer byId = repository.findById(id);
        return EntityConverter.convert(byId, CustomerDto.class);
    }

    @Override
    public CustomerViewDto[] findAllCustomersOrderedByBirthDate() {
        List<Customer> allCustomers = repository.findAllCustomers();
        CustomerViewDto[] results = EntityConverter.convert(allCustomers, CustomerViewDto[].class);
        return results;
    }

    @Override
    public List<CustomerDetailsViewDto> findAllCustomersWithPurchasesDetails() {
        List<Object[]> customersObjects = repository.customersWithCars();
        List<CustomerDetailsViewDto> results = new ArrayList<>();
        for (Object[] customersObject : customersObjects) {
            CustomerDetailsViewDto customer = new CustomerDetailsViewDto();
            customer.setName(customersObject[0].toString());
            customer.setBoughtCars(Integer.parseInt(customersObject[1].toString()));
            customer.setTotalCost(BigDecimal.valueOf(Double.parseDouble(customersObject[2].toString())));
            results.add(customer);
        }
        return results;
    }
}


text:
<?php

namespace Awakenweb\Livedocx4Laravel;

use Awakenweb\Livedocx\Container;
use Awakenweb\Livedocx\Livedocx;
use Awakenweb\Livedocx\Soap\Client;
use Illuminate\Support\ServiceProvider;
use SoapClient;

class LivedocxServiceProvider extends ServiceProvider
{

    /**
     * Indicates if loading of the provider is deferred.
     *
     * @var bool
     */
    protected $defer = true;

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        $this->app->singleton('livedocx.livedocx', function() {
            $client = new Client(
                    new SoapClient(config('livedocx.wsdl'))
            );
            $client->connect(
                    config('livedocx.username'), config('livedocx.password')
            );
            return new Livedocx($client, new Container(), true);
        });
    }

    public function boot()
    {
        $this->publishes([
            __DIR__ . '/livedocx.php' => config_path('livedocx.php'),
        ]);
    }

    /**
     * Get the services provided by the provider.
     *
     * @return array
     */
    public function provides()
    {
        return array('livedocx.livedocx');
    }

}


text:
namespace ExtractAlbumsDataFromCatalog
{
    public interface IAlbum
    {
        string Name { get; }

        string Author { get; }
    }
}


text:
import { ActivityType, step } from '../../../serenity/recording';
import { Interaction, UsesAbilities } from '../../../serenity/screenplay';
import { BrowseTheWeb } from '../abilities/browse_the_web';

export class ResizeBrowserWindow {
    static toMaximum = (): Interaction => new MaximiseBrowserWindow();
    static to = (width: number, height: number): Interaction => new SetBrowserWindowSize(width, height);
}

class MaximiseBrowserWindow implements Interaction {
    @step('{0} maximises the browser window', ActivityType.Interaction)
    performAs(actor: UsesAbilities): PromiseLike<void> {
        return BrowseTheWeb.as(actor).manage().window().maximize();
    }
}

class SetBrowserWindowSize implements Interaction {
    constructor(private width: number, private height: number) {
    }

    @step('{0} sets the size of the browser window to #width x #height', ActivityType.Interaction)
    performAs(actor: UsesAbilities): PromiseLike<void> {
        return BrowseTheWeb.as(actor).manage().window().setSize(this.width, this.height);
    }
}


text:
    <button mat-icon-button matTooltip="Notifications" [matMenuTriggerFor]="notificationsMenu">

         <mat-icon>notifications</mat-icon>

    </button>
    <button mat-icon-button matTooltip="Full Screen" (click)="toggleFullscreen()" tqFullscreen>
      <mat-icon>{{(!isFullscreen)?'fullscreen':'fullscreen_exit'}}</mat-icon>
    </button>
    <button mat-icon-button matTooltip="Tapas" [mat-menu-trigger-for]="menu">

    </button>

    <mat-toolbar td-sidenav-content class="pad0">
      <button mat-icon-button td-menu-button matTooltip="Expand/Collapse" matTooltipPosition="after" (click)="toggleSidebar()">
        <mat-icon class="mat-24">{{(sideNavOpened)?'chevron_left':'chevron_right'}}</mat-icon>
      </button>
      TestDataGen
      <button mat-icon-button color="accent" matTooltip="My Apps" [routerLink]="['/home/myapps']">
          <mat-icon>apps</mat-icon>
      </button>
    </mat-toolbar>
    <mat-nav-list td-sidenav-content>

        <mat-icon mat-list-icon>dashboard</mat-icon>
        Dashboard

      <mat-divider></mat-divider>

        <mat-icon mat-list-icon>visibility</mat-icon>
        Analytics

      <mat-divider></mat-divider>

        <mat-icon mat-list-icon>donut_small</mat-icon>
        Events

      <mat-divider></mat-divider>

        <mat-icon mat-list-icon>network_check</mat-icon>
        Performance

      <mat-divider></mat-divider>

        <mat-icon mat-list-icon>blur_linear</mat-icon>
        Engagement

      <mat-divider></mat-divider>

        <mat-icon mat-list-icon>broken_image</mat-icon>
        Compagions

      <mat-divider></mat-divider>
      {{(sideNavOpened)?"Administration":"Adm"}}

        <mat-icon mat-list-icon>people</mat-icon>
        User Management

      <mat-divider></mat-divider>

        <mat-icon mat-list-icon>receipt</mat-icon>
        Integration

      <mat-divider></mat-divider>

        <mat-icon mat-list-icon>settings_applications</mat-icon>
        Settings

    </mat-nav-list>
    <tq-toolbox [tools]="getTools()"></tq-toolbox>

    <router-outlet></router-outlet>

    <tq-footer></tq-footer>

<mat-menu x-position="before" y-position="below" #menu="matMenu">
  <mat-icon mat-list-icon>person</mat-icon>Profile
  <mat-icon mat-list-icon>settings</mat-icon>Preferences
  <mat-icon mat-list-icon>help</mat-icon>Help
  <mat-icon mat-list-icon>power_settings_new</mat-icon>Sign Out
</mat-menu>

<mat-menu x-position="before" y-position="below" #notificationsMenu="matMenu">

Recent Notifications

    <mat-nav-list dense>

        <mat-icon mat-list-avatar>notifications</mat-icon>

Notifications component added

New component

      <mat-divider></mat-divider>

        <mat-icon mat-list-avatar>format_align_center</mat-icon>

JSON driven dynamic forms

New component

      <mat-divider></mat-divider>

        <mat-icon mat-list-avatar>call_to_action</mat-icon>

Sticky footer added to layouts

Component updated

      <mat-divider></mat-divider>

        <mat-icon mat-list-avatar>grid_on</mat-icon>

Nested object support for data-table

Component updated

      <mat-divider></mat-divider>

        <mat-icon mat-list-avatar>http</mat-icon>

HTTP path interceptors & transform support

Service updated

      <mat-divider></mat-divider>

        <mat-icon mat-list-avatar>notifications</mat-icon>

Angular 2.4.1 & Material2 Beta1

Dependencies updated

    </mat-nav-list>
    <button mat-button color="accent" td-menu-footer [routerLink]="['/home/notifications']">
      View More
    </button>

</mat-menu>


text:
using Foundation;
using System;
using System.CodeDom.Compiler;
using UIKit;
using System.Linq;

namespace PSTableViewExample.iOS
{
	partial class CountriesController : UIViewController
	{
		public CountriesViewModel ViewModel = new CountriesViewModel ();

		public CountriesController (IntPtr handle) : base (handle)
		{
		}

		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			TableView.Source = new PSTableViewSource (ViewModel.Items);

			ViewModel.RequestNextPage = OnRequestNextPage;
		}

		private void OnRequestNextPage (CountryItemViewModel viewModel)
		{
			var storyboard = UIStoryboard.FromName ("Main", null);
			var controller = storyboard.InstantiateViewController ("FruitController") as FruitController;

			controller.ViewModel = new FruitViewModel (viewModel);

			NavigationController.PushViewController (controller, true);
		}
	}
}


text:
<?php

namespace BusinessLogicLibrary\QueryFilter\Exception;

use Zend\Http\Response;

class UnrecognizedFieldException extends QueryFilterException
{
    public function __construct($message = '', $code = Response::STATUS_CODE_400, \Exception $previous = null)
    {
        parent::__construct($message, $code, $previous);
    }
}


text:
/// <reference path="jquery-1.6.2.js" />
/// <reference path="jquery.validate.js" />

$(function () {
    // Cache for dialogs
    var dialogs = {};

    var getValidationSummaryErrors = function ($form) {
        // We verify if we created it beforehand
        var errorSummary = $form.data('validation-summary-errors');
        if (!errorSummary) {
            errorSummary = $('
Please correct the errors and try again.

')
                .insertBefore($form);

            // Remember that we created it
            $form.data('validation-summary-errors', errorSummary);
        }

        return errorSummary;
    };

    var formSubmitHandler = function (e) {
        var $form = $(this);

        // We check if jQuery.validator exists on the form
        if (!$form.valid || $form.valid()) {
            $.post($form.attr('action'), $form.serializeArray())
                .done(function (json) {
                    json = json || {};

                    // In case of success, we redirect to the provided URL or the same page.
                    if (json.success) {
                        location = json.redirect || location.href;
                    } else if (json.errors) {
                        var errorSummary = getValidationSummaryErrors($form);

                        var items = $.map(json.errors, function (error) {
                            return '
' + error + '
';
                        }).join('');

                        var ul = errorSummary
                            .find('ul')
                            .empty()
                            .append(items);
                    }
                });
        }

        // Prevent the normal behavior since we opened the dialog
        e.preventDefault();
    };

    var loadAndShowDialog = function (id, link, url) {
        var separator = url.indexOf('?') >= 0 ? '&' : '?';

        // Save an empty jQuery in our cache for now.
        dialogs[id] = $();

        // Load the dialog with the content=1 QueryString in order to get a PartialView
        $.get(url + separator + 'content=1')
            .done(function (content) {
                dialogs[id] = $('
' + content + '
')
                    .hide() // Hide the dialog for now so we prevent flicker
                    .appendTo(document.body)
                    .filter('div') // Filter for the div tag only, script tags could surface
                    .dialog({ // Create the jQuery UI dialog
                        title: link.data('dialog-title'),
                        modal: true,
                        resizable: true,
                        draggable: true,
                        width: link.data('dialog-width') || 300
                    })
                    .find('form') // Attach logic on forms
                        .submit(formSubmitHandler)
                    .end();
            });
    };

    // List of link ids to have an ajax dialog
    var links = ['logonLink', 'registerLink'];

    $.each(links, function (i, id) {
        $('#' + id).click(function (e) {
            var link = $(this),
                url = link.attr('href');

            if (!dialogs[id]) {
                loadAndShowDialog(id, link, url);
            } else {
                dialogs[id].dialog('open');
            }

            // Prevent the normal behavior since we use a dialog
            e.preventDefault();
        });
    });
});


text:
<?php
//src/NNWelcome/NticBundle/Entity/HotelMetaTranslation.php

namespace NNWelcome\NticBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Gedmo\Translatable\Entity\MappedSuperclass\AbstractPersonalTranslation;

/**
 * @ORM\Entity
 * @ORM\Table(name="hotel_meta_translations",
 *     uniqueConstraints={@ORM\UniqueConstraint(name="lookup_unique_idx", columns={
 *         "locale", "object_id", "field"
 *     })}
 * )
 */
class HotelMetaTranslation extends AbstractPersonalTranslation
{
    /**
     * @ORM\ManyToOne(targetEntity="HotelMeta", inversedBy="translations")
     * @ORM\JoinColumn(name="object_id", referencedColumnName="id", onDelete="CASCADE")
     */
    protected $object;
}


text:
using EFCoreExtend.Sql.SqlConfig;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace EFCoreExtend.Lua.SqlConfig
{
    /// <summary>
    /// lua sql配置
    /// </summary>
    public interface ILuaSqlConfig
    {
        /// <summary>
        /// 配置的Tables
        /// </summary>
        IReadOnlyDictionary<string, ILuaConfigTableInfo> TableSqlInfos { get; }

        /// <summary>
        /// lua sql配置发生了修改触发的事件
        /// </summary>
        event Action OnModified;

        /// <summary>
        /// 初始化lua sql配置
        /// </summary>
        void Init();

        /// <summary>
        /// 设置数据参数到lua的全局变量中
        /// </summary>
        /// <param name="parameterName"></param>
        /// <param name="parameter"></param>
        /// <returns></returns>
        bool SetGlobalLuaParam(string parameterName, object parameter);

        /// <summary>
        /// 从lua全局变量中获取数据
        /// </summary>
        /// <param name="parameterName"></param>
        /// <returns></returns>
        IReadOnlyList<object> GetGlobalLuaParam(string parameterName);

        /// <summary>
        /// 设置数据参数到lua中,根据指定的表
        /// </summary>
        /// <param name="tableName"></param>
        /// <param name="parameterName"></param>
        /// <param name="parameter"></param>
        bool SetLuaParam(string tableName, string parameterName, object parameter);

        /// <summary>
        /// 从lua参数中获取数据,根据指定的表
        /// </summary>
        /// <param name="tableName"></param>
        /// <param name="parameterName"></param>
        /// <returns></returns>
        IReadOnlyList<object> GetLuaParam(string tableName, string parameterName);

        /// <summary>
        /// 添加配置
        /// </summary>
        /// <param name="tableName">表名</param>
        /// <param name="luascript">lua脚本</param>
        void Add(string tableName, string luascript);

        /// <summary>
        /// 移除配置
        /// </summary>
        /// <param name="tableName">表名</param>
        /// <returns></returns>
        bool Remove(string tableName);

        /// <summary>
        /// 清空配置
        /// </summary>
        void Clear();

        /// <summary>
        /// 运行lua脚本中的函数
        /// </summary>
        /// <param name="tableName">表名</param>
        /// <param name="sqlName">sql名称</param>
        /// <param name="luaFuncParameters">传递到lua函数中的参数</param>
        /// <returns></returns>
        LuaSqlConfigRunReturn Run(string tableName, string sqlName,
            object luaFuncParameters);

    }

    public class LuaSqlConfigRunReturn
    {
        public string Sql { get; set; }
        public ConfigSqlExecuteType Type { get; set; }
    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.zugaldia.capitalbikeshare" >

    <uses-feature android:name="android.hardware.type.watch" />

    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.DeviceDefault" >

        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity
            android:name=".ResponseActivity"
            android:label="ResponseActivity" >
        </activity>

    </application>

</manifest>


text:
using System.Collections.Generic;
using System.Linq;
using System.Xml.Serialization;
using EmptyKeys.Strategy.Units;
using EmptyKeys.Strategy.Units.Tasks;

namespace EmptyKeys.Strategy.AI.Components.ActionsPlanet
{
    /// <summary>
    /// Implements planet action for behavior. This action repairs any unit on orbit, which has hull bellow HullPercentage.
    /// </summary>
    /// <seealso cref="EmptyKeys.Strategy.AI.Components.BehaviorComponentBase" />
    public class PlanetRepairUnitsOnOrbit : BehaviorComponentBase
    {
        /// <summary>
        /// Gets or sets the hull percentage.
        /// </summary>
        /// <value>
        /// The hull percentage.
        /// </value>
        [XmlAttribute]
        public float HullPercentage { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="PlanetRepairUnitsOnOrbit"/> class.
        /// </summary>
        public PlanetRepairUnitsOnOrbit()
            : base()
        {
            HullPercentage = 1;
        }

        /// <summary>
        /// Executes behavior with given context
        /// </summary>
        /// <param name="context">The context.</param>
        /// <returns></returns>
        public override BehaviorReturnCode Behave(IBehaviorContext context)
        {
            PlanetBehaviorContext planetContext = context as PlanetBehaviorContext;
            if (planetContext == null)
            {
                returnCode = BehaviorReturnCode.Failure;
                return returnCode;
            }

            if (!planetContext.Planet.Orbit.Units.ContainsKey(planetContext.Planet.Owner))
            {
                returnCode = BehaviorReturnCode.Failure;
                return returnCode;
            }

            // TODO MT issue here?
            List<MoveableUnit> units = planetContext.Planet.Orbit.Units[planetContext.Planet.Owner].ToList();
            foreach (var unit in units)
            {
                if (unit.Hull == unit.HullMax || unit.Hull > unit.HullMax * HullPercentage || unit.IsDead || unit.Owner == null)
                {
                    continue;
                }

                if (unit.Owner.Energy < unit.RepairCost)
                {
                    returnCode = BehaviorReturnCode.Failure;
                    return returnCode;
                }

                RepairOnOrbitTask task = new RepairOnOrbitTask(unit);
                task.Execute();

                if (!task.IsTaskFinished)
                {
                    returnCode = BehaviorReturnCode.Failure;
                    return returnCode;
                }
            }

            returnCode = BehaviorReturnCode.Success;
            return returnCode;
        }
    }
}


text:
package hbase.keyDesign;

import static org.apache.hadoop.hbase.util.Bytes.toBytes;

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

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.client.Get;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.filter.BinaryComparator;
import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp;
import org.apache.hadoop.hbase.filter.FilterList;
import org.apache.hadoop.hbase.filter.QualifierFilter;
import org.apache.hadoop.hbase.util.Bytes;

public class FlatAndWideTableDataFacade implements DataFacade {

	private final HTable table;
	private final static byte [] ENTRY_FAMILY = toBytes("entry");
	public FlatAndWideTableDataFacade(Configuration conf) throws IOException{
		table = new HTable(conf, "Exercise_Book_FlatAndWide");
	}
	@Override
	public void close() throws IOException{
		table.close();
	}

	@Override
	public void save(Book book) throws IOException {
		Put put = new Put(toBytes(book.getAuthorId()));
		put.add(ENTRY_FAMILY, toBytes(dateToColumn(book.getPublishDate())),
				toBytes(book.getTitle()));
		table.put(put);
	}

	private String dateToColumn(Date date ){
		String reversedDateAsStr=
				Long.toString(Long.MAX_VALUE-date.getTime());
		StringBuilder builder = new StringBuilder();
		for ( int i = reversedDateAsStr.length(); i < 19; i++){
			builder.append('0');
		}
		builder.append(reversedDateAsStr);
		return builder.toString();
	}
	public Date columnToDate(String column){
		long reverseStamp = Long.parseLong(column);
		return new Date(Long.MAX_VALUE-reverseStamp);
	}

	@Override
	public List<Book> getBooks(String authorId, Date from,
			Date to) throws IOException {
		return null;
	}

}


text:
package net.ontrack.core.model;

import lombok.Data;

import java.util.List;

@Data
public class BranchLastStatus {

    private final BranchSummary branch;
    private final BuildSummary latestBuild;
    private final List<Promotion> promotions;

}


text:
@interface RFGraphsCell : UICollectionViewCell

@end


text:
using System;

namespace MinimumEditDistance {

    /// <summary>
    /// Holds the Levenshtein distance calculation method
    /// </summary>
    public static class Levenshtein {

        /// <summary>
        /// The maximum length of products of strings which the CLR will allow us to use a rectangular array for the algo
        /// </summary>
        public const int MaxStringProductLength = 536848900;

        /// <summary>
        /// Calculates the Levenshtein minimum edit distance from one string to another
        /// </summary>
        /// <param name="s"></param>
        /// <param name="t"></param>
        /// <param name="substitutionCost">int the cost of substituting one letter for another.  Typically 1 or 2</param>
        /// <returns></returns>
        public static int CalculateDistance(string s, string t, int substitutionCost) {
            if(string.IsNullOrEmpty(s) || string.IsNullOrEmpty(t))
               return CalculateDistance(s, t, substitutionCost, new RectangularArray(0, 0)); //will short circuit the algo
            else {
                if(s.Length * t.Length > MaxStringProductLength)
                    return CalculateDistance(s, t, substitutionCost, new JaggedArray(s.Length + 1, t.Length + 1)); //large strings, use large data structure
                else
                    return CalculateDistance(s, t, substitutionCost, new RectangularArray(s.Length + 1, t.Length + 1)); //small strings, can use rectangular array
           }
        }

        /// <summary>
        /// Calculates the Levenshtein minimum edit distance from one string to another -> optionally uses a MemoryStructure for the algo of your choice
        /// </summary>
        /// <param name="s"></param>
        /// <param name="t"></param>
        /// <param name="substitutionCost">int the cost of substituting one letter for another.  Typically 1 or 2</param>
        /// <param name="d"></param>
        /// <returns></returns>
        public static int CalculateDistance(string s, string t, int substitutionCost, MemoryStructure d)
        {

            //guard against nulls and empties
            if (string.IsNullOrEmpty(s))
            {
                if (string.IsNullOrEmpty(t))
                    return 0;
                return t.Length;
            }

            if (string.IsNullOrEmpty(t))
            {
                if (string.IsNullOrEmpty(s))
                    return 0;
                return s.Length;
            }

            var m = s.Length + 1;
            var n = t.Length + 1;

            // map empties to each other
            for (int i = 0; i < m; i++)
            {
                d[i, 0] = i;
            }
            for (int i = 0; i < n; i++)
            {
                d[0, i] = i;
            }

            for (int i = 1; i < m; i++)
            {
                for (int j = 1; j < n; j++)
                {
                    if (s[i - 1] == t[j - 1])
                    {
                        d[i, j] = d[i - 1, j - 1]; //no cost, letters the same
                    }
                    else
                    {
                        var delete = d[i - 1, j] + 1;
                        var insert = d[i, j - 1] + 1;
                        var substitution = d[i - 1, j - 1] + substitutionCost;
                        d[i, j] = Math.Min(delete, Math.Min(insert, substitution));
                    }
                }
            }

            return d[m - 1, n - 1];
        }

    }
}


text:
<!doctype html>

  <meta charset="utf-8">
  <meta name="description" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <title>Gitáros mise</title>

  <meta name="theme-color" content="#2E3AA1">

  <link rel="manifest" href="manifest.json">

  <meta name="msapplication-TileColor" content="#3372DF">

  <meta name="mobile-web-app-capable" content="yes">
  <meta name="application-name" content="PSK">
  <link rel="icon" sizes="192x192" href="images/touch/chrome-touch-icon-192x192.png">

  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="apple-mobile-web-app-title" content="Polymer Starter Kit">
  <link rel="apple-touch-icon" href="images/touch/apple-touch-icon.png">

  <meta name="msapplication-TileImage" content="images/touch/ms-touch-icon-144x144-precomposed.png">

  <link rel="stylesheet" href="styles/main.css">

  <link rel="import" href="elements/elements.html">

  <template is="dom-bind" id="app">

    <paper-drawer-panel id="paperDrawerPanel">

      <paper-scroll-header-panel drawer fixed>

        <paper-toolbar id="drawerToolbar">
          Menü
        </paper-toolbar>

        <paper-menu attr-for-selected="data-route" selected="[[route]]">

            <iron-icon icon="home"></iron-icon>
            Üdvözlet

            <iron-icon icon="communication:import-contacts"></iron-icon>
            Misesorok

            <iron-icon icon="image:add-to-photos"></iron-icon>
            Új dia készítése

        </paper-menu>
      </paper-scroll-header-panel>

      <paper-scroll-header-panel main id="headerPanelMain" condenses keep-condensed-header>

        <paper-toolbar id="mainToolbar" class="tall">
          <paper-icon-button id="paperToggle" icon="menu" paper-drawer-toggle></paper-icon-button>

          <paper-icon-button icon="refresh"></paper-icon-button>
          <paper-icon-button icon="search"></paper-icon-button>

[[title]]

A békásmegyeri Szent József templom gitáros zenekara

        </paper-toolbar>

          <iron-pages attr-for-selected="data-route" selected="{{route}}">

              <flow-text>„Énekeljetek új dalt az Úrnak, daloljatok neki szép öröméneket zengve!” (33. zsoltár)</flow-text>
              <promo-container>
                <promo-box caption="Bemutatkozunk" icon="image:music-note">Jó kis összefoglaló szöveg a zenekarról. Nem kell személyes, lehet valami
                  "mióta zenélünk így", vagy hasonló. Ide egy kis előzetest belőle.</promo-box>
                <promo-box caption="Misék" icon="communication:import-contacts">Valami összefoglaló a misén játszott énekekről.</promo-box>
              </promo-container>

              <paper-material elevation="1">

Misesorok :)

              </paper-material>

              <paper-material elevation="1">

Contact

This is the contact section

              </paper-material>

          </iron-pages>

      </paper-scroll-header-panel>
    </paper-drawer-panel>

    <paper-toast id="toast">
      Ok
    </paper-toast>

  </template>


text:
class AddSslAndCooldown < ActiveRecord::Migration
  def change

    add_column :servers, :peer_verify,:boolean, :null => false, :default => false
    add_column :servers, :cooldown,   :float,   :null => false, :default => 0.8

  end
end


text:
<?xml version="1.0"?>
<!--

-->
<tabs>
    <role-info>
        <class>\Mage\Adminhtml\Test\Block\Widget\Tab</class>
        <selector>#role_info_tabs_info</selector>
        <strategy>css selector</strategy>
        <fields>
            <role_name>
                <selector>[name='rolename']</selector>
                <strategy>css selector</strategy>
            </role_name>
        </fields>
    </role-info>
    <role-resources>
        <class>\Mage\Adminhtml\Test\Block\Permissions\Role\Edit\Tab\RoleResources</class>
        <selector>#role_info_tabs_account</selector>
        <strategy>css selector</strategy>
        <fields>
            <resource_access>
                <selector>[name="all"]</selector>
                <strategy>css selector</strategy>
                <input>select</input>
            </resource_access>
            <roles_resources>
                <selector>#resource-tree</selector>
                <strategy>css selector</strategy>
                <input>tree</input>
            </roles_resources>
        </fields>
    </role-resources>
</tabs>


text:
<?php
/**
 * The template for displaying 404 pages (not found).
 *
 * @package Oblique
 */

get_header(); ?>

					<?php oblique_svg_1(); ?>

<?php _e( 'Oops! That page can’t be found.', 'oblique' ); ?>

					<?php echo oblique_svg_3(); ?>

<?php _e( 'It looks like nothing was found at this location. Maybe try a search?', 'oblique' ); ?>

					<?php get_search_form(); ?>

<?php get_footer(); ?>


text:
package com.taoswork.tallycheck.datadomain.tallyuser;

import com.taoswork.tallycheck.datadomain.base.presentation.PresentationEnumClass;
import com.taoswork.tallycheck.general.extension.utils.IFriendlyEnum;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Gao Yuan on 2015/8/25.
 */
@PresentationEnumClass(unknownEnum = "unknown")
public enum Gender implements IFriendlyEnum<String> {
    male("M", "male"),
    female("F", "female"),
    unknown("U", "unknown");

    public static final String DEFAULT_CHAR = "U";

    private final String type;
    private final String friendlyType;

    private static final Map<String, Gender> typeToEnum = new HashMap<String, Gender>();

    static {
        for (Gender _enum : values()) {
            typeToEnum.put(_enum.type, _enum);
        }
    }

    Gender(String type, String friendlyType) {
        this.type = type;
        this.friendlyType = friendlyType;
    }

    public static Gender fromType(String character) {
        return typeToEnum.get(character);
    }

    @Override
    public String getType() {
        return type;
    }

    @Override
    public String getFriendlyType() {
        return friendlyType;
    }
}


text:
<?xml version="1.0" encoding="utf-8" ?>
<LearningStandardItem RefId="42D43D973FEF4A028D2AEAC7151A01DB" xml:lang="en">
  <StandardHierarchyLevel>
    <Number>4</Number>
    <Description>Cluster</Description>
  </StandardHierarchyLevel>
  <PredecessorItems>
    <LearningStandardItemRefId>193ACFCEF9554E9095FF14921505EB09</LearningStandardItemRefId>
  </PredecessorItems>
  <StatementCodes>
    <StatementCode>Mathematics.8.EE.1</StatementCode>
  </StatementCodes>
  <Statements>
    <Statement>Work with radicals and integer exponents.</Statement>
  </Statements>
  <GradeLevels>
    <GradeLevel>8</GradeLevel>
  </GradeLevels>
  <LearningStandardDocumentRefId>B62C1C106873438AA0126760075A65A3</LearningStandardDocumentRefId>
</LearningStandardItem>


text:
[View the Demo](https://strml.github.io/react-resizable/examples/1.html)

A simple widget that can be resized via a handle.

You can either use the `<Resizable>` element directly, or use the much simpler `<ResizableBox>` element.

See the example and associated code in [TestLayout](/test/TestLayout.js) and
[ResizableBox](/lib/ResizableBox.js) for more details.

Make sure you use the associated styles in [/css/styles.css](/css/styles.css), as without them, you will have
problems with handle placement and visibility.

You can pass options directly to the underlying `DraggableCore` instance by using the prop `draggableOpts`.
See the [demo](/test/TestLayout.js) for more on this.

### Installation

Using [npm](https://www.npmjs.com/):

    $ npm install --save react-resizable

### Usage

```js
const Resizable = require('react-resizable').Resizable; // or,
const ResizableBox = require('react-resizable').ResizableBox;

// ES6
import { Resizable, ResizableBox } from 'react-resizable';

// ...
render() {
  return (
    <ResizableBox width={200} height={200} draggableOpts={{...}}
        minConstraints={[100, 100]} maxConstraints={[300, 300]}>
      <span>Contents</span>
    </ResizableBox>
  );
}
```

### Props

These props apply to both `<Resizable>` and `<ResizableBox>`.

```js
{
  children: React.Element<any>,
  width: number,
  height: number,
  // If you change this, be sure to update your css
  handleSize: [number, number] = [10, 10],
  lockAspectRatio: boolean = false,
  axis: 'both' | 'x' | 'y' | 'none' = 'both',
  minConstraints: [number, number] = [10, 10],
  maxConstraints: [number, number] = [Infinity, Infinity],
  onResizeStop?: ?(e: SyntheticEvent, data: ResizeCallbackData) => any,
  onResizeStart?: ?(e: SyntheticEvent, data: ResizeCallbackData) => any,
  onResize?: ?(e: SyntheticEvent, data: ResizeCallbackData) => any,
  draggableOpts?: ?Object
};
```


text:
import _ from 'lodash';
import React from 'react';
import { FormattedMessage, injectIntl } from 'react-intl';
import PropTypes from 'prop-types';
import {
  List,
  Accordion,
  Badge,
  Headline
} from '@folio/stripes/components';

import PermissionLabel from '../PermissionLabel';
import { getPermissionLabelString } from '../data/converters/permission';

class RenderPermissions extends React.Component {
  static propTypes = {
    accordionId: PropTypes.string,
    expanded: PropTypes.bool,
    heading: PropTypes.node.isRequired,
    intl: PropTypes.shape({
      formatMessage: PropTypes.func.isRequired,
    }),
    listedPermissions: PropTypes.arrayOf(PropTypes.object),
    onToggle: PropTypes.func,
    permToRead: PropTypes.string.isRequired,
    stripes: PropTypes.shape({
      hasPerm: PropTypes.func.isRequired,
      config: PropTypes.shape({
        showPerms: PropTypes.bool,
        listInvisiblePerms: PropTypes.bool,
      }).isRequired,
    }).isRequired,
  };

  renderList() {
    const {
      intl: { formatMessage },
      listedPermissions,
      stripes,
    } = this.props;
    const showPerms = _.get(stripes, ['config', 'showPerms']);
    const listFormatter = item => ((
      <li key={item.permissionName}>
        <PermissionLabel permission={item} showRaw={showPerms} />
      </li>
    ));
    const noPermissionsFound = <FormattedMessage id="ui-users.permissions.empty" />;

    return (
      <List
        items={(listedPermissions || []).sort((a, b) => {
          const permA = getPermissionLabelString(a, formatMessage, showPerms);
          const permB = getPermissionLabelString(b, formatMessage, showPerms);

          return permA.localeCompare(permB);
        })}
        itemFormatter={listFormatter}
        isEmptyMessage={noPermissionsFound}
      />
    );
  }

  render() {
    const {
      accordionId,
      expanded,
      onToggle,
      listedPermissions,
      stripes,
      permToRead,
      heading,
    } = this.props;

    if (!stripes.hasPerm(permToRead)) { return null; }

    return (
      <Accordion
        open={expanded}
        id={accordionId}
        onToggle={onToggle}
        label={<Headline size="large" tag="h3">{heading}</Headline>}
        displayWhenClosed={
          <Badge>{listedPermissions.length}</Badge>
        }
      >
        {this.renderList()}
      </Accordion>
    );
  }
}

export default injectIntl(RenderPermissions);


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.videoanalyzer.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.List;

/** Properties for access validation based on JSON Web Tokens (JWT). */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@type")
@JsonTypeName("#Microsoft.VideoAnalyzer.JwtAuthentication")
@Fluent
public final class JwtAuthentication extends AuthenticationBase {
    /*
     * List of expected token issuers. Token issuer is valid if it matches at
     * least one of the given values.
     */
    @JsonProperty(value = "issuers")
    private List<String> issuers;

    /*
     * List of expected token audiences. Token audience is valid if it matches
     * at least one of the given values.
     */
    @JsonProperty(value = "audiences")
    private List<String> audiences;

    /*
     * List of additional token claims to be validated. Token must contains all
     * claims and respective values for it to be valid.
     */
    @JsonProperty(value = "claims")
    private List<TokenClaim> claims;

    /*
     * List of keys which can be used to validate access tokens. Having
     * multiple keys allow for seamless key rotation of the token signing key.
     * Token signature must match exactly one key.
     */
    @JsonProperty(value = "keys")
    private List<TokenKey> keys;

    /**
     * Get the issuers property: List of expected token issuers. Token issuer is valid if it matches at least one of the
     * given values.
     *
     * @return the issuers value.
     */
    public List<String> issuers() {
        return this.issuers;
    }

    /**
     * Set the issuers property: List of expected token issuers. Token issuer is valid if it matches at least one of the
     * given values.
     *
     * @param issuers the issuers value to set.
     * @return the JwtAuthentication object itself.
     */
    public JwtAuthentication withIssuers(List<String> issuers) {
        this.issuers = issuers;
        return this;
    }

    /**
     * Get the audiences property: List of expected token audiences. Token audience is valid if it matches at least one
     * of the given values.
     *
     * @return the audiences value.
     */
    public List<String> audiences() {
        return this.audiences;
    }

    /**
     * Set the audiences property: List of expected token audiences. Token audience is valid if it matches at least one
     * of the given values.
     *
     * @param audiences the audiences value to set.
     * @return the JwtAuthentication object itself.
     */
    public JwtAuthentication withAudiences(List<String> audiences) {
        this.audiences = audiences;
        return this;
    }

    /**
     * Get the claims property: List of additional token claims to be validated. Token must contains all claims and
     * respective values for it to be valid.
     *
     * @return the claims value.
     */
    public List<TokenClaim> claims() {
        return this.claims;
    }

    /**
     * Set the claims property: List of additional token claims to be validated. Token must contains all claims and
     * respective values for it to be valid.
     *
     * @param claims the claims value to set.
     * @return the JwtAuthentication object itself.
     */
    public JwtAuthentication withClaims(List<TokenClaim> claims) {
        this.claims = claims;
        return this;
    }

    /**
     * Get the keys property: List of keys which can be used to validate access tokens. Having multiple keys allow for
     * seamless key rotation of the token signing key. Token signature must match exactly one key.
     *
     * @return the keys value.
     */
    public List<TokenKey> keys() {
        return this.keys;
    }

    /**
     * Set the keys property: List of keys which can be used to validate access tokens. Having multiple keys allow for
     * seamless key rotation of the token signing key. Token signature must match exactly one key.
     *
     * @param keys the keys value to set.
     * @return the JwtAuthentication object itself.
     */
    public JwtAuthentication withKeys(List<TokenKey> keys) {
        this.keys = keys;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (claims() != null) {
            claims().forEach(e -> e.validate());
        }
        if (keys() != null) {
            keys().forEach(e -> e.validate());
        }
    }
}


text:
import os

class DataManager(object):
  def __init__(self, scan_directory):
    self.scans = os.listdir(scan_directory)


text:
namespace DivineInject.Test
{
    public interface ITestDependency
    {
    }
}


text:
package com.facebook.react.modules.location;

import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.location.LocationProvider;
import android.os.Bundle;
import android.os.Handler;

import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.Callback;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.common.SystemClock;
import com.facebook.react.module.annotations.ReactModule;
import com.facebook.react.modules.core.DeviceEventManagerModule.RCTDeviceEventEmitter;

import javax.annotation.Nullable;

/**
 * Native module that exposes Geolocation to JS.
 */
@ReactModule(name = "LocationObserver")
public class LocationModule extends ReactContextBaseJavaModule {

  private @Nullable String mWatchedProvider;
  private static final float RCT_DEFAULT_LOCATION_ACCURACY = 100;

  private final LocationListener mLocationListener = new LocationListener() {
    @Override
    public void onLocationChanged(Location location) {
      getReactApplicationContext().getJSModule(RCTDeviceEventEmitter.class)
          .emit("geolocationDidChange", locationToMap(location));
    }

    @Override
    public void onStatusChanged(String provider, int status, Bundle extras) {
      if (status == LocationProvider.OUT_OF_SERVICE) {
        emitError(PositionError.POSITION_UNAVAILABLE, "Provider " + provider + " is out of service.");
      } else if (status == LocationProvider.TEMPORARILY_UNAVAILABLE) {
        emitError(PositionError.TIMEOUT, "Provider " + provider + " is temporarily unavailable.");
      }
    }

    @Override
    public void onProviderEnabled(String provider) { }

    @Override
    public void onProviderDisabled(String provider) { }
  };

  public LocationModule(ReactApplicationContext reactContext) {
    super(reactContext);
  }

  @Override
  public String getName() {
    return "LocationObserver";
  }

  private static class LocationOptions {
    private final long timeout;
    private final double maximumAge;
    private final boolean highAccuracy;
    private final float distanceFilter;

    private LocationOptions(
      long timeout,
      double maximumAge,
      boolean highAccuracy,
      float distanceFilter) {
      this.timeout = timeout;
      this.maximumAge = maximumAge;
      this.highAccuracy = highAccuracy;
      this.distanceFilter = distanceFilter;
    }

    private static LocationOptions fromReactMap(ReadableMap map) {
      // precision might be dropped on timeout (double -> int conversion), but that's OK
      long timeout =
          map.hasKey("timeout") ? (long) map.getDouble("timeout") : Long.MAX_VALUE;
      double maximumAge =
          map.hasKey("maximumAge") ? map.getDouble("maximumAge") : Double.POSITIVE_INFINITY;
      boolean highAccuracy =
          map.hasKey("enableHighAccuracy") && map.getBoolean("enableHighAccuracy");
      float distanceFilter = map.hasKey("distanceFilter") ?
        (float) map.getDouble("distanceFilter") :
        RCT_DEFAULT_LOCATION_ACCURACY;

      return new LocationOptions(timeout, maximumAge, highAccuracy, distanceFilter);
    }
  }

  /**
   * Get the current position. This can return almost immediately if the location is cached or
   * request an update, which might take a while.
   *
   * @param options map containing optional arguments: timeout (millis), maximumAge (millis) and
   *        highAccuracy (boolean)
   */
  @ReactMethod
  public void getCurrentPosition(
      ReadableMap options,
      final Callback success,
      Callback error) {
    LocationOptions locationOptions = LocationOptions.fromReactMap(options);

    try {
      LocationManager locationManager =
          (LocationManager) getReactApplicationContext().getSystemService(Context.LOCATION_SERVICE);
      String provider = getValidProvider(locationManager, locationOptions.highAccuracy);
      if (provider == null) {
        emitError(PositionError.PERMISSION_DENIED, "No location provider available.");
        return;
      }
      Location location = locationManager.getLastKnownLocation(provider);
      if (location != null &&
          SystemClock.currentTimeMillis() - location.getTime() < locationOptions.maximumAge) {
        success.invoke(locationToMap(location));
        return;
      }
      new SingleUpdateRequest(locationManager, provider, locationOptions.timeout, success, error)
          .invoke();
    } catch (SecurityException e) {
      throwLocationPermissionMissing(e);
    }
  }

  /**
   * Start listening for location updates. These will be emitted via the
   * {@link RCTDeviceEventEmitter} as {@code geolocationDidChange} events.
   *
   * @param options map containing optional arguments: highAccuracy (boolean)
   */
  @ReactMethod
  public void startObserving(ReadableMap options) {
    if (LocationManager.GPS_PROVIDER.equals(mWatchedProvider)) {
      return;
    }
    LocationOptions locationOptions = LocationOptions.fromReactMap(options);

    try {
      LocationManager locationManager =
          (LocationManager) getReactApplicationContext().getSystemService(Context.LOCATION_SERVICE);
      String provider = getValidProvider(locationManager, locationOptions.highAccuracy);
      if (provider == null) {
        emitError(PositionError.PERMISSION_DENIED, "No location provider available.");
        return;
      }
      if (!provider.equals(mWatchedProvider)) {
        locationManager.removeUpdates(mLocationListener);
        locationManager.requestLocationUpdates(
          provider,
          1000,
          locationOptions.distanceFilter,
          mLocationListener);
      }
      mWatchedProvider = provider;
    } catch (SecurityException e) {
      throwLocationPermissionMissing(e);
    }
  }

  /**
   * Stop listening for location updates.
   *
   * NB: this is not balanced with {@link #startObserving}: any number of calls to that method will
   * be canceled by just one call to this one.
   */
  @ReactMethod
  public void stopObserving() {
    LocationManager locationManager =
        (LocationManager) getReactApplicationContext().getSystemService(Context.LOCATION_SERVICE);
    locationManager.removeUpdates(mLocationListener);
    mWatchedProvider = null;
  }

  @Nullable
  private static String getValidProvider(LocationManager locationManager, boolean highAccuracy) {
    String provider =
        highAccuracy ? LocationManager.GPS_PROVIDER : LocationManager.NETWORK_PROVIDER;
    if (!locationManager.isProviderEnabled(provider)) {
      provider = provider.equals(LocationManager.GPS_PROVIDER)
          ? LocationManager.NETWORK_PROVIDER
          : LocationManager.GPS_PROVIDER;
      if (!locationManager.isProviderEnabled(provider)) {
        return null;
      }
    }
    return provider;
  }

  private static WritableMap locationToMap(Location location) {
    WritableMap map = Arguments.createMap();
    WritableMap coords = Arguments.createMap();
    coords.putDouble("latitude", location.getLatitude());
    coords.putDouble("longitude", location.getLongitude());
    coords.putDouble("altitude", location.getAltitude());
    coords.putDouble("accuracy", location.getAccuracy());
    coords.putDouble("heading", location.getBearing());
    coords.putDouble("speed", location.getSpeed());
    map.putMap("coords", coords);
    map.putDouble("timestamp", location.getTime());

    if (android.os.Build.VERSION.SDK_INT >= 18) {
      map.putBoolean("mocked", location.isFromMockProvider());
    }

    return map;
  }

  private void emitError(int code, String message) {
    getReactApplicationContext().getJSModule(RCTDeviceEventEmitter.class)
        .emit("geolocationError", PositionError.buildError(code, message));
  }

  /**
   * Provides a clearer exception message than the default one.
   */
  private static void throwLocationPermissionMissing(SecurityException e) {
    throw new SecurityException(
      "Looks like the app doesn't have the permission to access location.\n" +
      "Add the following line to your app's AndroidManifest.xml:\n" +
      "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" />", e);
  }

  private static class SingleUpdateRequest {

    private final Callback mSuccess;
    private final Callback mError;
    private final LocationManager mLocationManager;
    private final String mProvider;
    private final long mTimeout;
    private final Handler mHandler = new Handler();
    private final Runnable mTimeoutRunnable = new Runnable() {
      @Override
      public void run() {
        synchronized (SingleUpdateRequest.this) {
          if (!mTriggered) {
            mError.invoke(PositionError.buildError(PositionError.TIMEOUT, "Location request timed out"));
            mLocationManager.removeUpdates(mLocationListener);
            mTriggered = true;
          }
        }
      }
    };
    private final LocationListener mLocationListener = new LocationListener() {
      @Override
      public void onLocationChanged(Location location) {
        synchronized (SingleUpdateRequest.this) {
          if (!mTriggered) {
            mSuccess.invoke(locationToMap(location));
            mHandler.removeCallbacks(mTimeoutRunnable);
            mTriggered = true;
          }
        }
      }

      @Override
      public void onStatusChanged(String provider, int status, Bundle extras) {}

      @Override
      public void onProviderEnabled(String provider) {}

      @Override
      public void onProviderDisabled(String provider) {}
    };
    private boolean mTriggered;

    private SingleUpdateRequest(
        LocationManager locationManager,
        String provider,
        long timeout,
        Callback success,
        Callback error) {
      mLocationManager = locationManager;
      mProvider = provider;
      mTimeout = timeout;
      mSuccess = success;
      mError = error;
    }

    public void invoke() {
      mLocationManager.requestSingleUpdate(mProvider, mLocationListener, null);
      mHandler.postDelayed(mTimeoutRunnable, mTimeout);
    }
  }
}


text:
import baseOrderBy from './_baseOrderBy.js';
import isArray from './isArray.js';

/**
 * This method is like `_.sortBy` except that it allows specifying the sort
 * orders of the iteratees to sort by. If `orders` is unspecified, all values
 * are sorted in ascending order. Otherwise, specify an order of "desc" for
 * descending or "asc" for ascending sort order of corresponding values.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Collection
 * @param {Array|Object} collection The collection to iterate over.
 * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
 *  The iteratees to sort by.
 * @param {string[]} [orders] The sort orders of `iteratees`.
 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
 * @returns {Array} Returns the new sorted array.
 * @example
 *
 * var users = [
 *   { 'user': 'fred',   'age': 48 },
 *   { 'user': 'barney', 'age': 34 },
 *   { 'user': 'fred',   'age': 40 },
 *   { 'user': 'barney', 'age': 36 }
 * ];
 *
 * // Sort by `user` in ascending order and by `age` in descending order.
 * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
 * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
 */
function orderBy(collection, iteratees, orders, guard) {
  if (collection == null) {
    return [];
  }
  if (!isArray(iteratees)) {
    iteratees = iteratees == null ? [] : [iteratees];
  }
  orders = guard ? undefined : orders;
  if (!isArray(orders)) {
    orders = orders == null ? [] : [orders];
  }
  return baseOrderBy(collection, iteratees, orders);
}

export default orderBy;


text:
package org.apache.airavata.registry.core.repositories.common;

import org.apache.airavata.common.utils.DBInitConfig;
import org.apache.airavata.common.utils.DBInitializer;
import org.apache.airavata.common.utils.DerbyTestUtil;
import org.apache.airavata.common.utils.DerbyUtil;
import org.apache.airavata.common.utils.JDBCConfig;
import org.apache.airavata.registry.core.utils.AppCatalogDBInitConfig;
import org.apache.airavata.registry.core.utils.ExpCatalogDBInitConfig;
import org.apache.airavata.registry.core.utils.ReplicaCatalogDBInitConfig;
import org.apache.airavata.registry.core.utils.WorkflowCatalogDBInitConfig;
import org.junit.After;
import org.junit.Before;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TestBase {

    private static final Logger logger = LoggerFactory.getLogger(TestBase.class);

    public enum Database {APP_CATALOG, EXP_CATALOG, REPLICA_CATALOG, WORKFLOW_CATALOG}

    private Database[] databases;

    public TestBase(Database... databases) {
        if (databases == null) {
            throw new IllegalArgumentException("Databases can not be null");
        }
        this.databases = databases;
    }

    @Before
    public void setUp() throws Exception {
        try {
            DerbyUtil.startDerbyInServerMode("127.0.0.1", 20000, "airavata", "airavata");

            for (Database database: databases) {
                logger.info("Creating database " + database.name());
                DerbyTestUtil.destroyDatabase(getDatabaseJDBCConfig(database));
                DBInitializer.initializeDB(getDBInitConfig(database));
            }
        } catch (Exception e) {
            logger.error("Failed to create the databases" , e);
            throw e;
        }
    }

    @After
    public void tearDown() throws Exception {
        for (Database database: databases) {
            System.out.println("Tearing down database " + database.name());
            DerbyTestUtil.destroyDatabase(getDatabaseJDBCConfig(database));
        }
        DerbyUtil.stopDerbyServer();
    }

    private JDBCConfig getDatabaseJDBCConfig(Database database) {
        return getDBInitConfig(database).getJDBCConfig();
    }

    private DBInitConfig getDBInitConfig(Database database) {
        switch (database) {
            case APP_CATALOG:
                return new AppCatalogDBInitConfig()
                    .setDbInitScriptPrefix("appcatalog");
            case EXP_CATALOG:
                return new ExpCatalogDBInitConfig()
                    .setDbInitScriptPrefix("expcatalog");
            case REPLICA_CATALOG:
                return new ReplicaCatalogDBInitConfig()
                    .setDbInitScriptPrefix("replicacatalog");
            case WORKFLOW_CATALOG:
                return new WorkflowCatalogDBInitConfig()
                    .setDbInitScriptPrefix("airavataworkflowcatalog");
            default:
                return null;
        }
    }

}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Uses of Interface org.drip.spline.grid.Span</title>
<meta name="date" content="2014-01-13">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Interface
org.drip.spline.grid.Span

Packages that use Span

Package
Description

org.drip.spline.grid

org.drip.state.curve

Uses of Span in org.drip.spline.grid

Classes in org.drip.spline.grid that implement Span

Modifier and Type
Class and Description

class
OverlappingStretchSpan

OverlappingStretchSpan implements the Span interface, and the collection functionality of overlapping
  Stretches.

Methods in org.drip.spline.grid that return Span

Modifier and Type
Method and Description

Span
OverlappingStretchSpan.toNonOverlapping()

Convert the Overlapping Stretch Span to a non-overlapping Stretch Span.

Uses of Span in org.drip.state.curve

Constructors in org.drip.state.curve with parameters of type Span

Constructor and Description

BasisSplineForwardRate(FloatingRateIndex fri,
                      Span span)

BasisSplineForwardRate constructor

DiscountFactorDiscountCurve(java.lang.String strCurrency,
                           Span span)

DiscountFactorDiscountCurve constructor

ZeroRateDiscountCurve(java.lang.String strCurrency,
                     Span span)

ZeroRateDiscountCurve constructor

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
from __future__ import unicode_literals

import datetime

from django import test
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse
from django.http import Http404
from django.test.utils import override_settings
from django.utils.encoding import force_str, force_text
from django.views.generic.base import View

from .models import Article, Artist, Author, Book, Page

@override_settings(ROOT_URLCONF='views.urls')
class ListViewTests(test.TestCase):

    @classmethod
    def setUpTestData(cls):
        cls.artist1 = Artist.objects.create(
            name='Rene Magritte'
        )
        cls.author1 = Author.objects.create(
            name='Roberto Bolaño',
            slug='roberto-bolano'
        )
        cls.author2 = Author.objects.create(
            name='Scott Rosenberg',
            slug='scott-rosenberg'
        )
        cls.book1 = Book.objects.create(
            name='2066',
            slug='2066',
            pages=800,
            pubdate=datetime.date(2008, 10, 1)
        )
        cls.book1.authors.add(cls.author1)
        cls.book2 = Book.objects.create(
            name='Dreaming in Code',
            slug='dreaming-in-code',
            pages=300,
            pubdate=datetime.date(2006, 5, 1)
        )
        cls.page1 = Page.objects.create(
            content='I was once bitten by a moose.',
            template='views_tests/page_template.html'
        )

    def _make_authors(self, n):
        Author.objects.all().delete()
        for i in range(n):
            Author.objects.create(name='Author %02i' % i, slug='a%s' % i)

    def test_items(self):
        res = self.client.get('/list/dict/')
        self.assertEqual(res.status_code, 200)
        self.assertTemplateUsed(res, 'views_tests/list.html')
        self.assertEqual(res.context['object_list'][0]['first'], 'John')

    def test_queryset(self):
        res = self.client.get('/list/authors/')
        self.assertEqual(res.status_code, 200)
        self.assertTemplateUsed(res, 'views_tests/author_list.html')
        self.assertEqual(list(res.context['object_list']), list(Author.objects.all()))
        self.assertIsInstance(res.context['view'], View)
        self.assertIs(res.context['author_list'], res.context['object_list'])
        self.assertEqual(res.context['query'].num_pages, 1)
        self.assertEqual(res.context['page_obj'].number, 1)
        self.assertFalse(res.context['is_paginated'])

    def test_paginated_queryset(self):
        self._make_authors(100)
        res = self.client.get('/list/authors/paginated/')
        self.assertEqual(res.status_code, 200)
        self.assertTemplateUsed(res, 'views_tests/author_list.html')
        self.assertEqual(len(res.context['object_list']), 30)
        self.assertIs(res.context['author_list'], res.context['object_list'])
        self.assertTrue(res.context['is_paginated'])
        self.assertEqual(res.context['query'].num_pages, 4)
        self.assertEqual(res.context['page_obj'].number, 1)
        self.assertEqual(res.context['author_list'][0].name, 'Author 00')
        self.assertEqual(list(res.context['author_list'])[-1].name, 'Author 29')

    def test_paginated_queryset_shortdata(self):
        # Test that short datasets ALSO result in a paginated view.
        res = self.client.get('/list/authors/paginated/')
        self.assertEqual(res.status_code, 200)
        self.assertTemplateUsed(res, 'views_tests/author_list.html')
        self.assertEqual(list(res.context['object_list']), list(Author.objects.all()))
        self.assertIs(res.context['author_list'], res.context['object_list'])
        self.assertEqual(res.context['query'].num_pages, 1)
        self.assertEqual(res.context['page_obj'].number, 1)
        self.assertFalse(res.context['is_paginated'])

    def test_paginated_get_page_by_query_string(self):
        self._make_authors(100)
        res = self.client.get('/list/authors/paginated/', {'page': '2'})
        self.assertEqual(res.status_code, 200)
        self.assertTemplateUsed(res, 'views_tests/author_list.html')
        self.assertEqual(len(res.context['object_list']), 30)
        self.assertIs(res.context['author_list'], res.context['object_list'])
        self.assertEqual(res.context['author_list'][0].name, 'Author 30')
        self.assertEqual(res.context['page_obj'].number, 2)

    def test_paginated_get_last_page_by_query_string(self):
        self._make_authors(100)
        res = self.client.get('/list/authors/paginated/', {'page': 'last'})
        self.assertEqual(res.status_code, 200)
        self.assertEqual(len(res.context['object_list']), 10)
        self.assertIs(res.context['author_list'], res.context['object_list'])
        self.assertEqual(res.context['author_list'][0].name, 'Author 90')
        self.assertEqual(res.context['page_obj'].number, 4)

    def test_paginated_page_out_of_range(self):
        self._make_authors(100)
        res = self.client.get('/list/authors/paginated/', {'page': '42'})
        self.assertEqual(res.status_code, 200)
        self.assertEqual(res.context['page_obj'].number, 1)

    def test_paginated_invalid_page(self):
        self._make_authors(100)
        res = self.client.get('/list/authors/paginated/?page=frog')
        self.assertEqual(res.status_code, 200)
        self.assertEqual(res.context['page_obj'].number, 1)

    def test_paginated_custom_page_kwarg(self):
        self._make_authors(100)
        res = self.client.get('/list/authors/paginated/custom_page_kwarg/', {'pagina': '2'})
        self.assertEqual(res.status_code, 200)
        self.assertTemplateUsed(res, 'views_tests/author_list.html')
        self.assertEqual(len(res.context['object_list']), 30)
        self.assertIs(res.context['author_list'], res.context['object_list'])
        self.assertEqual(res.context['author_list'][0].name, 'Author 30')
        self.assertEqual(res.context['page_obj'].number, 2)

    def test_paginated_orphaned_queryset(self):
        self._make_authors(92)
        res = self.client.get('/list/authors/paginated-orphaned/')
        self.assertEqual(res.status_code, 200)
        self.assertEqual(res.context['page_obj'].number, 1)
        res = self.client.get(
            '/list/authors/paginated-orphaned/', {'page': 'last'})
        self.assertEqual(res.status_code, 200)
        self.assertEqual(res.context['page_obj'].number, 3)
        res = self.client.get(
            '/list/authors/paginated-orphaned/', {'page': '3'})
        self.assertEqual(res.status_code, 200)
        self.assertEqual(res.context['page_obj'].number, 3)
        res = self.client.get(
            '/list/authors/paginated-orphaned/', {'page': '4'})
        self.assertEqual(res.status_code, 200)
        self.assertEqual(res.context['page_obj'].number, 1)

    def test_paginated_non_queryset(self):
        res = self.client.get('/list/dict/paginated/')

        self.assertEqual(res.status_code, 200)
        self.assertEqual(len(res.context['object_list']), 1)

    def test_verbose_name(self):
        res = self.client.get('/list/artists/')
        self.assertEqual(res.status_code, 200)
        self.assertTemplateUsed(res, 'views_tests/list.html')
        self.assertEqual(list(res.context['object_list']), list(Artist.objects.all()))
        self.assertIs(res.context['artist_list'], res.context['object_list'])
        self.assertEqual(res.context['query'].num_pages, 1)
        self.assertEqual(res.context['page_obj'].number, 1)
        self.assertFalse(res.context['is_paginated'])

    def test_allow_empty_false(self):
        res = self.client.get('/list/authors/notempty/')
        self.assertEqual(res.status_code, 200)
        Author.objects.all().delete()
        res = self.client.get('/list/authors/notempty/')
        self.assertEqual(res.status_code, 404)

    def test_template_name(self):
        res = self.client.get('/list/authors/template_name/')
        self.assertEqual(res.status_code, 200)
        self.assertEqual(list(res.context['object_list']), list(Author.objects.all()))
        self.assertIs(res.context['author_list'], res.context['object_list'])
        self.assertTemplateUsed(res, 'views_tests/list.html')

    def test_template_name_suffix(self):
        res = self.client.get('/list/authors/template_name_suffix/')
        self.assertEqual(res.status_code, 200)
        self.assertEqual(list(res.context['object_list']), list(Author.objects.all()))
        self.assertIs(res.context['author_list'], res.context['object_list'])
        self.assertTemplateUsed(res, 'views_tests/author_objects.html')

    def test_context_object_name(self):
        res = self.client.get('/list/authors/context_object_name/')
        self.assertEqual(res.status_code, 200)
        self.assertEqual(list(res.context['object_list']), list(Author.objects.all()))
        self.assertNotIn('authors', res.context)
        self.assertIs(res.context['author_list'], res.context['object_list'])
        self.assertTemplateUsed(res, 'views_tests/author_list.html')

    def test_duplicate_context_object_name(self):
        res = self.client.get('/list/authors/dupe_context_object_name/')
        self.assertEqual(res.status_code, 200)
        self.assertEqual(list(res.context['object_list']), list(Author.objects.all()))
        self.assertNotIn('authors', res.context)
        self.assertNotIn('author_list', res.context)
        self.assertTemplateUsed(res, 'views_tests/author_list.html')

    def test_missing_items(self):
        with self.assertRaises(ImproperlyConfigured):
            self.client.get('/list/authors/invalid/')

    def test_paginated_list_view_does_not_load_entire_table(self):
        self._make_authors(3)
        # 1 query for authors
        with self.assertNumQueries(1):
            res = self.client.get('/list/authors/notempty/')
            self.assertEqual(len(res.context['object_list']), 3)
        # same as above + 1 query to test if authors exist and for pagination
        with self.assertNumQueries(2):
            res = self.client.get('/list/authors/notempty/paginated/')
            self.assertEqual(len(res.context['object_list']), 2)

    def test_explicitly_ordered_list_view(self):
        Book.objects.create(name="Zebras for Dummies", pages=800, pubdate=datetime.date(2006, 9, 1))
        res = self.client.get('/list/books/sorted/')
        self.assertEqual(res.status_code, 200)
        self.assertEqual(res.context['object_list'][0].name, '2066')
        self.assertEqual(res.context['object_list'][1].name, 'Dreaming in Code')
        self.assertEqual(res.context['object_list'][2].name, 'Zebras for Dummies')

        res = self.client.get('/list/books/sortedbypagesandnamedesc/')
        self.assertEqual(res.status_code, 200)
        self.assertEqual(res.context['object_list'][0].name, 'Dreaming in Code')
        self.assertEqual(res.context['object_list'][1].name, 'Zebras for Dummies')
        self.assertEqual(res.context['object_list'][2].name, '2066')


text:
import React from 'react';
import createReactClass from 'create-react-class';
import PropTypes from 'prop-types';

export default createReactClass({
  displayName: 'Hook',

  propTypes: {
    model: PropTypes.object.isRequired
  },

  render: function() {
    const { model } = this.props;

    return (
      <div key={model.id}>
        {lore.forms.tweet.destroy(model, {
          blueprint: 'optimistic'
        })}
      </div>
    );
  }

});


text:
#if HAVE_CONFIG_H
#  include <config.h>
#endif

#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "FLAC/assert.h"
#include "FLAC/metadata.h"
#include "share/grabbag.h"

static int do_cuesheet(const char *infilename, FLAC__bool is_cdda, FLAC__uint64 lead_out_offset)
{
	FILE *fin, *fout;
	const char *error_message;
	char tmpfilename[4096];
	unsigned last_line_read;
	FLAC__StreamMetadata *cuesheet;

	FLAC__ASSERT(strlen(infilename) + 2 < sizeof(tmpfilename));

	/*
	 * pass 1
	 */
	if(0 == strcmp(infilename, "-")) {
		fin = stdin;
	}
	else if(0 == (fin = fopen(infilename, "r"))) {
		fprintf(stderr, "can't open file %s for reading: %s\n", infilename, strerror(errno));
		return 255;
	}
	if(0 != (cuesheet = grabbag__cuesheet_parse(fin, &error_message, &last_line_read, is_cdda, lead_out_offset))) {
		if(fin != stdin)
			fclose(fin);
	}
	else {
		printf("pass1: parse error, line %u: \"%s\"\n", last_line_read, error_message);
		if(fin != stdin)
			fclose(fin);
		return 1;
	}
	if(!FLAC__metadata_object_cuesheet_is_legal(cuesheet, is_cdda, &error_message)) {
		printf("pass1: illegal cuesheet: \"%s\"\n", error_message);
		FLAC__metadata_object_delete(cuesheet);
		return 1;
	}
	sprintf(tmpfilename, "%s.1", infilename);
	if(0 == (fout = fopen(tmpfilename, "w"))) {
		fprintf(stderr, "can't open file %s for writing: %s\n", tmpfilename, strerror(errno));
		FLAC__metadata_object_delete(cuesheet);
		return 255;
	}
	grabbag__cuesheet_emit(fout, cuesheet, "\"dummy.wav\" WAVE");
	FLAC__metadata_object_delete(cuesheet);
	fclose(fout);

	/*
	 * pass 2
	 */
	if(0 == (fin = fopen(tmpfilename, "r"))) {
		fprintf(stderr, "can't open file %s for reading: %s\n", tmpfilename, strerror(errno));
		return 255;
	}
	if(0 != (cuesheet = grabbag__cuesheet_parse(fin, &error_message, &last_line_read, is_cdda, lead_out_offset))) {
		if(fin != stdin)
			fclose(fin);
	}
	else {
		printf("pass2: parse error, line %u: \"%s\"\n", last_line_read, error_message);
		if(fin != stdin)
			fclose(fin);
		return 1;
	}
	if(!FLAC__metadata_object_cuesheet_is_legal(cuesheet, is_cdda, &error_message)) {
		printf("pass2: illegal cuesheet: \"%s\"\n", error_message);
		FLAC__metadata_object_delete(cuesheet);
		return 1;
	}
	sprintf(tmpfilename, "%s.2", infilename);
	if(0 == (fout = fopen(tmpfilename, "w"))) {
		fprintf(stderr, "can't open file %s for writing: %s\n", tmpfilename, strerror(errno));
		FLAC__metadata_object_delete(cuesheet);
		return 255;
	}
	grabbag__cuesheet_emit(fout, cuesheet, "\"dummy.wav\" WAVE");
	FLAC__metadata_object_delete(cuesheet);
	fclose(fout);

	return 0;
}

int main(int argc, char *argv[])
{
	FLAC__uint64 lead_out_offset;
	FLAC__bool is_cdda = false;
	const char *usage = "usage: test_cuesheet cuesheet_file lead_out_offset [ cdda ]\n";

	if(argc > 1 && 0 == strcmp(argv[1], "-h")) {
		printf(usage);
		return 0;
	}

	if(argc < 3 || argc > 4) {
		fprintf(stderr, usage);
		return 255;
	}

	lead_out_offset = (FLAC__uint64)strtoul(argv[2], 0, 10);
	if(argc == 4) {
		if(0 == strcmp(argv[3], "cdda"))
			is_cdda = true;
		else {
			fprintf(stderr, usage);
			return 255;
		}
	}

	return do_cuesheet(argv[1], is_cdda, lead_out_offset);
}


text:
#ifndef Magnum_Trade_MeshObjectData3D_h
#define Magnum_Trade_MeshObjectData3D_h

/** @file
 * @brief Class @ref Magnum::Trade::MeshObjectData3D
 */

#include "Magnum/Trade/ObjectData3D.h"

namespace Magnum { namespace Trade {

/**
@brief Three-dimensional mesh object data

Provides access to material information for given mesh instance.
@see @ref MeshObjectData2D
*/
class MAGNUM_EXPORT MeshObjectData3D: public ObjectData3D {
    public:
        /**
         * @brief Constructor
         * @param children          Child objects
         * @param transformation    Transformation (relative to parent)
         * @param instance          Instance ID
         * @param material          Material ID or `-1`
         *
         * Creates object with mesh instance type.
         */
        explicit MeshObjectData3D(std::vector<UnsignedInt> children, const Matrix4& transformation, UnsignedInt instance, Int material);

        /** @brief Copying is not allowed */
        MeshObjectData3D(const MeshObjectData3D&) = delete;

        /** @brief Move constructor */
        MeshObjectData3D(MeshObjectData3D&&) = default;

        /** @brief Copying is not allowed */
        MeshObjectData3D& operator=(const MeshObjectData3D&) = delete;

        /** @brief Move assignment */
        MeshObjectData3D& operator=(MeshObjectData3D&&) = default;

        /**
         * @brief Material ID
         *
         * Returns `-1` if the object has no material assigned.
         */
        Int material() const { return _material; }

    private:
        Int _material;
};

}}

#endif


text:
from pyligaforex.services.auth.interfaces import IPlatforms
from pycloudia.uitls.structs import AbstractRegistry

class Registry(AbstractRegistry, IPlatforms):
    pass