text:
1. Clone this repo using `git clone --depth=1 https://github.com/mattmanske/mmReduxBoilerplate.git`
1. Run `npm run setup` to install dependencies and clean the git repo.

   *We auto-detect `yarn` for installing packages by default, if you wish to force `npm` usage do: `USE_YARN=false npm run setup`*

   *At this point you can run `npm start` to see the example app at `http://localhost:3000`.*
1. Run `npm run clean` to delete the example app.

Now you're ready to rumble!

Start your next react project in seconds

A highly scalable, offline-first foundation with the best DX and a focus on performance and best practices

  Created by Max Stoiber and maintained with ❤ by an amazing team of developers.

## Features

Quick scaffolding

Create components, containers, routes, selectors and sagas - and their tests - right from the CLI!

Instant feedback

Enjoy the best DX (Developer eXperience) and code your app at the speed of thought! Your saved changes to the CSS and JS are reflected instantaneously without refreshing the page. Preserve application state even when you update something in the underlying code!

Predictable state management

Unidirectional data flow allows for change logging and time travel debugging.

Next generation JavaScript

Use template strings, object destructuring, arrow functions, JSX syntax and more, today.

Next generation CSS

Write composable CSS that's co-located with your components for complete modularity. Unique generated class names keep the specificity low while eliminating style clashes. Ship only the styles that are on the page for the best performance.

Industry-standard routing

It's natural to want to add pages (e.g. `/about`) to your application, and routing makes this possible.

Industry-standard i18n internationalization support

Scalable apps need to support multiple languages, easily add and support multiple languages with `react-intl`.

Offline-first

The next frontier in performant web apps: availability without a network connection from the instant your users load the app.

SEO

We support SEO (document head tags management) for search engines that support indexing of JavaScript content. (eg. Google)

But wait... there's more!

  - *The best test setup:* Automatically guarantee code quality and non-breaking
    changes. (Seen a react app with 99% test coverage before?)
  - *Native web app:* Your app's new home? The home screen of your users' phones.
  - *The fastest fonts:* Say goodbye to vacant text.
  - *Stay fast*: Profile your app's performance from the comfort of your command
    line!
  - *Catch problems:* AppVeyor and TravisCI setups included by default, so your
    tests get run automatically on Windows and Unix.

There's also a fantastic video on how to structure your React.js apps with scalability in mind. It provides rationale for the majority of boilerplate's design decisions.

Keywords: React.js, Redux, Hot Reloading, ESNext, Babel, react-router, Offline First, ServiceWorker, `styled-components`, redux-saga, FontFaceObserver

> Please note that this boilerplate is **production-ready and not meant for beginners**! If you're just starting out with react or redux, please refer to https://github.com/petehunt/react-howto instead. If you want a solid, battle-tested base to build your next product upon and have some experience with react, this is the perfect start for you.

## Documentation

- [**The Hitchhikers Guide to `react-boilerplate`**](docs/general/introduction.md): An introduction for newcomers to this boilerplate.
- [Overview](docs/general): A short overview of the included tools
- [**Commands**](docs/general/commands.md): Getting the most out of this boilerplate
- [Testing](docs/testing): How to work with the built-in test harness
- [Styling](docs/css): How to work with the CSS tooling
- [Your app](docs/js): Supercharging your app with Routing, Redux, simple
  asynchronicity helpers, etc.

## Supporters

This project would not be possible without the support by these amazing folks. [**Become a sponsor**](https://opencollective.com/react-boilerplate) to get your company in front of thousands of engaged react developers and help us out!

----

## License

This project is licensed under the MIT license, Copyright (c) 2017 Maximilian
Stoiber. For more information see `LICENSE.md`.


text:
import testModels = require('../../../models/test_models');

var model = [
	new testModels.IssueCommentModel({
		user: "utester",
		repo: "tracker",
		number: 1348,
		result: {
		    "id": 1348,
		    "url": "https://api.github.com/repos/octocat/Hello-World/issues/comments/1348",
		    "html_url": "https://github.com/octocat/Hello-World/issues/1348#issuecomment-1348",
		    "body": "I am using __markdown__.",
		    "user": {
		      "login": "octocat",
		      "id": 1,
		      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
		      "gravatar_id": "somehexcode",
		      "url": "https://api.github.com/users/octocat",
		      "html_url": "https://github.com/octocat",
		      "followers_url": "https://api.github.com/users/octocat/followers",
		      "following_url": "https://api.github.com/users/octocat/following{/other_user}",
		      "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
		      "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
		      "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
		      "organizations_url": "https://api.github.com/users/octocat/orgs",
		      "repos_url": "https://api.github.com/users/octocat/repos",
		      "events_url": "https://api.github.com/users/octocat/events{/privacy}",
		      "received_events_url": "https://api.github.com/users/octocat/received_events",
		      "type": "User",
		      "site_admin": false
		    },
		    "created_at": "2011-04-14T16:00:49Z",
		    "updated_at": "2011-04-14T16:00:49Z"
		  }
	})
];

export = model;

redpajama_set_name: RedPajamaGithub


text:
require 'securerandom'

class AuthMongo
  @@admin_cmd_whitelist = [
    { 'ismaster' => 1 },
    { 'isMaster' => 1 },
    { 'listDatabases' => 1},
    {
      'replSetGetStatus' => 1,
      'forShell' => 1
    }
  ]

  def initialize(config = nil)
    @config = config
    @log = @config[:logger]
    @request_id = 20
    @last_error = {}
  end

  def wire_auth(conn, msg)
    return nil unless msg

    authed, response = auth(conn, msg)

    if !authed
      @last_error[conn] = true
    else
      @last_error[conn] = false
    end

    if response
      return WireMongo::build_reply(response, get_request_id, msg[:header][:requestID])
    else
      return authed
    end
  end

  private

  def reply_motd
    motd = @config[:motd]
    motd = motd.split("\n")
    return true, {
      'totalLinesWritten' => motd.size,
      'log' => motd,
      'ok' => 1.0
    }
  end

  def reply_unauth(db, coll)
    @log.info "replying unauthed for collection #{db}.#{coll}"
    return false, {
      'ok' => 0,
      'n' => 0,
        'code' => 2,
        'errmsg' => 'Writes and Javascript execution are disallowed in this interface.',
      'writeErrors' => {
        'index' => 0,
        'code' => 2,
        'errmsg' => 'Writes and Javascript execution are disallowed in this interface.'
      }
    }
  end

  def reply_error(err)
    return false, {
      'errmsg' => err,
      'ok' => 0.0
    }
  end

  def reply_ok
    return true, {
      'ok' => 1.0
    }
  end

  def get_request_id
    x = @request_id
    @request_id += 1
    return x
  end

  def auth(conn, msg)
    op = msg[:header][:opCode]

    if op == WireMongo::OP_KILL_CURSORS
      return true, nil
    end

    db = msg[:database]
    coll = msg[:collection]
    query = (msg[:query] or {})

    case op
    when WireMongo::OP_QUERY, WireMongo::OP_GET_MORE
      return reply_unauth(db, coll) unless db and coll
      return reply_unauth(db, coll) if query['$where'] != nil

      # handle authentication process
      if coll == '$cmd'

        if query['count']
          # fields key can be nil but must exist
          unless query.size == 3 and query['query'] and query.has_key? 'fields'
            return reply_unauth(db, coll)
          end
          return true, nil

        elsif query['getlasterror'] == 1
          if @last_error[conn]
            return reply_unauth(db, coll)
            @last_error[conn] = false
          else
            return true, nil
          end

        # allow ismaster query, listDatabases query
        elsif db == 'admin'
          if @@admin_cmd_whitelist.include?(query)
            return true, nil
          elsif query['getLog'] == 'startupWarnings'
            if @config[:motd]
              return reply_motd
            else
              return true
            end
          end

        end # if db == 'admin'
        return reply_unauth(db, coll)
      end # if coll == '$cmd'

      return true, nil if coll == 'system.namespaces' # list collections
      return reply_unauth(db, coll) if coll[0] == '$' #other command

      return true, nil

    when WireMongo::OP_UPDATE, WireMongo::OP_INSERT, WireMongo::OP_DELETE
      #return reply_unauth(db, coll)
      return false, nil

    else
      return reply_unauth(db, coll)

    end
  end
end


text:
Write your MySQL query statement below
select Person.FirstName, Person.LastName, Address.City, Address.State from Person left join Address
on Person.PersonId = Address.PersonId;

select p.FirstName, p.LastName, a.City, a.State from Person p left join Address a
on p.PersonId = a.PersonId

-- 以下为测试样例
-- {
--     "headers": {
--         "Person": ["PersonId", "LastName", "FirstName"],
--         "Address": ["AddressId", "PersonId", "City", "State"]
--     },
--     "rows": {
--         "Person": [
--             [1, "Wang", "Allen"]
--         ],
--         "Address": [
--             [1, 2, "New York City", "New York"]
--         ]
--     }
-- }


text:
$.indexWindow.orientationModes = [Titanium.UI.PORTRAIT];
$.indexWindow.open();

function userLogin() {
	var loginController = Alloy.createController('login');
	loginController.show();
}

function userSignUp() {
	var signUpController = Alloy.createController('signUp');
	signUpController.show();
}

$.loginButton.addEventListener("click", function(){
	userLogin();
});

$.signUpButton.addEventListener("click", function(){
	userSignUp();
});


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.cloudpad;

import java.util.List;
import org.junit.After;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.Before;

/**
 *
 * @author phillip
 */
public class FileStorageTest {

    Average average;
    Storable<Average> storage;
    public FileStorageTest() {
    }

    @Before
    public void setUp() throws CourseAlreadyExists, MatterAlreadyExists, ActivityAlreadyExists {
        storage = new FileStorage<>();
        average = new Average(storage);

        //Phillip
        User usuario = new User("Phillip");
        Course bsi = new Course(usuario, "BSI", 10F, 7F);
        Matter redes = new Matter(bsi, "Redes");
        Matter logica = new Matter(bsi, "Lógica");

        Activity listaExercicioRedes = new Activity(redes, "Lista de exercício de redes", 3F);
        Activity testeRedes = new Activity(redes, "Teste de redes", 2F);
        Activity provaRedes = new Activity(redes, "Prova de redes", 5F);

        Activity listaExercicioLogica = new Activity(logica, "Lista de exercício de lógica", 2.5F);
        Activity testeLogica = new Activity(logica, "Teste de lógica", 2.5F);
        Activity provaLogica = new Activity(logica, "Prova de lógica", 5F);

        //Antonio
        User outroUsuario = new User("Antônio");
        Course matematica = new Course(usuario, "Matemática", 10F, 7F);
        Matter calculo1 = new Matter(matematica, "Cálculo 1");
        Matter calculo2 = new Matter(matematica, "Cálculo 2");

        Activity trabalhoCalculo1 = new Activity(calculo1, "Trabaho em equipe", 1F);
        Activity testeCalculo1 = new Activity(calculo1, "Teste de Cálculo 1", 4F);
        Activity provaCalculo1 = new Activity(calculo1, "Prova de Cálculo 1", 5F);

        Activity trabalhoCalculo2 = new Activity(calculo2, "Trabaho em equipe", 2F);
        Activity testeCalculo2 = new Activity(calculo2, "Teste de Cálculo 2", 3F);
        Activity provaCalculo2 = new Activity(calculo2, "Prova de Cálculo 2", 5F);

        average.addUser(usuario);
        average.addUser(outroUsuario);
    }

    @After
    public void tearDown() {
        average = null;
    }

    @Test
    public void testSave(){
        List<User> usersTest = average.getUsers();
        average.save();

        //cleaning
        average = new Average(storage);
        average.refresh();

        assertEquals(usersTest, average.getUsers());

    }

    @Test
    public void testRefresh(){
        List<User> usersTest = average.getUsers();
        //cleaning
        average = new Average(storage);
        average.refresh();

        assertEquals(usersTest, average.getUsers());

    }

}


text:
using System;

namespace Encog.App.Quant.Loader.OpenQuant
{
    public class OpenQuantLoader
    {
        private string instrument = "EURUSD";

        /// <summary>
        ///     Froms the bar series to a double array.
        /// </summary>
        /// <param name="thebarserie">The thebarserie.</param>
        /// <returns></returns>
        public static double[] FromBarSeriestoDouble(IDataSeries thebarserie)
        {
            var outputtedseries = new double[thebarserie.Count];
            int index = 0;
            foreach (Data.Data.Bar abar in thebarserie)
            {
                outputtedseries[index] = abar.Close;
                index++;
            }
            return outputtedseries;
        }

        /// <summary>
        ///     the data loader for openquant.
        /// </summary>
        /// <param name="instrument">The instrument.</param>
        /// <param name="dtfrom">The dtfrom.</param>
        /// <param name="dtto">The dtto.</param>
        /// <param name="barsize">The barsize.</param>
        /// <returns></returns>
        public static LoaderTypes OpenquantDataLoader(string instrument, DateTime dtfrom, DateTime dtto,
                                                      Data.Data.BarType bartype, long barsize)
        {
            var BarSerie = new DataArray();
            Console.WriteLine("Initialized the Openquant-Encog Loader");
            try
            {
                //	BarSerie = this.GetHistoricalBars(dtfrom, dtto, BarType.Time, barsize);
                //	BarSerie = this.GetHistoricalBars(this.MarketDataProvider,Instrument,dtfrom,dtto,(int)barsize);
                // BarSerie = DataManager.GetHistoricalBars(instrument, Data.Data.BarType.Time, 3600);

                var typeLoaded = new LoaderTypes(instrument, dtfrom, dtto, bartype, barsize);
                Console.WriteLine("Loaded Types instrument:" + typeLoaded.Instrument);
                return typeLoaded;
            }
            catch (Exception ex)
            {
                var er = new EncogError(ex);
                Console.WriteLine("Error :" + ex.Message);
                Console.WriteLine("Error :" + ex.StackTrace);
                Console.WriteLine("Error:" + ex.InnerException);
                Console.WriteLine("Full message:" + ex);
                return null;
            }
        }

        public class LoaderTypes
        {
            public LoaderTypes(string instrument, DateTime StartingDate, DateTime ToDate, Data.Data.BarType Type,
                               long SizeOfBars)
            {
                @from = StartingDate;
                to = ToDate;
                Barsize = SizeOfBars;
                Instrument = instrument;
                TypeBar = Type;
            }

            public DateTime from { get; set; }
            public DateTime to { get; set; }
            public long Barsize { get; set; }
            public string Instrument { get; set; }
            public Data.Data.BarType TypeBar { get; set; }
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.bardframework</groupId>
        <artifactId>bard-util</artifactId>
        <version>0.4.0-SNAPSHOT</version>
    </parent>

    <artifactId>bard-user</artifactId>
    <version>0.4.0-SNAPSHOT</version>

    <dependencies>
        <dependency>
            <groupId>com.bardframework</groupId>
            <artifactId>bard-cache</artifactId>
            <version>0.4.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.9</version>
        </dependency>
    </dependencies>

</project>


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>Operator — SymPy 1.0.1.dev documentation</title>

    <link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="http://96.sympy-live-tests.appspot.com/static/live-core.css" type="text/css" />
    <link rel="stylesheet" href="http://96.sympy-live-tests.appspot.com/static/live-autocomplete.css" type="text/css" />
    <link rel="stylesheet" href="http://96.sympy-live-tests.appspot.com/static/live-sphinx.css" type="text/css" />

    <link rel="shortcut icon" href="../../../_static/sympy-notailtext-favicon.ico"/>
    <link rel="top" title="SymPy 1.0.1.dev documentation" href="../../../index.html" />
    <link rel="up" title="Quantum Mechanics" href="index.html" />
    <link rel="next" title="Operator/State Helper Functions" href="operatorset.html" />
    <link rel="prev" title="Hilbert Space" href="hilbert.html" />

  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

Operator¶

Quantum mechanical operators.

TODO:

Fix early 0 in apply_operators.

Debug and test apply_operators.

Get cse working with classes in this file.

Doctests and documentation of special methods for InnerProduct, Commutator,
AntiCommutator, represent, apply_operators.

class sympy.physics.quantum.operator.Operator[source]¶

Base class for non-commuting quantum operators.

An operator maps between quantum states [R420]. In quantum mechanics,
observables (including, but not limited to, measured physical values) are
represented as Hermitian operators [R421].

<col class="field-name" />
<col class="field-body" />

Parameters:
args : tuple

The list of numbers or parameters that uniquely specify the
operator. For time-dependent operators, this will include the time.

References

<colgroup><col class="label" /><col /></colgroup>

[R420]	(1, 2) http://en.wikipedia.org/wiki/Operator_%28physics%29

<colgroup><col class="label" /><col /></colgroup>

[R421]	(1, 2) http://en.wikipedia.org/wiki/Observable

Examples

Create an operator and examine its attributes:

>>> from sympy.physics.quantum import Operator
>>> from sympy import symbols, I
>>> A = Operator('A')
>>> A
A
>>> A.hilbert_space
H
>>> A.label
(A,)
>>> A.is_commutative
False

Create another operator and do some arithmetic operations:

>>> B = Operator('B')
>>> C = 2*A*A + I*B
>>> C
2*A**2 + I*B

Operators don’t commute:

>>> A.is_commutative
False
>>> B.is_commutative
False
>>> A*B == B*A
False

Polymonials of operators respect the commutation properties:

>>> e = (A+B)**3
>>> e.expand()
A*B*A + A*B**2 + A**2*B + A**3 + B*A*B + B*A**2 + B**2*A + B**3

Operator inverses are handle symbolically:

>>> A.inv()
A**(-1)
>>> A*A.inv()
1

class sympy.physics.quantum.operator.HermitianOperator[source]¶

A Hermitian operator that satisfies H == Dagger(H).

<col class="field-name" />
<col class="field-body" />

Parameters:
args : tuple

The list of numbers or parameters that uniquely specify the
operator. For time-dependent operators, this will include the time.

Examples

>>> from sympy.physics.quantum import Dagger, HermitianOperator
>>> H = HermitianOperator('H')
>>> Dagger(H)
H

class sympy.physics.quantum.operator.UnitaryOperator[source]¶

A unitary operator that satisfies U*Dagger(U) == 1.

<col class="field-name" />
<col class="field-body" />

Parameters:
args : tuple

The list of numbers or parameters that uniquely specify the
operator. For time-dependent operators, this will include the time.

Examples

>>> from sympy.physics.quantum import Dagger, UnitaryOperator
>>> U = UnitaryOperator('U')
>>> U*Dagger(U)
1

class sympy.physics.quantum.operator.IdentityOperator(*args, **hints)[source]¶

An identity operator I that satisfies op * I == I * op == op for any
operator op.

<col class="field-name" />
<col class="field-body" />

Parameters:
N : Integer

Optional parameter that specifies the dimension of the Hilbert space
of operator. This is used when generating a matrix representation.

Examples

>>> from sympy.physics.quantum import IdentityOperator
>>> IdentityOperator()
I

class sympy.physics.quantum.operator.OuterProduct[source]¶

An unevaluated outer product between a ket and bra.

This constructs an outer product between any subclass of KetBase and
BraBase as |a><b|. An OuterProduct inherits from Operator as they act as
operators in quantum expressions.  For reference see [R422].

<col class="field-name" />
<col class="field-body" />

Parameters:
ket : KetBase

The ket on the left side of the outer product.

bar : BraBase

The bra on the right side of the outer product.

References

<colgroup><col class="label" /><col /></colgroup>

[R422]	(1, 2) http://en.wikipedia.org/wiki/Outer_product

Examples

Create a simple outer product by hand and take its dagger:

>>> from sympy.physics.quantum import Ket, Bra, OuterProduct, Dagger
>>> from sympy.physics.quantum import Operator

>>> k = Ket('k')
>>> b = Bra('b')
>>> op = OuterProduct(k, b)
>>> op
|k><b|
>>> op.hilbert_space
H
>>> op.ket
|k>
>>> op.bra
<b|
>>> Dagger(op)
|b><k|

In simple products of kets and bras outer products will be automatically
identified and created:

>>> k*b
|k><b|

But in more complex expressions, outer products are not automatically
created:

>>> A = Operator('A')
>>> A*k*b
A*|k>*<b|

A user can force the creation of an outer product in a complex expression
by using parentheses to group the ket and bra:

>>> A*(k*b)
A*|k><b|

bra¶

Return the bra on the right side of the outer product.

ket¶

Return the ket on the left side of the outer product.

class sympy.physics.quantum.operator.DifferentialOperator[source]¶

An operator for representing the differential operator, i.e. d/dx

It is initialized by passing two arguments. The first is an arbitrary
expression that involves a function, such as Derivative(f(x), x). The
second is the function (e.g. f(x)) which we are to replace with the
Wavefunction that this DifferentialOperator is applied to.

<col class="field-name" />
<col class="field-body" />

Parameters:
expr : Expr

The arbitrary expression which the appropriate Wavefunction is to be
substituted into

func : Expr

A function (e.g. f(x)) which is to be replaced with the appropriate
Wavefunction when this DifferentialOperator is applied

Examples

You can define a completely arbitrary expression and specify where the
Wavefunction is to be substituted

>>> from sympy import Derivative, Function, Symbol
>>> from sympy.physics.quantum.operator import DifferentialOperator
>>> from sympy.physics.quantum.state import Wavefunction
>>> from sympy.physics.quantum.qapply import qapply
>>> f = Function('f')
>>> x = Symbol('x')
>>> d = DifferentialOperator(1/x*Derivative(f(x), x), f(x))
>>> w = Wavefunction(x**2, x)
>>> d.function
f(x)
>>> d.variables
(x,)
>>> qapply(d*w)
Wavefunction(2, x)

expr¶

Returns the arbitary expression which is to have the Wavefunction
substituted into it

Examples

>>> from sympy.physics.quantum.operator import DifferentialOperator
>>> from sympy import Function, Symbol, Derivative
>>> x = Symbol('x')
>>> f = Function('f')
>>> d = DifferentialOperator(Derivative(f(x), x), f(x))
>>> d.expr
Derivative(f(x), x)
>>> y = Symbol('y')
>>> d = DifferentialOperator(Derivative(f(x, y), x) +
...                          Derivative(f(x, y), y), f(x, y))
>>> d.expr
Derivative(f(x, y), x) + Derivative(f(x, y), y)

free_symbols¶

Return the free symbols of the expression.

function¶

Returns the function which is to be replaced with the Wavefunction

Examples

>>> from sympy.physics.quantum.operator import DifferentialOperator
>>> from sympy import Function, Symbol, Derivative
>>> x = Symbol('x')
>>> f = Function('f')
>>> d = DifferentialOperator(Derivative(f(x), x), f(x))
>>> d.function
f(x)
>>> y = Symbol('y')
>>> d = DifferentialOperator(Derivative(f(x, y), x) +
...                          Derivative(f(x, y), y), f(x, y))
>>> d.function
f(x, y)

variables¶

Returns the variables with which the function in the specified
arbitrary expression is evaluated

Examples

>>> from sympy.physics.quantum.operator import DifferentialOperator
>>> from sympy import Symbol, Function, Derivative
>>> x = Symbol('x')
>>> f = Function('f')
>>> d = DifferentialOperator(1/x*Derivative(f(x), x), f(x))
>>> d.variables
(x,)
>>> y = Symbol('y')
>>> d = DifferentialOperator(Derivative(f(x, y), x) +
...                          Derivative(f(x, y), y), f(x, y))
>>> d.variables
(x, y)

Related Topics

Documentation overview

SymPy Modules Reference

Physics Module

Quantum Mechanics

Previous: Hilbert Space

Next: Operator/State Helper Functions

This Page

Show Source

Quick search

    <form class="search" action="../../../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

      ©2015 SymPy Development Team.

      |
      Powered by Sphinx 1.4.1
      & Alabaster 0.7.7

      |
      Page source


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace DML_MobgameClient.UI.Panels.Home
{
    /// <summary>
    /// Logika interakcji dla klasy HomeView.xaml
    /// </summary>
    public partial class HomeView : UserControl
    {
        public HomeView()
        {
            InitializeComponent();
        }
    }
}


text:
<?php

namespace Core\Controllers\Cache;

use Core\Controllers\Cache\psr\CacheItemInterface;
use Core\Controllers\Cache\psr\InvalidArgumentException;

/**
 * Class Item.
 */
class Item implements CacheItemInterface
{
	/**
	 * A $redisClient instance this Item used.
	 *
	 * @var RedisClient
	 */
	private $redisClient;

	/**
	 * Cache Item key name.
	 *
	 * @var string
	 */
	private $key;

	/**
	 * Cache Item value.
	 *
	 * @var mixed
	 */
	private $value;

	/**
	 * Cache Item ttl (time to live) in minutes.
	 *
	 * @var float
	 */
	private $ttlSeconds;

	/**
	 * Constructor.
	 *
	 * @param RedisClient $redisClient a RedisClient instance
	 * @param string          $key             Cache Item key name
	 * @param int             $minute          Cache Item expire time
	 */
	public function __construct(RedisClient $redisClient, $key, $ttlSeconds = null)
	{
		$this->setRedisClient($redisClient);
		$this->setKey($key);
		$this->setTtlSeconds($ttlSeconds);
	}

	/**
	 * @return RedisRepository
	 */
	public function getRedisClient()
	{
		return $this->redisClient;
	}

	/**
	 * @param RedisRepository $repository
	 */
	protected function setRedisClient(RedisClient $repository)
	{
		$this->redisClient = $repository;
	}

	/**
	 * Returns the key for the current cache item.
	 *
	 * The key is loaded by the Implementing Library, but should be available to
	 * the higher level callers when needed.
	 *
	 * @return string
	 *                The key string for this cache item.
	 */
	public function getKey()
	{
		return $this->key;
	}

	/**
	 * Set the TTL in seconds for the item. Changes will apply after the item is saved.
	 *
	 * @param int|null seconds
	 *
	 * @return static
	 */
	protected function setTtlSeconds($seconds)
	{
		$this->ttlSeconds = $seconds;

		return $this;
	}

	/**
	 * Retrieves the value of the item from the cache associated with this object's key.
	 *
	 * The value returned must be identical to the value originally stored by set().
	 *
	 * If isHit() returns false, this method MUST return null. Note that null
	 * is a legitimate cached value, so the isHit() method SHOULD be used to
	 * differentiate between "null value was found" and "no value was found."
	 *
	 * @return mixed
	 *               The value corresponding to this cache item's key, or null if not found.
	 */
	public function get()
	{
		if (is_null($this->value)) {
			$this->value = $this->redisClient->get($this->key);
		}

		return $this->value;
	}

	/**
	 * Confirms if the cache item lookup resulted in a cache hit.
	 *
	 * Note: This method MUST NOT have a race condition between calling isHit()
	 * and calling get().
	 *
	 * @return bool
	 *              True if the request resulted in a cache hit. False otherwise.
	 */
	public function isHit()
	{
		return $this->redisClient->exists($this->key);
	}

	/**
	 * Sets the value represented by this cache item.
	 *
	 * The $value argument may be any item that can be serialized by PHP,
	 * although the method of serialization is left up to the Implementing
	 * Library.
	 *
	 * @param mixed $value
	 *                     The serializable value to be stored.
	 *
	 * @return static
	 *                The invoked object.
	 */
	public function set($value)
	{
		$this->value = $value;

		return $this;
	}

	/**
	 * Sets the expiration time for this cache item.
	 *
	 * @param \DateTimeInterface $expiration
	 *                                       The point in time after which the item MUST be considered expired.
	 *                                       If null is passed explicitly, a default value MAY be used. If none is set,
	 *                                       the value should be stored permanently or for as long as the
	 *                                       implementation allows.
	 *
	 * @return static
	 *                The called object.
	 */
	public function expiresAt($expiration)
	{
		if (!($expiration instanceof \DateTimeInterface || $expiration instanceof \DateTime)) {
			throw new InvalidArgumentException('expiration argument must inherit DateTimeInterface');
		}

		$now = new \DateTime();

		return $this->setTtlSeconds(($expiration->getTimestamp() - $now->getTimestamp()));
	}

	/**
	 * Sets the expiration time for this cache item.
	 *
	 * @param int|\DateInterval $time
	 *                                The period of time from the present after which the item MUST be considered
	 *                                expired. An integer parameter is understood to be the time in seconds until
	 *                                expiration. If null is passed explicitly, a default value MAY be used.
	 *                                If none is set, the value should be stored permanently or for as long as the
	 *                                implementation allows.
	 *
	 * @return static
	 *                The called object.
	 */
	public function expiresAfter($time)
	{
		if (!is_int($time) && !($time instanceof \DateInterval)) {
			throw new InvalidArgumentException('time argument must be int or DateInterval');
		}

		// Convert DateInterval to minutes
		if ($time instanceof \DateInterval) {
			$now = new \DateTime();
			$end = clone $now;
			$end->add($time);
			$time = $end->getTimestamp() - $now->getTimestamp();
		}

		return $this->setTtlSeconds($time);
	}

	/**
	 * Save the Item to the database;.
	 *
	 * @return static
	 *                The called object.
	 */
	public function save() {
		$serializedValue = is_numeric($this->value) ? $this->value : serialize($this->value);
		if (is_null($this->ttlSeconds)) {
			$this->redisClient->set($this->key, $serializedValue);
		} else {
			$this->redisClient->setex($this->key, floatval($this->ttlSeconds), $serializedValue);
		}

		return $this;
	}
}


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

namespace AlgorithmLibraries
{
    public class Search
    {
        public string SubstringSearch(string toSearch, string srchStr)
        {
            return "";
        }
    }
}


text:
import {Component, Input} from '@angular/core';
import {ImageDocument} from 'idai-field-core';

@Component({
    selector: 'image-grid-cell',
    templateUrl: './image-grid-cell.html'
})
/**
 * @author Daniel de Oliveira
 * @author Sebastian Cuy
 * @author Thomas Kleinke
 */
export class ImageGridCellComponent {

    @Input() cell: any;
    @Input() main: ImageDocument;
    @Input() showLinkBadges: boolean = true;
    @Input() showIdentifier: boolean = true;
    @Input() showShortDescription: boolean = true;
    @Input() showGeoIcon: boolean = false;
    @Input() resourceIdentifiers: {[id: string]: string} = {};
    @Input() nrOfColumns: number = 0;

    public getIdentifier(id: string): string|undefined {

        if (!this.resourceIdentifiers ||
            (Object.keys(this.resourceIdentifiers).length < 1)) {
            return undefined;
        }
        return this.resourceIdentifiers[id];
    }
}


text:
<?php

return Innmind\CodingStandard\CodingStandard::config(['src', 'tests', 'fixtures']);


text:
package vgrechka.phizdetsidea.phizdets.documentation.docstrings;

import com.intellij.openapi.util.text.StringUtil;
import vgrechka.phizdetsidea.phizdets.psi.PyIndentUtil;
import vgrechka.phizdetsidea.phizdets.toolbox.Substring;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Collections;
import java.util.List;

/**
 * @author Mikhail Golubev
 */
public abstract class DocStringLineParser {
  protected final List<Substring> myLines;
  protected final Substring myDocStringContent;

  protected DocStringLineParser(@NotNull Substring content) {
    myDocStringContent = content;
    myLines = Collections.unmodifiableList(content.splitLines());
  }

  public int getLineIndentSize(int lineNum) {
    return PyIndentUtil.getLineIndentSize(getLine(lineNum));
  }

  @NotNull
  public String getLineIndent(int lineNum) {
    return PyIndentUtil.getLineIndent(getLine(lineNum)).toString();
  }

  public boolean isEmptyOrDoesNotExist(int lineNum) {
    return lineNum < 0 || lineNum >= myLines.size() || isEmpty(lineNum);
  }

  public boolean isEmpty(int lineNum) {
    return StringUtil.isEmptyOrSpaces(getLine(lineNum));
  }

  @NotNull
  public Substring getLine(int lineNum) {
    return myLines.get(lineNum);
  }

  @Nullable
  public Substring getLineOrNull(int lineNum) {
    return lineNum >= 0 && lineNum < myLines.size() ? myLines.get(lineNum) : null;
  }

  public int getLineCount() {
    return myLines.size();
  }

  @NotNull
  public List<Substring> getLines() {
    return myLines;
  }

  @NotNull
  public Substring getDocStringContent() {
    return myDocStringContent;
  }

  /**
   * Finds line number of the line next after the end of indented block, i.e. if returned value equals startLine,
   * it means that no block with requested indentation exist. Block can contain intermediate empty lines or lines that consists
   * solely of spaces: their indentation is ignored, but it always ends with non-empty line. Non-empty lines in a block must
   * have indentation greater than indentThreshold and for them {@link #isBlockEnd(int)} must return false.
   *
   * @param indentThreshold indentation size of non-empty line that will break block once reached, i.e. minimum possible indentation
   *                        inside a block is {@code indentThreshold + 1}
   */
  public int consumeIndentedBlock(int startLine, int indentThreshold) {
    int blockEnd = startLine - 1;
    int lineNum = startLine;
    while (lineNum < getLineCount() && !isBlockEnd(lineNum)) {
      if (!isEmpty(lineNum)) {
        if (getLineIndentSize(lineNum) > indentThreshold) {
          blockEnd = lineNum;
        }
        else {
          break;
        }
      }
      lineNum++;
    }
    return blockEnd + 1;
  }

  public int consumeEmptyLines(int lineNum) {
    while (lineNum < getLineCount() && isEmpty(lineNum)) {
      lineNum++;
    }
    return lineNum;
  }

  protected abstract boolean isBlockEnd(int lineNum);
}


text:
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.CompilerServices;

namespace Microsoft.CodeAnalysis
{
    /// <summary>
    /// Specifies the Ids of special runtime types.
    /// </summary>
    /// <remarks>
    /// Only types explicitly mentioned in "Co-located core types" spec
    /// (http://devdiv/sites/docs/Dev11/CLR/Specs/CoreFx/Co-located%20core%20types.docx)
    /// can be in this enum.
    /// The following things should be in sync:
    ///     1) SpecialType enum
    ///     2) names in SpecialTypes.EmittedNames array.
    /// </remarks>
    public enum SpecialType : sbyte
    {
        /// <summary>
        /// Indicates a non-special type (default value).
        /// </summary>
        None = 0,

        /// <summary>
        /// Indicates that the type is <see cref="object"/>.
        /// </summary>
        System_Object = 1,

        /// <summary>
        /// Indicates that the type is <see cref="Enum"/>.
        /// </summary>
        System_Enum = 2,

        /// <summary>
        /// Indicates that the type is <see cref="MulticastDelegate"/>.
        /// </summary>
        System_MulticastDelegate = 3,

        /// <summary>
        /// Indicates that the type is <see cref="Delegate"/>.
        /// </summary>
        System_Delegate = 4,

        /// <summary>
        /// Indicates that the type is <see cref="ValueType"/>.
        /// </summary>
        System_ValueType = 5,

        /// <summary>
        /// Indicates that the type is <see cref="void"/>.
        /// </summary>
        System_Void = 6,

        /// <summary>
        /// Indicates that the type is <see cref="bool"/>.
        /// </summary>
        System_Boolean = 7,

        /// <summary>
        /// Indicates that the type is <see cref="char"/>.
        /// </summary>
        System_Char = 8,

        /// <summary>
        /// Indicates that the type is <see cref="sbyte"/>.
        /// </summary>
        System_SByte = 9,

        /// <summary>
        /// Indicates that the type is <see cref="byte"/>.
        /// </summary>
        System_Byte = 10,

        /// <summary>
        /// Indicates that the type is <see cref="short"/>.
        /// </summary>
        System_Int16 = 11,

        /// <summary>
        /// Indicates that the type is <see cref="ushort"/>.
        /// </summary>
        System_UInt16 = 12,

        /// <summary>
        /// Indicates that the type is <see cref="int"/>.
        /// </summary>
        System_Int32 = 13,

        /// <summary>
        /// Indicates that the type is <see cref="uint"/>.
        /// </summary>
        System_UInt32 = 14,

        /// <summary>
        /// Indicates that the type is <see cref="long"/>.
        /// </summary>
        System_Int64 = 15,

        /// <summary>
        /// Indicates that the type is <see cref="ulong"/>.
        /// </summary>
        System_UInt64 = 16,

        /// <summary>
        /// Indicates that the type is <see cref="decimal"/>.
        /// </summary>
        System_Decimal = 17,

        /// <summary>
        /// Indicates that the type is <see cref="float"/>.
        /// </summary>
        System_Single = 18,

        /// <summary>
        /// Indicates that the type is <see cref="double"/>.
        /// </summary>
        System_Double = 19,

        /// <summary>
        /// Indicates that the type is <see cref="string"/>.
        /// </summary>
        System_String = 20,

        /// <summary>
        /// Indicates that the type is <see cref="IntPtr" />.
        /// </summary>
        System_IntPtr = 21,

        /// <summary>
        /// Indicates that the type is <see cref="UIntPtr"/>.
        /// </summary>
        System_UIntPtr = 22,

        /// <summary>
        /// Indicates that the type is <see cref="Array"/>.
        /// </summary>
        System_Array = 23,

        /// <summary>
        /// Indicates that the type is <see cref="IEnumerable"/>.
        /// </summary>
        System_Collections_IEnumerable = 24,

        /// <summary>
        /// Indicates that the type is <see cref="IEnumerable{T}"/>.
        /// </summary>
        System_Collections_Generic_IEnumerable_T = 25, // Note: IEnumerable<int> (i.e. constructed type) has no special type

        /// <summary>
        /// Indicates that the type is <see cref="IList{T}"/>.
        /// </summary>
        System_Collections_Generic_IList_T = 26,

        /// <summary>
        /// Indicates that the type is <see cref="ICollection{T}"/>.
        /// </summary>
        System_Collections_Generic_ICollection_T = 27,

        /// <summary>
        /// Indicates that the type is <see cref="IEnumerator"/>.
        /// </summary>
        System_Collections_IEnumerator = 28,

        /// <summary>
        /// Indicates that the type is <see cref="IEnumerator{T}"/>.
        /// </summary>
        System_Collections_Generic_IEnumerator_T = 29,

        /// <summary>
        /// Indicates that the type is <see cref="IReadOnlyList{T}"/>.
        /// </summary>
        System_Collections_Generic_IReadOnlyList_T = 30,

        /// <summary>
        /// Indicates that the type is <see cref="IReadOnlyCollection{T}"/>.
        /// </summary>
        System_Collections_Generic_IReadOnlyCollection_T = 31,

        /// <summary>
        /// Indicates that the type is <see cref="Nullable{T}"/>.
        /// </summary>
        System_Nullable_T = 32,

        /// <summary>
        /// Indicates that the type is <see cref="DateTime"/>.
        /// </summary>
        System_DateTime = 33,

        /// <summary>
        /// Indicates that the type is <see cref="IsVolatile"/>.
        /// </summary>
        System_Runtime_CompilerServices_IsVolatile = 34,

        /// <summary>
        /// Indicates that the type is <see cref="IDisposable"/>.
        /// </summary>
        System_IDisposable = 35,

#pragma warning disable RS0010
        /// <summary>
        /// Indicates that the type is <see cref="T:System.TypedReference"/>.
        /// </summary>
#pragma warning restore RS0010
        System_TypedReference = 36,

#pragma warning disable RS0010
        /// <summary>
        /// Indicates that the type is <see cref="T:System.ArgIterator"/>.
        /// </summary>
#pragma warning restore RS0010
        System_ArgIterator = 37,

#pragma warning disable RS0010
        /// <summary>
        /// Indicates that the type is <see cref="T:System.RuntimeArgumentHandle"/>.
        /// </summary>
#pragma warning restore RS0010
        System_RuntimeArgumentHandle = 38,

        /// <summary>
        /// Indicates that the type is <see cref="RuntimeFieldHandle"/>.
        /// </summary>
        System_RuntimeFieldHandle = 39,

        /// <summary>
        /// Indicates that the type is <see cref="RuntimeMethodHandle"/>.
        /// </summary>
        System_RuntimeMethodHandle = 40,

        /// <summary>
        /// Indicates that the type is <see cref="RuntimeTypeHandle"/>.
        /// </summary>
        System_RuntimeTypeHandle = 41,

        /// <summary>
        /// Indicates that the type is <see cref="IAsyncResult"/>.
        /// </summary>
        System_IAsyncResult = 42,

        /// <summary>
        /// Indicates that the type is <see cref="AsyncCallback"/>.
        /// </summary>
        System_AsyncCallback = 43,

        /// <summary>
        /// Count of special types. This is not a count of enum members.
        /// </summary>
        Count = System_AsyncCallback
    }
}


text:
using namespace std;
Truck::Truck(){
    //cout<<"Truck @ .c"<<endl;
}

VehicleSize Truck::getSize(){
    //cout<<"[T]"<<endl;
    return VehicleSize::Large;
}


text:
/*
 * src/tools/ifaddrs/test_ifaddrs.c
 *
 *
 *	test_ifaddrs.c
 *		test pg_foreach_ifaddr()
 */

#include "postgres.h"

#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/socket.h>

#include "libpq/ip.h"

static void
print_addr(struct sockaddr * addr)
{
	char		buffer[256];
	int			ret,
				len;

	switch (addr->sa_family)
	{
		case AF_INET:
			len = sizeof(struct sockaddr_in);
			break;
#ifdef HAVE_IPV6
		case AF_INET6:
			len = sizeof(struct sockaddr_in6);
			break;
#endif
		default:
			len = sizeof(struct sockaddr_storage);
			break;
	}

	ret = getnameinfo(addr, len, buffer, sizeof(buffer), NULL, 0,
					  NI_NUMERICHOST);
	if (ret != 0)
		printf("[unknown: family %d]", addr->sa_family);
	else
		printf("%s", buffer);
}

static void
callback(struct sockaddr * addr, struct sockaddr * mask, void *unused)
{
	printf("addr: ");
	print_addr(addr);
	printf("  mask: ");
	print_addr(mask);
	printf("\n");
}

int
main(int argc, char *argv[])
{
#ifdef WIN32
	WSADATA		wsaData;

	if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0)
	{
		fprintf(stderr, "WSAStartup failed\n");
		return 1;
	}
#endif

	if (pg_foreach_ifaddr(callback, NULL) < 0)
		fprintf(stderr, "pg_foreach_ifaddr failed: %s\n", strerror(errno));
	return 0;
}


text:
export declare type ScrollPosition = {
    x: number;
    y: number;
};
export declare type ViewportSize = {
    width: number;
    height: number;
};
export interface ScrollMapItem {
    getDistance(viewportSize: ViewportSize): number;
    getPosition(viewportSize: ViewportSize, progress: number): ScrollPosition;
    getElementScrollPosition(element: HTMLElement): number;
    getDirection(): number;
    onLayoutUpdated(): void;
}


text:
import {Component, Input} from '@angular/core';
import {UserService} from '../services/user.service';
import {UserView} from "./user-view";
import {ActivatedRoute, Params} from '@angular/router'

@Component({
    selector: 'user',
    providers: [UserService],
    template: `

Loading user...

            <user-view [user]="user"></user-view>

            Show all users

    `
})
export class UserComponent {

    @Input() private user:any;

    constructor(service:UserService, route: ActivatedRoute) {
        route.params.forEach((params: Params) => {
            var userId = params["id"];
            if (userId) {
                service.get(userId).subscribe(user =>  this.user = user);
            }
        });
    }

}


text:
#pragma once

#include <memory>

#include <globjects/base/ref_ptr.h>

#include <gloperate/painter/Painter.h>

#include <gloperate-qt/viewer/QtOpenGLWindowBase.h>
#include <gloperate-qt/viewer/TimePropagator.h>

namespace gloperate
{
    class ResourceManager;
}

namespace gloperate_qt
{

class TimerApi;

/**
*  @brief
*    Qt window that can be used for rendering with gloperate and OpenGL
*
*    This is the main rendering widget that displays a gloperate::Painter
*    within a Qt application. It contains only the rendering widget itself,
*    no other components. For a fully-fledged application template, see
*    gloperate_qt::Viewer.
*/
class GLOPERATE_QT_API QtOpenGLWindow : public QtOpenGLWindowBase
{
public:
    /**
    *  @brief
    *    Constructor
    *
    *  @param[in] resourceManager
    *    Manager for loading/saving resources (i.e., textures, scenes)
    */
    QtOpenGLWindow(gloperate::ResourceManager & resourceManager);

    /**
    *  @brief
    *    Constructor
    *
    *  @param[in] resourceManager
    *    Manager for loading/saving resources (i.e., textures, scenes)
    *  @param[in] format
    *    Surface format
    */
    QtOpenGLWindow(gloperate::ResourceManager & resourceManager, const QSurfaceFormat & format);

    /**
    *  @brief
    *    Destructor
    */
    virtual ~QtOpenGLWindow();

    /**
    *  @brief
    *    Get used painter
    *
    *  @return
    *    Painter, can be nullptr
    */
    gloperate::Painter * painter() const;

    /**
    *  @brief
    *    Set used painter
    *
    *  @param[in] painter
    *    Painter, can be nullptr
    */
    void setPainter(gloperate::Painter * painter);

    /**
    *  @brief
    *    Set scripting timer API
    *
    *  @param[in] timerAPI
    *    Scripting timer API, can be nullptr
    *
    *  @remarks
    *    This is necessary to propagate the
    *    nextTick-event to the timer API.
    */
    void setTimerApi(TimerApi * timerApi);

protected:
    virtual void onInitialize() override;
    virtual void onResize(QResizeEvent * event) override;
    virtual void onPaint() override;
    virtual void keyPressEvent(QKeyEvent * event) override;
    virtual void keyReleaseEvent(QKeyEvent * event) override;
    virtual void mouseMoveEvent(QMouseEvent * event) override;
    virtual void mousePressEvent(QMouseEvent * event) override;
    virtual void mouseReleaseEvent(QMouseEvent * event) override;
    virtual void mouseDoubleClickEvent(QMouseEvent * event) override;
    virtual void wheelEvent(QWheelEvent * event) override;

protected:
    gloperate::ResourceManager & m_resourceManager;
    gloperate::Painter * m_painter;                    ///< Currently used painter
    std::unique_ptr<TimePropagator> m_timePropagator;  ///< Time propagator for continous updates
    TimerApi * m_timerApi;                             ///< Scripting timer API
};

} // namespace gloperate-qt


text:
/**
 * RateExceededError.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter.
 */

package com.google.api.ads.adwords.axis.v201506.cm;

/**
 * Signals that a call failed because a measured rate exceeded.
 */
public class RateExceededError  extends com.google.api.ads.adwords.axis.v201506.cm.ApiError  implements java.io.Serializable {
    /* The error reason represented by an enum. */
    private com.google.api.ads.adwords.axis.v201506.cm.RateExceededErrorReason reason;

    /* Cause of the rate exceeded error. */
    private java.lang.String rateName;

    /* The scope of the rate (ACCOUNT/DEVELOPER). */
    private java.lang.String rateScope;

    /* The amount of time (in seconds) the client should wait before
     * retrying the request. */
    private java.lang.Integer retryAfterSeconds;

    public RateExceededError() {
    }

    public RateExceededError(
           java.lang.String fieldPath,
           java.lang.String trigger,
           java.lang.String errorString,
           java.lang.String apiErrorType,
           com.google.api.ads.adwords.axis.v201506.cm.RateExceededErrorReason reason,
           java.lang.String rateName,
           java.lang.String rateScope,
           java.lang.Integer retryAfterSeconds) {
        super(
            fieldPath,
            trigger,
            errorString,
            apiErrorType);
        this.reason = reason;
        this.rateName = rateName;
        this.rateScope = rateScope;
        this.retryAfterSeconds = retryAfterSeconds;
    }

    /**
     * Gets the reason value for this RateExceededError.
     *
     * @return reason   * The error reason represented by an enum.
     */
    public com.google.api.ads.adwords.axis.v201506.cm.RateExceededErrorReason getReason() {
        return reason;
    }

    /**
     * Sets the reason value for this RateExceededError.
     *
     * @param reason   * The error reason represented by an enum.
     */
    public void setReason(com.google.api.ads.adwords.axis.v201506.cm.RateExceededErrorReason reason) {
        this.reason = reason;
    }

    /**
     * Gets the rateName value for this RateExceededError.
     *
     * @return rateName   * Cause of the rate exceeded error.
     */
    public java.lang.String getRateName() {
        return rateName;
    }

    /**
     * Sets the rateName value for this RateExceededError.
     *
     * @param rateName   * Cause of the rate exceeded error.
     */
    public void setRateName(java.lang.String rateName) {
        this.rateName = rateName;
    }

    /**
     * Gets the rateScope value for this RateExceededError.
     *
     * @return rateScope   * The scope of the rate (ACCOUNT/DEVELOPER).
     */
    public java.lang.String getRateScope() {
        return rateScope;
    }

    /**
     * Sets the rateScope value for this RateExceededError.
     *
     * @param rateScope   * The scope of the rate (ACCOUNT/DEVELOPER).
     */
    public void setRateScope(java.lang.String rateScope) {
        this.rateScope = rateScope;
    }

    /**
     * Gets the retryAfterSeconds value for this RateExceededError.
     *
     * @return retryAfterSeconds   * The amount of time (in seconds) the client should wait before
     * retrying the request.
     */
    public java.lang.Integer getRetryAfterSeconds() {
        return retryAfterSeconds;
    }

    /**
     * Sets the retryAfterSeconds value for this RateExceededError.
     *
     * @param retryAfterSeconds   * The amount of time (in seconds) the client should wait before
     * retrying the request.
     */
    public void setRetryAfterSeconds(java.lang.Integer retryAfterSeconds) {
        this.retryAfterSeconds = retryAfterSeconds;
    }

    private java.lang.Object __equalsCalc = null;
    public synchronized boolean equals(java.lang.Object obj) {
        if (!(obj instanceof RateExceededError)) return false;
        RateExceededError other = (RateExceededError) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = super.equals(obj) &&
            ((this.reason==null && other.getReason()==null) ||
             (this.reason!=null &&
              this.reason.equals(other.getReason()))) &&
            ((this.rateName==null && other.getRateName()==null) ||
             (this.rateName!=null &&
              this.rateName.equals(other.getRateName()))) &&
            ((this.rateScope==null && other.getRateScope()==null) ||
             (this.rateScope!=null &&
              this.rateScope.equals(other.getRateScope()))) &&
            ((this.retryAfterSeconds==null && other.getRetryAfterSeconds()==null) ||
             (this.retryAfterSeconds!=null &&
              this.retryAfterSeconds.equals(other.getRetryAfterSeconds())));
        __equalsCalc = null;
        return _equals;
    }

    private boolean __hashCodeCalc = false;
    public synchronized int hashCode() {
        if (__hashCodeCalc) {
            return 0;
        }
        __hashCodeCalc = true;
        int _hashCode = super.hashCode();
        if (getReason() != null) {
            _hashCode += getReason().hashCode();
        }
        if (getRateName() != null) {
            _hashCode += getRateName().hashCode();
        }
        if (getRateScope() != null) {
            _hashCode += getRateScope().hashCode();
        }
        if (getRetryAfterSeconds() != null) {
            _hashCode += getRetryAfterSeconds().hashCode();
        }
        __hashCodeCalc = false;
        return _hashCode;
    }

    // Type metadata
    private static org.apache.axis.description.TypeDesc typeDesc =
        new org.apache.axis.description.TypeDesc(RateExceededError.class, true);

    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201506", "RateExceededError"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("reason");
        elemField.setXmlName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201506", "reason"));
        elemField.setXmlType(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201506", "RateExceededError.Reason"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("rateName");
        elemField.setXmlName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201506", "rateName"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("rateScope");
        elemField.setXmlName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201506", "rateScope"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("retryAfterSeconds");
        elemField.setXmlName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201506", "retryAfterSeconds"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
    }

    /**
     * Return type metadata object
     */
    public static org.apache.axis.description.TypeDesc getTypeDesc() {
        return typeDesc;
    }

    /**
     * Get Custom Serializer
     */
    public static org.apache.axis.encoding.Serializer getSerializer(
           java.lang.String mechType,
           java.lang.Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanSerializer(
            _javaType, _xmlType, typeDesc);
    }

    /**
     * Get Custom Deserializer
     */
    public static org.apache.axis.encoding.Deserializer getDeserializer(
           java.lang.String mechType,
           java.lang.Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanDeserializer(
            _javaType, _xmlType, typeDesc);
    }

}


text:
<sect1 id="MatchPS">
<title><literal>MatchPS</literal>: The Perl-like matching interface
<indexterm><primary>MatchPS library (misc syslib)</primary></indexterm>
</title>

<para>The <literal>MatchPS</literal> library is no longer available,
please use <ulink
url="../libraries/base/Text.Regex.html"><literal>Text.Regex</literal></ulink>
instead.</para>

</sect1>


text:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEditor;
using UnityEditor.SceneManagement;

public class SceneManagerWindow : EditorWindow
{

	protected Vector2 scrollPosition;
	protected NewSceneSetup newSceneSetup = NewSceneSetup.DefaultGameObjects;
	protected NewSceneMode newSceneMode = NewSceneMode.Single;
	protected OpenSceneMode openSceneMode = OpenSceneMode.Single;
	protected bool showPath = false;
	protected bool showAddToBuild = true;
	protected bool askBeforeDelete = true;
	protected bool [] selectedScenes;
	protected string [] guids;

	[MenuItem ( "Tools/Scene Manager" )]
	public static void Init ()
	{
		var window = EditorWindow.GetWindow<SceneManagerWindow> ( "Scene Manager" );
		window.Show ();
	}

	protected virtual void OnGUI ()
	{
		List<EditorBuildSettingsScene> buildScenes = new List<EditorBuildSettingsScene> ( EditorBuildSettings.scenes );
		GUILayout.Label ( "Scenes", EditorStyles.boldLabel );
		this.guids = AssetDatabase.FindAssets ( "t:Scene" );
		if ( this.selectedScenes == null || this.selectedScenes.Length != guids.Length )
		{
			this.selectedScenes = new bool[guids.Length];
		}
		this.scrollPosition = EditorGUILayout.BeginScrollView ( this.scrollPosition );
		EditorGUILayout.BeginVertical ();
		for ( int i = 0; i < guids.Length; i++ )
		{
			string path = AssetDatabase.GUIDToAssetPath ( guids [ i ] );
			SceneAsset sceneAsset = AssetDatabase.LoadAssetAtPath<SceneAsset> ( path );
			EditorBuildSettingsScene buildScene = buildScenes.Find ( (editorBuildScene ) =>
			{
				return editorBuildScene.path == path;
			} );
			Scene scene = SceneManager.GetSceneByPath ( path );
			bool isOpen = scene.IsValid () && scene.isLoaded;
			EditorGUILayout.BeginHorizontal ();
			this.selectedScenes [ i ] = EditorGUILayout.Toggle ( this.selectedScenes [ i ], GUILayout.Width ( 15 ) );
			if ( isOpen )
			{
				GUILayout.Label ( sceneAsset.name, EditorStyles.whiteLabel );
			}
			else
			{
				GUILayout.Label ( sceneAsset.name, EditorStyles.wordWrappedLabel );
			}
			if ( this.showPath )
			{
				GUILayout.Label ( path, EditorStyles.wordWrappedLabel );
			}
			if ( buildScene == null )
			{
				if ( this.showAddToBuild )
				{
					if ( GUILayout.Button ( "Add to Build" ) )
					{
						AddToBuild ( path );
					}
				}
			}
			if ( GUILayout.Button ( isOpen ? "Close" : "Open", GUILayout.Width ( 50 ) ) )
			{
				if ( isOpen )
				{
					EditorSceneManager.CloseScene ( scene, true );
				}
				else
				{
					Open ( path );
				}
			}
			if ( GUILayout.Button ( "Delete", GUILayout.Width ( 50 ) ) )
			{
				Delete ( path );
			}
			EditorGUILayout.EndHorizontal ();
		}
		if ( GUILayout.Button ( "Create New Scene" ) )
		{
			Scene newScene = EditorSceneManager.NewScene ( this.newSceneSetup, this.newSceneMode );
			EditorSceneManager.SaveScene ( newScene );
		}
		EditorGUILayout.EndVertical ();
		EditorGUILayout.EndScrollView ();
		GUILayout.Label ( "Bulk Actions", EditorStyles.boldLabel );
		bool anySelected = false;
		for ( int i = 0; i < this.selectedScenes.Length; i++ )
		{
			anySelected |= this.selectedScenes [ i ];
		}
		GUI.enabled = anySelected;
		EditorGUILayout.BeginHorizontal ();
		if ( GUILayout.Button ( "Delete" ) )
		{
			for ( int i = 0; i < this.selectedScenes.Length; i++ )
			{
				if ( this.selectedScenes [ i ] )
				{
					Delete ( AssetDatabase.GUIDToAssetPath ( this.guids [ i ] ) );
				}
			}
		}
		if ( GUILayout.Button ( "Open Additive" ) )
		{
			OpenSceneMode openMode = this.openSceneMode;
			this.openSceneMode = OpenSceneMode.Additive;
			for ( int i = 0; i < this.selectedScenes.Length; i++ )
			{
				if ( this.selectedScenes [ i ] )
				{
					Open ( AssetDatabase.GUIDToAssetPath ( this.guids [ i ] ) );
				}
			}
			this.openSceneMode = openMode;
		}
		EditorGUILayout.EndHorizontal ();
		GUI.enabled = true;
		GUILayout.Label ( "Actions", EditorStyles.boldLabel );
		EditorGUILayout.BeginHorizontal ();
		if ( GUILayout.Button ( "Save Modified Scenes" ) )
		{
			EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo ();
		}
		if ( GUILayout.Button ( "Save Open Scenes" ) )
		{
			EditorSceneManager.SaveOpenScenes ();
		}
		EditorGUILayout.EndHorizontal ();
		GUILayout.Label ( "Settings", EditorStyles.boldLabel );
		this.newSceneSetup = ( NewSceneSetup )EditorGUILayout.EnumPopup ( "New Scene Setup", this.newSceneSetup );
		this.newSceneMode = ( NewSceneMode )EditorGUILayout.EnumPopup ( "New Scene Mode", this.newSceneMode );
		this.openSceneMode = ( OpenSceneMode )EditorGUILayout.EnumPopup ( "Open Scene Mode", this.openSceneMode );
		this.showPath = EditorGUILayout.Toggle ( "Show Path", this.showPath );
		this.showAddToBuild = EditorGUILayout.Toggle ( "Show Add To Build", this.showAddToBuild );
		this.askBeforeDelete = EditorGUILayout.Toggle ( "Ask Before Delete", this.askBeforeDelete );
	}

	public virtual void Open ( string path )
	{
		if ( EditorSceneManager.EnsureUntitledSceneHasBeenSaved ( "You don't have saved the Untitled Scene, Do you want to leave?" ) )
		{
			EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo ();
			EditorSceneManager.OpenScene ( path, this.openSceneMode );
		}
	}

	public virtual void Delete ( string path )
	{
		if ( !askBeforeDelete || EditorUtility.DisplayDialog (
			     "Delete Scene",
			     string.Format (
				     "Are you sure you want to delete the below scene: {0}",
				     path ),
			     "Delete",
			     "Cancel" ) )
		{
			AssetDatabase.DeleteAsset ( path );
			AssetDatabase.Refresh ();
		}
	}

	public virtual void AddToBuild ( string path )
	{
		List<EditorBuildSettingsScene> scenes = new List<EditorBuildSettingsScene> ( EditorBuildSettings.scenes );
		scenes.Add ( new EditorBuildSettingsScene ( path, true ) );
		EditorBuildSettings.scenes = scenes.ToArray ();
	}

}


text:
package in.srain.cube.image;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.LayerDrawable;
import android.net.Uri;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.ImageView;
import in.srain.cube.image.drawable.RecyclingBitmapDrawable;

/**
 * Sub-class of ImageView which:
 *

 *

 * automatically notifies the Drawable when it is being displayed.
 *

 *

 * Part of the code is taken from the Android best practice of displaying Bitmaps
 *

 * Displaying Bitmaps Efficiently.
 */
public class CubeImageView extends ImageView {

    private String mUrl = "";
    private int mSpecifiedWidth = 0;
    private int mSpecifiedHeight = 0;
    private ImageLoader mImageLoader;

    private ImageReuseInfo mImageReuseInfo;
    private ImageTask mImageTask;
    private boolean mClearWhenDetached = true;

    public CubeImageView(Context context) {
        super(context);
    }

    public CubeImageView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public void setClearDrawableWhenDetached(boolean clearWhenDetached) {
        mClearWhenDetached = clearWhenDetached;
    }

    public void clearDrawable() {
        setImageDrawable(null);

        if (null != mImageTask && null != mImageLoader) {
            mImageLoader.detachImageViewFromImageTask(mImageTask, this);
            clearLoadTask();
        }
    }

    /**
     * @see android.widget.ImageView#onDetachedFromWindow()
     */
    @Override
    protected void onDetachedFromWindow() {
        // This has been detached from Window, so clear the drawable
        // If this view is recycled ???
        if (mClearWhenDetached) {
            clearDrawable();
        }
        super.onDetachedFromWindow();
    }

    @Override
    protected void onAttachedToWindow() {
        super.onAttachedToWindow();
        if (mClearWhenDetached) {
            tryLoadImage();
        }
    }

    /**
     * @see android.widget.ImageView#setImageDrawable(android.graphics.drawable.Drawable)
     */
    @Override
    public void setImageDrawable(Drawable drawable) {

        // Keep hold of previous Drawable
        final Drawable previousDrawable = getDrawable();
        // Call super to set new Drawable
        super.setImageDrawable(drawable);

        // Notify new Drawable that it is being displayed
        notifyDrawable(drawable, true);

        // Notify old Drawable so it is no longer being displayed
        notifyDrawable(previousDrawable, false);
    }

    @Override
    public void setImageBitmap(Bitmap bm) {
        super.setImageBitmap(bm);
        clearLoadTask();
    }

    @Override
    public void setImageResource(int resId) {
        super.setImageResource(resId);
        clearLoadTask();
    }

    @Override
    public void setImageURI(Uri uri) {
        super.setImageURI(uri);
        clearLoadTask();
    }

    /**
     * Notifies the drawable that it's displayed state has changed.
     *
     * @param drawable
     * @param isDisplayed
     */
    private static void notifyDrawable(Drawable drawable, final boolean isDisplayed) {
        if (drawable instanceof RecyclingBitmapDrawable) {
            // The drawable is a CountingBitmapDrawable, so notify it
            ((RecyclingBitmapDrawable) drawable).setIsDisplayed(isDisplayed);
        } else if (drawable instanceof LayerDrawable) {
            // The drawable is a LayerDrawable, so recurse on each layer
            LayerDrawable layerDrawable = (LayerDrawable) drawable;
            for (int i = 0, z = layerDrawable.getNumberOfLayers(); i < z; i++) {
                notifyDrawable(layerDrawable.getDrawable(i), isDisplayed);
            }
        }
    }

    public void onLoadFinish() {
    }

    private void clearLoadTask() {
        mImageTask = null;
    }

    public void loadImage(ImageLoader imageLoader, String url) {
        loadImage(imageLoader, url, 0, 0, null);
    }

    public void loadImage(ImageLoader imageLoader, String url, ImageReuseInfo imageReuseInfo) {
        loadImage(imageLoader, url, 0, 0, imageReuseInfo);
    }

    public void loadImage(ImageLoader imageLoader, String url, int specifiedSize) {
        loadImage(imageLoader, url, specifiedSize, specifiedSize, null);
    }

    public void loadImage(ImageLoader imageLoader, String url, int specifiedSize, ImageReuseInfo imageReuseInfo) {
        loadImage(imageLoader, url, specifiedSize, specifiedSize, imageReuseInfo);
    }

    public void loadImage(ImageLoader imageLoader, String url, int specifiedWidth, int specifieHeight) {
        loadImage(imageLoader, url, specifiedWidth, specifieHeight, null);
    }

    public void loadImage(ImageLoader imageLoader, String url, int specifiedWidth, int specifieHeight, ImageReuseInfo imageReuseInfo) {
        mImageLoader = imageLoader;
        mUrl = url;
        mSpecifiedWidth = specifiedWidth;
        mSpecifiedHeight = specifieHeight;
        mImageReuseInfo = imageReuseInfo;
        tryLoadImage();
    }

    @Override
    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
        super.onLayout(changed, left, top, right, bottom);
        tryLoadImage();
    }

    private void tryLoadImage() {

        if (TextUtils.isEmpty(mUrl)) {
            return;
        }

        int width = getWidth();
        int height = getHeight();

        ViewGroup.LayoutParams lyp = getLayoutParams();
        boolean isFullyWrapContent = lyp != null && lyp.height == LayoutParams.WRAP_CONTENT && lyp.width == LayoutParams.WRAP_CONTENT;
        // if the view's bounds aren't known yet, and this is not a wrap-content/wrap-content
        // view, hold off on loading the image.
        if (width == 0 && height == 0 && !isFullyWrapContent) {
            return;
        }

        if (mSpecifiedWidth != 0) {
            width = mSpecifiedWidth;
        }

        if (mSpecifiedHeight != 0) {
            height = mSpecifiedHeight;
        }

        // 1. Check the previous ImageTask related to this ImageView
        if (null != mImageTask) {

            // duplicated ImageTask, return directly.
            if (mImageTask.isLoadingThisUrl(mUrl)) {
                return;
            }
            // ImageView is reused, detach it from the related ImageViews of the previous ImageTask.
            else {
                mImageLoader.detachImageViewFromImageTask(mImageTask, this);
            }
        }

        // 2. Let the ImageView hold this ImageTask. When ImageView is reused next time, check it in step 1.
        ImageTask imageTask = mImageLoader.createImageTask(mUrl, width, height, mImageReuseInfo);
        mImageTask = imageTask;

        // 3. Query cache, if hit, return at once.
        boolean hitCache = mImageLoader.queryCache(imageTask, this);
        if (hitCache) {
            return;
        } else {
            mImageLoader.addImageTask(mImageTask, this);
        }
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
    }

}


text:
@echo off

REM
REM Grab the directory where this script resides, for use later
REM
set COBERTURA_HOME=%~dp0

REM
REM Read all parameters into a single variable using an ugly loop
REM
set CMD_LINE_ARGS=%1
if ""%1""=="""" goto doneStart
shift
:getArgs
if ""%1""=="""" goto doneStart
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
shift
goto getArgs
:doneStart

java -cp %COBERTURA_HOME%cobertura.jar net.sourceforge.cobertura.merge.Main %CMD_LINE_ARGS%


text:
import {find} from 'lodash';
export default getPatternManifestsData;

function getPatternManifestsData(base, patterns = {}, pool = []) {
	return Object.values(patterns).map(id => {
		const dependency = find(pool, {id});
		return [dependency, ...getPatternManifestsData(base, dependency.patterns, pool)];
	});
}


text:
/* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is nsStyleStructInlines.h.
 *
 * The Initial Developer of the Original Code is the Mozilla Foundation.
 * Portions created by the Initial Developer are Copyright (C) 2008
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *   L. David Baron <dbaron@dbaron.org>, Mozilla Corporation (original author)
 *   Rob Arnold <robarnold@mozilla.com>
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */

/*
 * Inline methods that belong in nsStyleStruct.h, except that they
 * require more headers.
 */

#ifndef nsStyleStructInlines_h_
#define nsStyleStructInlines_h_

#include "nsStyleStruct.h"
#include "imgIRequest.h"
#include "imgIContainer.h"

inline void
nsStyleBorder::SetBorderImage(imgIRequest* aImage)
{
  mBorderImage = aImage;
  mSubImages.Clear();
}

inline imgIRequest*
nsStyleBorder::GetBorderImage() const
{
  NS_ABORT_IF_FALSE(!mBorderImage || mImageTracked,
                    "Should be tracking any images we're going to use!");
  return mBorderImage;
}

inline bool nsStyleBorder::IsBorderImageLoaded() const
{
  PRUint32 status;
  return mBorderImage &&
         NS_SUCCEEDED(mBorderImage->GetImageStatus(&status)) &&
         (status & imgIRequest::STATUS_LOAD_COMPLETE) &&
         !(status & imgIRequest::STATUS_ERROR);
}

inline void
nsStyleBorder::SetSubImage(PRUint8 aIndex, imgIContainer* aSubImage) const
{
  const_cast<nsStyleBorder*>(this)->mSubImages.ReplaceObjectAt(aSubImage, aIndex);
}

inline imgIContainer*
nsStyleBorder::GetSubImage(PRUint8 aIndex) const
{
  imgIContainer* subImage = nsnull;
  if (aIndex < mSubImages.Count())
    subImage = mSubImages[aIndex];
  return subImage;
}

#endif /* !defined(nsStyleStructInlines_h_) */


text:
#ifndef ART_RUNTIME_MIRROR_OBJECT_ARRAY_INL_H_
#define ART_RUNTIME_MIRROR_OBJECT_ARRAY_INL_H_

#include "object_array.h"

#include "gc/heap.h"
#include "mirror/art_field.h"
#include "mirror/class.h"
#include "runtime.h"
#include "thread.h"

namespace art {
namespace mirror {

template<class T>
inline ObjectArray<T>* ObjectArray<T>::Alloc(Thread* self, Class* object_array_class, int32_t length) {
  Array* array = Array::Alloc(self, object_array_class, length, sizeof(Object*));
  if (UNLIKELY(array == NULL)) {
    return NULL;
  } else {
    return array->AsObjectArray<T>();
  }
}

template<class T>
inline T* ObjectArray<T>::Get(int32_t i) const {
  if (UNLIKELY(!IsValidIndex(i))) {
    return NULL;
  }
  MemberOffset data_offset(DataOffset(sizeof(Object*)).Int32Value() + i * sizeof(Object*));
  return GetFieldObject<T*>(data_offset, false);
}

template<class T>
inline bool ObjectArray<T>::CheckAssignable(T* object) {
  if (object != NULL) {
    Class* element_class = GetClass()->GetComponentType();
    if (UNLIKELY(!object->InstanceOf(element_class))) {
      ThrowArrayStoreException(object);
      return false;
    }
  }
  return true;
}

template<class T>
inline void ObjectArray<T>::Set(int32_t i, T* object) {
  if (LIKELY(IsValidIndex(i) && CheckAssignable(object))) {
    MemberOffset data_offset(DataOffset(sizeof(Object*)).Int32Value() + i * sizeof(Object*));
    SetFieldObject(data_offset, object, false);
  } else {
    DCHECK(Thread::Current()->IsExceptionPending());
  }
}

template<class T>
inline void ObjectArray<T>::SetWithoutChecks(int32_t i, T* object) {
  DCHECK(IsValidIndex(i));
  MemberOffset data_offset(DataOffset(sizeof(Object*)).Int32Value() + i * sizeof(Object*));
  SetFieldObject(data_offset, object, false);
}

template<class T>
inline void ObjectArray<T>::SetPtrWithoutChecks(int32_t i, T* object) {
  DCHECK(IsValidIndex(i));
  MemberOffset data_offset(DataOffset(sizeof(Object*)).Int32Value() + i * sizeof(Object*));
  SetFieldPtr(data_offset, object, false);
}

template<class T>
inline T* ObjectArray<T>::GetWithoutChecks(int32_t i) const {
  DCHECK(IsValidIndex(i));
  MemberOffset data_offset(DataOffset(sizeof(Object*)).Int32Value() + i * sizeof(Object*));
  return GetFieldObject<T*>(data_offset, false);
}

template<class T>
inline void ObjectArray<T>::Copy(const ObjectArray<T>* src, int src_pos,
                                 ObjectArray<T>* dst, int dst_pos,
                                 size_t length) {
  if (src->IsValidIndex(src_pos) &&
      src->IsValidIndex(src_pos+length-1) &&
      dst->IsValidIndex(dst_pos) &&
      dst->IsValidIndex(dst_pos+length-1)) {
    MemberOffset src_offset(DataOffset(sizeof(Object*)).Int32Value() + src_pos * sizeof(Object*));
    MemberOffset dst_offset(DataOffset(sizeof(Object*)).Int32Value() + dst_pos * sizeof(Object*));
    Class* array_class = dst->GetClass();
    gc::Heap* heap = Runtime::Current()->GetHeap();
    if (array_class == src->GetClass()) {
      // No need for array store checks if arrays are of the same type
      for (size_t i = 0; i < length; i++) {
        Object* object = src->GetFieldObject<Object*>(src_offset, false);
        heap->VerifyObject(object);
        // directly set field, we do a bulk write barrier at the end
        dst->SetField32(dst_offset, reinterpret_cast<uint32_t>(object), false, true);
        src_offset = MemberOffset(src_offset.Uint32Value() + sizeof(Object*));
        dst_offset = MemberOffset(dst_offset.Uint32Value() + sizeof(Object*));
      }
    } else {
      Class* element_class = array_class->GetComponentType();
      CHECK(!element_class->IsPrimitive());
      for (size_t i = 0; i < length; i++) {
        Object* object = src->GetFieldObject<Object*>(src_offset, false);
        if (object != NULL && !object->InstanceOf(element_class)) {
          dst->ThrowArrayStoreException(object);
          return;
        }
        heap->VerifyObject(object);
        // directly set field, we do a bulk write barrier at the end
        dst->SetField32(dst_offset, reinterpret_cast<uint32_t>(object), false, true);
        src_offset = MemberOffset(src_offset.Uint32Value() + sizeof(Object*));
        dst_offset = MemberOffset(dst_offset.Uint32Value() + sizeof(Object*));
      }
    }
    heap->WriteBarrierArray(dst, dst_pos, length);
  }
}

template<class T>
inline ObjectArray<T>* ObjectArray<T>::CopyOf(Thread* self, int32_t new_length) {
  ObjectArray<T>* new_array = Alloc(self, GetClass(), new_length);
  if (LIKELY(new_array != NULL)) {
    Copy(this, 0, new_array, 0, std::min(GetLength(), new_length));
  }
  return new_array;
}

}  // namespace mirror
}  // namespace art

#endif  // ART_RUNTIME_MIRROR_OBJECT_ARRAY_INL_H_


text:
title: "Encryption"
linkTitle: "Encryption"
weight: 40
---

### Format Blob Encryption

Kopia uses a standard envelope encryption technique to de-couple the repository passphrase from the keys used for encrypting and authenticating the contents of the repository.

Each repository has a format blob containing configuration parameters for the repository. The format blob itself is serialized and persistent as JSON, such as the one below.

```json
{
  "tool": "https://github.com/kopia/kopia",
  "buildVersion": "v0.3.0",
  "buildInfo": "unknown",
  "uniqueID": "bm90IGEgZ29vZCByYW5kb20gaW5pdGlhbCB2YWx1ZQ==",
  "keyAlgo": "scrypt-65536-8-1",
  "version": "1",
  "encryption": "AES256_GCM",
  "encryptedBlockFormat": "ZSxqt/gXwVPS6pNvFZOOHlCKr18TmziuUnN8nnuvwQ/+mjbcvEHUfKS11RJl/sWrIOyiYqpSwAZt
BzOxQAUWQt7vHc2ZT4Y75ODrPHhzd0CcBlqHa3HSx8pxIXqpgMy5K3xDvIkBN1qdb/cTyU5s9lZ2
J+rBh2CGQ3phIlKFCCuS3lgB+rnYRrExGg5rm4BUmZZWHfBPQ7QiOJNg86PK+n///dejsAA/+FBj
qIODf7Gr3ppaGZeAHYJuz0BkRSPC4XIAgFj1yPo="
}
```

The corresponding Go struct is the following:

```go
type formatBlob struct {
	Tool         string `json:"tool"`
	BuildVersion string `json:"buildVersion"`
	BuildInfo    string `json:"buildInfo"`

	UniqueID               []byte `json:"uniqueID"`
	KeyDerivationAlgorithm string `json:"keyAlgo"`

	Version              string                  `json:"version"`
	EncryptionAlgorithm  string                  `json:"encryption"`
	EncryptedFormatBytes []byte                  `json:"encryptedBlockFormat,omitempty"`
	UnencryptedFormat    *format.RepositoryObjectFormat `json:"blockFormat,omitempty"`
}
```

* `Version` identifies the version of the format blob.
* The `tool` and `buildInfo` fields are informational
* `buildVersion` is the version of Kopia, which is also indirectly used as the repository format version.
* `UniqueID` is a randomly generated identifier for the repository. This is also used as the input for various encryption operations.
* `keyAlgo` identifies the password-based key derivation function (PBKDF). Only _scrypt_ with the currently recommended cost parameters (N=65536, r=8, p=1) is supported at the moment. The main purpose of this field is to be able to change and extend the key derivation algorithm in the future. For example, by increasing the cost parameters for _scrypt_ or using a different algorithm altogether.
* `encryption` identifies the encryption algorithm that was used to encrypt the encryptedBlockFormat field.
* `encryptedBlockFormat` is a ciphertext containing among others, the encryption secrets and parameters used for encrypting the repository content. Below is additional information about its plaintext content and how it is encrypted.
* Alternatively, the unencrypted block format parameters can be specified in the the `blockFormat` field.

The `formatBlob.EncryptedBlockFormat` field is the result of encrypting a JSON-serialized version of the `EncryptedRepositoryConfig` struct shown below. The plaintext version contains the parameters for performing block chunking, as well as for encrypting and authenticating "content" objects.

```go
type EncryptedRepositoryConfig struct {
	Format RepositoryObjectFormat `json:"format"`
}

type RepositoryObjectFormat struct {
	format.ContentFormat
	format.ObjectFormat
}
```

```go
package content

// ContentFormat describes the rules for formatting contents in repository.
type ContentFormat struct {
	Version     int    `json:"version,omitempty"`     // version number, must be "1"
	Hash        string `json:"hash,omitempty"`        // identifier of the hash algorithm used
	Encryption  string `json:"encryption,omitempty"`  // identifier of the encryption algorithm used
	HMACSecret  []byte `json:"secret,omitempty"`      // HMAC secret used to generate encryption keys
	MasterKey   []byte `json:"masterKey,omitempty"`   // master encryption key (SIV-mode encryption only)
	MaxPackSize int    `json:"maxPackSize,omitempty"` // maximum size of a pack object
}
```

```go
package object

type Format struct {
	Splitter string `json:"splitter,omitempty"` // splitter used to break objects into pieces of content
}
```

The ciphertext in `formatBlob.encryptedBlockFormat` is obtained by:

1. Serializing to JSON the populated encryptedRepositoryConfig struct.
2. Encrypting the resulting byte stream with the algorithm specified in `formatBlob.encryption`. At the moment, `AES256_GCM` is used by default, which is both encrypted and authenticated. The input parameters are:
    * "Plaintext": serialized JSON byte stream
    * "IV": randomly generated and prepended to the ciphertext in `formatBlob.encryptedBlockFormat`
    * Key: 256-bit AES encryption key derived from the passphrase, details below.
    * Additional Data (AD): Used as "authentication data", the value is derived from the passphrase as well. See below.

The passphrase is used to generate the encryption key and _additional data_ (AD) for the encryption and decryption of `formatBlob.encryptedBlockFormat` ciphertext as follows:

* A master key (Km) is derived from the password by using (a) the password-based key derivation function specified in `formatBlob.keyAlgo`, and (b) `formatBlob.UniqueID` as the salt. The resulting key is 32-bytes long (256 bits). `Km = PBKDF( passphrase, formatBlob.UniqueID, … cost parameters)`.
* The AES-256 encryption key (Ke) is derived from Km by using a hash-based key derivation function (HKDF), with SHA256 as the hash. `Ke = HKDF(SHA256, Km, formatBlob.UniqueID, "AES", 32)`
* The additional data (AD) is derived using an HKDF as follows: `AD = HKDF(SHA256, Km, formatBlob.UniqueID, "CHECKSUM", 32)`


text:
using System;

namespace Banshee.ServiceStack
{
    public class InterfaceAction
    {
        public InterfaceAction ()
        {
        }
    }
}


text:
<!doctype html>

    <meta charset="utf-8">
    <title>{{ 'Index.TITLE' | translate }}</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width">

        <acme-navbar creation-date="main.creationDate"></acme-navbar>

{{ 'Index.HEADER' | translate }}

          {{ 'Index.YEOMAN' | translate}}

          Splendid Toastr

          {{ 'Index.THANKS' | translate }}<acme-malarkey extra-values="['Yeoman', 'Gulp', 'Angular']"></acme-malarkey>

      <account-list></account-list>

{{ awesomeThing.title | translate }}

{{ awesomeThing.description | translate }}

{{ awesomeThing.url }}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <TITLE>Adobe Software Technology Lab: Member List</TITLE>
    <META HTTP-EQUIV="content-type" CONTENT="text/html;charset=ISO-8859-1"/>
    <LINK TYPE="text/css" REL="stylesheet" HREF="adobe_source.css"/>
    <LINK REL="alternate" TITLE="stlab.adobe.com RSS" HREF="http://sourceforge.net/export/rss2_projnews.php?group_id=132417&rss_fulltext=1" TYPE="application/rss+xml"/>

Documentation

        Overview

        Building ASL

        Documentation

        Library Wiki Docs

        Indices

        Browse Perforce

More Info

        Release Notes

        Wiki

        Site Search

        License

        Success Stories

        Contributors

Media

        Download

        Perforce Depots

Support

        ASL SourceForge Home

        Mailing Lists

        Discussion Forums

        Report Bugs

        Suggest Features

        Contribute to ASL

RSS

        Short-text news

        Full-text news

        File releases

Other Adobe Projects

        Open @ Adobe

        Adobe Open Source

        Adobe Labs

        Adobe Media Gallery

        C++ Benchmarks

Other Resources

        Boost

        RIAForge

        SGI STL

begin_bag Member List

This is the complete list of members for begin_bag, including all inherited members.

arg_m	basic_omanipulator< std::string, char, std::char_traits< char > >	 [protected]

argument_type typedef	begin_bag

basic_omanipulator(manip_func pf, const argument_type &arg)	basic_omanipulator< std::string, char, std::char_traits< char > >

begin_bag(const argument_type &index)	begin_bag

do_manip(stream_type &strm) const	basic_omanipulator< std::string, char, std::char_traits< char > >

error_m	manipulator_base	 [mutable, protected]

handle_error(StreamType &strm) const 	manipulator_base	 [protected]

manip_func typedef	basic_omanipulator< std::string, char, std::char_traits< char > >

manipulator_base()	manipulator_base

operator()(argument_type)	begin_bag

set_bad() const 	manipulator_base	 [protected]

set_fail() const 	manipulator_base	 [protected]

stream_type typedef	begin_bag

Company |

Online Privacy Policy |

Terms of Use |

Contact Us |

Accessibility |

Report Piracy |

Permissions & Trademarks |

Product License Agreements |

Send Feedback

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google


text:
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class sage_DShowDVDPlayer */

#ifndef _Included_sage_DShowDVDPlayer
#define _Included_sage_DShowDVDPlayer
#ifdef __cplusplus
extern "C" {
#endif
#undef sage_DShowDVDPlayer_OVERLAY_IS_DEFAULT
#define sage_DShowDVDPlayer_OVERLAY_IS_DEFAULT 1L
/*
 * Class:     sage_DShowDVDPlayer
 * Method:    getDVDTitle0
 * Signature: (J)I
 */
JNIEXPORT jint JNICALL Java_sage_DShowDVDPlayer_getDVDTitle0
  (JNIEnv *, jobject, jlong);

/*
 * Class:     sage_DShowDVDPlayer
 * Method:    getDVDTotalTitles0
 * Signature: (J)I
 */
JNIEXPORT jint JNICALL Java_sage_DShowDVDPlayer_getDVDTotalTitles0
  (JNIEnv *, jobject, jlong);

/*
 * Class:     sage_DShowDVDPlayer
 * Method:    getDVDChapter0
 * Signature: (J)I
 */
JNIEXPORT jint JNICALL Java_sage_DShowDVDPlayer_getDVDChapter0
  (JNIEnv *, jobject, jlong);

/*
 * Class:     sage_DShowDVDPlayer
 * Method:    getDVDTotalChapters0
 * Signature: (J)I
 */
JNIEXPORT jint JNICALL Java_sage_DShowDVDPlayer_getDVDTotalChapters0
  (JNIEnv *, jobject, jlong);

/*
 * Class:     sage_DShowDVDPlayer
 * Method:    getDVDDomain0
 * Signature: (J)I
 */
JNIEXPORT jint JNICALL Java_sage_DShowDVDPlayer_getDVDDomain0
  (JNIEnv *, jobject, jlong);

/*
 * Class:     sage_DShowDVDPlayer
 * Method:    areDVDButtonsVisible0
 * Signature: (J)Z
 */
JNIEXPORT jboolean JNICALL Java_sage_DShowDVDPlayer_areDVDButtonsVisible0
  (JNIEnv *, jobject, jlong);

/*
 * Class:     sage_DShowDVDPlayer
 * Method:    getDVDAngle0
 * Signature: (J)I
 */
JNIEXPORT jint JNICALL Java_sage_DShowDVDPlayer_getDVDAngle0
  (JNIEnv *, jobject, jlong);

/*
 * Class:     sage_DShowDVDPlayer
 * Method:    getDVDTotalAngles0
 * Signature: (J)I
 */
JNIEXPORT jint JNICALL Java_sage_DShowDVDPlayer_getDVDTotalAngles0
  (JNIEnv *, jobject, jlong);

/*
 * Class:     sage_DShowDVDPlayer
 * Method:    getDVDLanguage0
 * Signature: (J)Ljava/lang/String;
 */
JNIEXPORT jstring JNICALL Java_sage_DShowDVDPlayer_getDVDLanguage0
  (JNIEnv *, jobject, jlong);

/*
 * Class:     sage_DShowDVDPlayer
 * Method:    getDVDAvailableLanguages0
 * Signature: (J)[Ljava/lang/String;
 */
JNIEXPORT jobjectArray JNICALL Java_sage_DShowDVDPlayer_getDVDAvailableLanguages0
  (JNIEnv *, jobject, jlong);

/*
 * Class:     sage_DShowDVDPlayer
 * Method:    getDVDSubpicture0
 * Signature: (J)Ljava/lang/String;
 */
JNIEXPORT jstring JNICALL Java_sage_DShowDVDPlayer_getDVDSubpicture0
  (JNIEnv *, jobject, jlong);

/*
 * Class:     sage_DShowDVDPlayer
 * Method:    getDVDAvailableSubpictures0
 * Signature: (J)[Ljava/lang/String;
 */
JNIEXPORT jobjectArray JNICALL Java_sage_DShowDVDPlayer_getDVDAvailableSubpictures0
  (JNIEnv *, jobject, jlong);

/*
 * Class:     sage_DShowDVDPlayer
 * Method:    setDVDRate0
 * Signature: (JF)Z
 */
JNIEXPORT jboolean JNICALL Java_sage_DShowDVDPlayer_setDVDRate0
  (JNIEnv *, jobject, jlong, jfloat);

/*
 * Class:     sage_DShowDVDPlayer
 * Method:    seekDVD0
 * Signature: (JJ)Z
 */
JNIEXPORT jboolean JNICALL Java_sage_DShowDVDPlayer_seekDVD0
  (JNIEnv *, jobject, jlong, jlong);

/*
 * Class:     sage_DShowDVDPlayer
 * Method:    getMediaTimeMillis0
 * Signature: (J)J
 */
JNIEXPORT jlong JNICALL Java_sage_DShowDVDPlayer_getMediaTimeMillis0
  (JNIEnv *, jobject, jlong);

/*
 * Class:     sage_DShowDVDPlayer
 * Method:    getDurationMillis0
 * Signature: (J)J
 */
JNIEXPORT jlong JNICALL Java_sage_DShowDVDPlayer_getDurationMillis0
  (JNIEnv *, jobject, jlong);

/*
 * Class:     sage_DShowDVDPlayer
 * Method:    playbackControlMessage0
 * Signature: (JIJJ)Z
 */
JNIEXPORT jboolean JNICALL Java_sage_DShowDVDPlayer_playbackControlMessage0
  (JNIEnv *, jobject, jlong, jint, jlong, jlong);

/*
 * Class:     sage_DShowDVDPlayer
 * Method:    processEvents0
 * Signature: (J)I
 */
JNIEXPORT jint JNICALL Java_sage_DShowDVDPlayer_processEvents0
  (JNIEnv *, jobject, jlong);

/*
 * Class:     sage_DShowDVDPlayer
 * Method:    createGraph0
 * Signature: ()J
 */
JNIEXPORT jlong JNICALL Java_sage_DShowDVDPlayer_createGraph0
  (JNIEnv *, jobject);

/*
 * Class:     sage_DShowDVDPlayer
 * Method:    setupGraph0
 * Signature: (JLjava/lang/String;Ljava/lang/String;ZZ)V
 */
JNIEXPORT void JNICALL Java_sage_DShowDVDPlayer_setupGraph0
  (JNIEnv *, jobject, jlong, jstring, jstring, jboolean, jboolean);

/*
 * Class:     sage_DShowDVDPlayer
 * Method:    getDVDAspectRatio0
 * Signature: (J)F
 */
JNIEXPORT jfloat JNICALL Java_sage_DShowDVDPlayer_getDVDAspectRatio0
  (JNIEnv *, jobject, jlong);

#ifdef __cplusplus
}
#endif
#endif