text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.6.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.6.0/distro-source/core/src/gwt-module.dtd">
<module rename-to='mvp4gmodules'>
  <!-- Inherit the core Web Toolkit stuff.                        -->
  <inherits name='com.google.gwt.user.User'/>

  <!-- Inherit the default GWT style sheet.  You can change       -->
  <!-- the theme of your GWT application by uncommenting          -->
  <!-- any one of the following lines.                            -->
  <inherits name='com.google.gwt.user.theme.standard.Standard'/>
  <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
  <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/>     -->

  <!-- Other module inherits                                      -->
  <inherits name='com.mvp4g.Mvp4gModule'/>

  <!-- Specify the app entry point class.                         -->
  <entry-point class='com.mvp4g.example.client.Mvp4gModules'/>

  <!-- Specify the paths for translatable code                    -->
  <source path='client'/>

  <define-property name="ginModule" values="com$mvp4g$client$DefaultMvp4gGinModule,com$mvp4g$example$client$FirefoxGinModule" />

  <!-- Provide a default -->
  <set-property name="ginModule" value="com$mvp4g$client$DefaultMvp4gGinModule" />
  <set-property name="ginModule" value="com$mvp4g$example$client$FirefoxGinModule">
  	<when-property-is name="user.agent" value="gecko1_8" />
  </set-property>
  <!-- <set-property name="user.agent" value="safari" />  -->

  <!-- Super Dev Mode                                             -->
  <add-linker name="xsiframe"/>
  <set-configuration-property name="devModeRedirectEnabled" value="true"/>

  <set-configuration-property name="gwt.superdevmode" value="on"/>
  <set-configuration-property name="generatorResultCachingEnabled" value="true"/>

  <set-configuration-property name="devModeUrlWhitelistRegexp" value="http://(localhost|127\.0\.0\.1)(:\d+)?/.*" />
</module>


text:
int start_server(void);

#endif

redpajama_set_name: RedPajamaGithub


text:
package io.jenetics.prog.op;

import static org.assertj.core.api.Assertions.assertThat;
import static io.jenetics.prog.op.MathExprTestData.EXPRESSIONS;
import static io.jenetics.prog.op.MathExprTestData.EXPRESSIONS_TOKENS;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import io.jenetics.ext.internal.parser.Token;

/**
 * @author Franz Wilhelmstötter
 */
public class MathStringTokenizerTest {

	@Test(dataProvider = "expressions")
	public void tokenize(final String expression, final List<String> tokens) {
		final var tokenizer = new MathStringTokenizer(expression);

		assertThat(
			tokenizer.tokens()
				.map(Token::value)
				.toList()
		).isEqualTo(tokens);
	}

	@DataProvider
	public Object[][] expressions() {
		return IntStream.range(0, EXPRESSIONS.size())
			.mapToObj(i -> new Object[] { EXPRESSIONS.get(i), EXPRESSIONS_TOKENS.get(i) })
			.toArray(Object[][]::new);
	}

	public static void main(final String[] args) {
		MathExprTestData.EXPRESSIONS.forEach(expr -> {
			final var tokenizer = new MathStringTokenizer(expr);
			final var tokens = tokenizer.tokens()
				.map(Token::value)
				.collect(Collectors.joining("|"));

			System.out.println(tokens);
		});
	}

}


text:
package io.cattle.platform.api.cluster;

import com.netflix.config.DynamicStringProperty;
import io.cattle.platform.archaius.util.ArchaiusUtil;
import io.cattle.platform.core.addon.RegistrationToken;
import io.cattle.platform.core.constants.ClusterConstants;
import io.cattle.platform.core.constants.CommonStatesConstants;
import io.cattle.platform.core.model.Cluster;
import io.cattle.platform.object.util.DataAccessor;
import io.cattle.platform.server.context.ServerContext;
import io.cattle.platform.server.context.ServerContext.BaseProtocol;
import io.github.ibuildthecloud.gdapi.context.ApiContext;
import io.github.ibuildthecloud.gdapi.model.Resource;
import io.github.ibuildthecloud.gdapi.request.ApiRequest;
import io.github.ibuildthecloud.gdapi.response.ResourceOutputFilter;

public class ClusterOutputFilter implements ResourceOutputFilter {

    private static final DynamicStringProperty DOCKER_CMD = ArchaiusUtil.getString("docker.register.command");
    private static final DynamicStringProperty WINDOWS_CMD = ArchaiusUtil.getString("windows.register.command");
    private static final DynamicStringProperty CLUSTER_CMD = ArchaiusUtil.getString("k8s.register.command");
    private static final DynamicStringProperty REQUIRED_IMAGE = ArchaiusUtil.getString("bootstrap.required.image");

    @Override
    public Resource filter(ApiRequest request, Object original, Resource converted) {
        if (!(original instanceof Cluster)) {
            return converted;
        }

        Cluster cluster = (Cluster) original;

        RegistrationToken regToken = DataAccessor.field(original, ClusterConstants.FIELD_REGISTRATION, RegistrationToken.class);
        if (regToken == null) {
            return converted;
        }

        String token = regToken.getToken();
        String hostUrl = regUrl(token);
        String clusterUrl = regUrl(token + ".yaml");

        String hostCommand = String.format(DOCKER_CMD.get(), REQUIRED_IMAGE.get(), hostUrl);
        String clusterCommand = String.format(CLUSTER_CMD.get(), clusterUrl);
        String windowsCommand = String.format(WINDOWS_CMD.get(), hostUrl);

        regToken.setClusterCommand(clusterCommand);
        regToken.setHostCommand(hostCommand);
        regToken.setWindowsCommand(windowsCommand);
        regToken.setToken(token);
        regToken.setImage(REQUIRED_IMAGE.get());
        regToken.setRegistrationUrl(hostUrl);

        if (!CommonStatesConstants.INACTIVE.equals(cluster.getState())) {
            regToken.setClusterCommand(null);
        }

        if (DataAccessor.fieldObject(cluster, ClusterConstants.FIELD_K8S_CLIENT_CONFIG) != null) {
            regToken.setHostCommand(null);
            regToken.setWindowsCommand(null);
        }

        converted.getFields().put(ClusterConstants.FIELD_REGISTRATION, regToken);

        return converted;
    }

    public static String regUrl(String token) {
        if (ServerContext.isCustomApiHost()) {
            return ServerContext.getHostApiBaseUrl(BaseProtocol.HTTP) + "/scripts/" + token;
        } else {
            return ApiContext.getUrlBuilder().resourceReferenceLink("scripts", token).toExternalForm();
        }
    }

}


text:
<?php

namespace duncan3dc\Laravel;

use Illuminate\Contracts\View\Factory as FactoryInterface;
use Illuminate\Contracts\View\View as ViewInterface;

/**
 * Standalone class for generating text using blade templates.
 */
interface BladeInterface extends FactoryInterface
{
    /**
     * Add another extension to use to search for template files.
     *
     * @param string $extension (eg 'blade.php', or 'template')
     *
     * @return $this
     */
    public function addExtension(string $extension): BladeInterface;

    /**
     * Register a custom Blade compiler.
     *
     * @param callable $compiler
     *
     * @return $this
     */
    public function extend(callable $compiler): BladeInterface;

    /**
     * Register a handler for custom directives.
     *
     * @param string $name
     * @param callable $handler
     *
     * @return $this
     */
    public function directive(string $name, callable $handler): BladeInterface;

    /**
     * Register a component alias directive.
     *
     * @param string $path Path to blade component e.g. `components.radio-input`.
     * @param string|null $alias Name of the component alias. By default the component filename will be used
     *
     * @return $this
     */
    public function aliasComponent(string $path, string $alias = null): BladeInterface;

    /**
     * @deprecated Use aliasComponent()
     */
    public function component(string $path, string $alias = null): BladeInterface;

    /**
     * Register an custom conditional directive.
     *
     * @param string $name
     * @param callable $handler
     *
     * @return $this
     */
    public function if(string $name, callable $handler): BladeInterface;

    /**
     * Add a path to look for views in.
     *
     * @param string $path The path to look in
     *
     * @return $this
     */
    public function addPath(string $path): BladeInterface;

    /**
     * Check if a view exists.
     *
     * @param string $view The name of the view to check
     *
     * @return bool
     */
    public function exists($view): bool;

    /**
     * Share data across all views.
     *
     * @param string $key The name of the variable to share
     * @param mixed $value The value to assign to the variable
     *
     * @return $this
     */
    public function share($key, $value = null): BladeInterface;

    /**
     * Register a composer.
     *
     * @param string $key The name of the composer to register
     * @param mixed $value The closure or class to use
     *
     * @return array
     */
    public function composer($key, $value): array;

    /**
     * Register a creator.
     *
     * @param string $key The name of the creator to register
     * @param mixed $value The closure or class to use
     *
     * @return array
     */
    public function creator($key, $value): array;

    /**
     * Add a new namespace to the loader.
     *
     * @param string $namespace The namespace to use
     * @param array|string $hints The hints to apply
     *
     * @return $this
     */
    public function addNamespace($namespace, $hints): BladeInterface;

    /**
     * Replace the namespace hints for the given namespace.
     *
     * @param string $namespace The namespace to replace
     * @param array|string $hints The hints to use
     *
     * @return $this
     */
    public function replaceNamespace($namespace, $hints): BladeInterface;

    /**
     * Get the evaluated view contents for the given path.
     *
     * @param string $path The path of the file to use
     * @param array $data The parameters to pass to the view
     * @param array $mergeData The extra data to merge
     *
     * @return ViewInterface The generated view
     */
    public function file($path, $data = [], $mergeData = []): ViewInterface;

    /**
     * Generate a view.
     *
     * @param string $view The name of the view to make
     * @param array $params The parameters to pass to the view
     * @param array $mergeData The extra data to merge
     *
     * @return ViewInterface The generated view
     */
    public function make($view, $params = [], $mergeData = []): ViewInterface;

    /**
     * Get the content by generating a view.
     *
     * @param string $view The name of the view to make
     * @param array $params The parameters to pass to the view
     *
     * @return string The generated content
     */
    public function render(string $view, array $params = []): string;
}


text:
using System;

namespace Server.Factions
{
	public class Magincia : Town
	{
		public Magincia()
		{
			Definition =
				new TownDefinition(
					7,
					0x1870,
					"Magincia",
					"Magincia",
					new TextDefinition( 1011440, "MAGINCIA" ),
					new TextDefinition( 1011568, "TOWN STONE FOR MAGINCIA" ),
					new TextDefinition( 1041041, "The Faction Sigil Monolith of Magincia" ),
					new TextDefinition( 1041411, "The Faction Town Sigil Monolith of Magincia" ),
					new TextDefinition( 1041420, "Faction Town Stone of Magincia" ),
					new TextDefinition( 1041402, "Faction Town Sigil of Magincia" ),
					new TextDefinition( 1041393, "Corrupted Faction Town Sigil of Magincia" ),
					new Point3D( 3714, 2235, 20 ),
					new Point3D( 3712, 2230, 20 ) );
		}
	}
}


text:
cstApp.controller('linksButton', ['$scope', 'links', function($scope, links) {
    // $scope.variable = '';

    var replaceVariables = function(itemList) {
        for (var i in itemList) {
            itemList[i].url = itemList[i].url.replace('SYMBOL', $scope.variable);
        }
    }

    var data = links.getData();
    replaceVariables(data.items.custom);
    replaceVariables(data.items.default);
    $scope.links = data;

    $scope.$on('linksUpdate', function(event, data) {
        var linksData = links.getData();
        replaceVariables(linksData.items.custom);
        replaceVariables(linksData.items.default);
        $scope.links = linksData;
        if (data.apply) $scope.$apply();
    });
}]);

cstApp.controller('linksConfig', ['$scope', 'links', function($scope, links) {
    // Provide some default patterns.
    $scope.links = links.getData();
    $scope.export = { pretty: false, data: '' };
    $scope.addLink = { name: '', url: '' };

    $scope.$on('linksUpdate', function(event, data) {
        $scope.links = links.getData();
        if (data.apply) $scope.$apply();
    });
    $scope.add = function() {
        var result = links.addItem($scope.addLink);
        if (!result.success) {
            $('#saveConfirmLinks').html('
xFailed to add link: '+result.message+'
');
        } else {
            $scope.addLink = { name: '', url: '' };
        }
    };
    $scope.remove = function(index) {
        links.removeItem(index);
    };
    $scope.export = function() {
        var linksObject = JSON.stringify(links.getData(), null, ($scope.export.pretty * 4));
        $scope.export.data = linksObject;
    };
    $scope.reset = function() {
        links.reset(function(result) {
            if (result.success) {
                $('#saveConfirmLinks').html('
xReset!
');
            } else {
                $('#saveConfirmLinks').html('
xFailed to reset: '+result.message+'
');
            }
        });
    };
    $scope.import = function() {
        links.reset(function(result) {
            if (result.success) {
                $('#saveConfirmLinks').html('
xImported!
');
            } else {
                $('#saveConfirmLinks').html('
xFailed to import: '+result.message+'
');
            }
        }, $scope.export.data);
    };
    $scope.save = function() {
        var result = links.setData($scope.links);
        if (result.success) {
            links.save(function(result) {
                if (result.success) {
                    $('#saveConfirmLinks').html('
xSaved!
');
                } else {
                    $('#saveConfirmLinks').html('
xFailed to save: '+result.message+'
');
                }
            });
        } else {
            $('#saveConfirmLinks').html('
xFailed to save: '+result.message+'
');
        }
    };

}]);


text:
package stackongo

import (
	"fmt"
	"strings"
)

// TimelineForUsers returns a subset of the actions the users with given ids have taken on the site.
func (session Session) TimelineForUsers(ids []int, params map[string]string) (output *UserTimelines, error error) {
	string_ids := []string{}
	for _, v := range ids {
		string_ids = append(string_ids, fmt.Sprintf("%v", v))
	}
	request_path := strings.Join([]string{"users", strings.Join(string_ids, ";"), "timeline"}, "/")

	output = new(UserTimelines)
	error = session.get(request_path, params, output)
	return
}


text:
package edu.isistan.poo;

public class ClaseE extends ClaseB implements InterfaceI {

  @override
  public String metodo4(){
         return "Implementación de metodo4 en ClaseE";
  }
}


text:
var s3 = require('../')
var test = require('tape')
var assert = require('assert')

test('gets public URL', function(assert) {
  assert.plan(3)
  var httpsUrl = s3.getHttps('mybucket', 'path/to/key')
  assert.equal(httpsUrl, 'https://s3.amazonaws.com/mybucket/path/to/key')
  var httpUrl = s3.getHttp('mybucket', 'path/to/key')
  assert.equal(httpUrl, 'http://mybucket.s3.amazonaws.com/path/to/key')
  // treat slashes literally
  httpsUrl = s3.getHttps('marina-restaurant.at', 'uploads/about_restaurant_10.jpg', 'eu-west-1')
  assert.equal(httpsUrl, 'https://s3-eu-west-1.amazonaws.com/marina-restaurant.at/uploads/about_restaurant_10.jpg')
})


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FinancialControl.Model
{
	public class PropertyModelException
		: ModelException
	{
		public string Entity { get; set; }

		public string Property { get; set; }

		protected PropertyModelException(string msg, string entity, string property)
			: this(msg, entity, property, null)
		{
		}

		protected PropertyModelException(string msg, string entity, string property, Exception innerException)
			: base(msg, innerException)
		{
			this.Entity = entity;
			this.Property = property;
		}

	}
}


text:
NS_ASSUME_NONNULL_BEGIN

@interface SDLLockScreenManager ()

@property (assign, nonatomic) BOOL canPresent;
@property (strong, nonatomic, readwrite) SDLLockScreenConfiguration *config;
@property (strong, nonatomic) id<SDLViewControllerPresentable> presenter;
@property (strong, nonatomic, nullable) SDLOnLockScreenStatus *lastLockNotification;

@end

@implementation SDLLockScreenManager

- (instancetype)initWithConfiguration:(SDLLockScreenConfiguration *)config notificationDispatcher:(nullable id)dispatcher presenter:(id<SDLViewControllerPresentable>)presenter {
    self = [super init];
    if (!self) {
        return nil;
    }

    _canPresent = NO;
    _config = config;
    _presenter = presenter;

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sdl_lockScreenStatusDidChange:) name:SDLDidChangeLockScreenStatusNotification object:dispatcher];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sdl_lockScreenIconReceived:) name:SDLDidReceiveLockScreenIcon object:dispatcher];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sdl_appDidBecomeActive:) name:UIApplicationDidBecomeActiveNotification object:nil];

    return self;
}

- (void)start {
    self.canPresent = NO;

    // Create and initialize the lock screen controller depending on the configuration
    if (!self.config.enableAutomaticLockScreen) {
        self.presenter.lockViewController = nil;
        return;
    } else if (self.config.customViewController != nil) {
        self.presenter.lockViewController = self.config.customViewController;
    } else {
        SDLLockScreenViewController *viewController = nil;

        @try {
            viewController = [[UIStoryboard storyboardWithName:@"SDLLockScreen" bundle:[NSBundle sdlBundle]] instantiateInitialViewController];
        } @catch (NSException *exception) {
            SDLLogE(@"Attempted to instantiate the default SDL Lock Screen and could not find the storyboard. Be sure the 'SmartDeviceLink' bundle is within your main bundle. We're just going to return without instantiating the lock screen");
            return;
        }

        viewController.appIcon = self.config.appIcon;
        viewController.backgroundColor = self.config.backgroundColor;
        self.presenter.lockViewController = viewController;
    }

    self.canPresent = YES;
}

- (void)stop {
    self.canPresent = NO;

    // Remove the lock screen if presented, don't allow it to present again until we start
    [self.presenter dismiss];
}

- (nullable UIViewController *)lockScreenViewController {
    return self.presenter.lockViewController;
}

#pragma mark - Notification Selectors

- (void)sdl_lockScreenStatusDidChange:(SDLRPCNotificationNotification *)notification {
    if (![notification isNotificationMemberOfClass:[SDLOnLockScreenStatus class]]) {
        return;
    }

    self.lastLockNotification = notification.notification;
    [self sdl_checkLockScreen];
}

- (void)sdl_lockScreenIconReceived:(NSNotification *)notification {
    NSAssert([notification.userInfo[SDLNotificationUserInfoObject] isKindOfClass:[UIImage class]], @"A notification was sent with an unanticipated object");
    if (![notification.userInfo[SDLNotificationUserInfoObject] isKindOfClass:[UIImage class]]) {
        return;
    }

    UIImage *icon = notification.userInfo[SDLNotificationUserInfoObject];

    // If the VC is our special type, then add the vehicle icon. If they passed in a custom VC, there's no current way to show the vehicle icon. If they're managing it themselves, they can grab the notification themselves.
    if ([self.lockScreenViewController isKindOfClass:[SDLLockScreenViewController class]]) {
        ((SDLLockScreenViewController *)self.lockScreenViewController).vehicleIcon = icon;
    }
}

- (void)sdl_appDidBecomeActive:(NSNotification *)notification {
    [self sdl_checkLockScreen];
}

#pragma mark - Private Helpers

- (void)sdl_checkLockScreen {
    if (self.lockScreenViewController == nil || self.lastLockNotification == nil) {
        return;
    }

    // Present the VC depending on the lock screen status
    if ([self.lastLockNotification.lockScreenStatus isEqualToEnum:SDLLockScreenStatusRequired]) {
        if (!self.presenter.presented && self.canPresent) {
            [self.presenter present];
        }
    } else if ([self.lastLockNotification.lockScreenStatus isEqualToEnum:SDLLockScreenStatusOptional]) {
        if (self.config.showInOptionalState && !self.presenter.presented && self.canPresent) {
            [self.presenter present];
        } else if (self.presenter.presented) {
            [self.presenter dismiss];
        }
    } else if ([self.lastLockNotification.lockScreenStatus isEqualToEnum:SDLLockScreenStatusOff]) {
        if (self.presenter.presented) {
            [self.presenter dismiss];
        }
    }
}

@end

NS_ASSUME_NONNULL_END


text:
using System;
using System.Threading.Tasks;

using RestSharp.Portable.OAuth2.Configuration;
using RestSharp.Portable.OAuth2.Infrastructure;
using RestSharp.Portable.OAuth2.Models;

using Newtonsoft.Json;

namespace RestSharp.Portable.OAuth2.Client
{
    /// <summary>
    /// LinkedIn authentication client.
    /// </summary>
    public class LinkedInClient : OAuth2Client
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="LinkedInClient"/> class.
        /// </summary>
        /// <param name="factory">The factory.</param>
        /// <param name="configuration">The configuration.</param>
        public LinkedInClient(IRequestFactory factory, IClientConfiguration configuration)
            : base(factory, configuration)
        {
        }

        /// <summary>
        /// Defines URI of service which issues access code.
        /// </summary>
        protected override Endpoint AccessCodeServiceEndpoint
        {
            get
            {
                return new Endpoint
                {
                    BaseUri  = "https://www.linkedin.com",
                    Resource = "/uas/oauth2/authorization"
                };
            }
        }

        /// <summary>
        /// Defines URI of service which issues access token.
        /// </summary>
        protected override Endpoint AccessTokenServiceEndpoint
        {
            get
            {
                return new Endpoint
                {
                    BaseUri  = "https://www.linkedin.com",
                    Resource = "/uas/oauth2/accessToken"
                };
            }
        }

        /// <summary>
        /// Defines URI of service which allows to obtain information about user which is currently logged in.
        /// </summary>
        protected override Endpoint UserInfoServiceEndpoint
        {
            get
            {
                return new Endpoint
                {
                    BaseUri  = "https://api.linkedin.com",
                    Resource = "/v1/people/~:(id,email-address,first-name,last-name,picture-url)?format=json"
                };
            }
        }

        /// <summary>
        /// Returns URI of service which should be called in order to start authentication process.
        /// This URI should be used for rendering login link.
        /// </summary>
        /// <param name="state">
        /// Any additional information that will be posted back by service.
        /// </param>
        public override async Task<string> GetLoginLinkUri(string state = null)
        {
            return await base.GetLoginLinkUri(state ?? Guid.NewGuid().ToString("N"));
        }

        /// <summary>
        /// Called just before issuing request to service when everything is ready.
        /// Allows to add extra parameters to request or do any other needed preparations.
        /// </summary>
        protected override void BeforeGetUserInfo(BeforeAfterRequestArgs args)
        {
            args.Client.Authenticator = null;
            args.Request.Parameters.Add(new Parameter
            {
                Name  = "oauth2_access_token",
                Type  = ParameterType.GetOrPost,
                Value = AccessToken
            });
        }

        /// <summary>
        /// Should return parsed <see cref="UserInfo"/> from content received from third-party service.
        /// </summary>
        /// <param name="response">The response which is received from the provider.</param>
        protected override UserInfo ParseUserInfo(IRestResponse response)
        {
            return ParseUserInfo(response.Content);
        }

        /// <summary>
        /// Should return parsed <see cref="UserInfo"/> from content received from third-party service.
        /// </summary>
        /// <param name="content">The response which is received from the provider.</param>
        protected virtual UserInfo ParseUserInfo(string content)
        {
            var person = JsonConvert.DeserializeObject<Person>(content);

            var avatarUri = person.PictureUrl;
            var avatarSizeTemplate = "{0}_{0}";
            if (string.IsNullOrEmpty(avatarUri))
            {
                avatarUri = "https://www.linkedin.com/scds/common/u/images/themes/katy/ghosts/person/ghost_person_80x80_v1.png";
                avatarSizeTemplate = "{0}x{0}";
            }
            var avatarDefaultSize = string.Format(avatarSizeTemplate, 80);

            return new UserInfo
            {
                Id = person.Id,
                Email = person.Email,
                FirstName = person.FirstName,
                LastName = person.LastName,
                AvatarUri =
                    {
                        Small  = avatarUri.Replace(avatarDefaultSize, string.Format(avatarSizeTemplate, AvatarInfo.SmallSize)),
                        Normal = avatarUri,
                        Large  = avatarUri.Replace(avatarDefaultSize, string.Format(avatarSizeTemplate, AvatarInfo.LargeSize))
                    }
            };
        }

        /// <summary>
        /// Friendly name of provider (OAuth service).
        /// </summary>
        public override string Name
        {
            get { return "LinkedIn"; }
        }

        private class Person
        {
            [JsonProperty("id")]
            public string Id { get; set; }

            [JsonProperty("emailAddress")]
            public string Email { get; set; }

            [JsonProperty("firstName")]
            public string FirstName { get; set; }

            [JsonProperty("lastName")]
            public string LastName { get; set; }

            [JsonProperty("pictureUrl")]
            public string PictureUrl { get; set; }
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<bitmap android:src="@drawable/st_ic_applications" android:tint="@color/dashboard_applications_color"
  xmlns:android="http://schemas.android.com/apk/res/android" />


text:
import * as React from 'react';

import miscConfig from '../../config/misc';

import Layout from '../layouts/composite';
import {Links} from "../elements/menu";
import PromptBox from "../elements/promptBox";
import {Context} from "koa";
import {Model} from "../../models/Model";

export interface Props {
  readonly context: Context,
  readonly Model: Model,
}

class ModelsDeletePrompt extends React.Component<Props, {}> {
  render() {
    const {props} = this;

    return(
      <Layout title={`${miscConfig.websiteTitle} - ${props.Model.property}`}
              sectionTitle={`Delete resource ${props.Model.property}`}
              activeLinks={[Links.Models]}
              context={props.context}>

        <PromptBox message={`Are you sure you want to delete ${props.Model.property}?`}
                   cancelLink={`/models`}
                   confirmAction={`/models/${props.Model.id}/delete`} />

      </Layout>
    );
  }
}

export default ModelsDeletePrompt;


text:
package com.reason.ide;

import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
import static org.mockito.MockitoAnnotations.initMocks;
import static org.powermock.api.mockito.PowerMockito.mockStatic;

import com.intellij.mock.MockVirtualFile;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.search.FilenameIndex;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.util.indexing.ID;
import com.reason.esy.EsyPackageJson;

import java.util.Optional;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

//@RunWith(PowerMockRunner.class)
//@PrepareForTest({ID.class, EsyPackageJson.class, FilenameIndex.class, GlobalSearchScope.class})
public class ORFileUtilsTest {

//    @Mock GlobalSearchScope mockScope;
//    @Mock private Project mockProject;

//    @Before
//    public void setUp() {
//        initMocks(this);
//        mockStatic(ID.class);
//        mockStatic(EsyPackageJson.class);
//        mockStatic(FilenameIndex.class);
//        mockStatic(GlobalSearchScope.class);
//        when(GlobalSearchScope.allScope(mockProject)).thenReturn(mockScope);
//    }

    @Test
    public void testFindAncestorRecursive_startAtRootOfFileSystem() {
//    VirtualFile mockFile = spy(VirtualFile.class);
//    when(mockFile.isDirectory()).thenReturn(false);
//    when(mockFile.getParent()).thenReturn(null);
//    Optional<VirtualFile> ancestor = ORFileUtils.findAncestor(mockProject, "", mockFile);
//    verify(mockFile).isDirectory();
//    verify(mockFile).getParent();
//    assertFalse(ancestor.isPresent());
        assertTrue(true); // mock not working
    }

    @Test
    public void testFindAncestorRecursive_hitRootOfFileSystem() {
//    String mockProjectBasePath = "mock-path";
//    when(mockProject.getBasePath()).thenReturn(mockProjectBasePath);
//    VirtualFile mockStart = spy(VirtualFile.class);
//    when(mockStart.isDirectory()).thenReturn(true);
//    when(mockStart.getPath()).thenReturn(mockProjectBasePath);
//    Optional<VirtualFile> ancestor = ORFileUtils.findAncestor(mockProject, "", mockStart);
//    assertFalse(ancestor.isPresent());
        assertTrue(true); // mock not working
    }

    @Test
    public void testFindAncestorRecursive_targetFound() {
//    VirtualFile mockTarget = new MockVirtualFile("mock-target");
//    String targetName = mockTarget.getName();
//    VirtualFile mockStart = spy(VirtualFile.class);
//    when(mockStart.isDirectory()).thenReturn(true);
//    when(mockStart.findChild(targetName)).thenReturn(mockTarget);
//    Optional<VirtualFile> ancestor =
//        ORFileUtils.findAncestor(mockProject, targetName, mockStart);
//    assertTrue(ancestor.isPresent());
//    assertEquals(mockTarget, ancestor.get());
        assertTrue(true); // mock not working
    }
}


text:
package com.sksamuel.elastic4s

import com.sksamuel.elastic4s.source.Indexable
import org.scalatest.{WordSpec, Matchers}

class SuggestionsTest extends WordSpec with Matchers with ElasticSugar {

  implicit object SongIndexable extends Indexable[Song] {
    override def json(t: Song): String = s"""{"name":"${t.name}", "artist":"${t.artist}"}"""
  }

  import ElasticDsl._

  private val indexType = "suggestionstest" / "music"

  client.execute(
    bulk(
      index into indexType source Song("style", "taylor swift"),
      index into indexType source Song("shake it off", "Taylor Swift"),
      index into indexType source Song("a new england", "kirsty maccoll"),
      index into indexType source Song("blank page", "taylor swift"),
      index into indexType source Song("I want it all", "Queen"),
      index into indexType source Song("I to break free", "Queen"),
      index into indexType source Song("radio gaga", "Queen"),
      index into indexType source Song("we are the champions", "Quoon"),
      index into indexType source Song("Down with the trumpets", "Rizzle Kicks"),
      index into indexType source Song("Down with the trombones", "Razzle Kacks"),
      index into indexType source Song("lover of the light", "Mumford and sons"),
      index into indexType source Song("Monster", "Mumford and sons")
    )
  ).await

  blockUntilCount(8, "suggestionstest")

  "suggestions" should {
    "bring back results" in {
      val mysugg = termSuggestion.field("artist").text("taylor swaft")
      val resp = client.execute {
        search in indexType suggestions {
          mysugg
        }
      }.await
      resp.suggestion(mysugg).entry("taylor").options.isEmpty shouldBe true
      resp.suggestion(mysugg).entry("swaft").optionsText shouldBe Array("swift")
    }
    "bring back suggestions for matching terms when mode is always" in {
      val suggestionA = term suggestion "a" field "artist" text "Razzle Kacks" mode SuggestMode.Always
      val resp = client.execute {
        search in indexType suggestions suggestionA
      }.await
      resp.suggestion("a").entry("razzle").optionsText shouldBe Array("rizzle")
      resp.suggestion("a").entry("kacks").optionsText shouldBe Array("kicks")
    }
    "bring back suggestions that are more popular when popular mode is set" in {
      val resp = client.execute {
        search in indexType suggestions {
          term suggestion "a" field "artist" text "Quoon" mode SuggestMode.Popular
        }
      }.await
      resp.suggestion("a").entry("quoon").optionsText shouldBe Array("queen")
    }
    "allow us to set the max edits to be counted as a suitable suggestion" in {
      val resp = client.execute {
        search in indexType suggestions {
          term suggestion "a" field "artist" text "Quean" maxEdits 1 // so Quean->Queen but not Quean -> Quoon
        }
      }.await
      resp.suggestion("a").entry("quean").optionsText shouldBe Array("queen")
    }
    //    "allow us to set min word length to be suggested for" in {
    //      val resp = client.execute {
    //        search in indexType suggestions {
    //          suggest as "a" field "artist" on "Mamford ind sans"  minWordLength 2
    //        }
    //      }.await
    //      resp.suggestion("a").get.entryTerms shouldBe Array("mamford", "sans")
    //      resp.suggestion("a").get.entry("mamford").optionsText shouldBe Array("mumford")
    //      resp.suggestion("a").get.entry("sons").optionsText shouldBe Array("sans")
    //    }
  }
}

case class Song(name: String, artist: String)


text:
```
gem install bundler
```

#### Execute the vendoring script

```
./scripts/vendor_gems
```

### Creating a new BOSH release

#### Development

1. Make local changes to the release

2. Create a dev release

    (--force is required if there are local changes not committed to git)

    ```
    bosh create release --force --with-tarball
    ```

### Final

1. Configure the blobstore secrets in `config/private.yml`.

2. Create a final release

    (--final will upload the package/job blobs to the blobstore)

    ```
    bosh create release --final --with-tarball
    ```

3. Tag the final release (optional)

4. Push changes to github

### Creating a tarball of an existing BOSH release

Create a release tarball using an existing manifest

```
bosh create release ./releases/bosh-vcloud-cpi/bosh-vcloud-cpi-<version>.yml --with-tarball
```


text:
title: Time for Lilacs
date: 2008-05-28 00:00:00 -06:00
categories:
- whats-blooming
layout: post
blog-banner: whats-blooming-now-spring.jpg
post-date: May 28, 2008
post-time: 9:48 AM
blog-image: wbn-default.jpg
---

  It's time! The lilacs are finally in full bloom and they smell wonderful! Come take a look at our numerous varieties. Most of them are located along the lower portion of the Floral Walk, but you can find other amazing varieties in the Fragrance Garden and Children's Garden.

Joseph Hers Lilac  Syringa julianae 'Hers Variety'

Compact Meyer Lilac  Syringa meyeri 'Palabin'

Dappled Dawn Lilac  Syringa vulgaris 'Dappled Dawn'

Sarah Sands Lilac  Syringa vulgaris 'Sarah Sands'

Slater's Elegance Lilac  Syringa vulgaris 'Slater's Elegance'

Sensation Lilac  Syringa vulgaris 'Sensation'

 Lace-leaf Lilac  Syringa x laciniata

     Our Viburnum collection is also beginning to bloom.  Don't forget to watch for them as you're on your way to the lilacs.  Some are just as fragrant as lilacs.


text:
```eval_rst
    .. currentmodule:: mxnet.symbol.random
```

## Overview

This document lists the random distribution generator routines of the symbolic expression package:

```eval_rst
.. autosummary::
    :nosignatures:

    mxnet.symbol.random
```

The `Random Distribution Generator Symbol` API, defined in the `symbol.random` package, provides
symbolic expressions for random distribution generator routines.

In the rest of this document, we list routines provided by the `symbol.random` package.

## Random Distribution Generator

```eval_rst
.. currentmodule:: mxnet.symbol.random

.. autosummary::
    :nosignatures:

    exponential
    gamma
    generalized_negative_binomial
    negative_binomial
    normal
    poisson
    uniform
    multinomial
    shuffle
    mxnet.random.seed
```

## API Reference

<script type="text/javascript" src='../../../_static/js/auto_module_index.js'></script>

```eval_rst

.. automodule:: mxnet.symbol.random
    :members:
    :noindex:

.. automodule:: mxnet.random
    :members:

```

<script>auto_index("api-reference");</script>


text:
package lesson.questions;

/**
 * Created by igor on 21.10.2015.
 */
public class Array {

    public static void main(String[] args) {

        Object[] arr = {new Object(),new Object(),null,new Object(),new Object()};
        for(Object obj : arr) {
            System.out.println(obj.toString());
        }
    }
}


text:
/*!
 * Author : Matteo Bruni
 * MIT license: https://opensource.org/licenses/MIT
 * Demo / Generator : https://particles.js.org/
 * GitHub : https://www.github.com/matteobruni/tsparticles
 * How to use? : Check the GitHub README
 * v2.1.3
 */
(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory(require("tsparticles-engine"));
	else if(typeof define === 'function' && define.amd)
		define(["tsparticles-engine"], factory);
	else {
		var a = typeof exports === 'object' ? factory(require("tsparticles-engine")) : factory(root["window"]);
		for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
	}
})(this, function(__WEBPACK_EXTERNAL_MODULE__818__) {
return /******/ (function() { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

/***/ 818:
/***/ (function(module) {

module.exports = __WEBPACK_EXTERNAL_MODULE__818__;

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/************************************************************************/
/******/ 	/* webpack/runtime/define property getters */
/******/ 	!function() {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = function(exports, definition) {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	}();
/******/
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	!function() {
/******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ 	}();
/******/
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	!function() {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = function(exports) {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	}();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
!function() {
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "loadLightInteraction": function() { return /* binding */ loadLightInteraction; }
});

// EXTERNAL MODULE: external {"commonjs":"tsparticles-engine","commonjs2":"tsparticles-engine","amd":"tsparticles-engine","root":"window"}
var external_commonjs_tsparticles_engine_commonjs2_tsparticles_engine_amd_tsparticles_engine_root_window_ = __webpack_require__(818);
;// CONCATENATED MODULE: ./dist/browser/Utils.js

function drawLight(container, context, mousePos) {
  const lightOptions = container.actualOptions.interactivity.modes.light.area;
  context.beginPath();
  context.arc(mousePos.x, mousePos.y, lightOptions.radius, 0, 2 * Math.PI);
  const gradientAmbientLight = context.createRadialGradient(mousePos.x, mousePos.y, 0, mousePos.x, mousePos.y, lightOptions.radius);
  const gradientRgb = container.canvas.mouseLight;

  if (!gradientRgb || !gradientRgb.start || !gradientRgb.stop) {
    return;
  }

  gradientAmbientLight.addColorStop(0, (0,external_commonjs_tsparticles_engine_commonjs2_tsparticles_engine_amd_tsparticles_engine_root_window_.getStyleFromRgb)(gradientRgb.start));
  gradientAmbientLight.addColorStop(1, (0,external_commonjs_tsparticles_engine_commonjs2_tsparticles_engine_amd_tsparticles_engine_root_window_.getStyleFromRgb)(gradientRgb.stop));
  context.fillStyle = gradientAmbientLight;
  context.fill();
}
function drawParticleShadow(container, context, particle, mousePos) {
  var _a, _b;

  const pos = particle.getPosition();
  const shadowOptions = container.actualOptions.interactivity.modes.light.shadow;
  context.save();
  const radius = particle.getRadius();
  const sides = particle.sides;
  const full = Math.PI * 2 / sides;
  const angle = -((_b = (_a = particle.rotate) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : 0) + Math.PI / 4;
  const factor = 1; //Math.sqrt(2);

  const dots = [];

  for (let i = 0; i < sides; i++) {
    dots.push({
      x: pos.x + radius * Math.sin(angle + full * i) * factor,
      y: pos.y + radius * Math.cos(angle + full * i) * factor
    });
  }

  const points = [];
  const shadowLength = shadowOptions.length;

  for (const dot of dots) {
    const dotAngle = Math.atan2(mousePos.y - dot.y, mousePos.x - dot.x);
    const endX = dot.x + shadowLength * Math.sin(-dotAngle - Math.PI / 2);
    const endY = dot.y + shadowLength * Math.cos(-dotAngle - Math.PI / 2);
    points.push({
      endX: endX,
      endY: endY,
      startX: dot.x,
      startY: dot.y
    });
  }

  const shadowRgb = particle.lightShadow;

  if (!shadowRgb) {
    return;
  }

  const shadowColor = (0,external_commonjs_tsparticles_engine_commonjs2_tsparticles_engine_amd_tsparticles_engine_root_window_.getStyleFromRgb)(shadowRgb);

  for (let i = points.length - 1; i >= 0; i--) {
    const n = i == points.length - 1 ? 0 : i + 1;
    context.beginPath();
    context.moveTo(points[i].startX, points[i].startY);
    context.lineTo(points[n].startX, points[n].startY);
    context.lineTo(points[n].endX, points[n].endY);
    context.lineTo(points[i].endX, points[i].endY);
    context.fillStyle = shadowColor;
    context.fill();
  }

  context.restore();
}
;// CONCATENATED MODULE: ./dist/browser/ExternalLighter.js

class ExternalLighter extends external_commonjs_tsparticles_engine_commonjs2_tsparticles_engine_amd_tsparticles_engine_root_window_.ExternalInteractorBase {
  constructor(container) {
    super(container);
  }

  clear() {// do nothing
  }

  init() {// do nothing
  }

  async interact() {
    const container = this.container,
          options = container.actualOptions;

    if (options.interactivity.events.onHover.enable && container.interactivity.status === "mousemove") {
      const mousePos = container.interactivity.mouse.position;

      if (!mousePos) {
        return;
      }

      container.canvas.draw(ctx => {
        drawLight(container, ctx, mousePos);
      });
    }
  }

  isEnabled(particle) {
    var _a;

    const container = this.container,
          mouse = container.interactivity.mouse,
          interactivity = (_a = particle === null || particle === void 0 ? void 0 : particle.interactivity) !== null && _a !== void 0 ? _a : container.actualOptions.interactivity,
          events = interactivity.events;

    if (!(events.onHover.enable && mouse.position)) {
      return false;
    }

    const res = (0,external_commonjs_tsparticles_engine_commonjs2_tsparticles_engine_amd_tsparticles_engine_root_window_.isInArray)("light"
    /* HoverMode.light */
    , events.onHover.mode);

    if (res) {
      const lightGradient = interactivity.modes.light.area.gradient;
      container.canvas.mouseLight = {
        start: (0,external_commonjs_tsparticles_engine_commonjs2_tsparticles_engine_amd_tsparticles_engine_root_window_.rangeColorToRgb)(lightGradient.start),
        stop: (0,external_commonjs_tsparticles_engine_commonjs2_tsparticles_engine_amd_tsparticles_engine_root_window_.rangeColorToRgb)(lightGradient.stop)
      };
    }

    return res;
  }

  reset() {// do nothing
  }

}
;// CONCATENATED MODULE: ./dist/browser/ParticlesLighter.js

class ParticlesLighter extends external_commonjs_tsparticles_engine_commonjs2_tsparticles_engine_amd_tsparticles_engine_root_window_.ParticlesInteractorBase {
  constructor(container) {
    super(container);
  }

  clear() {// do nothing
  }

  init() {// do nothing
  }

  async interact(particle) {
    const container = this.container,
          options = container.actualOptions;

    if (options.interactivity.events.onHover.enable && container.interactivity.status === "mousemove") {
      const mousePos = this.container.interactivity.mouse.position;

      if (mousePos) {
        container.canvas.draw(ctx => {
          drawParticleShadow(container, ctx, particle, mousePos);
        });
      }
    }
  }

  isEnabled(particle) {
    var _a;

    const container = this.container,
          interactivity = (_a = particle.interactivity) !== null && _a !== void 0 ? _a : container.actualOptions.interactivity,
          mouse = container.interactivity.mouse,
          events = interactivity.events;

    if (!(events.onHover.enable && mouse.position)) {
      return false;
    }

    const res = (0,external_commonjs_tsparticles_engine_commonjs2_tsparticles_engine_amd_tsparticles_engine_root_window_.isInArray)("light"
    /* HoverMode.light */
    , events.onHover.mode);

    if (res) {
      const shadowOptions = interactivity.modes.light.shadow;
      particle.lightShadow = (0,external_commonjs_tsparticles_engine_commonjs2_tsparticles_engine_amd_tsparticles_engine_root_window_.rangeColorToRgb)(shadowOptions.color);
    }

    return res;
  }

  reset() {// do nothing
  }

}
;// CONCATENATED MODULE: ./dist/browser/index.js

function loadLightInteraction(engine) {
  engine.addInteractor("externalLight", container => new ExternalLighter(container));
  engine.addInteractor("particlesLight", container => new ParticlesLighter(container));
}
}();
/******/ 	return __webpack_exports__;
/******/ })()
;
});


text:
package org.apache.hadoop.hive.metastore.events;

import org.apache.hadoop.hive.metastore.HiveMetaStore.HMSHandler;
import org.apache.hadoop.hive.metastore.api.Table;

/**
 * Table read event
 */
public class PreReadTableEvent extends PreEventContext {

  private final Table table;

  public PreReadTableEvent(Table table, HMSHandler handler) {
    super(PreEventType.READ_TABLE, handler);
    this.table = table;
  }

  /**
   * @return the table
   */
  public Table getTable() {
    return table;
  }

}


text:
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>

#include "../hashtable.h"

#define BUCKET_COUNT 2

#define KEY1 "key1"
#define VAL1 2
#define KEY2 "key2"
#define VAL2 4
#define KEY3 "key3"
#define VAL3 7
#define BAD_KEY "meow"

int hash_node(char* key);
int node_compare(struct ht_node* node1, struct ht_node* node2);

void assertSimpleTable(struct ht* table);
void assertNodeEquals(struct ht_node* node1, struct ht_node* node2, struct ht_node* node3);
void assertSingleNode(struct ht* table, struct ht_node* node);
void assertLookups(struct ht* table);
void assertMultiNode(struct ht* table);

int
main()
{
        struct ht* table;
        struct ht_node *node1, *node2, *node3;

        printf("Testing hashtable...\n");

        table = ht_init_simple(BUCKET_COUNT, &hash_node, &node_compare);
        /* Assert that we've gotten memory for our table */
        printf("Checking table has been allocated... ");
        assert(table);
        printf("OK\n");

        assertSimpleTable(table);

        printf("Creating node1 with key %s and value %d...", KEY1, VAL1);
        node1 = ht_create_node(KEY1, (void*)VAL1);
        assert(node1);
        printf("OK\nCreating node2 with key %s and value %d...", KEY2, VAL2);
        node2 = ht_create_node(KEY2, (void*)VAL2);
        assert(node2);
        printf("OK\nCreating node3 with key %s and value %d...", KEY3, VAL3);
        node3 = ht_create_node(KEY3, (void*)VAL3);
        assert(node3);
        printf("OK\n");

        printf("Inserting node1 into the table...");
        ht_insert(table, node1);
        printf("OK\n");
        assertSingleNode(table, node1);
        printf("Inserting nodes 2 and 3 into the table...");
        ht_insert(table, node2);
        ht_insert(table, node3);
        printf("OK\n");
        assertNodeEquals(node1, node2, node3);
        assertLookups(table);
        assertMultiNode(table);

        printf("Freeing the hashtable...");
        ht_free(table);
        assert(!table);
        //assert(!node1);
        //assert(!node2);
        //assert(!node3);
        printf("OK\nAll hashtable tests passed\n\n");
}

void
assertMultiNode(struct ht* table)
{
        printf("Checking table size is 3...");
        assert(table->node_count == 3);
        printf("OK\nChecking that all buckets are being used...");
        assert(table->used == BUCKET_COUNT);
        printf("OK\n");
}

void
assertNodeEquals(struct ht_node* node1, struct ht_node* node2, struct ht_node* node3)
{
        printf("Checking node1 == node1...");
        assert(node_compare(node1, node1));
        printf("OK\nChecking node2 != node3...");
        assert(!node_compare(node2, node3));
        printf("OK\n");
}

void
assertLookups(struct ht* table)
{
        printf("Checking if a node with key %s exists in the table...", KEY1);
        assert(ht_lookup(table, KEY1));
        printf("OK\nChecking if node with key %s exists in the table...", KEY2);
        assert(ht_lookup(table, KEY2));
        printf("OK\nChecking if node with key %s exists in the table...", KEY3);
        assert(ht_lookup(table, KEY3));
        printf("OK\nChecking node with key %s isn't in the table...", BAD_KEY);
        assert(!ht_lookup(table, BAD_KEY));
        printf("OK\n");
}

void
assertSimpleTable(struct ht* table)
{
        printf("Checking table has 0 elements...");
        assert(table->node_count == 0);
        printf("OK\nChecking the table has %d buckets...", BUCKET_COUNT);
        assert(table->size == BUCKET_COUNT);
        printf("OK\nChecking that no buckets are in use...");
        assert(table->used == 0);
        printf("OK\nChecking largest bucket is 0...");
        assert(table->current_max == 0);
        printf("OK\nChecking bucket array has been allocated...");
        assert(table->buckets);
        printf("OK\nChecking each linkedlist has been allocated...\n");
        for(int i=0; i<BUCKET_COUNT; i++){
            printf("  %d...", i);
            assert(table->buckets[i]);
            printf("OK\n");
        }
}

void
assertSingleNode(struct ht* table, struct ht_node* node)
{
    printf("Checking table has 1 element...");
    assert(table->node_count == 1);
    printf("OK\nChecking one bucket is being used...");
    assert(table->used == 1);
    printf("OK\n");
}

int
hash_node(char* key)
{
        int sum = 0;
        char *str = key;
        while(*str) { sum += *str++; }
        return sum;
}

int
node_compare(struct ht_node* node1, struct ht_node* node2)
{
        return node1->hash == node2->hash;
}


text:
===================
Databases and Files
===================

Flags in this category fall into the below groupings:

#. `Allocation`_ --> Flags that modify how pages in MDF/NDF files are allocated to individual objects.
#. `Other`_ --> Flags not related to page allocation.
#. `Fixes and Past Relevance`_ --> Fix flags and flags which are no longer relevant.

See also: 3449 and 8903 ([Disk and Network IO](https://github.com/AaronMorelli/SQLServerTraceFlags/blob/master/Categories/DiskNetworkIO.md))

(TODO: ensure 1802 is present in the See Also for Security)
(TODO: find other entry for 9394 and place an in-line link to its other home. Ditto for the other section)
(TODO: 10207 should be moved to the corrupt Checkdb section and placed here in the see also section)
TODO: is 9929 in multiple locations? e.g. the special features one?
TODO: should 1482 move to a t-log focused page?
TODO: 2330 should have a reference in one of the optimization pages

|

Short Descriptions
------------------

.. This comment line is as long as we would ever want the short desc to be in the table below.

.. list-table::
	:widths: 10 60
	:header-rows: 1

	* - Flag
	  - Short Description
	* - See Also
	  -
	* - :doc:`205 <qry_CompInfo>`
	  - Reports to error log when recompile occurs due to auto-update of stats.
	* - ...
	  -
	* - :ref:`Allocation <FAlloc>`
	  -
	* - 670_
	  - (or 671) Disables deferred deallocation.
	* - 1106_
	  - Creates a new ring buffer to track TempDB allocations.
	* - \* 1117_
	  - When one files grows, all files in filegroup grow with it.
	* - \* 1118_
	  - Eliminates most single page allocations.
	* - 1165_
	  - Prints calculations used for proportional fill algorithm.
	* - 1180_
	  - Changes the way text/image data is allocated
	* - 1197_
	  - Prevents use of worktable cache for certain TempDB allocations.
	* - 1806_
	  - Disables instant file initialization
	* - ...
	  -
	* - :ref:`Other <DBFOther>`
	  -
	* - 272_
	  - Reverts identity column generation behavior to pre-SQL 2012 behavior.
	* - 647_
	  - Skips a new-in-2012 data check that lengthens ALTER TABLE durations.
	* - 1140_
	  - Allows reversion to an older algorithm for mixed page allocs.
	* - 1482_
	  - Prints info on a variety of t-log management operations.
	* - 1808_
	  - Ignores auto-closing DBs even if auto-close property is set.
	* - 1816_
	  - Provides more details around IO errors for stretch database.
	* - 2330_
	  - Stops data collection for sys.db_index_usage_stats.
	* - 2548_
	  - Causes DBCC SHRINK and other options to skip LOB_COMPACTION.
	* - 3861_
	  - Allows DB startup code to move system tables to primary FG.
	* - 9851_
	  - Disables Hekaton auto-merge process for checkpoint files.
	* - 9929_
	  - Reduces Hekaton checkpoint files to 1 MB each.
	* - 10204_
	  - Disables merge/recompress of smaller columnstore delta rowgroups.
	* - 10207_
	  - Disables skipping of corrupt segments for columnstore scans.
	* - ...
	  -
	* - :ref:`Fix/PastRel <FixPastRel6>`
	  -
	* - 1802_
	  - Workaround for permissions change upon DB detach
	* - 1807_
	  - Allows creation of DB file on UNC paths
	* - 9394_
	  - Enables fix for AV re: Japanese characters
	* - 10202_
	  - Enabled new column store DMV in pre-release SQL version.

.. This comment line is as long as we would ever want the short desc to be in the table above.

|

.. _FAlloc:

Allocation
----------

.. _670:

670 (or 671)
	CSS: Disables deferred deallocation. But note Paul White's comment on the post! The flag
	number may actually be 671.

	CSS_1_

.. _1106:

1106 (Info)
	Creates a new RB in sys.dm_os_ring_buffers that tracks allocations made in TempDB.

	947204_ | BobWard_Pass2011_ | Arvind_1_

.. _1117:

1117 ``Doc2014``
	`BOL 2014`_: "When a file in the filegroup meets the autogrow threshold, all files in the filegroup grow.

	Note: Beginning with SQL Server 2016 this behavior is controlled by the AUTOGROW_SINGLE_FILE and
	AUTOGROW_ALL_FILES option of ALTER DATABASE, and trace flag 1117 has no affect."

	This flag is commonly associated with tempdb but applies to all databases when on. The flag is typically
	used to ensure that all files grow evenly to maintain a well balanced proportional-fill allocation algorithm.
	Nacho gives a very special/rare edge case for sysfiles1. Chris Adkin has some interesting screenshots on its
	effect under certain workloads. (PRand_1_ doesn't reference this flag but its info is highly relevant to
	this topic.)

	`ALTER DATABASE file and filegroup options`_ | BobWard_Pass2011_ | PRand_4_ |
	Nacho_2_ | CAdkin_2_ | SQLArticlesDotCom_

.. _1118:

1118 ``Doc2014``
	`BOL 2014`_: "Removes most single page allocations on the server, reducing contention on the SGAM page. When a
	new object is created, by default, the first eight pages are allocated from different extents (mixed extents).
	Afterwards, when more pages are needed, those are allocated from that same extent (uniform extent). The SGAM
	page is used to track these mixed extents, so can quickly become a bottleneck when numerous mixed page allocations
	are occurring. This trace flag allocates all eight pages from the same extent when creating new objects,
	minimizing the need to scan the SGAM page. For more information, see this Microsoft Support article.

	Note: Beginning with SQL Server 2016 this behavior is controlled by the SET MIXED_PAGE_ALLOCATION option of
	ALTER DATABASE, and trace flag 1118 has no affect."

	`ALTER DATABASE SET Options`_ | 328551_ | 837938_ | 936185_ | 2154845_ |
	CSS_3_ | CSS_4_ | PRand_5_ | CAdkin_2_

.. _1140:

1140
	Allows reversion to an older, more aggressive form of the mixed-page-allocation algorithm.
	The flag was introduced as a workaround for a bug in 2005SP2/SP3 and SQL 2008 where mixed page
	allocations climb continually in tempdb for workloads that use tempdb extremely heavily. That
	behavior was due to a change in the way that mixed-page allocations are done. KB has a great
	description of both the "old" and "new" way that free pages are found for a mixed-page
	allocation to be performed.

	2000471_

.. _1165:

1165 (Info)
	Outputs the recalculated #'s (every 8192 allocations) for the proportional fill algorithm
	when multiple files are present. Requires TF 3605, output goes to SQL error log.

	BobWard_Pass2011_ | PRand_1_

.. _1180:

1180
	(Very old, may not be functional) KB notes that after a SQL 7.0 fix is installed, this
	flag will cause text/image data to be placed in free pages in partially-allocated extents;
	w/o the flag, text/image data is placed in newly-allocated extents until the file size
	limit is reached; only then will partially-allocated extents be used for new data.

	272220_

.. _1197:

1197
	Bob Ward uses to prevent allocation of TempDB pages (by Work Tables) from being pulled from
	a worktable cache (see around 1:25:00). The (very old) KB references for use w/1180 in
	reclaiming space from inefficiently-stored text/image data.

	BobWard_Pass2011_ | 324432_

.. _1806:

1806
	Disables instant file initialization.

	2574695_ | PFE_1_ | PRand_2_

|

.. _DBFOther:

Other
-----

.. _272:

272
	Connect: "In SQL Server 2012 the implementation of the identity property has been changed to accommodate
	investments into other features. In previous versions of SQL Server the tracking of identity generation
	relied on transaction log records for each identity value generated. In SQL Server 2012 we generate identity
	values in batches and log only the max value of the batch. This reduces the amount and frequency of information
	written to the transaction log improving insert scalability. If you require the same identity generation
	semantics as previous versions of SQL Server there are two options available:
		- Use trace flag 272. This will cause a log record to be generated for each generated identity value. The performance of identity generation may be impacted by turning on this trace flag.
		- Use a sequence generator with the NO CACHE setting. This will cause a log record to be generated for each generated sequence value. Note that the performance of sequence value generation may be impacted by using NO CACHE."

	Later in the Connect discussion, one commenter notes that when adding the TF as a startup flag, the flag only
	appears to work when using the "lowercase t" syntax rather than the more common "uppercase T" syntax.

	Connect_1_

.. _647:

647
	Avoids a new-in-SQL 2012 data check (done when adding a column to a table) that can cause
	ALTER TABLE… ADD <column> operations to take a very long time. The KB has a useful query
	for determining the row size for a table.

	2986423_

.. _1482:

1482 (Info)
	Prints info to the Error Log (3605 not necess.) for a variety of transaction log operations,
	including when MinLSN value is reset, when a VLF is formatted, etc. (First discovered in
	Bob Ward's PASS 2014 talk on SQL Server IO, and then tested for myself.)

	<links needed>

.. _1808:

1808
	Directs SQL Server to ignore auto-closing databases even if the Auto-close property is set
	to ON. Must be set globally. Present in 2005+.

	Nacho_1_

.. _1816:

1816 (Info)
	Bob Ward briefly references this flag in his PASS2014 IO talk, saying it "could provide
	more details around errors" that occur with IO done to SQL data files in Azure Storage
	(stretch/http IO, I think he means).

	<links needed>

.. _2330:

2330
	Stops the collection of statistics for sys.db_index_usage_stats. CAdkin: also disables
	sys.dm_db_missing_index_group_stats, and thus is useful when seeing high waits on the
	OPT_IDX_STATS spinlock.

	2003031_ | PRand_3_ | BrentOzar_1_ | CAdkin_1_

.. _2548:

2548
	"SQL 2005 has a –T2548 dbcc tracon(-1, 2548) that allows shrink* and other LOB_COMPACTION actions
	to be skipped. Enabling this returns shrink* behavior to that similar to SQL 2000."

	CSS_2_

.. _3861:

3861
	Allows the DB startup code to move system tables to the primary filegroup. Introduced for a
	bug in SQL 2014 upgrade process, where system tables could be created in a secondary filegroup
	(if that FG was the default).

	3003760_

.. _9851:

9851
	Disables Hekaton's auto-merge process; if this flag is enabled, the various merge-related
	procedures will need to be called manually. First seen in a Sunil Agarwal session at
	PASS 2014, also present in Kalen Delaney's book on Hekaton.

	<links needed>

.. _9929:

9929
	Enables an update that reduces the "disk footprint [of In-Memory OLTP] by reducing the
	In-Memory checkpoint files to 1 MB (megabytes) each."

	3147012_

.. _10204:

10204 ``Doc2016``
	`BOL 2016`_: "Disables merge/recompress during columnstore index reorganization. In SQL
	Server 2016, when a columnstore index is reorganized, there is new functionality to
	automatically merge any small compressed rowgroups into larger compressed rowgroups, as
	well as recompressing any rowgroups that have a large number of deleted rows."

.. _10207:

10207
	When a CCI is corrupt, allows a scan to skip corrupt segments and suppress errors 5288 and
	5289, thus enabling the copy-out of data in a corrupt CCI.

	3067257_ | RelSvcs_1_

|

.. _FixPastRel6:

Fixes and Past Relevance
------------------------
These flags either are old and irrelevant for modern builds, appear only in CTPs, or enable a
fix in a CU but are baselined in a later service pack or release.

.. _1802:

1802
	Workaround for: "after you detach a Microsoft SQL Server 2005 database that resides on network-
	attached storage, you cannot reattach the SQL Server database... This problem occurs because SQL
	Server 2005 resets the file permissions when the database is detached. When you try to reattach
	the database, it cannot be attached because of limited share permissions."

	It sounds like this flag disables functionality in changing permissions on database files after
	the DB is detached, thus has security implications.

	922804_ | StorEng_1_ (comments, though Kevin likely means 1807)

.. _1807:

1807
	Allows the creation of a database file on UNC paths, and is a workaround for errors 5105 and
	5110. The KB describes MSFT policy towards DBs on network locations.

	304261_

.. _9394:

9394
	(9394 is either doing double-duty or there's a typo. See other entry for 9394) Apparently
	enables a fix for an access violation when a table with Japanese characters has an
	indexed changed.

	3142595_

.. _10202:

10202
	Sunil Agarwal PASS 2014 demo script: enables new DMV named sys.dm_db_column_store_row_group_physical_stats.
	DMV was not in 2014 at the time of the demo, thus appears to be in a future (or internal)
	version of SQL Server.

.. Official Links

.. _BOL 2014: https://technet.microsoft.com/en-us/library/ms188396.aspx

.. _BOL 2016: https://technet.microsoft.com/en-us/library/ms188396.aspx

.. _ALTER DATABASE file and filegroup options: https://msdn.microsoft.com/en-us/library/bb522469.aspx

.. _ALTER DATABASE SET Options: https://msdn.microsoft.com/en-us/library/bb522682.aspx

.. _USE HINT: https://technet.microsoft.com/en-us/library/ms181714.aspx

.. _DB SCOPED CONFIG: https://technet.microsoft.com/en-us/library/mt629158.aspx

.. _2012SP2: http://support.microsoft.com/kb/2958429

.. _272220: https://support.microsoft.com/en-us/kb/272220

.. _304261: https://support.microsoft.com/en-us/kb/304261

.. _324432: https://support.microsoft.com/en-us/kb/324432

.. _328551: https://support.microsoft.com/en-us/kb/328551

.. _837938: https://support.microsoft.com/en-us/kb/837938

.. _922804: https://support.microsoft.com/en-us/kb/922804

.. _936185: https://support.microsoft.com/en-us/kb/936185

.. _947204: https://support.microsoft.com/en-us/kb/947204

.. _2000471: https://support.microsoft.com/en-us/kb/2000471

.. _2003031: https://support.microsoft.com/en-us/kb/2003031

.. _2154845: https://support.microsoft.com/en-us/kb/2154845

.. _2574695: https://support.microsoft.com/en-us/kb/2574695

.. _2986423: https://support.microsoft.com/en-us/kb/2986423

.. _3003760: https://support.microsoft.com/en-us/kb/3003760

.. _3067257: https://support.microsoft.com/en-us/kb/3067257

.. _3142595: https://support.microsoft.com/en-us/kb/3003760

.. _3147012: https://support.microsoft.com/en-us/kb/3147012

.. MSFT Blog links

.. _Arvind_1: https://blogs.msdn.microsoft.com/arvindsh/2014/02/24/tracking-tempdb-internal-object-space-usage-in-sql-2012/

.. _BobWard_Pass2011: https://www.youtube.com/watch?v=SvseGMobe2w&feature=youtu.be

.. _CSS_1: https://blogs.msdn.microsoft.com/psssql/2009/11/17/how-it-works-controlling-sql-server-memory-dumps/

.. _CSS_2: http://blogs.msdn.com/b/psssql/archive/2008/03/28/how-it-works-sql-server-2005-dbcc-shrink-may-take-longer-than-sql-server-2000.aspx

.. _CSS_3: https://blogs.msdn.microsoft.com/psssql/2008/12/17/sql-server-2005-and-2008-trace-flag-1118-t1118-usage/

.. _CSS_4: https://blogs.msdn.microsoft.com/psssql/2009/06/04/sql-server-tempdb-number-of-files-the-raw-truth/

.. _Nacho_1: https://blogs.msdn.microsoft.com/ialonso/2012/04/11/want-your-sql-server-to-simply-ignore-the-auto_close-setting-for-all-open-databases-for-which-it-has-been-enabled/

.. _Nacho_2: https://blogs.msdn.microsoft.com/ialonso/2011/12/01/attempt-to-grow-all-files-in-one-filegroup-and-not-just-the-one-next-in-the-autogrowth-chain-using-trace-flag-1117/

.. _PFE_1: https://blogs.msdn.microsoft.com/sql_pfe_blog/2009/12/22/how-and-why-to-enable-instant-file-initialization/

.. _RelSvcs_1: https://blogs.msdn.microsoft.com/sqlreleaseservices/partial-results-in-a-query-of-a-clustered-columnstore-index-in-sql-server-2014/

.. _StorEng_1: https://blogs.msdn.microsoft.com/sqlserverstorageengine/2010/02/21/backup-compression-and-virtual-device-interface-vdi/

.. Non-MSFT bloggers

.. _BrentOzar_1: https://www.brentozar.com/archive/2015/11/trace-flag-2330-who-needs-missing-index-requests/

.. _CAdkin_1: https://exadat.co.uk/2015/04/14/well-known-and-not-so-well-known-sql-server-tuning-knobs-and-switches/

.. _CAdkin_2: https://exadat.co.uk/2015/04/14/well-known-and-not-so-well-known-sql-server-tuning-knobs-and-switches/

.. _PRand_1: http://www.sqlskills.com/blogs/paul/investigating-the-proportional-fill-algorithm/

.. _PRand_2: http://www.sqlskills.com/blogs/paul/a-sql-server-dba-myth-a-day-330-instant-file-initialization-can-be-controlled-from-within-sql-server/

.. _PRand_3: http://www.sqlskills.com/blogs/paul/the-pros-and-cons-of-trace-flags/

.. _PRand_4: http://www.sqlskills.com/blogs/paul/tempdb-configuration-survey-results-and-advice/

.. _PRand_5: http://www.sqlskills.com/blogs/paul/misconceptions-around-tf-1118/

.. Connect links

.. _Connect_1: http://connect.microsoft.com/SQLServer/feedback/details/739013/alwayson-failover-results-in-reseed-of-identity

.. Forums

.. Other Links

.. _SQLArticlesDotCom: http://sql-articles.com/articles/general/day-6trace-flag-1117-auto-grow-equally-in-all-data-file/


text:
/*
 * $Id$
 */

/*

Copyright (c) 2000-2013 Board of Trustees of Leland Stanford Jr. University,
all rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
STANFORD UNIVERSITY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Except as contained in this notice, the name of Stanford University shall not
be used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from Stanford University.

*/

package org.lockss.plugin.hindawi;

import org.lockss.filter.pdf.ExtractingPdfFilterFactory;
import org.lockss.pdf.*;
import org.lockss.plugin.ArchivalUnit;
import org.lockss.util.Logger;

public class HindawiPdfFilterFactory extends ExtractingPdfFilterFactory {

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

  protected static class LastPageRecognizer extends PdfTokenStreamWorker {

    protected boolean result;

    protected int state;

    @Override
    public void setUp() throws PdfException {
      super.setUp();
      this.result = false;
      this.state = 0;
    }

    @Override
    public void operatorCallback() throws PdfException {
      if (logger.isDebug3()) {
        logger.debug3("LastPageRecognizer: initial: " + state);
        logger.debug3("LastPageRecognizer: index: " + getIndex());
        logger.debug3("LastPageRecognizer: operator: " + getOpcode());
      }

      switch (state) {

        case 0: {
          if (isBeginTextObject()) {
            ++state;
          }
        } break;

        case 1: {
          if (isShowTextGlyphPositioningEquals("Submit your manuscripts at")) {
            ++state;
          }
          else if (isEndTextObject()) {
            state = 0;
          }
        } break;

        case 2: {
          if (isShowTextGlyphPositioningEquals("http://www.hindawi.com")) {
            ++state;
          }
          else if (isEndTextObject()) {
            state = 0;
          }
        } break;

        case 3: {
          if (isEndTextObject()) {
            result = true;
            stop();
          }
        } break;

        default: {
          throw new PdfException("Invalid state in LastPageRecognizer: " + state);
        }

      }

      if (logger.isDebug3()) {
        logger.debug3("LastPageRecognizer: final: " + state);
        logger.debug3("LastPageRecognizer: result: " + result);
      }
    }

  }

  @Override
  public void transform(ArchivalUnit au,
                        PdfDocument pdfDocument)
      throws PdfException {
    // Strip ancillary data
    pdfDocument.unsetMetadata();
    pdfDocument.unsetAuthor();
    pdfDocument.unsetCreationDate();
    pdfDocument.unsetCreator();
    pdfDocument.unsetKeywords();
    pdfDocument.unsetLanguage();
    pdfDocument.unsetModificationDate();
    pdfDocument.unsetProducer();
    pdfDocument.unsetSubject();
    pdfDocument.unsetTitle();
    PdfUtil.normalizeTrailerId(pdfDocument);

    // Remove the generated last page if necessary
    LastPageRecognizer worker = new LastPageRecognizer();
    int lastPageIndex = pdfDocument.getNumberOfPages() - 1;
    worker.process(pdfDocument.getPage(lastPageIndex).getPageTokenStream());
    if (worker.result) {
      logger.debug2("Removing the last page");
      pdfDocument.removePage(lastPageIndex);
    }
    else {
      logger.debug2("Not removing the last page");
    }
  }

}


text:
declare namespace jsrsasign.KJUR.asn1.cades {
    /**
     * class for OtherHashAlgAndValue ASN.1 object
     * @param params associative array of parameters
     * @description
     * ```
     * OtherHashAlgAndValue ::= SEQUENCE {
     *    hashAlgorithm   AlgorithmIdentifier,
     *    hashValue       OtherHashValue }
     * OtherHashValue ::= OCTET STRING
     * ```
     */
    class OtherHashAlgAndValue extends ASN1Object {
        constructor(params?: { alg: string; hash: string });
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="action_editSection">Edit</string>
    <string name="action_deleteSection">Delete</string>
    <string name="action_retryDeleteSection">Retry</string>
    <string name="action_readMore">Read more</string>

    <string name="info_onSectionEdited">Saved</string>

    <string name="error_onDeleteSection">Unable to delete</string>
</resources>


text:
package org.jtwig.property.resolver;

import com.google.common.base.Optional;
import org.jtwig.property.resolver.request.PropertyResolveRequest;
import org.jtwig.property.strategy.method.ArgumentsConverter;
import org.jtwig.reflection.model.Value;
import org.jtwig.reflection.model.java.JavaMethod;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.lang.reflect.InvocationTargetException;

public class MethodPropertyResolver implements PropertyResolver {
    private static final Logger logger = LoggerFactory.getLogger(MethodPropertyResolver.class);
    private final JavaMethod javaMethod;
    private final ArgumentsConverter argumentsConverter;

    public MethodPropertyResolver(JavaMethod javaMethod, ArgumentsConverter argumentsConverter) {
        this.javaMethod = javaMethod;
        this.argumentsConverter = argumentsConverter;
    }

    @Override
    public Optional<Value> resolve(PropertyResolveRequest request) {
        if (request.getContext() == null) return Optional.absent();

        Object[] arguments = request.getArguments().toArray();
        Optional<Object[]> convert = argumentsConverter.convert(javaMethod, arguments);
        if (convert.isPresent()) {
            try {
                return Optional.of(new Value(javaMethod.invoke(request.getContext(), convert.get())));
            } catch (InvocationTargetException | IllegalAccessException | IllegalArgumentException e) {
                logger.debug("Unable to retrieve value from method {} with arguments {}", javaMethod, request.getArguments(), e);
                return Optional.absent();
            }
        } else {
            logger.debug("Cannot convert arguments provided {} to defined method arguments types {}.", arguments, javaMethod.arguments());
            return Optional.absent();
        }
    }
}


text:
[![NPM version][npm-image]][npm-url]
[![NPM downloads][npm-download-image]][npm-download-url]
[![Build Status][travis-image]][travis-url]
[![Coverage Status][codecov-image]][codecov-url]
[![DevDependency Status][daviddm-dev-image]][daviddm-dev-url]
[![License][license-image]][license-url]

AWS config file loader for CLI tools.

this library load `~/.aws/config` that [aws-sdk-js](https://github.com/aws/aws-sdk-js) is not supported.

## Installation

```
npm install aws-sdk-config-loader aws-sdk
```

## Usage

API Document: https://moqada.github.io/aws-sdk-config-loader/

put following `~/.aws/credentials`

```
[default]
aws_access_key_id = default_key_id
aws_secret_access_key = default_secret_key
[foo]
aws_access_key_id = foo_key_id
aws_secret_access_key = foo_secret_key
```

put following `~/.aws/config`.

```
[default]
region = ap-northeast-1
[foo]
region = us-east-1
```

```javascript
import AWS from 'aws-sdk';
import loader from 'aws-sdk-config-loader';

loader(AWS);
// AWS.config.region === 'ap-northeast-1'
// AWS.config.credentials.accessKeyId = 'default_key_id'
// AWS.config.credentials.secretAccessKey = 'default_secret_key'

// export AWS_PROFILE=foo
loader(AWS);
// AWS.config.region === 'us-east-1'
// AWS.config.credentials.accessKeyId = 'foo_key_id'
// AWS.config.credentials.secretAccessKey = 'foo_secret_key'

// export AWS_CONFIG_FILE=/path/to/config
loader(AWS);
// set AWS.config from /path/to/config

loader(AWS, {profile: 'foo'})
// AWS.config.region === 'us-east-1'
// AWS.config.credentials.accessKeyId = 'foo_key_id'
// AWS.config.credentials.secretAccessKey = 'foo_secret_key'

loader(AWS, {profile: 'foo', noReflectCredentials: true})
// AWS.config.region === 'us-east-1'
// AWS.config.credentials.accessKeyId = 'default_key_id'
// AWS.config.credentials.secretAccessKey = 'default_secret_key'
```

[npm-url]: https://www.npmjs.com/package/aws-sdk-config-loader
[npm-image]: https://img.shields.io/npm/v/aws-sdk-config-loader.svg?style=flat-square
[npm-download-url]: https://www.npmjs.com/package/aws-sdk-config-loader
[npm-download-image]: https://img.shields.io/npm/dt/aws-sdk-config-loader.svg?style=flat-square
[travis-url]: https://travis-ci.org/moqada/aws-sdk-config-loader
[travis-image]: https://img.shields.io/travis/moqada/aws-sdk-config-loader.svg?style=flat-square
[codecov-url]: https://codecov.io/github/moqada/aws-sdk-config-loader
[codecov-image]: https://img.shields.io/codecov/c/github/moqada/aws-sdk-config-loader.svg?style=flat-square
[daviddm-dev-url]: https://david-dm.org/moqada/aws-sdk-config-loader#info=devDependencies
[daviddm-dev-image]: https://img.shields.io/david/dev/moqada/aws-sdk-config-loader.svg?style=flat-square
[license-url]: http://opensource.org/licenses/MIT
[license-image]: https://img.shields.io/npm/l/aws-sdk-config-loader.svg?style=flat-square


text:
<?php

/**
 * PHP version 7.1
 *
 * @package  SaaS\Service\Dellin\Model\Response\Book
 * @author   RetailDriver LLC <integration@retailcrm.ru>
 * @license  https://retailcrm.ru Proprietary
 * @link     http://retailcrm.ru
 * @see      https://help.retailcrm.ru
 */
namespace SaaS\Service\Dellin\Model\Response\Book;

use Er1z\FakeMock\Annotations\FakeMock;
use Er1z\FakeMock\Annotations\FakeMockField;
use JMS\Serializer\Annotation as Serializer;

/**
 * Class CounteragentResponse
 *
 * @package  SaaS\Service\Dellin\Model\Response\Book
 * @author   RetailDriver LLC <integration@retailcrm.ru>
 * @license  https://retailcrm.ru Proprietary
 * @link     http://retailcrm.ru
 * @see      https://help.retailcrm.ru
 *
 * @FakeMock()
 */
class CounteragentResponse
{
    /**
     * @var SuccessCounteragent
     *
     * @Serializer\Type("SaaS\Service\Dellin\Model\Response\Book\SuccessCounteragent")
     * @Serializer\SerializedName("success")
     *
     * @FakeMockField()
     */
    public $success;
}


text:
import java.util.ArrayList;
import java.util.Collections;

public class Cup {

	private int dice;

	public Cup() {

	}

	// Generates random results for x dice
	public ArrayList<Integer> throwDice(int dice) {
		ArrayList<Integer> result = new ArrayList<>();

		for (int i = 0; i<dice; i++) {
			result.add(randomWithRange(1,6));
		}

		return result;
	}

	public int[] scoreDice(ArrayList<Integer> dice) {
		int score = 0;
		int freeDice = dice.size();

		// Check for 3 of a kind
		for (int i = 1; i<7; i++) {
			int occurrences = Collections.frequency(dice, i);

			if (occurrences >= 3) {
				if (i == 1) score = 1000;
				else score = i*100;
				occurrences -= 3;
				freeDice -= 3;
			}

			if (i == 1 || i == 5) {
				score += occurrences*numberScore(i);
				freeDice -= occurrences;
			}
		}

		int[] response = new int[2];
		response[0] = score;
		response[1] = freeDice;
		return response;
	}

	private int numberScore(int n) {
		if (n == 1) return 100;
		else if (n == 5) return 50;
		else return 0;
	}

	int randomWithRange(int min, int max) {
	   int range = (max - min) + 1;
	   return (int)(Math.random() * range) + min;
	}
}


text:
#ifndef _MPxBlendShape
#define _MPxBlendShape
// ===========================================================================
// Copyright 2016 Autodesk, Inc.  All rights reserved.
//
// Use of this software is subject to the terms of the Autodesk license
// agreement provided at the time of installation or download, or which
// otherwise accompanies this software in either electronic or hard copy form.
// ===========================================================================
//
// CLASS:    MPxBlendShape
//
// ****************************************************************************

#if defined __cplusplus

// ****************************************************************************
// INCLUDED HEADER FILES

#include <maya/MStatus.h>
#include <maya/MTypes.h>
#include <maya/MObject.h>
#include <maya/MPxGeometryFilter.h>
#include <maya/MSelectionList.h>

// ****************************************************************************
// CLASS DECLARATION (MPxBlendShape)

class MItGeometry;
class MDagModifier;

//! \ingroup OpenMayaAnim MPx
//! \brief Base class for user-defined blendshape deformers
/*!
 MPxBlendShape allows the creation of user-defined blendshape deformers.
 It derives from MPxGeometryFilter and so offers all the functionality of that class.
 Additionally, it has the input target and all other attributes
 of the Maya built-in blendShape node.

 Custom nodes derived from MPxBlendShape are treated by Maya just like the built-in blendShape,
 so all the weight painting/editing etc. tools that artists are used to also work on the custom nodes.
*/
class OPENMAYAANIM_EXPORT MPxBlendShape : public MPxGeometryFilter
{
public:

	MPxBlendShape();

	virtual ~MPxBlendShape();

	virtual MPxNode::Type type() const;

	// Methods to overload

	// deformData is called by computePlug when an output geometry
	// value is evaluated
	//

    virtual MStatus        deformData(MDataBlock& block,
								  MDataHandle geomData,
								  unsigned int groupId,
								  const MMatrix& mat,
								  unsigned int multiIndex);

	// Inherited attributes
	//! weight attribute, multi
	static MObject weight;
	//! inputTarget attribute, multi
	static MObject inputTarget;
	//! inputTargetGroup attribute, multi
	static MObject inputTargetGroup;
	//! inputTargetItem attribute, multi
	static MObject inputTargetItem;
	//! inputGeomTarget attribute
	static MObject inputGeomTarget;
	//! inputPointsTarget attribute
	static MObject inputPointsTarget;
	//! inputComponentsTarget attribute
	static MObject inputComponentsTarget;
	//! targetWeights attribute, multi
	static MObject targetWeights;

	static const char*	    className();

protected:
// No protected members

private:
	static void				initialSetup();
};

#endif /* __cplusplus */
#endif /* _MPxBlendShape */


text:
using System.Reflection;
using True.KenticoMapper.Core;
using True.KenticoMapper.TreeNode.Wrappers;

namespace True.KenticoMapper.TreeNode.Mapping
{
    public class MapTreeNodeRelativeUrl : IMapValue
    {
        private readonly IKenticoTreeNode _source;

        public MapTreeNodeRelativeUrl(IKenticoTreeNode source)
        {
            _source = source;
        }

        public void Set(PropertyInfo property, object target)
        {
            var value = _source.RelativeUrl;
            property.SetValue(target, value, null);
        }
    }
}