text:
We have two different pieces of code to calculate quantiles (aka percentiles, or
order statistics):
[QuantileTree](https://github.com/google/differential-privacy/blob/main/cc/algorithms/quantile-tree.h)
offers a tree-based differentially private algorithm with a distinctive
interface, and
[Quantiles](https://github.com/google/differential-privacy/blob/main/cc/algorithms/quantiles.h)
uses it to implement the `Algorithm` interface. Both offer the same accuracy,
performance, and privacy guarantees because they use the same underlying DP
mechanism. Both can be used to calculate any quantile (though they are least
accurate close to the maximum and minimum), and both can be used to calculate
any number of quantiles with no loss in accuracy (e.g. if you want to calculate
a median, your result will be equally accurate regardless of whether or not you
choose to calculate additional quantiles). The only difference between the two
is in their interface.

Note: If you only want to calculate a single quantile, we recommend using
`Quantiles` and requesting only a single quantile. We do not currently have a
more efficient algorithm for single quantiles. If we add a more efficient
algorithm for single quantiles, we will use it whenever a `Quantiles` is created
to find a single quantile.

## Quantiles

### Input & Output

`Quantiles` support any numeric type. Its `Output`s contain one element for each
requested quantile, in the same order as when the `Quantiles` was built.
`ConfidenceInterval` and `BoundingReport` are not provided.

### Construction

`Quantiles` is an [`Algorithm`](algorithm.md). It does require an upper and
lower bound, but it does not use [BoundedAlgorithmBuilder](bounded-algorithm.md)
and cannot determine the bounds automatically. Instead, the user must manually
set the bounds or the algorithm will fail to build.

Note: You can run [`ApproxBounds`](approx-bounds.md) over your dataset to get
bounds if you do not know them in advance, but you must do so manually in a
separate pass over your data (before you construct your `Quantiles`) and you
must manually pass the bounds from your `ApproxBounds` to your `Quantiles`.

In addition, you must specify a set of quantiles to calculate. Quantiles are
provided as a `vector<double>`. Quantiles will be returned in the same order as
you specify them. If you call `SetQuantiles` multiple times, each call will
overwrite the set of quantiles from the previous call.

Here is the minimal set of arguments for constructing a Quantiles:

```
absl::StatusOr<std::unique_ptr<Quantiles<T>>> quantile =
   Quantiles<T>::Builder()
       .SetLower(upper)
       .SetUpper(lower)
       .SetQuantiles(quantiles)
       .Build();
```

*   `T`: The input type, for example `double` or `int64`.
*   `T upper, lower`: The upper and lower bounds on each input element. If any
    input elements are greater than `upper` or less than `lower`, they will be
    replaced with `upper` or `lower` respectively.
*   `std::vector<double> quantiles`: The list of quantiles you wish to
    calculate. Each quantile should be in the range [0, 1] where 0 will find the
    minimum, and 1 the maximum. Can be created inline, e.g. `.SetQuantile({0.25,
    0.5, 0.75})`.

### Use

`Quantiles` is an [`Algorithm`](algorithm.md) and supports its full API, except
for the ability to provide confidence intervals.

## QuantileTree

QuantileTree implements a tree-based differentially private quantile calculation
algorithm. For details, see the
[full algorithm writeup](https://github.com/google/differential-privacy/blob/main/common_docs/Differentially_Private_Quantile_Trees.pdf).

### Construction

A `QuantileTree` is constructed via a `QuantileTree<T>::Builder`. The builder
supports the following methods:

```
absl::StatusOr<std::unique_ptr<QuantileTree<T>>> quantile_tree =
  QuantileTree<T>::Builder()
      .SetLower(lower)
      .SetUpper(upper)
      .SetTreeHeight(tree_height) // optional
      .SetBranchingFactor(branching_factor)
      .Build();
```

*   `T`: The input type, for example `double` or `int64`.
*   `T upper, lower`: The upper and lower bounds for each input element. If any
    inputs are greater than `upper` or less than `lower` they will be replaced
    with `upper` or `lower` respectively.
*   `int tree_height, branching_factor`: These parameters specify the height and
    width of the quantile tree. Each node will have `branching_factor` children,
    and the tree will be of height `tree_height`. The quantile tree assigns each
    leaf node to an equal sized portion of the domain [lower, upper], and there
    will be `branching_factor` ^ `tree_height` leaf nodes. These parameters are
    optional, and have reasonable default values.

Note that privacy parameters are not specified when constructing the quantile
tree.

### Input and Output

Like `Quantiles`, `QuantileTree` supports any numeric type as input.

To get results, call the `MakePrivate` method. The `MakePrivate` method takes a
struct that contains all of the privacy parameters (these are the same ones used
when constructing an [`Algorithm`](algorithm.md)):

```
absl::StatusOr<QuantileTree<T>::Privatized> results =
  quantile_tree.MakePrivate({
      .epsilon = epsilon,
      .delta = delta,
      .max_contributions_per_partition = max_contributions,
      .max_partitions_contributed_to = max_partitions,
      .mechanism_builder = absl::MakeUnique<LaplaceMechanism::Builder>()});
```

*   `double epsilon`: The `epsilon` differential privacy parameter. A smaller
    number means more privacy but less accuracy. `epsilon` should be > 0.
*   `double delta`: The `delta` differential privacy parameter. A smaller number
    means more privacy but less accuracy. `delta` should be in (0, 1).
*   `int max_partitions`: The number of aggregations, or 'partitions,' that each
    user is allowed to contribute to. Defaults to 1 if unset. The caller must
    guarantee that this limit is enforced on the input. The library cannot
    enforce it because it cannot distinguish between users or aggregations. Note
    that `Algorithm`s that will be merged together are considered part of the
    same partition.
*   `int max_contributions`: The number of pieces of input to this aggregation
    that can belong to a single user. Defaults to 1 if unset. The caller must
    guarantee that this limit is enforced on the input. The library cannot
    enforce it because it does not now which inputs belong to which users. If
    summaries from multiple `Algorithm`s are merged together, the total number
    of inputs from a single user across all marged `Algorithm`s must not exceed
    this limit.
*   `std::unique_ptr<NumericalMechanism::Builder> mechanism_builder`: Used to
    specify the type of numerical mechanism the algorithm will use to add noise
    (e.g. Laplace, Gaussian). In most cases this should not be set (and a
    default LaplaceMechanism will be used), but it can be used to remove or mock
    noise during testing.

`MakePrivate` returns a `QuantileTree<T>::Privatized` (or an error status if an
error occurred). A `QuantileTree<T>::Privatized` can be used to calculate any
quantile by calling the `GetQuantile` method. Calling `GetQuantile` consumes no
additional privacy budget. A `QuantileTree<T>::Privatized` may contain internal
non-privatized information, but only privatized information can be accessed
through its API. A `QuantileTree<T>::Privatized` answers questions about the
input that had been added to the `QuantileTree<T>` at the time that
`MakePrivate` was called. After a `QuantileTree<T>::Privatized` has been created
it is no longer tied to the `QuantileTree<T>`, and modifying the
`QuantileTree<T>` has no effect on it.

## Result Performance

For both `Quantiles` and `QuantileTree`, calling `Result` has a constant time
complexity (though the value of the constant will depend on the tree
parameters). Space complexity is also constant, and again depends on the tree
parameters.


text:
<#
    .NOTES
    ===========================================================================
     Created with: 	SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135
     Created on:   	2/13/2017 12:20 PM
     Last Edited:   2/14/2017
     Created by:   	Mark Kraus
     Organization: 	Mitel
     Filename:     	Get-AADServicePrinicpalbyDisplayName.ps1
    ===========================================================================
    .DESCRIPTION
        Get-AADServicePrinicpalbyDisplayName Function
#>

<#
    .SYNOPSIS
        Retrieves an Azure AD ServicePrincipal by the Display name

    .DESCRIPTION
        Retrieves an Azure AD ServicePrincipal by the Display Name

    .PARAMETER AccessToken
        MSGraphAPI.Oauth.AccessToken object obtained from Get-GraphOauthAccessToken.

    .PARAMETER DisplayName
        The ServicePrincipal's Display Name. This must be an exact match and does not support wildcards

    .PARAMETER BaseURL
        The Azure AD Graph Base URL. This is not required. Deafult
            https://graph.windows.net

    .PARAMETER APIVersion
        version og the API to use. Default is 1.6

    .EXAMPLE
        PS C:\> $AADServicePrincipal = Get-AADServicePrincipalByDisplayName -AccessToken $GraphAccessToken -DisplayName 'Contoso Web App'

    .OUTPUTS
        MSGraphAPI.DirectoryObject.ServicePrincipal

    .LINK
        http://psmsgraph.readthedocs.io/en/latest/functions/Get-AADServicePrinicpalbyDisplayName
#>
function Get-AADServicePrinicpalbyDisplayName {
    [CmdletBinding(SupportsShouldProcess = $true,
                   HelpUri = 'http://psmsgraph.readthedocs.io/en/latest/functions/Get-AADServicePrinicpalbyDisplayName')]
    [OutputType('MSGraphAPI.DirectoryObject.ServicePrincipal')]
    param
    (
        [Parameter(Mandatory = $true,
                   ValueFromPipelineByPropertyName = $true)]
        [ValidateNotNullOrEmpty()]
        [PSTypeName('MSGraphAPI.Oauth.AccessToken')]
        $AccessToken,

        [Parameter(Mandatory = $true,
                   ValueFromPipeline = $true,
                   ValueFromPipelineByPropertyName = $true,
                   ValueFromRemainingArguments = $true)]
        [ValidateNotNullOrEmpty()]
        [string[]]$DisplayName,

        [Parameter(Mandatory = $false,
                   ValueFromPipelineByPropertyName = $true)]
        [ValidateNotNullOrEmpty()]
        [string]$BaseUrl = 'https://graph.windows.net',

        [Parameter(Mandatory = $false,
                   ValueFromPipelineByPropertyName = $true)]
        [ValidateNotNullOrEmpty()]
        [string]$APIversion = '1.6'

    )

    process {
        foreach ($ServiceName in $DisplayName) {
            if (-not $pscmdlet.ShouldProcess($ServiceId)) {
                return
            }
            $Application = $AccessToken.Application
            $Tenant = $Application.Tenant
            $Url = '{0}/{1}/{2}?api-version={3}&$filter=displayName+eq+%27{4}%27' -f @(
                $BaseUrl
                $Tenant
                'servicePrincipals'
                $APIversion
                [System.Web.HttpUtility]::UrlEncode($ServiceName)
            )
            $Params = @{
                Uri = $Url
                Method = 'GET'
                AccessToken = $AccessToken
                ErrorAction = 'Stop'
            }
            try {
                $Result = Invoke-GraphRequest @Params
            }
            catch {
                $ErrorMessage = "Unable to query User '{0}': {1}" -f $UserId, $_.Exception.Message
                Write-Error $ErrorMessage
                return
            }
            foreach ($ServiceObject in $Result.ContentObject.value) {
                $OutputObject = $ServiceObject.psobject.copy()
                $OutputObject.psobject.TypeNames.Insert(0, 'MSGraphAPI.DirectoryObject.ServicePrincipal')
                $OutputObject | Add-Member -MemberType NoteProperty -Name _AccessToken -Value $AccessToken
                $OutputObject
            }
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
package nam.model.pod;

import java.io.Serializable;

import javax.enterprise.context.SessionScoped;
import javax.inject.Named;

import org.aries.ui.AbstractWizardPage;

import nam.model.Pod;
import nam.model.util.PodUtil;

@SessionScoped
@Named("podConfigurationSection")
public class PodRecord_ConfigurationSection extends AbstractWizardPage<Pod> implements Serializable {

	private Pod pod;

	public PodRecord_ConfigurationSection() {
		setName("Configuration");
		setUrl("configuration");
	}

	public Pod getPod() {
		return pod;
	}

	public void setPod(Pod pod) {
		this.pod = pod;
	}

	@Override
	public void initialize(Pod pod) {
		setEnabled(true);
		setBackEnabled(true);
		setNextEnabled(true);
		setFinishEnabled(false);
		setPod(pod);
	}

	@Override
	public void validate() {
		if (pod == null) {
			validator.missing("Pod");
		} else {
		}
	}

}


text:
@import Photos;

@interface PlaybackViewController : UIViewController

@property (nonatomic) PHAsset *asset;

@end


text:
package org.apache.geode.management.internal.configuration;

import static org.apache.geode.distributed.ConfigurationProperties.ENABLE_CLUSTER_CONFIGURATION;
import static org.apache.geode.distributed.ConfigurationProperties.USE_CLUSTER_CONFIGURATION;

import java.io.File;
import java.io.IOException;
import java.util.Properties;

import org.apache.commons.io.FileUtils;
import org.junit.Before;
import org.junit.Rule;

import org.apache.geode.management.internal.configuration.utils.ZipUtils;
import org.apache.geode.test.compiler.ClassBuilder;
import org.apache.geode.test.junit.rules.serializable.SerializableTemporaryFolder;

public abstract class ClusterConfigTestBase {
  public String clusterConfigZipPath;

  public static final ConfigGroup CLUSTER = new ConfigGroup("cluster").regions("regionForCluster")
      .jars("cluster.jar").maxLogFileSize("5000").configFiles("cluster.properties", "cluster.xml");
  public static final ConfigGroup GROUP1 = new ConfigGroup("group1").regions("regionForGroup1")
      .jars("group1.jar").maxLogFileSize("6000").configFiles("group1.properties", "group1.xml");
  public static final ConfigGroup GROUP2 = new ConfigGroup("group2").regions("regionForGroup2")
      .jars("group2.jar").maxLogFileSize("7000").configFiles("group2.properties", "group2.xml");

  public static final ClusterConfig CONFIG_FROM_ZIP = new ClusterConfig(CLUSTER, GROUP1, GROUP2);

  public static final ClusterConfig REPLICATED_CONFIG_FROM_ZIP = new ClusterConfig(
      new ConfigGroup("cluster").maxLogFileSize("5000").jars("cluster.jar")
          .regions("regionForCluster"),
      new ConfigGroup("group1").maxLogFileSize("6000").jars("group1.jar")
          .regions("regionForGroup1"),
      new ConfigGroup("group2").maxLogFileSize("7000").jars("group2.jar")
          .regions("regionForGroup2"));

  @Rule
  public SerializableTemporaryFolder temporaryFolder = new SerializableTemporaryFolder();

  protected Properties locatorProps;
  protected Properties serverProps;

  @Before
  public void beforeClusterConfigTestBase() throws Exception {
    clusterConfigZipPath = buildClusterZipFile();
    locatorProps = new Properties();
    serverProps = new Properties();

    // the following are default values, we don't need to set them. We do it for clarity purpose
    locatorProps.setProperty(ENABLE_CLUSTER_CONFIGURATION, "true");
    serverProps.setProperty(USE_CLUSTER_CONFIGURATION, "true");
  }

  private String buildClusterZipFile() throws Exception {
    File clusterConfigDir = temporaryFolder.newFolder("cluster_config");

    File clusterDir = new File(clusterConfigDir, "cluster");
    String clusterXml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
        + "<cache xmlns=\"http://geode.apache.org/schema/cache\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" copy-on-read=\"false\" is-server=\"false\" lock-lease=\"120\" lock-timeout=\"60\" search-timeout=\"300\" version=\"1.0\" xsi:schemaLocation=\"http://geode.apache.org/schema/cache http://geode.apache.org/schema/cache/cache-1.0.xsd\">\n"
        + "<region name=\"regionForCluster\">\n"
        + "    <region-attributes data-policy=\"replicate\" scope=\"distributed-ack\"/>\n"
        + "  </region>\n" + "</cache>\n";
    writeFile(clusterDir, "cluster.xml", clusterXml);
    writeFile(clusterDir, "cluster.properties", "log-file-size-limit=5000");
    createJarFileWithClass("Cluster", "cluster.jar", clusterDir);

    File group1Dir = new File(clusterConfigDir, "group1");
    String group1Xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
        + "<cache xmlns=\"http://geode.apache.org/schema/cache\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" copy-on-read=\"false\" is-server=\"false\" lock-lease=\"120\" lock-timeout=\"60\" search-timeout=\"300\" version=\"1.0\" xsi:schemaLocation=\"http://geode.apache.org/schema/cache http://geode.apache.org/schema/cache/cache-1.0.xsd\">\n"
        + "<region name=\"regionForGroup1\">\n"
        + "    <region-attributes data-policy=\"replicate\" scope=\"distributed-ack\"/>\n"
        + "  </region>\n" + "</cache>\n";
    writeFile(group1Dir, "group1.xml", group1Xml);
    writeFile(group1Dir, "group1.properties", "log-file-size-limit=6000");
    createJarFileWithClass("Group1", "group1.jar", group1Dir);

    File group2Dir = new File(clusterConfigDir, "group2");
    String group2Xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
        + "<cache xmlns=\"http://geode.apache.org/schema/cache\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" copy-on-read=\"false\" is-server=\"false\" lock-lease=\"120\" lock-timeout=\"60\" search-timeout=\"300\" version=\"1.0\" xsi:schemaLocation=\"http://geode.apache.org/schema/cache http://geode.apache.org/schema/cache/cache-1.0.xsd\">\n"
        + "<region name=\"regionForGroup2\">\n"
        + "    <region-attributes data-policy=\"replicate\" scope=\"distributed-ack\"/>\n"
        + "  </region>\n" + "</cache>\n";
    writeFile(group2Dir, "group2.xml", group2Xml);
    writeFile(group2Dir, "group2.properties", "log-file-size-limit=7000");
    createJarFileWithClass("Group2", "group2.jar", group2Dir);

    File clusterConfigZip = new File(temporaryFolder.newFolder(), "cluster_config.zip");
    ZipUtils.zipDirectory(clusterConfigDir.getCanonicalPath(), clusterConfigZip.getCanonicalPath());

    FileUtils.deleteDirectory(clusterConfigDir);
    return clusterConfigZip.getCanonicalPath();
  }

  private File writeFile(File dir, String fileName, String content) throws IOException {
    dir.mkdirs();
    File file = new File(dir, fileName);
    FileUtils.writeStringToFile(file, content);

    return file;
  }

  protected static String createJarFileWithClass(String className, String jarName, File dir)
      throws IOException {
    File jarFile = new File(dir, jarName);
    new ClassBuilder().writeJarFromName(className, jarFile);
    return jarFile.getCanonicalPath();
  }
}


text:
Runs common memory image analysis commands.

## Script Data
---

| **Name** | **Description** |
| --- | --- |
| Script Type | javascript |
| Tags | memory, forensics, volatility, server |

## Inputs
---

| **Argument Name** | **Description** |
| --- | --- |
| memdump | The path to memory dump the file on the system being used. |
| system | The system with `Volatility` installed to be used for the analysis. |

## Outputs
---
There are no outputs for this script.


text:
module.exports = {
  publicPath: 'http://localhost:4000',
  port: 8000,
  serverPort: 8001,
  target: 'dist-build',
  cspEnabled: true,
  cspExtraScriptSrcHosts: ['https://some-cdn.com'],
};


text:
RenderToolbox3
==============

RenderToolbox3 is now deprecated in favor of RenderToolbox4.  Please consider migrating to [RenderToolbox4](https://github.com/RenderToolbox/RenderToolbox4/wiki/RenderToolbox4).

This RenderToolbox3 repository will be here for reference.  Thanks!

RenderToolbox3 is a Matlab toolbox for doing physically based rendering for psychophysics.  For more in formation, please see the RenderToolbox3 wiki:
https://github.com/DavidBrainard/RenderToolbox3/wiki

RenderToolbox3 Copyright (c) 2012-2013 The RenderToolbox3 Team.
RenderToolbox3 is released under the MIT License.
Please see LICENSE.txt for details.
 - About Us: https://github.com/DavidBrainard/RenderToolbox3/wiki/About-Us
 - Join Us: https://github.com/DavidBrainard/RenderToolbox3/wiki/Join-Us
 - Discussion forum: https://groups.google.com/forum/?hl=en#!forum/rendertoolbox3-discussion
 - Known issues: https://github.com/DavidBrainard/RenderToolbox3/issues?state=open


text:
export const sortByMetricName = (metricData: { name: string }[]) => {
	metricData.sort((a, b) => {
		const aLower = a.name.toLowerCase()
		const bLower = b.name.toLowerCase()
		return aLower > bLower ? 1 : bLower > aLower ? -1 : 0
	})
}


text:
from pychron.paths import paths
from pychron.stage.maps.furnace_map import FurnaceStageMap
from pychron.stage.stage_manager import BaseStageManager

class BaseFurnaceStageManager(BaseStageManager):
    stage_map_klass = FurnaceStageMap

    def __init__(self, *args, **kw):
        super(BaseFurnaceStageManager, self).__init__(*args, **kw)
        self.tray_calibration_manager.style = 'Linear'

    def get_sample_states(self):
        return [h.id for h in self.stage_map.sample_holes if h.analyzed]

    def _root_default(self):
        return paths.furnace_map_dir
# ============= EOF =============================================


text:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
    <alpha
        android:duration="100"
        android:fromAlpha="0.0"
        android:toAlpha="1.0" />

    <scale
        android:duration="100"
        android:fromXScale="0"
        android:fromYScale="0"
        android:toXScale="100%"
        android:toYScale="100%"
        android:pivotX="50%"
        android:pivotY="50%"
        />
</set>


text:
'use strict';

var EC = protractor.ExpectedConditions;

var Helper = ( function() {
  function Helper(){
  }

  Helper.prototype = {
    presenceOf : function(element) {
      browser.wait(EC.presenceOf(element), 5000);
    },

    urlContains : function(text) {
      browser.wait(EC.urlContains(text), 5000);
    }
  }

  return Helper;
} )();

module.exports = new Helper();


text:
package com.esotericsoftware.kryo.serializers;

import static com.esotericsoftware.minlog.Log.*;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.reflect.Field;

import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryo.KryoException;
import com.esotericsoftware.kryo.io.Input;
import com.esotericsoftware.kryo.io.Output;

/** Serializes objects using direct field assignment for fields that have a @Tag(int) annotation. This provides
 * backward compatibility so new fields can be added. TaggedFieldSerializer has two advantages over {@link VersionFieldSerializer}
 * : 1) fields can be renamed and 2) fields marked with the @Deprecated annotation will be ignored when reading old
 * bytes and won't be written to new bytes. Deprecation effectively removes the field from serialization, though the field and
 * @Tag annotation must remain in the class. Deprecated fields can optionally be made private and/or renamed so they
 * don't clutter the class (eg, ignored, ignored2). For these reasons, TaggedFieldSerializer generally
 * provides more flexibility for classes to evolve. The downside is that it has a small amount of additional overhead compared to
 * VersionFieldSerializer (an additional varint per field). Forward compatibility is not supported.
 * @see VersionFieldSerializer
 * @author Nathan Sweet <misc@n4te.com> */
public class TaggedFieldSerializer<T> extends FieldSerializer<T> {
	private int[] tags;
	private int writeFieldCount;
	private boolean[] deprecated;

	public TaggedFieldSerializer (Kryo kryo, Class type) {
		super(kryo, type);
	}

	protected void initializeCachedFields () {
		CachedField[] fields = getFields();
		// Remove untagged fields.
		for (int i = 0, n = fields.length; i < n; i++) {
			Field field = fields[i].getField();
			if (field.getAnnotation(Tag.class) == null) {
				if (TRACE) trace("kryo", "Ignoring field without tag: " + fields[i]);
				super.removeField(fields[i]);
			}
		}
		// Cache tag values.
		fields = getFields();
		tags = new int[fields.length];
		deprecated = new boolean[fields.length];
		writeFieldCount = fields.length;
		for (int i = 0, n = fields.length; i < n; i++) {
			Field field = fields[i].getField();
			tags[i] = field.getAnnotation(Tag.class).value();
			if (field.getAnnotation(Deprecated.class) != null) {
				deprecated[i] = true;
				writeFieldCount--;
			}
		}

		this.removedFields.clear();
	}

	public void removeField (String fieldName) {
		super.removeField(fieldName);
		initializeCachedFields();
	}

	public void removeField (CachedField field) {
		super.removeField(field);
		initializeCachedFields();
	}

	public void write (Kryo kryo, Output output, T object) {
		CachedField[] fields = getFields();
		output.writeVarInt(writeFieldCount, true); // Can be used for null.
		for (int i = 0, n = fields.length; i < n; i++) {
			if (deprecated[i]) continue;
			output.writeVarInt(tags[i], true);
			fields[i].write(output, object);
		}
	}

	public T read (Kryo kryo, Input input, Class<T> type) {
		T object = create(kryo, input, type);
		kryo.reference(object);
		int fieldCount = input.readVarInt(true);
		int[] tags = this.tags;
		CachedField[] fields = getFields();
		for (int i = 0, n = fieldCount; i < n; i++) {
			int tag = input.readVarInt(true);

			CachedField cachedField = null;
			for (int ii = 0, nn = tags.length; ii < nn; ii++) {
				if (tags[ii] == tag) {
					cachedField = fields[ii];
					break;
				}
			}
			if (cachedField == null) throw new KryoException("Unknown field tag: " + tag + " (" + getType().getName() + ")");
			cachedField.read(input, object);
		}
		return object;
	}

	/** If true, this field will not be serialized. */
	@Retention(RetentionPolicy.RUNTIME)
	@Target(ElementType.FIELD)
	public @interface Tag {
		int value();
	}
}


text:
//@flow
import template from '../templates/emptyGrid.hbs';

/**
 * Some description for initializer
 * @name EmptyGridView
 * @memberof module:core.list.views
 * @class EmptyGridView
 * @constructor
 * @description View для отображения списка без колонок
 * @extends Marionette.View
 * @param {Object} options Constructor options
 * @param {string} [options.text=Список пуст] отображаемый текст
 * */

export default Marionette.View.extend({
    templateContext() {
        return {
            text: _.result(this.options, 'text', Localizer.get('CORE.GRID.EMPTYVIEW.EMPTY')),
            colspan: this.options.colspan
        };
    },

    tagName: 'tr',

    template: Handlebars.compile(template),

    className: 'empty-view'
});


text:
/*global QUnit*/

sap.ui.define([
	"sap/ui/core/UIComponent",
	"sap/ui/core/ComponentContainer",
	"sap/ui/core/mvc/XMLView",
	"sap/ui/layout/VerticalLayout",
	"sap/m/Button",
	"sap/m/Dialog",
	"sap/m/Popover",
	"sap/m/InstanceManager",
	"sap/m/MessageBox",
	"sap/ui/model/json/JSONModel",
	"sap/ui/support/Bootstrap",
	"sap/ui/support/RuleAnalyzer",
	"test-resources/sap/ui/support/TestHelper",
	"sap/ui/core/Core"
], function (
	UIComponent,
	ComponentContainer,
	XMLView,
	VerticalLayout,
	Button,
	Dialog,
	Popover,
	InstanceManager,
	MessageBox,
	JSONModel,
	Bootstrap,
	RuleAnalyzer,
	testRule,
	oCore
) {
	"use strict";

	QUnit.module("Base functionality for app component's root view", {
		beforeEach: function (assert) {
			var fnDone = assert.async();
			var CustomComponent = UIComponent.extend("sap.ui.dt.test.Component", {
				createContent: function() {
					return new VerticalLayout({
						id: this.createId("layoutId"),
						content: [
							new Button(this.createId("buttonId")),
							new Button({
								text: "Missing stable id"
							}),
							new XMLView({ // Missing ID for view and implicit missing IDs for controls inside
								viewContent:
									'<mvc:View xmlns:mvc="sap.ui.core.mvc" xmlns:m="sap.m" xmlns:l="sap.ui.layout">' +
										'<l:VerticalLayout id="layout">' +
											'<m:Button text="Button 1" id="button1" />' +
										'</l:VerticalLayout>' +
									'</mvc:View>'
							})
						]
					});
				}
			});
			this.oComponent = new CustomComponent(); // Missing ID

			this.oComponentContainer = new ComponentContainer("CompCont1", {
				component: this.oComponent
			});

			this.oComponentContainer.placeAt("qunit-fixture");
			oCore.applyChanges();

			Bootstrap.initSupportRules(["true", "silent"], {
				onReady: fnDone
			});
		},
		afterEach: function () {
			this.oComponentContainer.destroy();
		}
	}, function () {
		testRule({
			executionScopeType: "global",
			libName: "sap.ui.fl",
			ruleId: "stableId",
			expectedNumberOfIssues: 5
		});
	});

	QUnit.module("Base functionality for popups", {
		beforeEach: function (assert) {
			var fnDone = assert.async();
			var CustomComponent = UIComponent.extend("sap.ui.dt.test.Component", {
				createContent: function() {
					return new VerticalLayout({
						id: this.createId("layoutId")
					});
				}
			});
			this.oComponent = new CustomComponent("componentId");

			// popups with app components + unstable
			this.oComponent.runAsOwner(function () {
				this.oDialog = new Dialog({
					id: this.oComponent.createId("DialogWithComponent"),
					showHeader: false,
					content: [this.oButton0 = new Button({text: "button inside dialog with unstable id"})],
					contentHeight: "800px",
					contentWidth: "600px"
				});
				this.oPopover = new Popover({
					content: [new Button({text: "button inside popover with unstable id"})],
					showHeader: false,
					contentWidth: "270px"
				});
				// popup with adaptation disabled
				this.oPopoverAdaptationDisabled = new Popover({
					id: this.oComponent.createId("PopoverAdaptationDisabled"),
					content: [new Button({text: "button inside popover with unstable id"})],
					showHeader: false,
					contentWidth: "270px"
				});
				this.oPopoverAdaptationDisabled.isPopupAdaptationAllowed = function () {
					return false;
				};
				// when focus is taken away popover might close - resulting in failing tests
				this.oPopoverAdaptationDisabled.oPopup.setAutoClose(false);
				this.oPopover.oPopup.setAutoClose(false);
			}.bind(this));

			// popup without component
			this.oDialogWithoutComponent = new Dialog({
				showHeader: false,
				content: [this.oButton1 = new Button({text: "button inside dialog with unstable id"})],
				contentHeight: "800px",
				contentWidth: "600px"
			});

			this.oComponentContainer = new ComponentContainer("CompCont1", {
				component: this.oComponent
			});

			this.oComponentContainer.placeAt("qunit-fixture");
			oCore.applyChanges();

			this.oDialog.attachAfterOpen(function () {
				this.oPopover.attachAfterOpen(function () {
					this.oDialogWithoutComponent.attachAfterOpen(function () {
						this.oPopoverAdaptationDisabled.attachAfterOpen(function () {
							// recognized as a dialog from InstanceManager
							MessageBox.show("message box");
							Bootstrap.initSupportRules(["true", "silent"], {
								onReady: fnDone
							});
						});
						this.oPopoverAdaptationDisabled.openBy(this.oButton1);
					}.bind(this));
					this.oDialogWithoutComponent.open();
				}.bind(this));
				this.oPopover.openBy(this.oButton0);
			}.bind(this));
			this.oDialog.open();
		},
		afterEach: function () {
			this.oPopover.destroy();
			this.oPopoverAdaptationDisabled.destroy();
			this.oDialog.destroy();
			this.oDialogWithoutComponent.destroy();
			InstanceManager.closeAllDialogs();
			this.oComponentContainer.destroy();
		}
	}, function () {
		QUnit.test("stableId check", function (assert) {
			return RuleAnalyzer.analyze({type: "global"},
				[{
					libName: "sap.ui.fl",
					ruleId: "stableId"
				}]
			).then(function () {
				var aUnstableIds = [
					this.oDialog.getContent()[0].getId(),
					this.oPopover.getContent()[0].getId(),
					this.oPopover.getId()
				];
				var oHistory = RuleAnalyzer.getLastAnalysisHistory();
				oHistory.issues.forEach(function (oIssue) {
					var iUnstableIdIndex = aUnstableIds.indexOf(oIssue.context.id);
					if (iUnstableIdIndex > -1) {
						aUnstableIds.splice(iUnstableIdIndex, 1);
					}
				});
				assert.strictEqual(aUnstableIds.length, 0, "then the correct no. of issues were created");
			}.bind(this));
		});
	});

	QUnit.module("Aggregation Binding via template", {
		beforeEach: function (assert) {
			var fnDone = assert.async();
			var CustomComponent = UIComponent.extend("sap.ui.dt.test.Component", {
				createContent: function() {
					return new XMLView({
						id: this.createId("view"),
						viewContent:
							'<mvc:View xmlns:mvc="sap.ui.core.mvc" xmlns:m="sap.m" xmlns:l="sap.ui.layout">' +
								'<l:VerticalLayout id="layout" content="{/buttons}">' +
									'<l:content>' +
										'<m:Button text="{text}" />' +
									'</l:content>' +
								'</l:VerticalLayout>' +
							'</mvc:View>'
					});
				}
			});
			this.oComponent = new CustomComponent("comp");

			this.oModel = new JSONModel({
				buttons: [
					{ text: "Button 1" },
					{ text: "Button 2" },
					{ text: "Button 3" }
				]
			});
			this.oComponent.setModel(this.oModel);

			this.oComponentContainer = new ComponentContainer("CompCont1", {
				component: this.oComponent
			});

			this.oComponentContainer.placeAt("qunit-fixture");
			oCore.applyChanges();

			Bootstrap.initSupportRules(["true", "silent"], {
				onReady: fnDone
			});
		},
		afterEach: function () {
			this.oComponentContainer.destroy();
			this.oComponent.destroy();
		}
	}, function () {
		testRule({
			executionScopeType: "global",
			libName: "sap.ui.fl",
			ruleId: "stableId",
			expectedNumberOfIssues: 3
		});
	});

	QUnit.module("Aggregation Binding via factory function", {
		beforeEach: function (assert) {
			var fnDone = assert.async();
			var CustomComponent = UIComponent.extend("sap.ui.dt.test.Component", {
				createContent: function() {
					return new XMLView({
						id: this.createId("view"),
						viewContent:
							'<mvc:View xmlns:mvc="sap.ui.core.mvc" xmlns:l="sap.ui.layout">' +
								'<l:VerticalLayout id="layout" />' +
							'</mvc:View>'
					});
				}
			});
			this.oComponent = new CustomComponent("comp");

			this.oModel = new JSONModel({
				buttons: [
					{ text: "Button 1" },
					{ text: "Button 2" },
					{ text: "Button 3" }
				]
			});
			this.oComponent.setModel(this.oModel);

			this.oVerticalLayout = this.oComponent.getRootControl().byId("layout");
			this.oVerticalLayout.bindAggregation("content", "/buttons", function (sId) {
				return new Button(sId, {
					text: {
						path: "text"
					}
				});
			});

			this.oComponentContainer = new ComponentContainer("CompCont1", {
				component: this.oComponent
			});

			this.oComponentContainer.placeAt("qunit-fixture");
			oCore.applyChanges();

			Bootstrap.initSupportRules(["true", "silent"], {
				onReady: fnDone
			});
		},
		afterEach: function () {
			this.oComponentContainer.destroy();
			this.oComponent.destroy();
		}
	}, function () {
		// Controls in bound aggregations should be ignored during the evaluation
		testRule({
			executionScopeType: "global",
			libName: "sap.ui.fl",
			ruleId: "stableId",
			expectedNumberOfIssues: 0
		});
	});

	QUnit.done(function() {
		document.getElementById("qunit-fixture").style.display = "none";
	});
});


text:
package com.hack;

import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Date;

import org.json.JSONException;
import org.json.JSONObject;

import android.app.ActionBar;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.NavUtils;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.CompoundButton;
import android.widget.ImageButton;
import android.widget.Switch;
import android.widget.TextView;

public class DeviceDetailsActivity extends Activity {

    // -- Member Variables

    private long mDeviceId;
    private Device mDevice;
    private DeviceDataSource mDeviceDataSource;
    private long mSocketId;
    private int mDeviceState;

    private ImageButton mAddTimerButton;
    private ImageButton mDeleteTimerButton;
    private TextView mDeviceTimerDetails;
    private Switch mDeviceStateSwitch;
    private TextView mDeviceType;
    private TextView mDeviceOnSinceTime;
    private TextView mDeviceTotalTimeOn;
    private TextView mDevicePowerUsage;

    private HardwareUnitDataSource mHardwareUnitDataSource;

    private Timer mTimer;
    private TimerDataSource mTimerDataSource;

    private ActionBar mActionBar;

    private long mHardwareUnitId;
    private HardwareUnit mHardwareUnit;

    private boolean isCheckedChangeEnabled = true;

    // -- Initialize Activity

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

        // Show the Up button in the action bar.
        setupActionBar();
        mActionBar = getActionBar();

        // initialize members
        mDeviceDataSource = new DeviceDataSource(this);
        mDeviceDataSource.open();
        mHardwareUnitDataSource = new HardwareUnitDataSource(this);
        mHardwareUnitDataSource.open();
        mTimerDataSource = new TimerDataSource(this);
        mTimerDataSource.open();

        // get device id from previous activity
        Intent intent = getIntent();
        mDeviceId = intent.getLongExtra(SingleUnitActivity.EXTRA_DEVICE_ID, -1);
        mHardwareUnitId = intent.getLongExtra(SingleUnitActivity.EXTRA_HARDWARE_UNIT_ID, -1);

        mHardwareUnit = mHardwareUnitDataSource.getHardwareUnitById(mHardwareUnitId);

        mAddTimerButton = (ImageButton) findViewById(R.id.addTimerButton);
        mDeleteTimerButton = (ImageButton) findViewById(R.id.deleteTimerButton);
        mDeviceTimerDetails = (TextView) findViewById(R.id.deviceTimerDetails);
        mDeviceStateSwitch = (Switch) findViewById(R.id.deviceStateSwitch);
        mDeviceType = (TextView) findViewById(R.id.deviceType);
        mDeviceOnSinceTime = (TextView) findViewById(R.id.deviceOnSince);
        mDeviceTotalTimeOn = (TextView) findViewById(R.id.deviceTotalTimeOn);
        mDevicePowerUsage = (TextView) findViewById(R.id.devicePowerUsage);

        // update on-screen stats
        updateUIDeviceStatistics();

        // set up event listeners
        mDeviceStateSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                if (isCheckedChangeEnabled) {
                    String url = "http://" + mHardwareUnit.getBasePath() + ":" + mHardwareUnit.getPortNumber() + "/hack";
                    if (isChecked) {
                        url += "/on?socket=" + mSocketId;
                    } else {
                        url += "/off?socket=" + mSocketId;
                    }
                    Log.i("DeviceDetailsActivity - onCheckChanged()", "Requested url: " + url);

                    HackCommand toggleCommand = new HackCommand(DeviceDetailsActivity.this, mHardwareUnit, url) {

                        @Override
                        public void doSuccess(JSONObject response) {
                            super.doSuccess(response);

                            JSONObject data = new JSONObject();
                            try {
                                data = response.getJSONObject("data");
                            } catch (JSONException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                            }

                            parseJSONResponse(data);
                            updateUIDeviceStatistics();
                            Log.i("DeviceDetailsActivity - onPostExecute","device statistics updated");
                        }

                        @Override
                        public void doFail(JSONObject response) {
                            super.doFail(response);
                            // change switch back to its old position
                            // temporarily disable event listener so we can switch it back without firing event
                            isCheckedChangeEnabled = false;
                            mDeviceStateSwitch.toggle();
                            isCheckedChangeEnabled = true;
                        }

                    };

                    // send command
                    toggleCommand.send();
                }
            }
        });

        mAddTimerButton.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                startSetTimerActivity();
            }
        });

        mDeleteTimerButton.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                cancelTimer();
            }

        });

    }

    // -- Action Bar

    /**
     * Set up the {@link android.app.ActionBar}.
     */
    private void setupActionBar() {
        getActionBar().setDisplayHomeAsUpEnabled(true);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.device_details, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
        case android.R.id.home:
            // This ID represents the Home or Up button. In the case of this
            // activity, the Up button is shown. Use NavUtils to allow users
            // to navigate up one level in the application structure. For
            // more details, see the Navigation pattern on Android Design:
            //
            // http://developer.android.com/design/patterns/navigation.html#up-vs-back
            //
            Intent upIntent = NavUtils.getParentActivityIntent(this);
            upIntent.putExtra(AllUnitsActivity.EXTRA_UNIT_ID, mDevice.getHardwareUnitId());
            NavUtils.navigateUpTo(this, upIntent);
            return true;
        case R.id.action_edit:
            startEditDeviceActivity();
            break;
        case R.id.action_refresh:
            String url = "http://" + mHardwareUnit.getBasePath() + ":" + mHardwareUnit.getPortNumber() + "/hack/refresh";
            HackCommand refreshCommand = new HackCommand(DeviceDetailsActivity.this, mHardwareUnit, url) {

                @Override
                public void doSuccess(JSONObject response) {
                    super.doSuccess(response);

                    JSONObject data = new JSONObject();
                    try {
                        data = response.getJSONObject("data");
                    } catch (JSONException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }

                    parseJSONResponse(data);
                    updateUIDeviceStatistics();
                    Log.i("DeviceDetailsActivity - onPostExecute","device statistics updated");
                }
            };

            // send command
            refreshCommand.send();

            break;
        }
        return super.onOptionsItemSelected(item);
    }

    // -- Intents

    public void startSetTimerActivity() {
        Intent intent = new Intent(this, SetTimerActivity.class);
        intent.putExtra(SingleUnitActivity.EXTRA_DEVICE_ID, mDeviceId);
        startActivity(intent);
    }

    public void startEditDeviceActivity() {
        if (mDevice != null) {
            Intent intent = new Intent(this, AddDeviceActivity.class);
            intent.putExtra(SingleUnitActivity.EXTRA_DEVICE_ID, mDeviceId);
            intent.putExtra(SingleUnitActivity.EXTRA_HARDWARE_UNIT_ID, mDevice.getHardwareUnitId());
            intent.putExtra(SingleUnitActivity.EXTRA_SOCKET_ID, mDevice.getSocketId());
            intent.putExtra(SingleUnitActivity.EXTRA_TITLE, "Edit Device");
            startActivity(intent);
        }
    }

    // -- Misc

    // kWh
    public long calculatePowerUsage(long totalTimeOn, long deviceTypeId) {
        int multFactor = 1;
        switch ((int) deviceTypeId) {
        case 1: // simple
            multFactor = 200;
            break;
        case 2:
            multFactor = 60;
            break;
        case 3:
            multFactor = 1000;
            break;
        default:
            break;
        }

        return ((totalTimeOn / 360) * multFactor) / 1000;
    }

    private void deleteTimer() {
        if (mTimer != null && mDevice != null) {
            // delete timer from db
            mTimerDataSource.deleteTimerByDeviceId(mDevice.getId());
            mTimer = null;

            // show add button
            mDeviceTimerDetails.setText("No Timer Set");
            mAddTimerButton.setVisibility(View.VISIBLE);
            mDeleteTimerButton.setVisibility(View.GONE);

        }
    }

    private void parseJSONResponse(JSONObject data) {
        if (data != null) {
            ArrayList<Device> devices = mDeviceDataSource.getAllDevicesForHardwareUnit(mHardwareUnitId);
            // update each of the devices in the db
            for (Device d : devices) {
                Log.i("DeviceDetailsActivity - parseJSONResponse()", "updating device at socket: " + d.getSocketId());
                int newState = 0;
                long totalTimeOn = 0; // milliseconds
                long onSinceTime = -1; // milliseconds
                long espruinoCurrentTime = 0; // milliseconds
                try {
                    espruinoCurrentTime = data.getLong("currentTime");
                    JSONObject outlet = data.getJSONArray("outlets").getJSONObject((int) d.getSocketId());
                    newState = outlet.getInt("state");
                    totalTimeOn = outlet.getLong("totalTimeOn");
                    onSinceTime = outlet.getLong("onSinceTime");
                    Log.i("DeviceDetailsActivity - parseJSONResponse",
                            "new state: " + newState +
                            ", current espruino time (seconds): " + espruinoCurrentTime +
                            ", total time on: " + totalTimeOn +
                            ", on since time (espruino seconds): " + onSinceTime);
                } catch (JSONException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                // update db
                // time conversion
                long now = new Date().getTime();
                if (onSinceTime != -1) {
                    onSinceTime = now - ((espruinoCurrentTime - onSinceTime) * 1000);
                }
                mDeviceDataSource.updateDevice(d.getId(), newState, totalTimeOn, onSinceTime);
            }
        }
    }

    private void updateUIDeviceStatistics() {
        if (mDeviceDataSource != null) {
            mDevice = mDeviceDataSource.getDeviceById(mDeviceId);
            if (mDevice != null) {
                mSocketId = mDevice.getSocketId();
                // title
                mActionBar.setTitle(mDevice.getName());
                // state
                mDeviceState = mDevice.getState();
                isCheckedChangeEnabled = false;
                if (mDeviceState == 1) {  // 1 is off
                    mDeviceStateSwitch.setChecked(false);
                } else {
                    mDeviceStateSwitch.setChecked(true);
                }
                isCheckedChangeEnabled = true;
                // type
                mDeviceType.setText(mDevice.getType());
                // on since time
                String onSinceTime = "OFF";
                Log.i("DeviceDetailsActivity - updateUIDeviceStatistics()", "Actual on Since: " + mDevice.getOnSinceTime());
                if (mDevice.getOnSinceTime() != -1) {
                    Date onSinceDate = new Date(mDevice.getOnSinceTime());
                    DateFormat df = DateFormat.getTimeInstance(DateFormat.SHORT);
                    onSinceTime = df.format(onSinceDate);
                }
                mDeviceOnSinceTime.setText(onSinceTime);
                // total time on and power usage
                long totalTimeOn = mDevice.getTotalTimeOn();
                long powerUsage = calculatePowerUsage(totalTimeOn, mDevice.getTypeId());
                mDeviceTotalTimeOn.setText((totalTimeOn / 60) + " minutes");
                mDevicePowerUsage.setText(powerUsage + " kWh");
            }
        }

        // get timer info
        if (mTimerDataSource != null) {
            mTimer = mTimerDataSource.getTimerByDeviceId(mDeviceId);
            // no timer set?
            if (mTimer == null) {
                mDeviceTimerDetails.setText("No Timer Set");
                mAddTimerButton.setVisibility(View.VISIBLE);
                mDeleteTimerButton.setVisibility(View.GONE);
            } else {
                mAddTimerButton.setVisibility(View.GONE);
                mDeleteTimerButton.setVisibility(View.VISIBLE);
                DateFormat df = DateFormat.getTimeInstance(DateFormat.SHORT);
                Date timeOnDate = new Date(mTimer.getTimeOn());
                Date timeOffDate = new Date(mTimer.getTimeOff());
                String timeOn = df.format(timeOnDate);
                String timeOff = df.format(timeOffDate);
                mDeviceTimerDetails.setText("Turn ON: " + timeOn + " - " + timeOff);
            }
        }
    }

    public void cancelTimer() {
        String url = "http://" + mHardwareUnit.getBasePath() + ":" + mHardwareUnit.getPortNumber() + "/hack/cancelTimer?socket=" + mDevice.getSocketId();
        HackCommand cancelTimerCommand = new HackCommand(DeviceDetailsActivity.this, mHardwareUnit, url) {

            @Override
            public void doSuccess(JSONObject response) {
                super.doSuccess(response);
                deleteTimer();
            }
        };

        cancelTimerCommand.send();
    }

}


text:
import React from 'react';
import Text from 'atoms/Text';

export default (props) => <Text {...props} />;


text:
set -e

function abort()
{
	echo "$@"
	exit 1
}

function cleanup()
{
	echo " --> Stopping container"
	docker stop $ID >/dev/null
	docker rm $ID >/dev/null
}

PWD=`pwd`

echo " --> Starting container"
ID=`docker run -d -p 8080:8080 -v $PWD/test:/test $NAME:$VERSION /sbin/my_init`
sleep 1

echo " --> Verifying container"
docker ps -q | grep ^${ID:0:12} > /dev/null
if [ $? -ne 0 ]; then
	abort "Unable to verify container IP"
else
  echo " --> Container verifyied"
fi

trap cleanup EXIT

echo " --> Running tests"

echo " --> Checking Jenkins process"
sleep 10
docker exec -it $ID ps -ef | grep jenkins > /dev/null
if [ $? -ne 0 ]; then
	abort "No Jenkins Process running"
else
  echo " --> Jenkins is running"
fi

echo " --> Checking HTTP port 8080, please wait"
sleep 30
curl -s http://$(docker-machine ip default):8080 > /dev/null

if [ $? -ne 0 ]; then
	abort "Jenkins is not open on 8080"
else
  echo " --> Connected on port 8080"
fi


text:
"use strict";

var x = require('x-ray')();

var HEADING_TAGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];

var util = {
  scrape(url, scope, selector, callback) {
    callback = callback || ((obj) => console.log(JSON.stringify(obj, null, 4)));
    var indexStream = x(url, scope, selector).write();
    var index = '';
    indexStream.on('data', (c) => index += c);
    indexStream.on('end', () => callback(JSON.parse(index)));
  },

  forEachSectionInIndex(index, callback) {
    index.sections && index.sections.forEach((section) => {
      callback(section);
      util.forEachSectionInIndex(section, callback);
    });
  },

  HEADING_TAGS,

  isHeadingTag($elem) {
    if ($elem.length === 0) {
      return false;
    }
    return (HEADING_TAGS.indexOf($elem[0].name) !== -1);
  }
};

module.exports = util;


text:
import { ConfigSection, ConfigWithDefaults } from '@jupyterlab/services';

import { log } from './log';

export async function main(): Promise<void> {
  log('Config');
  // The base url of the Jupyter server.

  const section = await ConfigSection.create({ name: 'notebook' });
  const config = new ConfigWithDefaults({
    section,
    defaults: { default_cell_type: 'code' },
    className: 'Notebook'
  });
  log(config.get('default_cell_type')); // 'code'
  const data = await config.set('foo', 'bar');
  log(data);
}


text:
package io.netty.handler.codec;

import io.netty.util.concurrent.FastThreadLocal;
import io.netty.util.internal.MathUtil;

import java.util.AbstractList;
import java.util.RandomAccess;

import static io.netty.util.internal.ObjectUtil.checkNotNull;

/**
 * Special {@link AbstractList} implementation which is used within our codec base classes.
 */
final class CodecOutputList extends AbstractList<Object> implements RandomAccess {

    private static final CodecOutputListRecycler NOOP_RECYCLER = new CodecOutputListRecycler() {
        @Override
        public void recycle(CodecOutputList object) {
            // drop on the floor and let the GC handle it.
        }
    };

    private static final FastThreadLocal<CodecOutputLists> CODEC_OUTPUT_LISTS_POOL =
            new FastThreadLocal<CodecOutputLists>() {
                @Override
                protected CodecOutputLists initialValue() throws Exception {
                    // 16 CodecOutputList per Thread are cached.
                    return new CodecOutputLists(16);
                }
            };

    private interface CodecOutputListRecycler {
        void recycle(CodecOutputList codecOutputList);
    }

    private static final class CodecOutputLists implements CodecOutputListRecycler {
        private final CodecOutputList[] elements;
        private final int mask;

        private int currentIdx;
        private int count;

        CodecOutputLists(int numElements) {
            elements = new CodecOutputList[MathUtil.safeFindNextPositivePowerOfTwo(numElements)];
            for (int i = 0; i < elements.length; ++i) {
                // Size of 16 should be good enough for the majority of all users as an initial capacity.
                elements[i] = new CodecOutputList(this, 16);
            }
            count = elements.length;
            currentIdx = elements.length;
            mask = elements.length - 1;
        }

        public CodecOutputList getOrCreate() {
            if (count == 0) {
                // Return a new CodecOutputList which will not be cached. We use a size of 4 to keep the overhead
                // low.
                return new CodecOutputList(NOOP_RECYCLER, 4);
            }
            --count;

            int idx = (currentIdx - 1) & mask;
            CodecOutputList list = elements[idx];
            currentIdx = idx;
            return list;
        }

        @Override
        public void recycle(CodecOutputList codecOutputList) {
            int idx = currentIdx;
            elements[idx] = codecOutputList;
            currentIdx = (idx + 1) & mask;
            ++count;
            assert count <= elements.length;
        }
    }

    static CodecOutputList newInstance() {
        return CODEC_OUTPUT_LISTS_POOL.get().getOrCreate();
    }

    private final CodecOutputListRecycler recycler;
    private int size;
    private Object[] array;
    private boolean insertSinceRecycled;

    private CodecOutputList(CodecOutputListRecycler recycler, int size) {
        this.recycler = recycler;
        array = new Object[size];
    }

    @Override
    public Object get(int index) {
        checkIndex(index);
        return array[index];
    }

    @Override
    public int size() {
        return size;
    }

    @Override
    public boolean add(Object element) {
        checkNotNull(element, "element");
        try {
            insert(size, element);
        } catch (IndexOutOfBoundsException ignore) {
            // This should happen very infrequently so we just catch the exception and try again.
            expandArray();
            insert(size, element);
        }
        ++ size;
        return true;
    }

    @Override
    public Object set(int index, Object element) {
        checkNotNull(element, "element");
        checkIndex(index);

        Object old = array[index];
        insert(index, element);
        return old;
    }

    @Override
    public void add(int index, Object element) {
        checkNotNull(element, "element");
        checkIndex(index);

        if (size == array.length) {
            expandArray();
        }

        if (index != size) {
            System.arraycopy(array, index, array, index + 1, size - index);
        }

        insert(index, element);
        ++ size;
    }

    @Override
    public Object remove(int index) {
        checkIndex(index);
        Object old = array[index];

        int len = size - index - 1;
        if (len > 0) {
            System.arraycopy(array, index + 1, array, index, len);
        }
        array[-- size] = null;

        return old;
    }

    @Override
    public void clear() {
        // We only set the size to 0 and not null out the array. Null out the array will explicit requested by
        // calling recycle()
        size = 0;
    }

    /**
     * Returns {@code true} if any elements where added or set. This will be reset once {@link #recycle()} was called.
     */
    boolean insertSinceRecycled() {
        return insertSinceRecycled;
    }

    /**
     * Recycle the array which will clear it and null out all entries in the internal storage.
     */
    void recycle() {
        for (int i = 0 ; i < size; i ++) {
            array[i] = null;
        }
        size = 0;
        insertSinceRecycled = false;

        recycler.recycle(this);
    }

    /**
     * Returns the element on the given index. This operation will not do any range-checks and so is considered unsafe.
     */
    Object getUnsafe(int index) {
        return array[index];
    }

    private void checkIndex(int index) {
        if (index >= size) {
            throw new IndexOutOfBoundsException("expected: index < ("
                    + size + "),but actual is (" + size + ")");
        }
    }

    private void insert(int index, Object element) {
        array[index] = element;
        insertSinceRecycled = true;
    }

    private void expandArray() {
        // double capacity
        int newCapacity = array.length << 1;

        if (newCapacity < 0) {
            throw new OutOfMemoryError();
        }

        Object[] newArray = new Object[newCapacity];
        System.arraycopy(array, 0, newArray, 0, array.length);

        array = newArray;
    }
}


text:
package com.groupon.lex.metrics.lib.sequence;

import java.lang.ref.SoftReference;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
import org.mockito.runners.MockitoJUnitRunner;

@RunWith(MockitoJUnitRunner.class)
public class CachingObjectSequenceTest {
    private static final String ZERO = "zero";
    @Mock
    private ObjectSequence<String> underlying;

    private ObjectSequence<String> seq;

    @Before
    public void setup() {
        when(underlying.size()).thenReturn(1);
        when(underlying.get(0)).thenReturn(ZERO);  // Reference won't expire, because static constant exists.

        seq = new CachingObjectSequence<>(underlying, SoftReference::new);
        verify(underlying, times(1)).size();
    }

    @Test
    public void constructor() {
        assertFalse(seq.isEmpty());
        assertEquals(1, seq.size());

        verifyNoMoreInteractions(underlying);
    }

    @Test
    public void readTwice() {
        assertSame(ZERO, seq.get(0));
        verify(underlying, times(1)).get(0);

        assertSame(ZERO, seq.get(0));  // Second call uses cached value.
        verifyNoMoreInteractions(underlying);
    }

    @Test
    public void flags() {
        when(underlying.isSorted()).thenReturn(true);
        when(underlying.isNonnull()).thenReturn(true);
        when(underlying.isDistinct()).thenReturn(true);

        assertTrue(seq.isSorted());
        verify(underlying, times(1)).isSorted();
        assertTrue(seq.isNonnull());
        verify(underlying, times(1)).isNonnull();
        assertTrue(seq.isDistinct());
        verify(underlying, times(1)).isDistinct();

        verifyNoMoreInteractions(underlying);
    }
}


text:
"""
The main purpose of this script is to check the similarity of two ends around the breakpoint region.

=============================
Usage: python whole_summary_similarity_check.py -i -o
-h help

-i files to processed                           *[No default value]

-I input file path				[default value: current folder]

-o name of output files                       	*[No default value]

-s suffix for the files to be processed         [default value "txt"]

-d sep_char within among columns                [default value '\t']

-j skip header lines                            [default value 0]
	if skip header lines = 0 indicates that there is no header line
	if skip header lines = n indicates that first n lines are header lines

-l unique_id length for the infile		[default value 2]

#-t number of split_reads			[default value 1]
#-a number of span_reads			[default value 1]
#-u number of sum of supporting reads		[default value 2]

===================
input description:
input files: whole_summary_all.txt include all the candidate fusions and supporting reads.

======================
output files: whole_summary_filtered.txt only keep the fusions have pass the filter.

============================

Python & Module requirement:
Versions: 2.4 or above
Module: No additional Python Module is required.

============================
Library file requirement:
Not Standalone version, few library file is required.
============================
command line example:

"""

##Copyright
##By Liye Zhang
##Contact: bioliyezhang@gmail.com
##Compatible Python Version:2.4 or above

###Code Framework
'''
command line example: python whole_summary_similarity_check.py -i -o

'''

#To do this check, first, need to extract n bases around the breakpoint (3n+3n).(because after real-case testing, )
#As a result, need to generate bed file to extract from the genemoe.fa
#Second, use bed tools to get this two n*6 long fa.
#use these two strings from fa and try to compare similarity (which means the use??? by shifting left and right from the breakpoint for n bp, for the next 2n bp (same direction on both end) can get the same m nucletide at that position.(m do not need to be consecutive, for example, in the TBL1_PDL2 defuse 97 case, on TBL1 is TTACCAG, so m=2 for CxG)
#m is the reported similarity. Pick the biggest one as the one to use.
#Note: for both direction, only one direction will have this property.
#example from TL03: TBL1_PDL2 the most reliable one (this model generally work, but not for RP11 case, from that, I found I need 2n extended. This example is still n extended.)
#PDL2 end: n=3: TTTGAT|CTGAAA
#TBL1 end: n=3: GCTTAC|CTGGAA
#As a result, now, the similarity m=3 on right side.
#If shift 1bp to left on PDL2, it will be TTTGA|TCTGAA then n=0, same as left 2 and 3 bp or right 1,2,3bp.
#If shift 1bp to left on TBL1, it will be GCTTA|CCTGGA then n=0, same as others.
#More complicated situation is move on both end. In which, both move 1bp to right will have n=2.
#In all, it is n*2 pairs of fragments comparing to n*2 pairs of fragments (each move have left and right side.) In these n*2^2 pairs, find the biggest m!

#two things need to be careful, first is string, second is direction.
#default of n is 3 because generally this is enough and 3 is the codon length. n should always be a multiple of 3.(If I want to check n bp around, I need 2n more bp as extended in the input.)

#because I will do the fragment extract, I will do the binucletide check here too.

def span_split_check(infile, outfile, sep_char,frag_size,read_len,fragsize_std):
	#check the parameters
	if infile==None:
		print "infile is not provided"; sys.exit(0)

	if outfile==None:
		print "outfile is not provided"; sys.exit(0)

	#check whether the files provide is there.
	if not os.path.exists(infile):
		print "infile not found"; sys.exit(0)

	h_infile=open(infile,"r")
	h_outfile=open(outfile,"w")

	#read in line by line and filter.
	for line in h_infile:
		items=line.strip().split(sep_char)
		span_n_in=int(items[11])
		split_n_in=int(items[10])
		sum_n_in=int(items[12])
		if span_n_in>=span_n and split_n_in>=split_n and sum_n_in>=sum_n:
			h_outfile.write(line)

	h_infile.close()
	h_outfile.close()

if __name__ == "__main__":
	###Python General Module Import
	import sys, csv, getopt, re
	import os
	import math
	from itertools import ifilter

	###Liye own common function,class loading
	#from Constant_Library import *
	#from General_Library import *
	#from File_Class import *
	#from Sequencing_Library import *
	#
	OUTPUT_SEP_CHAR='\t'

        ###Start of the program
	#exit if not enough arguments
	if len(sys.argv) < 3:
		print __doc__
		sys.exit(0)

	###set default value
	#can use the keys in Constant_Libary as default.
	suffix="txt"
	infile=None
	outfile=None
	#log_path=None
	sep_char='\t'
	#sep_gene=','
	#split_n=1
	#span_n=1
	#sum_n=2
	input_path=os.getcwd()

	###get arguments(parameters)
	#all the names of parameters must in the optlist.
	#all the names can be only one letter!
	optlist, cmd_list = getopt.getopt(sys.argv[1:], 'hi:I:o:s:d:j:l:t:a:u:z')
	for opt in optlist:
		if opt[0] == '-h':
			print __doc__; sys.exit(0)
		elif opt[0] == '-i': infile = opt[1]
		#elif opt[0] == '-I': input_path =opt[1]
		elif opt[0] == '-o': outfile = opt[1]
		#elif opt[0] == '-s': suffix = opt[1]
		#elif opt[0] == '-d': sep_char =opt[1]
		#elif opt[0] == '-j': infile_skip= int(opt[1])
		#elif opt[0] == '-t': split_n = int(opt[1])
		#elif opt[0] == '-a': span_n = int(opt[1])
		#elif opt[0] == '-u': sum_n =int(opt[1])
		#elif opt[0] == '-l': unique_id_length = int(opt[1])
		#elif opt[0] == '-log_p': log_path =opt[1]

	#if not os.path.exists(log_path):
	#	print "log_path not found"; sys.exit(0)

	#prepare files.

	#errorfile=log_path+"error.log"
	#runlogfile=log_path+"run.log"
	#h_errorfile=open(errorfile,"a")
	#h_runfile=open(runlogfile,"a")

	span_split_check(infile, outfile, sep_char)

	#copy the things from shell directly to here.
	#use this to call existing functions.
	#sam_extract_cmd="samtools view "+bam_infile + " " + coor_region +"> "+  outfile_sam
	#subprocess.call(sam_extract_cmd,shell=True)


text:
class MessagesController < WebsocketRails::BaseController
  def create
    msg = current_user.messages.create body: message
    broadcast_message 'messages.create', msg
  end
end


text:
	<TITLE>3rd Party ROBOTC Drivers</TITLE>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>

    3rd Party ROBOTC Drivers

            [Home] [Download] [Submit a bug/suggestion]  [ROBOTC Forums] [Blog] [Support this project]

Data Structures

Here are the data structures with brief descriptions:

blob

mmuxDataT

tClassicCtrl

tGetRequest

tNetworkInfo

tNunchuck

tPostRequest

tPSP

tTCPRequest

tUDPRequest

typeTMR

<address class="footer">Generated on Fri Nov 2 2012 17:45:53 for ROBOTC Drivers by

 1.7.2 </address>


text:
<?xml version="1.0" encoding="UTF-8"?>
<MetaDataObject xmlns="http://v8.1c.ru/8.3/MDClasses" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:cmi="http://v8.1c.ru/8.2/managed-application/cmi" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xen="http://v8.1c.ru/8.3/xcf/enums" xmlns:xpr="http://v8.1c.ru/8.3/xcf/predef" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<Catalog uuid="e1562bd9-3c07-4b45-b171-d34954026b3a">
		<InternalInfo>
			<xr:GeneratedType name="CatalogObject.Товары" category="Object">
				<xr:TypeId>823695df-c9c6-4100-adc3-3a74694422fb</xr:TypeId>
				<xr:ValueId>04e3d626-43af-4327-ab33-fb51b9670c59</xr:ValueId>
			</xr:GeneratedType>
			<xr:GeneratedType name="CatalogRef.Товары" category="Ref">
				<xr:TypeId>6602bd65-2cea-4b14-8d88-ec51b8f5e173</xr:TypeId>
				<xr:ValueId>0970e4f1-60e6-49f9-8a51-bb43865638b3</xr:ValueId>
			</xr:GeneratedType>
			<xr:GeneratedType name="CatalogSelection.Товары" category="Selection">
				<xr:TypeId>b1419003-7288-470c-9ac2-57cb0e3b58bb</xr:TypeId>
				<xr:ValueId>57f88694-2e90-49ec-a05f-3f46dec91bb0</xr:ValueId>
			</xr:GeneratedType>
			<xr:GeneratedType name="CatalogList.Товары" category="List">
				<xr:TypeId>8d5bd1ae-7073-4290-ad74-466737398fce</xr:TypeId>
				<xr:ValueId>fc0a8503-46fa-4b11-9640-6ba1fff1805b</xr:ValueId>
			</xr:GeneratedType>
			<xr:GeneratedType name="CatalogManager.Товары" category="Manager">
				<xr:TypeId>74954ecf-5d01-4b63-9485-267126e3e771</xr:TypeId>
				<xr:ValueId>dacd00a2-28a7-47b5-b957-2152700d2b0f</xr:ValueId>
			</xr:GeneratedType>
		</InternalInfo>
		<Properties>
			<Name>Товары</Name>
			<Synonym>
				<v8:item>
					<v8:lang>ru</v8:lang>
					<v8:content>Товары</v8:content>
				</v8:item>
			</Synonym>
			<Comment/>
			<Hierarchical>false</Hierarchical>
			<HierarchyType>HierarchyFoldersAndItems</HierarchyType>
			<LimitLevelCount>false</LimitLevelCount>
			<LevelCount>2</LevelCount>
			<FoldersOnTop>true</FoldersOnTop>
			<UseStandardCommands>true</UseStandardCommands>
			<Owners/>
			<SubordinationUse>ToItems</SubordinationUse>
			<CodeLength>9</CodeLength>
			<DescriptionLength>50</DescriptionLength>
			<CodeType>String</CodeType>
			<CodeAllowedLength>Variable</CodeAllowedLength>
			<CodeSeries>WholeCatalog</CodeSeries>
			<CheckUnique>true</CheckUnique>
			<Autonumbering>true</Autonumbering>
			<DefaultPresentation>AsDescription</DefaultPresentation>
			<Characteristics/>
			<PredefinedDataUpdate>Auto</PredefinedDataUpdate>
			<EditType>InDialog</EditType>
			<QuickChoice>false</QuickChoice>
			<ChoiceMode>BothWays</ChoiceMode>
			<InputByString>
				<xr:Field>Catalog.Товары.StandardAttribute.Description</xr:Field>
				<xr:Field>Catalog.Товары.StandardAttribute.Code</xr:Field>
			</InputByString>
			<SearchStringModeOnInputByString>Begin</SearchStringModeOnInputByString>
			<FullTextSearchOnInputByString>DontUse</FullTextSearchOnInputByString>
			<ChoiceDataGetModeOnInputByString>Directly</ChoiceDataGetModeOnInputByString>
			<DefaultObjectForm/>
			<DefaultFolderForm/>
			<DefaultListForm/>
			<DefaultChoiceForm/>
			<DefaultFolderChoiceForm/>
			<AuxiliaryObjectForm/>
			<AuxiliaryFolderForm/>
			<AuxiliaryListForm/>
			<AuxiliaryChoiceForm/>
			<AuxiliaryFolderChoiceForm/>
			<IncludeHelpInContents>false</IncludeHelpInContents>
			<BasedOn/>
			<DataLockFields/>
			<DataLockControlMode>Managed</DataLockControlMode>
			<FullTextSearch>Use</FullTextSearch>
			<ObjectPresentation/>
			<ExtendedObjectPresentation/>
			<ListPresentation/>
			<ExtendedListPresentation/>
			<Explanation/>
			<CreateOnInput>Use</CreateOnInput>
			<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
		</Properties>
		<ChildObjects/>
	</Catalog>
</MetaDataObject>


text:
**Namespace:** [OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201705](OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201705.md)
**Assembly:** OfficeDevPnP.Core.dll
## Syntax
```C#
public int AdjustHijriDays { get; set; }
```

### Property Value
Type: System.Int32

## See also
- [RegionalSettings](OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201705.RegionalSettings.md)
- [OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201705](OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201705.md)


text:
// LICENSE : MIT
"use strict";

/* eslint-disable no-console */

/**
 * Logger Utils class
 * Use this instead of `console.log`
 * Main purpose for helping linting.
 */
export class Logger {
    static log(...message: any[]) {
        console.log(...message);
    }

    static warn(...message: any[]) {
        console.warn(...message);
    }

    static error(...message: any[]) {
        console.error(...message);
    }
}

/* eslint-enable no-console */


text:
Orders

Loading orders...

<button id="addOrder">Add new order</button>


text:
from __future__ import print_function

import sys
from google.auth.credentials import AnonymousCredentials
from google.cloud import storage

if len(sys.argv)-1 != 3:
    print('args: PROJECT BUCKET record|replay')
    sys.exit(1)
project = sys.argv[1]
bucket_name = sys.argv[2]
mode = sys.argv[3]

if mode == 'record':
    creds = None  # use default creds for demo purposes; not recommended
    client = storage.Client(project=project)
elif mode == 'replay':
    creds = AnonymousCredentials()
else:
    print('want record or replay')
    sys.exit(1)

client = storage.Client(project=project, credentials=creds)
bucket = client.get_bucket(bucket_name)
print('bucket %s created %s' %(bucket.id, bucket.time_created))


text:
package com.intellij.openapi.roots.ui.configuration.libraries;

import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.roots.LibraryOrderEntry;
import com.intellij.openapi.roots.ModifiableRootModel;
import com.intellij.openapi.roots.libraries.Library;
import com.intellij.openapi.roots.ui.configuration.projectRoot.ModuleStructureConfigurable;
import com.intellij.openapi.roots.ui.configuration.projectRoot.StructureConfigurableContext;

import javax.swing.*;

/**
 * @author nik
 */
public class AddExistingCustomLibraryAction extends CustomLibraryActionBase {
  private Library myLibrary;

  public AddExistingCustomLibraryAction(Library library,
                                        Icon icon,
                                        CustomLibraryCreator creator,
                                        StructureConfigurableContext context,
                                        ModuleStructureConfigurable moduleStructureConfigurable,
                                        Module module) {
    super(library.getName(), null, icon, context, moduleStructureConfigurable, creator, module);
    myLibrary = library;
  }

  @Override
  public void actionPerformed(AnActionEvent e) {
    final ModifiableRootModel rootModel = myContext.getModulesConfigurator().getOrCreateModuleEditor(myModule).getModifiableRootModelProxy();
    if (!askAndRemoveDuplicatedLibraryEntry(myCreator.getDescription(), rootModel)) {
      return;
    }
    final LibraryOrderEntry orderEntry = rootModel.addLibraryEntry(myLibrary);
    myModuleStructureConfigurable.selectOrderEntry(myModule, orderEntry);
  }
}


text:
.class public final Lcom/google/android/gms/internal/ig$d;
.super Lcom/google/android/gms/internal/es;

# interfaces
.implements Lcom/google/android/gms/common/internal/safeparcel/SafeParcelable;
.implements Lcom/google/android/gms/plus/model/people/Person$Name;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/google/android/gms/internal/ig;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x19
    name = "d"
.end annotation

# static fields
.field public static final CREATOR:Lcom/google/android/gms/internal/in;

.field private static final Ep:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap<Ljava/lang/String;Lcom/google/android/gms/internal/es$a<**>;>;"
        }
    .end annotation
.end field

# instance fields
.field private EP:Ljava/lang/String;

.field private ES:Ljava/lang/String;

.field private final Eq:Ljava/util/Set;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Set<Ljava/lang/Integer;>;"
        }
    .end annotation
.end field

.field private FQ:Ljava/lang/String;

.field private FR:Ljava/lang/String;

.field private FS:Ljava/lang/String;

.field private FT:Ljava/lang/String;

.field private final kg:I

# direct methods
.method static constructor <clinit>()V
    .locals 4

    new-instance v0, Lcom/google/android/gms/internal/in;

    invoke-direct {v0}, Lcom/google/android/gms/internal/in;-><init>()V

    sput-object v0, Lcom/google/android/gms/internal/ig$d;->CREATOR:Lcom/google/android/gms/internal/in;

    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    sput-object v0, Lcom/google/android/gms/internal/ig$d;->Ep:Ljava/util/HashMap;

    const-string v1, "familyName"

    const-string v2, "familyName"

    const/4 v3, 0x2

    invoke-static {v2, v3}, Lcom/google/android/gms/internal/es$a;->g(Ljava/lang/String;I)Lcom/google/android/gms/internal/es$a;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    sget-object v0, Lcom/google/android/gms/internal/ig$d;->Ep:Ljava/util/HashMap;

    const-string v1, "formatted"

    const-string v2, "formatted"

    const/4 v3, 0x3

    invoke-static {v2, v3}, Lcom/google/android/gms/internal/es$a;->g(Ljava/lang/String;I)Lcom/google/android/gms/internal/es$a;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    sget-object v0, Lcom/google/android/gms/internal/ig$d;->Ep:Ljava/util/HashMap;

    const-string v1, "givenName"

    const-string v2, "givenName"

    const/4 v3, 0x4

    invoke-static {v2, v3}, Lcom/google/android/gms/internal/es$a;->g(Ljava/lang/String;I)Lcom/google/android/gms/internal/es$a;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    sget-object v0, Lcom/google/android/gms/internal/ig$d;->Ep:Ljava/util/HashMap;

    const-string v1, "honorificPrefix"

    const-string v2, "honorificPrefix"

    const/4 v3, 0x5

    invoke-static {v2, v3}, Lcom/google/android/gms/internal/es$a;->g(Ljava/lang/String;I)Lcom/google/android/gms/internal/es$a;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    sget-object v0, Lcom/google/android/gms/internal/ig$d;->Ep:Ljava/util/HashMap;

    const-string v1, "honorificSuffix"

    const-string v2, "honorificSuffix"

    const/4 v3, 0x6

    invoke-static {v2, v3}, Lcom/google/android/gms/internal/es$a;->g(Ljava/lang/String;I)Lcom/google/android/gms/internal/es$a;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    sget-object v0, Lcom/google/android/gms/internal/ig$d;->Ep:Ljava/util/HashMap;

    const-string v1, "middleName"

    const-string v2, "middleName"

    const/4 v3, 0x7

    invoke-static {v2, v3}, Lcom/google/android/gms/internal/es$a;->g(Ljava/lang/String;I)Lcom/google/android/gms/internal/es$a;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    return-void
.end method

.method public constructor <init>()V
    .locals 1

    invoke-direct {p0}, Lcom/google/android/gms/internal/es;-><init>()V

    const/4 v0, 0x1

    iput v0, p0, Lcom/google/android/gms/internal/ig$d;->kg:I

    new-instance v0, Ljava/util/HashSet;

    invoke-direct {v0}, Ljava/util/HashSet;-><init>()V

    iput-object v0, p0, Lcom/google/android/gms/internal/ig$d;->Eq:Ljava/util/Set;

    return-void
.end method

.method constructor <init>(Ljava/util/Set;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    .locals 0
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(Ljava/util/Set<Ljava/lang/Integer;>;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"
        }
    .end annotation

    invoke-direct {p0}, Lcom/google/android/gms/internal/es;-><init>()V

    iput-object p1, p0, Lcom/google/android/gms/internal/ig$d;->Eq:Ljava/util/Set;

    iput p2, p0, Lcom/google/android/gms/internal/ig$d;->kg:I

    iput-object p3, p0, Lcom/google/android/gms/internal/ig$d;->EP:Ljava/lang/String;

    iput-object p4, p0, Lcom/google/android/gms/internal/ig$d;->FQ:Ljava/lang/String;

    iput-object p5, p0, Lcom/google/android/gms/internal/ig$d;->ES:Ljava/lang/String;

    iput-object p6, p0, Lcom/google/android/gms/internal/ig$d;->FR:Ljava/lang/String;

    iput-object p7, p0, Lcom/google/android/gms/internal/ig$d;->FS:Ljava/lang/String;

    iput-object p8, p0, Lcom/google/android/gms/internal/ig$d;->FT:Ljava/lang/String;

    return-void
.end method

# virtual methods
.method protected final V(Ljava/lang/String;)Ljava/lang/Object;
    .locals 1

    const/4 v0, 0x0

    return-object v0
.end method

.method protected final W(Ljava/lang/String;)Z
    .locals 1

    const/4 v0, 0x0

    return v0
.end method

.method protected final a(Lcom/google/android/gms/internal/es$a;)Z
    .locals 2

    iget-object v0, p0, Lcom/google/android/gms/internal/ig$d;->Eq:Ljava/util/Set;

    invoke-virtual {p1}, Lcom/google/android/gms/internal/es$a;->cq()I

    move-result v1

    invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z

    move-result v0

    return v0
.end method

.method protected final b(Lcom/google/android/gms/internal/es$a;)Ljava/lang/Object;
    .locals 3

    invoke-virtual {p1}, Lcom/google/android/gms/internal/es$a;->cq()I

    move-result v0

    packed-switch v0, :pswitch_data_0

    goto :goto_0

    :pswitch_data_0
    .packed-switch 0x2
        :pswitch_0
        :pswitch_1
        :pswitch_2
        :pswitch_3
        :pswitch_4
        :pswitch_5
    .end packed-switch

    :pswitch_0
    iget-object v0, p0, Lcom/google/android/gms/internal/ig$d;->EP:Ljava/lang/String;

    return-object v0

    :pswitch_1
    iget-object v0, p0, Lcom/google/android/gms/internal/ig$d;->FQ:Ljava/lang/String;

    return-object v0

    :pswitch_2
    iget-object v0, p0, Lcom/google/android/gms/internal/ig$d;->ES:Ljava/lang/String;

    return-object v0

    :pswitch_3
    iget-object v0, p0, Lcom/google/android/gms/internal/ig$d;->FR:Ljava/lang/String;

    return-object v0

    :pswitch_4
    iget-object v0, p0, Lcom/google/android/gms/internal/ig$d;->FS:Ljava/lang/String;

    return-object v0

    :pswitch_5
    iget-object v0, p0, Lcom/google/android/gms/internal/ig$d;->FT:Ljava/lang/String;

    return-object v0

    :goto_0
    new-instance v0, Ljava/lang/IllegalStateException;

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "Unknown safe parcelable id="

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {p1}, Lcom/google/android/gms/internal/es$a;->cq()I

    move-result v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method public final cj()Ljava/util/HashMap;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()Ljava/util/HashMap<Ljava/lang/String;Lcom/google/android/gms/internal/es$a<**>;>;"
        }
    .end annotation

    sget-object v0, Lcom/google/android/gms/internal/ig$d;->Ep:Ljava/util/HashMap;

    return-object v0
.end method

.method public final describeContents()I
    .locals 1

    const/4 v0, 0x0

    return v0
.end method

.method public final equals(Ljava/lang/Object;)Z
    .locals 4

    instance-of v0, p1, Lcom/google/android/gms/internal/ig$d;

    if-nez v0, :cond_0

    const/4 v0, 0x0

    return v0

    :cond_0
    if-ne p0, p1, :cond_1

    const/4 v0, 0x1

    return v0

    :cond_1
    move-object v0, p1

    check-cast v0, Lcom/google/android/gms/internal/ig$d;

    move-object p1, v0

    sget-object v0, Lcom/google/android/gms/internal/ig$d;->Ep:Ljava/util/HashMap;

    invoke-virtual {v0}, Ljava/util/HashMap;->values()Ljava/util/Collection;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :goto_0
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_5

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/google/android/gms/internal/es$a;

    move-object v3, v0

    invoke-virtual {p0, v3}, Lcom/google/android/gms/internal/ig$d;->a(Lcom/google/android/gms/internal/es$a;)Z

    move-result v0

    if-eqz v0, :cond_3

    invoke-virtual {p1, v3}, Lcom/google/android/gms/internal/ig$d;->a(Lcom/google/android/gms/internal/es$a;)Z

    move-result v0

    if-eqz v0, :cond_2

    invoke-virtual {p0, v3}, Lcom/google/android/gms/internal/ig$d;->b(Lcom/google/android/gms/internal/es$a;)Ljava/lang/Object;

    move-result-object v0

    invoke-virtual {p1, v3}, Lcom/google/android/gms/internal/ig$d;->b(Lcom/google/android/gms/internal/es$a;)Ljava/lang/Object;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_4

    const/4 v0, 0x0

    return v0

    :cond_2
    const/4 v0, 0x0

    return v0

    :cond_3
    invoke-virtual {p1, v3}, Lcom/google/android/gms/internal/ig$d;->a(Lcom/google/android/gms/internal/es$a;)Z

    move-result v0

    if-eqz v0, :cond_4

    const/4 v0, 0x0

    return v0

    :cond_4
    goto :goto_0

    :cond_5
    const/4 v0, 0x1

    return v0
.end method

.method public final fK()Lcom/google/android/gms/internal/ig$d;
    .locals 0

    return-object p0
.end method

.method final fa()Ljava/util/Set;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()Ljava/util/Set<Ljava/lang/Integer;>;"
        }
    .end annotation

    iget-object v0, p0, Lcom/google/android/gms/internal/ig$d;->Eq:Ljava/util/Set;

    return-object v0
.end method

.method public final synthetic freeze()Ljava/lang/Object;
    .locals 1

    invoke-virtual {p0}, Lcom/google/android/gms/internal/ig$d;->fK()Lcom/google/android/gms/internal/ig$d;

    move-result-object v0

    return-object v0
.end method

.method public final getFamilyName()Ljava/lang/String;
    .locals 1

    iget-object v0, p0, Lcom/google/android/gms/internal/ig$d;->EP:Ljava/lang/String;

    return-object v0
.end method

.method public final getFormatted()Ljava/lang/String;
    .locals 1

    iget-object v0, p0, Lcom/google/android/gms/internal/ig$d;->FQ:Ljava/lang/String;

    return-object v0
.end method

.method public final getGivenName()Ljava/lang/String;
    .locals 1

    iget-object v0, p0, Lcom/google/android/gms/internal/ig$d;->ES:Ljava/lang/String;

    return-object v0
.end method

.method public final getHonorificPrefix()Ljava/lang/String;
    .locals 1

    iget-object v0, p0, Lcom/google/android/gms/internal/ig$d;->FR:Ljava/lang/String;

    return-object v0
.end method

.method public final getHonorificSuffix()Ljava/lang/String;
    .locals 1

    iget-object v0, p0, Lcom/google/android/gms/internal/ig$d;->FS:Ljava/lang/String;

    return-object v0
.end method

.method public final getMiddleName()Ljava/lang/String;
    .locals 1

    iget-object v0, p0, Lcom/google/android/gms/internal/ig$d;->FT:Ljava/lang/String;

    return-object v0
.end method

.method final getVersionCode()I
    .locals 1

    iget v0, p0, Lcom/google/android/gms/internal/ig$d;->kg:I

    return v0
.end method

.method public final hasFamilyName()Z
    .locals 2

    iget-object v0, p0, Lcom/google/android/gms/internal/ig$d;->Eq:Ljava/util/Set;

    const/4 v1, 0x2

    invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z

    move-result v0

    return v0
.end method

.method public final hasFormatted()Z
    .locals 2

    iget-object v0, p0, Lcom/google/android/gms/internal/ig$d;->Eq:Ljava/util/Set;

    const/4 v1, 0x3

    invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z

    move-result v0

    return v0
.end method

.method public final hasGivenName()Z
    .locals 2

    iget-object v0, p0, Lcom/google/android/gms/internal/ig$d;->Eq:Ljava/util/Set;

    const/4 v1, 0x4

    invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z

    move-result v0

    return v0
.end method

.method public final hasHonorificPrefix()Z
    .locals 2

    iget-object v0, p0, Lcom/google/android/gms/internal/ig$d;->Eq:Ljava/util/Set;

    const/4 v1, 0x5

    invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z

    move-result v0

    return v0
.end method

.method public final hasHonorificSuffix()Z
    .locals 2

    iget-object v0, p0, Lcom/google/android/gms/internal/ig$d;->Eq:Ljava/util/Set;

    const/4 v1, 0x6

    invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z

    move-result v0

    return v0
.end method

.method public final hasMiddleName()Z
    .locals 2

    iget-object v0, p0, Lcom/google/android/gms/internal/ig$d;->Eq:Ljava/util/Set;

    const/4 v1, 0x7

    invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z

    move-result v0

    return v0
.end method

.method public final hashCode()I
    .locals 5

    const/4 v2, 0x0

    sget-object v0, Lcom/google/android/gms/internal/ig$d;->Ep:Ljava/util/HashMap;

    invoke-virtual {v0}, Ljava/util/HashMap;->values()Ljava/util/Collection;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v3

    :goto_0
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_1

    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/google/android/gms/internal/es$a;

    move-object v4, v0

    invoke-virtual {p0, v4}, Lcom/google/android/gms/internal/ig$d;->a(Lcom/google/android/gms/internal/es$a;)Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-virtual {v4}, Lcom/google/android/gms/internal/es$a;->cq()I

    move-result v0

    add-int/2addr v0, v2

    invoke-virtual {p0, v4}, Lcom/google/android/gms/internal/ig$d;->b(Lcom/google/android/gms/internal/es$a;)Ljava/lang/Object;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/Object;->hashCode()I

    move-result v1

    add-int v2, v0, v1

    :cond_0
    goto :goto_0

    :cond_1
    return v2
.end method

.method public final isDataValid()Z
    .locals 1

    const/4 v0, 0x1

    return v0
.end method

.method public final writeToParcel(Landroid/os/Parcel;I)V
    .locals 0

    invoke-static {p0, p1, p2}, Lcom/google/android/gms/internal/in;->a(Lcom/google/android/gms/internal/ig$d;Landroid/os/Parcel;I)V

    return-void
.end method


text:
<?php
use Migrations\AbstractMigration;

class AddAttemptedDateToImports extends AbstractMigration
{
    /**
     * Change Method.
     *
     * More information on this method is available here:
     * http://docs.phinx.org/en/latest/migrations.html#the-change-method
     * @return void
     */
    public function change()
    {
        $table = $this->table('imports');
        $table->addColumn('attempted_date', 'datetime', [
            'default' => null,
            'null' => true,
        ]);
        $table->update();
    }
}