text:
import mock
from oslo_config import cfg

from cinder import context
from cinder import exception
from cinder.tests.unit.targets import targets_fixture as tf
from cinder import utils
from cinder.volume import configuration as conf
from cinder.volume.targets import fake
from cinder.volume.targets import iscsi

class FakeIncompleteDriver(iscsi.ISCSITarget):
    def null_method():
        pass

class TestBaseISCSITargetDriver(tf.TargetDriverFixture):

    def setUp(self):
        super(TestBaseISCSITargetDriver, self).setUp()
        self.target = fake.FakeTarget(root_helper=utils.get_root_helper(),
                                      configuration=self.configuration)
        self.target.db = mock.MagicMock(
            volume_get=mock.MagicMock(return_value={'provider_auth':
                                                    'CHAP otzL 234Z'}))

    def test_abc_methods_not_present_fails(self):
        configuration = conf.Configuration(cfg.StrOpt('target_prefix',
                                                      default='foo',
                                                      help='you wish'))
        self.assertRaises(TypeError,
                          FakeIncompleteDriver,
                          configuration=configuration)

    def test_get_iscsi_properties(self):
        self.assertEqual(self.expected_iscsi_properties,
                         self.target._get_iscsi_properties(self.testvol))

    def test_get_iscsi_properties_multiple_targets(self):
        testvol = self.testvol.copy()
        expected_iscsi_properties = self.expected_iscsi_properties.copy()
        iqn = expected_iscsi_properties['target_iqn']
        testvol.update(
            {'provider_location': '10.10.7.1:3260;10.10.8.1:3260 '
                                  'iqn.2010-10.org.openstack:'
                                  'volume-%s 0' % self.fake_volume_id})
        expected_iscsi_properties.update(
            {'target_portals': ['10.10.7.1:3260', '10.10.8.1:3260'],
             'target_iqns': [iqn, iqn],
             'target_luns': [0, 0]})
        self.assertEqual(expected_iscsi_properties,
                         self.target._get_iscsi_properties(testvol))

    def test_build_iscsi_auth_string(self):
        auth_string = 'chap chap-user chap-password'
        self.assertEqual(auth_string,
                         self.target._iscsi_authentication('chap',
                                                           'chap-user',
                                                           'chap-password'))

    def test_do_iscsi_discovery(self):
        with mock.patch.object(self.configuration,
                               'safe_get', return_value='127.0.0.1'),\
                mock.patch('cinder.utils.execute',
                           return_value=(self.target_string, '')):
            self.assertEqual(self.target_string,
                             self.target._do_iscsi_discovery(self.testvol))

    def test_remove_export(self):

        with mock.patch.object(self.target, '_get_target_and_lun') as \
                mock_get_target,\
                mock.patch.object(self.target, 'show_target'),\
                mock.patch.object(self.target, 'remove_iscsi_target') as \
                mock_remove_target:

            mock_get_target.return_value = (0, 1)
            iscsi_target, lun = mock_get_target.return_value
            ctxt = context.get_admin_context()
            self.target.remove_export(ctxt, self.testvol)
            mock_remove_target.assert_called_once_with(
                iscsi_target,
                lun,
                'ed2c2222-5fc0-11e4-aa15-123b93f75cba',
                'testvol')

    def test_remove_export_notfound(self):

        with mock.patch.object(self.target, '_get_target_and_lun') as \
                mock_get_target,\
                mock.patch.object(self.target, 'show_target'),\
                mock.patch.object(self.target, 'remove_iscsi_target'):

            mock_get_target.side_effect = exception.NotFound
            ctxt = context.get_admin_context()
            self.assertIsNone(self.target.remove_export(ctxt,
                                                        self.testvol))

    def test_remove_export_show_error(self):

        with mock.patch.object(self.target, '_get_target_and_lun') as \
                mock_get_target,\
                mock.patch.object(self.target, 'show_target') as mshow,\
                mock.patch.object(self.target, 'remove_iscsi_target'):

            mock_get_target.return_value = (0, 1)
            iscsi_target, lun = mock_get_target.return_value
            mshow.side_effect = Exception
            ctxt = context.get_admin_context()
            self.assertIsNone(self.target.remove_export(ctxt,
                                                        self.testvol))

    def test_initialize_connection(self):
        expected = {'driver_volume_type': 'iscsi',
                    'data': self.expected_iscsi_properties}
        self.assertEqual(expected,
                         self.target.initialize_connection(self.testvol, {}))

    def test_validate_connector(self):
        bad_connector = {'no_initiator': 'nada'}
        self.assertRaises(exception.InvalidConnectorException,
                          self.target.validate_connector,
                          bad_connector)

        connector = {'initiator': 'fake_init'}
        self.assertTrue(bool(self.target.validate_connector),
                        connector)

    def test_show_target_error(self):
        self.assertRaises(exception.InvalidParameterValue,
                          self.target.show_target,
                          0, None)

        with mock.patch.object(self.target, '_get_target') as mock_get_target:
            mock_get_target.side_effect = exception.NotFound()
            self.assertRaises(exception.NotFound,
                              self.target.show_target, 0,
                              self.expected_iscsi_properties['target_iqn'])

    def test_iscsi_location(self):
        location = self.target._iscsi_location('portal', 1, 'target', 2)
        self.assertEqual('portal:3260,1 target 2', location)

        location = self.target._iscsi_location('portal', 1, 'target', 2,
                                               ['portal2'])
        self.assertEqual('portal:3260;portal2:3260,1 target 2', location)

    def test_get_target_chap_auth(self):
        ctxt = context.get_admin_context()
        self.assertEqual(('otzL', '234Z'),
                         self.target._get_target_chap_auth(ctxt,
                                                           self.testvol))
        self.target.db.volume_get.assert_called_once_with(
            ctxt, self.testvol['id'])


text:
/*package com.agileEAP.portal.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.listener.ChannelTopic;
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
import org.springframework.data.redis.listener.adapter.MessageListenerAdapter;
import org.springframework.data.redis.serializer.GenericToStringSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import org.springframework.scheduling.annotation.EnableScheduling;

import com.agileEAP.portal.cache.redis.RedisMessageListener;
import com.agileEAP.portal.cache.redis.RedisPublisher;

@Configuration
@EnableScheduling
@ComponentScan("com.agileEAP.portal")
@PropertySource("classpath:/redis.properties")
public class RedisConfig {
	private @Value("${redis.host}") String redisHostName;
	private @Value("${redis.port}") int redisPort;

    @Bean
    JedisConnectionFactory jedisConnectionFactory() {
    	 JedisConnectionFactory factory = new JedisConnectionFactory();
    	      factory.setHostName(redisHostName);
    	      factory.setPort(redisPort);
    	      factory.setUsePool(true);
    	      return factory;
    }

    @Bean
    RedisTemplate< String, Object > redisTemplate() {
        final RedisTemplate< String, Object > template =  new RedisTemplate< String, Object >();
        template.setConnectionFactory( jedisConnectionFactory() );
        template.setKeySerializer( new StringRedisSerializer() );
        template.setHashValueSerializer( new GenericToStringSerializer< Object >( Object.class ) );
        template.setValueSerializer( new GenericToStringSerializer< Object >( Object.class ) );
        return template;
    }

    @Bean
    MessageListenerAdapter messageListener() {
        return new MessageListenerAdapter( new RedisMessageListener() );
    }

    @Bean
    RedisMessageListenerContainer redisContainer() {
        final RedisMessageListenerContainer container = new RedisMessageListenerContainer();
        container.setConnectionFactory( jedisConnectionFactory() );
        container.addMessageListener( messageListener(), topic() );

        return container;
    }

    @Bean
    RedisPublisher redisPublisher() {
        return new RedisPublisher( redisTemplate(), topic() );
    }

    @Bean
    ChannelTopic topic() {
        return new ChannelTopic("pubsub:queue" );
    }
}*/

redpajama_set_name: RedPajamaGithub


text:
Browse

						{ONXSHOP_REQUEST_menu #bo/component/server_browser_menu~directory=models/:scope=all:trim_extension=1:expand_all=1~}

					http://{_SERVER.HTTP_HOST}/share/docs/database/Onxshop.pdf

					{ONXSHOP_REQUEST_database_listing #bo/component/database_listing}


text:
<?php namespace FHIR\Elements\Primitive;

/**
 * Class FHIRBoolean
 * @package FHIR\Elements
 */
class FHIRBoolean extends AbstractFHIRPrimitiveType
{
    /**
     * @param $value
     * @return bool
     */
    public function isValueValid($value)
    {
        if (is_string($value))
        {
            $value = strtolower($value);
            return 'true' === $value || 'false' === $value;
        }
        else
        {
            return false;
        }
    }

    /**
     * @return string
     */
    public function __toString()
    {
        if ($this->value)
            return 'TRUE';
        else
            return 'FALSE';
    }
}


text:
namespace Azure.ResourceManager.SecurityCenter.Models
{
    /// <summary> The Defender for Databases AWS offering. </summary>
    public partial class DefenderForDatabasesAwsOffering : SecurityCenterCloudOffering
    {
        /// <summary> Initializes a new instance of DefenderForDatabasesAwsOffering. </summary>
        public DefenderForDatabasesAwsOffering()
        {
            OfferingType = OfferingType.DefenderForDatabasesAws;
        }

        /// <summary> Initializes a new instance of DefenderForDatabasesAwsOffering. </summary>
        /// <param name="offeringType"> The type of the security offering. </param>
        /// <param name="description"> The offering description. </param>
        /// <param name="arcAutoProvisioning"> The ARC autoprovisioning configuration. </param>
        /// <param name="rds"> The RDS configuration. </param>
        internal DefenderForDatabasesAwsOffering(OfferingType offeringType, string description, DefenderForDatabasesAwsOfferingArcAutoProvisioning arcAutoProvisioning, DefenderForDatabasesAwsOfferingRds rds) : base(offeringType, description)
        {
            ArcAutoProvisioning = arcAutoProvisioning;
            Rds = rds;
            OfferingType = offeringType;
        }

        /// <summary> The ARC autoprovisioning configuration. </summary>
        public DefenderForDatabasesAwsOfferingArcAutoProvisioning ArcAutoProvisioning { get; set; }
        /// <summary> The RDS configuration. </summary>
        public DefenderForDatabasesAwsOfferingRds Rds { get; set; }
    }
}


text:
package db

import (
	"encoding/json"
	"fmt"
	"math/rand"

	"github.com/HouzuoGuo/tiedot/tdlog"
)

// Resolve the attribute(s) in the document structure along the given path.
func GetIn(doc interface{}, path []string) (ret []interface{}) {
	docMap, ok := doc.(map[string]interface{})
	if !ok {
		return
	}
	var thing interface{} = docMap
	// Get into each path segment
	for i, seg := range path {
		if aMap, ok := thing.(map[string]interface{}); ok {
			thing = aMap[seg]
		} else if anArray, ok := thing.([]interface{}); ok {
			for _, element := range anArray {
				ret = append(ret, GetIn(element, path[i:])...)
			}
			return ret
		} else {
			return nil
		}
	}
	switch thing := thing.(type) {
	case []interface{}:
		return append(ret, thing...)
	default:
		return append(ret, thing)
	}
}

// Hash a string using sdbm algorithm.
func StrHash(str string) int {
	var hash int
	for _, c := range str {
		hash = int(c) + (hash << 6) + (hash << 16) - hash
	}
	if hash < 0 {
		return -hash
	}
	return hash
}

// Put a document on all user-created indexes.
func (col *Col) indexDoc(id int, doc map[string]interface{}) {
	for idxName, idxPath := range col.indexPaths {
		for _, idxVal := range GetIn(doc, idxPath) {
			if idxVal != nil {
				hashKey := StrHash(fmt.Sprint(idxVal))
				partNum := hashKey % col.db.numParts
				ht := col.hts[partNum][idxName]
				ht.Lock.Lock()
				ht.Put(hashKey, id)
				ht.Lock.Unlock()
			}
		}
	}
}

// Remove a document from all user-created indexes.
func (col *Col) unindexDoc(id int, doc map[string]interface{}) {
	for idxName, idxPath := range col.indexPaths {
		for _, idxVal := range GetIn(doc, idxPath) {
			if idxVal != nil {
				hashKey := StrHash(fmt.Sprint(idxVal))
				partNum := hashKey % col.db.numParts
				ht := col.hts[partNum][idxName]
				ht.Lock.Lock()
				ht.Remove(hashKey, id)
				ht.Lock.Unlock()
			}
		}
	}
}

// Insert a document with the specified ID into the collection (incl. index). Does not place partition/schema lock.
func (col *Col) InsertRecovery(id int, doc map[string]interface{}) (err error) {
	docJS, err := json.Marshal(doc)
	if err != nil {
		return
	}
	partNum := id % col.db.numParts
	part := col.parts[partNum]
	// Put document data into collection
	if _, err = part.Insert(id, []byte(docJS)); err != nil {
		return
	}
	// Index the document
	col.indexDoc(id, doc)
	return
}

// Insert a document into the collection.
func (col *Col) Insert(doc map[string]interface{}) (id int, err error) {
	docJS, err := json.Marshal(doc)
	if err != nil {
		return
	}
	id = rand.Int()
	partNum := id % col.db.numParts
	col.db.schemaLock.RLock()
	part := col.parts[partNum]

	// Put document data into collection
	part.DataLock.Lock()
	_, err = part.Insert(id, []byte(docJS))
	part.DataLock.Unlock()
	if err != nil {
		col.db.schemaLock.RUnlock()
		return
	}

	part.LockUpdate(id)
	// Index the document
	col.indexDoc(id, doc)
	part.UnlockUpdate(id)

	col.db.schemaLock.RUnlock()
	return
}

func (col *Col) read(id int, placeSchemaLock bool) (doc map[string]interface{}, err error) {
	if placeSchemaLock {
		col.db.schemaLock.RLock()
	}
	part := col.parts[id%col.db.numParts]

	part.DataLock.RLock()
	docB, err := part.Read(id)
	part.DataLock.RUnlock()
	if err != nil {
		if placeSchemaLock {
			col.db.schemaLock.RUnlock()
		}
		return
	}

	err = json.Unmarshal(docB, &doc)
	if placeSchemaLock {
		col.db.schemaLock.RUnlock()
	}
	return
}

// Find and retrieve a document by ID.
func (col *Col) Read(id int) (doc map[string]interface{}, err error) {
	return col.read(id, true)
}

// Update a document.
func (col *Col) Update(id int, doc map[string]interface{}) error {
	if doc == nil {
		return fmt.Errorf("Updating %d: input doc may not be nil", id)
	}
	docJS, err := json.Marshal(doc)
	if err != nil {
		return err
	}
	col.db.schemaLock.RLock()
	part := col.parts[id%col.db.numParts]

	// Place lock, read back original document and update
	part.DataLock.Lock()
	originalB, err := part.Read(id)
	if err != nil {
		part.DataLock.Unlock()
		col.db.schemaLock.RUnlock()
		return err
	}
	err = part.Update(id, []byte(docJS))
	part.DataLock.Unlock()
	if err != nil {
		col.db.schemaLock.RUnlock()
		return err
	}

	// Done with the collection data, next is to maintain indexed values
	var original map[string]interface{}
	if err = json.Unmarshal(originalB, &original); err != nil {
		col.db.schemaLock.RUnlock()
		return err
	}
	part.LockUpdate(id)
	if original != nil {
		col.unindexDoc(id, original)
	} else {
		tdlog.Noticef("Will not attempt to unindex document %d during update", id)
	}
	col.indexDoc(id, doc)
	// Done with the index
	part.UnlockUpdate(id)

	col.db.schemaLock.RUnlock()
	return nil
}

// UpdateBytesFunc will update a document bytes.
// update func will get current document bytes and should return bytes of updated document;
// updated document should be valid JSON;
// provided buffer could be modified (reused for returned value);
// non-nil error will be propagated back and returned from UpdateBytesFunc.
func (col *Col) UpdateBytesFunc(id int, update func(origDoc []byte) (newDoc []byte, err error)) error {
	col.db.schemaLock.RLock()
	part := col.parts[id%col.db.numParts]

	// Place lock, read back original document and update
	part.DataLock.Lock()
	originalB, err := part.Read(id)
	if err != nil {
		part.DataLock.Unlock()
		col.db.schemaLock.RUnlock()
		return err
	}
	var original map[string]interface{}
	// Unmarshal originalB before passing it to update
	if err = json.Unmarshal(originalB, &original); err != nil {
		part.DataLock.Unlock()
		col.db.schemaLock.RUnlock()
		return err
	}
	docB, err := update(originalB)
	if err != nil {
		part.DataLock.Unlock()
		col.db.schemaLock.RUnlock()
		return err
	}
	var doc map[string]interface{} // check if docB are valid JSON before Update
	if err = json.Unmarshal(docB, &doc); err != nil {
		part.DataLock.Unlock()
		col.db.schemaLock.RUnlock()
		return err
	}
	err = part.Update(id, docB)
	part.DataLock.Unlock()
	if err != nil {
		col.db.schemaLock.RUnlock()
		return err
	}

	// Done with the collection data, next is to maintain indexed values
	part.LockUpdate(id)
	if original != nil {
		col.unindexDoc(id, original)
	} else {
		tdlog.Noticef("Will not attempt to unindex document %d during update", id)
	}
	col.indexDoc(id, doc)
	// Done with the index
	part.UnlockUpdate(id)

	col.db.schemaLock.RUnlock()
	return nil
}

// UpdateFunc will update a document.
// update func will get current document and should return updated document;
// provided document should NOT be modified;
// non-nil error will be propagated back and returned from UpdateFunc.
func (col *Col) UpdateFunc(id int, update func(origDoc map[string]interface{}) (newDoc map[string]interface{}, err error)) error {
	col.db.schemaLock.RLock()
	part := col.parts[id%col.db.numParts]

	// Place lock, read back original document and update
	part.DataLock.Lock()
	originalB, err := part.Read(id)
	if err != nil {
		part.DataLock.Unlock()
		col.db.schemaLock.RUnlock()
		return err
	}
	var original map[string]interface{}
	err = json.Unmarshal(originalB, &original)
	if err != nil {
		part.DataLock.Unlock()
		col.db.schemaLock.RUnlock()
		return err
	}
	doc, err := update(original)
	if err != nil {
		part.DataLock.Unlock()
		col.db.schemaLock.RUnlock()
		return err
	}
	docJS, err := json.Marshal(doc)
	if err != nil {
		part.DataLock.Unlock()
		col.db.schemaLock.RUnlock()
		return err
	}
	err = part.Update(id, []byte(docJS))
	part.DataLock.Unlock()
	if err != nil {
		col.db.schemaLock.RUnlock()
		return err
	}

	// Done with the collection data, next is to maintain indexed values
	part.LockUpdate(id)
	col.unindexDoc(id, original)
	col.indexDoc(id, doc)
	// Done with the document
	part.UnlockUpdate(id)

	col.db.schemaLock.RUnlock()
	return nil
}

// Delete a document.
func (col *Col) Delete(id int) error {
	col.db.schemaLock.RLock()
	part := col.parts[id%col.db.numParts]

	// Place lock, read back original document and delete document
	part.DataLock.Lock()
	originalB, err := part.Read(id)
	if err != nil {
		part.DataLock.Unlock()
		col.db.schemaLock.RUnlock()
		return err
	}
	err = part.Delete(id)
	part.DataLock.Unlock()
	if err != nil {
		col.db.schemaLock.RUnlock()
		return err
	}

	// Done with the collection data, next is to remove indexed values
	var original map[string]interface{}
	err = json.Unmarshal(originalB, &original)
	if err == nil {
		part.LockUpdate(id)
		col.unindexDoc(id, original)
		part.UnlockUpdate(id)
	} else {
		tdlog.Noticef("Will not attempt to unindex document %d during delete", id)
	}

	col.db.schemaLock.RUnlock()
	return nil
}


text:
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**description** | **String** |  | [optional] [default to None]
**icon_class_name** | **String** |  | [optional] [default to None]
**icon_url** | **String** |  | [optional] [default to None]
**score** | **isize** |  | [optional] [default to None]
**_class** | **String** |  | [optional] [default to None]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


text:
> Display status of jobs in the current session.

- Show status of all jobs:

`jobs`

- Show status of a particular job:

`jobs {{job_id}}`

- Show status and process IDs of all jobs:

`jobs -l`

- Show process IDs of all jobs:

`jobs -p`


text:
from azurelinuxagent.common.protocol.util import get_protocol_util, \
                                                 OVF_FILE_NAME, \
                                                 TAG_FILE_NAME


text:
<?php
namespace fully\core\base\gateway;

interface WriteGatewayInterface
{

}


text:
[![Build Status](https://travis-ci.org/bundler/gemstash.svg?branch=master)](https://travis-ci.org/bundler/gemstash)

## What is Gemstash?

Gemstash is both a cache for remote servers such as https://www.rubygems.org,
and a private gem source.

If you are using [bundler](http://bundler.io/) across many machines that have
access to a server within your control, you might want to use Gemstash.

If you produce gems that you don't want everyone in the world to have access to,
you might want to use Gemstash.

If you frequently bundle the same set of gems across multiple projects, you
might want to use Gemstash.

Are you only using gems from https://www.rubygems.org, and don't bundle the same
gems frequently? Well, maybe you don't need Gemstash... yet.

## Quickstart Guide

### Setup

Gemstash is designed to be quick and painless to get set up. By the end of this
Quickstart Guide, you will be able to bundle stashed gems from public sources
against a Gemstash server running on your machine.

Install Gemstash to get started:

```
$ gem install gemstash
```

After it is installed, starting Gemstash requires no additional steps. Simply
start the Gemstash server with the `gemstash` command:

```
$ gemstash start
```

You may have noticed that the command finished quickly. This is because Gemstash
will run the server in the background by default. The server runs on port 9292.

### Bundling

With the server running, you can bundle against it. Tell Bundler that you want
to use Gemstash to find gems from RubyGems.org:

```
$ bundle config mirror.https://rubygems.org http://localhost:9292
```

Now you can create a Gemfile and install gems through Gemstash:

```ruby
# ./Gemfile
source "https://rubygems.org"
gem "rubywarrior"
```

The gems you include should be gems you don't yet have installed,
otherwise Gemstash will have nothing to stash. Now bundle:

```
$ bundle install --path .bundle
```

Your Gemstash server has fetched the gems from https://www.rubygems.org and
cached them for you! To prove this, you can disable your Internet connection and
try again. The gem dependencies from https://www.rubygems.org are cached for 30
minutes, so if you bundle again before that, you can successfully bundle without
an Internet connection:

```
$ # Disable your Internet first!
$ rm -rf Gemfile.lock .bundle
$ bundle
```

### Stopping the Server

Once you've finish using your Gemstash server, you can stop it just as easily as
you started it:

```
$ gemstash stop
```

You'll also want to tell Bundler that it can go back to getting gems from
RubyGems.org directly, instead of going through Gemstash:

```
$ bundle config --delete mirror.https://rubygems.org
```

### Under the Hood

You might wonder where the gems are stored. After running the commands above,
you will find a new directory at `~/.gemstash`. This directory holds all the
cached and private gems. It also has a server log, the database, and
configuration for Gemstash. If you prefer, you can [point to a different
directory](docs/config.md#files).

Gemstash uses [SQLite](https://www.sqlite.org/) to store details about private
gems. The database will be located in `~/.gemstash`, however you won't see the
database appear until you start using private gems. If you prefer, you can [use
a different database](docs/config.md#database).

Gemstash temporarily caches things like gem dependencies in memory. Anything
cached in memory will last for 30 minutes before being retrieved again. You can
[use memcached](docs/config.md#cache) instead of caching in memory. Gem files
are always cached permanently, so bundling with a `Gemfile.lock` with all gems
cached will never call out to https://www.rubygems.org.

The server you ran is provided via [Puma](http://puma.io/) and
[Rack](http://rack.github.io/), however they are not customizable at this point.

## Deep Dive

For a deep dive into the following subjects, follow the links:
* [Private gems](docs/private_gems.md)
* [Multiple gem sources](docs/multiple_sources.md)
* [Using Gemstash as a mirror](docs/mirror.md)
* [Customizing the server (database, storage, caching, and more)](docs/config.md)
* [Deploying Gemstash](docs/deploy.md)
* [Debugging Gemstash](docs/debug.md)

## Reference

For an anatomy of various configuration and commands, follow the links:
* [Configuration](docs/reference.md#configuration)
* [Authorize](docs/reference.md#authorize)
* [Start](docs/reference.md#start)
* [Stop](docs/reference.md#stop)
* [Status](docs/reference.md#status)
* [Setup](docs/reference.md#setup)
* [Version](docs/reference.md#version)

To see what has changed in recent versions of Gemstash, see the
[CHANGELOG](CHANGELOG.md).

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run
`rake` to run RuboCop and the tests. While developing, you can run
`bin/gemstash` to run Gemstash. You can also run `bin/console` for an
interactive prompt that will allow you to experiment.

## Contributing

Bug reports and pull requests are welcome on GitHub at
https://github.com/bundler/gemstash. This project is intended to be a safe,
welcoming space for collaboration, and contributors are expected to adhere to
the [Contributor Covenant](CODE_OF_CONDUCT.md) code of conduct.

## License

The gem is available as open source under the terms of the
[MIT License](http://opensource.org/licenses/MIT).


text:
============
Architecture
============

Hardware selection involves three key areas:

* Compute

* Network

* Storage

Hardware for a general purpose OpenStack cloud should reflect a cloud
with no pre-defined usage model, designed to run a wide variety of
applications with varying resource usage requirements. These
applications include any of the following:

* RAM-intensive

* CPU-intensive

* Storage-intensive

Certain hardware form factors may better suit a general purpose
OpenStack cloud due to the requirement for equal (or nearly equal)
balance of resources. Server hardware must provide the following:

* Equal (or nearly equal) balance of compute capacity (RAM and CPU)

* Network capacity (number and speed of links)

* Storage capacity (gigabytes or terabytes as well as Input/Output
  Operations Per Second (:term:`IOPS`)

Evaluate server hardware around four conflicting dimensions:

Server density
 A measure of how many servers can fit into a given measure of
 physical space, such as a rack unit [U].

Resource capacity
 The number of CPU cores, amount of RAM, or amount of deliverable
 storage.

Expandability
 Limit of additional resources you can add to a server.

Cost
 The relative purchase price of the hardware weighted against the
 level of design effort needed to build the system.

Increasing server density means sacrificing resource capacity or
expandability, however, increasing resource capacity and expandability
increases cost and decreases server density. As a result, determining
the best server hardware for a general purpose OpenStack architecture
means understanding how choice of form factor will impact the rest of
the design. The following list outlines the form factors to choose from:

* Blade servers typically support dual-socket multi-core CPUs. Blades
  also offer outstanding density.

* 1U rack-mounted servers occupy only a single rack unit. Their
  benefits include high density, support for dual-socket multi-core
  CPUs, and support for reasonable RAM amounts. This form factor offers
  limited storage capacity, limited network capacity, and limited
  expandability.

* 2U rack-mounted servers offer the expanded storage and networking
  capacity that 1U servers tend to lack, but with a corresponding
  decrease in server density (half the density offered by 1U
  rack-mounted servers).

* Larger rack-mounted servers, such as 4U servers, will tend to offer
  even greater CPU capacity, often supporting four or even eight CPU
  sockets. These servers often have much greater expandability so will
  provide the best option for upgradability. This means, however, that
  the servers have a much lower server density and a much greater
  hardware cost.

* *Sled servers* are rack-mounted servers that support multiple
  independent servers in a single 2U or 3U enclosure. This form factor
  offers increased density over typical 1U-2U rack-mounted servers but
  tends to suffer from limitations in the amount of storage or network
  capacity each individual server supports.

The best form factor for server hardware supporting a general purpose
OpenStack cloud is driven by outside business and cost factors. No
single reference architecture applies to all implementations; the
decision must flow from user requirements, technical considerations, and
operational considerations. Here are some of the key factors that
influence the selection of server hardware:

Instance density
 Sizing is an important consideration for a general purpose OpenStack
 cloud. The expected or anticipated number of instances that each
 hypervisor can host is a common meter used in sizing the deployment.
 The selected server hardware needs to support the expected or
 anticipated instance density.

Host density
 Physical data centers have limited physical space, power, and
 cooling. The number of hosts (or hypervisors) that can be fitted
 into a given metric (rack, rack unit, or floor tile) is another
 important method of sizing. Floor weight is an often overlooked
 consideration. The data center floor must be able to support the
 weight of the proposed number of hosts within a rack or set of
 racks. These factors need to be applied as part of the host density
 calculation and server hardware selection.

Power density
 Data centers have a specified amount of power fed to a given rack or
 set of racks. Older data centers may have a power density as power
 as low as 20 AMPs per rack, while more recent data centers can be
 architected to support power densities as high as 120 AMP per rack.
 The selected server hardware must take power density into account.

Network connectivity
 The selected server hardware must have the appropriate number of
 network connections, as well as the right type of network
 connections, in order to support the proposed architecture. Ensure
 that, at a minimum, there are at least two diverse network
 connections coming into each rack.

The selection of form factors or architectures affects the selection of
server hardware. Ensure that the selected server hardware is configured
to support enough storage capacity (or storage expandability) to match
the requirements of selected scale-out storage solution. Similarly, the
network architecture impacts the server hardware selection and vice
versa.

Selecting storage hardware
~~~~~~~~~~~~~~~~~~~~~~~~~~

Determine storage hardware architecture by selecting specific storage
architecture. Determine the selection of storage architecture by
evaluating possible solutions against the critical factors, the user
requirements, technical considerations, and operational considerations.
Incorporate the following facts into your storage architecture:

Cost
 Storage can be a significant portion of the overall system cost. For
 an organization that is concerned with vendor support, a commercial
 storage solution is advisable, although it comes with a higher price
 tag. If initial capital expenditure requires minimization, designing
 a system based on commodity hardware would apply. The trade-off is
 potentially higher support costs and a greater risk of
 incompatibility and interoperability issues.

Scalability
 Scalability, along with expandability, is a major consideration in a
 general purpose OpenStack cloud. It might be difficult to predict
 the final intended size of the implementation as there are no
 established usage patterns for a general purpose cloud. It might
 become necessary to expand the initial deployment in order to
 accommodate growth and user demand.

Expandability
 Expandability is a major architecture factor for storage solutions
 with general purpose OpenStack cloud. A storage solution that
 expands to 50 PB is considered more expandable than a solution that
 only scales to 10 PB. This meter is related to scalability, which is
 the measure of a solution's performance as it expands.

Using a scale-out storage solution with direct-attached storage (DAS) in
the servers is well suited for a general purpose OpenStack cloud. Cloud
services requirements determine your choice of scale-out solution. You
need to determine if a single, highly expandable and highly vertical,
scalable, centralized storage array is suitable for your design. After
determining an approach, select the storage hardware based on this
criteria.

This list expands upon the potential impacts for including a particular
storage architecture (and corresponding storage hardware) into the
design for a general purpose OpenStack cloud:

Connectivity
 Ensure that, if storage protocols other than Ethernet are part of
 the storage solution, the appropriate hardware has been selected. If
 a centralized storage array is selected, ensure that the hypervisor
 will be able to connect to that storage array for image storage.

Usage
 How the particular storage architecture will be used is critical for
 determining the architecture. Some of the configurations that will
 influence the architecture include whether it will be used by the
 hypervisors for ephemeral instance storage or if OpenStack Object
 Storage will use it for object storage.

Instance and image locations
 Where instances and images will be stored will influence the
 architecture.

Server hardware
 If the solution is a scale-out storage architecture that includes
 DAS, it will affect the server hardware selection. This could ripple
 into the decisions that affect host density, instance density, power
 density, OS-hypervisor, management tools and others.

General purpose OpenStack cloud has multiple options. The key factors
that will have an influence on selection of storage hardware for a
general purpose OpenStack cloud are as follows:

Capacity
 Hardware resources selected for the resource nodes should be capable
 of supporting enough storage for the cloud services. Defining the
 initial requirements and ensuring the design can support adding
 capacity is important. Hardware nodes selected for object storage
 should be capable of support a large number of inexpensive disks
 with no reliance on RAID controller cards. Hardware nodes selected
 for block storage should be capable of supporting high speed storage
 solutions and RAID controller cards to provide performance and
 redundancy to storage at a hardware level. Selecting hardware RAID
 controllers that automatically repair damaged arrays will assist
 with the replacement and repair of degraded or deleted storage
 devices.

Performance
 Disks selected for object storage services do not need to be fast
 performing disks. We recommend that object storage nodes take
 advantage of the best cost per terabyte available for storage.
 Contrastingly, disks chosen for block storage services should take
 advantage of performance boosting features that may entail the use
 of SSDs or flash storage to provide high performance block storage
 pools. Storage performance of ephemeral disks used for instances
 should also be taken into consideration.

Fault tolerance
 Object storage resource nodes have no requirements for hardware
 fault tolerance or RAID controllers. It is not necessary to plan for
 fault tolerance within the object storage hardware because the
 object storage service provides replication between zones as a
 feature of the service. Block storage nodes, compute nodes, and
 cloud controllers should all have fault tolerance built in at the
 hardware level by making use of hardware RAID controllers and
 varying levels of RAID configuration. The level of RAID chosen
 should be consistent with the performance and availability
 requirements of the cloud.

Selecting networking hardware
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Selecting network architecture determines which network hardware will be
used. Networking software is determined by the selected networking
hardware.

There are more subtle design impacts that need to be considered. The
selection of certain networking hardware (and the networking software)
affects the management tools that can be used. There are exceptions to
this; the rise of *open* networking software that supports a range of
networking hardware means that there are instances where the
relationship between networking hardware and networking software are not
as tightly defined.

Some of the key considerations that should be included in the selection
of networking hardware include:

Port count
 The design will require networking hardware that has the requisite
 port count.

Port density
 The network design will be affected by the physical space that is
 required to provide the requisite port count. A higher port density
 is preferred, as it leaves more rack space for compute or storage
 components that may be required by the design. This can also lead
 into concerns about fault domains and power density that should be
 considered. Higher density switches are more expensive and should
 also be considered, as it is important not to over design the
 network if it is not required.

Port speed
 The networking hardware must support the proposed network speed, for
 example: 1 GbE, 10 GbE, or 40 GbE (or even 100 GbE).

Redundancy
 The level of network hardware redundancy required is influenced by
 the user requirements for high availability and cost considerations.
 Network redundancy can be achieved by adding redundant power
 supplies or paired switches. If this is a requirement, the hardware
 will need to support this configuration.

Power requirements
 Ensure that the physical data center provides the necessary power
 for the selected network hardware.

.. note::

   This may be an issue for spine switches in a leaf and spine
   fabric, or end of row (EoR) switches.

There is no single best practice architecture for the networking
hardware supporting a general purpose OpenStack cloud that will apply to
all implementations. Some of the key factors that will have a strong
influence on selection of networking hardware include:

Connectivity
 All nodes within an OpenStack cloud require network connectivity. In
 some cases, nodes require access to more than one network segment.
 The design must encompass sufficient network capacity and bandwidth
 to ensure that all communications within the cloud, both north-south
 and east-west traffic have sufficient resources available.

Scalability
 The network design should encompass a physical and logical network
 design that can be easily expanded upon. Network hardware should
 offer the appropriate types of interfaces and speeds that are
 required by the hardware nodes.

Availability
 To ensure that access to nodes within the cloud is not interrupted,
 we recommend that the network architecture identify any single
 points of failure and provide some level of redundancy or fault
 tolerance. With regard to the network infrastructure itself, this
 often involves use of networking protocols such as LACP, VRRP or
 others to achieve a highly available network connection. In
 addition, it is important to consider the networking implications on
 API availability. In order to ensure that the APIs, and potentially
 other services in the cloud are highly available, we recommend you
 design a load balancing solution within the network architecture to
 accommodate for these requirements.

Software selection
~~~~~~~~~~~~~~~~~~

Software selection for a general purpose OpenStack architecture design
needs to include these three areas:

* Operating system (OS) and hypervisor

* OpenStack components

* Supplemental software

Operating system and hypervisor
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The operating system (OS) and hypervisor have a significant impact on
the overall design. Selecting a particular operating system and
hypervisor can directly affect server hardware selection. Make sure the
storage hardware and topology support the selected operating system and
hypervisor combination. Also ensure the networking hardware selection
and topology will work with the chosen operating system and hypervisor
combination.

Some areas that could be impacted by the selection of OS and hypervisor
include:

Cost
 Selecting a commercially supported hypervisor, such as Microsoft
 Hyper-V, will result in a different cost model rather than
 community-supported open source hypervisors including
 :term:`KVM<kernel-based VM (KVM)>`, Kinstance or :term:`Xen`. When
 comparing open source OS solutions, choosing Ubuntu over Red Hat
 (or vice versa) will have an impact on cost due to support
 contracts.

Supportability
 Depending on the selected hypervisor, staff should have the
 appropriate training and knowledge to support the selected OS and
 hypervisor combination. If they do not, training will need to be
 provided which could have a cost impact on the design.

Management tools
 The management tools used for Ubuntu and Kinstance differ from the
 management tools for VMware vSphere. Although both OS and hypervisor
 combinations are supported by OpenStack, there will be very
 different impacts to the rest of the design as a result of the
 selection of one combination versus the other.

Scale and performance
 Ensure that selected OS and hypervisor combinations meet the
 appropriate scale and performance requirements. The chosen
 architecture will need to meet the targeted instance-host ratios
 with the selected OS-hypervisor combinations.

Security
 Ensure that the design can accommodate regular periodic
 installations of application security patches while maintaining
 required workloads. The frequency of security patches for the
 proposed OS-hypervisor combination will have an impact on
 performance and the patch installation process could affect
 maintenance windows.

Supported features
 Determine which features of OpenStack are required. This will often
 determine the selection of the OS-hypervisor combination. Some
 features are only available with specific operating systems or
 hypervisors.

Interoperability
 You will need to consider how the OS and hypervisor combination
 interactions with other operating systems and hypervisors, including
 other software solutions. Operational troubleshooting tools for one
 OS-hypervisor combination may differ from the tools used for another
 OS-hypervisor combination and, as a result, the design will need to
 address if the two sets of tools need to interoperate.

OpenStack components
~~~~~~~~~~~~~~~~~~~~

Selecting which OpenStack components are included in the overall design
is important. Some OpenStack components, like compute and Image service,
are required in every architecture. Other components, like
Orchestration, are not always required.

Excluding certain OpenStack components can limit or constrain the
functionality of other components. For example, if the architecture
includes Orchestration but excludes Telemetry, then the design will not
be able to take advantage of Orchestrations' auto scaling functionality.
It is important to research the component interdependencies in
conjunction with the technical requirements before deciding on the final
architecture.

Networking software
-------------------

OpenStack Networking (neutron) provides a wide variety of networking
services for instances. There are many additional networking software
packages that can be useful when managing OpenStack components. Some
examples include:

* Software to provide load balancing

* Network redundancy protocols

* Routing daemons

Some of these software packages are described in more detail in the
OpenStack High Availability Guide (refer to the `OpenStack network
nodes
chapter <http://docs.openstack.org/ha-guide/networking-ha.html>`__ of
the OpenStack High Availability Guide).

For a general purpose OpenStack cloud, the OpenStack infrastructure
components need to be highly available. If the design does not include
hardware load balancing, networking software packages like HAProxy will
need to be included.

Management software
-------------------

Selected supplemental software solution impacts and affects the overall
OpenStack cloud design. This includes software for providing clustering,
logging, monitoring and alerting.

Inclusion of clustering software, such as Corosync or Pacemaker, is
determined primarily by the availability requirements. The impact of
including (or not including) these software packages is primarily
determined by the availability of the cloud infrastructure and the
complexity of supporting the configuration after it is deployed. The
`OpenStack High Availability
Guide <http://docs.openstack.org/ha-guide/>`__ provides more details on
the installation and configuration of Corosync and Pacemaker, should
these packages need to be included in the design.

Requirements for logging, monitoring, and alerting are determined by
operational considerations. Each of these sub-categories includes a
number of various options.

If these software packages are required, the design must account for the
additional resource consumption (CPU, RAM, storage, and network
bandwidth). Some other potential design impacts include:

* OS-hypervisor combination: Ensure that the selected logging,
  monitoring, or alerting tools support the proposed OS-hypervisor
  combination.

* Network hardware: The network hardware selection needs to be
  supported by the logging, monitoring, and alerting software.

Database software
-----------------

OpenStack components often require access to back-end database services
to store state and configuration information. Selecting an appropriate
back-end database that satisfies the availability and fault tolerance
requirements of the OpenStack services is required. OpenStack services
supports connecting to a database that is supported by the SQLAlchemy
python drivers, however, most common database deployments make use of
MySQL or variations of it. We recommend that the database, which
provides back-end service within a general purpose cloud, be made highly
available when using an available technology which can accomplish that
goal.


text:
package com.jay.marqueeview;

import java.util.ArrayList;
import java.util.List;

import com.jay.marqueeview.widget.MarqueeView;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends Activity {
	private MarqueeView mv_list;

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

		findView();
		setEvent();
	}

	private void findView() {
		mv_list = (MarqueeView) findViewById(R.id.mv_list);
	}

	private void setEvent() {
		List<String> info = new ArrayList<String>();
        info.add("1. 淘宝头条");
        info.add("2. 京东快报");
        info.add("3. 博客地址:http://blog.csdn.net/jayliu1989/article/details/51713420");
        info.add("4. 项目地址:https://github.com/Winfred1989/MarqueeView");
        info.add("5. 参考:http://www.jianshu.com/p/d9442041743f");
        mv_list.startWithList(info);

        mv_list.setOnClickListener(listener);
	}

	private OnClickListener listener = new OnClickListener() {

		@Override
		public void onClick(View v) {
			// TODO 点击MarqueeView能直接定位到点击时的TextView
			Toast.makeText(MainActivity.this, ((TextView)v).getText(), Toast.LENGTH_SHORT).show();
		}
	};

}


text:
@interface AppDelegate_Pad : NSObject <UIApplicationDelegate> {
    UIWindow *window;
}

@property (nonatomic, retain) IBOutlet UIWindow *window;

@end


text:
layout: default
scripts:
permalink: applications/renewable-energy-mapping.html
title: Renewable Energy Mapping
parent: applications

prev: Population Estimation, Modelling, and Migration
next: Digital Microplanning

---

## [Renewable Energy Mapping](https://www.sciencedirect.com/science/article/abs/pii/S0034425721003084)

There are a growing number of applications that demonstrate the use of satellite data in the renewable energy sector. Satellite data can in many cases better inform resource assessments, especially those done at a large spatial scale. For example, solar radiation can be measured from space and inform decision-making on where to put solar farms. In addition, more comprehensive environmental impact assessments can be conducted with satellite data. This ensures that investments in renewable energy or not only well informed but have limited impact on the natural environment. Among the mapping of renewable energy resources and generation, other applications include energy access mapping, electrification modelling and smart grid planning.

OnSSET is an open source, spatial electrification tool that provides technology and investment outlooks on expanding access through on grid, off-grid and mini-grid systems. Considering several data layers such as renewable energy potential, location of infrastructure (grid network, roads, power plants), OnSSET maps out the mix of technologies that are the most cost-efficient across the studied region to reach certain electricity access goals.1

Some recent demonstration projects by ESA have included Gridwatch, which was aimed to detect small, slow movements of transmission towers and the ground, Point 4 designed for vegetation monitoring and auditing, Sharper Shape designed for distribution and transmission asset management and ISSWind for offshore wind resource mapping.2

Related to renewable energy mapping is the mapping and estimation of carbon sequestration potential (carbon capture) by estimating ground biomass and seasonal productivity of forests and other ecosystems.

---

1) [https://cleantechnica.com/2019/05/10/seeing-energy-from-space-5-tools-using-remote-sensing-to-improve-life-on-earth/](https://cleantechnica.com/2019/05/10/seeing-energy-from-space-5-tools-using-remote-sensing-to-improve-life-on-earth/)
2) [https://www.smart-energy.com/industry-sectors/data_analytics/satellite-data-to-support-the-renewables-transition/](https://www.smart-energy.com/industry-sectors/data_analytics/satellite-data-to-support-the-renewables-transition/)


text:
An abstraction layer between the CMS and [Github](https://docs.github.com/en/rest)

## Code structure

`Implementation` for [File Management System API](https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-lib-util/README.md) based on `Api`.

`Api` - A wrapper for GitHub REST API.

`GraphQLApi` - `Api` with `ApolloClient`. [Api docs](https://docs.github.com/en/graphql) and [netlify docs](https://www.netlifycms.org/docs/beta-features/#github-graphql-api).

`AuthenticationPage` -  uses [lib-auth](https://github.com/netlify/netlify-cms/tree/master/packages/netlify-cms-lib-auth/README.md) to facilitate OAuth and implicit authentication.

`scripts` -  use `createFragmentTypes.js` to create GitHub GraphQL API fragment types.

Look at tests or types for more info.


text:
<bindings xmlns="http://www.mozilla.org/xbl">
<binding id="a">
<implementation>
<destructor>
  window.frameElement.parentNode.removeChild(window.frameElement);
</destructor>
</implementation>
<content>
<children/>
</content>
</binding>
</bindings>


text:
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import {NativeEventTarget as EventTarget} from 'chrome://resources/js/cr/event_target.m.js';

import {BrowserApi} from './browser_api.js';

/**
 * Abstract parent of classes that manage updating the browser
 * with zoom changes and/or updating the viewer's zoom when
 * the browser zoom changes.
 */
export class ZoomManager {
  /**
   * @param {function():number} getViewportZoom Callback to get the viewport's
   *     current zoom level.
   * @param {number} initialZoom The initial browser zoom level.
   */
  constructor(getViewportZoom, initialZoom) {
    if (this.constructor === ZoomManager) {
      throw new TypeError('Instantiated abstract class: ZoomManager');
    }

    /** @private {number} */
    this.browserZoom_ = initialZoom;

    /** @private {function():number} */
    this.getViewportZoom_ = getViewportZoom;

    /** @private {!EventTarget} */
    this.eventTarget_ = new EventTarget();
  }

  /** @return {!EventTarget} */
  getEventTarget() {
    return this.eventTarget_;
  }

  /**
   * Creates the appropriate kind of zoom manager given the zoom behavior.
   *
   * @param {BrowserApi.ZoomBehavior} zoomBehavior How to manage zoom.
   * @param {function():number} getViewportZoom A function that gets the current
   *     viewport zoom.
   * @param {function(number):Promise} setBrowserZoomFunction A function that
   *     sets the browser zoom to the provided value.
   * @param {number} initialZoom The initial browser zoom level.
   */
  static create(
      zoomBehavior, getViewportZoom, setBrowserZoomFunction, initialZoom) {
    switch (zoomBehavior) {
      case BrowserApi.ZoomBehavior.MANAGE:
        return new ActiveZoomManager(
            getViewportZoom, setBrowserZoomFunction, initialZoom);
      case BrowserApi.ZoomBehavior.PROPAGATE_PARENT:
        return new EmbeddedZoomManager(getViewportZoom, initialZoom);
      default:
        return new InactiveZoomManager(getViewportZoom, initialZoom);
    }
  }

  /**
   * Invoked when a browser-initiated zoom-level change occurs.
   *
   * @param {number} newZoom the zoom level to zoom to.
   */
  onBrowserZoomChange(newZoom) {}

  /**
   * Invoked when an extension-initiated zoom-level change occurs.
   */
  onPdfZoomChange() {}

  /**
   * Combines the internal pdf zoom and the browser zoom to
   * produce the total zoom level for the viewer.
   *
   * @param {number} internalZoom the zoom level internal to the viewer.
   * @return {number} the total zoom level.
   */
  applyBrowserZoom(internalZoom) {
    return this.browserZoom_ * internalZoom;
  }

  /**
   * Given a zoom level, return the internal zoom level needed to
   * produce that zoom level.
   *
   * @param {number} totalZoom the total zoom level.
   * @return {number} the zoom level internal to the viewer.
   */
  internalZoomComponent(totalZoom) {
    return totalZoom / this.browserZoom_;
  }

  /**
   * Returns whether two numbers are approximately equal.
   *
   * @param {number} a The first number.
   * @param {number} b The second number.
   */
  floatingPointEquals(a, b) {
    const MIN_ZOOM_DELTA = 0.01;
    // If the zoom level is close enough to the current zoom level, don't
    // change it. This avoids us getting into an infinite loop of zoom changes
    // due to floating point error.
    return Math.abs(a - b) <= MIN_ZOOM_DELTA;
  }
}

/**
 * InactiveZoomManager has no control over the browser's zoom
 * and does not respond to browser zoom changes.
 */
export class InactiveZoomManager extends ZoomManager {}

/**
 * ActiveZoomManager controls the browser's zoom.
 */
class ActiveZoomManager extends ZoomManager {
  /**
   * Constructs a ActiveZoomManager.
   * @param {function():number} getViewportZoom A function that gets the current
   *     viewport zoom level
   * @param {function(number):Promise} setBrowserZoomFunction A function that
   *     sets the browser zoom to the provided value.
   * @param {number} initialZoom The initial browser zoom level.
   */
  constructor(getViewportZoom, setBrowserZoomFunction, initialZoom) {
    super(getViewportZoom, initialZoom);

    /** @private {function(number):Promise} */
    this.setBrowserZoomFunction_ = setBrowserZoomFunction;

    /** @private {?Promise} */
    this.changingBrowserZoom_ = null;
  }

  /**
   * Invoked when a browser-initiated zoom-level change occurs.
   *
   * @param {number} newZoom the zoom level to zoom to.
   */
  onBrowserZoomChange(newZoom) {
    // If we are changing the browser zoom level, ignore any browser zoom level
    // change events. Either, the change occurred before our update and will be
    // overwritten, or the change being reported is the change we are making,
    // which we have already handled.
    if (this.changingBrowserZoom_) {
      return;
    }

    if (this.floatingPointEquals(this.browserZoom_, newZoom)) {
      return;
    }

    this.browserZoom_ = newZoom;
    this.eventTarget_.dispatchEvent(
        new CustomEvent('set-zoom', {detail: newZoom}));
  }

  /**
   * Invoked when an extension-initiated zoom-level change occurs.
   * @override
   */
  onPdfZoomChange() {
    // If we are already changing the browser zoom level in response to a
    // previous extension-initiated zoom-level change, ignore this zoom change.
    // Once the browser zoom level is changed, we check whether the extension's
    // zoom level matches the most recently sent zoom level.
    if (this.changingBrowserZoom_) {
      return;
    }

    const viewportZoom = this.getViewportZoom_();
    if (this.floatingPointEquals(this.browserZoom_, viewportZoom)) {
      return;
    }

    this.changingBrowserZoom_ =
        this.setBrowserZoomFunction_(viewportZoom).then(() => {
          this.browserZoom_ = viewportZoom;
          this.changingBrowserZoom_ = null;

          // The extension's zoom level may have changed while the browser zoom
          // change was in progress. We call back into onPdfZoomChange to ensure
          // the browser zoom is up to date.
          this.onPdfZoomChange();
        });
  }

  /**
   * Combines the internal pdf zoom and the browser zoom to
   * produce the total zoom level for the viewer.
   *
   * @param {number} internalZoom the zoom level internal to the viewer.
   * @return {number} the total zoom level.
   */
  applyBrowserZoom(internalZoom) {
    // The internal zoom and browser zoom are changed together, so the
    // browser zoom is already applied.
    return internalZoom;
  }

  /**
   * Given a zoom level, return the internal zoom level needed to
   * produce that zoom level.
   *
   * @param {number} totalZoom the total zoom level.
   * @return {number} the zoom level internal to the viewer.
   */
  internalZoomComponent(totalZoom) {
    // The internal zoom and browser zoom are changed together, so the
    // internal zoom is the total zoom.
    return totalZoom;
  }
}

/**
 * This EmbeddedZoomManager responds to changes in the browser zoom,
 * but does not control the browser zoom.
 */
class EmbeddedZoomManager extends ZoomManager {
  /**
   * Invoked when a browser-initiated zoom-level change occurs.
   *
   * @param {number} newZoom the new browser zoom level.
   */
  onBrowserZoomChange(newZoom) {
    const oldZoom = this.browserZoom_;
    this.browserZoom_ = newZoom;
    this.eventTarget_.dispatchEvent(
        new CustomEvent('update-zoom-from-browser', {detail: oldZoom}));
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<module>
  <inherits name='scoutmgr.Scoutmgr'/>
  <inherits name='scoutmgr.modules.ScoutmgrAppSupport'/>

  <inherits name="com.gwtplatform.mvp.MvpWithEntryPoint"/>
  <inherits name="gwt.material.design.GwtMaterialWithJQueryDebug"/>
  <!--<inherits name="gwt.material.design.GwtMaterialDesignBasic" />-->
  <!--<inherits name="gwt.material.design.addins.GWTMaterialAddins"/>-->
  <inherits name="gwt.material.design.themes.GwtMaterialThemeBlue"/>

  <set-configuration-property name="gin.ginjector.modules" value="scoutmgr.client.ioc.ScoutmgrClientModule" />
  <set-configuration-property name="gin.ginjector.extensions" value="scoutmgr.client.ioc.ScoutmgrGinjector" />
  <set-configuration-property name="gwtp.bootstrapper" value="scoutmgr.client.Bootstrap"/>
  <set-configuration-property name="gwtp.prebootstrapper" value="scoutmgr.client.Prebootstrap"/>
</module>


text:
import { moduleForModel, test } from 'ember-qunit';

moduleForModel('topics', 'Unit | Model | topics', {
  // Specify the other units that are required for this test.
  needs: []
});

test('it exists', function(assert) {
  var model = this.subject();
  // var store = this.store();
  assert.ok(!!model);
});


text:
title: Telerik.Web.UI.PersistenceFramework.PersistenceFrameworkStorageException
page_title: Telerik.Web.UI.PersistenceFramework.PersistenceFrameworkStorageException
description: Telerik.Web.UI.PersistenceFramework.PersistenceFrameworkStorageException
---

# Telerik.Web.UI.PersistenceFramework.PersistenceFrameworkStorageException

Storage-specific exception thrown by RadPersistenceFramework

## Inheritance Hierarchy

* System.Object
* System.Exception
* Telerik.Web.UI.PersistenceFramework.PersistenceFrameworkException
* Telerik.Web.UI.PersistenceFramework.PersistenceFrameworkStorageException


text:
__version__ = '0.3.10'

__all__ = [
    'YubiAuth',
    'settings',
    'create_tables',
]

from yubiauth.config import settings
from yubiauth.core.controller import YubiAuth

from yubiauth.util.model import engine
from yubiauth.core.model import Base as core_base
from yubiauth.client.model import Base as client_base

def create_tables(engine=engine):
    core_base.metadata.create_all(engine)
    client_base.metadata.create_all(engine)

#TODO: Remove?
create_tables()