text:
<!DOCTYPE html>

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

  <title>linalg — emus  documentation</title>

  <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'>

    <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />

    <link rel="top" title="emus  documentation" href="../index.html"/>
        <link rel="up" title="Module code" href="index.html"/>

           emus

  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>

Quickstart

Loading from WHAM-like Formats

Calculating the PMF

Estimating Window Partition Functions

Calculating Averages

Data Structures

Parameters for Harmonic windows

Data from Sampling

Other Conventions

EMUS Modules

autocorrelation module

avar module

emus module

emusroutines module

linalg module

usutils module

test

        emus

Docs »

Module code »

linalg

Source code for linalg

# -*- coding: utf-8 -*-
"""
Collection of linear algebra routines used in the EMUS algorithm and
associated error analysis.
"""
from scipy.linalg import qr
from scipy.linalg import inv
from scipy.linalg import solve
import numpy as np

[docs]def stationary_distrib(F,residtol = 1.E-10,max_iter=100):
    """
    Calculates the eigenvector of the matrix F with eigenvalue 1 (if it exists).

    Parameters
    ----------
    F : ndarray
        A matrix known to have a single left eigenvector with
        eigenvalue 1.

    residtol : float or scalar
        To improve the accuracy of the computation, the algorithm will
        "polish" the final result using several iterations of the power
        method, z^T F = z^T.  Residtol gives the tolerance for the
        associated relative residual to determine convergence.

    maxiter : int
        Maximum number of iterations to use the power method to reduce
        the residual.  In practice, should never be reached.

    Returns
    -------
    z : ndarray
        The eigenvector of the matrix F with eigenvalue 1.  For a Markov
        chain stationary distribution, this is the stationary distribution.
        Normalization is chosen s.t. entries sum to one.

    """

    L = len(F) # Number of States
    M = np.eye(L)-F
    q,r=qr(M)
    z=q[:,-1] # Stationary dist. is last column of QR fact
    z/=np.sum(z) # Normalize Trajectory
    # Polish solution using power method.
    for itr in xrange(max_iter):
        znew = np.dot(z,F)
        maxresid = np.max(np.abs(znew - z)/z) # Convergence Criterion
        if maxresid < residtol:
            break
        else:
            z = znew

    return z/np.sum(z) # Return normalized (by convention)

[docs]def old_stationary_distrib(F,fix=None,residtol = 1.E-10,max_iter=100):
    L = len(F) # Number of States
    # If no fixed state is specified, we find a state with high weight in z.
    if fix is None:
        testz = stationary_distrib(F,1)
        fix = np.argmax(testz)
    #We get the matrix subminor, and the fix'th row of F
    submat = _submatrix(F,fix)
    Fi = F[fix,:]
    # (I-Fsub)^T
    ImFt = np.transpose(np.eye(L-1)-submat)
    Fi = np.delete(Fi,fix)
    z = solve(ImFt,Fi)  # Partition fxns of the other states.
    z = np.insert(z,fix,1.0) # Put the state we fixed to 1. back in
    # Polish solution using power method.
    for itr in xrange(max_iter):
        znew = np.dot(z,F)
        maxresid = np.max(np.abs(znew - z)/z) # Convergence Criterion
        if maxresid < residtol:
            break
        else:
            z = znew
    return z/np.sum(z)

def _submatrix(F,i):
    """
    Calculates the submatrix of F with the i'th row and column removed.

    Parameters
    ----------
    F : ndarray
        A matrix with at least i rows and columns
    i : int
        The row or column to delete

    Returns
    -------
    submatrix: ndarray
        The ensuing submatrix with the i'th row and column deleted.
    """
    submat = np.copy(F)
    submat = np.delete(submat,i,axis=1)
    submat = np.delete(submat,i,axis=0)
    return submat

[docs]def groupInverse(M):
    """
    Computes the group inverse of stochastic matrix using the algorithm
    given by Golub and Meyer in:
    G. H. Golub and C. D. Meyer, Jr, SIAM J. Alg. Disc. Meth. 7, 273-
    281 (1986)

    Parameters
    ----------
        M : ndarray
            A square matrix with index 1.

    Returns
    -------
        grpInvM : ndarray
            The group inverse of M.
    """
    L=np.shape(M)[1]
    q,r=qr(M)
    piDist=q[:,L-1]
    piDist=(1/np.sum(piDist))*piDist
    specProjector=np.identity(L)-np.outer(np.ones(L),piDist)
    u=r[0:(L-1),0:(L-1)]#remember 0:(L-1) actually means 0 to L-2!
    uInv= inv(u)#REPLACE W. lapack, invert triangular matrix ROUTINE
    uInv = np.real(uInv)
    grpInvM=np.zeros((L,L))
    grpInvM[0:(L-1),0:(L-1)]=uInv
    grpInvM=np.dot(specProjector,np.dot(grpInvM,np.dot(q.transpose(),specProjector)))
    return grpInvM

        © Copyright 2016, Erik H Thiede.

  Built with Sphinx using a theme provided by Read the Docs.


text:
package org.apache.felix.connect

import java.util

import org.apache.felix.connect.felix.framework.ServiceRegistry
import org.apache.felix.connect.felix.framework.util.EventDispatcher
import org.osgi.framework._

import scala.jdk.CollectionConverters._

class BlendedPojoBundle(
  activator : BundleActivator,
  registry : ServiceRegistry,
  dispatcher : EventDispatcher,
  bundles : java.util.Map[java.lang.Long, Bundle],
  location : String,
  id : Long,
  symbolicName : String,
  version : Version,
  revision : Revision,
  headers : java.util.Map[String, String],
  config : util.HashMap[String, Object]
) extends PojoSRBundle(
  registry,
  dispatcher,
  bundles,
  location,
  id,
  symbolicName,
  version,
  revision,
  getClass().getClassLoader(),
  headers,
  new util.HashMap[Class[_], Object](),
  config
) {

  @throws[BundleException]
  override def start() : Unit = {

    if (m_state != Bundle.RESOLVED) {
      if (m_state == Bundle.ACTIVE) {
        throw new BundleException("Bundle is in wrong state for start")
      }
    }

    try {
      m_state = Bundle.STARTING

      m_context = new PojoSRBundleContext(this, registry, dispatcher, bundles, config)
      dispatcher.fireBundleEvent(new BundleEvent(BundleEvent.STARTING, this))

      activator.start(m_context)
      m_state = Bundle.ACTIVE
      dispatcher.fireBundleEvent(new BundleEvent(BundleEvent.STARTED, this))
    } catch {
      case t : Throwable =>
        m_state = Bundle.RESOLVED
        dispatcher.fireBundleEvent(new BundleEvent(BundleEvent.STOPPED, this))
        throw new BundleException("Unable to start bundle", t)
    }
  }

  @throws[BundleException]
  override def stop(): Unit = {

    m_state match {
      case Bundle.ACTIVE =>
        try {
          m_state = Bundle.STOPPING
          dispatcher.fireBundleEvent(new BundleEvent(BundleEvent.STOPPING, this))
          activator.stop(m_context)
        } catch {
          case ex : Throwable => throw new BundleException("Error while stopping bundle", ex)
        } finally {
          registry.unregisterServices(this)
          dispatcher.removeListeners(m_context)
          // scalastyle:off null
          m_context = null
          // scalastyle:on null
          m_state = Bundle.RESOLVED
          dispatcher.fireBundleEvent(new BundleEvent(BundleEvent.STOPPED, this))
        }

      case Bundle.RESOLVED =>

      case _               => throw new BundleException("Bundle is in wrong state for stop")
    }
  }
}

redpajama_set_name: RedPajamaGithub


text:
API-PHP
=======

The API-PHP library presents a simple and easy to use interface to the Get a Newsletter's REST API.

Requirements
------------
* PHP 5.5.* or greater
* [Httpful 0.2.*](http://phphttpclient.com/)

Installation
------------

If your project is supporting [Composer](https://getcomposer.org/) you may use the following in your composer.json file:
```json
"require": {
    "getanewsletter/api-php": "0.1.1"
}
```

Usage
-----
Start by creating an instance of the ```\Gan\Api``` object:
```php
<?php

$token = '...';
$gan = new \Gan\Api($token);
```
Here ```$token``` variable must contain a valid [API token](http://help.getanewsletter.com/en/support/api-token-2/) string.

#### The contact object
The instances of the \Gan\Contact class represent the contact entities in the API.
They have the following fields:

*Required fields*
* ```email``` - contact's email. It's also a ***_lookup field_*** - required when updating or deleting the contact.

*Optional fields*
* ```attributes``` - list of the contact's [attributes](http://help.getanewsletter.com/en/support/attribute-overview/).
* ```first_name```
* ```last_name```
* ```lists``` - list of the newsletters for which this contact is subscribed to.

*Read-only fields*
* ```url``` - the contact's resource URL.
* ```active``` - true if the contact is active and can receive mails, false otherwise.
* ```updated``` - the date of the last change.
* ```created``` - the date of creation.

#### Retreiving a contact
You have to create an instance of the ```\Gan\ContactManager\``` class and then use it's ```get()``` method to retrieve the contact you need.
```php
<?php

$contactManager = new \Gan\ContactManager($gan);
$contact = $contactManager->get('john.doe@example.com');
```
The manager methods will throw an ```\Gan\ApiException``` in case of HTTP error from the API, so it's a good idea to catch it.
```php
<?php

try {
    $contact = $contactManager->get('john.doe@example.com');
} catch (\Gan\ApiException $e) {
    if ($e->response->code === 404) {
        echo 'Contact not found!';
    } else {
        echo 'API error: ' . $e;
    }
}
```

#### Creating a contact
```php
<?php

$contact = new \Gan\Contact();
$contact->email = 'jane.doe@example.com';
$contact->first_name = 'Jane';

$contactManager->save($contact);
```
This will create a new contact and save it. Again, it'll be a good idea to catch exceptions when calling the ```save()``` method. The API will respond with an error if the contact already exists.
One way to avoid it is to force the creation of the contact, overwriting the existing one:
```php
<?php

$contactManager->overwrite($contact);
```

Both ```save()``` and ```overwrite()``` will return the same contact object with it's read-only fields updated (e.g. ```created```, ```updated```).

```php
<?php

$contact = $contactManager->save($contact);
echo $contact->created;
```

#### Updating an existing contact
```php
<?php

// Get the contact.
$contact = $contactManager->get('john.doe@example.com');
// Change some fields.
$contact->first_name = 'John';
// Save it.
$contactManager->save($contact);
```
You can avoid making two calls to the API by forcing a *partial update*.
```php
<?php

$contact = new \Gan\Contact();
$contact->setPersisted();
$contact->email = 'john.doe@example.com';
$contact->first_name = 'John';
$contactManager->save($contact);
```
Calling ```setPersisted()``` on the contact object marks it like it's already existing and coming from the API. The calls to the ```save()``` method when a contact is maked as existing will do only a *partial update*, i.e. update only the supplied fields and skipping all the ```null``` fields.
Do not forget that ```email``` is a ***_lookup field_*** and required when updating or deleting the contact.

#### Deleting a contact
```php
<?php

$contactManager->delete($contact);
```

#### The newsletter object
The instances of the \Gan\Newsletter class represent the [lists](http://help.getanewsletter.com/en/support/lists-overview/) in the API. They have the following structure:

*Required fields*
* ```email``` - sender's email.
* ```name``` - name of the list.
* ```sender``` - sender's name.
*
*Optional fields*
* ```description```

*Lookup field*
* ```hash``` - the list's unique hash.

*Read-only fields*
* ```responders_count```
* ```subcribers```
* ```created```
* ```url```
* ```subscribers_count```
* ```active_subscribers_count```
* ```responders```

#### Retreiving, creating, updating and deleting a list
The CRUD operations on lists are no different from the operations on contacts:
```php
<?php

$listManager = new \Gan\NewsletterManager($gan);

// Retrieve a list.
$list = $listManager->get('hash');

// Update the list.
$list->name = 'my list';
$list = $listManager->save($list);
echo $list->updated;

// Create new list.
$new_list = new \Gan\Newsletter();
$new_list->email = 'john.doe@example.com'; // requred fields
$new_list->name = 'my new list';
$new_list->sender = 'John Doe';
$listManager->save($new_list);

// Partial update.
$list = new \Gan\Newsletter();
$list->hash = 'hash'; // lookup field
$list->name = 'updated list';
$listManager->save($list);

// Delete the list.
$listManager->delete($list);

```

#### Subscribing a contact to a list
```php
<?php

$contact->subscribeTo($list);
$contactManager->save($contact);
```
You can also create a new contact automatically subscribed.
```php
<?php

$contact = new \Gan\Contact();
$contact->email = 'john.doe@example.com';
$contact->subscribeTo($list);
$contactManager->save($contact);
```


text:
import os
import sys
import logging
import json
import re
import ast
import argparse
import device42
import requests

from foreman.client import Foreman
from puppetexplore import JSONEncoder, get_config, d42_update
requests.packages.urllib3.disable_warnings()
logging.getLogger('foreman.client').setLevel(logging.CRITICAL)

logger = logging.getLogger('log')
CUR_DIR = os.path.dirname(os.path.abspath(__file__))

parser = argparse.ArgumentParser(description="foremanexploer")

parser.add_argument('-d', '--debug', action='store_true', help='Enable debug output')
parser.add_argument('-q', '--quiet', action='store_true', help='Quiet mode - outputs only errors')
parser.add_argument('-c', '--config', help='Config file', default='settings.yaml')
parser.add_argument('-S', '--savenodes', help='Save nodes info from Puppet server to json file')
parser.add_argument('-n', '--onlynode', action='append', help='Process only selected nodes (fqdn or hostname)')

debugmode = False
cpuf_re = re.compile(r'@ ([\w\d\.]+)GHz', re.I)

def main():
    global debugmode
    args = parser.parse_args()
    if args.debug:
        logger.setLevel(logging.DEBUG)
        debugmode = True
    if args.quiet:
        logger.setLevel(logging.ERROR)
        debugmode = False
    onlynodes = []
    if args.onlynode:
        onlynodes = args.onlynode

    config = get_config(args.config)
    host = config['foreman']['host']
    user = config['foreman']['user']
    password = config['foreman']['pass']
    api_version = config['foreman']['api_version']

    f = Foreman('https://%s' % host, (user, password), verify=False, api_version=api_version)

    node_ids = []
    hosts = f.hosts.index(per_page=100000) if api_version == 1 else f.hosts.index(per_page=100000)['results']

    for node in hosts:

        try:
            if len(onlynodes) > 0 and node['name'] in onlynodes:
                node_ids.append(node['id'])
            elif len(onlynodes) == 0:
                node_ids.append(node['id'])
        except KeyError:
            continue

    facts_query = 'fqdn or memorysize_mb or is_virtual or processorcount or processors::models or serialnumber'

    nodes = []
    for node_id in node_ids:

        host = f.hosts.show(id=node_id)['host'] if api_version == 1 else f.hosts.show(id=node_id)

        if len(onlynodes) > 0 and host['name'] not in onlynodes:
            continue

        host['model'] = f.models.show(id=host['model_id'])
        host['os'] = f.operatingsystems.show(id=host['operatingsystem_id'])

        facts = f.do_get('/api/hosts/%s/facts?search=%s&per_page=999' % (node_id, facts_query), {})\
            if api_version == 1 else f.do_get('/api/hosts/%s/facts?search=%s&per_page=999' % (node_id, facts_query), {})['results']
        facts = facts[host['name']] if host['name'] in facts else {}

        disks = f.do_get('/api/hosts/%s/facts?search=disks&per_page=999' % node_id, {})\
            if api_version == 1 else f.do_get('/api/hosts/%s/facts?search=disks&per_page=999' % node_id, {})['results']
        disks = disks[host['name']] if host['name'] in disks else {}

        ec2_metadata = f.do_get('/api/hosts/%s/facts?search=ec2_metadata&per_page=999' % node_id, {})\
            if api_version == 1 else f.do_get('/api/hosts/%s/facts?search=ec2_metadata&per_page=999' % node_id, {})['results']
        ec2_metadata = ec2_metadata[host['name']] if host['name'] in ec2_metadata else {}

        networking = f.do_get('/api/hosts/%s/facts?search=networking&per_page=999' % node_id, {}) \
            if api_version == 1 else f.do_get('/api/hosts/%s/facts?search=networking&per_page=999' % node_id, {})['results']
        networking = networking[host['name']] if host['name'] in networking else {}

        if 'networking::interfaces' in networking:
            networking2 = {}
            for x in networking:
                value = networking[x]
                if value:
                    value = value.replace('"=>', '":')
                    chain = x.split('::')

                    last = False
                    el = 0
                    obj = networking2
                    while not last:
                        key = chain[el:el+1][0]
                        el += 1
                        if key not in obj:
                            obj[key] = {}
                        obj = obj[key]
                        if len(chain) == el:
                            last = True
                            obj[key] = value

            def clean_dict(obj):
                for x in obj:
                    try:
                        obj[x] = obj[x][x]
                    except:
                        pass
                    try:
                        if type(obj[x]) == dict:
                            obj[x] = clean_dict(obj[x])
                    except:
                        pass

                return obj

            networking = {
                'networking': json.dumps(clean_dict(networking2['networking']))
            }

        if facts == {}:
            continue

        formatted_disks = {}
        for key in disks:
            splitted = key.split('::')
            if len(splitted) == 3:
                if splitted[2] == 'size_bytes':
                    formatted_disks[splitted[1]] = {
                        'size_bytes': disks[key]
                    }

        # Check to see that we have all data, or set it to '' if not
        if facts.has_key('is_virtual'):
            _is_virtual = facts['is_virtual']
        else:
            _is_virtual = False
        if facts.has_key('serialnumber'):
            _serialnumber = facts['serialnumber']
        else:
            _serialnumber = ''
        if facts.has_key('processors::models'):
                _processors_models = ast.literal_eval(facts['processors::models'])
        else:
            _processors_models = ['']
            # prepare correct format

        operating_system = host['os']['operatingsystem']['name'] if api_version == 1 else host['operatingsystem_name']
        operating_system_release = host['os']['operatingsystem']['release_name'] if api_version == 1 else None

        # Device42 must have a valid host name to add a device
        try:
            host_name = host['name']
        except KeyError:
            continue

        data = {
            'hostname': host_name,
            'memorysize_mb': facts['memorysize_mb'] if 'memorysize_mb' in facts else '',
            'fqdn': facts['fqdn'] if 'fqdn' in facts else '',
            'disks': formatted_disks,
            'is_virtual': _is_virtual,
            'serial_no': _serialnumber,
            'physicalprocessorcount': facts['physicalprocessorcount'] if 'physicalprocessorcount' in facts else '',
            'processorcount': facts['processorcount'] if 'processorcount' in facts else '',
            'processors': {
                'models': _processors_models
            },
            'operatingsystem': operating_system,
            'operatingsystemrelease': operating_system_release,
            'macaddress': host['mac'] if 'mac' in host else '',
            'networking': json.loads(networking['networking'].replace('"=>', '":')) if 'networking' in networking else ''
        }
        if len(ec2_metadata) > 0:
            data.update({'ec2_metadata': ec2_metadata})

        nodes.append(data)

    if args.savenodes:
        with open(args.savenodes, 'w') as wnf:
            wnf.write(json.dumps(nodes, cls=JSONEncoder, indent=4, sort_keys=True, ensure_ascii=False))

    dev42 = device42.Device42(
        endpoint=config['device42']['host'],
        user=config['device42']['user'],
        password=config['device42']['pass'],
        logger=logger,
        debug=debugmode
    )

    d42_update(dev42, nodes, config['options'], config.get('static', {}), config.get('mapping', {}),
               from_version='4', puppethost=config['foreman']['host'])

    return 0

if __name__ == "__main__":
    retval = main()
    print 'Done'
    sys.exit(retval)


text:
import Vue from 'vue';
import ExternalDashboardForm from './components/external_dashboard.vue';

export default () => {
  /**
   * This check can be removed when we remove
   * the :grafana_dashboard_link feature flag
   */
  if (!gon.features.grafanaDashboardLink) {
    return null;
  }

  const el = document.querySelector('.js-operation-settings');

  return new Vue({
    el,
    render(createElement) {
      return createElement(ExternalDashboardForm, {
        props: {
          ...el.dataset,
          expanded: false,
        },
      });
    },
  });
};


text:
<!doctype html>

  <meta charset="utf-8">
  <title>cyjs dev</title>

      <button id='cyFitButton'>Fit</button>
      <button id='cyFitSelectedButton'>Fit Selected</button>
      <button id='cySFNButton'>SFN</button>
      <button id='cyHideUnselectedButton'>Hide Unselected</button>
      <button id='cyShowAllButton'>Show All</button>
      <button id='cyDeleteGraphButton'>Delete Graph</button>
      <button id='cyAddGraphButton'>Add Graph</button>


text:
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Language extends Model
{
    use SoftDeletes;
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'language';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = ['name', 'code', 'flag_img_path'];

}


text:
package edu.clemson.resolve.vcgen.stats;

import edu.clemson.resolve.misc.Utils;
import edu.clemson.resolve.proving.absyn.PExp;
import edu.clemson.resolve.proving.absyn.PSymbol;
import edu.clemson.resolve.vcgen.VCAssertiveBlock.VCAssertiveBlockBuilder;
import edu.clemson.resolve.vcgen.app.ChangeApplicationStrategy;
import org.antlr.v4.runtime.ParserRuleContext;
import org.jetbrains.annotations.NotNull;

import java.util.LinkedHashSet;
import java.util.Set;

public class VCChanging extends VCRuleBackedStat {

    private final Set<PExp> changingVariables = new LinkedHashSet<>();

    public VCChanging(ParserRuleContext ctx, VCAssertiveBlockBuilder block, Set<PExp> variables) {
        super(ctx, block, new ChangeApplicationStrategy());
        this.changingVariables.addAll(variables);
    }

    @NotNull
    public Set<PExp> getChangingVariables() {
        return changingVariables;
    }

    @NotNull
    @Override
    public VCRuleBackedStat copyWithEnclosingBlock(@NotNull VCAssertiveBlockBuilder b) {
        return new VCChanging(definingCtx, b, changingVariables);
    }

    @Override
    public String toString() {
        return "Changing " + Utils.join(changingVariables, ", ") + ";";
    }
}


text:
#include "stdneb.h"
#include "core/refcounted.h"

namespace Core
{
__ImplementRootClass(Core::RefCounted, 'REFC');

#if NEBULA3_DEBUG
using namespace Util;

Threading::CriticalSection RefCounted::criticalSection;
int RefCounted::isInCreate = 0;
RefCountedList RefCounted::list;
#endif

//------------------------------------------------------------------------------
/**
*/
RefCounted::~RefCounted()
{
    n_assert(0 == this->refCount);
    #if NEBULA3_DEBUG
        n_assert(!this->destroyed);
        n_assert(0 != this->listIterator);
        criticalSection.Enter();
        list.Remove(this->listIterator);
        criticalSection.Leave();
        this->listIterator = 0;
        this->destroyed = true;
    #endif
}

//------------------------------------------------------------------------------
/**
    This method should be called as the very last before an application
    exits.
*/
void
RefCounted::DumpRefCountingLeaks()
{
    #if NEBULA3_DEBUG
    list.DumpLeaks();
    #endif
}

//------------------------------------------------------------------------------
/**
    Gather per-class stats.
*/
#if NEBULA3_DEBUG
Dictionary<String,RefCounted::Stats>
RefCounted::GetOverallStats()
{
    Dictionary<String,Stats> result;
    criticalSection.Enter();
    // iterate over refcounted list
    RefCountedList::Iterator iter;
    for (iter = list.Begin(); iter != list.End(); iter++)
    {
        RefCounted* cur = *iter;
        if (!result.Contains(cur->GetClassName()))
        {
            Stats newStats;
            newStats.className   = cur->GetClassName();
            newStats.classFourCC = cur->GetClassFourCC();
            newStats.numObjects  = 1;
            newStats.overallRefCount = cur->GetRefCount();
            newStats.instanceSize = cur->GetRtti()->GetInstanceSize();
            result.Add(cur->GetClassName(), newStats);
        }
        else
        {
            Stats& stats = result[cur->GetClassName()];
            stats.numObjects++;
            stats.overallRefCount += cur->GetRefCount();
        }
    }
    criticalSection.Leave();
    return result;
}
#endif

} // namespace Foundation


text:
package com.seanchenxi.gwt.wordpress.json.api.model;

public class Author extends JModel {

  protected Author() {
  }

  public final native int getId() /*-{
		return this.id;
  }-*/;

  public final native void setId(int id) /*-{
		this.id = id;
  }-*/;

  public final native String getlogin() /*-{
		return this.slug;
  }-*/;

  public final native void setLogin(String login) /*-{
		this.slug = login;
  }-*/;

  public final native String getDisplayName() /*-{
		return this.name;
  }-*/;

  public final native void setDisplayName(String displayName) /*-{
		this.name = displayName;
  }-*/;

  public final native String getFirstName() /*-{
		return this.first_name;
  }-*/;

  public final native void setFirstName(String firstName) /*-{
		this.first_name = firstName;
  }-*/;

  public final native String getLastName() /*-{
		return this.last_name;
  }-*/;

  public final native void setLastName(String lastName) /*-{
		this.last_name = lastName;
  }-*/;

  public final native String getNickName() /*-{
		return this.nickname;
  }-*/;

  public final native void setNickName(String nickName) /*-{
		this.nickname = nickName;
  }-*/;

  public final native String getURL() /*-{
		return this.url;
  }-*/;

  public final native void setURL(String url) /*-{
		this.url = url;
  }-*/;

  public final native String getDescription() /*-{
		return this.description;
  }-*/;

  public final native void setDescription(String description) /*-{
		this.description = description;
  }-*/;

}


text:
namespace ngraph
{
    namespace onnx_import
    {
        namespace op
        {
            namespace set_1
            {
                OutputVector onehot(const Node& node);
            }
        }
    }
}


text:
package com.aspose.slides.examples.presentations.conversion;

import com.aspose.slides.*;
import com.aspose.slides.examples.RunExamples;

public class CustomOptionsPDFConversion
{
    public static void main(String[] args)
    {
        //ExStart:CustomOptionsPDFConversion
        // The path to the documents directory.
        String dataDir = RunExamples.getDataDir_Conversion();

        // Instantiate a Presentation object that represents a presentation file
        Presentation pres = new Presentation(dataDir + "ConvertToPDF.pptx");
        try
        {
            // Instantiate the PdfOptions class
            PdfOptions pdfOptions = new PdfOptions();

            // Set Jpeg Quality
            pdfOptions.setJpegQuality((byte) 90);

            // Define behavior for metafiles
            pdfOptions.setSaveMetafilesAsPng(true);

            // Set Text Compression level
            pdfOptions.setTextCompression(PdfTextCompression.Flate);

            // Define the PDF standard
            pdfOptions.setCompliance(PdfCompliance.Pdf15);

            INotesCommentsLayoutingOptions options = pdfOptions.getNotesCommentsLayouting();
            options.setNotesPosition(NotesPositions.BottomFull);

            // Save the presentation to PDF with specified options
            pres.save(dataDir + "Custom_Option_Pdf_Conversion_out.pdf", SaveFormat.Pdf, pdfOptions);
        }
        finally
        {
            if (pres != null) pres.dispose();
        }
        //ExEnd:CustomOptionsPDFConversion
    }
}


text:
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_CSS_CSS_GRID_LINE_NAMES_VALUE_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_CSS_GRID_LINE_NAMES_VALUE_H_

#include "third_party/blink/renderer/core/css/css_value_list.h"
#include "third_party/blink/renderer/platform/wtf/casting.h"

namespace blink {
namespace cssvalue {

class CSSGridLineNamesValue : public CSSValueList {
 public:
  CSSGridLineNamesValue();

  String CustomCSSText() const;

  void TraceAfterDispatch(blink::Visitor* visitor) const {
    CSSValueList::TraceAfterDispatch(visitor);
  }
};

}  // namespace cssvalue

template <>
struct DowncastTraits<cssvalue::CSSGridLineNamesValue> {
  static bool AllowFrom(const CSSValue& value) {
    return value.IsGridLineNamesValue();
  }
};

}  // namespace blink

#endif


text:
from rx.disposable import Disposable, CompositeDisposable, SingleAssignmentDisposable
from rx.internal import noop
from rx.observer import Observer, AutoDetachObserver
from rx.scheduler import Scheduler
from threading import RLock

##########################################################
#                 !! Important note !!                   #
# import rx.linq is done at the end to avoid a circular  #
# depency. rx.linq attaches all operators to Observable. #
##########################################################

class Observable(object):
  """Provides all extension methods to Observable"""

  def subscribe(self, observerOrOnNext=noop, onError=noop, onComplete=noop):
    observer = observerOrOnNext

    if observerOrOnNext == None or callable(observerOrOnNext):
      observer = Observer.create(observerOrOnNext, onError, onComplete)

    return self.subscribeCore(observer)

  def subscribeCore(self, observer):
    raise NotImplementedError()

  def subscribeSafe(self, observer):
    if isinstance(self, ObservableBase):
      return self.subscribeCore(observer)
    elif isinstance(self, Producer):
      return self.subscribeRaw(observer, False)

    d = Disposable.empty()

    try:
      d = self.subscribeCore(observer)
    except Exception as e:
      observer.onError(e)

    return d

class ObservableBase(Observable):

  def subscribe(self, observerOrOnNext=noop, onError=noop, onComplete=noop):
    observer = observerOrOnNext

    if observerOrOnNext == None or hasattr(observerOrOnNext, '__call__'):
      observer = Observer.create(observerOrOnNext, onError, onComplete)

    autoDetachObserver = AutoDetachObserver(observer)

    if Scheduler.currentThread.isScheduleRequired():
      Scheduler.currentThread.scheduleWithState(autoDetachObserver, self.scheduledSubscribe)
    else:
      try:
        autoDetachObserver.disposable(self.subscribeCore(autoDetachObserver))
      except Exception as e:
        if not autoDetachObserver.fail(e):
          raise e

    return autoDetachObserver

  def scheduledSubscribe(self, scheduler, autoDetachObserver):
    try:
      autoDetachObserver.disposable = self.subscribeCore(autoDetachObserver)
    except Exception as e:
      if not autoDetachObserver.fail(e):
        raise e

    return Disposable.empty()

class AnonymousObservable(ObservableBase):
  def __init__(self, subscribe):
    super(AnonymousObservable, self).__init__()
    self._subscribe = subscribe

  def subscribeCore(self, observer):
    d = self._subscribe(observer)

    if d == None:
      return Disposable.empty()
    else:
      return d

class ConnectableObservable(Observable):
  """Represents an observable wrapper that can be connected
  and disconnected from its underlying observable sequence."""
  def __init__(self, source, subject):
    self.source = source.asObservable()
    self.subject = subject
    self.gate = RLock()
    self.connection = None

  def connect(self):
    with self.gate:
      if self.connection == None:
        subscription = self.source.subscribeSafe(self.subject)
        self.connection = self.Connection(self, subscription)

      return self.connection

  def subscribeCore(self, observer):
    return self.subject.subscribeSafe(observer)

  class Connection(Disposable):
    def __init__(self, parent, subscription):
      self.parent = parent
      self.subscription = subscription

    def dispose(self):
      with self.parent.gate:
        if self.subscription != None:
          self.subscription.dispose()
          self.subscription = None

          self.parent.connection = None

class GroupObservable(ObservableBase):
  def __init__(self, key, subject, refCount=None):
    super(GroupObservable, self).__init__()
    self.key = key
    self.subject = subject
    self.refCount = refCount

  def subscribeCore(self, observer):
    if self.refCount == None:
      # [OK] Use of unsafe Subscribe: called on a known subject implementation.
      return self.subject.subscribe(observer)
    else:
      # [OK] Use of unsafe Subscribe: called on a known subject implementation.
      release = self.refCount.getDisposable()
      subscription = self.subject.subscribe(observer)
      return CompositeDisposable(release, subscription)

class Producer(Observable):
  """Base class for implementation of query operators, providing
  performance benefits over the use of Observable.Create"""

  def subscribeCore(self, observer):
    return self.subscribeRaw(observer, True)

  def subscribeRaw(self, observer, enableSafequard):
    sink = SingleAssignmentDisposable()
    subscription = SingleAssignmentDisposable()

    d = CompositeDisposable(sink, subscription)

    if enableSafequard:
      observer = AutoDetachObserver(observer, d)

    def assignSink(s):
      sink.disposable = s

    def scheduled():
      subscription.disposable = self.run(observer, subscription, assignSink)
      return Disposable.empty()

    if Scheduler.currentThread.isScheduleRequired():
      Scheduler.currentThread.schedule(scheduled)
    else:
      scheduled()

    return d

  def run(self, observer, cancel, setSink):
    raise NotImplementedError()

class PushToPullAdapter(object):
  def __init__(self, source):
    self.source = source

  def __iter__(self):
    d = SingleAssignmentDisposable()
    res = self.run(d)
    d.disposable = self.source.subscribeSafe(res)
    return res

  def run(self, subscription):
    raise NotImplementedError()

# import linq to add all extension methods
import rx.linq.allOperators


text:
package org.apache.lucene.search.join;

import org.apache.lucene.index.AtomicReaderContext;
import org.apache.lucene.search.DocIdSet;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.FieldComparator;
import org.apache.lucene.search.Filter;
import org.apache.lucene.util.FixedBitSet;

import java.io.IOException;

/**
 * A field comparator that allows parent documents to be sorted by fields
 * from the nested / child documents.
 *
 * @lucene.experimental
 */
public abstract class ToParentBlockJoinFieldComparator extends FieldComparator<Object> {

  private final Filter parentFilter;
  private final Filter childFilter;
  final int spareSlot;

  FieldComparator<Object> wrappedComparator;
  FixedBitSet parentDocuments;
  FixedBitSet childDocuments;

  ToParentBlockJoinFieldComparator(FieldComparator<Object> wrappedComparator, Filter parentFilter, Filter childFilter, int spareSlot) {
    this.wrappedComparator = wrappedComparator;
    this.parentFilter = parentFilter;
    this.childFilter = childFilter;
    this.spareSlot = spareSlot;
  }

  @Override
  public int compare(int slot1, int slot2) {
    return wrappedComparator.compare(slot1, slot2);
  }

  @Override
  public void setBottom(int slot) {
    wrappedComparator.setBottom(slot);
  }

  @Override
  public FieldComparator<Object> setNextReader(AtomicReaderContext context) throws IOException {
    DocIdSet innerDocuments = childFilter.getDocIdSet(context, null);
    if (isEmpty(innerDocuments)) {
      this.childDocuments = null;
    } else if (innerDocuments instanceof FixedBitSet) {
      this.childDocuments = (FixedBitSet) innerDocuments;
    } else {
      DocIdSetIterator iterator = innerDocuments.iterator();
      if (iterator != null) {
        this.childDocuments = toFixedBitSet(iterator, context.reader().maxDoc());
      } else {
        childDocuments = null;
      }
    }
    DocIdSet rootDocuments = parentFilter.getDocIdSet(context, null);
    if (isEmpty(rootDocuments)) {
      this.parentDocuments = null;
    } else if (rootDocuments instanceof FixedBitSet) {
      this.parentDocuments = (FixedBitSet) rootDocuments;
    } else {
      DocIdSetIterator iterator = rootDocuments.iterator();
      if (iterator != null) {
        this.parentDocuments = toFixedBitSet(iterator, context.reader().maxDoc());
      } else {
        this.parentDocuments = null;
      }
    }

    wrappedComparator = wrappedComparator.setNextReader(context);
    return this;
  }

  private static boolean isEmpty(DocIdSet set) {
    return set == null;
  }

  private static FixedBitSet toFixedBitSet(DocIdSetIterator iterator, int numBits) throws IOException {
    FixedBitSet set = new FixedBitSet(numBits);
    int doc;
    while ((doc = iterator.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
      set.set(doc);
    }
    return set;
  }

  @Override
  public Object value(int slot) {
    return wrappedComparator.value(slot);
  }

  /**
   * Concrete implementation of {@link ToParentBlockJoinSortField} to sorts the parent docs with the lowest values
   * in the child / nested docs first.
   */
  public static final class Lowest extends ToParentBlockJoinFieldComparator {

    /**
     * Create ToParentBlockJoinFieldComparator.Lowest
     *
     * @param wrappedComparator The {@link FieldComparator} on the child / nested level.
     * @param parentFilter Filter (must produce FixedBitSet per-segment) that identifies the parent documents.
     * @param childFilter Filter that defines which child / nested documents participates in sorting.
     * @param spareSlot The extra slot inside the wrapped comparator that is used to compare which nested document
     *                  inside the parent document scope is most competitive.
     */
    public Lowest(FieldComparator<Object> wrappedComparator, Filter parentFilter, Filter childFilter, int spareSlot) {
      super(wrappedComparator, parentFilter, childFilter, spareSlot);
    }

    @Override
    public int compareBottom(int parentDoc) throws IOException {
      if (parentDoc == 0 || parentDocuments == null || childDocuments == null) {
        return 0;
      }

      // We need to copy the lowest value from all child docs into slot.
      int prevParentDoc = parentDocuments.prevSetBit(parentDoc - 1);
      int childDoc = childDocuments.nextSetBit(prevParentDoc + 1);
      if (childDoc >= parentDoc || childDoc == -1) {
        return 0;
      }

      // We only need to emit a single cmp value for any matching child doc
      int cmp = wrappedComparator.compareBottom(childDoc);
      if (cmp > 0) {
        return cmp;
      }

      while (true) {
        childDoc = childDocuments.nextSetBit(childDoc + 1);
        if (childDoc >= parentDoc || childDoc == -1) {
          return cmp;
        }
        int cmp1 = wrappedComparator.compareBottom(childDoc);
        if (cmp1 > 0) {
          return cmp1;
        } else {
          if (cmp1 == 0) {
            cmp = 0;
          }
        }
      }
    }

    @Override
    public void copy(int slot, int parentDoc) throws IOException {
      if (parentDoc == 0 || parentDocuments == null || childDocuments == null) {
        return;
      }

      // We need to copy the lowest value from all child docs into slot.
      int prevParentDoc = parentDocuments.prevSetBit(parentDoc - 1);
      int childDoc = childDocuments.nextSetBit(prevParentDoc + 1);
      if (childDoc >= parentDoc || childDoc == -1) {
        return;
      }
      wrappedComparator.copy(spareSlot, childDoc);
      wrappedComparator.copy(slot, childDoc);

      while (true) {
        childDoc = childDocuments.nextSetBit(childDoc + 1);
        if (childDoc >= parentDoc || childDoc == -1) {
          return;
        }
        wrappedComparator.copy(spareSlot, childDoc);
        if (wrappedComparator.compare(spareSlot, slot) < 0) {
          wrappedComparator.copy(slot, childDoc);
        }
      }
    }

    @Override
    @SuppressWarnings("unchecked")
    public int compareDocToValue(int parentDoc, Object value) throws IOException {
      if (parentDoc == 0 || parentDocuments == null || childDocuments == null) {
        return 0;
      }

      // We need to copy the lowest value from all nested docs into slot.
      int prevParentDoc = parentDocuments.prevSetBit(parentDoc - 1);
      int childDoc = childDocuments.nextSetBit(prevParentDoc + 1);
      if (childDoc >= parentDoc || childDoc == -1) {
        return 0;
      }

      // We only need to emit a single cmp value for any matching child doc
      int cmp = wrappedComparator.compareBottom(childDoc);
      if (cmp > 0) {
        return cmp;
      }

      while (true) {
        childDoc = childDocuments.nextSetBit(childDoc + 1);
        if (childDoc >= parentDoc || childDoc == -1) {
          return cmp;
        }
        int cmp1 = wrappedComparator.compareDocToValue(childDoc, value);
        if (cmp1 > 0) {
          return cmp1;
        } else {
          if (cmp1 == 0) {
            cmp = 0;
          }
        }
      }
    }

  }

  /**
   * Concrete implementation of {@link ToParentBlockJoinSortField} to sorts the parent docs with the highest values
   * in the child / nested docs first.
   */
  public static final class Highest extends ToParentBlockJoinFieldComparator {

    /**
     * Create ToParentBlockJoinFieldComparator.Highest
     *
     * @param wrappedComparator The {@link FieldComparator} on the child / nested level.
     * @param parentFilter Filter (must produce FixedBitSet per-segment) that identifies the parent documents.
     * @param childFilter Filter that defines which child / nested documents participates in sorting.
     * @param spareSlot The extra slot inside the wrapped comparator that is used to compare which nested document
     *                  inside the parent document scope is most competitive.
     */
    public Highest(FieldComparator<Object> wrappedComparator, Filter parentFilter, Filter childFilter, int spareSlot) {
      super(wrappedComparator, parentFilter, childFilter, spareSlot);
    }

    @Override
    public int compareBottom(int parentDoc) throws IOException {
      if (parentDoc == 0 || parentDocuments == null || childDocuments == null) {
        return 0;
      }

      int prevParentDoc = parentDocuments.prevSetBit(parentDoc - 1);
      int childDoc = childDocuments.nextSetBit(prevParentDoc + 1);
      if (childDoc >= parentDoc || childDoc == -1) {
        return 0;
      }

      int cmp = wrappedComparator.compareBottom(childDoc);
      if (cmp < 0) {
        return cmp;
      }

      while (true) {
        childDoc = childDocuments.nextSetBit(childDoc + 1);
        if (childDoc >= parentDoc || childDoc == -1) {
          return cmp;
        }
        int cmp1 = wrappedComparator.compareBottom(childDoc);
        if (cmp1 < 0) {
          return cmp1;
        } else {
          if (cmp1 == 0) {
            cmp = 0;
          }
        }
      }
    }

    @Override
    public void copy(int slot, int parentDoc) throws IOException {
      if (parentDoc == 0 || parentDocuments == null || childDocuments == null) {
        return;
      }

      int prevParentDoc = parentDocuments.prevSetBit(parentDoc - 1);
      int childDoc = childDocuments.nextSetBit(prevParentDoc + 1);
      if (childDoc >= parentDoc || childDoc == -1) {
        return;
      }
      wrappedComparator.copy(spareSlot, childDoc);
      wrappedComparator.copy(slot, childDoc);

      while (true) {
        childDoc = childDocuments.nextSetBit(childDoc + 1);
        if (childDoc >= parentDoc || childDoc == -1) {
          return;
        }
        wrappedComparator.copy(spareSlot, childDoc);
        if (wrappedComparator.compare(spareSlot, slot) > 0) {
          wrappedComparator.copy(slot, childDoc);
        }
      }
    }

    @Override
    @SuppressWarnings("unchecked")
    public int compareDocToValue(int parentDoc, Object value) throws IOException {
      if (parentDoc == 0 || parentDocuments == null || childDocuments == null) {
        return 0;
      }

      int prevParentDoc = parentDocuments.prevSetBit(parentDoc - 1);
      int childDoc = childDocuments.nextSetBit(prevParentDoc + 1);
      if (childDoc >= parentDoc || childDoc == -1) {
        return 0;
      }

      int cmp = wrappedComparator.compareBottom(childDoc);
      if (cmp < 0) {
        return cmp;
      }

      while (true) {
        childDoc = childDocuments.nextSetBit(childDoc + 1);
        if (childDoc >= parentDoc || childDoc == -1) {
          return cmp;
        }
        int cmp1 = wrappedComparator.compareDocToValue(childDoc, value);
        if (cmp1 < 0) {
          return cmp1;
        } else {
          if (cmp1 == 0) {
            cmp = 0;
          }
        }
      }
    }

  }

}


text:
namespace LibGit2Sharp
{
    /// <summary>
    /// Options controlling the behavior of two trees being merged.
    /// </summary>
    public sealed class MergeTreeOptions : MergeOptionsBase
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="MergeTreeOptions"/> class.
        /// <para>
        ///   Default behavior:
        ///     Merge will attempt to find renames.
        /// </para>
        /// </summary>
        public MergeTreeOptions()
        {
        }
    }
}


text:
package com.amazonaws.services.storagegateway.model;

import java.io.Serializable;

/**
 *
 */
public class ListVolumesResult implements Serializable, Cloneable {

    private String gatewayARN;

    private String marker;

    private com.amazonaws.internal.SdkInternalList<VolumeInfo> volumeInfos;

    /**
     * @param gatewayARN
     */

    public void setGatewayARN(String gatewayARN) {
        this.gatewayARN = gatewayARN;
    }

    /**
     * @return
     */

    public String getGatewayARN() {
        return this.gatewayARN;
    }

    /**
     * @param gatewayARN
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public ListVolumesResult withGatewayARN(String gatewayARN) {
        setGatewayARN(gatewayARN);
        return this;
    }

    /**
     * @param marker
     */

    public void setMarker(String marker) {
        this.marker = marker;
    }

    /**
     * @return
     */

    public String getMarker() {
        return this.marker;
    }

    /**
     * @param marker
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public ListVolumesResult withMarker(String marker) {
        setMarker(marker);
        return this;
    }

    /**
     * @return
     */

    public java.util.List<VolumeInfo> getVolumeInfos() {
        if (volumeInfos == null) {
            volumeInfos = new com.amazonaws.internal.SdkInternalList<VolumeInfo>();
        }
        return volumeInfos;
    }

    /**
     * @param volumeInfos
     */

    public void setVolumeInfos(java.util.Collection<VolumeInfo> volumeInfos) {
        if (volumeInfos == null) {
            this.volumeInfos = null;
            return;
        }

        this.volumeInfos = new com.amazonaws.internal.SdkInternalList<VolumeInfo>(
                volumeInfos);
    }

    /**
     *

     * NOTE: This method appends the values to the existing list (if
     * any). Use {@link #setVolumeInfos(java.util.Collection)} or
     * {@link #withVolumeInfos(java.util.Collection)} if you want to override
     * the existing values.
     *

     *
     * @param volumeInfos
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public ListVolumesResult withVolumeInfos(VolumeInfo... volumeInfos) {
        if (this.volumeInfos == null) {
            setVolumeInfos(new com.amazonaws.internal.SdkInternalList<VolumeInfo>(
                    volumeInfos.length));
        }
        for (VolumeInfo ele : volumeInfos) {
            this.volumeInfos.add(ele);
        }
        return this;
    }

    /**
     * @param volumeInfos
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public ListVolumesResult withVolumeInfos(
            java.util.Collection<VolumeInfo> volumeInfos) {
        setVolumeInfos(volumeInfos);
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and
     * debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getGatewayARN() != null)
            sb.append("GatewayARN: " + getGatewayARN() + ",");
        if (getMarker() != null)
            sb.append("Marker: " + getMarker() + ",");
        if (getVolumeInfos() != null)
            sb.append("VolumeInfos: " + getVolumeInfos());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof ListVolumesResult == false)
            return false;
        ListVolumesResult other = (ListVolumesResult) obj;
        if (other.getGatewayARN() == null ^ this.getGatewayARN() == null)
            return false;
        if (other.getGatewayARN() != null
                && other.getGatewayARN().equals(this.getGatewayARN()) == false)
            return false;
        if (other.getMarker() == null ^ this.getMarker() == null)
            return false;
        if (other.getMarker() != null
                && other.getMarker().equals(this.getMarker()) == false)
            return false;
        if (other.getVolumeInfos() == null ^ this.getVolumeInfos() == null)
            return false;
        if (other.getVolumeInfos() != null
                && other.getVolumeInfos().equals(this.getVolumeInfos()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode
                + ((getGatewayARN() == null) ? 0 : getGatewayARN().hashCode());
        hashCode = prime * hashCode
                + ((getMarker() == null) ? 0 : getMarker().hashCode());
        hashCode = prime
                * hashCode
                + ((getVolumeInfos() == null) ? 0 : getVolumeInfos().hashCode());
        return hashCode;
    }

    @Override
    public ListVolumesResult clone() {
        try {
            return (ListVolumesResult) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                            + "even though we're Cloneable!", e);
        }
    }
}


text:
const LOCAL = 'http://localhost:8080';
const STG = 'http://staging.openlattice.com';
const PROD = 'http://api.openlattice.com';

export default {
  LOCAL,
  STG,
  PROD
};


text:
package com.bylak.network.neural;

import org.apache.commons.math.linear.RealMatrix;

import com.bylak.network.function.ActivationFunction;

/**
 * Created with IntelliJ IDEA.
 * User: Artur.Bylak
 * Date: 30.10.13
 * Time: 12:26
 * To change this template use File | Settings | File Templates.
 */
public final class Bias implements Neuron {

    private final ActivationFunction activationFunction;
    private static final int BIAS_VALUE = 1;

    private Bias(final ActivationFunction activationFunction) {
        this.activationFunction = activationFunction;
    }

    @Override
    public double getValue() {
        return BIAS_VALUE;
    }

    @Override
    public void simulate(final RealMatrix inputs) {
    }

    @Override
    public void setValue(final double newValue) {
        throw new UnsupportedOperationException();
    }

    @Override
    public double getInputDerivativeValue() {
        return activationFunction.derivativeValue(BIAS_VALUE);
    }

    @Override
    public double getWag(final int index) {
        return 0;
    }

    @Override
    public void setWag(final int index, final double value) {
    }

    public static Neuron createBias(final ActivationFunction activationFunction) {
        return new Bias(activationFunction);
    }
}


text:
namespace _1.Match_Count
{
    using System;
    using System.Text.RegularExpressions;

    public class MatchCount
    {
        public static void Main()
        {
            var key = Console.ReadLine();
            var text = Console.ReadLine();

            var matchesCount = Regex.Matches(text, key).Count;
            Console.WriteLine(matchesCount);
        }
    }
}


text:
<?php

namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use \DateTime;

/**
 * Critique
 *
 * @ORM\Table(name="critique")
 * @ORM\Entity(repositoryClass="AppBundle\Repository\CritiqueRepository")
 */
class Critique
{

    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="Contenu", type="text")
     */
    private $contenu;

    /**
     * @ORM\ManyToOne(targetEntity="Serie", inversedBy="critiques")
     */
    private $serie;

    /**
     * @ORM\ManytoOne(targetEntity="Utilisateur", inversedBy="critiques")
     */
    private $auteur;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="Date_critique", type="datetime")
     */
    private $dateCritique;

    /**
     * @var int
     *
     * @ORM\Column(name="Note", type="integer")
     */
    private $note;

    /**
     * @var boolean
     *
     * @ORM\Column(name="Signale", type="boolean")
     */
    private $signale;

    public function __construct()
    {

        $this->dateCritique = new DateTime();
        $this->note = 0;
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set contenu
     *
     * @param string $contenu
     * @return Critique
     */
    public function setContenu($contenu)
    {
        $this->contenu = $contenu;

        return $this;
    }

    /**
     * Get contenu
     *
     * @return string
     */
    public function getContenu()
    {
        return $this->contenu;
    }

    /**
     * Set dateCritique
     *
     * @param \DateTime $dateCritique
     * @return Critique
     */
    public function setDateCritique($dateCritique)
    {
        $this->dateCritique = $dateCritique;

        return $this;
    }

    /**
     * Get dateCritique
     *
     * @return \DateTime
     */
    public function getDateCritique()
    {
        return $this->dateCritique;
    }

    /**
     * Set note
     *
     * @param integer $note
     * @return Critique
     */
    public function setNote($note)
    {
        $this->note = $note;

        return $this;
    }

    /**
     * Get note
     *
     * @return integer
     */
    public function getNote()
    {
        return $this->note;
    }

    public function getSerie()
    {

        return $this->serie;
    }

    public function setSerie($serie)
    {

        $this->serie = $serie;
        $serie->addCritique($this);
        return $this;
    }

    public function getAuteur()
    {

        return $this->auteur;
    }

    public function setAuteur($auteur)
    {
        $this->auteur = $auteur;
        $auteur->addCritique($this)->addActivite(["type" => "critique", "cible" => $this]);
        return $this;
    }

    public function getSignale()
    {

        return $this->signale;
    }

    public function setSignale($signale)
    {

        $this->signale = $signale;
        return $this;
    }

}


text:
Check it out live [FoodRecalls.info](https://foodrecalls.info)

## What it's built with
- ReactJS
- React Router
- Bootstrap V4 Alpha
- Create React App
- Hosted on Azure
- Secured with Cloudflare
- ES6 and Babel
- Using data from [openFDA](https://open.fda.gov)

## TODO
- Add pagination of results
- Debounce history pushing
- Get html5 history working on Azure
- Add more details to list and detail records
- Add filters for other fields (dates, classifications, etc)
- Fancy D3 charts

## Miscellaneous

##### Any questions about this, please let me know: johnwiegert@outlook.com


text:
for (var i = 0; i < cdrLegs.length; i++) {
    $('.nav.nav-tabs')
        .append($('<li>', {class: cdrLegs[i].val.variables.uuid === defUuid ? 'active': ""})
            .append($('<a>', {href: '#', 'bind-id': i, text: cdrLegs[i].name})));

    if (cdrLegs[i].val.variables.uuid === defUuid) {
        $('#json-preview').JSONView(cdrLegs[i].val);
    }
}

$('#save-json').click(function() {
    var textFileAsBlob = new Blob([cdrText], {type: 'application/json'}),
        downloadLink = document.createElement("a");

    downloadLink.download = cdrLegs[0].val.variables.uuid + ".json";
    downloadLink.innerHTML = "Download File";

    if (window.webkitURL !== null) {
        downloadLink.href = window.webkitURL.createObjectURL(textFileAsBlob);
    }
    else {
        downloadLink.href = window.URL.createObjectURL(textFileAsBlob);
        downloadLink.style.display = "none";
        document.body.appendChild(downloadLink);
    }
    downloadLink.click();
});

var menuItems = $('.nav.nav-tabs>li');

menuItems.click(function () {
    if (this.id === 'save-data') {
        return;
    }

    menuItems.removeClass('active');
    $(this).addClass('active');
    $('#json-preview').JSONView(cdrLegs[+$(this).children().attr('bind-id')].val);
});


text: Access denaid


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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>
  <groupId>com.texelz</groupId>
  <artifactId>schemorger</artifactId>
  <version>1.0</version>
  <dependencies>
  	<dependency>
  		<groupId>commons-beanutils</groupId>
  		<artifactId>commons-beanutils</artifactId>
  		<version>1.9.0</version>
  	</dependency>
  	<dependency>
  		<groupId>org.jsoup</groupId>
  		<artifactId>jsoup</artifactId>
  		<version>1.7.3</version>
  	</dependency>
  	<dependency>
  		<groupId>org.apache.commons</groupId>
  		<artifactId>commons-lang3</artifactId>
  		<version>3.1</version>
  	</dependency>
  </dependencies>
</project>


text:
package com.reactnativenavigation.bridge;

import com.facebook.react.bridge.Callback;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.reactnativenavigation.controllers.NavigationCommandsHandler;
import com.reactnativenavigation.params.ContextualMenuParams;
import com.reactnativenavigation.params.FabParams;
import com.reactnativenavigation.params.LightBoxParams;
import com.reactnativenavigation.params.SlidingOverlayParams;
import com.reactnativenavigation.params.SnackbarParams;
import com.reactnativenavigation.params.TitleBarButtonParams;
import com.reactnativenavigation.params.TitleBarLeftButtonParams;
import com.reactnativenavigation.params.parsers.ContextualMenuParamsParser;
import com.reactnativenavigation.params.parsers.FabParamsParser;
import com.reactnativenavigation.params.parsers.LightBoxParamsParser;
import com.reactnativenavigation.params.parsers.ScreenParamsParser;
import com.reactnativenavigation.params.parsers.SlidingOverlayParamsParser;
import com.reactnativenavigation.params.parsers.SnackbarParamsParser;
import com.reactnativenavigation.params.parsers.TitleBarButtonParamsParser;
import com.reactnativenavigation.params.parsers.TitleBarLeftButtonParamsParser;
import com.reactnativenavigation.views.SideMenu.Side;

import java.util.List;

/**
 * The basic abstract components we will expose:
 * BottomTabs (app) - boolean
 * TopBar (per screen)
 * - TitleBar
 * - - RightButtons
 * - - LeftButton
 * - TopTabs (segmented control / view pager tabs)
 * DeviceStatusBar (app) (colors are per screen)
 * AndroidNavigationBar (app) (colors are per screen)
 * SideMenu (app) - boolean, (menu icon is screen-based)
 */
public class NavigationReactModule extends ReactContextBaseJavaModule {
    public static final String NAME = "NavigationReactModule";

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

    @Override
    public String getName() {
        return NAME;
    }

    @ReactMethod
    public void startApp(final ReadableMap params) {
        NavigationCommandsHandler.startApp(BundleConverter.toBundle(params));
    }

    @ReactMethod
    public void setScreenTitleBarTitle(String screenInstanceId, String title) {
        NavigationCommandsHandler.setScreenTitleBarTitle(screenInstanceId, title);
    }

    @ReactMethod
    public void setScreenTitleBarSubtitle(String screenInstanceId, String subtitle) {
        NavigationCommandsHandler.setScreenTitleBarSubtitle(screenInstanceId, subtitle);
    }

    @ReactMethod
    public void setScreenButtons(String screenInstanceId, String navigatorEventId,
                                 ReadableArray rightButtonsParams, ReadableMap leftButtonParams, ReadableMap fab) {
        if (rightButtonsParams != null) {
            setScreenTitleBarRightButtons(screenInstanceId, navigatorEventId, rightButtonsParams);
        }
        if (leftButtonParams != null) {
            setScreenTitleBarLeftButton(screenInstanceId, navigatorEventId, leftButtonParams);
        }
        if (fab != null) {
            setScreenFab(screenInstanceId, navigatorEventId, fab);
        }
    }

    private void setScreenTitleBarRightButtons(String screenInstanceId, String navigatorEventId, ReadableArray rightButtonsParams) {
        List<TitleBarButtonParams> rightButtons = new TitleBarButtonParamsParser()
                .parseButtons(BundleConverter.toBundle(rightButtonsParams));
        NavigationCommandsHandler.setScreenTitleBarRightButtons(screenInstanceId, navigatorEventId, rightButtons);
    }

    private void setScreenTitleBarLeftButton(String screenInstanceId, String navigatorEventId, ReadableMap leftButtonParams) {
        TitleBarLeftButtonParams leftButton = new TitleBarLeftButtonParamsParser()
                .parseSingleButton(BundleConverter.toBundle(leftButtonParams));
        NavigationCommandsHandler.setScreenTitleBarLeftButtons(screenInstanceId, navigatorEventId, leftButton);
    }

    private void setScreenFab(String screenInstanceId, String navigatorEventId, ReadableMap fab) {
        FabParams fabParams = new FabParamsParser().parse(BundleConverter.toBundle(fab), navigatorEventId, screenInstanceId);
        NavigationCommandsHandler.setScreenFab(screenInstanceId, navigatorEventId, fabParams);
    }

    @ReactMethod
    public void setScreenStyle(String screenInstanceId, ReadableMap style) {
        NavigationCommandsHandler.setScreenStyle(screenInstanceId, BundleConverter.toBundle(style));
    }

    @ReactMethod
    public void setBottomTabBadgeByIndex(Integer index, String badge) {
        NavigationCommandsHandler.setBottomTabBadgeByIndex(index, badge);
    }

    @ReactMethod
    public void setBottomTabBadgeByNavigatorId(String navigatorId, String badge) {
        NavigationCommandsHandler.setBottomTabBadgeByNavigatorId(navigatorId, badge);
    }

    @ReactMethod
    public void setBottomTabButtonByIndex(Integer index, final ReadableMap params) {
        NavigationCommandsHandler.setBottomTabButtonByIndex(index, BundleConverter.toBundle(params));
    }

    @ReactMethod
    public void setBottomTabButtonByNavigatorId(String navigatorId, final ReadableMap params) {
        NavigationCommandsHandler.setBottomTabButtonByNavigatorId(navigatorId, BundleConverter.toBundle(params));
    }

    @ReactMethod
    public void selectBottomTabByTabIndex(Integer index) {
        NavigationCommandsHandler.selectBottomTabByTabIndex(index);
    }

    @ReactMethod
    public void selectBottomTabByNavigatorId(String navigatorId) {
        NavigationCommandsHandler.selectBottomTabByNavigatorId(navigatorId);
    }

    @ReactMethod
    public void selectTopTabByTabIndex(String screenInstanceId, int index) {
        NavigationCommandsHandler.selectTopTabByTabIndex(screenInstanceId, index);
    }

    @ReactMethod
    public void selectTopTabByScreen(String screenInstanceId) {
        NavigationCommandsHandler.selectTopTabByScreen(screenInstanceId);
    }

    @ReactMethod
    public void toggleSideMenuVisible(boolean animated, String side) {
        NavigationCommandsHandler.toggleSideMenuVisible(animated, Side.fromString(side));
    }

    @ReactMethod
    public void setSideMenuVisible(boolean animated, boolean visible, String side) {
        NavigationCommandsHandler.setSideMenuVisible(animated, visible, Side.fromString(side));
    }

    @ReactMethod
    public void setSideMenuEnabled(boolean enabled, String side) {
        NavigationCommandsHandler.setSideMenuEnabled(enabled, Side.fromString(side));
    }

    @ReactMethod
    public void toggleTopBarVisible(final ReadableMap params) {
    }

    @ReactMethod
    public void setTopBarVisible(String screenInstanceId, boolean hidden, boolean animated) {
        NavigationCommandsHandler.setTopBarVisible(screenInstanceId, hidden, animated);
    }

    @ReactMethod
    public void toggleBottomTabsVisible(final ReadableMap params) {
    }

    @ReactMethod
    public void setBottomTabsVisible(boolean hidden, boolean animated) {
        NavigationCommandsHandler.setBottomTabsVisible(hidden, animated);
    }

    @ReactMethod
    public void push(final ReadableMap params) {
        NavigationCommandsHandler.push(BundleConverter.toBundle(params));
    }

    @ReactMethod
    public void pop(final ReadableMap params) {
        NavigationCommandsHandler.pop(BundleConverter.toBundle(params));
    }

    @ReactMethod
    public void popToRoot(final ReadableMap params) {
        NavigationCommandsHandler.popToRoot(BundleConverter.toBundle(params));
    }

    @ReactMethod
    public void newStack(final ReadableMap params) {
        NavigationCommandsHandler.newStack(BundleConverter.toBundle(params));
    }

    @ReactMethod
    public void showModal(final ReadableMap params) {
        NavigationCommandsHandler.showModal(BundleConverter.toBundle(params));
    }

    @ReactMethod
    public void showLightBox(final ReadableMap params) {
        LightBoxParams lbp = new LightBoxParamsParser(BundleConverter.toBundle(params)).parse();
        NavigationCommandsHandler.showLightBox(lbp);
    }

    @ReactMethod
    public void dismissLightBox() {
        NavigationCommandsHandler.dismissLightBox();
    }

    @ReactMethod
    public void dismissAllModals() {
        NavigationCommandsHandler.dismissAllModals();
    }

    @ReactMethod
    public void dismissTopModal(final ReadableMap params) {
        NavigationCommandsHandler.dismissTopModal(ScreenParamsParser.parse(BundleConverter.toBundle(params)));
    }

    @ReactMethod
    public void showSlidingOverlay(final ReadableMap params) {
        SlidingOverlayParams slidingOverlayParams = new SlidingOverlayParamsParser().parse(BundleConverter.toBundle(params));
        NavigationCommandsHandler.showSlidingOverlay(slidingOverlayParams);
    }

    @ReactMethod
    public void hideSlidingOverlay(final ReadableMap params) {
        NavigationCommandsHandler.hideSlidingOverlay();
    }

    @ReactMethod
    public void showSnackbar(final ReadableMap params) {
        SnackbarParams snackbarParams = new SnackbarParamsParser().parse(BundleConverter.toBundle(params));
        NavigationCommandsHandler.showSnackbar(snackbarParams);
    }

    @ReactMethod
    public void dismissSnackbar() {
        NavigationCommandsHandler.dismissSnackbar();
    }

    @ReactMethod
    public void showContextualMenu(final String screenInstanceId, final ReadableMap params, final Callback onButtonClicked) {
        ContextualMenuParams contextualMenuParams =
                new ContextualMenuParamsParser().parse(BundleConverter.toBundle(params));
        NavigationCommandsHandler.showContextualMenu(screenInstanceId, contextualMenuParams, onButtonClicked);
    }

    @ReactMethod
    public void dismissContextualMenu(String screenInstanceId) {
        NavigationCommandsHandler.dismissContextualMenu(screenInstanceId);
    }

    @ReactMethod
    public void getOrientation(Promise promise) {
        NavigationCommandsHandler.getOrientation(promise);
    }

    @ReactMethod
    public void isAppLaunched(Promise promise) {
        NavigationCommandsHandler.isAppLaunched(promise);
    }

    @ReactMethod
    public void isRootLaunched(Promise promise) {
        NavigationCommandsHandler.isRootLaunched(promise);
    }

    @ReactMethod
    public void getCurrentlyVisibleScreenId(Promise promise) {
        NavigationCommandsHandler.getCurrentlyVisibleScreenId(promise);
    }
}


text:
#include <log4cxx/rolling/zipcompressaction.h>
#include <apr_thread_proc.h>
#include <apr_strings.h>
#include <log4cxx/helpers/exception.h>
#include <log4cxx/helpers/transcoder.h>

using namespace log4cxx;
using namespace log4cxx::rolling;
using namespace log4cxx::helpers;

IMPLEMENT_LOG4CXX_OBJECT(ZipCompressAction)

ZipCompressAction::ZipCompressAction(const File& src,
    const File& dest,
    bool del)
   : source(src), destination(dest), deleteSource(del) {
}

bool ZipCompressAction::execute(log4cxx::helpers::Pool& p) const {
    if (source.exists(p)) {
        apr_pool_t* aprpool = p.getAPRPool();
        apr_procattr_t* attr;
        apr_status_t stat = apr_procattr_create(&attr, aprpool);
        if (stat != APR_SUCCESS) throw IOException(stat);

        stat = apr_procattr_io_set(attr, APR_NO_PIPE, APR_NO_PIPE, APR_FULL_BLOCK);
        if (stat != APR_SUCCESS) throw IOException(stat);

        stat = apr_procattr_cmdtype_set(attr, APR_PROGRAM_PATH);
        if (stat != APR_SUCCESS) throw IOException(stat);

        //
        //   redirect the child's error stream to this processes' error stream
        //
        apr_file_t* child_err;
        stat = apr_file_open_stderr(&child_err, aprpool);
        if (stat == APR_SUCCESS) {
         stat =  apr_procattr_child_err_set(attr, child_err, NULL);
         if (stat != APR_SUCCESS) throw IOException(stat);
        }

        const char** args = (const char**)
            apr_palloc(aprpool, 5 *sizeof(*args));
        int i = 0;
        args[i++] = "zip";
        args[i++] = "-q";
        args[i++] = Transcoder::encode(destination.getPath(), p);
        args[i++] = Transcoder::encode(source.getPath(), p);
        args[i++] = NULL;

        if (destination.exists(p)) {
            destination.deleteFile(p);
        }

        apr_proc_t pid;
        stat = apr_proc_create(&pid, "zip", args, NULL, attr, aprpool);
        if (stat != APR_SUCCESS) throw IOException(stat);

        apr_proc_wait(&pid, NULL, NULL, APR_WAIT);

        if (deleteSource) {
            source.deleteFile(p);
        }
        return true;
    }
    return false;
}


text:
package org.apache.fineract.portfolio.interestratechart.service;

import static org.apache.fineract.portfolio.interestratechart.InterestIncentiveApiConstants.INCENTIVE_RESOURCE_NAME;
import static org.apache.fineract.portfolio.interestratechart.InterestIncentiveApiConstants.amountParamName;
import static org.apache.fineract.portfolio.interestratechart.InterestIncentiveApiConstants.attributeNameParamName;
import static org.apache.fineract.portfolio.interestratechart.InterestIncentiveApiConstants.attributeValueParamName;
import static org.apache.fineract.portfolio.interestratechart.InterestIncentiveApiConstants.conditionTypeParamName;
import static org.apache.fineract.portfolio.interestratechart.InterestIncentiveApiConstants.entityTypeParamName;
import static org.apache.fineract.portfolio.interestratechart.InterestIncentiveApiConstants.incentiveTypeparamName;
import static org.apache.fineract.portfolio.interestratechart.InterestRateChartSlabApiConstants.incentivesParamName;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;

import org.apache.fineract.infrastructure.core.data.ApiParameterError;
import org.apache.fineract.infrastructure.core.data.DataValidatorBuilder;
import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException;
import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper;
import org.apache.fineract.portfolio.interestratechart.domain.InterestIncentives;
import org.apache.fineract.portfolio.interestratechart.domain.InterestIncentivesFields;
import org.apache.fineract.portfolio.interestratechart.domain.InterestRateChartSlab;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;

@Service
public class InterestIncentiveAssembler {

    private final FromJsonHelper fromApiJsonHelper;

    @Autowired
    public InterestIncentiveAssembler(final FromJsonHelper fromApiJsonHelper) {
        this.fromApiJsonHelper = fromApiJsonHelper;
    }

    public Collection<InterestIncentives> assembleIncentivesFrom(final JsonElement element, InterestRateChartSlab interestRateChartSlab,
            final Locale locale) {
        final Collection<InterestIncentives> interestIncentivesSet = new HashSet<>();

        if (element.isJsonObject()) {
            final JsonObject topLevelJsonElement = element.getAsJsonObject();
            if (topLevelJsonElement.has(incentivesParamName) && topLevelJsonElement.get(incentivesParamName).isJsonArray()) {
                final JsonArray array = topLevelJsonElement.get(incentivesParamName).getAsJsonArray();
                for (int i = 0; i < array.size(); i++) {
                    final JsonObject incentiveElement = array.get(i).getAsJsonObject();
                    final InterestIncentives incentives = this.assembleFrom(incentiveElement, interestRateChartSlab, locale);
                    interestIncentivesSet.add(incentives);
                }
            }
        }

        return interestIncentivesSet;
    }

    private InterestIncentives assembleFrom(final JsonElement element, final InterestRateChartSlab interestRateChartSlab,
            final Locale locale) {
        final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
        final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource(INCENTIVE_RESOURCE_NAME);
        InterestIncentivesFields incentivesFields = createInterestIncentiveFields(element, baseDataValidator, locale);
        throwExceptionIfValidationWarningsExist(dataValidationErrors);
        return new InterestIncentives(interestRateChartSlab, incentivesFields);
    }

    private InterestIncentivesFields createInterestIncentiveFields(final JsonElement element, final DataValidatorBuilder baseDataValidator,
            final Locale locale) {
        Integer entityType = this.fromApiJsonHelper.extractIntegerNamed(entityTypeParamName, element, locale);
        Integer conditionType = this.fromApiJsonHelper.extractIntegerNamed(conditionTypeParamName, element, locale);
        Integer attributeName = this.fromApiJsonHelper.extractIntegerNamed(attributeNameParamName, element, locale);
        String attributeValue = this.fromApiJsonHelper.extractStringNamed(attributeValueParamName, element);
        Integer incentiveType = this.fromApiJsonHelper.extractIntegerNamed(incentiveTypeparamName, element, locale);
        BigDecimal amount = this.fromApiJsonHelper.extractBigDecimalNamed(amountParamName, element, locale);
        return InterestIncentivesFields.createNew(entityType, attributeName, conditionType, attributeValue, incentiveType, amount,
                baseDataValidator);
    }

    private void throwExceptionIfValidationWarningsExist(final List<ApiParameterError> dataValidationErrors) {
        if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException(dataValidationErrors); }
    }
}


text:
			BooleantreeNode.isAjaxing

			Overview[ depends on jquery.ztree.core js ]

Judge whether the node's child nodes being loaded
					asynchronously.

Do not initialize or modify it, it is
					created by the zTree.

Boolean Format

true means: the node's child nodes is being loaded
				asynchronously

false means: the node's child nodes is not being loaded
				asynchronously

Examples of treeNode

1. Judge whether the first selected node's child nodes being
			loaded asynchronously

			var treeObj = $.fn.zTree.getZTreeObj("tree");
var sNodes = treeObj.getSelectedNodes();
if (sNodes.length > 0) {
	var isAjaxing = sNodes[0].isAjaxing;
}


text:
#include "SplashScreenMenuView.h"
#include "AssetList.h"
#include "NewAssetList.h"
#include "Game.h"

using namespace CR::Sound;

extern Game* game_class;

SplashScreenMenuView::SplashScreenMenuView()
{
	tandemSound = ISound::Instance().CreateSoundFX(CR::AssetList::sounds::tanlogo::ID);
	m_splashScreen = new SplashScreen(CR::AssetList::Splash_Screen_1, 1.5f, 1000);
	m_splashScreen->DesignSize(320, 480);
	m_splashScreen->SplashFinished += Delegate(this, &SplashScreenMenuView::OnSplashScreen1Done);
	m_splashScreen->StartSplash();
	tandemSound->Play();
}

SplashScreenMenuView::~SplashScreenMenuView()
{
	delete m_splashScreen;
}

void SplashScreenMenuView::Update()
{
	m_splashScreen->Update();
}

void SplashScreenMenuView::Render()
{
	m_splashScreen->ForceRender();
}

void SplashScreenMenuView::OnSplashScreen1Done()
{
	m_splashScreen->SplashFinished.Clear();
	m_splashScreen->SplashFinished += Delegate(this, &SplashScreenMenuView::OnSplashScreen2Done);
	m_splashScreen->SetSplashAsset(CR::AssetList::Splash_Screen_2, 1.5f);
	m_splashScreen->DesignSize(320, 480);
	m_splashScreen->StartSplash();
}

void SplashScreenMenuView::OnSplashScreen2Done()
{
	game_class->WaitForScoreloop();
	ExitSplashScreen();
}


text:
import Auth from './auth';

const PORT = 3000; // config this value eventually
const socketConnectionString = () => `//${document.domain}:${PORT}`;

export default class Connection {
    constructor() {
        this.queue = [];
        this.handlers = [];
        this.socket = null;
        this.connectionLive = false;

        this.subscribe('disconnect', () => this.connectionLive = false);
    }

    connect(authCallback) {
        if (!this.socket) {
            this.socket = this.subscribeToSocketEvents(io(socketConnectionString()));
        }

        this.socket.on('connect', () => {
            Auth.authenticate(this.socket, (username) => {
                this.connectionLive = true;
                authCallback(username);
            });
        });
    }

    subscribe(event, handler) {
        this.handlers.push({event, handler});

        if (this.socket) {
            this.socket.on(event, handler);
        }
    }

    sendEvent(event, payload) {
        this.queue.push({
            type: event,
            description: payload
        });
    }

    sendImmediate(type, payload) {
        this.socket.emit(type, payload);
    }

    processQueue() {
        if (this.connectionLive && this.queue.length > 0) {
            const toSend = this.queue;
            this.queue = [];

            this.socket.emit('client-updates', {
                updates: toSend
            });
        }
    }

    subscribeToSocketEvents(socket) {
        this.handlers.forEach(({event, handler}) => {
            socket.on(event, handler);
        });

        return socket;
    }
}


text:
"""add meta.created

Revision ID: d2176bc400c8
Revises: 661fce6a2f64
Create Date: 2019-12-02 07:14:01.145411

"""
from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision = 'd2176bc400c8'
down_revision = '661fce6a2f64'
branch_labels = None
depends_on = None

def upgrade(engine_name):
    globals()["upgrade_%s" % engine_name]()

def downgrade(engine_name):
    globals()["downgrade_%s" % engine_name]()

def upgrade_app():
    # ### commands auto generated by Alembic - please adjust! ###
    pass
    # ### end Alembic commands ###

def downgrade_app():
    # ### commands auto generated by Alembic - please adjust! ###
    pass
    # ### end Alembic commands ###

def upgrade_ingest():
    # ### commands auto generated by Alembic - please adjust! ###
    pass
    # ### end Alembic commands ###

def downgrade_ingest():
    # ### commands auto generated by Alembic - please adjust! ###
    pass
    # ### end Alembic commands ###

def upgrade_fingerprint():
    op.add_column(u'meta', sa.Column('created', sa.DateTime(timezone=True), nullable=True))

def downgrade_fingerprint():
    op.drop_column(u'meta', 'created')


text:
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="20dp"
    android:height="20dp"
    android:viewportWidth="20"
    android:viewportHeight="20"
    android:tint="?attr/colorControlNormal">
  <path
      android:fillColor="@android:color/white"
      android:pathData="M2.292,17.708V2.292H17.708V17.708Z"/>
</vector>


text:
package fr.redfroggy.hmac.configuration.security.hmac;

/**
 * Hmac signer exception
 * Created by Michael DESIGAUD on 16/02/2016.
 */
public class HmacException extends Exception{

    public HmacException(String message) {
        super(message);
    }

    public HmacException(String message, Throwable throwable) {
        super(message,throwable);
    }
}


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

<TITLE>
Serialized Form
</TITLE>

<META NAME="date" CONTENT="2013-08-01">

<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Serialized Form

Package org.droidparts.http

Class org.droidparts.http.HTTPException extends java.lang.Exception implements Serializable

serialVersionUID: 1L

Serialized Fields

respCode

int respCode

      Overview
      Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes


text:
package org.appenders.log4j2.elasticsearch.metrics;

import org.junit.jupiter.api.Test;

import java.util.UUID;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;

public class DefaultMetricsFactoryPluginTest {

    @Test
    public void defaultBuilderBuildsSuccessfully() {

        // given
        final DefaultMetricsFactoryPlugin.Builder builder = DefaultMetricsFactoryPlugin.newBuilder();

        // when
        final DefaultMetricsFactoryPlugin factory = builder.build();

        // then
        assertNotNull(factory);

    }

    @Test
    public void defaultBuilderHasNoConfigs() {

        // given
        final DefaultMetricsFactoryPlugin.Builder builder = DefaultMetricsFactoryPlugin.newBuilder();

        // when
        final DefaultMetricsFactoryPlugin factory = builder.build();

        // then
        assertEquals(0, factory.getMetricConfigs().size());

    }

    @Test
    public void builderBuildsWithGivenMetricConfigs() {

        // given
        final String expectedCountName = UUID.randomUUID().toString();
        final String expectedResettableMaxName = UUID.randomUUID().toString();
        final String expectedMaxName = UUID.randomUUID().toString();

        final DefaultMetricsFactoryPlugin.Builder builder = DefaultMetricsFactoryPlugin.newBuilder()
                .withMetricConfigs(new MetricConfig[] {
                        MetricConfigFactory.createCountConfig(expectedCountName),
                        MetricConfigFactory.createMaxConfig(expectedResettableMaxName, false),
                        MetricConfigFactory.createMaxConfig(expectedMaxName, true)
                });

        // when
        final DefaultMetricsFactoryPlugin factory = builder.build();

        // then
        assertEquals(3, factory.getMetricConfigs().size());
        assertEquals(expectedCountName, factory.createMetric("test-component", expectedCountName).getKey().getMetricNamePart());
        assertEquals(expectedResettableMaxName, factory.createMetric("test-component", expectedResettableMaxName).getKey().getMetricNamePart());
        assertEquals(expectedMaxName, factory.createMetric("test-component", expectedMaxName).getKey().getMetricNamePart());

    }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
    <!-- ================================= -->
    <!-- Preserve messages in a local file -->
    <!-- ================================= -->
    <appender name="ERR" class="org.apache.log4j.DailyRollingFileAppender">
        <param name="File" value="error.log"/>
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d %-5p %c [%t] (%F:%L) - %m%n"/>
        </layout>
    </appender>

    <appender name="WARNING" class="org.apache.log4j.RollingFileAppender">
        <param name="File" value="warning.log"/>
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%m %d{ISO8601}%n"/>
        </layout>
    </appender>

    <appender name="DATA" class="org.apache.log4j.rolling.RollingFileAppender">
        <param name="File" value="data.log"/>
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%m	%d{ISO8601}%n"/>
        </layout>
        <rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
            <param name="ActiveFileName" value="data.log"/>
            <param name="FileNamePattern" value="data.log.%d.gz"/>
        </rollingPolicy>
        <filter class="org.apache.log4j.varia.LevelMatchFilter">
        <param name="LevelToMatch" value="DATALEVEL#net.recommenders.plista.log.DataLevel" />
        <param name="AcceptOnMatch" value="true" />
    </filter>
        <filter class="org.apache.log4j.varia.DenyAllFilter"/>
        </appender>

    <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
        <param name="Target" value="System.out"/>
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d %-5p %c [%t] (%F:%L) - %m%n"/>
        </layout>
    </appender>
    <!-- ================ -->
    <!-- Limit categories -->
    <!-- ================ -->
    <logger name="net.recommenders.plista.recommender" additivity="false">
        <level value="DATALEVEL#net.recommenders.plista.log.DataLevel"/>
        <appender-ref ref="WARNING"/>
        <appender-ref ref="ERR"/>
        <appender-ref ref="DATA"/>
    </logger>
    <logger name="net.recommenders.plista.client" additivity="false">
        <level value="DATALEVEL#net.recommenders.plista.log.DataLevel"/>
        <appender-ref ref="WARNING"/>
        <appender-ref ref="ERR"/>
        <appender-ref ref="DATA"/>
    </logger>
    <logger name="net.recommenders.plista.rec" additivity="false">
        <level value="DATALEVEL#net.recommenders.plista.log.DataLevel"/>
        <appender-ref ref="WARNING"/>
        <appender-ref ref="ERR"/>
        <appender-ref ref="DATA"/>
    </logger>
    <!-- ======================= -->
    <!-- Setup the Root category -->
    <!-- ======================= -->
    <root>
        <appender-ref ref="CONSOLE"/>
        <appender-ref ref="ERR"/>
    </root>
</log4j:configuration>


text:
package com.cinnamon.utils;

import com.cinnamon.system.MouseEvent;

/**
 *

 *     Listener to be triggered on a mouse click.
 *

 */
public interface OnClickListener
{
    /**
     *
Called when an object is clicked on.

     *
     * @param event {@link MouseEvent}.
     * @return true if the MouseEvent was used.
     */
    boolean onClick(MouseEvent event);
}


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

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.SET_WALLPAPER" />
    <uses-permission android:name="android.permission.INTERNET"/>

    <application
        android:name=".App"
        android:allowBackup="true"
        android:hardwareAccelerated="false"
        android:largeHeap="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_launcher_name"
        android:roundIcon="@mipmap/ic_launcher_3"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name="com.amar.notesapp.activities.WelcomeActivity"
            android:theme="@style/SplashTheme">

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".activities.MainActivity"
            android:resizeableActivity="true">
            <intent-filter>
                <action android:name="android.intent.action.PICK" />

                <category android:name="android.intent.category.DEFAULT" />

                <data android:mimeType="image/*" />
                <data android:mimeType="video/*" />
                <data android:mimeType="vnd.android.cursor.dir/image" />
                <data android:mimeType="vnd.android.cursor.dir/video" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.GET_CONTENT" />

                <category android:name="android.intent.category.OPENABLE" />
                <category android:name="android.intent.category.DEFAULT" />

                <data android:mimeType="image/*" />
                <data android:mimeType="video/*" />
                <data android:mimeType="vnd.android.cursor.dir/image" />
                <data android:mimeType="vnd.android.cursor.dir/video" />
            </intent-filter>
        </activity>
        <activity
            android:name=".activities.MediaActivity"
            android:parentActivityName=".activities.MainActivity" />
        <activity
            android:name=".activities.ViewPagerActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:parentActivityName=".activities.MediaActivity"
            android:theme="@style/FullScreenTheme">
            <intent-filter>
                <action android:name="com.android.camera.action.REVIEW" />

                <category android:name="android.intent.category.BROWSABLE" />
                <category android:name="android.intent.category.DEFAULT" />

                <data android:mimeType="image/*" />
                <data android:mimeType="video/*" />
            </intent-filter>
        </activity>
        <activity
            android:name=".activities.SettingsActivity"
            android:label="@string/settings"
            android:parentActivityName=".activities.MainActivity" />
        <activity
            android:name="com.simplemobiletools.commons.activities.CustomizationActivity"
            android:label="@string/customize_colors"
            android:parentActivityName=".activities.SettingsActivity" />
        <activity
            android:name=".activities.PhotoVideoActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:theme="@style/FullScreenTheme" />
        <activity
            android:name=".activities.PhotoActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:theme="@style/FullScreenTheme">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.BROWSABLE" />
                <category android:name="android.intent.category.DEFAULT" />

                <data android:mimeType="image/*" />
            </intent-filter>
        </activity>
        <activity
            android:name=".activities.VideoActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:theme="@style/FullScreenTheme">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.BROWSABLE" />
                <category android:name="android.intent.category.DEFAULT" />

                <data android:mimeType="video/*" />
            </intent-filter>
        </activity>
        <activity
            android:name=".activities.SetWallpaperActivity"
            android:label="@string/simple_wallpaper">
            <intent-filter>
                <action android:name="android.intent.action.ATTACH_DATA" />

                <category android:name="android.intent.category.DEFAULT" />

                <data android:mimeType="image/*" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.SET_WALLPAPER" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

        <provider
            android:name="android.support.v4.content.FileProvider"
            android:authorities="${applicationId}.provider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/provider_paths" />
        </provider>

        <receiver
            android:name=".receivers.InstallReceiver"
            android:exported="true">
            <intent-filter>
                <action android:name="com.android.vending.INSTALL_REFERRER" />
            </intent-filter>
        </receiver>

    </application>

</manifest>


text:
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<!DOCTYPE comment_db [
<!ELEMENT files (file)+>
<!ELEMENT file (comments)+>
<!ATTLIST file id CDATA #REQUIRED>
<!ELEMENT comments (comment)+>
<!ELEMENT comment (author|version|since|deprecated|see|return|exception|throws|param|usage|example)+>
<!ATTLIST comment id CDATA #REQUIRED>
<!ELEMENT author (#PCDATA)>
<!ELEMENT version (#PCDATA)>
<!ELEMENT since (#PCDATA)>
<!ELEMENT deprecated (#PCDATA)>
<!ELEMENT see (#PCDATA)>
<!ELEMENT return (#PCDATA)>
<!ELEMENT exception (#PCDATA)>
<!ELEMENT throws (#PCDATA)>
<!ELEMENT param (#PCDATA)>
<!ELEMENT usage (#PCDATA)>
<!ELEMENT example (#PCDATA)>
]>
<comment_db>
 <files>
 <file id="assert.h">
  <comments>
   <comment id="assert(c) ((void)((c) ? 0 : _assert_fail(#c, __FILE__, __LINE__,  __FUNCTION__)) ">
    <params>
     <param id="c">expression to be tested</param>
    </params>
    <usage>
assert("This would pass");
assert(!"But this would fail")
assert(foo == 1);
    </usage>
    <desc>If NDEBUG is defined then assert on failure of c</desc>
   </comment>
  </comments>
 </file>
 <file id="daemon.c">
  <comments>
  </comments>
 </file>
 </files></comment_db>