text:
"""Testing framework."""
from __future__ import print_function
from __future__ import unicode_literals

import functools

# python2/3 support
try:
    from itertools import izip_longest as zip_longest
except ImportError:
    from itertools import zip_longest

import inspect
import json

import pytest
from napalm_base.test import helpers
from napalm_base.test import models
from napalm_base import NetworkDriver

# text_type is 'unicode' for py2 and 'str' for py3
from napalm_base.utils.py23_compat import text_type

from napalm_base.test import conftest

def list_dicts_diff(prv, nxt):
    """Compare two lists of dicts."""
    result = []
    for prv_element, nxt_element in zip_longest(prv, nxt, fillvalue={}):
        intermediate_result = dict_diff(prv_element, nxt_element)
        if intermediate_result:
            result.append(intermediate_result)
    return result

def dict_diff(prv, nxt):
    """Return a dict of keys that differ with another config object."""
    keys = set(list(prv.keys()) + list(nxt.keys()))
    result = {}

    for k in keys:
        if isinstance(prv.get(k), dict):
            if isinstance(nxt.get(k), dict):
                "If both are dicts we do a recursive call."
                diff = dict_diff(prv.get(k), nxt.get(k))
                if diff:
                    result[k] = diff
            else:
                "If only one is a dict they are clearly different"
                result[k] = {'result': prv.get(k), 'expected': nxt.get(k)}
        else:
            "Ellipsis is a wildcard."""
            if prv.get(k) != nxt.get(k) and nxt.get(k) != "...":
                result[k] = {'result': prv.get(k), 'expected': nxt.get(k)}
    return result

def wrap_test_cases(func):
    """Wrap test cases."""
    func.__dict__['build_test_cases'] = True

    @functools.wraps(func)
    def mock_wrapper(cls, test_case):
        for patched_attr in cls.device.patched_attrs:
            attr = getattr(cls.device, patched_attr)
            attr.current_test = func.__name__
            attr.current_test_case = test_case

        try:
            # This is an ugly, ugly, ugly hack because some python objects don't load
            # as expected. For example, dicts where integers are strings
            result = json.loads(json.dumps(func(cls, test_case)))
        except IOError:
            if test_case == "no_test_case_found":
                pytest.fail("No test case for '{}' found".format(func.__name__))
            else:
                raise
        except NotImplementedError:
            pytest.skip("Method not implemented")
            return

        # This is an ugly, ugly, ugly hack because some python objects don't load
        # as expected. For example, dicts where integers are strings

        try:
            expected_result = attr.expected_result
        except IOError as e:
            raise Exception("{}. Actual result was: {}".format(e, json.dumps(result)))
        if isinstance(result, list):
            diff = list_dicts_diff(result, expected_result)
        else:
            diff = dict_diff(result, expected_result)
        if diff:
            print("Resulting JSON object was: {}".format(json.dumps(result)))
            raise AssertionError("Expected result varies on some keys {}".format(
                                                                        json.dumps(diff)))

        for patched_attr in cls.device.patched_attrs:
            attr = getattr(cls.device, patched_attr)
            attr.current_test = ''   # Empty them to avoid side effects
            attr.current_test_case = ''   # Empty them to avoid side effects

        return result

    @functools.wraps(func)
    def real_wrapper(cls, test_case):
        try:
            return func(cls, test_case)
        except NotImplementedError:
            pytest.skip("Method not implemented")
            return

    if conftest.NAPALM_TEST_MOCK:
        return mock_wrapper
    else:
        return real_wrapper

class BaseTestGetters(object):
    """Base class for testing drivers."""

    def test_method_signatures(self):
        """Test that all methods have the same signature."""
        errors = {}
        cls = self.driver
        # Create fictional driver instance (py3 needs bound methods)
        tmp_obj = cls(hostname='test', username='admin', password='pwd')
        attrs = [m for m, v in inspect.getmembers(tmp_obj)]
        for attr in attrs:
            func = getattr(tmp_obj, attr)
            if attr.startswith('_') or not inspect.ismethod(func):
                continue
            try:
                orig = getattr(NetworkDriver, attr)
                orig_spec = inspect.getargspec(orig)
            except AttributeError:
                orig_spec = 'Method does not exist in napalm_base'
            func_spec = inspect.getargspec(func)
            if orig_spec != func_spec:
                errors[attr] = (orig_spec, func_spec)

        EXTRA_METHODS = ['__init__', ]
        for method in EXTRA_METHODS:
            orig_spec = inspect.getargspec(getattr(NetworkDriver, method))
            func_spec = inspect.getargspec(getattr(cls, method))
            if orig_spec != func_spec:
                errors[attr] = (orig_spec, func_spec)

        assert not errors, "Some methods vary. \n{}".format(errors.keys())

    @wrap_test_cases
    def test_is_alive(self, test_case):
        """Test is_alive method."""
        alive = self.device.is_alive()
        assert helpers.test_model(models.alive, alive)
        return alive

    @wrap_test_cases
    def test_get_facts(self, test_case):
        """Test get_facts method."""
        facts = self.device.get_facts()
        assert helpers.test_model(models.facts, facts)
        return facts

    @wrap_test_cases
    def test_get_interfaces(self, test_case):
        """Test get_interfaces."""
        get_interfaces = self.device.get_interfaces()
        assert len(get_interfaces) > 0

        for interface, interface_data in get_interfaces.items():
            assert helpers.test_model(models.interface, interface_data)

        return get_interfaces

    @wrap_test_cases
    def test_get_lldp_neighbors(self, test_case):
        """Test get_lldp_neighbors."""
        get_lldp_neighbors = self.device.get_lldp_neighbors()
        assert len(get_lldp_neighbors) > 0

        for interface, neighbor_list in get_lldp_neighbors.items():
            for neighbor in neighbor_list:
                assert helpers.test_model(models.lldp_neighbors, neighbor)

        return get_lldp_neighbors

    @wrap_test_cases
    def test_get_interfaces_counters(self, test_case):
        """Test get_interfaces_counters."""
        get_interfaces_counters = self.device.get_interfaces_counters()
        assert len(self.device.get_interfaces_counters()) > 0

        for interface, interface_data in get_interfaces_counters.items():
            assert helpers.test_model(models.interface_counters, interface_data)

        return get_interfaces_counters

    @wrap_test_cases
    def test_get_environment(self, test_case):
        """Test get_environment."""
        environment = self.device.get_environment()
        assert len(environment) > 0

        for fan, fan_data in environment['fans'].items():
            assert helpers.test_model(models.fan, fan_data)

        for power, power_data in environment['power'].items():
            assert helpers.test_model(models.power, power_data)

        for temperature, temperature_data in environment['temperature'].items():
            assert helpers.test_model(models.temperature, temperature_data)

        for cpu, cpu_data in environment['cpu'].items():
            assert helpers.test_model(models.cpu, cpu_data)

        assert helpers.test_model(models.memory, environment['memory'])

        return environment

    @wrap_test_cases
    def test_get_bgp_neighbors(self, test_case):
        """Test get_bgp_neighbors."""
        get_bgp_neighbors = self.device.get_bgp_neighbors()
        assert 'global' in get_bgp_neighbors.keys()

        for vrf, vrf_data in get_bgp_neighbors.items():
            assert isinstance(vrf_data['router_id'], text_type)

            for peer, peer_data in vrf_data['peers'].items():
                assert helpers.test_model(models.peer, peer_data)

                for af, af_data in peer_data['address_family'].items():
                    assert helpers.test_model(models.af, af_data)

        return get_bgp_neighbors

    @wrap_test_cases
    def test_get_lldp_neighbors_detail(self, test_case):
        """Test get_lldp_neighbors_detail."""
        get_lldp_neighbors_detail = self.device.get_lldp_neighbors_detail()
        assert len(get_lldp_neighbors_detail) > 0

        for interface, neighbor_list in get_lldp_neighbors_detail.items():
            for neighbor in neighbor_list:
                assert helpers.test_model(models.lldp_neighbors_detail, neighbor)

        return get_lldp_neighbors_detail

    @wrap_test_cases
    def test_get_bgp_config(self, test_case):
        """Test get_bgp_config."""
        get_bgp_config = self.device.get_bgp_config()
        assert len(get_bgp_config) > 0

        for bgp_group in get_bgp_config.values():
            assert helpers.test_model(models.bgp_config_group, bgp_group)
            for bgp_neighbor in bgp_group.get('neighbors', {}).values():
                assert helpers.test_model(models.bgp_config_neighbor, bgp_neighbor)

        return get_bgp_config

    @wrap_test_cases
    def test_get_bgp_neighbors_detail(self, test_case):
        """Test get_bgp_neighbors_detail."""
        get_bgp_neighbors_detail = self.device.get_bgp_neighbors_detail()

        assert len(get_bgp_neighbors_detail) > 0

        for vrf, vrf_ases in get_bgp_neighbors_detail.items():
            assert isinstance(vrf, text_type)
            for remote_as, neighbor_list in vrf_ases.items():
                assert isinstance(remote_as, int)
                for neighbor in neighbor_list:
                    assert helpers.test_model(models.peer_details, neighbor)

        return get_bgp_neighbors_detail

    @wrap_test_cases
    def test_get_arp_table(self, test_case):
        """Test get_arp_table."""
        get_arp_table = self.device.get_arp_table()
        assert len(get_arp_table) > 0

        for arp_entry in get_arp_table:
            assert helpers.test_model(models.arp_table, arp_entry)

        return get_arp_table

    @wrap_test_cases
    def test_get_ipv6_neighbors_table(self, test_case):
        """Test get_ipv6_neighbors_table."""
        get_ipv6_neighbors_table = self.device.get_ipv6_neighbors_table()
        assert len(get_ipv6_neighbors_table) > 0

        for entry in get_ipv6_neighbors_table:
            assert helpers.test_model(models.ipv6_neighbor, entry)

        return get_ipv6_neighbors_table

    @wrap_test_cases
    def test_get_ntp_peers(self, test_case):
        """Test get_ntp_peers."""
        get_ntp_peers = self.device.get_ntp_peers()
        assert len(get_ntp_peers) > 0

        for peer, peer_details in get_ntp_peers.items():
            assert isinstance(peer, text_type)
            assert helpers.test_model(models.ntp_peer, peer_details)

        return get_ntp_peers

    @wrap_test_cases
    def test_get_ntp_servers(self, test_case):
        """Test get_ntp_servers."""
        get_ntp_servers = self.device.get_ntp_servers()
        assert len(get_ntp_servers) > 0

        for server, server_details in get_ntp_servers.items():
            assert isinstance(server, text_type)
            assert helpers.test_model(models.ntp_server, server_details)

        return get_ntp_servers

    @wrap_test_cases
    def test_get_ntp_stats(self, test_case):
        """Test get_ntp_stats."""
        get_ntp_stats = self.device.get_ntp_stats()
        assert len(get_ntp_stats) > 0

        for ntp_peer_details in get_ntp_stats:
            assert helpers.test_model(models.ntp_stats, ntp_peer_details)

        return get_ntp_stats

    @wrap_test_cases
    def test_get_interfaces_ip(self, test_case):
        """Test get_interfaces_ip."""
        get_interfaces_ip = self.device.get_interfaces_ip()
        assert len(get_interfaces_ip) > 0

        for interface, interface_details in get_interfaces_ip.items():
            ipv4 = interface_details.get('ipv4', {})
            ipv6 = interface_details.get('ipv6', {})
            for ip, ip_details in ipv4.items():
                assert helpers.test_model(models.interfaces_ip, ip_details)
            for ip, ip_details in ipv6.items():
                assert helpers.test_model(models.interfaces_ip, ip_details)

        return get_interfaces_ip

    @wrap_test_cases
    def test_get_mac_address_table(self, test_case):
        """Test get_mac_address_table."""
        get_mac_address_table = self.device.get_mac_address_table()
        assert len(get_mac_address_table) > 0

        for mac_table_entry in get_mac_address_table:
            assert helpers.test_model(models.mac_address_table, mac_table_entry)

        return get_mac_address_table

    @wrap_test_cases
    def test_get_route_to(self, test_case):
        """Test get_route_to."""
        destination = '1.0.4.0/24'
        protocol = 'bgp'
        get_route_to = self.device.get_route_to(destination=destination, protocol=protocol)

        assert len(get_route_to) > 0

        for prefix, routes in get_route_to.items():
            for route in routes:
                assert helpers.test_model(models.route, route)

        return get_route_to

    @wrap_test_cases
    def test_get_snmp_information(self, test_case):
        """Test get_snmp_information."""
        get_snmp_information = self.device.get_snmp_information()

        assert len(get_snmp_information) > 0

        for snmp_entry in get_snmp_information:
            assert helpers.test_model(models.snmp, get_snmp_information)

        for community, community_data in get_snmp_information['community'].items():
            assert helpers.test_model(models.snmp_community, community_data)

        return get_snmp_information

    @wrap_test_cases
    def test_get_probes_config(self, test_case):
        """Test get_probes_config."""
        get_probes_config = self.device.get_probes_config()

        assert len(get_probes_config) > 0

        for probe_name, probe_tests in get_probes_config.items():
            for test_name, test_config in probe_tests.items():
                assert helpers.test_model(models.probe_test, test_config)

        return get_probes_config

    @wrap_test_cases
    def test_get_probes_results(self, test_case):
        """Test get_probes_results."""
        get_probes_results = self.device.get_probes_results()
        assert len(get_probes_results) > 0

        for probe_name, probe_tests in get_probes_results.items():
            for test_name, test_results in probe_tests.items():
                assert helpers.test_model(models.probe_test_results, test_results)

        return get_probes_results

    @wrap_test_cases
    def test_ping(self, test_case):
        """Test ping."""
        destination = '8.8.8.8'
        get_ping = self.device.ping(destination)
        assert isinstance(get_ping.get('success'), dict)
        ping_results = get_ping.get('success', {})

        assert helpers.test_model(models.ping, ping_results)

        for ping_result in ping_results.get('results', []):
            assert helpers.test_model(models.ping_result, ping_result)

        return get_ping

    @wrap_test_cases
    def test_traceroute(self, test_case):
        """Test traceroute."""
        destination = '8.8.8.8'
        get_traceroute = self.device.traceroute(destination)
        assert isinstance(get_traceroute.get('success'), dict)
        traceroute_results = get_traceroute.get('success', {})

        for hope_id, hop_result in traceroute_results.items():
            for probe_id, probe_result in hop_result.get('probes', {}).items():
                assert helpers.test_model(models.traceroute, probe_result)

        return get_traceroute

    @wrap_test_cases
    def test_get_users(self, test_case):
        """Test get_users."""
        get_users = self.device.get_users()
        assert len(get_users)

        for user, user_details in get_users.items():
            assert helpers.test_model(models.users, user_details)
            assert (0 <= user_details.get('level') <= 15)

        return get_users

    @wrap_test_cases
    def test_get_optics(self, test_case):
        """Test get_optics."""
        get_optics = self.device.get_optics()
        assert isinstance(get_optics, dict)

        for iface, iface_data in get_optics.items():
            assert isinstance(iface, text_type)
            for channel in iface_data['physical_channels']['channel']:
                assert len(channel) == 2
                assert isinstance(channel['index'], int)
                for field in ['input_power', 'output_power',
                              'laser_bias_current']:

                    assert len(channel['state'][field]) == 4
                    assert isinstance(channel['state'][field]['instant'],
                                      float)
                    assert isinstance(channel['state'][field]['avg'], float)
                    assert isinstance(channel['state'][field]['min'], float)
                    assert isinstance(channel['state'][field]['max'], float)

        return get_optics

    @wrap_test_cases
    def test_get_config(self, test_case):
        """Test get_config method."""
        get_config = self.device.get_config()

        assert isinstance(get_config, dict)
        assert helpers.test_model(models.config, get_config)

        return get_config

    @wrap_test_cases
    def test_get_config_filtered(self, test_case):
        """Test get_config method."""
        for config in ['running', 'startup', 'candidate']:
            get_config = self.device.get_config(retrieve=config)

            assert get_config['candidate'] == "" if config != "candidate" else True
            assert get_config['startup'] == "" if config != "startup" else True
            assert get_config['running'] == "" if config != "running" else True

        return get_config

    @wrap_test_cases
    def test_get_network_instances(self, test_case):
        """Test get_network_instances method."""
        get_network_instances = self.device.get_network_instances()

        assert isinstance(get_network_instances, dict)
        for network_instance_name, network_instance in get_network_instances.items():
            assert helpers.test_model(models.network_instance, network_instance)
            assert helpers.test_model(models.network_instance_state, network_instance['state'])
            assert helpers.test_model(models.network_instance_interfaces,
                                      network_instance['interfaces'])

        return get_network_instances

    @wrap_test_cases
    def test_get_firewall_policies(self, test_case):
        """Test get_firewall_policies method."""
        get_firewall_policies = self.device.get_firewall_policies()
        assert len(get_firewall_policies) > 0
        for policy_name, policy_details in get_firewall_policies.items():
            for policy_term in policy_details:
                assert helpers.test_model(models.firewall_policies, policy_term)
        return get_firewall_policies


text:
class Main {
  public static void main(String[] args) {
    foo();
  }

  public static void foo() {
    int a = myField1; // esi
    int b = myField2; // edi
    $noinline$bar(); // makes allocation of a and b to be callee-save registers
    int c = myField3; // ecx
    int e = myField4; // ebx
    int f = myField5; // edx
    long d = a == 42 ? myLongField1 : 42L; // Will call AllocateBlockedReg -> edx/ebx

    // At this point, the register allocator used to be in a bogus state, where the low
    // part of the interval was in the active set, but not the high part.

    long i = myLongField1; // Will call TrySplitNonPairOrUnalignedPairIntervalAt -> Failing DCHECK

    // Use esi and edi first to not have d allocated to them.
    myField2 = a;
    myField3 = b;

    // The following sequence of instructions are making the AllocateBlockedReg call
    // for allocating the d variable misbehave: allocation of the low interval would split
    // both low and high interval at the fixed use; therefore the allocation of the high interval
    // would not see the register use, and think the interval can just be spilled and not be
    // put in the active set, even though it is holding a register.
    myField1 = (int)d; // stack use
    myLongField3 = (long) myField2; // edx fixed use
    myLongField2 = d; // register use

    // Ensure the HInstruction mapping to i, c, e, and f have a live range.
    myLongField1 = i;
    myField4 = c;
    myField5 = e;
    myField6 = f;
  }

  public static long $noinline$bar() {
    if (doThrow) throw new Error();
    return 42;
  }

  public static boolean doThrow = false;

  public static int myField1 = 0;
  public static int myField2 = 0;
  public static int myField3 = 0;
  public static int myField4 = 0;
  public static int myField5 = 0;
  public static int myField6 = 0;
  public static long myLongField1 = 0L;
  public static long myLongField2 = 0L;
  public static long myLongField3 = 0L;
}

redpajama_set_name: RedPajamaGithub


text:
from google.cloud import apigee_registry_v1

def sample_get_api_spec_contents():
    # Create a client
    client = apigee_registry_v1.RegistryClient()

    # Initialize request argument(s)
    request = apigee_registry_v1.GetApiSpecContentsRequest(
        name="name_value",
    )

    # Make the request
    response = client.get_api_spec_contents(request=request)

    # Handle the response
    print(response)

# [END apigeeregistry_v1_generated_Registry_GetApiSpecContents_sync]


text:
package com.zt.lib.config;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import android.content.Context;

/**
 * 读写配置文件的方法接口。对配置文件进行读写操作之前请确保成功loadFile,完成操作用请确保使用commit提交更改。
 * @author zhaotong
 */
public interface StringListReaderWriter {

	/**
	 * 读取指定名称、指定类型的配置文件。目前支持SharedPreference和properties两种配置文件格式。
	 * @param name 配置文件名,不包括后缀名
	 * @param context 上下文
	 * @throws IOException 读取出错
	 */
	public void loadFile(String name, Context context) throws IOException;

	/**
	 * 获取指定名称的属性的INT值
	 * @param name key
	 * @return 无此名称则返回默认值0
	 */
	public List<Integer> getInt(String name);

	/**
	 * 获取指定名称的属性的boolean值
	 * @param name key
	 * @return 无此名称则返回默认值false
	 */
	public List<Boolean> getBoolean(String name);

	/**
	 * 获取指定名称的属性的String值
	 * @param name key
	 * @return 无此名称则返回默认值""
	 */
	public List<String> getString(String name);

	/**
	 * 获取配置文件中所有键值对
	 * @return Returns a map containing a list of pairs key/value representing the preferences.
	 */
	public Map<String, ?> getAll();

	/**
	 * 设置指定名称的属性为指定值。如果不存在此名称则创建,如果有同名则覆盖。
	 * @param name the key to add
	 * @param value the value to add
	 * @return {@link ReaderWriter}
	 */
	public StringListReaderWriter set(String name, Object value);

	/**
	 * 设置指定名称的属性为指定INT值。如果不存在此名称则创建,如果有同名则覆盖。
	 * @param name the key to add
	 * @param value the value to add
	 * @return {@link ReaderWriter}
	 */
	public StringListReaderWriter setInt(String name, int value);

	/**
	 * 设置指定名称的属性为指定boolean值。如果不存在此名称则创建,如果有同名则覆盖。
	 * @param name the key to add
	 * @param value the value to add
	 * @return {@link ReaderWriter}
	 */
	public StringListReaderWriter setBoolean(String name, boolean value);

	/**
	 * 设置指定名称的属性为指定String值。如果不存在此名称则创建,如果有同名则覆盖。
	 * @param name the key to add
	 * @param value the value to add
	 * @return {@link ReaderWriter}
	 */
	public StringListReaderWriter setString(String name, String value);

	/**
	 * 加入指定Map中所有键值对
	 * @param value the map to add
	 * @return {@link ReaderWriter}
	 */
	public StringListReaderWriter setAll(Map<String, ?> value);

	/**
	 * 提交更改,保存至文件。
	 * @throws IOException
	 */
	public void commit() throws IOException ;

}


text:
<script type="text/javascript">
  const electron = require('electron')
  const {getCurrentWebContents} = electron.remote
  electron.remote.getCurrentWebContents = () => {
    const webContents = getCurrentWebContents()
    webContents.isLoading = () => true
    return webContents
  }
</script>


text:
var drones = [];

(function worker() {
    $.get("http://localhost:8680/api/drone?t=" + Math.floor((Math.random() * 1000) + 1), function (data) {

        // Assume data is a JSON array
        for (var i = 0; i < data.length; i++)
        {
            var drone = data[i];
            var index = drones.indexOf(drone.Id);

            if (index === -1) // Drone doesn't exist
            {
                console.log('New drone id [' + drone.Id + ']');
                // Create element
                $('.DroneList').append('

Id: ' + drone.Id + ', Altitude: ' + drone.State.Altitude + ', Longitude: ' + drone.State.Longitude + ', Latitude: ' + drone.State.Latitude + '

');
                // Store index
                drones.push(drone.Id);
            }
            else // Drone exists
            {
                console.log('Drone id [' + drone.Id + '] already exists');
                console.log(drone.State);
                var existingState = drones[index].State;

                if (drone.State === null)
                {
                    console.log("ERROR: State is null!"); // Pass through
                }
                else if (drone.State === existingState)
                {
                    console.log("State not changed"); // Pass through
                }
                else
                {
                    console.log("Updating state"); // Update state
                    $('.drone' + drone.Id).html('Id: ' + drone.Id + '
' +
                                                ', Alt: ' + drone.State.Altitude + '
' +
                                                ', Lon: ' + drone.State.Longitude + '
' +
                                                ', Lat: ' + drone.State.Latitude + '
' +
                                                ', Hea: ' + drone.State.Heading + '
' +
                                                ', Vel: ' + drone.State.Speed);
                }
            }
        }

        // Recursively invoke worker function with delay
        setTimeout(worker, 2000);
    });
})();


text:
package nl.hvanderheijden.prutengine.core.data;

import java.awt.geom.AffineTransform;
import java.awt.image.AffineTransformOp;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.nio.ByteBuffer;
import javax.imageio.ImageIO;

import nl.hvanderheijden.prutengine.exceptions.ResourceNotFoundException;
import org.lwjgl.BufferUtils;
import org.lwjgl.opengl.GL11;
import static org.lwjgl.opengl.GL11.GL_NEAREST;
import static org.lwjgl.opengl.GL11.GL_RGBA;
import static org.lwjgl.opengl.GL11.GL_TEXTURE_2D;
import static org.lwjgl.opengl.GL11.GL_TEXTURE_MAG_FILTER;
import static org.lwjgl.opengl.GL11.GL_TEXTURE_MIN_FILTER;
import static org.lwjgl.opengl.GL11.GL_TEXTURE_WRAP_T;
import static org.lwjgl.opengl.GL11.GL_UNSIGNED_BYTE;
import static org.lwjgl.opengl.GL11.glBindTexture;
import static org.lwjgl.opengl.GL11.glGenTextures;
import static org.lwjgl.opengl.GL11.glTexImage2D;
import static org.lwjgl.opengl.GL11.glTexParameteri;
import static org.lwjgl.opengl.GL12.GL_CLAMP_TO_EDGE;

/**
 *
 * @author Heiko van der Heijden
 */
public class Texture extends Resource{
    private final int textureID;

    public Texture(String fileLocation, int position)  throws ResourceNotFoundException {
        super(fileLocation, position);

        //Mirror the texture firsrt
        BufferedImage image = null;
        try {
            image = ImageIO.read(Texture.class.getResourceAsStream(fileLocation));

        } catch (IOException e) {
            throw new ResourceNotFoundException(String.format("File %s has not been found", fileLocation));
        }
        AffineTransform tx = AffineTransform.getScaleInstance(-1, -1);
        tx.translate(-image.getWidth(null), -image.getHeight(null));
        AffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
        image = op.filter(image, null);

        int[] pixels = new int[image.getWidth() * image.getHeight()];
        image.getRGB(0, 0, image.getWidth(), image.getHeight(), pixels, 0, image.getWidth());
        int BYTES_PER_PIXEL = 4;
        ByteBuffer buffer = BufferUtils.createByteBuffer(image.getWidth() * image.getHeight() * BYTES_PER_PIXEL);

        for (int y = 0; y < image.getHeight(); y++) {
            for (int x = 0; x < image.getWidth(); x++) {
                int pixel = pixels[y * image.getWidth() + x];
                buffer.put((byte) ((pixel >> 16) & 0xFF));     // Red component
                buffer.put((byte) ((pixel >> 8) & 0xFF));      // Green component
                buffer.put((byte) (pixel & 0xFF));               // Blue component
                buffer.put((byte) ((pixel >> 24) & 0xFF));    // Alpha component. Only for RGBA
            }
        }

        buffer.flip();

        this.textureID = glGenTextures();
        glBindTexture(GL_TEXTURE_2D, this.textureID);

        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
        glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.getWidth(), image.getHeight(), 0, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
    }

    public int getTexture(){
        return this.textureID;
    }

    @Override
    public void destroy() {
        GL11.glDeleteTextures(this.textureID);
    }
}


text:
redirect_from: /docs/1.0.0/interfaces/common.obj.html
---
<!doctype html>

	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>Obj | @uirouter/angularjs</title>
	<meta name="description" content="">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="../assets/css/main.css">
	<link rel="stylesheet" href="../assets/css/uirouter.css">

						Search
						<input id="tsd-search-field" type="text" />

Preparing search index...

The search index is not available

					@uirouter/angularjs

						Options

							<input type="checkbox" id="tsd-filter-externals" checked />
							Internal UI-Router API

					Menu

					@uirouter/angularjs

					common

					Obj

Interface Obj

Hierarchy

						Object

								Obj

Indexable

[key: string]: any

Index

Properties

Object

constructor

Methods

has<wbr>Own<wbr>Property

is<wbr>Prototype<wbr>Of

property<wbr>IsEnumerable

to<wbr>Locale<wbr>String

to<wbr>String

value<wbr>Of

Properties

Object: ObjectConstructor

 Provides functionality common to all JavaScript objects.

Provides functionality common to all JavaScript objects.

Defined in angularjs/node_modules/typedoc/node_modules/typescript/lib/lib.es6.d.ts:245

constructor: Function

 The initial value of Object.prototype.constructor is the standard built-in Object constructor.

The initial value of Object.prototype.constructor is the standard built-in Object constructor.

Inherited from Object.constructor

Defined in angularjs/node_modules/typedoc/node_modules/typescript/lib/lib.es6.d.ts:100

Methods

has<wbr>Own<wbr>Property(v: string): boolean

 Determines whether an object has a property with the specified name.

Determines whether an object has a property with the specified name.

Parameters

v string

									:

A property name.

Returns boolean

Inherited from Object.hasOwnProperty

Overwrites Object.hasOwnProperty

Defined in angularjs/node_modules/typedoc/node_modules/typescript/lib/lib.es6.d.ts:115

is<wbr>Prototype<wbr>Of(v: Object): boolean

 Determines whether an object exists in another object's prototype chain.

Determines whether an object exists in another object's prototype chain.

Parameters

v Object

									:

Another object whose prototype chain is to be checked.

Returns boolean

Inherited from Object.isPrototypeOf

Defined in angularjs/node_modules/typedoc/node_modules/typescript/lib/lib.es6.d.ts:121

property<wbr>IsEnumerable(v: string): boolean

 Determines whether a specified property is enumerable.

Determines whether a specified property is enumerable.

Parameters

v string

									:

A property name.

Returns boolean

Inherited from Object.propertyIsEnumerable

Overwrites Object.propertyIsEnumerable

Defined in angularjs/node_modules/typedoc/node_modules/typescript/lib/lib.es6.d.ts:127

to<wbr>Locale<wbr>String(): string

 Returns a date converted to a string using the current locale.

Returns a date converted to a string using the current locale.

Returns string

Inherited from Object.toLocaleString

Defined in angularjs/node_modules/typedoc/node_modules/typescript/lib/lib.es6.d.ts:106

to<wbr>String(): string

 Returns a string representation of an object.

Returns a string representation of an object.

Returns string

Inherited from Object.toString

Defined in angularjs/node_modules/typedoc/node_modules/typescript/lib/lib.es6.d.ts:103

value<wbr>Of(): Object

 Returns the primitive value of the specified object.

Returns the primitive value of the specified object.

Returns Object

Inherited from Object.valueOf

Defined in angularjs/node_modules/typedoc/node_modules/typescript/lib/lib.es6.d.ts:109

						@uirouter/angularjs

						Public API

						core

						directives

						injectables

						ng1

						ng1_<wbr>state_<wbr>events

						params

						resolve

						state

						trace

						transition

						url

						view

						Internal UI-<wbr><wbr>Router API

						common

						common_<wbr>hof

						common_<wbr>predicates

						common_<wbr>strings

						hooks

						path

						vanilla

						Obj

								Object

								constructor

								has<wbr>Own<wbr>Property

								is<wbr>Prototype<wbr>Of

								property<wbr>IsEnumerable

								to<wbr>Locale<wbr>String

								to<wbr>String

								value<wbr>Of

Legend

Module

Object literal

Variable

Function

Function with type parameter

Index signature

Type alias

Enumeration

Enumeration member

Property

Method

Interface

Interface with type parameter

Constructor

Property

Method

Index signature

Class

Class with type parameter

Constructor

Property

Method

Accessor

Index signature

Inherited constructor

Inherited property

Inherited method

Inherited accessor

Protected property

Protected method

Protected accessor

Private property

Private method

Private accessor

Static property

Static method

Generated using TypeDoc


text:
package com.example.tests;

import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

import org.testng.annotations.Test;

import com.example.utils.SortedListOf;

public class GroupCreationTests extends TestBase {

	@Test(dataProvider = "randomValidGroupGenerator")
	public void testGroupCreationWithValidData(GroupData group)
			throws Exception {
		// save old state
		SortedListOf<GroupData> oldList = app.getGroupHelper().getGroups();

		// actions
		app.getGroupHelper().createGroup(group);

		// save new state
		SortedListOf<GroupData> newList = app.getGroupHelper().getGroups();

		// compare states
		assertThat(newList, equalTo(oldList.withAdded(group)));

	}

}


text:
package org.apache.derbyTesting.functionTests.tests.jdbcapi;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import junit.framework.Test;
import org.apache.derbyTesting.junit.BaseJDBCTestCase;
import org.apache.derbyTesting.junit.BaseTestSuite;
import org.apache.derbyTesting.junit.TestConfiguration;

public class Derby5158Test extends BaseJDBCTestCase
{

    public Derby5158Test(String name)
    {
        super(name);
    }

    protected static Test makeSuite(String name)
    {
        BaseTestSuite suite = new BaseTestSuite(name);

        Test cst = TestConfiguration.defaultSuite(Derby5158Test.class);

        suite.addTest(cst);

        return suite;
    }

    public static Test suite()
    {
        String testName = "Derby5158Repro";

        return makeSuite(testName);
    }

    protected void setUp()
            throws java.lang.Exception {
        super.setUp();
        setAutoCommit(false);
    }

    /**
     * DERBY-5158
     */
    public void testCommitRollbackAfterShutdown() throws SQLException {

        Statement s = createStatement();
        ResultSet rs = s.executeQuery("select 1 from sys.systables");
        rs.close();
        s.close(); // just so we have a transaction, otherwise the commit is
                   // short-circuited in the client.

        TestConfiguration.getCurrent().shutdownDatabase();

        try {
            commit();
        } catch (SQLException e) {
            if (usingEmbedded()) {
                assertSQLState("08003", e);
            } else {
                // Before DERBY-5158, we saw "58009" instead with c/s.
                assertSQLState("08006", e);
            }
        }

        // bring db back up and start a transaction
        s = createStatement();
        rs = s.executeQuery("select 1 from sys.systables");
        rs.close();
        s.close();

        TestConfiguration.getCurrent().shutdownDatabase();

        try {
            rollback();
        } catch (SQLException e) {
            if (usingEmbedded()) {
                assertSQLState("08003", e);
            } else {
                // Before DERBY-5158, we saw "58009" instead with c/s.
                assertSQLState("08006", e);
            }
        }
    }
}


text:
Template.rss.helpers({
  rss: function () {
    return Rss.find({},{sort: {pubDate: -1}, limit: 5});
  }
});

Meteor.subscribe('rss');

UI.registerHelper("fromNowRSS", function(datetime) {
  return new moment(datetime).fromNow();
});


text:
package edu.iu.informatics.omics.io.impl;

import java.io.IOException;
import java.util.regex.Matcher;

import junit.framework.TestCase;
import edu.iu.informatics.omics.Glycan;

public class GlycanThxFormatTest extends TestCase {
	private GlycanThxFormat gtf = new GlycanThxFormat();

	/*
	 * Test method for
	 * 'edu.iu.informatics.omics.io.impl.GlycanColFormatReader.getNodePattern()'
	 */
	public void testGetNodePattern() {
		Matcher matcher = GlycanThxFormat.getNodePattern().matcher(
				"Glc(4Man(6Glc,6Glc(4Man)))");
		assertTrue(matcher.find());
		assertEquals("", matcher.group(1));
		assertEquals("Glc", matcher.group(2));

		Matcher matcher2 = GlycanThxFormat.getNodePattern().matcher(
				"4Man(6Glc,6Glc(4Man))");
		assertTrue(matcher2.find());
		assertEquals("4", matcher2.group(1));
		assertEquals("Man", matcher2.group(2));
	}

	/*
	 * Test method for
	 * 'edu.iu.informatics.omics.io.impl.GlycanColFormatReader.parse(String)'
	 */
	public void testParse() {
		String expectSingleChain = "Glc(6Glc(6Glc(6Glc(6Glc))))";
		Glycan singleChainGlycan = gtf.parse(expectSingleChain);
		assertEquals(expectSingleChain, gtf.glycanToString(singleChainGlycan));

		String expectDoubleChain = "ManNAc(6Glc(3Man(4ManNAc,6Glc(3Gal,4Man))))";
		Glycan doubleChainGlycan = gtf.parse(expectDoubleChain);
		assertEquals(expectDoubleChain, gtf.glycanToString(doubleChainGlycan));

		try {
			gtf.parse("ManNAc(3Man(3ManNAc,4Man)");
			fail("Should throw IllegalArgumentException");
		} catch (IllegalArgumentException ex) {
		}
	}

	/*
	 * Test method for
	 * 'edu.iu.informatics.omics.io.impl.GlycanColFormatReader.read(String)'
	 */
	public void testRead() throws IOException {
		Glycan branchGlycan = gtf.read("data/branch_thx.inp");
		assertEquals("ManNAc(6Glc(3Man(6Glc(3Gal,4Man)),4ManNAc))", gtf
				.glycanToString(branchGlycan));
		assertFalse(branchGlycan.isLinear());

		Glycan singleChainGlycan = gtf.read("data/Dextran_glc06_thx.inp");
		assertEquals("Glc(6Glc(6Glc(6Glc(6Glc(6Glc)))))", gtf
				.glycanToString(singleChainGlycan));
		assertTrue(singleChainGlycan.isLinear());
	}

	public void testGlycanToString() {
		String expectDoubleChain = "ManNAc(6Glc(3Man(4ManNAc,6Glc(3Gal,4Man))))";
		Glycan doubleChainGlycan = gtf.parse(expectDoubleChain);
		assertEquals(expectDoubleChain, gtf.glycanToString(doubleChainGlycan));
	}

}


text:
package com.pushtechnology.adapters.rest.model.v14;

import static com.pushtechnology.diffusion.client.session.SessionAttributes.DEFAULT_CONNECTION_TIMEOUT;
import static com.pushtechnology.diffusion.client.session.SessionAttributes.DEFAULT_INPUT_BUFFER_SIZE;
import static com.pushtechnology.diffusion.client.session.SessionAttributes.DEFAULT_OUTPUT_BUFFER_SIZE;
import static com.pushtechnology.diffusion.client.session.SessionAttributes.DEFAULT_RECONNECTION_TIMEOUT;
import static com.pushtechnology.diffusion.client.session.SessionAttributes.DEFAULT_RECOVERY_BUFFER_SIZE;
import static com.pushtechnology.diffusion.client.session.SessionAttributes.MAXIMUM_MESSAGE_SIZE_MIN;

import com.pushtechnology.diffusion.client.session.SessionAttributes;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Builder.Default;
import lombok.NonNull;
import lombok.ToString;
import lombok.Value;

/**
 * Diffusion configuration. Version 14.
 * <p>
 * Description of a Diffusion server to publish to.
 *
 * @author Push Technology Limited
 */
@Value
@Builder
@AllArgsConstructor
@ToString(of = {"host", "port", "secure", "principal", "connectionTimeout", "reconnectionTimeout",
    "maximumMessageSize", "inputBufferSize", "outputBufferSize", "recoveryBufferSize"})
public class DiffusionConfig {
    /**
     * The host of the Diffusion server. Defaults to the localhost.
     */
    @NonNull
    @Default
    String host = "localhost";
    /**
     * The port the Diffusion server listens on. Defaults to 8080.
     */
    @Default
    int port = 8080;
    /**
     * If a secure connection should be used. Defaults to false.
     */
    @Default
    boolean secure = false;
    /**
     * The principal. Can be {@code null}.
     */
    String principal;
    /**
     * The password. Can be {@code null}.
     */
    String password;
    /**
     * The Diffusion session connection timeout.
     * Defaults to {@link SessionAttributes#DEFAULT_CONNECTION_TIMEOUT}.
     */
    @Default
    int connectionTimeout = DEFAULT_CONNECTION_TIMEOUT;
    /**
     * The Diffusion session reconnection timeout.
     * Defaults to {@link SessionAttributes#DEFAULT_RECONNECTION_TIMEOUT}.
     */
    @Default
    int reconnectionTimeout = DEFAULT_RECONNECTION_TIMEOUT;
    /**
     * The Diffusion session maximum message size.
     * Defaults to {@link SessionAttributes#MAXIMUM_MESSAGE_SIZE_MIN}.
     */
    @Default
    int maximumMessageSize = MAXIMUM_MESSAGE_SIZE_MIN;
    /**
     * The Diffusion session input buffer size.
     * Defaults to {@link SessionAttributes#DEFAULT_INPUT_BUFFER_SIZE}.
     */
    @Default
    int inputBufferSize = DEFAULT_INPUT_BUFFER_SIZE;
    /**
     * The Diffusion session output buffer size.
     * Defaults to {@link SessionAttributes#DEFAULT_OUTPUT_BUFFER_SIZE}.
     */
    @Default
    int outputBufferSize = DEFAULT_OUTPUT_BUFFER_SIZE;
    /**
     * The Diffusion session recovery buffer size.
     * Defaults to {@link SessionAttributes#DEFAULT_RECOVERY_BUFFER_SIZE}.
     */
    @Default
    int recoveryBufferSize = DEFAULT_RECOVERY_BUFFER_SIZE;
}


text:
@implementation PfpopRoot
static PBExtensionRegistry* extensionRegistry = nil;
+ (PBExtensionRegistry*) extensionRegistry {
  return extensionRegistry;
}

+ (void) initialize {
  if (self == [PfpopRoot class]) {
    PBMutableExtensionRegistry* registry = [PBMutableExtensionRegistry registry];
    [self registerAllExtensions:registry];
    extensionRegistry = [registry retain];
  }
}
+ (void) registerAllExtensions:(PBMutableExtensionRegistry*) registry {
}
@end

@interface PFPBPopPoint ()
@property Float32 x;
@property Float32 y;
@property Float64 createTime;
@property Float32 pressure;
@end

@implementation PFPBPopPoint

- (BOOL) hasX {
  return !!hasX_;
}
- (void) setHasX:(BOOL) value {
  hasX_ = !!value;
}
@synthesize x;
- (BOOL) hasY {
  return !!hasY_;
}
- (void) setHasY:(BOOL) value {
  hasY_ = !!value;
}
@synthesize y;
- (BOOL) hasCreateTime {
  return !!hasCreateTime_;
}
- (void) setHasCreateTime:(BOOL) value {
  hasCreateTime_ = !!value;
}
@synthesize createTime;
- (BOOL) hasPressure {
  return !!hasPressure_;
}
- (void) setHasPressure:(BOOL) value {
  hasPressure_ = !!value;
}
@synthesize pressure;
- (void) dealloc {
  [super dealloc];
}
- (id) init {
  if ((self = [super init])) {
    self.x = 0;
    self.y = 0;
    self.createTime = 0;
    self.pressure = 0;
  }
  return self;
}
static PFPBPopPoint* defaultPFPBPopPointInstance = nil;
+ (void) initialize {
  if (self == [PFPBPopPoint class]) {
    defaultPFPBPopPointInstance = [[PFPBPopPoint alloc] init];
  }
}
+ (PFPBPopPoint*) defaultInstance {
  return defaultPFPBPopPointInstance;
}
- (PFPBPopPoint*) defaultInstance {
  return defaultPFPBPopPointInstance;
}
- (BOOL) isInitialized {
  if (!self.hasX) {
    return NO;
  }
  if (!self.hasY) {
    return NO;
  }
  return YES;
}
- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output {
  if (self.hasX) {
    [output writeFloat:1 value:self.x];
  }
  if (self.hasY) {
    [output writeFloat:2 value:self.y];
  }
  if (self.hasCreateTime) {
    [output writeDouble:3 value:self.createTime];
  }
  if (self.hasPressure) {
    [output writeFloat:4 value:self.pressure];
  }
  [self.unknownFields writeToCodedOutputStream:output];
}
- (int32_t) serializedSize {
  int32_t size = memoizedSerializedSize;
  if (size != -1) {
    return size;
  }

  size = 0;
  if (self.hasX) {
    size += computeFloatSize(1, self.x);
  }
  if (self.hasY) {
    size += computeFloatSize(2, self.y);
  }
  if (self.hasCreateTime) {
    size += computeDoubleSize(3, self.createTime);
  }
  if (self.hasPressure) {
    size += computeFloatSize(4, self.pressure);
  }
  size += self.unknownFields.serializedSize;
  memoizedSerializedSize = size;
  return size;
}
+ (PFPBPopPoint*) parseFromData:(NSData*) data {
  return (PFPBPopPoint*)[[[PFPBPopPoint builder] mergeFromData:data] build];
}
+ (PFPBPopPoint*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry {
  return (PFPBPopPoint*)[[[PFPBPopPoint builder] mergeFromData:data extensionRegistry:extensionRegistry] build];
}
+ (PFPBPopPoint*) parseFromInputStream:(NSInputStream*) input {
  return (PFPBPopPoint*)[[[PFPBPopPoint builder] mergeFromInputStream:input] build];
}
+ (PFPBPopPoint*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry {
  return (PFPBPopPoint*)[[[PFPBPopPoint builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build];
}
+ (PFPBPopPoint*) parseFromCodedInputStream:(PBCodedInputStream*) input {
  return (PFPBPopPoint*)[[[PFPBPopPoint builder] mergeFromCodedInputStream:input] build];
}
+ (PFPBPopPoint*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry {
  return (PFPBPopPoint*)[[[PFPBPopPoint builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build];
}
+ (PFPBPopPoint_Builder*) builder {
  return [[[PFPBPopPoint_Builder alloc] init] autorelease];
}
+ (PFPBPopPoint_Builder*) builderWithPrototype:(PFPBPopPoint*) prototype {
  return [[PFPBPopPoint builder] mergeFrom:prototype];
}
- (PFPBPopPoint_Builder*) builder {
  return [PFPBPopPoint builder];
}
@end

@interface PFPBPopPoint_Builder()
@property (retain) PFPBPopPoint* result;
@end

@implementation PFPBPopPoint_Builder
@synthesize result;
- (void) dealloc {
  self.result = nil;
  [super dealloc];
}
- (id) init {
  if ((self = [super init])) {
    self.result = [[[PFPBPopPoint alloc] init] autorelease];
  }
  return self;
}
- (PBGeneratedMessage*) internalGetResult {
  return result;
}
- (PFPBPopPoint_Builder*) clear {
  self.result = [[[PFPBPopPoint alloc] init] autorelease];
  return self;
}
- (PFPBPopPoint_Builder*) clone {
  return [PFPBPopPoint builderWithPrototype:result];
}
- (PFPBPopPoint*) defaultInstance {
  return [PFPBPopPoint defaultInstance];
}
- (PFPBPopPoint*) build {
  [self checkInitialized];
  return [self buildPartial];
}
- (PFPBPopPoint*) buildPartial {
  PFPBPopPoint* returnMe = [[result retain] autorelease];
  self.result = nil;
  return returnMe;
}
- (PFPBPopPoint_Builder*) mergeFrom:(PFPBPopPoint*) other {
  if (other == [PFPBPopPoint defaultInstance]) {
    return self;
  }
  if (other.hasX) {
    [self setX:other.x];
  }
  if (other.hasY) {
    [self setY:other.y];
  }
  if (other.hasCreateTime) {
    [self setCreateTime:other.createTime];
  }
  if (other.hasPressure) {
    [self setPressure:other.pressure];
  }
  [self mergeUnknownFields:other.unknownFields];
  return self;
}
- (PFPBPopPoint_Builder*) mergeFromCodedInputStream:(PBCodedInputStream*) input {
  return [self mergeFromCodedInputStream:input extensionRegistry:[PBExtensionRegistry emptyRegistry]];
}
- (PFPBPopPoint_Builder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry {
  PBUnknownFieldSet_Builder* unknownFields = [PBUnknownFieldSet builderWithUnknownFields:self.unknownFields];
  while (YES) {
    int32_t tag = [input readTag];
    switch (tag) {
      case 0:
        [self setUnknownFields:[unknownFields build]];
        return self;
      default: {
        if (![self parseUnknownField:input unknownFields:unknownFields extensionRegistry:extensionRegistry tag:tag]) {
          [self setUnknownFields:[unknownFields build]];
          return self;
        }
        break;
      }
      case 13: {
        [self setX:[input readFloat]];
        break;
      }
      case 21: {
        [self setY:[input readFloat]];
        break;
      }
      case 25: {
        [self setCreateTime:[input readDouble]];
        break;
      }
      case 37: {
        [self setPressure:[input readFloat]];
        break;
      }
    }
  }
}
- (BOOL) hasX {
  return result.hasX;
}
- (Float32) x {
  return result.x;
}
- (PFPBPopPoint_Builder*) setX:(Float32) value {
  result.hasX = YES;
  result.x = value;
  return self;
}
- (PFPBPopPoint_Builder*) clearX {
  result.hasX = NO;
  result.x = 0;
  return self;
}
- (BOOL) hasY {
  return result.hasY;
}
- (Float32) y {
  return result.y;
}
- (PFPBPopPoint_Builder*) setY:(Float32) value {
  result.hasY = YES;
  result.y = value;
  return self;
}
- (PFPBPopPoint_Builder*) clearY {
  result.hasY = NO;
  result.y = 0;
  return self;
}
- (BOOL) hasCreateTime {
  return result.hasCreateTime;
}
- (Float64) createTime {
  return result.createTime;
}
- (PFPBPopPoint_Builder*) setCreateTime:(Float64) value {
  result.hasCreateTime = YES;
  result.createTime = value;
  return self;
}
- (PFPBPopPoint_Builder*) clearCreateTime {
  result.hasCreateTime = NO;
  result.createTime = 0;
  return self;
}
- (BOOL) hasPressure {
  return result.hasPressure;
}
- (Float32) pressure {
  return result.pressure;
}
- (PFPBPopPoint_Builder*) setPressure:(Float32) value {
  result.hasPressure = YES;
  result.pressure = value;
  return self;
}
- (PFPBPopPoint_Builder*) clearPressure {
  result.hasPressure = NO;
  result.pressure = 0;
  return self;
}
@end

@interface PFPBPopStroke ()
@property (retain) PFPBPopPoint* offset;
@property (retain) NSMutableArray* mutablePointsList;
@property int32_t type;
@end

@implementation PFPBPopStroke

- (BOOL) hasOffset {
  return !!hasOffset_;
}
- (void) setHasOffset:(BOOL) value {
  hasOffset_ = !!value;
}
@synthesize offset;
@synthesize mutablePointsList;
- (BOOL) hasType {
  return !!hasType_;
}
- (void) setHasType:(BOOL) value {
  hasType_ = !!value;
}
@synthesize type;
- (void) dealloc {
  self.offset = nil;
  self.mutablePointsList = nil;
  [super dealloc];
}
- (id) init {
  if ((self = [super init])) {
    self.offset = [PFPBPopPoint defaultInstance];
    self.type = 0;
  }
  return self;
}
static PFPBPopStroke* defaultPFPBPopStrokeInstance = nil;
+ (void) initialize {
  if (self == [PFPBPopStroke class]) {
    defaultPFPBPopStrokeInstance = [[PFPBPopStroke alloc] init];
  }
}
+ (PFPBPopStroke*) defaultInstance {
  return defaultPFPBPopStrokeInstance;
}
- (PFPBPopStroke*) defaultInstance {
  return defaultPFPBPopStrokeInstance;
}
- (NSArray*) pointsList {
  return mutablePointsList;
}
- (PFPBPopPoint*) pointsAtIndex:(int32_t) index {
  id value = [mutablePointsList objectAtIndex:index];
  return value;
}
- (BOOL) isInitialized {
  if (!self.hasOffset) {
    return NO;
  }
  if (!self.hasType) {
    return NO;
  }
  if (!self.offset.isInitialized) {
    return NO;
  }
  for (PFPBPopPoint* element in self.pointsList) {
    if (!element.isInitialized) {
      return NO;
    }
  }
  return YES;
}
- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output {
  if (self.hasOffset) {
    [output writeMessage:1 value:self.offset];
  }
  for (PFPBPopPoint* element in self.pointsList) {
    [output writeMessage:2 value:element];
  }
  if (self.hasType) {
    [output writeInt32:3 value:self.type];
  }
  [self.unknownFields writeToCodedOutputStream:output];
}
- (int32_t) serializedSize {
  int32_t size = memoizedSerializedSize;
  if (size != -1) {
    return size;
  }

  size = 0;
  if (self.hasOffset) {
    size += computeMessageSize(1, self.offset);
  }
  for (PFPBPopPoint* element in self.pointsList) {
    size += computeMessageSize(2, element);
  }
  if (self.hasType) {
    size += computeInt32Size(3, self.type);
  }
  size += self.unknownFields.serializedSize;
  memoizedSerializedSize = size;
  return size;
}
+ (PFPBPopStroke*) parseFromData:(NSData*) data {
  return (PFPBPopStroke*)[[[PFPBPopStroke builder] mergeFromData:data] build];
}
+ (PFPBPopStroke*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry {
  return (PFPBPopStroke*)[[[PFPBPopStroke builder] mergeFromData:data extensionRegistry:extensionRegistry] build];
}
+ (PFPBPopStroke*) parseFromInputStream:(NSInputStream*) input {
  return (PFPBPopStroke*)[[[PFPBPopStroke builder] mergeFromInputStream:input] build];
}
+ (PFPBPopStroke*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry {
  return (PFPBPopStroke*)[[[PFPBPopStroke builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build];
}
+ (PFPBPopStroke*) parseFromCodedInputStream:(PBCodedInputStream*) input {
  return (PFPBPopStroke*)[[[PFPBPopStroke builder] mergeFromCodedInputStream:input] build];
}
+ (PFPBPopStroke*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry {
  return (PFPBPopStroke*)[[[PFPBPopStroke builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build];
}
+ (PFPBPopStroke_Builder*) builder {
  return [[[PFPBPopStroke_Builder alloc] init] autorelease];
}
+ (PFPBPopStroke_Builder*) builderWithPrototype:(PFPBPopStroke*) prototype {
  return [[PFPBPopStroke builder] mergeFrom:prototype];
}
- (PFPBPopStroke_Builder*) builder {
  return [PFPBPopStroke builder];
}
@end

@interface PFPBPopStroke_Builder()
@property (retain) PFPBPopStroke* result;
@end

@implementation PFPBPopStroke_Builder
@synthesize result;
- (void) dealloc {
  self.result = nil;
  [super dealloc];
}
- (id) init {
  if ((self = [super init])) {
    self.result = [[[PFPBPopStroke alloc] init] autorelease];
  }
  return self;
}
- (PBGeneratedMessage*) internalGetResult {
  return result;
}
- (PFPBPopStroke_Builder*) clear {
  self.result = [[[PFPBPopStroke alloc] init] autorelease];
  return self;
}
- (PFPBPopStroke_Builder*) clone {
  return [PFPBPopStroke builderWithPrototype:result];
}
- (PFPBPopStroke*) defaultInstance {
  return [PFPBPopStroke defaultInstance];
}
- (PFPBPopStroke*) build {
  [self checkInitialized];
  return [self buildPartial];
}
- (PFPBPopStroke*) buildPartial {
  PFPBPopStroke* returnMe = [[result retain] autorelease];
  self.result = nil;
  return returnMe;
}
- (PFPBPopStroke_Builder*) mergeFrom:(PFPBPopStroke*) other {
  if (other == [PFPBPopStroke defaultInstance]) {
    return self;
  }
  if (other.hasOffset) {
    [self mergeOffset:other.offset];
  }
  if (other.mutablePointsList.count > 0) {
    if (result.mutablePointsList == nil) {
      result.mutablePointsList = [NSMutableArray array];
    }
    [result.mutablePointsList addObjectsFromArray:other.mutablePointsList];
  }
  if (other.hasType) {
    [self setType:other.type];
  }
  [self mergeUnknownFields:other.unknownFields];
  return self;
}
- (PFPBPopStroke_Builder*) mergeFromCodedInputStream:(PBCodedInputStream*) input {
  return [self mergeFromCodedInputStream:input extensionRegistry:[PBExtensionRegistry emptyRegistry]];
}
- (PFPBPopStroke_Builder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry {
  PBUnknownFieldSet_Builder* unknownFields = [PBUnknownFieldSet builderWithUnknownFields:self.unknownFields];
  while (YES) {
    int32_t tag = [input readTag];
    switch (tag) {
      case 0:
        [self setUnknownFields:[unknownFields build]];
        return self;
      default: {
        if (![self parseUnknownField:input unknownFields:unknownFields extensionRegistry:extensionRegistry tag:tag]) {
          [self setUnknownFields:[unknownFields build]];
          return self;
        }
        break;
      }
      case 10: {
        PFPBPopPoint_Builder* subBuilder = [PFPBPopPoint builder];
        if (self.hasOffset) {
          [subBuilder mergeFrom:self.offset];
        }
        [input readMessage:subBuilder extensionRegistry:extensionRegistry];
        [self setOffset:[subBuilder buildPartial]];
        break;
      }
      case 18: {
        PFPBPopPoint_Builder* subBuilder = [PFPBPopPoint builder];
        [input readMessage:subBuilder extensionRegistry:extensionRegistry];
        [self addPoints:[subBuilder buildPartial]];
        break;
      }
      case 24: {
        [self setType:[input readInt32]];
        break;
      }
    }
  }
}
- (BOOL) hasOffset {
  return result.hasOffset;
}
- (PFPBPopPoint*) offset {
  return result.offset;
}
- (PFPBPopStroke_Builder*) setOffset:(PFPBPopPoint*) value {
  result.hasOffset = YES;
  result.offset = value;
  return self;
}
- (PFPBPopStroke_Builder*) setOffsetBuilder:(PFPBPopPoint_Builder*) builderForValue {
  return [self setOffset:[builderForValue build]];
}
- (PFPBPopStroke_Builder*) mergeOffset:(PFPBPopPoint*) value {
  if (result.hasOffset &&
      result.offset != [PFPBPopPoint defaultInstance]) {
    result.offset =
      [[[PFPBPopPoint builderWithPrototype:result.offset] mergeFrom:value] buildPartial];
  } else {
    result.offset = value;
  }
  result.hasOffset = YES;
  return self;
}
- (PFPBPopStroke_Builder*) clearOffset {
  result.hasOffset = NO;
  result.offset = [PFPBPopPoint defaultInstance];
  return self;
}
- (NSArray*) pointsList {
  if (result.mutablePointsList == nil) { return [NSArray array]; }
  return result.mutablePointsList;
}
- (PFPBPopPoint*) pointsAtIndex:(int32_t) index {
  return [result pointsAtIndex:index];
}
- (PFPBPopStroke_Builder*) replacePointsAtIndex:(int32_t) index with:(PFPBPopPoint*) value {
  [result.mutablePointsList replaceObjectAtIndex:index withObject:value];
  return self;
}
- (PFPBPopStroke_Builder*) addAllPoints:(NSArray*) values {
  if (result.mutablePointsList == nil) {
    result.mutablePointsList = [NSMutableArray array];
  }
  [result.mutablePointsList addObjectsFromArray:values];
  return self;
}
- (PFPBPopStroke_Builder*) clearPointsList {
  result.mutablePointsList = nil;
  return self;
}
- (PFPBPopStroke_Builder*) addPoints:(PFPBPopPoint*) value {
  if (result.mutablePointsList == nil) {
    result.mutablePointsList = [NSMutableArray array];
  }
  [result.mutablePointsList addObject:value];
  return self;
}
- (BOOL) hasType {
  return result.hasType;
}
- (int32_t) type {
  return result.type;
}
- (PFPBPopStroke_Builder*) setType:(int32_t) value {
  result.hasType = YES;
  result.type = value;
  return self;
}
- (PFPBPopStroke_Builder*) clearType {
  result.hasType = NO;
  result.type = 0;
  return self;
}
@end


text:
@(form: Form[String])(implicit request: AdminRequest)
@import loom.models._
@import loom.models.admin._
@layout.admin(Messages("m.account.create"), Model.M_Accounts) {
    <form action="@cadmin.routes.Admins.create()" method="post" class="bs-docs-example form-horizontal" id="inputForm">
        <fieldset>
            <legend>@Messages("m.account.create")</legend>
            @tags.errors(form)
            @tags.requestflash(request)

                @Messages("m.account.email")

                    <input type="text" name="email" id="email" placeholder="@Messages("m.account.email")" value="@form.data.get("email")">

                    <button type="submit" class="btn btn-primary">@Messages("common.create")</button>

                    <button type="button" class="btn" onclick="history.back()">@Messages("common.back")</button>

        </fieldset>
    </form>
}


text:
/*
 * This file is part of FFmpeg.
 *
 * FFmpeg is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * FFmpeg is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with FFmpeg; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

#ifndef AVUTIL_DYNARRAY_H
#define AVUTIL_DYNARRAY_H

#include "log.h"
#include "mem.h"

/**
 * Add an element of to a dynamic array.
 *
 * The array is reallocated when its number of elements reaches powers of 2.
 * Therefore, the amortized cost of adding an element is constant.
 *
 * In case of success, the pointer to the array is updated in order to
 * point to the new grown array, and the size is incremented.
 *
 * @param av_size_max  maximum size of the array, usually the MAX macro of
 *                     the type of the size
 * @param av_elt_size  size of the elements in the array, in bytes
 * @param av_array     pointer to the array, must be a lvalue
 * @param av_size      size of the array, must be an interger lvalue
 * @param av_success   statement to execute on success; at this point, the
 *                     size variable is not yet incremented
 * @param av_failure   statement to execute on failure; if this happens, the
 *                     array and size are not changed; the statement can end
 *                     with a return or a goto
 */
#define AV_DYNARRAY_ADD(av_size_max, av_elt_size, av_array, av_size, \
                        av_success, av_failure) \
    do { \
        size_t av_size_new = (av_size); \
        if (!((av_size) & ((av_size) - 1))) { \
            av_size_new = (av_size) ? (av_size) << 1 : 1; \
            if (av_size_new > (av_size_max) / (av_elt_size)) { \
                av_size_new = 0; \
            } else { \
                void *av_array_new = \
                    av_realloc((av_array), av_size_new * (av_elt_size)); \
                if (!av_array_new) \
                    av_size_new = 0; \
                else \
                    (av_array) = av_array_new; \
            } \
        } \
        if (av_size_new) { \
            { av_success } \
            (av_size)++; \
        } else { \
            av_failure \
        } \
    } while (0)

#endif /* AVUTIL_DYNARRAY_H */


text:
import type { AST } from '@glimmer/syntax';

export function isPath(node: AST.Node): node is AST.PathExpression {
  return node.type === 'PathExpression';
}

export function isSubExpression(node: AST.Node): node is AST.SubExpression {
  return node.type === 'SubExpression';
}

export function isStringLiteral(node: AST.Expression): node is AST.StringLiteral {
  return node.type === 'StringLiteral';
}

export function trackLocals() {
  let locals = new Map();

  let node = {
    enter(node: AST.Program | AST.Block | AST.ElementNode) {
      for (let param of node.blockParams) {
        let value = locals.get(param) || 0;
        locals.set(param, value + 1);
      }
    },

    exit(node: AST.Program | AST.Block | AST.ElementNode) {
      for (let param of node.blockParams) {
        let value = locals.get(param) - 1;

        if (value === 0) {
          locals.delete(param);
        } else {
          locals.set(param, value);
        }
      }
    },
  };

  return {
    hasLocal: (key: string) => locals.has(key),
    node,
  };
}


text:
FastLeafDecay
=============
A simple Minecraft mod that speeds up leaf decay after you cut down the wood in a tree. Generally it will only take about five seconds before all leaves are gone.

## Download
Get the mod from [CurseForge](http://minecraft.curseforge.com/mc-mods/230976-fastleafdecay).

## Discuss
Comments are welcome on CurseForge. Bug reports may also be entered here on GitHub.

## Modpacks
Feel free to add this mod to your pack. No permission required! A comment on CurseForge is allowed of course. ;)


text:
import { createStore, applyMiddleware, compose } from 'redux';
import createSagaMiddleware from 'redux-saga';
import { createNetworkMiddleware } from 'react-native-offline';
import invariant from 'redux-immutable-state-invariant';
import {
  persistStore,
  persistReducer,
  createTransform,
  createMigrate,
} from 'redux-persist';
import autoMergeLevel2 from 'redux-persist/lib/stateReconciler/autoMergeLevel2';
import getStoredStateMigrateV4 from 'redux-persist/lib/integration/getStoredStateMigrateV4';
import applyAppStateListener from 'redux-enhancer-react-native-appstate';
import FileSystemStorage from 'redux-persist-filesystem-storage';
import AsyncStorage from '@react-native-community/async-storage';
import rootReducer from '../reducers';
import rootSaga from '../sagas';
import getStoredStateMigrateToFileSystemStorage from './getStoredStateMigrateToFileSystemStorage';
import { SCREENS } from '../constants';

const myTransform = createTransform(
  (inboundState, key, fullState) => {
    switch (key) {
      case 'entities': {
        const {
          entities,
          browsingHistoryIllusts,
          browsingHistoryNovels,
          muteUsers,
        } = fullState;
        const selectedUsersEntities = {};
        const selectedIllustsEntities = browsingHistoryIllusts.items
          .filter((id) => entities.illusts[id])
          .reduce((prev, id) => {
            prev[id] = entities.illusts[id];
            const userId = entities.illusts[id].user;
            selectedUsersEntities[userId] = entities.users[userId];
            return prev;
          }, {});
        const selectedNovelsEntities = browsingHistoryNovels.items
          .filter((id) => entities.novels[id])
          .reduce((prev, id) => {
            prev[id] = entities.novels[id];
            const userId = entities.novels[id].user;
            selectedUsersEntities[userId] = entities.users[userId];
            return prev;
          }, {});
        const selectedUsersEntities2 = muteUsers.items
          .filter((m) => entities.users[m.id])
          .reduce((prev, m) => {
            prev[m.id] = entities.users[m.id];
            return prev;
          }, {});
        const finalSelectedUsersEntities = {
          ...selectedUsersEntities,
          ...selectedUsersEntities2,
        };
        return {
          ...inboundState,
          illusts: selectedIllustsEntities,
          novels: selectedNovelsEntities,
          users: finalSelectedUsersEntities,
        };
      }
      case 'browsingHistoryIllusts': {
        const { entities, browsingHistoryIllusts } = fullState;
        return {
          ...inboundState,
          items: browsingHistoryIllusts.items.filter(
            (id) =>
              entities.illusts[id] &&
              entities.illusts[id].user &&
              entities.users[entities.illusts[id].user],
          ),
        };
      }
      case 'browsingHistoryNovels': {
        const { entities, browsingHistoryNovels } = fullState;
        return {
          ...inboundState,
          items: browsingHistoryNovels.items.filter(
            (id) =>
              entities.novels[id] &&
              entities.novels[id].user &&
              entities.users[entities.novels[id].user],
          ),
        };
      }
      default:
        return inboundState;
    }
  },
  (outboundState, key, fullState) => {
    switch (key) {
      case 'browsingHistoryIllusts': {
        try {
          const entities = JSON.parse(fullState.entities);
          const browsingHistoryIllusts = outboundState;
          return {
            ...outboundState,
            items: browsingHistoryIllusts.items.filter(
              (id) =>
                entities.illusts[id]?.user &&
                entities.users[entities.illusts[id]?.user],
            ),
          };
        } catch (err) {
          return outboundState;
        }
      }
      case 'browsingHistoryNovels': {
        try {
          const entities = JSON.parse(fullState.entities);
          const browsingHistoryNovels = outboundState;
          return {
            ...outboundState,
            items: browsingHistoryNovels.items.filter(
              (id) =>
                entities.novels[id]?.user &&
                entities.users[entities.novels[id]?.user],
            ),
          };
        } catch (err) {
          return outboundState;
        }
      }
      default:
        return outboundState;
    }
  },
  {
    whitelist: [
      'entities',
      'browsingHistoryIllusts',
      'browsingHistoryNovels',
      'muteUsers',
      'initialScreenSettings',
      'readingSettings',
      'trendingSearchSettings',
    ],
  },
);

const clearV4PersistedContents = () =>
  AsyncStorage.getAllKeys((err, keys) => {
    if (!err && keys && keys.length) {
      const keyPrefix = 'persist:root';
      const v5PersistKeys = keys.filter((key) => key.indexOf(keyPrefix) === 0);
      if (v5PersistKeys.length) {
        AsyncStorage.multiRemove(v5PersistKeys, () => Promise.resolve());
      } else {
        const v4KeyPrefix = 'reduxPersist:';
        const v4PersistKeys = keys.filter(
          (key) => key.indexOf(v4KeyPrefix) === 0,
        );
        if (v4PersistKeys.length) {
          AsyncStorage.multiRemove(v4PersistKeys, () => Promise.resolve());
        }
      }
    }
    return Promise.resolve();
  });

export default function configureStore() {
  let enhancer;
  const sagaMiddleware = createSagaMiddleware();
  const networkMiddleware = createNetworkMiddleware();
  if (process.env.NODE_ENV !== 'production') {
    const composeEnhancers =
      // eslint-disable-next-line no-underscore-dangle
      window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
    enhancer = composeEnhancers(
      applyAppStateListener(),
      applyMiddleware(invariant(), networkMiddleware, sagaMiddleware),
      // devTools(),
    );
  } else {
    enhancer = compose(
      applyAppStateListener(),
      applyMiddleware(networkMiddleware, sagaMiddleware),
    );
  }

  const v4Config = {
    whitelist: [
      'searchHistory',
      'browsingHistoryIllusts',
      'browsingHistoryNovels',
      'highlightTags',
      'muteTags',
      'muteUsers',
      'saveImageSettings',
      'novelSettings',
      'entities',
      'auth',
      'i18n',
    ],
    storage: AsyncStorage,
    transforms: [myTransform],
  };

  const v5Config = {
    key: 'root',
    stateReconciler: autoMergeLevel2,
    whitelist: [
      'searchHistory',
      'browsingHistoryIllusts',
      'browsingHistoryNovels',
      'highlightTags',
      'muteTags',
      'muteUsers',
      'saveImageSettings',
      'initialScreenSettings',
      'novelSettings',
      'entities',
      'auth',
      'i18n',
      'theme',
      'readingSettings',
      'trendingSearchSettings',
    ],
    storage: AsyncStorage,
    transforms: [myTransform],
    getStoredState: getStoredStateMigrateV4(v4Config),
  };

  const migirationToAppV4 = {
    0: (state) => {
      return state;
    },
    1: (state) => {
      const { entities, muteUsers, initialScreenSettings } = state;
      // migrate from array of id to array of object
      const items = muteUsers.items
        .map((id) => {
          const user = entities.users[id];
          if (user) {
            return {
              id: user.id,
              name: user.name,
              profile_image_urls: user.profile_image_urls,
            };
          }
          return null;
        })
        .filter((item) => item);
      return {
        ...state,
        muteUsers: {
          items,
        },
        initialScreenSettings: {
          routeName:
            initialScreenSettings.routeName === SCREENS.Ranking
              ? SCREENS.RankingPreview
              : initialScreenSettings.routeName,
        },
      };
    },
  };

  const persistConfig = {
    key: 'root',
    timeout: 15000, // https://github.com/rt2zz/redux-persist/issues/717
    stateReconciler: autoMergeLevel2,
    version: 1,
    whitelist: [
      'searchHistory',
      'browsingHistoryIllusts',
      'browsingHistoryNovels',
      'highlightTags',
      'muteSettings',
      'muteTags',
      'muteUsers',
      'saveImageSettings',
      'initialScreenSettings',
      'novelSettings',
      'likeButtonSettings',
      'readingSettings',
      'trendingSearchSettings',
      'entities',
      'auth',
      'i18n',
      'theme',
    ],
    storage: FileSystemStorage,
    transforms: [myTransform],
    getStoredState: getStoredStateMigrateToFileSystemStorage(
      v5Config,
      v4Config,
    ),
    migrate: createMigrate(migirationToAppV4, {
      debug: process.env.NODE_ENV !== 'production',
    }),
    debug: process.env.NODE_ENV !== 'production',
  };
  const persistedReducer = persistReducer(persistConfig, rootReducer);
  const store = createStore(persistedReducer, undefined, enhancer);
  sagaMiddleware.run(rootSaga);

  const persistor = persistStore(store, undefined, clearV4PersistedContents);
  if (module.hot) {
    // eslint-disable-next-line global-require
    const nextRootReducer = require('../reducers');
    module.hot.accept(() => {
      store.replaceReducer(persistReducer(persistConfig, nextRootReducer));
    });
  }

  return { store, persistor };
}


text:
package workbench.gui.sql;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.StringReader;
import java.io.Writer;
import java.util.ArrayList;
import java.util.List;

import workbench.log.LogMgr;
import workbench.resource.Settings;

import workbench.gui.actions.ClearStatementHistoryAction;
import workbench.gui.actions.FirstStatementAction;
import workbench.gui.actions.LastStatementAction;
import workbench.gui.actions.NextStatementAction;
import workbench.gui.actions.PrevStatementAction;
import workbench.gui.actions.WbAction;

import workbench.util.EncodingUtil;
import workbench.util.StringUtil;

/**
 * Stores the SQL scripts entered in the {@link SqlPanel} and manages
 * a history of statements.
 *
 * @author  Thomas Kellerer
 */
public class SqlHistory
{
	private static final String LIST_DELIMITER = "----------- WbStatement -----------";

	final private List<SqlHistoryEntry> history;
	private int currentEntry;
	private int maxSize;
	private boolean changed;
	private EditorPanel editor;
	private NextStatementAction nextStmtAction;
	private PrevStatementAction prevStmtAction;
	private FirstStatementAction firstStmtAction;
	private LastStatementAction lastStmtAction;
	private ClearStatementHistoryAction clearAction;

	public SqlHistory(EditorPanel ed, int size)
	{
		this.maxSize = size;
		this.history = new ArrayList<>(size + 2);
		this.editor = ed;
		this.firstStmtAction = new FirstStatementAction(this);
		this.firstStmtAction.setEnabled(false);

		this.prevStmtAction = new PrevStatementAction(this);
		this.prevStmtAction.setEnabled(false);

		this.nextStmtAction = new NextStatementAction(this);
		this.nextStmtAction.setEnabled(false);

		this.lastStmtAction = new LastStatementAction(this);
		this.lastStmtAction.setEnabled(false);

		this.clearAction = new ClearStatementHistoryAction(this);
		this.clearAction.setEnabled(false);
	}

	public synchronized void setEnabled(boolean flag)
	{
		nextStmtAction.setEnabled(flag);
		prevStmtAction.setEnabled(flag);
		firstStmtAction.setEnabled(flag);
		lastStmtAction.setEnabled(flag);
	}

	public WbAction getShowFirstStatementAction() { return this.firstStmtAction; }
	public WbAction getShowLastStatementAction() { return this.lastStmtAction; }
	public WbAction getShowNextStatementAction() { return this.nextStmtAction; }
	public WbAction getShowPreviousStatementAction() { return this.prevStmtAction; }
	public WbAction getClearHistoryAction() { return this.clearAction; }

	public synchronized void addContent(EditorPanel edit)
	{
		boolean includeFiles = Settings.getInstance().getStoreFilesInHistory();
		if (!includeFiles && edit.hasFileLoaded()) return;

		int maxLength = Settings.getInstance().getIntProperty("workbench.sql.history.maxtextlength", 1024*1024*10);
		if (edit.getDocumentLength() > maxLength) return;

		String text = edit.getText();
		if (text == null || text.length() == 0) return;

		try
		{
			SqlHistoryEntry entry = null;
			if (edit.currentSelectionIsTemporary())
			{
				entry = new SqlHistoryEntry(text, edit.getCaretPosition(), 0, 0);
			}
			else
			{
				entry = new SqlHistoryEntry(text, edit.getCaretPosition(), edit.getSelectionStart(), edit.getSelectionEnd());
			}

			SqlHistoryEntry top = this.getTopEntry();
			if (top != null && top.equals(entry)) return;
			this.addEntry(entry);
		}
		catch (Exception e)
		{
			LogMgr.logError("SqlHistory.addContent(editor)", "Could not add entry", e);
		}
		checkActions();
	}

	public void addEntry(SqlHistoryEntry entry)
	{
		this.history.add(entry);
		if (this.history.size() > this.maxSize)
		{
			this.history.remove(0);
		}
		this.currentEntry = this.history.size() - 1;
		this.changed = true;
	}

	public boolean hasNext()
	{
		return (this.currentEntry < (this.history.size() - 1));
	}

	public boolean hasPrevious()
	{
		return (this.currentEntry > 0);
	}

	public void clear()
	{
		this.currentEntry = 0;
		this.history.clear();
		this.changed = false;
		this.checkActions();
	}

	public void dispose()
	{
		clear();
		WbAction.dispose(nextStmtAction, prevStmtAction, firstStmtAction, lastStmtAction, clearAction);
	}

	public void showLastStatement()
	{
		if (this.history.isEmpty()) return;
		if (!editor.isEditable()) return;
		this.currentEntry = this.history.size() - 1;
		SqlHistoryEntry entry = this.history.get(this.currentEntry);
		entry.applyTo(editor);
		checkActions();
	}

	public void showFirstStatement()
	{
		if (this.history.isEmpty()) return;
		if (!editor.isEditable()) return;
		this.currentEntry = 0;
		SqlHistoryEntry entry = this.history.get(this.currentEntry);
		entry.applyTo(editor);
		checkActions();
	}

	public void showCurrent()
  {
		if (this.currentEntry >= this.history.size()) return;
		if (!editor.isEditable()) return;
		SqlHistoryEntry entry = this.history.get(this.currentEntry);
		entry.applyTo(editor, true);
		checkActions();
	}

	public void showPreviousStatement()
	{
		if (!this.hasPrevious()) return;
		if (!editor.isEditable()) return;
		SqlHistoryEntry entry = this.getPreviousEntry();
		entry.applyTo(editor);
		checkActions();
	}

	public void showNextStatement()
	{
		if (!this.hasNext()) return;
		SqlHistoryEntry entry = this.getNextEntry();
		entry.applyTo(editor);
		checkActions();
	}

	public SqlHistoryEntry getTopEntry()
	{
		if (this.history.size() < 1) return null;
		SqlHistoryEntry entry = this.history.get(this.history.size() - 1);
		return entry;
	}

	private SqlHistoryEntry getPreviousEntry()
	{
		if (this.currentEntry <= 0) return null;
		this.currentEntry--;
		SqlHistoryEntry entry = this.history.get(this.currentEntry);
		return entry;
	}

	private SqlHistoryEntry getNextEntry()
	{
		if (this.currentEntry >= this.history.size() - 1) return null;
		this.currentEntry++;
		SqlHistoryEntry entry = this.history.get(this.currentEntry);
		return entry;
	}

	private static final String KEY_POS = "##sqlwb.pos=";
	private static final String KEY_START = "##sqlwb.selStart=";
	private static final String KEY_END = "##sqlwb.selEnd=";

	public void writeToStream(OutputStream out)
	{

		String lineEnding = "\n";
		try
		{
			Writer writer = EncodingUtil.createWriter(out, "UTF-8");

			int count = this.history.size();
			for (int i=0; i < count; i++)
			{
				SqlHistoryEntry entry = this.history.get(i);
				writer.write(KEY_POS);
				writer.write(Integer.toString(entry.getCursorPosition()));
				writer.write(lineEnding);

				writer.write(KEY_START);
				writer.write(Integer.toString(entry.getSelectionStart()));
				writer.write(lineEnding);

				writer.write(KEY_END);
				writer.write(Integer.toString(entry.getSelectionEnd()));
				writer.write(lineEnding);

				// Make sure the editor text is converted to the correct line ending
				BufferedReader reader = new BufferedReader(new StringReader(entry.getText()));
				String line = reader.readLine();
				while(line != null)
				{
					int len = StringUtil.getRealLineLength(line);
					if (len > 0)
					{
						writer.write(line.substring(0,len));
					}
					writer.write(lineEnding);
					line = reader.readLine();
				}

				//writer.write(lineEnding);
				writer.write(LIST_DELIMITER);
				writer.write(lineEnding);
			}
			writer.flush();
			this.changed = false;
		}
		catch (IOException e)
		{
			LogMgr.logError("SqlHistory.writeToStream()", "Could not write history!", e);
		}
	}

	public boolean isChanged()
	{
		return this.changed;
	}

	public void readFromStream(InputStream in)
	{
		StringBuilder content = new StringBuilder(500);
		int pos = 0;
		int start = -1;
		int end = -1;

		String lineEnding = "\n";
		BufferedReader reader = null;
		try
		{
			reader = new BufferedReader(EncodingUtil.createReader(in , "UTF-8"));
			String line = reader.readLine();
			while(line != null)
			{
				if (line.equals(LIST_DELIMITER))
				{
					try
					{
						SqlHistoryEntry entry = new SqlHistoryEntry(content.toString(), pos, start, end);
						this.addEntry(entry);
						pos = 0;
						start = -1;
						end = -1;
						content = new StringBuilder(500);
					}
					catch (Exception e)
					{
						LogMgr.logError("SqlHistory.readFromStream()", "Error when creating SqlHistoryEntry", e);
					}
				}
				else if (line.startsWith(KEY_POS))
				{
					pos = StringUtil.getIntValue(line.substring(KEY_POS.length()), -1);
				}
				else if (line.startsWith(KEY_START))
				{
					start = StringUtil.getIntValue(line.substring(KEY_START.length()), -1);
				}
				else if (line.startsWith(KEY_END))
				{
					end = StringUtil.getIntValue(line.substring(KEY_END.length()), -1);
				}
				else
				{
					int len = StringUtil.getRealLineLength(line);
					if (len > 0)
					{
						content.append(line, 0, len);
					}
					content.append(lineEnding);
				}
				line = reader.readLine();
			}
			this.changed = false;
		}
		catch (IOException e)
		{
			LogMgr.logError("SqlHistory.readFromStream()", "Could not read history!", e);
		}
		finally
		{
			try { reader.close(); } catch (Throwable th) {}
		}

		if (content.length() > 0)
		{
			SqlHistoryEntry entry = new SqlHistoryEntry(content.toString(), pos, start, end);
			this.addEntry(entry);
		}
	}

	private void checkActions()
	{
		this.nextStmtAction.setEnabled(this.hasNext());
		this.lastStmtAction.setEnabled(this.hasNext());
		this.prevStmtAction.setEnabled(this.hasPrevious());
		this.firstStmtAction.setEnabled(this.hasPrevious());
		this.clearAction.setEnabled(this.history.size() > 0);
	}
}


text:
/**
Author: MI
Description: MenuSystem Module
Used in: App Module, App
*/
define([
  'marionette',
  'app.vent',
  'corso',
  'a3/router'		// Defining the Router for the MenuSystem module

], function(Marionette, Vent, Corso, Router) {
  'use strict';

  return {
    initialize: function() {
			var
			App = require('app'),
			MenuSystemModule = App.module('MenuSystemModule', function() {
				// prevent starting with parent
				this.startWithParent = false;
				// module handle
				this.handle = 'a3';

				var API = {
					// Get Menus using the idUser of the User as parameter
					getMenu: function(idUser) {
						Corso.startCloseModules("MenuSystemModule", App);

						require(['a3/ctr/menuSystem'], function(MenuSystemController) {
							// Create a new controller
							MenuSystemModule.controller = new MenuSystemController({
								idUser: idUser,
								handle: MenuSystemModule.handle
							});
						});
					}
				};
				this.router = new Router({
					controller: API
				});
			});
			return MenuSystemModule;
		}
	};
});


text:
@interface OKPatientViewController : UIViewController

@property (weak, nonatomic) IBOutlet UITextView *txtOutput;
@property (weak, nonatomic) IBOutlet UISwitch *energySwitch;
@property (weak, nonatomic) IBOutlet UINavigationBar *navBar;

@end


text:
package nl.fm.downline;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
import nl.fm.downline.common.Utils;
import nl.fm.downline.csv.FmGroupMember;
import roboguice.fragment.provided.RoboFragment;
import roboguice.inject.InjectView;

import java.text.SimpleDateFormat;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.List;

/**
 * @author Ruud de Jong
 */
public class DownlineFragment extends RoboFragment implements RefreshListener {

    private static final String LOG_TAG = "DownlineFragment";

    private FmGroupMemberAdapter<FmGroupMember> fmGroupMemberAdapter;
    private MemberSelectionListener memberSelectionListener;

    @InjectView(R.id.listMembers)
    private ListView membersList;

    @InjectView(R.id.textMemberName)
    private TextView memberName;

    @InjectView(R.id.textMemberLevel)
    private TextView memberLevel;

    @InjectView(R.id.textMemberPoints)
    private TextView memberPoints;

    @InjectView(R.id.progressLevel)
    private ProgressBar levelProgress;

    @InjectView(R.id.textMemberEarnings)
    private TextView memberEarnings;

    @InjectView(R.id.textLatestUpdate)
    private TextView latestUpdateText;

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        if (activity instanceof MemberSelectionListener) {
            memberSelectionListener = (MemberSelectionListener) activity;
        } else {
            throw new ClassCastException(activity.toString() + " must implement MemberSelectionListener");
        }
    }

    @Override
    public void onDetach() {
        super.onDetach();
        memberSelectionListener = null;
    }

    /**
     * Called when the fragment is first created.
     *
     * @param savedInstanceState If the activity is being re-initialized after
     *                           previously being shut down then this BundleType contains the data it most
     *                           recently supplied in onSaveInstanceState(BundleType). <b>Note: Otherwise it is null.</b>
     */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.i(LOG_TAG, "onCreate");
        DownlineApp.getInstance().registerListener(this);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        super.onCreateView(inflater, container, savedInstanceState);
        Log.i(LOG_TAG, "onCreateView");
        return inflater.inflate(R.layout.fragment_downline, container, false);
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        initControls();
    }

    @Override
    public void onResume() {
        super.onResume();
        Log.i(LOG_TAG, "onResume");

        if (properSettings()) {
            refresh();
        }
    }

    private boolean properSettings() {
        return (DownlineApp.getUsername().length() > 0 && DownlineApp.getPassword().length() > 0);
    }

    private void initControls() {
        Context ctx = getActivity().getApplicationContext();
        membersList.addHeaderView(new View(ctx));
        membersList.addFooterView(new View(ctx));
        fmGroupMemberAdapter = new FmGroupMemberAdapter<>(ctx, R.layout.list_item_card);
        membersList.setAdapter(fmGroupMemberAdapter);

        membersList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                Object chosenItem = parent.getItemAtPosition(position);
                if (chosenItem instanceof FmGroupMember) {
                    FmGroupMember chosenMember = (FmGroupMember) chosenItem;
                    Log.i(LOG_TAG, "Chosen member " + chosenMember.getName());
                    memberSelectionListener.chosenMember(chosenMember);
                }
            }
        });
    }

    private void updateLatestUpdate() {
        long latestUpdate = DownlineApp.getLatestUpdate();
        String latestUpdatePretext = getString(R.string.latestUpdate);
        if (latestUpdate == 0) {
            latestUpdateText.setText(latestUpdatePretext + " " + getString(R.string.latestUpdateNever) + ".");
        } else {
            Date latestUpdateDate = new Date();
            latestUpdateDate.setTime(latestUpdate);
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            latestUpdateText.setText(latestUpdatePretext + " " + sdf.format(latestUpdateDate));
        }
    }

    private void render(FmGroupMember fmGroupMember) {
        if (fmGroupMember == null) {
            return;
        }
        Log.i(LOG_TAG, "fmGroupMember.getName() " + fmGroupMember.getName());
        memberName.setText(fmGroupMember.getName());

        Log.i(LOG_TAG, "fmGroupMember.getLevel() " + fmGroupMember.getLevel());
        memberLevel.setText(String.valueOf(fmGroupMember.getLevel()));

        String personalPoints = Utils.formatGetal(fmGroupMember.getPersonalPoints());
        String groupPoints = Utils.formatGetal(fmGroupMember.getGroupPoints());
        String combinedPoints = personalPoints + " / " + groupPoints;
        Log.i(LOG_TAG, "fmGroupMember.getPersonalPoints() " + personalPoints);
        Log.i(LOG_TAG, "fmGroupMember.getGroupPoints() " + groupPoints);
        Log.i(LOG_TAG, "fmGroupMember combined points() " + combinedPoints);
        memberPoints.setText(combinedPoints);

        DownlineApp.getInstance().setLevelProgress(levelProgress, fmGroupMember);

        Log.i(LOG_TAG, "fmGroupMember.getEarnings() " + Utils.formatGetal(fmGroupMember.getEarnings()));
        memberEarnings.setText("€ " + Utils.formatGetal(fmGroupMember.getEarnings()));

        Collections.sort(fmGroupMember.getDownline(), new Comparator<FmGroupMember>() {
            @Override
            public int compare(FmGroupMember lhs, FmGroupMember rhs) {
                int lhsGroupPoints = (int) (lhs.getGroupPoints() * 100f);
                int rhsGroupPoints = (int) (rhs.getGroupPoints() * 100f);
                return rhsGroupPoints - lhsGroupPoints;
            }
        });
        renderDownlineMembers(fmGroupMember.getDownline());
    }

    private void renderDownlineMembers(List<FmGroupMember> memberList) {
        Log.i(LOG_TAG, "renderDownlineMembers() adding " + memberList.size() + " members to list.");
        fmGroupMemberAdapter.clear();
        fmGroupMemberAdapter.addAll(memberList);
    }

    @Override
    public void refresh() {
        updateLatestUpdate();
        FmGroupMember fmDownlineTree = DownlineApp.getInstance().getFmDownline();
        render(fmDownlineTree);
    }
}


text:
package com.arjuna.databroker.metadata.rdf.selectors;

import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.ResIterator;
import com.arjuna.databroker.metadata.selectors.MutableMetadataContentsSelector;

public class RDFMutableMetadataContentsSelector extends RDFMetadataContentsSelector implements MutableMetadataContentsSelector
{
    public RDFMutableMetadataContentsSelector(Model model)
    {
        super(model);
    }

    public RDFMutableMetadataContentSelector mutableWithPath(String path)
    {
        return new RDFMutableMetadataContentSelector(_model.getResource(path));
    }

    public RDFMutableMetadataContentSelector mutableWithPropertyValue(String propertyName, String propertyValue)
    {
        if (_model != null)
        {
            Property    property         = _model.getProperty(propertyName);
            ResIterator resourceIterator = _model.listResourcesWithProperty(property, propertyValue);

            return new RDFMutableMetadataContentSelector(resourceIterator.nextResource());
        }
        else
            return new RDFMutableMetadataContentSelector(null);
    }

    @Override
    @SuppressWarnings("unchecked")
    public <S extends MutableMetadataContentsSelector> S mutableSelector(Class<S> c)
        throws IllegalArgumentException
    {
        if (c.isAssignableFrom(RDFMutableMetadataContentsSelector.class))
            return (S) this;
        else
            return null;
    }
}


text:
#include "Tiano.h"
#include EFI_ARCH_PROTOCOL_DEFINITION (Runtime)

EFI_GUID  gEfiRuntimeArchProtocolGuid = EFI_RUNTIME_ARCH_PROTOCOL_GUID;

EFI_GUID_STRING(&gEfiRuntimeArchProtocolGuid, "Runtime", "Runtime Arch Protocol");


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no, maximum-scale=1">
  <meta name="generator" content="Jekyll">
  <meta name="description" content="web sistem pakar sederhana dengan jekyll">
  <meta name="author" content="Arifin Jiwantoko">
  <meta name="theme-color" content="#19A974">
  <meta content=' - Doctorobo' name='title'>
  <meta content=' - Doctorobo' name='og:title'>

  <title>Doctorobo</title>

  <link href='http://localhost:4000/img/fav.png' rel='shortcut icon'>
  <link rel="stylesheet" href="http://localhost:4000/css/style.css" media="screen" title="no title">

Doctorobo by Jiwantoko

       Beranda

       Bahaya Demam

       Bantuan

       Tentang

  Tekan tombol "Diagnosis!" untuk mulai diagnosis!

        Diagnosis!

       Disclaimer

       LEGAL

       Terms of Use

       Source Code

  Made by jiwantoko

  Coded with love using Jekyll


text:
package org.netbeans.modules.multilangsourcefilepalette.Customizer;

import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import javax.swing.JComboBox;
import javax.swing.JLabel;

public class Combo extends ComponentPanel {

    private JLabel jLabel1;
    private JComboBox jComboBox1;
    private String jComboBox1Text;

    public Combo() {
        super.setPreferredSize(new Dimension(Customizer.WIDTH, 35));
        jLabel1 = new JLabel();
        jComboBox1 = new JComboBox();
        configurePanel();
    }

    private void configurePanel() {
        setLayout(new GridBagLayout());
        GridBagConstraints c = new GridBagConstraints();
        c.anchor = GridBagConstraints.LINE_START;
        c.insets = new Insets(5, 5, 5, 5);
        c.gridx = 0;
        c.gridy = 0;
        c.weightx = 1.0;
        add(jLabel1, c);
        c.anchor = GridBagConstraints.WEST;
        c.gridx = 1;
        c.weightx = 100.0;
        c.fill = GridBagConstraints.HORIZONTAL;
        add(jComboBox1, c);
    }

    public void evaluateInput() {
        jComboBox1Text = (String) jComboBox1.getSelectedItem();
    }

    /**
     * @return the jLabel1
     */
    public JLabel getjLabel1() {
        return jLabel1;
    }

    /**
     * @return the jComboBox1
     */
    public JComboBox getjComboBox1() {
        return jComboBox1;
    }

    /**
     * @return the jComboBox1Text
     */
    public String getjComboBox1Text() {
        return jComboBox1Text;
    }

}


text:
package macbury.forge.editor.controllers.maps;

import icons.Utils;

import javax.swing.*;
import javax.swing.tree.DefaultTreeCellRenderer;
import java.awt.*;

/**
 * Created by macbury on 11.03.15.
 */
public class MapTreeCellRenderer extends DefaultTreeCellRenderer {
  private Icon projectIcon = Utils.getIcon("node_root");
  private Icon folderIcon  = Utils.getIcon("node_folder");
  private Icon mapIcon     = Utils.getIcon("node_map");
  @Override
  public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean isLeaf, int row, boolean focused) {
    Component c = super.getTreeCellRendererComponent(tree, value, selected, expanded, isLeaf, row, focused);
    if (MapTreeModel.ProjectNode.class.isInstance(value)) {
      setIcon(projectIcon);
    } else if (MapTreeModel.FolderNode.class.isInstance(value)) {
      setIcon(folderIcon);
    } else {
      setIcon(mapIcon);
    }
    return c;
  }
}


text:
rm -rf *.coverprofile
X=1
for Package in $(go list ./... | grep -v "vendor") ; do
	echo $Package ;
	go test -v -covermode=count -coverprofile=$X.coverprofile $Package ;
	X=$((X+1)) ;
done