text:
namespace cwisstable {
template <typename T>
struct DefaultHash {
  size_t operator()(const T& val) {
    CWISS_AbslHash_State state = CWISS_AbslHash_kInit;
    CWISS_AbslHash_Write(&state, &val, sizeof(T));
    return CWISS_AbslHash_Finish(state);
  }
};

struct HashStdString {
  template <typename S>
  size_t operator()(const S& s) {
    CWISS_AbslHash_State state = CWISS_AbslHash_kInit;
    size_t size = s.size();
    CWISS_AbslHash_Write(&state, &size, sizeof(size_t));
    CWISS_AbslHash_Write(&state, s.data(), s.size());
    return CWISS_AbslHash_Finish(state);
  }
};

template <typename T>
struct DefaultEq {
  bool operator()(const T& a, const T& b) { return a == b; }
};

template <typename T, typename Hash, typename Eq>
struct FlatPolicyWrapper {
  CWISS_GCC_PUSH
  CWISS_GCC_ALLOW("-Waddress")
  // clang-format off
  CWISS_DECLARE_FLAT_SET_POLICY(kPolicy, T,
    (modifiers, static constexpr),
    (obj_copy, [](void* dst, const void* src) {
      new (dst) T(*static_cast<const T*>(src));
    }),
    (obj_dtor, [](void* val) {
      static_cast<T*>(val)->~T();
    }),
    (key_hash, [](const void* val) {
      return Hash{}(*static_cast<const T*>(val));
    }),
    (key_eq, [](const void* a, const void* b) {
      return Eq{}(*static_cast<const T*>(a), *static_cast<const T*>(b));
    }),
    (slot_transfer, [](void* dst, void* src) {
      T* old = static_cast<T*>(src);
      new (dst) T(std::move(*old));
      old->~T();
    }));
  // clang-format on
  CWISS_GCC_POP
};

template <typename T, typename Hash = DefaultHash<T>,
          typename Eq = DefaultEq<T>>
constexpr const CWISS_Policy& FlatPolicy() {
  return FlatPolicyWrapper<T, Hash, Eq>::kPolicy;
}

template <typename K, typename V, typename Hash, typename Eq>
struct FlatMapPolicyWrapper {
  CWISS_GCC_PUSH
  CWISS_GCC_ALLOW("-Waddress")
  // clang-format off
  CWISS_DECLARE_FLAT_MAP_POLICY(kPolicy, K, V,
    (modifiers, static constexpr),
    (obj_copy, [](void* dst, const void* src) {
      new (dst) kPolicy_Entry(*static_cast<const kPolicy_Entry*>(src));
    }),
    (obj_dtor, [](void* val) {
      static_cast<kPolicy_Entry*>(val)->~kPolicy_Entry();
    }),
    (key_hash, [](const void* val) {
      return Hash{}(static_cast<const kPolicy_Entry*>(val)->k);
    }),
    (key_eq, [](const void* a, const void* b) {
      return Eq{}(static_cast<const kPolicy_Entry*>(a)->k,
                  static_cast<const kPolicy_Entry*>(b)->k);
    }),
    (slot_transfer, [](void* dst, void* src) {
      kPolicy_Entry* old = static_cast<kPolicy_Entry*>(src);
      new (dst) kPolicy_Entry(std::move(*old));
      old->~kPolicy_Entry();
    }));
  // clang-format on
  CWISS_GCC_POP
};

template <typename K, typename V, typename Hash = DefaultHash<K>,
          typename Eq = DefaultEq<K>>
constexpr const CWISS_Policy& FlatMapPolicy() {
  return FlatMapPolicyWrapper<K, V, Hash, Eq>::kPolicy;
}

// Helpers for doing some operations on tables with minimal pain.
//
// This macro expands to functions that will form an overload set with other
// table types.
#define TABLE_HELPERS(HashSet_)                                                \
  CWISS_INLINE_ALWAYS                                                          \
  inline HashSet_##_Entry* Find(HashSet_& set, const HashSet_##_Key& needle) { \
    auto it = HashSet_##_find(&set, &needle);                                  \
    return HashSet_##_Iter_get(&it);                                           \
  }                                                                            \
  CWISS_INLINE_ALWAYS                                                          \
  inline std::pair<HashSet_##_Entry*, bool> Insert(                            \
      HashSet_& set, const HashSet_##_Entry& value) {                          \
    auto it = HashSet_##_insert(&set, &value);                                 \
    return {HashSet_##_Iter_get(&it.iter), it.inserted};                       \
  }                                                                            \
  CWISS_INLINE_ALWAYS                                                          \
  inline std::pair<HashSet_##_Entry*, bool> LazyInsert(                        \
      HashSet_& set, const HashSet_##_Key& value) {                            \
    auto it = HashSet_##_deferred_insert(&set, &value);                        \
    return {HashSet_##_Iter_get(&it.iter), it.inserted};                       \
  }                                                                            \
  CWISS_INLINE_ALWAYS                                                          \
  inline std::pair<HashSet_##_Entry*, bool> MoveInsert(                        \
      HashSet_& set, HashSet_##_Entry&& value) {                               \
    auto [ptr, inserted] = LazyInsert(set, value);                             \
    if (inserted) {                                                            \
      new (ptr) HashSet_##_Entry(value);                                       \
    }                                                                          \
    return {ptr, inserted};                                                    \
  }                                                                            \
  CWISS_INLINE_ALWAYS                                                          \
  inline bool Erase(HashSet_& set, const HashSet_##_Key& needle) {             \
    return HashSet_##_erase(&set, &needle);                                    \
  }                                                                            \
  CWISS_INLINE_ALWAYS                                                          \
  inline std::vector<HashSet_##_Entry> Collect(const HashSet_& set) {          \
    std::vector<HashSet_##_Entry> items;                                       \
    items.reserve(HashSet_##_size(&set));                                      \
    for (auto it = HashSet_##_citer(&set); HashSet_##_CIter_get(&it);          \
         HashSet_##_CIter_next(&it)) {                                         \
      items.push_back(*HashSet_##_CIter_get(&it));                             \
    }                                                                          \
    return items;                                                              \
  }
}  // namespace cwisstable

#endif  // CWISSTABLE_TEST_HELPERS_H_


text:
package mx.iteso.desi.cloud;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import org.apache.hadoop.io.DoubleWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.Writable;

/**
 * URLGeocodeWritable -- wrapper for serializing Geocode class
 *
 */
public class GeocodeWritable implements Writable {

    private Text name;
    private DoubleWritable lat;
    private DoubleWritable lon;

    public GeocodeWritable() {
        set(new Text(), new DoubleWritable(0), new DoubleWritable(0));
    }

    public GeocodeWritable(String name, double lat, double lon) {
        set(new Text(name), new DoubleWritable(lat), new DoubleWritable(lon));
    }

    public GeocodeWritable(Geocode g) {
        set(new Text(g.getName()), new DoubleWritable(g.getLatitude()), new DoubleWritable(g.getLongitude()));
    }

    public GeocodeWritable(Text name, DoubleWritable lat, DoubleWritable lon) {
        this.name = name;
        this.lat = lat;
        this.lon = lon;
    }

    public Geocode getGeocode() {
        return new Geocode(getName().toString(), getLatitude(), getLongitude());
    }

    public Text getName() {
        return name;
    }

    public double getLatitude() {
        return lat.get();
    }

    public double getLongitude() {
        return lon.get();
    }

    public void set(Text n, DoubleWritable la, DoubleWritable lo) {
        name = n;
        lat = la;
        lon = lo;
    }

    public void readFields(DataInput arg0) throws IOException {
        name.readFields(arg0);
        lat.readFields(arg0);
        lon.readFields(arg0);
    }

    public void write(DataOutput arg0) throws IOException {
        name.write(arg0);
        lat.write(arg0);
        lon.write(arg0);
    }

    @Override
    public int hashCode() {
        return name.hashCode() * 163 + (lat.hashCode() ^ lon.hashCode());
    }

    @Override
    public String toString() {
        return name + "\t(" + lat + "," + lon + ")";
    }

    @Override
    public boolean equals(Object o) {
        if (!(o instanceof GeocodeWritable)) {
            return false;
        }

        GeocodeWritable u = (GeocodeWritable) o;
        return name.equals(u.name) && u.lat == lat && u.lon == lon;
    }
}

// EOF

redpajama_set_name: RedPajamaGithub


text:
import { application } from "kamboja"

export const app = application(__dirname).init()


text:
Javascript Code with Scope: Unicode and embedded null in code string, empty scope
--XFAIL--
Embedded null in code string is not supported in libbson (CDRIVER-1879)
--DESCRIPTION--
Generated by scripts/convert-bson-corpus-tests.php

DO NOT EDIT THIS FILE
--FILE--
<?php

require_once __DIR__ . '/../utils/tools.php';

$canonicalBson = hex2bin('1A0000000F61001200000005000000C3A9006400050000000000');
$canonicalExtJson = '{"a" : {"$code" : "\\u00e9\\u0000d", "$scope" : {}}}';

// Canonical BSON -> Native -> Canonical BSON
echo bin2hex(fromPHP(toPHP($canonicalBson))), "\n";

// Canonical BSON -> Canonical extJSON
echo json_canonicalize(toCanonicalExtendedJSON($canonicalBson)), "\n";

// Canonical extJSON -> Canonical BSON
echo bin2hex(fromJSON($canonicalExtJson)), "\n";

?>
===DONE===
<?php exit(0); ?>
--EXPECT--
1a0000000f61001200000005000000c3a9006400050000000000
{"a":{"$code":"\u00e9\u0000d","$scope":{}}}
1a0000000f61001200000005000000c3a9006400050000000000
===DONE===


text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0">
<context>
    <name>AddStopPage</name>
    <message>
        <source>Add</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <source>Stop number</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <source>Route number</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <source>Route number - optional</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <source>Nickname - optional</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <source>Nickname</source>
        <translation type="unfinished"></translation>
    </message>
</context>
<context>
    <name>FirstPage</name>
    <message>
        <source>Stops</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <source>Add stop</source>
        <translation type="unfinished"></translation>
    </message>
</context>
<context>
    <name>SailingTrams</name>
    <message>
        <source>SailingTrams</source>
        <translation type="unfinished"></translation>
    </message>
</context>
<context>
    <name>StopPage</name>
    <message>
        <source>Stop: </source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <source>Route: </source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <source>Update</source>
        <translation type="unfinished"></translation>
    </message>
</context>
<context>
    <name>database</name>
    <message>
        <source>Stop </source>
        <translation type="unfinished"></translation>
    </message>
</context>
</TS>


text:
<!DOCTYPE html>

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

<title>Lazy Social Buttons Plugin</title>

Lazy Social Buttons Plugin

lazySocialButtons.js: A JavaScript plugin to place social buttons on a page on user interaction (mouseover) to spare the initial page load from the 300kb+ download requests for social APIs. Get the source on GitHub!

			Load a share dynamically

Loaded via attribute decoration:

Loaded via explicit plugin call:

Documentation

Example of Blocking Script include:

	<script id="LazySocialButtonsScript" src=""></script>

Example of Non-Blocking Script include:

	<script>
		function lsbReady() {
			$('#sharemetoo').lazySocialButtons({ shareUrl: 'http://godaddy.com' });
		};

		(function (loaded){
			var d = document,
				id = 'LazySocialButtonsScript',
				src = '';
			var js, st = d.getElementsByTagName('script')[0];
			if (d.getElementById(id)) { return; }
			js = d.createElement('script');
			js.id = id;
			js.type = "text/javascript";
			js.async = true;
			js.src = src;
			st.parentNode.insertBefore(js, st);

			// if we have a callback, execute it
			if (typeof(loaded) === 'function') {
				(function checkLoaded() {
					if (!$.fn.lazySocialButtons) setTimeout(checkLoaded, 100);
					else loaded();
				})();
			}
		})(lsbReady);
	</script>

Options:

shareUrl [js], data-shareurl [html]: The url that will be shared.  If not specified, open graph tags will be queried.  If no OG tags, then the page's location will be used.

google.shareUrl [js], data-gpshareurl [html]: The url that will be shared for the Google button.  Defaults to shareUrl if not specified.

twitter.shareUrl [js], data-twshareurl [html]: The url that will be shared for the Twitter button.  Defaults to shareUrl if not specified.

twitter.defaultText [js], data-twtext [html]: (default: 'Check out this site!') The text that will appear in the Twitter dialog when clicking on the button before the shared url.

twitter.hash [js], data-twhash [html]: See hashtags.

twitter.reply [js], data-twreply [html]:  See in_reply_to.

twitter.via [js], data-twvia [html]:  See via.

twitter.related [js], data-twrelated [html]:  See related.

facebook.shareUrl [js], data-fbshareurl [html]: The url that will be shared for the Facebook button.  Defaults to shareUrl if not specified.

facebook.hideCommentFlyout [js], data-fbhideflyout [html]: (default true) Will hide the comment flyout that normally appears when clicking the Facebook Like button.

height [js], data-height [html]: (default 20) The height of the wrapping div for the buttons.

buttons [js], data-buttons [html]: (default facebook, google, twitter) The buttons that will be displayed.  For html it is a comma delimited list, for js it is an object with each one desired as a property set to true.

containerFloat [js], data-float [html]: The float position of the share container.  If not specified, defaults to 'left'.

Example JS call with full options:

	$('#shareme').lazySocialButtons({
		shareUrl: 'http://godaddy.com',
		buttons: { facebook: true, google: true, twitter: true },
		facebook: {
			shareUrl: 'http://facebook.godaddy.com'
		},
		twitter: {
			shareUrl: 'http://twitter.godaddy.com',
			defaultText: 'Twitter on GoDaddy.com: ',
			hash: 'HotForTech',
			related: 'GoDaddy',
			via: 'twicodeer',
			reply: '35782000644194304'
		},
		google: {
			shareUrl: 'http://google.godaddy.com'
		},
		height: 20
	});

Example decorated html tag with full options:

Must have the 'lazysocialbuttons' class

	<div
		class="lazysocialbuttons"
		data-height="100"
		data-twshareurl="http://twitter.godaddy.com"
		data-twtext="Twitter on GoDaddy.com: "
		data-twhash="HotForTech"
		data-twrelated="GoDaddy"
		data-twvia="twicodeer"
		data-twreply="35782000644194304"
		data-fbshareurl="http://facebook.godaddy.com"
		data-gpshareurl="http://google.godaddy.com"
		data-shareurl="http://godaddy.com"
		data-buttons="google,facebook,twitter">
	</div>

If an element is decorated you can initialize it via js by passing an empty object for the options.

	$('#shareme').lazySocialButtons({});

Please view source for code samples and comments for implemention examples.


text:
package com.quark.admin;

import com.quark.admin.service.*;
import com.quark.common.dao.AdminUserDao;
import com.quark.common.entity.Posts;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.domain.Page;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringRunner;

import javax.sql.DataSource;

/**
 * Created by lhr on 17-7-31.
 * user.setUsername("lhr");
 * user.setPassword("root");
 */
@RunWith(SpringRunner.class)
@TestPropertySource(locations = {"classpath:admin.properties"})
@SpringBootTest
public class AdminApplicationTest {

    @Autowired
    DataSource dataSource;

    @Autowired(required=true)
    AdminUserService adminUserService;

    @Autowired(required=true)
    PermissionService permissionService;

    @Autowired(required=true)
    RoleService roleService;

    @Autowired
    AdminUserDao dao;

    @Autowired
    UserService userService;

    @Autowired
    PostsService postsService;

    @Test
    public void testDataSource() {
       System.out.println(dao.findOne(3));

    }

    @Test
    public void testRole(){
//        AdminUser user1 = new AdminUser();
//        AdminUser user2 = new AdminUser();
//        AdminUser user3 = new AdminUser();
//        user1.setId(11);
//        user2.setId(12);
//        user3.setId(13);
        adminUserService.saveAdminEnable(new Integer[]{11,12,13});
    }

    @Test
    public void testPosts(){
        Posts posts = new Posts();
//        posts.setId(1);
        posts.setTitle("测试");
        posts.setUser(userService.findOne(2));
        Page<Posts> page = postsService.findByPage(posts, 0, 10);
        System.out.println(page.getContent());
    }
}


text:
<?php

namespace Konsulting\Laravel\RuleRepository\Tests;

use Konsulting\Laravel\RuleRepository\RepositoryMagicMethods;
use Konsulting\Laravel\RuleRepository\RuleRepositoryTrait;

class ConfigTest extends TestCase
{
    /**
     * Define environment setup.
     *
     * @param  \Illuminate\Foundation\Application $app
     * @return void
     */
    protected function getEnvironmentSetUp($app)
    {
        parent::getEnvironmentSetUp($app);
        $app['config']->set('rule_repository', [
            'property_suffix' => 'ListOfConstraints',
            'method_suffix'   => 'GetConstraints',
        ]);
    }

    /** @test */
    public function the_property_suffix_can_be_defined_in_the_config()
    {
        $rules = ModelCustomSuffixes::getRules('custom');

        $this->assertEquals(['test_field' => 'required'], $rules);
    }

    /** @test */
    public function the_method_suffix_can_be_defined_in_the_config()
    {
        $rules = ModelCustomSuffixes::customGetConstraints();

        $this->assertEquals(['test_field' => 'required'], $rules);
    }
}

class ModelCustomSuffixes
{
    use RuleRepositoryTrait, RepositoryMagicMethods;

    protected $customListOfConstraints = ModelRuleRepository::class;
}


text:
package com.laytonsmith.abstraction.entities;

import com.laytonsmith.annotations.MEnum;

public interface MCPanda extends MCAgeable {

	@MEnum("com.commandhelper.PandaGene")
	enum Gene {
		AGGRESSIVE, BROWN, LAZY, NORMAL, PLAYFUL, WEAK, WORRIED
	}

	MCPanda.Gene getMainGene();
	void setMainGene(Gene gene);
	MCPanda.Gene getHiddenGene();
	void setHiddenGene(Gene gene);

}


text:
<?php

namespace Album\Model;

 use Zend\Db\TableGateway\TableGateway;

 class AlbumTable
 {
     protected $tableGateway;

     public function __construct(TableGateway $tableGateway)
     {
         $this->tableGateway = $tableGateway;
     }

     public function fetchAll()
     {

         $sqlSelect = $this->tableGateway->getSql()->select();
        $sqlSelect->columns(array('id', 'artist', 'title' ));
        $sqlSelect->join(
                    'album_category',
                    'album_category.id = album.category',
                    array('categoryName' => 'name' )
                );

        $statement = $this->tableGateway->getSql()->prepareStatementForSqlObject($sqlSelect);
        $resultSet = $statement->execute();
        return $resultSet;

     }

     public function getAlbum($id)
     {
         $id  = (int) $id;
         $rowset = $this->tableGateway->select(array('id' => $id));
         $row = $rowset->current();
         if (!$row) {
             throw new \Exception("Could not find row $id");
         }
         return $row;
     }

     public function saveAlbum(Album $album)
     {
         $data = array(
             'artist' => $album->artist,
             'title'  => $album->title,
             'category'  => $album->category,
         );

         $id = (int) $album->id;
         if ($id == 0) {
             $this->tableGateway->insert($data);
         } else {
             if ($this->getAlbum($id)) {
                 $this->tableGateway->update($data, array('id' => $id));
             } else {
                 throw new \Exception('Album id does not exist');
             }
         }
     }

     public function deleteAlbum($id)
     {
         $this->tableGateway->delete(array('id' => (int) $id));
     }
 }


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FakeItEasy;
using Woodpecker.Core.Metrics.Infrastructure;
using Xunit;

namespace Woodpecker.Core.UnitTests.DocumentDb
{
    public class MetricsAggregatorShould
    {
        private readonly MetricsAggregator sut = new MetricsAggregator();

        private static readonly LocalizedString MetricName = new LocalizedString { Value = "The metric!" };

        [Fact]
        public void Throw_ArgumentException_If_Empty_Values()
        {
            // arrange
            var values = new MetricValue[0];
            var metric = new Metric { Name = MetricName, MetricValues = values };

            // act & assert
            Assert.Throws<ArgumentException>(() => sut.Aggregate(metric));
        }

        [Fact]
        public void Return_Metric_With_Given_Name()
        {
            // arrange
            var expectedName = MetricName;
            var values = new MetricValue[] { new MetricValue() };

            // act
            var metric = sut.Aggregate(new Metric { Name = MetricName, MetricValues = values });

            // assert
            Assert.Equal(expectedName.Value, metric.Name);
        }

        [Fact]
        public void Return_Metric_With_Latest_Timestamp()
        {
            // arrange
            var firstTimeStamp = DateTime.Now;
            var latestTimeStamp = DateTime.Now.AddMinutes(1);

            var values = new MetricValue[]
            {
                new MetricValue { TimeStamp = firstTimeStamp },
                new MetricValue { TimeStamp =  latestTimeStamp}
            };

            // act
            var metric = sut.Aggregate(new Metric { Name = MetricName, MetricValues = values });

            // assert
            Assert.Equal(latestTimeStamp, metric.TimeStamp);
        }

        [Fact]
        public void Return_Metric_With_Max_Of_Counts_For_Cumulative_MetricValues()
        {
            // arrange
            var values = Enumerable.Range(0, 10).Select(i => new MetricValue { Count = i, Total = 1, Average = 1 }).ToArray();

            var expectedCount = values.Max(v => v.Count);

            // act
            var metric = sut.Aggregate(new Metric { Name = MetricName, MetricValues = values });

            // assert
            Assert.Equal(expectedCount, metric.Count);
        }

        [Fact]
        public void Return_Metric_With_Sum_Of_Counts_For_Non_Cumulative_MetricValues()
        {
            // arrange
            var values = Enumerable.Range(0, 10).Select(i => new MetricValue { Count = i }).ToArray();

            var expectedCount = values.Sum(v => v.Count);

            // act
            var metric = sut.Aggregate(new Metric { Name = MetricName, MetricValues = values });

            // assert
            Assert.Equal(expectedCount, metric.Count);
        }

        [Fact]
        public void Ignore_Nulls_Count_When_Aggregating()
        {
            // arrange
            var expectedCount = 5;

            var values = new MetricValue[] { new MetricValue { Count = 5 }, new MetricValue { Count = null } };

            // act
            var metric = sut.Aggregate(new Metric { Name = MetricName, MetricValues = values });

            // assert
            Assert.Equal(expectedCount, metric.Count);
        }

        [Fact]
        public void Return_Metric_With_Null_Count_If_All_Values_Have_Null_Count()
        {
            // arrange
            var values = new MetricValue[] { new MetricValue { Count = null }, new MetricValue { Count = null } };

            // act
            var metric = sut.Aggregate(new Metric { Name = MetricName, MetricValues = values });

            // assert
            Assert.Null(metric.Count);
        }

        [Fact]
        public void Return_Metric_With_Max_Of_Maximums()
        {
            // arrange
            var values = Enumerable.Range(0, 10).Select(i => new MetricValue { Maximum = i }).ToArray();

            var expectedMaximum = values.Max(v => v.Maximum);

            // act
            var metric = sut.Aggregate(new Metric { Name = MetricName, MetricValues = values });

            // assert
            Assert.Equal(expectedMaximum, metric.Maximum);
        }

        [Fact]
        public void Ignore_Nulls_Maximum_When_Aggregating()
        {
            // arrange
            var expectedMaximum = 5;

            var values = new MetricValue[] { new MetricValue { Maximum = 5 }, new MetricValue { Maximum = null } };

            // act
            var metric = sut.Aggregate(new Metric { Name = MetricName, MetricValues = values });

            // assert
            Assert.Equal(expectedMaximum, metric.Maximum);
        }

        [Fact]
        public void Return_Metric_With_Null_Maximum_If_All_Values_Have_Null_Maximum()
        {
            // arrange
            var values = new MetricValue[] { new MetricValue { Maximum = null }, new MetricValue { Maximum = null } };

            // act
            var metric = sut.Aggregate(new Metric { Name = MetricName, MetricValues = values });

            // assert
            Assert.Null(metric.Maximum);
        }

        [Fact]
        public void Return_Metric_With_Min_Of_Minimums()
        {
            // arrange
            var values = Enumerable.Range(0, 10).Select(i => new MetricValue { Minimum = i }).ToArray();

            var expectedMinimum = values.Min(v => v.Minimum);

            // act
            var metric = sut.Aggregate(new Metric { Name = MetricName, MetricValues = values });

            // assert
            Assert.Equal(expectedMinimum, metric.Minimum);
        }

        [Fact]
        public void Ignore_Nulls_Minimum_When_Aggregating()
        {
            // arrange
            var expectedMinimum = 5;

            var values = new MetricValue[] { new MetricValue { Minimum = 5 }, new MetricValue { Minimum = null } };

            // act
            var metric = sut.Aggregate(new Metric { Name = MetricName, MetricValues = values });

            // assert
            Assert.Equal(expectedMinimum, metric.Minimum);
        }

        [Fact]
        public void Return_Metric_With_Null_Minimum_If_All_Values_Have_Null_Minimum()
        {
            // arrange
            var values = new MetricValue[] { new MetricValue { Minimum = null }, new MetricValue { Minimum = null } };

            // act
            var metric = sut.Aggregate(new Metric { Name = MetricName, MetricValues = values });

            // assert
            Assert.Null(metric.Minimum);
        }

        [Fact]
        public void Return_Metric_With_Avg_Of_Averages()
        {
            // arrange
            var values = Enumerable.Range(0, 10).Select(i => new MetricValue { Average = i }).ToArray();

            var expectedAverage = values.Average(v => v.Average);

            // act
            var metric = sut.Aggregate(new Metric { Name = MetricName, MetricValues = values });

            // assert
            Assert.Equal(expectedAverage, metric.Average);
        }

        [Fact]
        public void Ignore_Nulls_Average_When_Aggregating()
        {
            // arrange
            var expectedAverage = 5;

            var values = new MetricValue[] { new MetricValue { Average = 5 }, new MetricValue { Average = null } };

            // act
            var metric = sut.Aggregate(new Metric { Name = MetricName, MetricValues = values });

            // assert
            Assert.Equal(expectedAverage, metric.Average);
        }

        [Fact]
        public void Return_Metric_With_Null_Average_If_All_Values_Have_Null_Average()
        {
            // arrange
            var values = new MetricValue[] { new MetricValue { Average = null }, new MetricValue { Average = null } };

            // act
            var metric = sut.Aggregate(new Metric { Name = MetricName, MetricValues = values });

            // assert
            Assert.Null(metric.Average);
        }

        [Fact]
        public void Return_Metric_With_Max_Of_Totals_For_Cumulative_MetricValues()
        {
            // arrange
            var values = Enumerable.Range(0, 10).Select(i => new MetricValue { Total = i, Average = 1, Count = 1 }).ToArray();

            var expectedTotal = values.Max(v => v.Total);

            // act
            var metric = sut.Aggregate(new Metric { Name = MetricName, MetricValues = values });

            // assert
            Assert.Equal(expectedTotal, metric.Total);
        }

        [Fact]
        public void Return_Metric_With_Sum_Of_Totals_For_NonCumulative_MetricValues()
        {
            // arrange
            var values = Enumerable.Range(0, 10).Select(i => new MetricValue { Total = i }).ToArray();
            var expectedTotal = values.Sum(v => v.Total);

            // act
            var metric = sut.Aggregate(new Metric { Name = MetricName, MetricValues = values });

            // assert
            Assert.Equal(expectedTotal, metric.Total);
        }

        [Fact]
        public void Ignore_Nulls_Total_When_Aggregating()
        {
            // arrange
            var expectedTotal = 5;

            var values = new MetricValue[] { new MetricValue { Total = 5 }, new MetricValue { Total = null } };

            // act
            var metric = sut.Aggregate(new Metric { Name = MetricName, MetricValues = values });

            // assert
            Assert.Equal(expectedTotal, metric.Total);
        }

        [Fact]
        public void Return_Metric_With_Null_Total_If_All_Values_Have_Null_Total()
        {
            // arrange
            var values = new MetricValue[] { new MetricValue { Total = null }, new MetricValue { Total = null } };

            // act
            var metric = sut.Aggregate(new Metric { Name = MetricName, MetricValues = values });

            // assert
            Assert.Null(metric.Total);
        }
    }
}


text:
package gnu.java.security.sig.dss;

import gnu.java.security.Registry;
import gnu.java.security.der.DER;
import gnu.java.security.der.DERReader;
import gnu.java.security.der.DERValue;
import gnu.java.security.der.DERWriter;
import gnu.java.security.sig.ISignatureCodec;
import gnu.java.security.util.DerUtil;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.math.BigInteger;
import java.security.InvalidParameterException;
import java.util.ArrayList;

/**
 * An implementation of an {@link ISignatureCodec} that knows to encode and
 * decode DSS signatures into the raw bytes which would constitute a DER-encoded
 * form of the ASN.1 structure defined in RFC-2459, and RFC-2313 as described in
 * the next paragraphs.
 *

 * Digital signatures when transmitted in an X.509 certificates are encoded
 * in DER (Distinguished Encoding Rules) as a BIT STRING; i.e.
 *
 *

 * Certificate ::= SEQUENCE {
 *   tbsCertificate       TBSCertificate,
 *   signatureAlgorithm   AlgorithmIdentifier,
 *   signature            BIT STRING
 * }
 *

 *

 * The output of the encoder, and the input of the decoder, of this codec are
 * then the raw bytes of such a BIT STRING; i.e. not the DER-encoded
 * form itself.
 *

 * RFC-2459 states that, for the Digital Signature Standard (DSS), which
 * generates two MPIs, commonly called r and s, as the
 * result of digitally signing a message, these two numbers will be transferred
 * as the following ASN.1 structure:
 *
 *

 *   Dss-Sig-Value ::= SEQUENCE {
 *     r  INTEGER,
 *     s  INTEGER
 *   }
 *

 *

 * Client code that needs to build a DER BIT STRING MUST construct such
 * an ASN.1 value. The following is an example of how to do this:
 *

 *

 * ...
 * import gnu.java.security.der.BitString;
 * import gnu.java.security.der.DER;
 * import gnu.java.security.der.DERValue;
 * ...
 * DERValue bitString = new DERValue(DER.BIT_STRING, new BitString(sigBytes));
 * ...
 *

 */
public class DSSSignatureX509Codec
    implements ISignatureCodec
{
  // implicit 0-arguments constructor

  public int getFormatID()
  {
    return Registry.X509_ENCODING_ID;
  }

  /**
   * Encodes a DSS Signature output as the signature raw bytes which can
   * be used to construct an ASN.1 DER-encoded BIT STRING as defined in the
   * documentation of this class.
   *
   * @param signature the output of the DSS signature algorithm; i.e. the value
   *          returned by the invocation of
   *          {@link gnu.java.security.sig.ISignature#sign()} method. In the
   *          case of a DSS signature this is an array of two MPIs called
   *          r and s.
   * @return the raw bytes of a DSS signature which could be then used as the
   *         contents of a BIT STRING as per rfc-2459.
   * @throws InvalidParameterException if an exception occurs during the
   *           marshalling process.
   */
  public byte[] encodeSignature(Object signature)
  {
    BigInteger[] rs = (BigInteger[]) signature;

    DERValue derR = new DERValue(DER.INTEGER, rs[0]);
    DERValue derS = new DERValue(DER.INTEGER, rs[1]);

    ArrayList dssSigValue = new ArrayList(2);
    dssSigValue.add(derR);
    dssSigValue.add(derS);
    DERValue derDssSigValue = new DERValue(DER.CONSTRUCTED | DER.SEQUENCE,
                                           dssSigValue);
    byte[] result;
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    try
      {
        DERWriter.write(baos, derDssSigValue);
        result = baos.toByteArray();
      }
    catch (IOException x)
      {
        InvalidParameterException y = new InvalidParameterException();
        y.initCause(x);
        throw y;
      }

    return result;
  }

  /**
   * Decodes a signature as defined in the documentation of this class.
   *
   * @param input the byte array to unmarshall into a valid DSS signature
   *          instance; i.e. an array of two MPIs. MUST NOT be null.
   * @return an array of two MPIs, r and s in this
   *         order, decoded from the designated input.
   * @throw InvalidParameterException if an exception occurs during the
   *        unmarshalling process.
   */
  public Object decodeSignature(byte[] input)
  {
    if (input == null)
      throw new InvalidParameterException("Input bytes MUST NOT be null");

    BigInteger r, s;
    DERReader der = new DERReader(input);
    try
      {
        DERValue derDssSigValue = der.read();
        DerUtil.checkIsConstructed(derDssSigValue, "Wrong Dss-Sig-Value field");

        DERValue val = der.read();
        DerUtil.checkIsBigInteger(val, "Wrong R field");
        r = (BigInteger) val.getValue();
        val = der.read();
        DerUtil.checkIsBigInteger(val, "Wrong S field");
        s = (BigInteger) val.getValue();
      }
    catch (IOException x)
      {
        InvalidParameterException y = new InvalidParameterException();
        y.initCause(x);
        throw y;
      }

    return new BigInteger[] { r, s };
  }
}


text:
export default [];
//# sourceMappingURL=rwk.js.map


text:
<!DOCTYPE HTML>

Check that window.blur() does nothing, and window.focus() only works if it is
invoked from the window that opened the former. If the test passes, you should
see a series of PASS messages with the last being 'All tests finished'.

This test is adopted from mozilla's tests.


text:
using EcoCardio.Domain;
using System.Data.Entity.ModelConfiguration;

namespace EcoCardio.Repository.EntityConfiguration
{
    internal class TemplateConfiguration : EntityTypeConfiguration<Template>
    {
        public TemplateConfiguration()
        {
            HasKey(u => u.Id);

            Property(u => u.Nome)
                .IsRequired()
                .HasMaxLength(1024);

            Property(u => u.Texto)
                .HasMaxLength(4096);
        }
    }
}


text:
layout: post
title:  "Big Changes for Orlando Devs, Announcing New Board Members"
categories:
author: csndra0504
---
Orlando Devs is undergoing some big changes and we wanted to take some time to go through them and explain what they mean for our group and what you can expect as we move into 2018 and look further into the future.

We are pleased to announce that Orlando Devs is working towards becoming a 501(c)(3) nonprofit organization under the name Orlando Devs, Inc. As many of you may know, this is a lengthy process and part of that process includes establishing a Board of Directors as well as a Board of Advisors. We expect that this new organizational structure will position us for for long-term growth and increase our ability to serve the needs of Greater Orlando's developer community. An up-to-date list of board members can be found on the [ODevs About page](http://orlandodevs.com/about/) but I've also included them here.

### Orlando Devs Board of Directors

**Sergio Cruz, President**
Software Engineer, Instructor, Community Organizer & Consultant focusing on JavaScript.

**Jacques Fu, Treasurer**
Developer and tech entrepreneur, co-founder of several funded tech startups in Orlando creating hundreds of jobs. Resident for 15 years, attended UCF, and married with two kids. Seeking to lift up other developers in the community.

**Susanna Miller, Secretary**
MBA with expertise in operations and project management in tech. Focused on helping the tech community in Orlando grow sustainably and inclusively, and helps O-devs with organization and business management.

### Orlando Devs Board of Advisors

**Matt Burgess**
Java/Groovy developer for Hortonworks. Working to support and enhance the communities around software development in Orlando.

**Jorge Hernandez**
Software Developer mainly focused on web and native mobile development. Committed to growing the Orlando Devs community by asking every developer he comes across ("are you familiar with Orlando Devs"). Also encouraging all age groups to get excited about the world of tech.

**Jenell Pizarro**
Software developer at IZEA and co-organizer of some pretty spiffy Meetups in the area.

**Cassandra Wilcox**
JavaScript developer and instructor who runs the Orlando LadyDevs Meetup and Girl Develop It Orlando. Works to promote diversity in Orlando's developer community, and especially to empower women and minorities.

## How were board members chosen?
We want to make sure we have well-rounded representation on our Advisory Board, so the ODevs Board of Directors reached out to several individuals who we believe represent some of the many facets of our community in order to be as inclusive possible. The Advisory Board is not fixed. Members have terms and new members may be added.

## What prompted these changes?
Orlando Devs has grown significantly in just a few years. Our first Salary Survey in 2015 (which demonstrates our very first effort to organize toward a common goal) had 20-something respondents. Our most recent [2017 Salary Survey](http://orlandodevs.com/blog/orlando-devs-salaries-2017/) two years later, had about 10 times that with 277 respondents. At the time of writing this, Orlando Devs has nearly 3,000 members on Meetup and more than 2,000 active members in our Slack group.

_Read more about our origin story [here](https://medium.com/@tjkrusinski/orlando-developers-slack-a-beginning-ec3cc303f61)._

As organizations grow, they inevitably face new challenges and require greater structure. We've grown beyond what a single person can do effectively and we need accountable leadership and formal processes to ensure that our growth doesn't stagnate.

## How do these changes benefit Orlando Devs community members?

**Organization**
Orlando Devs will now be governed by clear-cut rules about delegation of authority and how we get things done. This means we will be able to take on bigger initiatives and trust that community leaders have the guidance they need to see things through to successful fruition. You can also expect better oversight and enforcement of our Code of Conduct resulting in a friendlier and more constructive Slack community. This, among other things will be the responsibility of a committee of volunteers that will be organized in the near future.

**Accountability**
ODevs members can expect more organization and accountability from ODevs as a whole. We now have in our Board of Directors and Board of Advisors a committed and accountable leadership team. Members of both Boards have already agreed that transparency is of great importance and so all meeting minutes, financials, and relevant happenings within Orlando Devs will be made public.

**Funding**
As we grow, we require more resources to operate. Over time we've found it increasingly difficult to raise the funds needed to put on quality events and to even consider pursuing other initiatives that would benefit our community. As a 501(c)(3) nonprofit, ODevs will be able to solicit charitable donations from the public much more easily and will become eligible to receive federal grants which will allow us to operate more effectively.

### How can community members learn more, ask questions, provide feedback or get involved?
Many of you likely have or will have questions about these changes and some of you may want to know how you can get involved. Please feel free to contact us if you have any questions, concerns or feedback. Also, we will be hosting an event in the new year at which we will introduce our board members and gather feedback from community members like you!

We are excited about these changes, and we hope that you are as well. Thank you all for all that you contribute to our community. I look forward to working with all of you to serve the ODevs mission together.

_The Orlando Devs Team_


text:
Note: This library is in early development.

# icymodal

A small javascript modal/off-canvas dialog library,

* No dependencies, very small size.
* Focus on accessibility - Follows the WAI-ARIA Authoring Practices.
    * Tab trap - contained tab sequence. `Tab` and `Shift + Tab` do not move focus outside the dialog.
    * `Esc` closes the modal.
* Minimal CSS stylesheet

## Demo

https://marek95.github.io/icy-modal/

## Usage

### HTML structure

Below  is the HTML structure for a **basic modal** dialog.

```html
<div id="modal-0" class="icymodal icymodal-basic">
    <div class="icymodal-body icymodal-main-scroll">
        <p>hi, I'm modal 0</p>
        <p><a href="#!" data-icymodal-close>close</a></p>
    </div>
</div>
```

There are four `icymodal` classes used here. Except for the first `icymodal` class, these are not referred to in any way from the JS code.

Note that inside the modal there is a link with the `data-icymodal-close` attribute. When clicked, elements/links/buttons that have this attribute will close a modal.

You can use this HTML structure if you want a **basic modal with header and/or footer**.

```html
<div id="modal-0" class="icymodal icymodal-basic">
    <div class="icymodal-body">
        <div class="icymodal-header">
            <p>this is header <a href="#!" data-icymodal-close>close</a></p>
        </div>
        <div class="icymodal-main-scroll">
            <h1>hi, I'm modal 0</h1>
        </div>
        <div class="icymodal-footer">
            <p>this is footer</p>
        </div>
    </div>
</div>
```

Header and footer will keep being visible even if the content of the modal is long. Overflow will be contained by automatic scroll inside the `icymodal-main-scroll` element. If you do not need either footer or header, you can just delete its element and keep the rest.

This library also allows for an off-canvas type of panel. There is nothing specific in the JS code to make this work. It is just a few additional styles that need are applied, such as different positioning, size, animation etc. but it still acts as a regular modal dialog, and all the keyboard accessibility features are useful here as well.

Below is an HTML structure for an **off-canvas panel**.

```html
<div id="off-canvas-0" class="icymodal icymodal-off-canvas-right">
    <div class="icymodal-body icymodal-main-scroll">
        <p>hi, I'm off canvas 0</p>
    </div>
</div>
```

Note that the structure is the same as in the 'basic modal' example, except the `icymodal-basic` class is changed to `icymodal-off-canvas-right`

As the name suggests, you can change the class to `icymodal-off-canvas-left` if you want the off-canvas panel to slide from the left.

You can use header and/or footer inside the off-canvas as well following the structure from the previous example.

In any case you will also need elements that open these modals.

```html
<a href="#!" data-icymodal-show="modal-0">click here</a>
```

Make sure that the value of the `data-icymodal-show` attribute is the same as the `id` attribute of the modal element.

### Include and initialize the library

You need to include the icymodal JS and CSS file. This may be different depending on your setup.

Then, you need to initialize it like this:

```js
var icyModal = new IcyModal();

document.addEventListener('DOMContentLoaded', function () {
    icyModal.init();
});
```

### Attributes

`data-icymodal-show` can be added on any element on a page. It requires a value.  It opens a modal where `id` is the same as the value of this attribute.

`data-icymodal-close` closes modal that is open

`data-icymodal-strong-overlay` can be added on the modal element. It will prevent the click on the overlay to cause a closing of the modal. Example:

```html
<div id="modal-0" class="icymodal icymodal-basic" data-icymodal-strong-overlay>
    <div class="icymodal-body icymodal-main-scroll">
        <p>hi, I'm modal 0</p>
        <p><a href="#!" data-icymodal-close>close</a></p>
    </div>
</div>
```

`data-icymodal-reset-embed` can be added on a modal element. It will reset the `src` attribute of an `iframe` element inside a modal, when the modal is closed. This is useful for example when you have a YouTube video in a modal. By resting the `src` attribute, the video will be stopped when the modal is closed. Example:

```html
<div id="modal-0" class="icymodal icymodal-basic" data-icymodal-reset-embed>
    <div class="icymodal-body icymodal-main-scroll">
        <p>hi, I'm modal 0</p>
        <iframe width="560" height="315" src="https://www.youtube.com/embed/dQw4w9WgXcQ" frameborder="0" allowfullscreen></iframe>
    </div>
</div>
```

`data-icymodal-focus` can be added on an element inside a modal. When a modal is opened,  focus is put on the first element that has this attribute. Otherwise, focus defaults to the first focusable element in the modal.

## CSS

A minimal CSS stylesheet is included. Default stylistic choices are for example the white background of modal, black semi-transparent overlay, or a short open/close animation, assuming that these things would be useful to have on most project. These can be easily overridden.

## Extra

### Similar Projects and Links

[Micromodal.js - lightweight, configurable and a11y-enabled modal library written in pure JavaScript](https://micromodal.now.sh/)

[Modal & Nonmodal Dialogs: When (& When Not) to Use Them](https://www.nngroup.com/articles/modal-nonmodal-dialog/)

[WAI-ARIA Authoring Practices 1.1 - Dialog (Modal)](https://www.w3.org/TR/wai-aria-practices-1.1/#dialog_modal)


text:
cd "$(dirname "$0")"
set -ve

rm -rf tmp/
bazel build ...
mkdir tmp/
tar xvfi bazel-bin/exercises/autograder_tar.tar -C tmp
tar xvfi bazel-bin/exercises/tmp-student_notebooks_tar.tar

cp -v student/* tmp/student/
cp -rv nbextensions tmp/student/
perl -i -pe \
  's,http://localhost:8000/upload,https://prog-edu-assistant.salikh.info/upload,g' \
  tmp/student/nbextensions/upload_it/main.js


text:
Install new Drupal instances
============================

Theming
-------

Base template we use:

* [mothership](https://drupal.org/project/mothership)

Moduling
--------

Modules we install:

* [admin_menu](https://drupal.org/project/admin_menu)
* [advanced_help](https://drupal.org/project/advanced_help)


text:
Sequel.require 'connection_pool/threaded'

# The slowest and most advanced connection, dealing with both multi-threaded
# access and configurations with multiple shards/servers.
#
# In addition, this pool subclass also handles scheduling in-use connections
# to be removed from the pool when they are returned to it.
class Sequel::ShardedThreadedConnectionPool < Sequel::ThreadedConnectionPool
  # The following additional options are respected:
  # * :servers - A hash of servers to use.  Keys should be symbols.  If not
  #   present, will use a single :default server.  The server name symbol will
  #   be passed to the connection_proc.
  def initialize(opts = {}, &block)
    super
    @available_connections = {}
    @connections_to_remove = []
    @servers = Hash.new(:default)
    add_servers([:default])
    add_servers(opts[:servers].keys) if opts[:servers]
  end

  # Adds new servers to the connection pool. Primarily used in conjunction with master/slave
  # or shard configurations. Allows for dynamic expansion of the potential slaves/shards
  # at runtime. servers argument should be an array of symbols.
  def add_servers(servers)
    sync do
      servers.each do |server|
        unless @servers.has_key?(server)
          @servers[server] = server
          @available_connections[server] = []
          @allocated[server] = {}
        end
      end
    end
  end

  # A hash of connections currently being used for the given server, key is the
  # Thread, value is the connection.  Nonexistent servers will return nil.  Treat
  # this as read only, do not modify the resulting object.
  def allocated(server=:default)
    @allocated[server]
  end

  # An array of connections opened but not currently used, for the given
  # server. Nonexistent servers will return nil. Treat this as read only, do
  # not modify the resulting object.
  def available_connections(server=:default)
    @available_connections[server]
  end

  # The total number of connections opened for the given server, should
  # be equal to available_connections.length + allocated.length.  Nonexistent
  # servers will return the created count of the default server.
  def size(server=:default)
    server = @servers[server]
    @allocated[server].length + @available_connections[server].length
  end

  # Removes all connections currently available on all servers, optionally
  # yielding each connection to the given block. This method has the effect of
  # disconnecting from the database, assuming that no connections are currently
  # being used.  If connections are being used, they are scheduled to be
  # disconnected as soon as they are returned to the pool.
  #
  # Once a connection is requested using #hold, the connection pool
  # creates new connections to the database. Options:
  # * :server - Should be a symbol specifing the server to disconnect from,
  #   or an array of symbols to specify multiple servers.
  def disconnect(opts={}, &block)
    block ||= @disconnection_proc
    sync do
      (opts[:server] ? Array(opts[:server]) : @servers.keys).each do |s|
        disconnect_server(s, &block)
      end
    end
  end

  # Chooses the first available connection to the given server, or if none are
  # available, creates a new connection.  Passes the connection to the supplied
  # block:
  #
  #   pool.hold {|conn| conn.execute('DROP TABLE posts')}
  #
  # Pool#hold is re-entrant, meaning it can be called recursively in
  # the same thread without blocking.
  #
  # If no connection is immediately available and the pool is already using the maximum
  # number of connections, Pool#hold will block until a connection
  # is available or the timeout expires.  If the timeout expires before a
  # connection can be acquired, a Sequel::PoolTimeout is
  # raised.
  def hold(server=:default)
    sync{server = @servers[server]}
    t = Thread.current
    if conn = owned_connection(t, server)
      return yield(conn)
    end
    begin
      unless conn = acquire(t, server)
        time = Time.now
        timeout = time + @timeout
        sleep_time = @sleep_time
        sleep sleep_time
        until conn = acquire(t, server)
          raise(::Sequel::PoolTimeout) if Time.now > timeout
          sleep sleep_time
        end
      end
      yield conn
    rescue Sequel::DatabaseDisconnectError
      sync{@connections_to_remove << conn} if conn
      raise
    ensure
      sync{release(t, conn, server)} if conn
    end
  end

  # Remove servers from the connection pool. Primarily used in conjunction with master/slave
  # or shard configurations.  Similar to disconnecting from all given servers,
  # except that after it is used, future requests for the server will use the
  # :default server instead.
  def remove_servers(servers)
    sync do
      raise(Sequel::Error, "cannot remove default server") if servers.include?(:default)
      servers.each do |server|
        if @servers.include?(server)
          disconnect_server(server, &@disconnection_proc)
          @available_connections.delete(server)
          @allocated.delete(server)
          @servers.delete(server)
        end
      end
    end
  end

  # Return an array of symbols for servers in the connection pool.
  def servers
    sync{@servers.keys}
  end

  private

  # Assigns a connection to the supplied thread for the given server, if one
  # is available. The calling code should NOT already have the mutex when
  # calling this.
  def acquire(thread, server)
    sync do
      if conn = available(server)
        allocated(server)[thread] = conn
      end
    end
  end

  # Returns an available connection to the given server. If no connection is
  # available, tries to create a new connection. The calling code should already
  # have the mutex before calling this.
  def available(server)
    available_connections(server).pop || make_new(server)
  end

  # Disconnect from the given server.  Disconnects available connections
  # immediately, and schedules currently allocated connections for disconnection
  # as soon as they are returned to the pool. The calling code should already
  # have the mutex before calling this.
  def disconnect_server(server, &block)
    if conns = available_connections(server)
      conns.each{|conn| block.call(conn)} if block
      conns.clear
    end
    @connections_to_remove.concat(allocated(server).values)
  end

  # Creates a new connection to the given server if the size of the pool for
  # the server is less than the maximum size of the pool. The calling code
  # should already have the mutex before calling this.
  def make_new(server)
    if (n = size(server)) >= @max_size
      allocated(server).to_a.each{|t, c| release(t, c, server) unless t.alive?}
      n = nil
    end
    default_make_new(server) if (n || size(server)) < @max_size
  end

  # Returns the connection owned by the supplied thread for the given server,
  # if any. The calling code should NOT already have the mutex before calling this.
  def owned_connection(thread, server)
    sync{@allocated[server][thread]}
  end

  # Releases the connection assigned to the supplied thread and server. If the
  # server or connection given is scheduled for disconnection, remove the
  # connection instead of releasing it back to the pool.
  # The calling code should already have the mutex before calling this.
  def release(thread, conn, server)
    if @connections_to_remove.include?(conn)
      remove(thread, conn, server)
    else
      available_connections(server) << allocated(server).delete(thread)
    end
  end

  # Removes the currently allocated connection from the connection pool. The
  # calling code should already have the mutex before calling this.
  def remove(thread, conn, server)
    @connections_to_remove.delete(conn)
    allocated(server).delete(thread) if @servers.include?(server)
    @disconnection_proc.call(conn) if @disconnection_proc
  end

  CONNECTION_POOL_MAP[[false, true]] = self
end


text:
import telephonyStatuses from 'ringcentral-integration/enums/telephonyStatus';
import * as mock from 'ringcentral-integration/integration-test/mock';

import deviceBody from './data/device';

import { timeout } from '../shared';
import {
  makeCall,
  getInboundCall,
  mockActiveCalls,
  mockPresencePubnub,
  mockGeneratePresenceApi,
  mockGeneratePresenceUpdateApi,
  mockGenerateActiveCallsApi,
} from '../../support/callHelper';

function mockCallProcedure(func) {
  return async (phone, ...args) => {
    mock.device(deviceBody, false);
    const activeCallsBody = await func.apply(null, [phone, ...args]);
    mock.activeCalls(activeCallsBody);
    await phone.subscription.subscribe(['/account/~/extension/~/presence'], 10);
    await timeout(100);
    await mockPresencePubnub(activeCallsBody);
  };
}

async function mockMultiActiveCallBodies(phone) {
  // inbound call
  const inboundSession = await getInboundCall(phone, {
    id: '111',
    direction: 'Inbound',
    callId: 'call-111',
  });
  await phone.webphone.answer(inboundSession.id);
  // outbound call session
  const outboundSession = await makeCall(phone, {
    callId: true,
    fromNumber: '+15878133670',
    homeCountryId: '1',
    toNumber: '101',
  });
  // incoming call
  const incomingSession = await getInboundCall(phone, {
    id: '222',
    direction: 'Inbound',
    callId: 'call-222',
    telephonyStatus: telephonyStatuses.ringing,
  });
  // other device calls
  const mockOtherDeivce = [
    {
      id: 'call-4444',
      sessionId: '4444',
      fromName: 'FirstName 104 LastName',
      from: '104',
      toName: 'FirstName 105 LastName',
      to: '105',
      direction: 'Inbound',
      telephonyStatus: 'CallConnected',
      sipData: {
        toTag: 'pgrneavq66',
        fromTag: '10.74.2.218-5070-2a0553bd67c3401',
        remoteUri: 'sip:104@ringcentral.com',
        localUri: 'sip:105@ringcentral.com',
      },
      startTime: '2018-08-07T09:20:09.405Z',
    },
  ];
  return mockActiveCalls(phone.webphone.sessions, mockOtherDeivce);
}

async function mockMultipleOutboundCallBodies(phone, n) {
  for (let i = n; i > 0; i -= 1) {
    const outboundSession = await makeCall(phone, {
      callId: true,
      fromNumber: '+15878133670',
      homeCountryId: '1',
      toNumber: '101',
    });
    outboundSession.accept(phone.webphone.acceptOptions);
  }
  return mockActiveCalls(phone.webphone.sessions);
}

export async function mockMultiActiveCalls(phone) {
  await mockCallProcedure(mockMultiActiveCallBodies)(phone);
}

export async function mockMultiOutboundCalls(phone, n) {
  await mockCallProcedure(mockMultipleOutboundCallBodies)(phone, n);
}

export async function mockActiveCallPanelData(
  phone,
  mockOtherDeivce = [],
  ringSessionIds = [],
) {
  const activeCalls = mockActiveCalls(
    phone.webphone.sessions,
    mockOtherDeivce,
    ringSessionIds,
  );
  mockGeneratePresenceApi({
    activeCalls,
  });
  mockGeneratePresenceUpdateApi({
    activeCalls,
  });
  mockGenerateActiveCallsApi({
    sessions: phone.webphone.sessions,
  });
  await phone.subscription.subscribe(['/account/~/extension/~/presence'], 10);
  await timeout(100);
  await mockPresencePubnub(activeCalls);
}


text:
activate :MiddlemanPageGroups do |options|

  # Indicate whether or not numeric file name prefixes used for sorting
  # pages should be eliminated during output. This results in cleaner
  # URI's. Helpers such as `page_name` and Middleman helpers such as
  # `page_class` will reflect the pretty name.
  options[:strip_file_prefixes] = true

  # Indicates whether or not Middleman's built-in `page_class` helper is
  # extended to include the page_group and page_name.
  options[:extend_page_class] = true

  # the following options provide defaults for the built-in helpers, and
  # also work with the sample partials if you choose to install them.
  # They'll also work in your own partials and helpers, of course.

  # Default css class for the nav_breadcrumbs helper/partial.
  options[:nav_breadcrumbs_class] = 'breadcrumbs'

  # Default css class for the nav_breadcrumbs_alt helper/partial.
  options[:nav_breadcrumbs_alt_class] = 'breadcrumbs'

  # Default "current page" label for the nav_breadcrumbs_alt helper/partial.
  options[:nav_breadcrumbs_alt_label] = 'Current page'

  # Default css class for the nav_brethren helper/partial.
  options[:nav_brethren_class] = 'table_contents'

  # Default css class for the nav_brethren_index helper/partial.
  options[:nav_brethren_index_class] = 'related-topics'

  # Default css class for the nav_legitimate_children helper/partial.
  options[:nav_legitimate_children_class] = 'table_contents'

  # Default css class for the nav_prev_next helper/partial.
  options[:nav_prev_next_class] = 'navigate_prev_next'

  # Default "previous" label text for the nav_prev_next helper/partial.
  options[:nav_prev_next_label_prev] = 'Previous'

  # Default "next" label text for the nav_prev_next helper/partial.
  options[:nav_prev_next_label_next] = 'Next'

  # Default css class for the nav_toc_index helper/partial.
  options[:nav_toc_index_class] = 'help_map'

end

#==========================================================================
# Regular Middleman Setup
#==========================================================================

set :relative_links, true
activate :syntax

#==========================================================================
# Helpers
#  These helpers are used by the sample project only; there's no need
#  to keep them around in your own projects.
#==========================================================================

# Methods defined in the helpers block are available in templates
helpers do

  def product_name
    'middleman-pagegroups'
  end

  def product_version
    '1.0.10'
  end

  def product_uri
    'http://github.com/middlemac/middleman-pagegroups'
  end

end

# Build-specific configuration
configure :build do
  # Minify CSS on build
  # activate :minify_css

  # Minify Javascript on build
  # activate :minify_javascript
end


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>psidev.psi.mi.jami.model (PSI :: JAMI - Java framework for molecular interactions 3.2.12 API)</title>
<meta name="date" content="2021-08-20">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Package psidev.psi.mi.jami.model

Interface Summary

Interface
Description

Alias

Alias is a synonym.

AllostericEffector

The effector that elicits an allosteric response.

Allostery<T extends AllostericEffector>

The allostery cooperative Effect.

Annotation

An Annotations gives some information about a specific topic.

BioactiveEntity

Molecules showing activity in a living system and which can interact with other molecules

CausalRelationship

These relationship types denote a causal relationship, or the absence of a causal relationship between a subject and an object term

Checksum

Checksum is a value for checking consistency of the data and can also be used for identifying objects.

Complex

An interactor composed of interacting molecules that can be copurified.

Confidence

A Confidence gives information about how reliable an object is.

CooperativeEffect

A cooperative effect an interaction has on a subsequent interaction.

CooperativityEvidence

The experimental method and corresponding publication from which a cooperative effect has been inferred.

CvTerm

A controlled vocabulary term defined by an ontology.

Entity<F extends Feature>

An entity which gives more information to a specific molecule (such as features, causal relationships)

Experiment

Experiment in which some interactions has been determined.

ExperimentalEntity

An experimental entity with experimental features

ExperimentalParticipantCandidate

Interface for experimental participant candidates

ExperimentalParticipantPool

A pool of experimental participants

Feature<P extends Entity,F extends Feature>

Property of a participant that may interfere with the binding of a molecule.

FeatureEvidence

The form of a molecule that was actually used to experimentally demonstrate the interaction, that may differ
 from the sequence described by the identifying accession number.

FeatureModificationEffector

The modification (feature) that elicits an allosteric response in an allosteric molecule.

Gene

Interactor for genetic interactions

Interaction<T extends Participant>

Interaction involving one to several molecules.

InteractionEvidence

Interaction involving one to several molecules supported by experiments.

Interactor

Molecule or complex of molecules that interacts with other molecules/complexes

InteractorPool

InteractorPool represents a collection of potential interactors but we cannot determine which one interacts.

ModelledConfidence

A modelled confidence is a confidence for a modelled interaction.

ModelledEntity

An modelled entity with modelled features

ModelledFeature

Biological property of a participant that may be involved with or interfere with the binding of a molecule.

ModelledInteraction

An interaction that is not directly supported by experimental evidence but is based on homology statements, modelling, etc...

ModelledParameter

A modelled parameter is a parameter for a modelled interaction.

ModelledParticipant

Participant of a modelled interaction.

ModelledParticipantCandidate

Interface for modelled participant candidates

ModelledParticipantPool

A pool of modelled participant candidates

Molecule

This interface represents a simple molecule such as a protein, nucleic acid, gene, small molecule but excludes
 complexes and interactorSet

MoleculeEffector

The participant that elicits an allosteric response in an allosteric molecule upon binding to that molecule.

NamedExperiment

A named experiment is an experiment with a shortname, fullname and aliases

NamedInteraction<T extends Participant>

A named interaction is an interaction having a fullname and aliases in addition to a shortname.

NamedParticipant<I extends Interaction,F extends Feature>

A named entity is an entity having a short name and a fullname in addition to aliases.

NucleicAcid

Polymers of nucleotides which can interact with other molecules

OntologyTerm

Ontology term with definition,  parents and children

Organism

The organism is defined by a taxonomy identifier.

Parameter

A numeric parameter e.g.

Participant<I extends Interaction,F extends Feature>

Participant identified in an interaction

ParticipantCandidate<P extends ParticipantPool,F extends Feature>

A participant candidate is part of a participant pool and contains the molecule which can interact plus some participant details such as
 features and causal relationships

ParticipantEvidence

Participant of an interaction which is supported by experimental evidences

ParticipantPool<I extends Interaction,F extends Feature,P extends ParticipantCandidate>

A pool of participants that can be grouped together as a single participant as they are interchangeable

Polymer

A polymer is an interactor with a sequence

Position

The position of a feature in the interactor sequence

Preassembly

The pre-assembly cooperative effect.

Protein

Polymer of amino acids which can interact with other molecules.

Publication

A scientific publication which has been curated by an interaction database.

Range

A feature range indicates the positions of a feature in the interactor sequence

ResultingSequence

This interface is for representing a sequence portion that has been changed (by mutation, a variant, etc.)

Source

Source of the data.

Stoichiometry

The stoichiometry of a participant

VariableParameter

A VariableParameter is a variable experimental parameter such as a drug treatment where several drug concentration were used
 and that affects some interactions (dynamic interactions).

VariableParameterValue

A value for a specific variableParameter in a specific experiment - eg - the concentration of a specific drug.

VariableParameterValueSet

Set of variable parameter values applied together in a same experiment

Xref

Cross reference to an external database/resource which can give more information about an object.

Class Summary

Class
Description

ModelledComparableParticipant

ParameterValue

A parameter numeric value.

Enum Summary

Enum
Description

AllostericEffectorType

The types of allosteryEffectors

ComplexType

The type of complex that can describe this interaction.

CurationDepth

Flag to determine the curation depth.

InteractionCategory

Enum to recognize the object category of an interaction :
 - evidence : for InteractionEvidence implementations.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Copyright © 2021. All rights reserved.


text:
package com.linecorp.bot.client;

import static java.util.Collections.emptyList;

import java.util.List;
import java.util.concurrent.CompletableFuture;

import com.linecorp.bot.client.exception.GeneralLineMessagingException;
import com.linecorp.bot.model.Broadcast;
import com.linecorp.bot.model.Multicast;
import com.linecorp.bot.model.Narrowcast;
import com.linecorp.bot.model.PushMessage;
import com.linecorp.bot.model.ReplyMessage;
import com.linecorp.bot.model.group.GroupMemberCountResponse;
import com.linecorp.bot.model.group.GroupSummaryResponse;
import com.linecorp.bot.model.profile.MembersIdsResponse;
import com.linecorp.bot.model.profile.UserProfileResponse;
import com.linecorp.bot.model.request.GetFollowersRequest;
import com.linecorp.bot.model.request.SetWebhookEndpointRequest;
import com.linecorp.bot.model.request.TestWebhookEndpointRequest;
import com.linecorp.bot.model.response.BotApiResponse;
import com.linecorp.bot.model.response.BotInfoResponse;
import com.linecorp.bot.model.response.GetAggregationUnitNameListResponse;
import com.linecorp.bot.model.response.GetAggregationUnitUsageResponse;
import com.linecorp.bot.model.response.GetFollowersResponse;
import com.linecorp.bot.model.response.GetMessageEventResponse;
import com.linecorp.bot.model.response.GetNumberOfFollowersResponse;
import com.linecorp.bot.model.response.GetNumberOfMessageDeliveriesResponse;
import com.linecorp.bot.model.response.GetStatisticsPerUnitResponse;
import com.linecorp.bot.model.response.GetWebhookEndpointResponse;
import com.linecorp.bot.model.response.IssueLinkTokenResponse;
import com.linecorp.bot.model.response.MessageQuotaResponse;
import com.linecorp.bot.model.response.NarrowcastProgressResponse;
import com.linecorp.bot.model.response.NumberOfMessagesResponse;
import com.linecorp.bot.model.response.QuotaConsumptionResponse;
import com.linecorp.bot.model.response.SetWebhookEndpointResponse;
import com.linecorp.bot.model.response.TestWebhookEndpointResponse;
import com.linecorp.bot.model.response.demographics.GetFriendsDemographicsResponse;
import com.linecorp.bot.model.richmenu.RichMenu;
import com.linecorp.bot.model.richmenu.RichMenuBulkLinkRequest;
import com.linecorp.bot.model.richmenu.RichMenuBulkUnlinkRequest;
import com.linecorp.bot.model.richmenu.RichMenuIdResponse;
import com.linecorp.bot.model.richmenu.RichMenuListResponse;
import com.linecorp.bot.model.richmenu.RichMenuResponse;
import com.linecorp.bot.model.richmenualias.CreateRichMenuAliasRequest;
import com.linecorp.bot.model.richmenualias.RichMenuAliasListResponse;
import com.linecorp.bot.model.richmenualias.RichMenuAliasResponse;
import com.linecorp.bot.model.richmenualias.UpdateRichMenuAliasRequest;
import com.linecorp.bot.model.room.RoomMemberCountResponse;

import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

/**
 * Proxy implementation of {@link LineMessagingClient} to hind internal implementation.
 */
@Slf4j
@AllArgsConstructor
public class LineMessagingClientImpl implements LineMessagingClient {
    static final ExceptionConverter EXCEPTION_CONVERTER = new ExceptionConverter();
    private static final String ORG_TYPE_GROUP = "group"; // TODO Enum
    private static final String ORG_TYPE_ROOM = "room";
    private static final BotApiResponseBody BOT_API_SUCCESS_RESPONSE_BODY =
            BotApiResponseBody.builder().message("").details(emptyList()).build();

    private final LineMessagingService retrofitImpl;

    private final LineBlobClient blobDelegationTarget;

    @Override
    public CompletableFuture<BotApiResponse> replyMessage(final ReplyMessage replyMessage) {
        return toBotApiResponseFuture(retrofitImpl.replyMessage(replyMessage));
    }

    @Override
    public CompletableFuture<BotApiResponse> pushMessage(final PushMessage pushMessage) {
        return toBotApiResponseFuture(retrofitImpl.pushMessage(null, pushMessage));
    }

    @Override
    public CompletableFuture<BotApiResponse> multicast(final Multicast multicast) {
        return toBotApiResponseFuture(retrofitImpl.multicast(null, multicast));
    }

    @Override
    public CompletableFuture<BotApiResponse> broadcast(Broadcast broadcast) {
        return toBotApiResponseFuture(retrofitImpl.broadcast(null, broadcast));
    }

    @Override
    public CompletableFuture<BotApiResponse> narrowcast(Narrowcast narrowcast) {
        return toBotApiResponseFuture(retrofitImpl.narrowcast(null, narrowcast));
    }

    /**
     * Gets the status of a narrowcast message.
     */
    @Override
    public CompletableFuture<NarrowcastProgressResponse> getNarrowcastProgress(String requestId) {
        return toFuture(retrofitImpl.getNarrowcastProgress(requestId));
    }

    @Override
    public CompletableFuture<MessageQuotaResponse> getMessageQuota() {
        return toFuture(retrofitImpl.getMessageQuota());
    }

    @Override
    public CompletableFuture<QuotaConsumptionResponse> getMessageQuotaConsumption() {
        return toFuture(retrofitImpl.getMessageQuotaConsumption());
    }

    @Override
    public CompletableFuture<NumberOfMessagesResponse> getNumberOfSentReplyMessages(String date) {
        return toFuture(retrofitImpl.getNumberOfSentReplyMessages(date));
    }

    @Override
    public CompletableFuture<NumberOfMessagesResponse> getNumberOfSentPushMessages(String date) {
        return toFuture(retrofitImpl.getNumberOfSentPushMessages(date));
    }

    @Override
    public CompletableFuture<NumberOfMessagesResponse> getNumberOfSentMulticastMessages(String date) {
        return toFuture(retrofitImpl.getNumberOfSentMulticastMessages(date));
    }

    @Override
    public CompletableFuture<NumberOfMessagesResponse> getNumberOfSentBroadcastMessages(String date) {
        return toFuture(retrofitImpl.getNumberOfSentBroadcastMessages(date));
    }

    @Override
    public CompletableFuture<UserProfileResponse> getProfile(final String userId) {
        return toFuture(retrofitImpl.getProfile(userId));
    }

    @Override
    public CompletableFuture<UserProfileResponse> getGroupMemberProfile(
            final String groupId, final String userId) {
        return toFuture(retrofitImpl.getMemberProfile(ORG_TYPE_GROUP, groupId, userId));
    }

    @Override
    public CompletableFuture<UserProfileResponse> getRoomMemberProfile(
            final String roomId, final String userId) {
        return toFuture(retrofitImpl.getMemberProfile(ORG_TYPE_ROOM, roomId, userId));
    }

    @Override
    public CompletableFuture<MembersIdsResponse> getGroupMembersIds(
            final String groupId, final String start) {
        return toFuture(retrofitImpl.getMembersIds(ORG_TYPE_GROUP, groupId, start));
    }

    @Override
    public CompletableFuture<MembersIdsResponse> getRoomMembersIds(
            final String roomId, final String start) {
        return toFuture(retrofitImpl.getMembersIds(ORG_TYPE_ROOM, roomId, start));
    }

    @Override
    public CompletableFuture<BotApiResponse> leaveGroup(final String groupId) {
        return toBotApiResponseFuture(retrofitImpl.leaveGroup(groupId));
    }

    @Override
    public CompletableFuture<BotApiResponse> leaveRoom(final String roomId) {
        return toBotApiResponseFuture(retrofitImpl.leaveRoom(roomId));
    }

    @Override
    public CompletableFuture<GroupSummaryResponse> getGroupSummary(final String groupId) {
        return toFuture(retrofitImpl.getGroupSummary(groupId));
    }

    @Override
    public CompletableFuture<GroupMemberCountResponse> getGroupMemberCount(String groupId) {
        return toFuture(retrofitImpl.getGroupMemberCount(groupId));
    }

    @Override
    public CompletableFuture<RoomMemberCountResponse> getRoomMemberCount(String roomId) {
        return toFuture(retrofitImpl.getRoomMemberCount(roomId));
    }

    @Override
    public CompletableFuture<RichMenuResponse> getRichMenu(final String richMenuId) {
        return toFuture(retrofitImpl.getRichMenu(richMenuId));
    }

    @Override
    public CompletableFuture<BotApiResponse> validateRichMenuObject(final RichMenu richMenu) {
        return toBotApiFuture(retrofitImpl.validateRichMenuObject(richMenu));
    }

    @Override
    public CompletableFuture<RichMenuIdResponse> createRichMenu(final RichMenu richMenu) {
        return toFuture(retrofitImpl.createRichMenu(richMenu));
    }

    @Override
    public CompletableFuture<BotApiResponse> deleteRichMenu(final String richMenuId) {
        return toBotApiFuture(retrofitImpl.deleteRichMenu(richMenuId));
    }

    @Override
    public CompletableFuture<RichMenuIdResponse> getRichMenuIdOfUser(final String userId) {
        return toFuture(retrofitImpl.getRichMenuIdOfUser(userId));
    }

    @Override
    public CompletableFuture<BotApiResponse> linkRichMenuIdToUser(
            final String userId, final String richMenuId) {
        return toBotApiFuture(retrofitImpl.linkRichMenuToUser(userId, richMenuId));
    }

    @Override
    public CompletableFuture<BotApiResponse> linkRichMenuIdToUsers(List<String> userIds, String richMenuId) {
        return toBotApiFuture(retrofitImpl.linkRichMenuToUsers(RichMenuBulkLinkRequest.builder()
                                                                                .richMenuId(richMenuId)
                                                                                .userIds(userIds)
                                                                                .build()));
    }

    @Override
    public CompletableFuture<BotApiResponse> unlinkRichMenuIdFromUser(final String userId) {
        return toBotApiFuture(retrofitImpl.unlinkRichMenuIdFromUser(userId));
    }

    @Override
    public CompletableFuture<BotApiResponse> unlinkRichMenuIdFromUsers(List<String> userIds) {
        return toBotApiFuture(retrofitImpl.unlinkRichMenuIdFromUsers(RichMenuBulkUnlinkRequest.builder()
                                                                                .userIds(userIds)
                                                                                .build()));
    }

    @Override
    public CompletableFuture<RichMenuListResponse> getRichMenuList() {
        return toFuture(retrofitImpl.getRichMenuList());
    }

    @Override
    public CompletableFuture<BotApiResponse> setDefaultRichMenu(final String richMenuId) {
        return toBotApiFuture(retrofitImpl.setDefaultRichMenu(richMenuId));
    }

    @Override
    public CompletableFuture<RichMenuIdResponse> getDefaultRichMenuId() {
        return toFuture(retrofitImpl.getDefaultRichMenuId());
    }

    @Override
    public CompletableFuture<BotApiResponse> cancelDefaultRichMenu() {
        return toBotApiFuture(retrofitImpl.cancelDefaultRichMenu());
    }

    @Override
    public CompletableFuture<BotApiResponse> createRichMenuAlias(CreateRichMenuAliasRequest request) {
        return toBotApiResponseFuture(retrofitImpl.createRichMenuAlias(request));
    }

    @Override
    public CompletableFuture<BotApiResponse> updateRichMenuAlias(String richMenuAliasId,
                                                                 UpdateRichMenuAliasRequest request) {
        return toBotApiResponseFuture(retrofitImpl.updateRichMenuAlias(richMenuAliasId, request));
    }

    @Override
    public CompletableFuture<RichMenuAliasResponse> getRichMenuAlias(
            String richMenuAliasId) {
        return toFuture(retrofitImpl.getRichMenuAlias(richMenuAliasId));
    }

    @Override
    public CompletableFuture<RichMenuAliasListResponse> getRichMenuAliasList() {
        return toFuture(retrofitImpl.getRichMenuAliasList());
    }

    @Override
    public CompletableFuture<BotApiResponse> deleteRichMenuAlias(String richMenuAliasId) {
        return toBotApiResponseFuture(retrofitImpl.deleteRichMenuAlias(richMenuAliasId));
    }

    @Override
    public CompletableFuture<IssueLinkTokenResponse> issueLinkToken(String userId) {
        return toFuture(retrofitImpl.issueLinkToken(userId));
    }

    @Override
    public CompletableFuture<GetFriendsDemographicsResponse> getFriendsDemographics() {
        return toFuture(retrofitImpl.getFriendsDemographics());
    }

    @Override
    public CompletableFuture<GetNumberOfMessageDeliveriesResponse> getNumberOfMessageDeliveries(String date) {
        return toFuture(retrofitImpl.getNumberOfMessageDeliveries(date));
    }

    @Override
    public CompletableFuture<GetNumberOfFollowersResponse> getNumberOfFollowers(String date) {
        return toFuture(retrofitImpl.getNumberOfFollowers(date));
    }

    @Override
    public CompletableFuture<GetFollowersResponse> getFollowers(GetFollowersRequest request) {
        return toFuture(retrofitImpl.getFollowers(request.getNext(), request.getLimit()));
    }

    @Override
    public CompletableFuture<GetMessageEventResponse> getMessageEvent(String requestId) {
        return toFuture(retrofitImpl.getMessageEvent(requestId));
    }

    @Override
    public CompletableFuture<BotInfoResponse> getBotInfo() {
        return toFuture(retrofitImpl.getBotInfo());
    }

    @Override
    public CompletableFuture<GetWebhookEndpointResponse> getWebhookEndpoint() {
        return toFuture(retrofitImpl.getWebhookEndpoint());
    }

    @Override
    public CompletableFuture<SetWebhookEndpointResponse> setWebhookEndpoint(SetWebhookEndpointRequest request) {
        return toFuture(retrofitImpl.setWebhookEndpoint(request));
    }

    @Override
    public CompletableFuture<TestWebhookEndpointResponse> testWebhookEndpoint(
            TestWebhookEndpointRequest request) {
        return toFuture(retrofitImpl.testWebhookEndpoint(request));
    }

    @Override
    public CompletableFuture<GetStatisticsPerUnitResponse> getStatisticsPerUnit(
            String customAggregationUnit, String from, String to) {
        return toFuture(retrofitImpl.getStatisticsPerUnit(customAggregationUnit, from, to));
    }

    @Override
    public CompletableFuture<GetAggregationUnitUsageResponse> getAggregationUnitUsage() {
        return toFuture(retrofitImpl.getAggregationUnitUsage());
    }

    @Override
    public CompletableFuture<GetAggregationUnitNameListResponse> getAggregationUnitNameList(
            String limit, String start) {
        return toFuture(retrofitImpl.getAggregationUnitNameList(limit, start));
    }

    // TODO: Extract this method.
    static <T> CompletableFuture<T> toFuture(Call<T> callToWrap) {
        final CallbackAdaptor<T> completableFuture = new CallbackAdaptor<>();
        callToWrap.enqueue(completableFuture);
        return completableFuture;
    }

    private static CompletableFuture<BotApiResponse> toBotApiResponseFuture(
            final Call<BotApiResponseBody> callToWrap) {
        final BotApiCallbackAdaptor completableFuture = new BotApiCallbackAdaptor();
        callToWrap.enqueue(completableFuture);
        return completableFuture;
    }

    static CompletableFuture<BotApiResponse> toBotApiFuture(Call<Void> callToWrap) {
        final VoidToBotApiCallbackAdaptor completableFuture = new VoidToBotApiCallbackAdaptor();
        callToWrap.enqueue(completableFuture);
        return completableFuture;
    }

    static class CallbackAdaptor<T> extends CompletableFuture<T> implements Callback<T> {
        @Override
        public void onResponse(final Call<T> call, final Response<T> response) {
            if (response.isSuccessful()) {
                complete(response.body());
            } else {
                completeExceptionally(EXCEPTION_CONVERTER.apply(response));
            }
        }

        @Override
        public void onFailure(final Call<T> call, final Throwable t) {
            completeExceptionally(
                    new GeneralLineMessagingException(t.getMessage(), null, t));
        }
    }

    static class VoidToBotApiCallbackAdaptor extends CompletableFuture<BotApiResponse>
            implements Callback<Void> {
        @Override
        public void onResponse(final Call<Void> call, final Response<Void> response) {
            if (response.isSuccessful()) {
                final String requestId = response.headers().get("x-line-request-id");
                complete(BOT_API_SUCCESS_RESPONSE_BODY.withRequestId(requestId));
            } else {
                completeExceptionally(EXCEPTION_CONVERTER.apply(response));
            }
        }

        @Override
        public void onFailure(final Call<Void> call, final Throwable t) {
            completeExceptionally(
                    new GeneralLineMessagingException(t.getMessage(), null, t));
        }
    }

    static class BotApiCallbackAdaptor extends CompletableFuture<BotApiResponse>
            implements Callback<BotApiResponseBody> {
        @Override
        public void onResponse(final Call<BotApiResponseBody> call,
                               final Response<BotApiResponseBody> response) {
            if (response.isSuccessful()) {
                final String requestId = response.headers().get("x-line-request-id");
                complete(response.body().withRequestId(requestId));
            } else {
                completeExceptionally(EXCEPTION_CONVERTER.apply(response));
            }
        }

        @Override
        public void onFailure(final Call<BotApiResponseBody> call, final Throwable t) {
            completeExceptionally(
                    new GeneralLineMessagingException(t.getMessage(), null, t));
        }
    }
}


text:
============
ALTER SCHEMA
============

Synopsis
--------

.. code-block:: none

    ALTER SCHEMA name RENAME TO new_name

Description
-----------

Change the definition of an existing schema.

Examples
--------

Rename schema ``web`` to ``traffic``::

    ALTER SCHEMA web RENAME TO traffic

See Also
--------

:doc:`create-schema`


text:
<!DOCTYPE html>

    <meta http-equiv="refresh" content="0;URL=type.U162.html">

Redirecting to type.U162.html...


text:
class CreateDebitcreditTransactions < ActiveRecord::Migration
  def change
    create_table :debitcredit_transactions do |t|
      t.integer :reference_id,   null: true
      t.string  :reference_type, null: true, limit: 32
      t.string  :kind,           null: true
      t.string  :description,    null: false

      t.timestamps
    end
    add_index :debitcredit_transactions, [:reference_id, :reference_type, :id], name: :rindex
  end
end


text:
package ru.demo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author Evgeny Khodzitskiy (evgeny.hodz@gmail.com)
 * @since 18.08.2017
 */
@Component
public class ByeWorld {
    @Override
    public String toString(){
        return "Bye!";
    }
}


text:
---
external help file: Microsoft.Azure.Commands.Websites.dll-Help.xml
Module Name: AzureRM
ms.assetid: 8F36244D-A4D7-40BB-AC4C-E9AD445549F8
online version: https://docs.microsoft.com/en-us/powershell/module/azurerm.websites/new-azurermappserviceplan
schema: 2.0.0
---

# New-AzureRmAppServicePlan

## SYNOPSIS
Creates an Azure App Service plan in a given Geo location.

## SYNTAX

### S1
```
New-AzureRmAppServicePlan [-Location] <String> [[-Tier] <String>] [[-NumberofWorkers] <Int32>]
 [[-WorkerSize] <String>] [[-AseName] <String>] [[-AseResourceGroupName] <String>] [-PerSiteScaling <Boolean>]
 [-ResourceGroupName] <String> [-Name] <String> [-AsJob][-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
```

### S2
```
New-AzureRmAppServicePlan [-Location] <String> [[-Tier] <String>] [[-NumberofWorkers] <Int32>]
 [[-WorkerSize] <String>] [[-AseName] <String>] [[-AseResourceGroupName] <String>] [-PerSiteScaling <Boolean>]
 [-AppServicePlan] <ServerFarmWithRichSku> [-AsJob]
 [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
```

## DESCRIPTION
The **New-AzureRmAppServicePlan** cmdlet creates an Azure App Service plan in a given Geo location with the specified Tier, worker size, and number of workers.

## EXAMPLES

### Example 1: Create an App Service plan
```
PS C:\>New-AzureRmAppServicePlan -ResourceGroupName "Default-Web-WestUS" -Name "ContosoASP" -Location "West US" -Tier "Basic" -NumberofWorkers 2 -WorkerSize "Small"
```

This command creates an App Service plan named ContosoASP in the resource group named Default-Web-WestUS in Geo location West US.
The command specifies a Basic Tier and allocates two small workers.

## PARAMETERS

### -AppServicePlan
App Service Plan Object

```yaml
Type: ServerFarmWithRichSku
Parameter Sets: S2
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```

### -AseName
App Service Environment Name

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

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

### -AseResourceGroupName
App Service Environment Resource Group Name

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

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

### -DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure.

```yaml
Type: IAzureContextContainer
Parameter Sets: (All)
Aliases: AzureRmContext, AzureCredential

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

### -Location
Location

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

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

### -Name
App Service Plan Name

```yaml
Type: String
Parameter Sets: S1
Aliases:

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

### -NumberofWorkers
Number Of Workers

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

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

### -PerSiteScaling
Whether or not to enable Per Site Scaling

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

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

### -ResourceGroupName
Resource Group Name

```yaml
Type: String
Parameter Sets: S1
Aliases:

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

### -Tier
Tier

```yaml
Type: String
Parameter Sets: (All)
Aliases:
Accepted values: Free, Shared, Basic, Standard, Premium, PremiumV2

Required: False
Position: 3
Default value: Free
Accept pipeline input: False
Accept wildcard characters: False
```

### -WorkerSize
Size of web worker

```yaml
Type: String
Parameter Sets: (All)
Aliases:
Accepted values: Small, Medium, Large, ExtraLarge

Required: False
Position: 5
Default value: Small
Accept pipeline input: False
Accept wildcard characters: False
```
### -AsJob
Run cmdlet in the background

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

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

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

## INPUTS

### ServerFarmWithRichSku
Parameter 'AppServicePlan' accepts value of type 'ServerFarmWithRichSku' from the pipeline

## OUTPUTS

### Microsoft.Azure.Management.WebSites.Models.ServerFarmWithRichSku

## NOTES

## RELATED LINKS

[Get-AzureRmAppServicePlan](./Get-AzureRmAppServicePlan.md)

[Remove-AzureRmAppServicePlan](./Remove-AzureRmAppServicePlan.md)

[Set-AzureRmAppServicePlan](./Set-AzureRmAppServicePlan.md)


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

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../../../../print.css" type="text/css" media="print">
<title>com.yahoo.astra.fl.charts.series Summary</title>

YUI AS Component Documentation	All Packages | All Classes | Index | FramesNo Frames

Package com.yahoo.astra.fl.charts.series	Interfaces | Classes

Interfaces

 	Interface	Description

 	ICategorySeries
  Defines functions and properties for an ISeries that relies on categories.

 	ILegendItemSeries
  A series type that can create data for a legend.

 	ISeries
  A renderer for a series displayed on a chart.

 	ISeriesItemRenderer
  A renderer for an item in a series on a chart.

 	IStackedSeries
  A type of series that supports stacking.

Classes

 	Class	Description

 	BarSeries
  Renders data points as a series of horizontal bars.

 	CartesianSeries
  Functionality common to most series appearing in cartesian charts.

 	ColumnSeries
  Renders data points as a series of vertical columns.

 	LineSeries
  Renders data points as a series of connected line segments.

 	PieSeries
  Renders data points as a series of pie-like wedges.

 	Series
  Functionality common to most series.

 	SeriesItemRenderer
     The primary item renderer class for a chart series.

 	StackedBarSeries
  A bar series type that stacks.

 	StackedColumnSeries
  A column series type that stacks.


text:
#ifndef SIMPLE_UART_H
#define SIMPLE_UART_H

/*lint ++flb "Enter library region" */

#include <stdbool.h>
#include <stdint.h>

/** @file
* @brief Simple UART driver
*
*
* @defgroup nrf_drivers_simple_uart Simple UART driver
* @{
* @ingroup nrf_drivers
* @brief Simple UART driver
*/

/** @brief Function for reading a character from UART.
Execution is blocked until UART peripheral detects character has been received.
\return cr Received character.
*/
uint8_t simple_uart_get(void);

/** @brief Function for reading a character from UART with timeout on how long to wait for the byte to be received.
Execution is blocked until UART peripheral detects character has been received or until the timeout expires, which even occurs first
\return bool True, if byte is received before timeout, else returns False.
@param timeout_ms maximum time to wait for the data.
@param rx_data pointer to the memory where the received data is stored.
*/
bool simple_uart_get_with_timeout(int32_t timeout_ms, uint8_t *rx_data);

/** @brief Function for sending a character to UART.
Execution is blocked until UART peripheral reports character to have been send.
@param cr Character to send.
*/
void simple_uart_put(uint8_t cr);

/** @brief Function for sending a string to UART.
Execution is blocked until UART peripheral reports all characters to have been send.
Maximum string length is 254 characters including null character in the end.
@param str Null terminated string to send.
*/
void simple_uart_putstring(const uint8_t *str);

/** @brief Function for configuring UART to use 38400 baud rate.
@param rts_pin_number Chip pin number to be used for UART RTS
@param txd_pin_number Chip pin number to be used for UART TXD
@param cts_pin_number Chip pin number to be used for UART CTS
@param rxd_pin_number Chip pin number to be used for UART RXD
@param hwfc Enable hardware flow control
*/
void simple_uart_config(uint8_t rts_pin_number, uint8_t txd_pin_number, uint8_t cts_pin_number, uint8_t rxd_pin_number, bool hwfc);

/**
 *@}
 **/

#define LEVEL_VERBOSE		1
#define LEVEL_INFO			2
#define LEVEL_DEBUG			3
#define LEVEL_WARNING		4
#define LEVEL_ERROR			5
#define LEVEL_NONE			6

#define __LEVEL__	LEVEL_VERBOSE

void __log(uint8_t level, const char * func, uint32_t line, const char * restrict format, ...);
#if defined(DEBUG_LOG)
    #define LOG(level, format, ...) __log(level, __func__, __LINE__, format, ##__VA_ARGS__);
#else
    #define LOG(level, format, ...)
#endif

/*lint --flb "Leave library region" */
#endif