text:
Adds an AWS::ElasticBeanstalk::ConfigurationTemplate resource to the template.
The AWS::ElasticBeanstalk::ConfigurationTemplate resource is an AWS Elastic Beanstalk resource type that specifies an Elastic Beanstalk configuration template, associated with a specific Elastic Beanstalk application.
You define application configuration settings in a configuration template.
You can then use the configuration template to deploy different versions of the application with the same configuration settings.

## SYNTAX

```
New-VSElasticBeanstalkConfigurationTemplate [-LogicalId] <String> -ApplicationName <Object>
 [-Description <Object>] [-EnvironmentId <Object>] [-OptionSettings <Object>] [-PlatformArn <Object>]
 [-SolutionStackName <Object>] [-SourceConfiguration <Object>] [-DeletionPolicy <String>]
 [-UpdateReplacePolicy <String>] [-DependsOn <String[]>] [-Metadata <Object>] [-UpdatePolicy <Object>]
 [-Condition <Object>] [<CommonParameters>]
```

## DESCRIPTION
Adds an AWS::ElasticBeanstalk::ConfigurationTemplate resource to the template.
The AWS::ElasticBeanstalk::ConfigurationTemplate resource is an AWS Elastic Beanstalk resource type that specifies an Elastic Beanstalk configuration template, associated with a specific Elastic Beanstalk application.
You define application configuration settings in a configuration template.
You can then use the configuration template to deploy different versions of the application with the same configuration settings.

**Note**

The Elastic Beanstalk console and documentation often refer to configuration templates as *saved configurations*.
When you set configuration options in a saved configuration (configuration template, Elastic Beanstalk applies them with a particular precedence as part of applying options from multiple sources.
For more information, see  Configuration Options: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html in the *AWS Elastic Beanstalk Developer Guide*.

## PARAMETERS

### -LogicalId
The logical ID must be alphanumeric (A-Za-z0-9) and unique within the template.
Use the logical name to reference the resource in other parts of the template.
For example, if you want to map an Amazon Elastic Block Store volume to an Amazon EC2 instance, you reference the logical IDs to associate the block stores with the instance.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ApplicationName
The name of the Elastic Beanstalk application to associate with this configuration template.

Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticbeanstalk-configurationtemplate.html#cfn-elasticbeanstalk-configurationtemplate-applicationname
PrimitiveType: String
UpdateType: Immutable

```yaml
Type: Object
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Description
An optional description for this configuration.

Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticbeanstalk-configurationtemplate.html#cfn-elasticbeanstalk-configurationtemplate-description
PrimitiveType: String
UpdateType: Mutable

```yaml
Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -EnvironmentId
The ID of an environment whose settings you want to use to create the configuration template.
You must specify EnvironmentId if you don't specify PlatformArn, SolutionStackName, or SourceConfiguration.

Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticbeanstalk-configurationtemplate.html#cfn-elasticbeanstalk-configurationtemplate-environmentid
PrimitiveType: String
UpdateType: Immutable

```yaml
Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -OptionSettings
Option values for the Elastic Beanstalk configuration, such as the instance type.
If specified, these values override the values obtained from the solution stack or the source configuration template.
For a complete list of Elastic Beanstalk configuration options, see Option Values: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html in the *AWS Elastic Beanstalk Developer Guide*.

Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticbeanstalk-configurationtemplate.html#cfn-elasticbeanstalk-configurationtemplate-optionsettings
DuplicatesAllowed: True
ItemType: ConfigurationOptionSetting
Type: List
UpdateType: Mutable

```yaml
Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -PlatformArn
The Amazon Resource Name ARN of the custom platform.
For more information, see  Custom Platforms: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/custom-platforms.html in the *AWS Elastic Beanstalk Developer Guide*.
If you specify PlatformArn, then don't specify SolutionStackName.

Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticbeanstalk-configurationtemplate.html#cfn-elasticbeanstalk-configurationtemplate-platformarn
PrimitiveType: String
UpdateType: Immutable

```yaml
Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -SolutionStackName
The name of an Elastic Beanstalk solution stack platform version that this configuration uses.
For example, 64bit Amazon Linux 2013.09 running Tomcat 7 Java 7.
A solution stack specifies the operating system, runtime, and application server for a configuration template.
It also determines the set of configuration options as well as the possible and default values.
For more information, see Supported Platforms: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/concepts.platforms.html in the *AWS Elastic Beanstalk Developer Guide*.
You must specify SolutionStackName if you don't specify PlatformArn, EnvironmentId, or SourceConfiguration.
Use the  ListAvailableSolutionStacks : https://docs.aws.amazon.com/elasticbeanstalk/latest/api/API_ListAvailableSolutionStacks.html API to obtain a list of available solution stacks.

Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticbeanstalk-configurationtemplate.html#cfn-elasticbeanstalk-configurationtemplate-solutionstackname
PrimitiveType: String
UpdateType: Immutable

```yaml
Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -SourceConfiguration
An Elastic Beanstalk configuration template to base this one on.
If specified, Elastic Beanstalk uses the configuration values from the specified configuration template to create a new configuration.
Values specified in OptionSettings override any values obtained from the SourceConfiguration.
You must specify SourceConfiguration if you don't specify PlatformArn, EnvironmentId, or SolutionStackName.
Constraint: If both solution stack name and source configuration are specified, the solution stack of the source configuration template must match the specified solution stack name.

Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticbeanstalk-configurationtemplate.html#cfn-elasticbeanstalk-configurationtemplate-sourceconfiguration
Type: SourceConfiguration
UpdateType: Immutable

```yaml
Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted.
You specify a DeletionPolicy attribute for each resource that you want to control.
If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.

To keep a resource when its stack is deleted, specify Retain for that resource.
You can use retain for any resource.
For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.

You must use one of the following options: "Delete","Retain","Snapshot"

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -UpdateReplacePolicy
Use the UpdateReplacePolicy attribute to retain or (in some cases) backup the existing physical instance of a resource when it is replaced during a stack update operation.

When you initiate a stack update, AWS CloudFormation updates resources based on differences between what you submit and the stack's current template and parameters.
If you update a resource property that requires that the resource be replaced, AWS CloudFormation recreates the resource during the update.
Recreating the resource generates a new physical ID.
AWS CloudFormation creates the replacement resource first, and then changes references from other dependent resources to point to the replacement resource.
By default, AWS CloudFormation then deletes the old resource.
Using the UpdateReplacePolicy, you can specify that AWS CloudFormation retain or (in some cases) create a snapshot of the old resource.

For resources that support snapshots, such as AWS::EC2::Volume, specify Snapshot to have AWS CloudFormation create a snapshot before deleting the old resource instance.

You can apply the UpdateReplacePolicy attribute to any resource.
UpdateReplacePolicy is only executed if you update a resource property whose update behavior is specified as Replacement, thereby causing AWS CloudFormation to replace the old resource with a new one with a new physical ID.
For example, if you update the Engine property of an AWS::RDS::DBInstance resource type, AWS CloudFormation creates a new resource and replaces the current DB instance resource with the new one.
The UpdateReplacePolicy attribute would then dictate whether AWS CloudFormation deleted, retained, or created a snapshot of the old DB instance.
The update behavior for each property of a resource is specified in the reference topic for that resource in the AWS Resource and Property Types Reference.
For more information on resource update behavior, see Update Behaviors of Stack Resources.

The UpdateReplacePolicy attribute applies to stack updates you perform directly, as well as stack updates performed using change sets.

Note
Resources that are retained continue to exist and continue to incur applicable charges until you delete those resources.
Snapshots that are created with this policy continue to exist and continue to incur applicable charges until you delete those snapshots.
UpdateReplacePolicy retains the old physical resource or snapshot, but removes it from AWS CloudFormation's scope.

UpdateReplacePolicy differs from the DeletionPolicy attribute in that it only applies to resources replaced during stack updates.
Use DeletionPolicy for resources deleted when a stack is deleted, or when the resource definition itself is deleted from the template as part of a stack update.

You must use one of the following options: "Delete","Retain","Snapshot"

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another.
When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute.

This parameter takes a string or list of strings representing Logical IDs of resources that must be created prior to this resource being created.

```yaml
Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Metadata
The Metadata attribute enables you to associate structured data with a resource.
By adding a Metadata attribute to a resource, you can add data in JSON or YAML to the resource declaration.
In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.

You must use a PSCustomObject containing key/value pairs here.
This will be returned when describing the resource using AWS CLI.

```yaml
Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -UpdatePolicy
Use the UpdatePolicy attribute to specify how AWS CloudFormation handles updates to the AWS::AutoScaling::AutoScalingGroup resource.
AWS CloudFormation invokes one of three update policies depending on the type of change you make or whether a scheduled action is associated with the Auto Scaling group.

You must use the "Add-UpdatePolicy" function here.

```yaml
Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Condition
Logical ID of the condition that this resource needs to be true in order for this resource to be provisioned.

```yaml
Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

## OUTPUTS

### Vaporshell.Resource.ElasticBeanstalk.ConfigurationTemplate
## NOTES

## RELATED LINKS

[http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticbeanstalk-configurationtemplate.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticbeanstalk-configurationtemplate.html)


text:
#import "RootViewController.h"
#import "BufferViewController.h"
#import "CutterViewController.h"
#import "DensifyViewController.h"
#import "UnionDifferenceViewController.h"
#import "OffsetViewController.h"
#import "ProjectViewController.h"
#import "RelationshipViewController.h"
#import "MeasureViewController.h"

#define kBufferViewControllerIdentifier @"BufferViewController"
#define kCutterViewControllerIdentifier @"CutterViewController"
#define kDensifyViewControllerIdentifier @"DensifyViewController"
#define kUnionDifferenceViewControllerIdentifier @"UnionDifferenceViewController"
#define kOffsetViewControllerIdentifier @"OffsetViewController"
#define kProjectViewControllerIdentifier @"ProjectViewController"
#define kRelationshipViewControllerIdentifier @"RelationshipViewController"
#define kMeasureViewControllerIdentifier @"MeasureViewController"

@implementation RootViewController

#pragma mark -
#pragma mark Table view data source

- (NSInteger)tableView:(UITableView *)aTableView numberOfRowsInSection:(NSInteger)section {

    // Eight sections, one for each detail view controller.
    return 8;
}

// in iOS7 this gets called and hides the status bar so the view does not go under the top iPhone status bar
- (BOOL)prefersStatusBarHidden
{
    return YES;
}

- (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"RootViewControllerCellIdentifier";

    // Dequeue or create a cell of the appropriate type.
    UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }

    // Set appropriate labels for the cells.
    if (indexPath.row == 0) {
        cell.textLabel.text = @"Buffer";
    }
    else if (indexPath.row == 1) {
        cell.textLabel.text = @"Cut";
    }
    else if(indexPath.row ==2) {
        cell.textLabel.text = @"Densify";
    }
    else if(indexPath.row == 3) {
        cell.textLabel.text = @"Union & Difference";
    }
    else if(indexPath.row == 4) {
         cell.textLabel.text = @"Offset";
    }
    else if (indexPath.row == 5) {
        cell.textLabel.text = @"Project";
    }
    else if (indexPath.row == 6) {
        cell.textLabel.text = @"Spatial Relationships";
    }
    else {
        cell.textLabel.text = @"Measure";
    }

    return cell;
}

#pragma mark -
#pragma mark Table view selection

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

    NSUInteger row = indexPath.row;

    //Obtain an instance of storyboard to create an object of the desired view controller
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Storyboard" bundle:[NSBundle mainBundle]];
    NSString *desiredViewControllerIdentifier;

    // Create and configure a new detail view controller appropriate for the selection.
    UIViewController *detailViewController = nil;

    if (row == 0) {
        desiredViewControllerIdentifier = kBufferViewControllerIdentifier;
    }
    else if (row == 1) {
        desiredViewControllerIdentifier = kCutterViewControllerIdentifier;
    }
    else if (row == 2) {
        desiredViewControllerIdentifier = kDensifyViewControllerIdentifier;
    }
    else if (row == 3) {
        desiredViewControllerIdentifier = kUnionDifferenceViewControllerIdentifier;
    }
    else if (row == 4) {
        desiredViewControllerIdentifier = kOffsetViewControllerIdentifier;
    }
    else if (row == 5) {
        desiredViewControllerIdentifier = kProjectViewControllerIdentifier;
    }
    else if (row == 6) {
        desiredViewControllerIdentifier = kRelationshipViewControllerIdentifier;
    }
    else {
        desiredViewControllerIdentifier = kMeasureViewControllerIdentifier;
    }

    //instantiate the desired view controller
    detailViewController = [storyboard instantiateViewControllerWithIdentifier:desiredViewControllerIdentifier];

    // Update the split view controller's view controllers array.
    UISplitViewController *splitViewController = [self.navigationController splitViewController];
    NSArray *viewControllers = [[NSArray alloc] initWithObjects:self.navigationController, detailViewController, nil];
    splitViewController.viewControllers = viewControllers;

}

#pragma mark -
#pragma mark View lifecycle

- (void)viewDidLoad {

    [super viewDidLoad];
    self.title = @"Operations";
}

#pragma mark -
#pragma mark Rotation support

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return YES;
}

#pragma mark -
#pragma mark Memory management

@end

redpajama_set_name: RedPajamaGithub


text:
using System;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.UI.ApplicationSettings;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

// The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227

namespace Image_Importer
{
    /// <summary>
    /// Provides application-specific behavior to supplement the default Application class.
    /// </summary>
    sealed partial class App : Application
    {
        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            this.InitializeComponent();
            this.Suspending += OnSuspending;
        }

        protected override void OnFileActivated(FileActivatedEventArgs args)
        {
            Frame rootFrame = (Frame)Window.Current.Content;
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();
                // Set the default language
                rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (args.Verb == "open")
            {
                rootFrame.Navigate(typeof(Views.SingleImageView), args.Files[0]);
            }

            if (args.Verb == "import")
            {
                var folder = (Windows.Storage.StorageFolder)args.Files[0];
                Common.Models.ImageDevice imageDevice = Common.Models.ImageDevice.FromFolder(folder);
                rootFrame.Navigate(typeof(Views.FilesView), imageDevice);
            }

            Window.Current.Activate();

            base.OnFileActivated(args);
        }

        protected override void OnActivated(IActivatedEventArgs args)
        {
            Frame rootFrame = (Frame)Window.Current.Content;
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();
                // Set the default language
                rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (args.Kind == ActivationKind.Device)
            {
                // Cast the activated event args as DeviceActivatedEventArgs and show images
                var deviceArgs = args as DeviceActivatedEventArgs;
                if (deviceArgs != null)
                {
                    Common.Models.ImageDevice imageDevice = Common.Models.ImageDevice.FromDeviceId(deviceArgs.DeviceInformationId);
                    rootFrame.Navigate(typeof(Views.FilesView), imageDevice);
                }
            }

            Window.Current.Activate();

            base.OnActivated(args);
        }

        #region Settings Page

        public void onCommandsRequested(SettingsPane settingsPane, SettingsPaneCommandsRequestedEventArgs eventArgs)
        {
            //SettingsCommand aboutCommand = new SettingsCommand("mainSettings", "Import Settings", (x) =>
            //{
            //    SettingsFlyout flyout = new SettingsFlyout();
            //    flyout.Content = new Views.SettingsMain();
            //    flyout.Title = "Import Settings";
            //    flyout.Background = new SolidColorBrush(Windows.UI.Colors.DarkGray);
            //    flyout.Show();
            //});
            //eventArgs.Request.ApplicationCommands.Add(aboutCommand);

            SettingsCommand privacyCommand = new SettingsCommand("privacyCommand", "Privacy Policy", (x) =>
            {
                Uri location = new Uri("http://massivescale.com/pages/apps/image-importer/image-importer-privacy-policy/");
                var ignore = Windows.System.Launcher.LaunchUriAsync(location);
            });
            eventArgs.Request.ApplicationCommands.Add(privacyCommand);
        }

        #endregion Settings Page

        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
#if DEBUG
            this.UnhandledException += App_UnhandledException;
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = true;
            }
#endif

            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();
                // Set the default language
                rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                if (!rootFrame.Navigate(typeof(Views.DevicesView), e.Arguments))
                {
                    throw new Exception("Failed to create initial page");
                }
            }

            SettingsPane.GetForCurrentView().CommandsRequested += onCommandsRequested;

            // Ensure the current window is active
            Window.Current.Activate();
        }

        private void App_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            System.Diagnostics.Debugger.Launch();
        }

        /// <summary>
        /// Invoked when application execution is being suspended.  Application state is saved
        /// without knowing whether the application will be terminated or resumed with the contents
        /// of memory still intact.
        /// </summary>
        /// <param name="sender">The source of the suspend request.</param>
        /// <param name="e">Details about the suspend request.</param>
        private void OnSuspending(object sender, SuspendingEventArgs e)
        {
            var deferral = e.SuspendingOperation.GetDeferral();
            //TODO: Save application state and stop any background activity
            deferral.Complete();
        }
    }
}


text:
package ru.pft40.bugHunter.tests;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.thoughtworks.xstream.XStream;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import ru.pft40.bugHunter.model.GroupData;
import ru.pft40.bugHunter.model.Groups;

import java.io.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;

public class GroupCreationTests extends TestBase {

    @DataProvider
    public Iterator<Object[]> validGroupsJson() throws IOException {
        try (BufferedReader reader = new BufferedReader(new FileReader(new File("src/test/resources/groups.json")))) {
            StringBuilder json = new StringBuilder();
            String line = reader.readLine();
            while (line != null) {
                json.append(line);
                line = reader.readLine();
            }
            Gson gson = new Gson();
            List<GroupData> groups = gson.fromJson(json.toString(), new TypeToken<List<GroupData>>() {}.getType());
            return groups.stream().map((g) -> new Object[] {g}).collect(Collectors.toList()).iterator();
        }
    }

    @Test(dataProvider = "validGroupsJson")
    public void testGroupCreation_GetGroupListFromDB(GroupData group) {

        appMngr.goTo().groupPage();
        Groups before = appMngr.db().groups();
        appMngr.group().create(group, 2);
        assertThat(appMngr.group().count(), equalTo(before.size() + 1));
        Groups after = appMngr.db().groups();
        assertThat(after, equalTo(before
                .withAdded(group.withId(after.stream().mapToInt((g) -> g.getId()).max().getAsInt()))));
        verifyGroupListInUI();
    }

    @Test(dataProvider = "validGroupsJson", enabled = false)
    public void testGroupCreation_GetGroupListFromUI(GroupData group) {

        appMngr.goTo().groupPage();
        Groups before = appMngr.group().all();
        appMngr.group().create(group, 1);
        assertThat(appMngr.group().count(), equalTo(before.size() + 1));
        Groups after = appMngr.group().all();
        assertThat(after, equalTo(before
                .withAdded(group.withId(after.stream().mapToInt((g) -> g.getId()).max().getAsInt()))));
    }

    @Test(enabled = false)
    public void testBadGroupCreation(GroupData group) {

        appMngr.goTo().groupPage();
        Groups before = appMngr.group().all();
        appMngr.group().create(group, 1);
        assertThat(appMngr.group().count(), equalTo(before.size()));
        Groups after = appMngr.group().all();
        assertThat(after, equalTo(before));
    }

    @DataProvider
    public Iterator<Object[]> validGroupsCsv() throws IOException {
        List<Object[]> list = new ArrayList<>();
        try (BufferedReader reader = new BufferedReader(new FileReader(new File("src/test/resources/groups.csv")))) {
            String line = reader.readLine();
            while (line != null) {
                String[] split = line.split(";");
                list.add(new Object[] {new GroupData().withName(split[0]).withHeader(split[1]).withFooter(split[2])});
                line = reader.readLine();
            }
            return list.iterator();
        }
    }

    @DataProvider
    public Iterator<Object[]> validGroupsXml() throws IOException {
        try (BufferedReader reader = new BufferedReader(new FileReader(new File("src/test/resources/groups.xml")))) {
            StringBuilder xml = new StringBuilder();
            String line = reader.readLine();
            while (line != null) {
                xml.append(line);
                line = reader.readLine();
            }
            XStream xStream = new XStream();
            xStream.processAnnotations(GroupData.class);
            List<GroupData> groups = (List<GroupData>)xStream.fromXML(xml.toString());
            return groups.stream().map((g) -> new Object[] {g}).collect(Collectors.toList()).iterator();
        }
    }
}


text:
package org.jcodec.containers.mp4;

import java.nio.ByteBuffer;

import org.jcodec.common.model.Packet;
import org.jcodec.common.model.TapeTimecode;

/**
 * This class is part of JCodec ( www.jcodec.org ) This software is distributed
 * under FreeBSD License
 *
 * @author The JCodec project
 */
public class MP4Packet extends Packet {
    private long mediaPts;
    private int entryNo;
    private long fileOff;
    private int size;
    private boolean psync;

    public MP4Packet(ByteBuffer data, long pts, long timescale, long duration, long frameNo, boolean iframe,
            TapeTimecode tapeTimecode, long mediaPts, int entryNo) {
        super(data, pts, timescale, duration, frameNo, iframe, tapeTimecode);
        this.mediaPts = mediaPts;
        this.entryNo = entryNo;
    }

    public MP4Packet(ByteBuffer data, long pts, long timescale, long duration, long frameNo, boolean iframe,
            TapeTimecode tapeTimecode, long mediaPts, int entryNo, long fileOff, int size, boolean psync) {
        super(data, pts, timescale, duration, frameNo, iframe, tapeTimecode);
        this.mediaPts = mediaPts;
        this.entryNo = entryNo;
        this.fileOff = fileOff;
        this.size = size;
        this.psync = psync;
    }

    public MP4Packet(MP4Packet packet, ByteBuffer frm) {
        super(packet, frm);
        this.mediaPts = packet.mediaPts;
        this.entryNo = packet.entryNo;
    }

    public MP4Packet(MP4Packet packet, TapeTimecode timecode) {
        super(packet, timecode);
        this.mediaPts = packet.mediaPts;
        this.entryNo = packet.entryNo;
    }

    public MP4Packet(Packet packet, long mediaPts, int entryNo) {
        super(packet);
        this.mediaPts = mediaPts;
        this.entryNo = entryNo;
    }

    public MP4Packet(MP4Packet packet) {
        super(packet);
        this.mediaPts = packet.mediaPts;
        this.entryNo = packet.entryNo;
    }

    /**
     * Zero-offset sample entry index
     *
     * @return
     */
    public int getEntryNo() {
        return entryNo;
    }

    public long getMediaPts() {
        return mediaPts;
    }

    public long getFileOff() {
        return fileOff;
    }

    public int getSize() {
        return size;
    }

    public boolean isPsync() {
        return psync;
    }
}


text:
import datetime as dt
import typing as t
from functools import partial
from io import BytesIO
from pathlib import Path

import dropbox
import imagehash
import pytz
import redis
import requests
from PIL import Image
from resizeimage import resizeimage
from timezonefinderL import TimezoneFinder

from kamera import config, image_processing
from kamera.logger import log

seconds_in_fortnight = int(dt.timedelta(weeks=1).total_seconds())

class FoundBetterDuplicateException(Exception):
    pass

class Task:
    dbx_cache: t.Dict[str, dropbox.Dropbox] = {}
    settings_cache: t.Dict[str, config.Settings] = {}
    redis_client: redis.Redis = None

    def __init__(
        self,
        account_id: str,
        entry: dropbox.files.FileMetadata,
        review_dir: Path,
        backup_dir: Path,
        error_dir: Path,
    ) -> None:
        self.account_id: str = account_id
        self.path: Path = Path(entry.path_display)
        self.name: str = self.path.name
        self.client_modified: dt.datetime = entry.client_modified
        self.review_dir: Path = review_dir
        self.backup_dir: Path = backup_dir
        self.error_dir: Path = error_dir

    def __repr__(self):
        return repr(self.name)

    @classmethod
    def connect_redis(cls) -> None:
        if cls.redis_client is None:
            cls.redis_client = redis.Redis(
                host=config.redis_host,
                port=config.redis_port,
                password=config.redis_password,
            )
        return cls.redis_client

    @classmethod
    def load_dbx_from_cache(
        cls, account_id: str, redis_client: redis.Redis
    ) -> dropbox.Dropbox:
        try:
            dbx = cls.dbx_cache[account_id]
        except KeyError:
            dbx = dropbox.Dropbox(config.get_dbx_token(redis_client, account_id))
            cls.dbx_cache[account_id] = dbx
        return dbx

    @classmethod
    def load_settings_from_cache(
        cls, account_id: str, dbx: dropbox.Dropbox
    ) -> config.Settings:
        try:
            settings = cls.settings_cache[account_id]
            log.debug("Settings loaded from cache")
        except KeyError:
            settings = config.Settings(dbx)
            cls.settings_cache[account_id] = settings
            log.debug("Settings loaded from dbx")
        return settings

    def main(self):
        try:
            redis_client = Task.connect_redis()
            dbx = Task.load_dbx_from_cache(self.account_id, redis_client)
            settings = Task.load_settings_from_cache(self.account_id, dbx)
        except Exception:
            log.exception("Exception occured during task setup")
            return
        self.process_entry(redis_client, dbx, settings)

    def process_entry(
        self, redis_client: redis.Redis, dbx: dropbox.Dropbox, settings: config.Settings
    ) -> None:
        start_time = dt.datetime.now()
        log.info(f"{self.name}: Processing")

        try:
            time_taken, dimensions, coordinates = parse_metdata(self.path, dbx)
            date = parse_date(
                time_taken, self.client_modified, coordinates, settings.default_tz
            )
            out_name = get_out_name(self.path.stem, self.path.suffix, date)
            subfolder = Path(str(date.year), settings.folder_names[date.month])
            review_path = self.review_dir / subfolder / out_name
            backup_path = self.backup_dir / subfolder / self.name

            if self.path.suffix.lower() in config.video_extensions:
                copy_entry(dbx, self.path, review_path)
                move_entry(dbx, self.path, backup_path)
                return

            elif self.path.suffix.lower() not in config.image_extensions:
                return

            _, response = download_entry(dbx, self.path.as_posix())
            in_data = response.raw.data
            new_data = image_processing.main(
                data=in_data,
                filepath=self.path,
                date=date,
                settings=settings,
                coordinates=coordinates,
                dimensions=dimensions,
            )

            img_hash = get_hash(data=new_data if new_data is not None else in_data)
            handle_duplication(
                account_id_and_img_hash=f"user:{self.account_id}, hash:{img_hash}",
                file_path=review_path,
                dbx=dbx,
                redis_client=redis_client,
                dimensions=dimensions,
            )

            if new_data is None:
                copy_entry(dbx, self.path, review_path)
            else:
                upload_entry(dbx, new_data, review_path)

            move_entry(dbx, self.path, backup_path)
        except FoundBetterDuplicateException:
            log.info(f"{self.name}: Found better duplicate, finishing")
            move_entry(dbx, self.path, backup_path)
        except Exception:
            log.exception(f"Exception occured, moving to Error subfolder: {self.name}")
            move_entry(dbx, self.path, (self.error_dir / self.name))
        finally:
            end_time = dt.datetime.now()
            duration = end_time - start_time
            log.info(f"{self.name}, duration: {duration}")
            log.info("\n")

def handle_duplication(
    account_id_and_img_hash: str,
    file_path: Path,
    dbx: dropbox.Dropbox,
    redis_client: redis.Redis,
    dimensions: dropbox.files.Dimensions,
) -> None:
    dup_file_path = redis_client.get(account_id_and_img_hash)
    # need to check for duplicate before storing the hash
    store_hash(account_id_and_img_hash, file_path, redis_client)
    if dup_file_path is None:
        return
    dup_file_path = dup_file_path.decode()

    try:
        dup_entry = dbx.files_get_metadata(dup_file_path, include_media_info=True)
    except dropbox.exceptions.ApiError:
        log.info("Duplicate hash found, but image not in dbx")
        delete_hash(account_id_and_img_hash, redis_client)
        return
    dup_metadata = dup_entry.media_info.get_metadata() if dup_entry.media_info else None
    try:
        duplicate_better = (
            dup_metadata.dimensions.height * dup_metadata.dimensions.width
        ) > (dimensions.height * dimensions.width)
    except AttributeError:
        duplicate_better = (
            dup_metadata is not None and dup_metadata.dimensions is not None
        ) and (dimensions is None)
    if duplicate_better:
        raise FoundBetterDuplicateException
    else:
        log.info(f"Found worse duplicate, deleting: {dup_entry.path_display}")
        delete_entry(dup_entry, dbx)
        delete_hash(account_id_and_img_hash, redis_client)

def get_hash(data: bytes) -> str:
    img = Image.open(BytesIO(data))
    if img.height > 500:
        small_img = resizeimage.resize_height(img, size=500)
    else:
        small_img = img
    img_hash = imagehash.whash(small_img)
    return img_hash

def store_hash(
    account_id_and_img_hash: str, file_path: Path, redis_client: redis.Redis
) -> None:
    redis_client.set(account_id_and_img_hash, file_path.as_posix())
    redis_client.expire(account_id_and_img_hash, seconds_in_fortnight)

def delete_hash(account_id_and_img_hash: str, redis_client: redis.Redis) -> None:
    redis_client.delete(account_id_and_img_hash)

def delete_entry(entry: dropbox.files.FileMetadata, dbx: dropbox.Dropbox) -> None:
    dbx.files_delete(entry.path_display)

def _execute_transfer(
    dbx: dropbox.Dropbox, transfer_func: t.Callable, destination_folder: Path
) -> None:
    try:
        transfer_func()
    except requests.exceptions.SSLError:
        log.info("Encountered SSL error during transfer. Trying again")
        transfer_func()
    except dropbox.exceptions.BadInputError:
        log.info(f"Making folder: {destination_folder}")
        dbx.files_create_folder(destination_folder.as_posix())
        transfer_func()

def move_entry(dbx: dropbox.Dropbox, from_path: Path, to_path: Path) -> None:
    transfer_func = partial(
        dbx.files_move,
        from_path=from_path.as_posix(),
        to_path=to_path.as_posix(),
        autorename=True,
    )
    log.info(f"{from_path.name}: Moving to dest: {to_path.as_posix()}")
    _execute_transfer(dbx, transfer_func, to_path.parent)

def copy_entry(dbx: dropbox.Dropbox, from_path: Path, to_path: Path) -> None:
    transfer_func = partial(
        dbx.files_copy,
        from_path=from_path.as_posix(),
        to_path=to_path.as_posix(),
        autorename=True,
    )
    log.info(f"{from_path.name}: Copying to dest: {to_path.as_posix()}")
    _execute_transfer(dbx, transfer_func, to_path.parent)

def upload_entry(dbx: dropbox.Dropbox, new_data: bytes, to_path: Path) -> None:
    transfer_func = partial(
        dbx.files_upload, f=new_data, path=to_path.as_posix(), autorename=True
    )
    log.info(f"{to_path.name}: Uploading to dest: {to_path.as_posix()}")
    _execute_transfer(dbx, transfer_func, to_path.parent)

def download_entry(dbx, path_str: str):
    try:
        return dbx.files_download(path_str)
    except requests.exceptions.SSLError:
        log.info("Encountered SSL error during transfer. Trying again")
        return dbx.files_download(path_str)

def parse_metdata(
    path: Path, dbx: dropbox.Dropbox
) -> t.Tuple[
    t.Optional[dt.datetime],
    t.Optional[dropbox.files.Dimensions],
    t.Optional[dropbox.files.GpsCoordinates],
]:
    metadata_obj = dbx.files_get_metadata(path=path.as_posix(), include_media_info=True)
    metadata = metadata_obj.media_info.get_metadata() if metadata_obj else None
    time_taken: t.Optional[dt.datetime] = None
    dimensions: t.Optional[dropbox.files.Dimensions] = None
    coordinates: t.Optional[dropbox.files.GpsCoordinates] = None
    if metadata is not None:
        time_taken = metadata.time_taken
        if metadata.dimensions is not None:
            dimensions = metadata.dimensions
        if metadata.location is not None:
            coordinates = metadata.location
    return time_taken, dimensions, coordinates

def parse_date(
    time_taken: t.Optional[dt.datetime],
    client_modified: dt.datetime,
    coordinates: t.Optional[dropbox.files.GpsCoordinates],
    default_tz: str,
) -> dt.datetime:
    naive_date = time_taken if time_taken is not None else client_modified
    utc_date = naive_date.replace(tzinfo=dt.timezone.utc)
    if coordinates is not None:
        img_tz = TimezoneFinder().timezone_at(
            lat=coordinates.latitude, lng=coordinates.longitude
        )
        if img_tz:
            local_date = utc_date.astimezone(tz=pytz.timezone(img_tz))
            return local_date
    local_date = utc_date.astimezone(tz=pytz.timezone(default_tz))
    return local_date

def get_out_name(stem: str, suffix: str, date: dt.datetime) -> str:
    date_format_in1 = date.strftime("_%Y%m%d_%H%M%S")
    date_format_in2 = date.strftime(" %Y-%m-%d %H_%M_%S")
    date_format_out = date.strftime("%Y-%m-%d %H.%M.%S")
    if date_format_in1 in stem:
        stem = stem.replace(date_format_in1, "")
    elif date_format_in2 in stem:
        stem = stem.replace(date_format_in2, "")
    out_name = date_format_out + " " + stem
    out_suffix = ".jpg" if suffix == ".png" else suffix
    return out_name + out_suffix


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;

using USTA.Bll;
using USTA.Common;
using USTA.Dal;
using USTA.Model;

public partial class Administrator_CurrentTermCourseList : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //控制Tab的显示
            string fragmentFlag = "1";

            if (Request["fragment"] != null)
            {
                fragmentFlag = Request["fragment"];
            }

            CommonUtility.ShowLiControl(fragmentFlag, liFragment1, liFragment2, liFragment3
                , divFragment1, divFragment2, divFragment3);

            //绑定学期标识下拉列表
            DataBindTermTagList();
            //绑定课程列表--学期标识(termTag)
            DataBindCourseList(ddlTermTags.SelectedValue);
        }
    }

    //绑定学期标识下拉列表
    public void DataBindTermTagList()
    {
        DalOperationAboutCourses doac = new DalOperationAboutCourses();
        DataTable dt = doac.FindAllTermTags().Tables[0];
        string termTag = null;
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            termTag = dt.Rows[i]["termTag"].ToString().Trim();
            ListItem li = new ListItem(CommonUtility.ChangeTermToString(termTag), termTag);
            ddlTermTags.Items.Add(li);
        }
    }
    //下拉列表事件
    protected void ddlTermTags_SelectedIndexChanged(object sender, EventArgs e)
    {
        //绑定课程列表--学期标识(termTag)
        DataBindCourseList(ddlTermTags.SelectedValue);
    }

    //定课程列表--学期标识(termTag)
    public void DataBindCourseList(string termTag)
    {
        DalOperationAboutCourses doac = new DalOperationAboutCourses();
        DataSet ds = doac.FindTermCoursesList(termTag);
        dlstCourses.DataSource = ds.Tables[0];
        dlstCourses.DataBind();
    }

}


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

<title>Overview List</title>
<meta name="date" content="2014-08-13">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">

All Classes

Packages

com.androidanimator.demo

com.androidanimator.demo.model


text:
<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
    </style>

    <style name="FullscreenTheme" parent="android:Theme.NoTitleBar">
        <item name="android:windowContentOverlay">@null</item>
        <item name="android:windowBackground">@null</item>
        <!--<item name="metaButtonBarStyle">@style/ButtonBar</item>-->
        <!--<item name="metaButtonBarButtonStyle">@style/ButtonBarButton</item>-->
    </style>

    <!-- Backward-compatible version of ?android:attr/buttonBarStyle -->
    <style name="ButtonBar">
        <item name="android:paddingLeft">2dp</item>
        <item name="android:paddingTop">5dp</item>
        <item name="android:paddingRight">2dp</item>
        <item name="android:paddingBottom">0dp</item>
        <item name="android:background">@android:drawable/bottom_bar</item>
    </style>

    <!-- Backward-compatible version of ?android:attr/buttonBarButtonStyle -->
    <style name="ButtonBarButton"/>

</resources>


text:
PersonalCabinet
===============
Тестовое ТЗ

В качестве тестового задания нужно сделать мини сайт, который позволяет пользователям регистрироваться и логиниться.

Описание функционала:
- регистрироваться, логиниться, менять пароль... (Использовать FOSUserBundle)
- в качестве логина использовать email
- профайл пользователя состоит из email адреса, пароля, имени и фамилии
- для регистрации пользователя достаточно ввести email пароль
- пользователи могут логиниться на на сайт с помощью соц сети facebook, (использовать HWIOAuthBundle)
- Пользователи также могут регистрироваться с помощью facebook, при этом данные email, фамилия, имя подтягиваются из профиля соц сети.
- для красоты можно использовать MopaBootstrapBundle


text:
layout: page
title: Basic Omega Holdings Award Ceremony
date: 2016-05-24
author: Douglas Steele
tags: weekly links, java
status: published
summary: Etiam quis lorem laoreet, euismod elit nec, egestas magna.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 09/20/2017
  endDate: 09/24/2017
  ctyhocn: DRTUVHX
  groupCode: BOHAC
published: true
---
Cras non ex eget libero tincidunt dignissim eget vitae ante. Suspendisse sit amet congue purus, at blandit massa. Nulla tristique erat et arcu sodales volutpat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque posuere quis urna sed pharetra. Interdum et malesuada fames ac ante ipsum primis in faucibus. Etiam vel velit eget felis sollicitudin volutpat. Suspendisse eros eros, imperdiet a ipsum vel, pellentesque tristique nisl. Etiam pellentesque ipsum commodo hendrerit volutpat.
Suspendisse suscipit tellus auctor consequat semper. Quisque purus sapien, malesuada at mauris eget, posuere condimentum nisl. Curabitur laoreet erat viverra porttitor congue. Phasellus pharetra ex non nulla efficitur, vel mollis felis eleifend. Duis iaculis enim sapien, id iaculis est sollicitudin sit amet. Suspendisse sagittis est nec leo rutrum tempor. Duis pulvinar massa ex, sit amet commodo lectus faucibus eget. Fusce convallis nibh tincidunt sapien gravida rhoncus. Fusce at feugiat quam. In hac habitasse platea dictumst. Aliquam finibus accumsan sem eu fringilla. Maecenas porta ut nunc ac placerat. Nunc iaculis euismod lacus.

* Phasellus et lorem dictum, tincidunt nibh eget, placerat massa
* Fusce laoreet orci id elit maximus blandit
* Quisque vitae ligula convallis, volutpat ipsum et, ultricies lectus
* Sed in velit porttitor, aliquet ligula non, malesuada libero.

Pellentesque pharetra consectetur ex vel rutrum. Sed eget cursus nibh, at suscipit odio. Aenean pellentesque nisl quis augue ultricies, sit amet fringilla ligula sodales. Aenean egestas nisl sed justo faucibus sagittis. Donec sit amet nibh molestie, faucibus dolor nec, interdum odio. Vivamus non ornare magna. Phasellus eu arcu enim. Duis malesuada tellus at sem vulputate egestas.


text:
namespace SPH
{
	class PBD_Simulator_GUI_imgui : public Simulator_GUI_imgui
	{
		protected:
			PBDWrapper *m_pbdWrapper;
			bool m_drawAABB;
			int m_drawBVHDepth;
			bool m_drawSDF;
			SPH::Shader *m_shader;
			float m_jointColor[4];

			SPH::Shader *createShader(const std::string &vertexShader, const std::string &geometryShader, const std::string &fragmentShader);
			void initShader();

			void shaderBegin(const float *col);
			void shaderEnd();

			void renderAABB(PBD::AABB &aabb);
			void renderBVH();
			void renderSDF();
			void renderSDF(PBD::CollisionDetection::CollisionObject* co);
			void renderTriangleModels();
			void renderTetModels();
			void renderConstraints();
			void renderBallJoint(PBD::BallJoint &bj);
			void renderRigidBodyParticleBallJoint(PBD::RigidBodyParticleBallJoint &bj);
			void renderBallOnLineJoint(PBD::BallOnLineJoint &bj);
			void renderHingeJoint(PBD::HingeJoint &hj);
			void renderUniversalJoint(PBD::UniversalJoint &uj);
			void renderSliderJoint(PBD::SliderJoint &joint);
			void renderTargetPositionMotorSliderJoint(PBD::TargetPositionMotorSliderJoint &joint);
			void renderTargetVelocityMotorSliderJoint(PBD::TargetVelocityMotorSliderJoint &joint);
			void renderTargetAngleMotorHingeJoint(PBD::TargetAngleMotorHingeJoint &hj);
			void renderTargetVelocityMotorHingeJoint(PBD::TargetVelocityMotorHingeJoint &hj);
			void renderRigidBodyContact(PBD::RigidBodyContactConstraint &cc);
			void renderParticleRigidBodyContact(PBD::ParticleRigidBodyContactConstraint &cc);
			void renderSpring(PBD::RigidBodySpring &s);
			void renderDistanceJoint(PBD::DistanceJoint &j);
			void renderDamperJoint(PBD::DamperJoint &joint);

		public:
			PBD_Simulator_GUI_imgui(SimulatorBase *base, PBDWrapper *pbdWrapper);
			virtual ~PBD_Simulator_GUI_imgui();

		public:
			virtual void init(int argc, char **argv, const char *name);
			virtual void render();
			virtual void initSimulationParameterGUI();

		public:
			template<class PositionData>
			static void drawMesh(const PositionData &pd, const Utilities::IndexedFaceMesh &mesh, const unsigned int offset, const float * const color);

	};

	template<class PositionData>
	void PBD_Simulator_GUI_imgui::drawMesh(const PositionData &pd, const Utilities::IndexedFaceMesh &mesh, const unsigned int offset, const float * const color)
	{
		// draw mesh
		const unsigned int *faces = mesh.getFaces().data();
		const unsigned int nFaces = mesh.numFaces();
		const Vector3r *vertexNormals = mesh.getVertexNormals().data();

		if (SPH::MiniGL::checkOpenGLVersion(3, 3))
		{
			glEnableVertexAttribArray(0);
			glVertexAttribPointer(0, 3, GL_REAL, GL_FALSE, 0, &pd.getPosition(offset)[0]);
			glEnableVertexAttribArray(2);
			glVertexAttribPointer(2, 3, GL_REAL, GL_FALSE, 0, &vertexNormals[0][0]);
		}
		else
		{
			float speccolor[4] = { 1.0, 1.0, 1.0, 1.0 };
			glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, color);
			glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, color);
			glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, speccolor);
			glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 100.0f);
			glColor3fv(color);

			glEnableClientState(GL_VERTEX_ARRAY);
			glEnableClientState(GL_NORMAL_ARRAY);
			glVertexPointer(3, GL_REAL, 0, &pd.getPosition(0)[0]);
			glNormalPointer(GL_REAL, 0, &vertexNormals[0][0]);
		}

		glDrawElements(GL_TRIANGLES, (GLsizei)3 * mesh.numFaces(), GL_UNSIGNED_INT, mesh.getFaces().data());

		if (SPH::MiniGL::checkOpenGLVersion(3, 3))
		{
			glDisableVertexAttribArray(0);
			glDisableVertexAttribArray(2);
		}
		else
		{
			glDisableClientState(GL_VERTEX_ARRAY);
			glDisableClientState(GL_NORMAL_ARRAY);
		}
	}

}

#endif


text:
title: ExpandableTextView.State.Collapsed - expandable-textview
---

[expandable-textview](../../../index.html) / [tm.charlie.expandabletextview](../../index.html) / [ExpandableTextView](../index.html) / [State](index.html) / [Collapsed](.)

# Collapsed

`Collapsed`

[State](index.html), in which text is ellipsized and it is possible to expand it, if [expandedLines](../expanded-lines.html) is greater than [collapsedLines](../collapsed-lines.html).


text:
<!--
id: 8357588493
link: http://tumblr.atmos.org/post/8357588493/software-developer-github-jobs
slug: software-developer-github-jobs
date: Mon Aug 01 2011 15:45:17 GMT-0700 (PDT)
publish: 2011-08-01
tags:
title: Software Developer — GitHub Jobs
-->

Software Developer — GitHub Jobs
================================

[http://jobs.github.com/positions/57399522-bc8c-11e0-97f5-2d88e8abe86c](http://jobs.github.com/positions/57399522-bc8c-11e0-97f5-2d88e8abe86c)

please come work with us at GitHub


text: {{message.text}}


text:
package com.neulevel.epp.core.response;

import org.w3c.dom.*;
import com.neulevel.epp.core.*;

/**
 * This EppResponseData class implements EPP Response Data entity.
 *
 * @author Ning Zhang ning.zhang@neustar.com
 * @version $Revision: 1.1 $ $Date: 2005/12/06 20:11:35 $
 */
abstract public class EppResponseData extends EppEntity
{
	/**
	 * Converts an XML element into an EppResponseData object.
	 * The caller of this method must make sure that the root node is the
	 * resData element of EPP responseType
	 *
	 * @param root root node for an EppResponseData object in
	 *             XML format
	 *
	 * @return an EppResponseData object, or null if the node
	 *         is invalid
	 */
	public static EppEntity fromXML( Node root )
	{
		NodeList list = root.getChildNodes();
		for( int i = 0; i < list.getLength(); i++ )
		{
			Node node = list.item(i);
			String prefix = node.getPrefix();
			String name = node.getLocalName();
			if( (prefix == null) || (name == null) )
			{
				continue;
			}
			if( prefix.equals("contact") )
			{
				if( name.equals("creData") )
				{
					return EppResponseDataCreateContact.fromXML(node);
				}
				else if( name.equals("infData") )
				{
					return EppResponseDataInfo.fromXML(node);
				}
				else if( name.equals("chkData") )
				{
					return EppResponseDataCheckContact.fromXML(node);
				}
				else if( name.equals("trnData") )
				{
					return EppResponseDataTransferContact.fromXML(node);
				}
				else if( name.equals("transfer") )
				{
					return EppResponseDataPoll.fromXML(node);
				}
				/*
				 * other response data types
				 */
			}
			else if( prefix.equals("domain") )
			{
				if( name.equals("creData") )
				{
					return EppResponseDataCreateDomain.fromXML(node);
				}
				else if( name.equals("infData") )
				{
					return EppResponseDataInfo.fromXML(node);
				}
				else if( name.equals("chkData") )
				{
					return EppResponseDataCheckDomain.fromXML(node);
				}
				else if( name.equals("trnData") )
				{
					return EppResponseDataTransferDomain.fromXML(node);
				}
				else if( name.equals("transfer") )
				{
					return EppResponseDataPoll.fromXML(node);
				}
				/*
				 * other response data types
				 */
			}
			else if( prefix.equals("host") )
			{
				if( name.equals("creData") )
				{
					return EppResponseDataCreateHost.fromXML(node);
				}
				else if( name.equals("infData") )
				{
					return EppResponseDataInfo.fromXML(node);
				}
				else if( name.equals("chkData") )
				{
					return EppResponseDataCheckHost.fromXML(node);
				}
				/*
				 * other response data types
				 */
			}
			else if( prefix.equals("svcsub") )
			{
				if( name.equals("creData") )
				{
					return EppResponseDataCreateSvcsub.fromXML(node);
				}
				else if( name.equals("infData") )
				{
					return EppResponseDataInfo.fromXML(node);
				}
				else if( name.equals("chkData") )
				{
					return EppResponseDataCheckSvcsub.fromXML(node);
				}
				else if( name.equals("trnData") )
				{
					return EppResponseDataTransferSvcsub.fromXML(node);
				}
				else if( name.equals("transfer") )
				{
					return EppResponseDataPoll.fromXML(node);
				}
				/*
				 * other response data types
				 */
			}
			/*
			 * other object types
			 */
		}

		return null;
	}

	public String toString()
	{
		return toString("resData");
	}
}


text:
package org.apache.cassandra.locator;

import java.net.InetAddress;
import java.util.List;

/**
 * A simple endpoint snitch implementation that treats Strategy order as proximity,
 * allowing non-read-repaired reads to prefer a single endpoint, which improves
 * cache locality.
 */
public class SimpleSnitch extends AbstractEndpointSnitch
{
    public String getRack(InetAddress endpoint)
    {
        return "rack1";
    }

    public String getDatacenter(InetAddress endpoint)
    {
        return "datacenter1";
    }

    @Override
    public void sortByProximity(final InetAddress address, List<InetAddress> addresses)
    {
        // Optimization to avoid walking the list
    }

    public int compareEndpoints(InetAddress target, InetAddress a1, InetAddress a2)
    {
        // Making all endpoints equal ensures we won't change the original ordering (since
        // Collections.sort is guaranteed to be stable)
        return 0;
    }
}


text:
.class final Lcom/android/internal/telephony/cat/Menu$1;
.super Ljava/lang/Object;
.source "Menu.java"

# interfaces
.implements Landroid/os/Parcelable$Creator;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/internal/telephony/cat/Menu;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x8
    name = null
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/Object;",
        "Landroid/os/Parcelable$Creator",
        "<",
        "Lcom/android/internal/telephony/cat/Menu;",
        ">;"
    }
.end annotation

# direct methods
.method constructor <init>()V
    .locals 0

    .prologue
    .line 98
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public createFromParcel(Landroid/os/Parcel;)Lcom/android/internal/telephony/cat/Menu;
    .locals 2
    .param p1, "in"    # Landroid/os/Parcel;

    .prologue
    .line 101
    new-instance v0, Lcom/android/internal/telephony/cat/Menu;

    const/4 v1, 0x0

    invoke-direct {v0, p1, v1}, Lcom/android/internal/telephony/cat/Menu;-><init>(Landroid/os/Parcel;Lcom/android/internal/telephony/cat/Menu$1;)V

    return-object v0
.end method

.method public bridge synthetic createFromParcel(Landroid/os/Parcel;)Ljava/lang/Object;
    .locals 1

    .prologue
    .line 98
    invoke-virtual {p0, p1}, Lcom/android/internal/telephony/cat/Menu$1;->createFromParcel(Landroid/os/Parcel;)Lcom/android/internal/telephony/cat/Menu;

    move-result-object v0

    return-object v0
.end method

.method public newArray(I)[Lcom/android/internal/telephony/cat/Menu;
    .locals 1
    .param p1, "size"    # I

    .prologue
    .line 106
    new-array v0, p1, [Lcom/android/internal/telephony/cat/Menu;

    return-object v0
.end method

.method public bridge synthetic newArray(I)[Ljava/lang/Object;
    .locals 1

    .prologue
    .line 98
    invoke-virtual {p0, p1}, Lcom/android/internal/telephony/cat/Menu$1;->newArray(I)[Lcom/android/internal/telephony/cat/Menu;

    move-result-object v0

    return-object v0
.end method


text:
package edu.cmu.minorthird.ui;

import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;

import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFileChooser;
import javax.swing.JTextField;

import edu.cmu.minorthird.util.gui.ComponentViewer;
import edu.cmu.minorthird.util.gui.Viewer;

/**
 * A panel with a text area and a browse button
 * @author ksteppe
 */
public class FileChooserViewer extends ComponentViewer implements
		ActionListener{

	static final long serialVersionUID=20080517L;

	private JFileChooser chooser=new JFileChooser();

	private JTextField textField=new JTextField(30);

	private File selectedFile=null;

	private boolean openFile=true;

	private JButton button=new JButton("Browse");

	private String defaultDir="."; //= System.getProperty("minorthird");

	public FileChooserViewer(Viewer superView){
		setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
		setSuperView(superView);
		setContent(selectedFile,true);
		button.addActionListener(this);
		componentFor(null);

	}

	public void setFileSelectionMode(int mode){
		chooser.setFileSelectionMode(mode);
	}

	public void setFile(File f){
		selectedFile=f;

		textField.setText(selectedFile.getAbsolutePath());
		//fire the action up the chain
		sendSignal(OBJECT_SELECTED,selectedFile);
		componentFor(null);
	}

	@Override
	public JComponent componentFor(Object o){
		removeAll();
		log.debug("build panel");
		//build up panel
		setLayout(new GridLayout(0,2));
		add(textField);
		textField.setEditable(false);
		add(button);
		this.setVisible(true);

		return this;
	}

	public void addActionListener(ActionListener l){
		button.addActionListener(l);
	}

	@Override
	public void actionPerformed(ActionEvent e){
		if(selectedFile!=null)
			chooser.setSelectedFile(selectedFile);
		else{
			chooser.setSelectedFile(new File(defaultDir));
		}
		int returnVal=
				openFile?chooser.showOpenDialog(null):chooser.showSaveDialog(null);
		if(returnVal==JFileChooser.APPROVE_OPTION)
			setFile(chooser.getSelectedFile());
	}

	// default: recieve anything that can be converted to a component
	@Override
	public boolean canReceive(Object obj){
		return false;
	}

	@Override
	public void receiveContent(Object content){
		return;
	}

	public String getDefaultDir(){
		return defaultDir;
	}

	public void setDefaultDir(String defaultDir){
		if(defaultDir!=null)
			this.defaultDir=defaultDir;
	}
}


text:
export function byte2Readable(byte: number, prefix = ''): string {
  // 1kb is 1024 bytes
  const kb = 1024;
  const mb = kb * 1024;
  const gb = mb * 1024;
  let readable; let
    unit;

  if (byte >= gb) {
    // xx GB
    readable = byte / gb;
    unit = 'GB';
  } else if (byte < gb && byte >= mb) {
    // xx MB
    readable = byte / mb;
    unit = 'MB';
  } else {
    // xx KB
    readable = byte / kb;
    unit = 'KB';
  }

  return `${parseFloat(readable.toFixed(2))}${unit}${prefix}`;
}

// Use any to avoid complex type checking,
// or to use the same types as GeneralCallback to be precise.
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
export function getFilename(task: any): string {
  if (task.constructor !== Object) {
    return '';
  }

  // BT protocol
  if (task.bittorrent) {
    if (task.bittorrent.info) {
      // Actual BT download - data structure https://jsonformatter.org/7901b2
      return task.bittorrent.info.name;
    }
    // Just bittorrent file - data structure example https://jsonformatter.org/json-pretty-print/9ac1f8
    return task.files[0].path;
  }
  // HTTP protocol, get filename from download path, https://stackoverflow.com/a/58708800/4480674
  // data structure example - https://jsonformatter.org/74ea5c
  return task.files[0].path.split('/').splice(-1)[0];
}

export function progress(total: number, completed: number): string {
  // Return 0 if total is 0.
  return `${Number(((completed / total) * 100).toFixed(2)) || 0}%`;
}

// Get `540625cfdbfa6ccc` from `resume-task.540625cfdbfa6ccc`.
export function getGidFromAction(action: string): string {
  const splited = action.split('.');

  return splited.pop() || '';
}

// HTTP/FTP/SFTP/Magnet/BT file
// https://stackoverflow.com/a/8061352
export function isDownloadable(uri: string): boolean {
  const httpFtp = /^(https?|ftps?):\/\/.*$/;

  // https://stackoverflow.com/a/19707059
  const magnet = /magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i;

  const btFile = /\.torrent$/;

  return httpFtp.test(uri) || magnet.test(uri) || btFile.test(uri);
}


text:
namespace syncer {

namespace {

absl::optional<PassphraseTypeForMetrics> GetPassphraseTypeForSingleProfile(
    const SyncService& sync_service) {
  if (sync_service.GetTransportState() != SyncService::TransportState::ACTIVE) {
    return absl::nullopt;
  }

  const SyncUserSettings* user_settings = sync_service.GetUserSettings();
  // Guaranteed by sync transport state.
  DCHECK(user_settings);

  switch (user_settings->GetPassphraseType()) {
    case PassphraseType::kImplicitPassphrase:
      return PassphraseTypeForMetrics::kImplicitPassphrase;
    case PassphraseType::kKeystorePassphrase:
      return PassphraseTypeForMetrics::kKeystorePassphrase;
    case PassphraseType::kFrozenImplicitPassphrase:
      return PassphraseTypeForMetrics::kFrozenImplicitPassphrase;
    case PassphraseType::kCustomPassphrase:
      return PassphraseTypeForMetrics::kCustomPassphrase;
    case PassphraseType::kTrustedVaultPassphrase:
      return PassphraseTypeForMetrics::kTrustedVaultPassphrase;
  }

  NOTREACHED();
  return absl::nullopt;
}

PassphraseTypeForMetrics GetPassphraseTypeForAllProfiles(
    const std::vector<const SyncService*>& sync_services) {
  base::flat_set<absl::optional<PassphraseTypeForMetrics>> passphrase_types;
  for (const SyncService* sync_service : sync_services) {
    DCHECK(sync_service);
    passphrase_types.insert(GetPassphraseTypeForSingleProfile(*sync_service));
  }

  if (passphrase_types.size() > 1) {
    return PassphraseTypeForMetrics::kInconsistentStateAcrossProfiles;
  }
  if (passphrase_types.empty() || !passphrase_types.begin()->has_value()) {
    return PassphraseTypeForMetrics::kNoActiveSyncingProfiles;
  }
  return **passphrase_types.begin();
}

}  // namespace

PassphraseTypeMetricsProvider::PassphraseTypeMetricsProvider(
    const GetAllSyncServicesCallback& get_all_sync_services_callback)
    : get_all_sync_services_callback_(get_all_sync_services_callback) {}

PassphraseTypeMetricsProvider::~PassphraseTypeMetricsProvider() = default;

void PassphraseTypeMetricsProvider::ProvideCurrentSessionData(
    metrics::ChromeUserMetricsExtension* uma_proto) {
  base::UmaHistogramEnumeration(
      "Sync.PassphraseType2",
      GetPassphraseTypeForAllProfiles(get_all_sync_services_callback_.Run()));
}

}  // namespace syncer


text:
package org.ocpsoft.prettytime;

/**
 * Format a Duration object.
 *
 * @author Lincoln Baxter, III
 */
public interface TimeFormat
{
   /**
    * Given a populated {@link Duration} object. Apply formatting (with rounding) and output the result.
    *
    * @param The original {@link Duration} instance from which the time string should be decorated.
    */
   public abstract String format(final Duration duration);

   /**
    * Given a populated {@link Duration} object. Apply formatting (without rounding) and output the result.
    *
    * @param The original {@link Duration} instance from which the time string should be decorated.
    */
   public String formatUnrounded(Duration duration);

   /**
    * Decorate with past or future prefix/suffix (with rounding)
    *
    * @param duration The original {@link Duration} instance from which the time string should be decorated.
    * @param time The formatted time string.
    */
   public String decorate(Duration duration, String time);

   /**
    * Decorate with past or future prefix/suffix (without rounding)
    *
    * @param duration The original {@link Duration} instance from which the time string should be decorated.
    * @param time The formatted time string.
    */
   public String decorateUnrounded(Duration duration, String time);

}


text:
published: true
title: Ier dimanche de Carême
---
**Dimanche 1er mars 2020, messe de 19h**

![Pelican Wolfen 2.jpg]({{site.baseurl}}/images/Pelican Wolfen 2.jpg)

*Scuto circúmdabit te véritas eius, non timébis a timóre noctúrno.*
Sa vérité t'environnera comme un bouclier, tu ne craindras pas les frayeurs de la nuit.

**Introït : Invocabit me**

**Graduel : Angelis suis**
faux-bourdon du 2e ton à 2 voix égales - 1772

**Trait : Qui habitat**
faux-bourdon à 2 voix égales

**Offertoire : Audi benigne Conditor**
alternance polyphonique de Jean de Bournonville 1585-1632

**Consécration : O salutaris Hostia**
d'après Cristobal de Moralès 1500-1553

**Communion : Ave vivens Hostia**
d'après Stabat Mater polyphonie sarde anonyme

**Au dernier évangile : Ave Regina caelorum**

**Sortie : Christe qui lux es**
d'après *Biasgina* - traditionnel corse


text:
"use strict";

const conversions = require("webidl-conversions");
const utils = require("./utils.js");

const isNode = require("./Node.js").is;
const impl = utils.implSymbol;
const Node = require("./Node.js");
const ChildNode = require("./ChildNode.js");
const NonDocumentTypeChildNode = require("./NonDocumentTypeChildNode.js");

function CharacterData() {
  throw new TypeError("Illegal constructor");
}

Object.setPrototypeOf(CharacterData.prototype, Node.interface.prototype);
Object.setPrototypeOf(CharacterData, Node.interface);

Object.defineProperty(CharacterData, "prototype", {
  value: CharacterData.prototype,
  writable: false,
  enumerable: false,
  configurable: false
});

CharacterData.prototype.substringData = function substringData(offset, count) {
  if (!this || !module.exports.is(this)) {
    throw new TypeError("Illegal invocation");
  }

  if (arguments.length < 2) {
    throw new TypeError(
      "Failed to execute 'substringData' on 'CharacterData': 2 arguments required, but only " +
        arguments.length +
        " present."
    );
  }
  const args = [];
  {
    let curArg = arguments[0];
    curArg = conversions["unsigned long"](curArg, {
      context: "Failed to execute 'substringData' on 'CharacterData': parameter 1"
    });
    args.push(curArg);
  }
  {
    let curArg = arguments[1];
    curArg = conversions["unsigned long"](curArg, {
      context: "Failed to execute 'substringData' on 'CharacterData': parameter 2"
    });
    args.push(curArg);
  }
  return this[impl].substringData(...args);
};

CharacterData.prototype.appendData = function appendData(data) {
  if (!this || !module.exports.is(this)) {
    throw new TypeError("Illegal invocation");
  }

  if (arguments.length < 1) {
    throw new TypeError(
      "Failed to execute 'appendData' on 'CharacterData': 1 argument required, but only " +
        arguments.length +
        " present."
    );
  }
  const args = [];
  {
    let curArg = arguments[0];
    curArg = conversions["DOMString"](curArg, {
      context: "Failed to execute 'appendData' on 'CharacterData': parameter 1"
    });
    args.push(curArg);
  }
  return this[impl].appendData(...args);
};

CharacterData.prototype.insertData = function insertData(offset, data) {
  if (!this || !module.exports.is(this)) {
    throw new TypeError("Illegal invocation");
  }

  if (arguments.length < 2) {
    throw new TypeError(
      "Failed to execute 'insertData' on 'CharacterData': 2 arguments required, but only " +
        arguments.length +
        " present."
    );
  }
  const args = [];
  {
    let curArg = arguments[0];
    curArg = conversions["unsigned long"](curArg, {
      context: "Failed to execute 'insertData' on 'CharacterData': parameter 1"
    });
    args.push(curArg);
  }
  {
    let curArg = arguments[1];
    curArg = conversions["DOMString"](curArg, {
      context: "Failed to execute 'insertData' on 'CharacterData': parameter 2"
    });
    args.push(curArg);
  }
  return this[impl].insertData(...args);
};

CharacterData.prototype.deleteData = function deleteData(offset, count) {
  if (!this || !module.exports.is(this)) {
    throw new TypeError("Illegal invocation");
  }

  if (arguments.length < 2) {
    throw new TypeError(
      "Failed to execute 'deleteData' on 'CharacterData': 2 arguments required, but only " +
        arguments.length +
        " present."
    );
  }
  const args = [];
  {
    let curArg = arguments[0];
    curArg = conversions["unsigned long"](curArg, {
      context: "Failed to execute 'deleteData' on 'CharacterData': parameter 1"
    });
    args.push(curArg);
  }
  {
    let curArg = arguments[1];
    curArg = conversions["unsigned long"](curArg, {
      context: "Failed to execute 'deleteData' on 'CharacterData': parameter 2"
    });
    args.push(curArg);
  }
  return this[impl].deleteData(...args);
};

CharacterData.prototype.replaceData = function replaceData(offset, count, data) {
  if (!this || !module.exports.is(this)) {
    throw new TypeError("Illegal invocation");
  }

  if (arguments.length < 3) {
    throw new TypeError(
      "Failed to execute 'replaceData' on 'CharacterData': 3 arguments required, but only " +
        arguments.length +
        " present."
    );
  }
  const args = [];
  {
    let curArg = arguments[0];
    curArg = conversions["unsigned long"](curArg, {
      context: "Failed to execute 'replaceData' on 'CharacterData': parameter 1"
    });
    args.push(curArg);
  }
  {
    let curArg = arguments[1];
    curArg = conversions["unsigned long"](curArg, {
      context: "Failed to execute 'replaceData' on 'CharacterData': parameter 2"
    });
    args.push(curArg);
  }
  {
    let curArg = arguments[2];
    curArg = conversions["DOMString"](curArg, {
      context: "Failed to execute 'replaceData' on 'CharacterData': parameter 3"
    });
    args.push(curArg);
  }
  return this[impl].replaceData(...args);
};

CharacterData.prototype.before = function before() {
  if (!this || !module.exports.is(this)) {
    throw new TypeError("Illegal invocation");
  }
  const args = [];
  for (let i = 0; i < arguments.length; i++) {
    let curArg = arguments[i];
    if (isNode(curArg)) {
      curArg = utils.implForWrapper(curArg);
    } else {
      curArg = conversions["DOMString"](curArg, {
        context: "Failed to execute 'before' on 'CharacterData': parameter " + (i + 1)
      });
    }
    args.push(curArg);
  }
  return this[impl].before(...args);
};

CharacterData.prototype.after = function after() {
  if (!this || !module.exports.is(this)) {
    throw new TypeError("Illegal invocation");
  }
  const args = [];
  for (let i = 0; i < arguments.length; i++) {
    let curArg = arguments[i];
    if (isNode(curArg)) {
      curArg = utils.implForWrapper(curArg);
    } else {
      curArg = conversions["DOMString"](curArg, {
        context: "Failed to execute 'after' on 'CharacterData': parameter " + (i + 1)
      });
    }
    args.push(curArg);
  }
  return this[impl].after(...args);
};

CharacterData.prototype.replaceWith = function replaceWith() {
  if (!this || !module.exports.is(this)) {
    throw new TypeError("Illegal invocation");
  }
  const args = [];
  for (let i = 0; i < arguments.length; i++) {
    let curArg = arguments[i];
    if (isNode(curArg)) {
      curArg = utils.implForWrapper(curArg);
    } else {
      curArg = conversions["DOMString"](curArg, {
        context: "Failed to execute 'replaceWith' on 'CharacterData': parameter " + (i + 1)
      });
    }
    args.push(curArg);
  }
  return this[impl].replaceWith(...args);
};

CharacterData.prototype.remove = function remove() {
  if (!this || !module.exports.is(this)) {
    throw new TypeError("Illegal invocation");
  }

  return this[impl].remove();
};

Object.defineProperty(CharacterData.prototype, "data", {
  get() {
    if (!this || !module.exports.is(this)) {
      throw new TypeError("Illegal invocation");
    }

    return this[impl]["data"];
  },

  set(V) {
    if (!this || !module.exports.is(this)) {
      throw new TypeError("Illegal invocation");
    }

    V = conversions["DOMString"](V, {
      context: "Failed to set the 'data' property on 'CharacterData': The provided value",
      treatNullAsEmptyString: true
    });

    this[impl]["data"] = V;
  },

  enumerable: true,
  configurable: true
});

Object.defineProperty(CharacterData.prototype, "length", {
  get() {
    if (!this || !module.exports.is(this)) {
      throw new TypeError("Illegal invocation");
    }

    return this[impl]["length"];
  },

  enumerable: true,
  configurable: true
});

Object.defineProperty(CharacterData.prototype, "previousElementSibling", {
  get() {
    if (!this || !module.exports.is(this)) {
      throw new TypeError("Illegal invocation");
    }

    return utils.tryWrapperForImpl(this[impl]["previousElementSibling"]);
  },

  enumerable: true,
  configurable: true
});

Object.defineProperty(CharacterData.prototype, "nextElementSibling", {
  get() {
    if (!this || !module.exports.is(this)) {
      throw new TypeError("Illegal invocation");
    }

    return utils.tryWrapperForImpl(this[impl]["nextElementSibling"]);
  },

  enumerable: true,
  configurable: true
});

Object.defineProperty(CharacterData.prototype, Symbol.toStringTag, {
  value: "CharacterData",
  writable: false,
  enumerable: false,
  configurable: true
});

const iface = {
  // When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
  // method into this array. It allows objects that directly implements *those* interfaces to be recognized as
  // implementing this mixin interface.
  _mixedIntoPredicates: [],
  is(obj) {
    if (obj) {
      if (utils.hasOwn(obj, impl) && obj[impl] instanceof Impl.implementation) {
        return true;
      }
      for (const isMixedInto of module.exports._mixedIntoPredicates) {
        if (isMixedInto(obj)) {
          return true;
        }
      }
    }
    return false;
  },
  isImpl(obj) {
    if (obj) {
      if (obj instanceof Impl.implementation) {
        return true;
      }

      const wrapper = utils.wrapperForImpl(obj);
      for (const isMixedInto of module.exports._mixedIntoPredicates) {
        if (isMixedInto(wrapper)) {
          return true;
        }
      }
    }
    return false;
  },
  convert(obj, { context = "The provided value" } = {}) {
    if (module.exports.is(obj)) {
      return utils.implForWrapper(obj);
    }
    throw new TypeError(`${context} is not of type 'CharacterData'.`);
  },

  create(constructorArgs, privateData) {
    let obj = Object.create(CharacterData.prototype);
    obj = this.setup(obj, constructorArgs, privateData);
    return obj;
  },
  createImpl(constructorArgs, privateData) {
    let obj = Object.create(CharacterData.prototype);
    obj = this.setup(obj, constructorArgs, privateData);
    return utils.implForWrapper(obj);
  },
  _internalSetup(obj) {
    Node._internalSetup(obj);
  },
  setup(obj, constructorArgs, privateData) {
    if (!privateData) privateData = {};

    privateData.wrapper = obj;

    this._internalSetup(obj);
    Object.defineProperty(obj, impl, {
      value: new Impl.implementation(constructorArgs, privateData),
      writable: false,
      enumerable: false,
      configurable: true
    });

    obj[impl][utils.wrapperSymbol] = obj;
    if (Impl.init) {
      Impl.init(obj[impl], privateData);
    }
    return obj;
  },
  interface: CharacterData,
  expose: {
    Window: { CharacterData }
  }
}; // iface
module.exports = iface;

ChildNode._mixedIntoPredicates.push(module.exports.is);

NonDocumentTypeChildNode._mixedIntoPredicates.push(module.exports.is);

const Impl = require("../nodes/CharacterData-impl.js");


text:
<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: table_connect_tthreadlog.php 29265 2012-03-31 06:03:26Z yexinhao $
 */

if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}

class table_connect_tthreadlog extends discuz_table {

	public function __construct() {
		$this->_table = 'connect_tthreadlog';
		$this->_pk = 'twid';

		parent::__construct();
	}

	public function fetch_max_updatetime_by_tid($tid) {
		return DB::result_first('SELECT updatetime FROM %t WHERE tid=%d ORDER BY updatetime DESC LIMIT 1', array($this->_table, $tid));
	}

	public function fetch_min_nexttime_by_tid($tid) {
		return DB::fetch_first('SELECT * FROM %t WHERE tid=%d ORDER BY nexttime ASC LIMIT 1', array($this->_table, $tid));
	}

}


text:
<?php

declare(strict_types=1);

namespace Linio\Component\SpreadsheetParser\Parser;

class CsvParser implements ParserInterface
{
    const OPTION_HAS_COLUMN_NAMES = 'has_column_names';
    const OPTION_LENGTH = 'length';
    const OPTION_DELIMITER = 'delimiter';
    const OPTION_ENCLOSURE = 'enclosure';
    const OPTION_ESCAPE = 'escape';

    /**
     * @var string
     */
    protected $filePath;

    /**
     * @var resource
     */
    protected $handle;

    /**
     * @var bool
     */
    protected $hasColumnNames;

    /**
     * @var int
     */
    protected $length;

    /**
     * @var string
     */
    protected $delimiter;

    /**
     * @var string
     */
    protected $enclosure;

    /**
     * @var string
     */
    protected $escape;

    /**
     * @var array
     */
    protected $columnNames;

    /**
     * @param string $filePath
     */
    public function __construct($filePath, array $options = [])
    {
        $this->filePath = $filePath;

        // default options
        $this->hasColumnNames = true;
        $this->length = 0;
        $this->delimiter = ',';
        $this->enclosure = '"';
        $this->escape = '\\';

        $this->loadParserOptions($options);
    }

    /**
     * @return bool
     */
    public function open()
    {
        if ($this->handle) {
            return true;
        }

        $this->handle = fopen($this->filePath, 'r');

        return true;
    }

    /**
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
     *
     * @return array|false
     */
    public function getColumnNames()
    {
        if (!$this->hasColumnNames) {
            return false;
        }

        if ($this->columnNames) {
            return $this->columnNames;
        }

        $this->open();
        $this->columnNames = fgetcsv($this->handle, $this->length, $this->delimiter, $this->enclosure, $this->escape);

        return $this->columnNames;
    }

    /**
     * @param int $numRows
     *
     * @return array
     */
    public function getData($numRows = 0)
    {
        $this->close();
        $this->open();

        $skipLine = false;
        if ($this->hasColumnNames) {
            $skipLine = true;
        }

        return $this->readDataFromFile($numRows, $skipLine);
    }

    /**
     * @return bool
     */
    public function close()
    {
        if ($this->handle) {
            fclose($this->handle);
            $this->handle = null;
        }

        return true;
    }

    public function __destruct()
    {
        $this->close();
    }

    /**
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
     */
    protected function loadParserOptions(array $options): void
    {
        if (isset($options[static::OPTION_HAS_COLUMN_NAMES])) {
            $this->hasColumnNames = $options[static::OPTION_HAS_COLUMN_NAMES];
        }

        if (isset($options[static::OPTION_LENGTH])) {
            $this->length = $options[static::OPTION_LENGTH];
        }

        if (isset($options[static::OPTION_DELIMITER])) {
            $this->delimiter = $options[static::OPTION_DELIMITER];
        }

        if (isset($options[static::OPTION_ENCLOSURE])) {
            $this->enclosure = $options[static::OPTION_ENCLOSURE];
        }

        if (isset($options[static::OPTION_ESCAPE])) {
            $this->escape = $options[static::OPTION_ESCAPE];
        }
    }

    /**
     * @param $numRows
     * @param $skipLine
     *
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
     *
     * @return array
     */
    protected function readDataFromFile($numRows, $skipLine)
    {
        $data = [];
        while (($row = fgetcsv($this->handle, $this->length, $this->delimiter, $this->enclosure, $this->escape)) !== false) {
            if ($skipLine) {
                $skipLine = false;
                continue;
            }

            $data[] = $row;

            $numRows--;
            if ($numRows == 0) {
                break;
            }
        }

        return $data;
    }
}


text:
docker + docker-compose

Installation instructions can be found here:
1. [Docker](https://docs.docker.com/engine/installation)
2. [Docker composer](https://docs.docker.com/compose/install)

## Let's begin

Before we can run application with docker we need to install composer dependencies.

```bash
docker run -v `pwd`:/var/www -w /var/www prooph/composer:7.1 install
```

After it ends we can run application with docker. First create a copy of `.env.dist`

```bash
cp .env.dist .env
```

If needed change values inside it and run application:

```bash
$ docker-compose up -d
```

## Open app

```
http://localhost:NGINX_PORT_FROM_.ENV_FILE
```