text:
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;

namespace RSCoreLib.OS
    {
    public static class ProcessNativeMethods
        {
        [DllImport("kernel32.dll", SetLastError = true)]
        public static extern bool AttachConsole (uint dwProcessId);

        [DllImport("kernel32.dll", SetLastError = true, ExactSpelling = true)]
        public static extern bool FreeConsole ();

        [DllImport("kernel32.dll")]
        public static extern bool SetConsoleCtrlHandler (ConsoleCtrlDelegate HandlerRoutine, bool Add);
        // Delegate type to be used as the Handler Routine for SCCH
        public delegate bool ConsoleCtrlDelegate (CtrlTypes CtrlType);

        // Enumerated type for the control messages sent to the handler routine
        public enum CtrlTypes : uint
            {
            CTRL_C_EVENT = 0,
            CTRL_BREAK_EVENT,
            CTRL_CLOSE_EVENT,
            CTRL_LOGOFF_EVENT = 5,
            CTRL_SHUTDOWN_EVENT
            }

        [DllImport("kernel32.dll")]
        [return: MarshalAs(UnmanagedType.Bool)]
        public static extern bool GenerateConsoleCtrlEvent (CtrlTypes dwCtrlEvent, uint dwProcessGroupId);
        }

    public static class ProcessExtensions
        {
        public static void TerminateByInterrupt (this Process p, int timeout = 5000)
            {
            if (p.HasExited)
                return;//super nice

            p.StandardInput.Close();
            if (p.WaitForExit(200))
                return;//nice

            //This does not require the console window to be visible.
            if (ProcessNativeMethods.AttachConsole((uint)p.Id))
                {
                try
                    {
                    //Disable Ctrl-C handling for our program
                    if (ProcessNativeMethods.SetConsoleCtrlHandler(null, true))
                        {
                        try
                            {
                            ProcessNativeMethods.GenerateConsoleCtrlEvent(ProcessNativeMethods.CtrlTypes.CTRL_C_EVENT, 0);
                            ProcessNativeMethods.GenerateConsoleCtrlEvent(ProcessNativeMethods.CtrlTypes.CTRL_C_EVENT, 0);
                            ProcessNativeMethods.GenerateConsoleCtrlEvent(ProcessNativeMethods.CtrlTypes.CTRL_C_EVENT, 0);
                            //Must wait here. If we don't and re-enable Ctrl-C handling below too fast, we might terminate ourselves.
                            if (p.WaitForExit(timeout))
                                {
                                return;//okay, interrupt did the trick.
                                }

                            Log.Warning("Interrupting the process {0} did not work, terminating the process tree...", p.ProcessName);
                            }
                        finally
                            {
                            //Re-enable Ctrl-C handling or any subsequently started programs will inherit the disabled state.
                            ProcessNativeMethods.SetConsoleCtrlHandler(null, false);
                            }
                        }
                    }
                catch(Exception e)
                    {
                    Log.Error("Interrupt termination of process threw exception. {0}", e.ToString());
                    //continue to kill the process
                    }
                finally
                    {
                    ProcessNativeMethods.FreeConsole();
                    }
                }

            p.Taskkill();
            }

        public static bool Taskkill (this Process p, bool force = false, bool skipClosingStandardInput = false, int timeoutSeconds = 5)
            {
            if (p.HasExited)
                return true;//super nice

            try
                {
                if (!skipClosingStandardInput)
                    {
                    p.StandardInput.Close();
                    if (p.WaitForExit(1000))
                        {
                        return true;
                        }
                    }

                string args = $"{(force ? "/F " : string.Empty)}/T /PID {p.Id}";
                Log.Information($"Using Taskkill to shutdown process with id {p.Id}");
                ProcessStartInfo processStartInfo = new ProcessStartInfo("taskkill", args)
                    {
                    CreateNoWindow = true,
                    UseShellExecute = false
                    };

                var terminateProcess = Process.Start(processStartInfo);
                return p.WaitForExit(timeoutSeconds * 1000);
                }
            catch(Exception e)
                {
                Log.Error($"Interrupt termination of process threw exception. {e.Message}");
                return false;
                }
            }
        }
    }


text:
package handler

import (
	"fmt"
	"net/http"
)

type Counter int

func (c *Counter) ServeHTTP(response http.ResponseWriter, request *http.Request) {
	*c++
	fmt.Fprint(response, *c)
}

func NewCounter() http.Handler {
	return new(Counter)
}

redpajama_set_name: RedPajamaGithub


text:
import App from './src/app';

export default App;


text:
<?php

namespace Bitpay;

use Bitpay\Autoloader;

class AutoloaderTest extends \PHPUnit_Framework_TestCase
{

    public function testAutoload()
    {
        Autoloader::register();

        // Only BitPay classes
        Autoloader::autoload('FooBar/Bitpay');

        Autoloader::autoload('Bitpay/Address');
        // Is only required once
        Autoloader::autoload('Bitpay/Address');
    }
}


text:
"""Tests for aggregate_ops."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import numpy as np

from tensorflow.python.framework import dtypes
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.platform import test

class AddNTest(test.TestCase):
  # AddN special-cases adding the first M inputs to make (N - M) divisible by 8,
  # after which it adds the remaining (N - M) tensors 8 at a time in a loop.
  # Test N in [1, 10] so we check each special-case from 1 to 9 and one
  # iteration of the loop.
  _MAX_N = 10

  def _supported_types(self):
    if test.is_gpu_available():
      return [dtypes.float16, dtypes.float32, dtypes.float64, dtypes.complex64,
              dtypes.complex128]
    return [dtypes.int8, dtypes.int16, dtypes.int32, dtypes.int64,
            dtypes.float16, dtypes.float32, dtypes.float64, dtypes.complex64,
            dtypes.complex128]

  def _buildData(self, shape, dtype):
    data = np.random.randn(*shape).astype(dtype.as_numpy_dtype)
    # For complex types, add an index-dependent imaginary component so we can
    # tell we got the right value.
    if dtype.is_complex:
      return data + 10j * data
    return data

  def testAddN(self):
    np.random.seed(12345)
    with self.test_session(use_gpu=True) as sess:
      for dtype in self._supported_types():
        for count in range(1, self._MAX_N + 1):
          data = [self._buildData((2, 2), dtype) for _ in range(count)]
          actual = sess.run(math_ops.add_n(data))
          expected = np.sum(np.vstack(
              [np.expand_dims(d, 0) for d in data]), axis=0)
          tol = 5e-3 if dtype == dtypes.float16 else 5e-7
          self.assertAllClose(expected, actual, rtol=tol, atol=tol)

  def testUnknownShapes(self):
    np.random.seed(12345)
    with self.test_session(use_gpu=True) as sess:
      for dtype in self._supported_types():
        data = self._buildData((2, 2), dtype)
        for count in range(1, self._MAX_N + 1):
          data_ph = array_ops.placeholder(dtype=dtype)
          actual = sess.run(math_ops.add_n([data_ph] * count), {data_ph: data})
          expected = np.sum(np.vstack([np.expand_dims(data, 0)] * count),
                            axis=0)
          tol = 5e-3 if dtype == dtypes.float16 else 5e-7
          self.assertAllClose(expected, actual, rtol=tol, atol=tol)

if __name__ == "__main__":
  test.main()


text:
package com.bxtel.commons;

import java.util.Map;

public class SearchData {
	Map<String, Object> search;
	Map<String, Object> sort;
	Integer page;
	Integer pagesize;
	public Map<String, Object> getSearch() {
		return search;
	}
	public void setSearch(Map<String, Object> search) {
		this.search = search;
	}
	public Map<String, Object> getSort() {
		return sort;
	}
	public void setSort(Map<String, Object> sort) {
		this.sort = sort;
	}
	public Integer getPage() {
		return page;
	}
	public void setPage(Integer page) {
		this.page = page;
	}
	public Integer getPagesize() {
		return pagesize;
	}
	public void setPagesize(Integer pagesize) {
		this.pagesize = pagesize;
	}
}


text:
require 'net/http'
require 'nokogiri'

module Tallyable
  module ActsAsTallyable
    def self.included(base)
      base.extend ClassMethods
    end

    module ClassMethods
      def acts_as_tallyable(host, port = 9002, options = {})
        @@host = host
        @@port = port
      end

      def employee_request
        result = tally_request("#{ File.dirname(__FILE__) }/employee_request.xml")
        employees = []

        unless result.is_a? String
          xml = Nokogiri.XML(result.body)
          xml.xpath("ENVELOPE").each do |nodes|
            params = {}
            nodes.children.each do |node|
              params[:name] = node.text if node.name == "EMPPROFILENAME"
              %w[EMPPROFILEEMAILID
                EMPPROFILEGENDER
                EMPPROFILEDATEOFBIRTH
                EMPPROFILECONTACTNUMBER
                EMPPROFILEEMPLOYEEADDRESS].each do |tag|
                  if node.at(tag)
                    case node.at(tag).name
                      when "EMPPROFILEEMAILID"
                        params[:email] = node.at(tag).text
                      when "EMPPROFILEGENDER"
                        params[:gender] = node.at(tag).text
                      when "EMPPROFILEDATEOFBIRTH"
                        params[:date_of_birth] = node.at(tag).text
                      when "EMPPROFILECONTACTNUMBER"
                        params[:phone] = node.at(tag).text
                      when "EMPPROFILEEMPLOYEEADDRESS"
                        params[:address] = node.at(tag).text
                    end
                  end
              end

              # hack to find a record delimiter, hierarchical tags are better
              if node.name == "EMPPROFILESNO" and !params.empty?
                employees << params
                params = {}
              end
            end
            employees << params
          end
        end

        employees
      end

      private
      # helper method for "POST" ing XML request to Tally
      def tally_request(tdl_file)
        uri = URI.parse("#{ @@host }:#{ @@port }")
        http_handler = Net::HTTP.new(uri.host, uri.port)

        request_handler = Net::HTTP::Post.new(uri.to_s)
        begin
          request_handler.body = File.read(tdl_file)
          http_handler.request(request_handler)
        rescue Exception => e
          "#{e.message}"
        end
      end
    end
  end
end

if defined?(ActiveRecord::Base)
  ActiveRecord::Base.send(:include, Tallyable::ActsAsTallyable)
else
  include Tallyable::ActsAsTallyable
end


text:
import copy
import mock
import sys

import jsonpatch
import pytest

from ray.autoscaler.batching_node_provider import NodeData
from ray.autoscaler._private.kuberay.node_provider import (
    _worker_group_index,
    _worker_group_max_replicas,
    _worker_group_replicas,
    KuberayNodeProvider,
    ScaleRequest,
)
from ray.autoscaler._private.util import NodeID
from pathlib import Path
import yaml

from ray.tests.kuberay.test_autoscaling_config import get_basic_ray_cr
from typing import Set, List

def _get_basic_ray_cr_workers_to_delete(
    cpu_workers_to_delete: List[NodeID], gpu_workers_to_delete: List[NodeID]
):
    """Generate a Ray cluster with non-empty workersToDelete field."""
    raycluster = get_basic_ray_cr()
    raycluster["spec"]["workerGroupSpecs"][0]["scaleStrategy"] = {
        "workersToDelete": cpu_workers_to_delete
    }
    raycluster["spec"]["workerGroupSpecs"][1]["scaleStrategy"] = {
        "workersToDelete": gpu_workers_to_delete
    }
    return raycluster

def _get_test_yaml(file_name):
    file_path = str(Path(__file__).resolve().parent / "test_files" / file_name)
    return yaml.safe_load(open(file_path).read())

@pytest.mark.skipif(sys.platform.startswith("win"), reason="Not relevant on Windows.")
@pytest.mark.parametrize(
    "group_name,expected_index", [("small-group", 0), ("gpu-group", 1)]
)
def test_worker_group_index(group_name, expected_index):
    """Basic unit test for _worker_group_index.

    Uses a RayCluster CR with worker groups "small-group" and "gpu-group",
    listed in that order.
    """
    raycluster_cr = get_basic_ray_cr()
    assert _worker_group_index(raycluster_cr, group_name) == expected_index

@pytest.mark.skipif(sys.platform.startswith("win"), reason="Not relevant on Windows.")
@pytest.mark.parametrize(
    "group_index,expected_max_replicas,expected_replicas",
    [(0, 300, 1), (1, 200, 1), (2, None, 0)],
)
def test_worker_group_replicas(group_index, expected_max_replicas, expected_replicas):
    """Basic unit test for _worker_group_max_replicas and _worker_group_replicas

    Uses a RayCluster CR with worker groups with 300 maxReplicas, 200 maxReplicas,
    and unspecified maxReplicas, in that order.
    """
    raycluster = get_basic_ray_cr()

    # Add a worker group without maxReplicas to confirm behavior
    # when maxReplicas is not specified.
    no_max_replicas_group = copy.deepcopy(raycluster["spec"]["workerGroupSpecs"][0])
    no_max_replicas_group["groupName"] = "no-max-replicas"
    del no_max_replicas_group["maxReplicas"]
    # Also, replicas field, just for the sake of testing.
    no_max_replicas_group["replicas"] = 0
    raycluster["spec"]["workerGroupSpecs"].append(no_max_replicas_group)

    assert _worker_group_max_replicas(raycluster, group_index) == expected_max_replicas
    assert _worker_group_replicas(raycluster, group_index) == expected_replicas

@pytest.mark.skipif(sys.platform.startswith("win"), reason="Not relevant on Windows.")
@pytest.mark.parametrize(
    "attempted_target_replica_count,expected_target_replica_count",
    [(200, 200), (250, 250), (300, 300), (400, 300), (1000, 300)],
)
def test_create_node_cap_at_max(
    attempted_target_replica_count, expected_target_replica_count
):
    """Validates that KuberayNodeProvider does not attempt to create more nodes than
    allowed by maxReplicas. For the config in this test, maxReplicas is fixed at 300.

    Args:
        attempted_target_replica_count: The mocked desired replica count for a given
            worker group.
        expected_target_replica_count: The actual requested replicaCount. Should be
            capped at maxReplicas (300, for the config in this test.)
    """
    raycluster = get_basic_ray_cr()
    with mock.patch.object(KuberayNodeProvider, "__init__", return_value=None):
        kr_node_provider = KuberayNodeProvider(provider_config={}, cluster_name="fake")
        scale_request = ScaleRequest(
            workers_to_delete=set(),
            desired_num_workers={"small-group": attempted_target_replica_count},
        )
        patch = kr_node_provider._scale_request_to_patch_payload(
            scale_request=scale_request, raycluster=raycluster
        )
        assert patch[0]["value"] == expected_target_replica_count

@pytest.mark.skipif(sys.platform.startswith("win"), reason="Not relevant on Windows.")
@pytest.mark.parametrize(
    "podlist_file,expected_node_data",
    [
        (
            # Pod list obtained by running kubectl get pod -o yaml at runtime.
            "podlist1.yaml",
            {
                "raycluster-autoscaler-head-8zsc8": NodeData(
                    kind="head", type="head-group", ip="10.4.2.6", status="up-to-date"
                ),  # up-to-date status because the Ray container is in running status
                "raycluster-autoscaler-worker-small-group-dkz2r": NodeData(
                    kind="worker", type="small-group", ip="10.4.1.8", status="waiting"
                ),  # waiting status, because Ray container's state is "waiting".
                # The pod list includes a worker with non-null deletion timestamp.
                # It is excluded from the node data because it is considered
                # "terminated".
            },
        ),
        (
            # Pod list obtained by running kubectl get pod -o yaml at runtime.
            "podlist2.yaml",
            {
                "raycluster-autoscaler-head-8zsc8": NodeData(
                    kind="head", type="head-group", ip="10.4.2.6", status="up-to-date"
                ),
                "raycluster-autoscaler-worker-fake-gpu-group-2qnhv": NodeData(
                    kind="worker",
                    type="fake-gpu-group",
                    ip="10.4.0.6",
                    status="up-to-date",
                ),
                "raycluster-autoscaler-worker-small-group-dkz2r": NodeData(
                    kind="worker",
                    type="small-group",
                    ip="10.4.1.8",
                    status="up-to-date",
                ),
                "raycluster-autoscaler-worker-small-group-lbfm4": NodeData(
                    kind="worker",
                    type="small-group",
                    ip="10.4.0.5",
                    status="up-to-date",
                ),
            },
        ),
    ],
)
def test_get_node_data(podlist_file: str, expected_node_data):
    """Test translation of a K8s pod list into autoscaler node data."""
    pod_list = _get_test_yaml(podlist_file)

    def mock_get(node_provider, path):
        if "pods" in path:
            return pod_list
        elif "raycluster" in path:
            return get_basic_ray_cr()
        else:
            raise ValueError("Invalid path.")

    with mock.patch.object(
        KuberayNodeProvider, "__init__", return_value=None
    ), mock.patch.object(KuberayNodeProvider, "_get", mock_get):
        kr_node_provider = KuberayNodeProvider(provider_config={}, cluster_name="fake")
        kr_node_provider.cluster_name = "fake"
        nodes = kr_node_provider.non_terminated_nodes({})
        assert kr_node_provider.node_data_dict == expected_node_data
        assert set(nodes) == set(expected_node_data.keys())

@pytest.mark.skipif(sys.platform.startswith("win"), reason="Not relevant on Windows.")
@pytest.mark.parametrize(
    "node_data_dict,scale_request,expected_patch_payload",
    [
        (
            {
                "raycluster-autoscaler-head-8zsc8": NodeData(
                    kind="head", type="head-group", ip="10.4.2.6", status="up-to-date"
                ),
                "raycluster-autoscaler-worker-fake-gpu-group-2qnhv": NodeData(
                    kind="worker",
                    type="fake-gpu-group",
                    ip="10.4.0.6",
                    status="up-to-date",
                ),
                "raycluster-autoscaler-worker-small-group-dkz2r": NodeData(
                    kind="worker",
                    type="small-group",
                    ip="10.4.1.8",
                    status="up-to-date",
                ),
                "raycluster-autoscaler-worker-small-group-lbfm4": NodeData(
                    kind="worker",
                    type="small-group",
                    ip="10.4.0.5",
                    status="up-to-date",
                ),
            },
            ScaleRequest(
                desired_num_workers={
                    "small-group": 1,  # Delete 1
                    "gpu-group": 1,  # Don't touch
                    "blah-group": 5,  # Create 5
                },
                workers_to_delete={
                    "raycluster-autoscaler-worker-small-group-dkz2r",
                },
            ),
            [
                {
                    "op": "replace",
                    "path": "/spec/workerGroupSpecs/2/replicas",
                    "value": 5,
                },
                {
                    "op": "replace",
                    "path": "/spec/workerGroupSpecs/0/scaleStrategy",
                    "value": {
                        "workersToDelete": [
                            "raycluster-autoscaler-worker-small-group-dkz2r"
                        ]
                    },
                },
            ],
        ),
    ],
)
def test_submit_scale_request(node_data_dict, scale_request, expected_patch_payload):
    """Test the KuberayNodeProvider's RayCluster patch payload given a dict
    of current node counts and a scale request.
    """
    raycluster = get_basic_ray_cr()
    # Add another worker group for the sake of this test.
    blah_group = copy.deepcopy(raycluster["spec"]["workerGroupSpecs"][1])
    blah_group["groupName"] = "blah-group"
    raycluster["spec"]["workerGroupSpecs"].append(blah_group)
    with mock.patch.object(KuberayNodeProvider, "__init__", return_value=None):
        kr_node_provider = KuberayNodeProvider(provider_config={}, cluster_name="fake")
        kr_node_provider.node_data_dict = node_data_dict
        patch_payload = kr_node_provider._scale_request_to_patch_payload(
            scale_request=scale_request, raycluster=raycluster
        )
        assert patch_payload == expected_patch_payload

@pytest.mark.parametrize("node_set", [{"A", "B", "C", "D", "E"}])
@pytest.mark.parametrize("cpu_workers_to_delete", ["A", "Z"])
@pytest.mark.parametrize("gpu_workers_to_delete", ["B", "Y"])
@pytest.mark.skipif(sys.platform.startswith("win"), reason="Not relevant on Windows.")
def test_safe_to_scale(
    node_set: Set[NodeID],
    cpu_workers_to_delete: List[NodeID],
    gpu_workers_to_delete: List[NodeID],
):
    # NodeData values unimportant for this test.
    mock_node_data = NodeData("-", "-", "-", "-")
    node_data_dict = {node_id: mock_node_data for node_id in node_set}

    raycluster = _get_basic_ray_cr_workers_to_delete(
        cpu_workers_to_delete, gpu_workers_to_delete
    )

    def mock_patch(kuberay_provider, path, patch_payload):
        patch = jsonpatch.JsonPatch(patch_payload)
        kuberay_provider._patched_raycluster = patch.apply(kuberay_provider._raycluster)

    with mock.patch.object(
        KuberayNodeProvider, "__init__", return_value=None
    ), mock.patch.object(KuberayNodeProvider, "_patch", mock_patch):
        kr_node_provider = KuberayNodeProvider(provider_config={}, cluster_name="fake")
        kr_node_provider.cluster_name = "fake"
        kr_node_provider._patched_raycluster = raycluster
        kr_node_provider._raycluster = raycluster
        kr_node_provider.node_data_dict = node_data_dict
        actual_safe = kr_node_provider.safe_to_scale()

    expected_safe = not any(
        cpu_worker_to_delete in node_set
        for cpu_worker_to_delete in cpu_workers_to_delete
    ) and not any(
        gpu_worker_to_delete in node_set
        for gpu_worker_to_delete in gpu_workers_to_delete
    )
    assert expected_safe is actual_safe
    patched_cpu_workers_to_delete = kr_node_provider._patched_raycluster["spec"][
        "workerGroupSpecs"
    ][0]["scaleStrategy"]["workersToDelete"]
    patched_gpu_workers_to_delete = kr_node_provider._patched_raycluster["spec"][
        "workerGroupSpecs"
    ][1]["scaleStrategy"]["workersToDelete"]

    if expected_safe:
        # Cleaned up workers to delete
        assert patched_cpu_workers_to_delete == []
        assert patched_gpu_workers_to_delete == []
    else:
        # Did not clean up workers to delete
        assert patched_cpu_workers_to_delete == cpu_workers_to_delete
        assert patched_gpu_workers_to_delete == gpu_workers_to_delete

if __name__ == "__main__":
    sys.exit(pytest.main(["-v", __file__]))


text:
<?php

namespace Magento\SalesRule\Test\Constraint;

use Magento\Sales\Test\Page\SalesGuestPrint;
use Magento\Mtf\Constraint\AbstractConstraint;

/**
 * Assert that sales rule amount printed correctly on sales guest print page.
 */
class AssertSalesRuleOnPrintOrder extends AbstractConstraint
{
    /**
     * Assert that sales rule amount printed correctly on sales guest print page.
     *
     * @param SalesGuestPrint $salesGuestPrint
     * @param array $prices
     * @return void
     */
    public function processAssert(SalesGuestPrint $salesGuestPrint, array $prices)
    {
        \PHPUnit_Framework_Assert::assertEquals(
            abs($prices['discount']),
            $salesGuestPrint->getViewSalesRule()->getItemBlock()->getSalesRuleDiscount(),
            "Sales rule amount not equals."
        );
    }

    /**
     * Returns a string representation of successful assertion.
     *
     * @return string
     */
    public function toString()
    {
        return "Sales rule amount was printed correctly.";
    }
}


text:
package cgeo.geocaching.files;

import cgeo.geocaching.utils.Log;

import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.CharEncoding;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.jdt.annotation.NonNull;

import android.content.ContentResolver;
import android.net.Uri;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

public class FileTypeDetector {

    private final ContentResolver contentResolver;
    private final Uri uri;

    public FileTypeDetector(final Uri uri, final ContentResolver contentResolver) {
        this.uri = uri;
        this.contentResolver = contentResolver;
    }

	public @NonNull FileType getFileType() {
        InputStream is = null;
        BufferedReader reader = null;
		FileType type = FileType.UNKNOWN;
		try {
            is = contentResolver.openInputStream(uri);
            if (is == null) {
                return FileType.UNKNOWN;
            }
            reader = new BufferedReader(new InputStreamReader(is, CharEncoding.UTF_8));
			type = detectHeader(reader);
            reader.close();
        } catch (final IOException e) {
            if (!uri.toString().startsWith("http")) {
                Log.e("FileTypeDetector", e);
            }
        } finally {
            IOUtils.closeQuietly(reader);
            IOUtils.closeQuietly(is);
        }
		return type;
    }

	private static FileType detectHeader(final BufferedReader reader)
			throws IOException {
		String line = reader.readLine();
		if (isZip(line)) {
			return FileType.ZIP;
		}
		// scan at most 5 lines of a GPX file
		for (int i = 0; i < 5; i++) {
			line = StringUtils.trim(line);
			if (StringUtils.contains(line, "<loc")) {
				return FileType.LOC;
			}
			if (StringUtils.contains(line, "<gpx")) {
				return FileType.GPX;
			}
			line = reader.readLine();
		}
		return FileType.UNKNOWN;
	}

	private static boolean isZip(final String line) {
		return StringUtils.length(line) >= 4
				&& StringUtils.startsWith(line, "PK") && line.charAt(2) == 3
				&& line.charAt(3) == 4;
	}

}


text:
module Bundler
  class Source
    class Git < Path

      class GitNotInstalledError < GitError
        def initialize
          msg =  "You need to install git to be able to use gems from git repositories. "
          msg << "For help installing git, please refer to GitHub's tutorial at https://help.github.com/articles/set-up-git"
          super msg
        end
      end

      class GitNotAllowedError < GitError
        def initialize(command)
          msg =  "Bundler is trying to run a `git #{command}` at runtime. You probably need to run `bundle install`. However, "
          msg << "this error message could probably be more useful. Please submit a ticket at http://github.com/bundler/bundler/issues "
          msg << "with steps to reproduce as well as the following\n\nCALLER: #{caller.join("\n")}"
          super msg
        end
      end

      class GitCommandError < GitError
        def initialize(command, path = nil)
          msg =  "Git error: command `git #{command}` in directory #{Dir.pwd} has failed."
          msg << "\nIf this error persists you could try removing the cache directory '#{path}'" if path && path.exist?
          super msg
        end
      end

      # The GitProxy is responsible to iteract with git repositories.
      # All actions required by the Git source is encapsualted in this
      # object.
      class GitProxy
        attr_accessor :path, :uri, :ref
        attr_writer :revision

        def initialize(path, uri, ref, revision=nil, &allow)
          @path     = path
          @uri      = uri
          @ref      = ref
          @revision = revision
          @allow    = allow || Proc.new { true }
        end

        def revision
          @revision ||= allowed_in_path { git("rev-parse #{ref}").strip }
        end

        def branch
          @branch ||= allowed_in_path do
            git("branch") =~ /^\* (.*)$/ && $1.strip
          end
        end

        def contains?(commit)
          allowed_in_path do
            result = git_null("branch --contains #{commit}")
            $? == 0 && result =~ /^\* (.*)$/
          end
        end

        def checkout
          if path.exist?
            return if has_revision_cached?
            Bundler.ui.confirm "Updating #{uri}"
            in_path do
              git %|fetch --force --quiet --tags #{uri_escaped} "refs/heads/*:refs/heads/*"|
            end
          else
            Bundler.ui.info "Fetching #{uri}"
            FileUtils.mkdir_p(path.dirname)
            clone_command = %|clone #{uri_escaped} "#{path}" --bare --no-hardlinks|
            clone_command = "#{clone_command} --quiet" if Bundler.ui.quiet?
            git clone_command
          end
        end

        def copy_to(destination, submodules=false)
          unless File.exist?(destination.join(".git"))
            FileUtils.mkdir_p(destination.dirname)
            FileUtils.rm_rf(destination)
            git %|clone --no-checkout "#{path}" "#{destination}"|
            File.chmod((0777 & ~File.umask), destination)
          end

          SharedHelpers.chdir(destination) do
            git %|fetch --force --quiet --tags "#{path}"|
            git "reset --hard #{@revision}"

            if submodules
              git "submodule update --init --recursive"
            end
          end
        end

      private

        # TODO: Do not rely on /dev/null.
        # Given that open3 is not cross platform until Ruby 1.9.3,
        # the best solution is to pipe to /dev/null if it exists.
        # If it doesn't, everything will work fine, but the user
        # will get the $stderr messages as well.
        def git_null(command)
          git("#{command} 2>#{Bundler::NULL}", false)
        end

        def git(command, check_errors=true)
          raise GitNotAllowedError.new(command) unless allow?
          raise GitNotInstalledError.new        unless Bundler.git_present?
          Bundler::Retry.new("git #{command}").attempts do
            out = SharedHelpers.with_clean_git_env { %x{git #{command}} }
            raise GitCommandError.new(command, path) if check_errors && !$?.success?
            out
          end
        end

        def has_revision_cached?
          return unless @revision
          in_path { git("cat-file -e #{@revision}") }
          true
        rescue GitError
          false
        end

        # Escape the URI for git commands
        def uri_escaped
          if Bundler::WINDOWS
            # Windows quoting requires double quotes only, with double quotes
            # inside the string escaped by being doubled.
            '"' + uri.gsub('"') {|s| '""'} + '"'
          else
            # Bash requires single quoted strings, with the single quotes escaped
            # by ending the string, escaping the quote, and restarting the string.
            "'" + uri.gsub("'") {|s| "'\\''"} + "'"
          end
        end

        def allow?
          @allow.call
        end

        def in_path(&blk)
          checkout unless path.exist?
          SharedHelpers.chdir(path, &blk)
        end

        def allowed_in_path
          if allow?
            in_path { yield }
          else
            raise GitError, "The git source #{uri} is not yet checked out. Please run `bundle install` before trying to start your application"
          end
        end

      end

    end
  end
end


text:
You might have noticed, that when you try to access a missing resource (for example entering album details url with arbitrary album id) then no response is sent.
In order to fix that, let's add a "Page Not Found" handler to our main `choose` WebPart as a last resort:

==> App.fs:`let webPart`

the `View.notFound` can then look like:

==> View.fs:`let notFound`


text:
use std::fs::File;
use std::path::Path;
use std::io::Read;
use std::env;
use std::process;

mod inversioncount;

fn main() {

    let args: Vec<String> = env::args().collect();
    if args.len() != 2 {
        println!("Usage: {} NUMBERS\n  Where NUMBERS is a path to a UTF-8 file containing unsigned integers separated by newlines", args[0]);
        process::exit(1);
    }

    let file_path = Path::new(&args[1]);
    let mut file = File::open(&file_path).unwrap();

    let mut file_content = String::new();
    file.read_to_string(&mut file_content).unwrap();

    let numbers: Vec<u32> = file_content.lines().map(|x| x.trim().parse().unwrap()).collect();

    println!("Counting...");
    println!("In the given {} numbers I found {} inversions.",
        numbers.len(), inversioncount::count(numbers));
}


text:
/*
 *
 * RegisterPage actions
 *
 */

import {
  UPDATE_USERNAME,
  UPDATE_PASSWORD,
} from './constants';

export function updateUsername(username) {
  return {
    type: UPDATE_USERNAME,
    username,
  };
}

export function updatePassword(password) {
  return {
    type: UPDATE_PASSWORD,
    password,
  };
}


text:
package gov.tubitak.xoola.transport;

/**
 * @author dogan, muhammet
 *
 */
public class Response implements TransportObject {
  private static final long serialVersionUID = 1L;
  public Object returnValue;
}


text:
namespace network {
class SharedURLLoaderFactory;
}  // namespace network

namespace content {

class BrowserContext;
class ServiceWorkerMainResourceHandle;
class WorkerScriptLoader;

// WorkerScriptLoaderFactory creates a WorkerScriptLoader to load the main
// script for a web worker (dedicated worker or shared worker), which follows
// redirects and sets the controller service worker on the web worker if needed.
// It's an error to call CreateLoaderAndStart() more than a total of one time
// across this object or any of its clones.
//
// This is created per one web worker. It lives on the UI thread.
class CONTENT_EXPORT WorkerScriptLoaderFactory
    : public network::mojom::URLLoaderFactory {
 public:
  // Returns the browser context, or nullptr during shutdown. Must be called on
  // the UI thread.
  using BrowserContextGetter = base::RepeatingCallback<BrowserContext*(void)>;

  // |loader_factory| is used to load the script if the load is not intercepted
  // by a feature like service worker. Typically it will load the script from
  // the NetworkService. However, it may internally contain non-NetworkService
  // factories used for non-http(s) URLs, e.g., a chrome-extension:// URL.
  WorkerScriptLoaderFactory(
      int process_id,
      const DedicatedOrSharedWorkerToken& worker_token,
      const net::IsolationInfo& isolation_info,
      ServiceWorkerMainResourceHandle* service_worker_handle,
      const BrowserContextGetter& browser_context_getter,
      scoped_refptr<network::SharedURLLoaderFactory> loader_factory,
      ukm::SourceId worker_source_id);

  WorkerScriptLoaderFactory(const WorkerScriptLoaderFactory&) = delete;
  WorkerScriptLoaderFactory& operator=(const WorkerScriptLoaderFactory&) =
      delete;

  ~WorkerScriptLoaderFactory() override;

  // network::mojom::URLLoaderFactory:
  void CreateLoaderAndStart(
      mojo::PendingReceiver<network::mojom::URLLoader> receiver,
      int32_t request_id,
      uint32_t options,
      const network::ResourceRequest& resource_request,
      mojo::PendingRemote<network::mojom::URLLoaderClient> client,
      const net::MutableNetworkTrafficAnnotationTag& traffic_annotation)
      override;
  void Clone(mojo::PendingReceiver<network::mojom::URLLoaderFactory> receiver)
      override;

  base::WeakPtr<WorkerScriptLoader> GetScriptLoader() { return script_loader_; }

 private:
  const int process_id_;
  const DedicatedOrSharedWorkerToken worker_token_;
  const net::IsolationInfo isolation_info_;
  base::WeakPtr<ServiceWorkerMainResourceHandle> service_worker_handle_;
  BrowserContextGetter browser_context_getter_;
  scoped_refptr<network::SharedURLLoaderFactory> loader_factory_;
  const ukm::SourceId worker_source_id_;

  // This is owned by SelfOwnedReceiver associated with the given
  // mojo::PendingReceiver<URLLoader>, and invalidated after receiver completion
  // or failure.
  base::WeakPtr<WorkerScriptLoader> script_loader_;
};

}  // namespace content

#endif  // CONTENT_BROWSER_WORKER_HOST_WORKER_SCRIPT_LOADER_FACTORY_H_


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Bootstrap Login Form Template</title>

	<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:400,100,300,500">
	<link rel="stylesheet" href="../../css/form-3/assets/bootstrap/css/bootstrap.min.css">
	<link rel="stylesheet" href="../../css/form-3/assets/font-awesome/css/font-awesome.min.css">
	<link rel="stylesheet" href="../../css/form-3/assets/css/form-elements.css">
	<link rel="stylesheet" href="../../css/form-3/assets/css/style.css">
	<link rel="stylesheet" href="../../css/form-3/choose-layout-assets/style.css">

	<link rel="shortcut icon" href="../../css/form-3/assets/ico/favicon.png">
	<link rel="apple-touch-icon-precomposed" sizes="144x144" href="../../css/form-3/assets/ico/apple-touch-icon-144-precomposed.png">
	<link rel="apple-touch-icon-precomposed" sizes="114x114" href="../../css/form-3/assets/ico/apple-touch-icon-114-precomposed.png">
	<link rel="apple-touch-icon-precomposed" sizes="72x72" href="../../css/form-3/assets/ico/apple-touch-icon-72-precomposed.png">
	<link rel="apple-touch-icon-precomposed" href="../../css/form-3/assets/ico/apple-touch-icon-57-precomposed.png">

Editar Usuario

Ingrese los nuevos datos

							<form class="form-horizontal" data-ng-submit="update()">

									Email

										<input type="text" data-ng-model="usuario.email" id="email" placeholder="Email" required>
										</input>

									Contraseña

										<input type="text" data-ng-model="usuario.password" id="password" placeholder="password">

										</input>

										<input type="submit" class="btn">

							</form>


text:
<!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
-->

## Use Case & Motivation :  Why introducing a new file format?
The motivation behind CarbonData is to create a single file format for all kind of query and analysis on Big Data. Existing data storage formats in Hadoop address only specific use cases requiring users to use multiple file formats for various types of queries resulting in unnecessary duplication of data.

### Sequential Access / Big Scan
Such queries select only a few columns with a group by clause but do not contain any filters. This results in full scan over the complete store for the selected columns.
![Full Scan Query](/docs/images/format/carbon_data_full_scan.png?raw=true)

### OLAP Style Query / Multi-dimensional Analysis
These are queries which are typically fired from Interactive Analysis tools. Such queries often select a few columns but involve filters and group by on a column or a grouping expression.
![OLAP Scan Query](/docs/images/format/carbon_data_olap_scan.png?raw=true)

### Random Access / Narrow Scan
These are queries used from operational applications and usually select all or most of the columns but do involve a large number of filters which reduce the result to a small size. Such queries generally do not involve any aggregation or group by clause.
![Random Scan Query](/docs/images/format/carbon_data_random_scan.png?raw=true)

### Single Format to provide low latency response for all usecases
The main motivation behind CarbonData is to provide a single storage format for all the usecases of querying big data on Hadoop. Thus CarbonData is able to cover all use-cases into a single storage format.
![Motivation](/docs/images/format/carbon_data_motivation.png?raw=true)

## CarbonData File Structure
CarbonData file contains groups of data called blocklet, along with all required information like schema, offsets and indices, etc, in a file footer.

The file footer can be read once to build the indices in memory, which can be utilized for optimizing the scans and processing for all subsequent queries.

Each blocklet in the file is further divided into chunks of data called Data Chunks. Each data chunk is organized either in columnar format or row format, and stores the data of either a single column or a set of columns. All blocklets in one file contain the same number and type of Data Chunks.

![Carbon File Structure](/docs/images/format/carbon_data_file_structure_new.png?raw=true)

Each Data Chunk contains multiple groups of data called as Pages. There are three types of pages.
* Data Page: Contains the encoded data of a column/group of columns.
* Row ID Page (optional): Contains the row id mappings used when the Data Page is stored as an inverted index.
* RLE Page (optional): Contains additional metadata used when the Data Page in RLE coded.

![Carbon File Format](/docs/images/format/carbon_data_format_new.png?raw=true)


text:
module Spree
  class PaymentVersion < PaperTrail::Version
    self.table_name = :spree_payment_versions
  end
end


text:
package org.primeframework.mvc.content;

import org.primeframework.mvc.workflow.Workflow;

/**
 * Defines the content workflow that handles content types and request bodies other than GET/POST parameters.
 *
 * @author Brian Pontarelli
 */
public interface ContentWorkflow extends Workflow {
}


text:
package org.codehaus.groovy.grails.plugins.remoting;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.remoting.support.RemoteExporter;
import org.springframework.web.HttpRequestHandler;

/**
 * A Spring remote exporter that can be used in place of any HTTP based
 * exporter. Its role is to replace existing exporters, thereby "switching" them
 * off. This is because you can not simply remove an exporter from the Spring
 * context at the moment.
 *
 * @author Peter Ledbrook
 */
public final class DummyHttpExporter extends RemoteExporter implements HttpRequestHandler {

	/**
	 * Always returns a 404 HTTP status.
	 */
	public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		response.sendError(HttpServletResponse.SC_NOT_FOUND);
	}
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
null

#### Original name
Pachydisca ascophanoides Boud., 1905

### Remarks
null


text:
package es.tid.topologyModuleBase.plugins.reader;

import java.util.concurrent.locks.Lock;
import java.util.logging.Logger;

import es.tid.topologyModuleBase.TopologyModuleParams;
import es.tid.topologyModuleBase.database.TopologiesDataBase;

public class TMReader
{
	public static String initFromXML = "initFromXML";
	public static String initFromOSPF = "initFromOSPF";
	public static String initFromBGPLS = "initFromBGPLS";
	public static String initFromFloodlight = "initFromFloodlight";
	public static String initFromRestInfinera = "initFromRestInfinera";

	Logger log=Logger.getLogger("TMController");

	TopologiesDataBase ted;
	TopologyModuleParams params;
	Lock lock;

	public TMReader(TopologiesDataBase ted, TopologyModuleParams params, Lock lock)
	{
		this.ted = ted;
		this.params = params;
		this.lock = lock;
	}
	public void read()
	{
		String[] initFrom = params.getInitFrom();
		for (int i = 0; i < initFrom.length; i++)
		{
			if (initFrom[i].equals(TMReader.initFromXML))
			{
				(new TopologyReaderXML(ted, params,lock)).readTopology();
			}
			if (initFrom[i].equals(TMReader.initFromOSPF))
			{
				(new TopologyReaderOSPF(ted, params, lock)).readTopology();
			}
			if (initFrom[i].equals(TMReader.initFromBGPLS))
			{
				(new TopologyReaderBGPLS(ted, params, lock)).readTopology();
				}
			/*if (initFrom[i].equals(TMReader.initFromFloodlight))
			{
				(new TopologyReaderController(ted, params, lock)).readTopology();
			}
			if (initFrom[i].equals(TMReader.initFromRestInfinera))
			{
				(new TopologyReaderInfinera(ted, params,lock)).readTopology();
			}*/
		}
	}
}


text:
Web based keyboards
====

One of the web based Chuvash keyboards is jQuery IME, it is a Wikimedia project. [Chuvash](https://github.com/wikimedia/jquery.ime/tree/master/rules/cv) is also present there.

A nice thing is an extension for Chrome and Firefox. It can be used to type Chuvash in any textbox.


text:
package org.finra.datagenerator.scaffolding.config

/**
  * Created by dkopel on 12/13/16.
  */
trait Configurable {
    def configBundle: ConfigBundle
}


text:
import Component from '@ember/component';
import { observer } from '@ember/object';
import QRCode from 'qrcode';

export default Component.extend({

  text: null,

  colorLight: '#ffffff',

  colorDark: '#000000',

  width: 128,

  height: 128,

  // L/M/Q/H
  correctLevel: 'Q',

  didInsertElement: function() {
    const text = this.get('text');
    const elementId = this.get('elementId');
    const correctLevel = this.get('correctLevel');
    const colorLight = this.get('colorLight');
    const colorDark = this.get('colorDark');
    const width = this.get('width');
    const height = this.get('height');

    let qrcode = new QRCode(elementId, {
      text,
      width,
      height,
      colorDark,
      colorLight,
      correctLevel: QRCode.CorrectLevel[correctLevel],
    });
    this.set('qrcode', qrcode);
  },

  willDestroyElement: function() {
    this.get('qrcode').clear();
  },

  _recreateCode: observer('text', function() {
    this.get('qrcode').makeCode(this.get('text'));
  })
});


text:
var StanfordSlateEnhancements = StanfordSlateEnhancements || (function(){
    var _features = ["classify", "dialog", "selectSearch", "showHide", "tabs"];
    var _args = [];
    var _observers = [];
    return {
        init : function(args) {
            if (!args) {
                args = _features;
            }

            // Add the arguments to the private variable.
            _args = args;

            // Call each feature.
            args.forEach(function(item, index) {
                StanfordSlateEnhancements[item]();
            });

            // For the items that need to wait for elements like popups to show
            // Create an observer to watch for changes.
            var observer = new MutationObserver(function(mutations) {
                _observers.forEach(function(item, index) {
                    if (_args.includes(item)) {
                        StanfordSlateEnhancements[item]();
                    }
                });
            });

            // Start observing
            observer.observe(document.body, { //document.body is node target to observe
                childList: true, //This is a must have for the observer with subtree
                subtree: true //Set to true if changes must also be observed in descendants.
            });
        },
        registerObserver : function(feature) { // Allows features to say they need to be called when a dom change occurs.
            if (!_observers.includes(feature)) {
                _observers.push(feature);
            }
        },
        classify : function() {
            var classes = [];

            // ======  Add path classes ======
            let path = window.location.pathname.substring(1);
            if (path.endsWith('/')) {
                path = path.slice(0, -1);
            }

            // Replace slashes with hyphens to build our class.
            let pathString = 'path-' + path.replace(/\//g, '-');

            // If it's a form add the form id to the class.
            let pathParts = path.split('/');
            if (pathParts[pathParts.length -1] == 'frm') {
                let urlParams = new URLSearchParams(window.location.search);
                for (var key of urlParams.keys()) {
                    pathString += '-' + key;
                    break;
                }
            }

            classes.push(pathString);

            // Add an application path on the application pages.
            if (pathParts.length > 1 && pathParts[0] == 'apply' && pathParts[pathParts.length - 1] !== 'status') {
                classes.push('application');
            }

            // Add a slate-form class on the slate pages.
            if (pathParts[0] == 'register') {
                classes.push('slate-form');
            }

            // ===== End Path Classes =====

            // ===== Logged In Class =====
            if ($('#global a[href^="/account/logout"]').length || $('#global a[href^="/manage/logout"]').length) {
                classes.push('logged-in');
            }
            else {
                classes.push('not-logged-in');
            }
            // ===== End Logged In Class =====

            var classString = classes.join(' ');

            $('body').addClass(classString);

            // Add a class for the application-list table.
            if (classes.includes('path-apply') && classes.includes('logged-in')) {
                $('#start_application_link').parent().prev().addClass('application-list');
            }

            // Add classes for the login links
            if (classes.includes('path-apply') && classes.includes('not-logged-in')) {
                $firstTimeTitle = $('h2:contains("First-time users:")');
                $firstTimeTitle.parents('td').addClass('create-an-account-wrapper');
                $firstTimeTitle.parents('table').addClass('authentication-table');

                $returningUsersTitle = $('h2:contains("Returning users:")');
                $returningUsersTitle.parents('td').addClass('log-in-wrapper');
            }
        },
        dialog : function($dialogs) {
            this.registerObserver('dialog');
            $dialogs = $('[data-sse-dialog]');
            if ($dialogs) {

                // Find all dialogs
                $dialogs.each(function() {
                    let $link = jQuery(this);

                    // Check if the dialog has already been processed
                    if ($link.hasClass("sse-dialog-observed")) {
                        return;
                    }

                    // Need to add a class markign that we have already processed this.
                    $link.addClass("sse-dialog-observed");

                    let dialogID = $link.attr('data-sse-dialog');
                    let $dialog = $('#' + dialogID);

                    // Hide the dialog
                    $dialog.hide();

                    // Add dialog class
                    $dialog.addClass('dialog');

                    // Create the close button and make it close on click.
                    let $dialogClose = $('<button class="default" type="button">Close</button>');
                    $dialogClose.on('click', function(e) {
                        e.preventDefault();
                        FW.Dialog.Unload();
                    });

                    // Add the close button to the end of the dialog.
                    $('

').appendTo($dialog).append($dialogClose);

                    // Open the dialog when the link is clicked.
                    $link.on('click', function(e) {
                        e.preventDefault();
                        FW.Dialog.Load($dialog);
                    });
                });
            }
        },
        selectSearch : function($selects) {
            this.registerObserver('selectSearch');
            // Get the select2 javascript file and load it in the header.
            $.ajax({
                url: "https://cdnjs.cloudflare.com/ajax/libs/select2/4.1.0-rc.0/js/select2.min.js",
                dataType: "script",
                cache: "true",
                success: function( data, textStatus, jqxhr ) {
                    $selects = $('span.sse-select-search');
                    if ($selects) {
                        // Add the css to our header so we can use it.
                        if (!$('link#select2-css').length) {
                            $('<link>').attr('id', 'select2-css').appendTo('head').attr({
                                type: 'text/css',
                                rel: 'stylesheet',
                                href: 'https://cdnjs.cloudflare.com/ajax/libs/select2/4.1.0-rc.0/css/select2.min.css'
                            });
                        }

                        // Run it on every span that has the class sse-search-select
                        $selects.each(function() {
                            $select = $(this);

                            // Check if the select has already been processed
                            if ($select.hasClass("sse-select-search-observed")) {
                                return;
                            }

                            // Need to add a class marking that we have already processed this.
                            $select.addClass("sse-select-search-observed");

                            // Let select2 options be set via a data attribute on the span tag.
                            let options = {}
                            if ($select.data('sse-select-search-options')) {
                                options = $select.data('sse-select-search-options');
                            }

                            var $selectInput = $select.closest('.form_select').find('.form_responses select');
                            $selectInput.select2(options);

                            // Fix accessibility issue where if a label exists it doesn't point to the select2 widget.
                            var selectID = $selectInput.attr('id');
                            $('label[for="' + selectID + '"]').attr('for', 'select2-' + selectID + '-container');

                            // Make the input box take focus when opened.
                            $selectInput.on('select2:open', function(e) {
                                $('.select2-search__field').get(0).focus();
                            });
                        });
                    }
                }
            });
        },
        showHide : function($showhides) {
            this.registerObserver('showHide');

            $showhides = $('[data-sse-showhide]');
            if ($showhides) {
                // Find all the showhide links.
                $showhides.each(function() {
                    let $link = $(this);

                    // Check if the show hide
                    if ($link.hasClass("sse-showhide-observed")) {
                        return;
                    }

                    $link.addClass("sse-showhide-observed");

                    let showHideID = $link.attr('data-sse-showhide');
                    let $showHide = jQuery('#' + showHideID);

                    // Hide the text initially
                    $showHide.hide();

                    // Hide and show depending on the current state.
                    $link.attr('aria-expanded', 'false');
                    $link.on('click', function(e) {
                        e.preventDefault();
                        if ($link.attr('aria-expanded') == "true") {
                            $link.attr('aria-expanded', 'false');
                            $showHide.hide();
                        }
                        else {
                            $link.attr('aria-expanded', 'true');
                            $showHide.show();
                        }
                    });
                });
            }
        },
        tabs : function() {
            this.registerObserver('tabs');

            // Find all tab groups.
            $('[data-sse-tabs-content]').each(function() {
                var $tabGroup = $(this);

                // Check if it has already been processed
                if ($tabGroup.hasClass('sse-tabs-observed')) {
                    return;
                }
                $tabGroup.addClass('sse-tabs-observed');

                // Get the ID of content area to use
                var contentID = $tabGroup.data('sse-tabs-content');

                // Loop through each tab
                var $tabs = $tabGroup.find('[data-sse-tabs-action]');
                $tabs.each(function() {
                    var $tabItem = $(this);

                    // Load the active tab
                    if ($tabItem.hasClass('active')) {
                        FW.Lazy.Fetch("?cmd=" + $tabItem.data('sse-tabs-action'), $("#" + contentID));
                    }

                    // Switch tab when clicked.
                    $tabItem.on('click', function(e) {
                        e.preventDefault();
                        var $tab = $(this);
                        $tabs.removeClass('active');
                        $tab.addClass('active');
                        FW.Lazy.Fetch("?cmd=" + $tab.data('sse-tabs-action'), $("#" + contentID));
                    });
                });
            });
        }
    };
}());


text:
package org.broadinstitute.hellbender.tools.walkers.vqsr;

import htsjdk.variant.variantcontext.VariantContext;
import org.broadinstitute.hellbender.exceptions.GATKException;

public final class VQSRUtils {
    private VQSRUtils() {/*no instance*/}

    public static boolean checkVariationClass( final VariantContext evalVC, final VariantRecalibratorArgumentCollection.Mode mode ) {
        switch( mode ) {
            case SNP:
                return evalVC.isSNP() || evalVC.isMNP();
            case INDEL:
                return evalVC.isStructuralIndel() || evalVC.isIndel() || evalVC.isMixed() || evalVC.isSymbolic();
            case BOTH:
                return true;
            default:
                throw new GATKException( "Encountered unknown recal mode: " + mode );
        }
    }
}


text:
module ValidatesGreekVatNumberFormatOf

  def self.validate_greek_vat_number(s)

   # vat number must be 9 digits wide.
    if s.length !=9
      return false
    end

    # Check to see if the number passed conforms to the rules of the algorithm
    # More about the algorithm here:
    # http://www.taxheaven.gr/acforum/index.php?showtopic=10377
    # http://www.dotnetzone.gr/cs/blogs/equilibrium/articles/Greek_VAT_Validation_Check.aspx

	# algorithm starts here
	sum = 0.0
      for k in 1..7
        sum = sum + (2**(8-k)) * s[k,1].to_i
      end

    if sum == 0
       return false
    end

    check = sum.modulo(11)

    if check == s[s.length-1,1].to_i
       return true
    elsif
       (check == 10) and (s[s.length-1,1].to_i) == 0
       return true
    else
       return false
    end
     # algorithm ends here

  end

  # Validates whether the specified value is a valid greek vat number.  Returns nil if the value is valid, otherwise returns an array
  # containing one or more validation error messages.
  #
  # Configuration options:
  # * <tt>message</tt> - A custom error message (default is: "does not appear to be a valid vat number")
  # * <tt>with</tt> The regular expression to use for validating the numericality of the number </tt>
  # http://www.railsforum.com/viewtopic.php?id=19081, :regular expression for checking for digits only
  def self.validate_greek_vat_number_format(number, options={} )
      default_options = { :message => I18n.t(:invalid_greek_vat_number, :scope => [:activerecord, :errors, :messages], :default => 'does not appear to be a valid vat number'),
                          :with => /\A[+-]?\d+?(\.\d+)?\Z/ }

      options.merge!(default_options) {|key, old, new| old}  # merge the default options into the specified options, retaining all specified options

      # first check if the string passed consists only of numbers, other characters are not allowed
      unless number.to_s =~ options[:with]
		return  [ options[:message] ]
      end

      if ValidatesGreekVatNumberFormatOf::validate_greek_vat_number(number)
		 return nil
      else
		 return [ options[:message] ]
	  end

      return nil    # represents no validation errors

  end

end

module ActiveRecord
  module Validations
    module ClassMethods
      # Validates whether the value of the specified attribute is a valid greek vat number
      #
      #   class User < ActiveRecord::Base
      #     validates_greek_vat_number_format_of :vatnumber, :on => :create
      #   end
      #
      # Configuration options:
      # * <tt>message</tt> - A custom error message (default is: "does not appear to be a valid greek vat number")
      # * <tt>on</tt> - Specifies when this validation is active (default is :save, other options :create, :update)
      # * <tt>allow_nil</tt> - Allow nil values (default is false)
      # * <tt>allow_blank</tt> - Allow blank values (default is false)
      # * <tt>if</tt> - Specifies a method, proc or string to call to determine if the validation should
      #   occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }).  The
      #   method, proc or string should return or evaluate to a true or false value.
      # * <tt>unless</tt> - See <tt>:if</tt>
      def validates_greek_vat_number_format_of(*attr_names)
        options = { :on => :save,
                    :allow_nil => false,
                    :allow_blank => false }
        options.update(attr_names.pop) if attr_names.last.is_a?(Hash)

        validates_each(attr_names, options) do |record, attr_name, value|
          v = value.to_s
          errors = ValidatesGreekVatNumberFormatOf::validate_greek_vat_number_format(v, options)
          errors.each do |error|
            record.errors.add(attr_name, error)
          end unless errors.nil?
        end
      end
    end
  end
end


text:
title: Wrap Content in the article Element
localeTitle: التفاف المحتوى في المادة عنصر
---
## التفاف المحتوى في المادة عنصر

هذا هو كعب. [ساعد مجتمعنا على توسيعه](https://github.com/freecodecamp/guides/tree/master/src/pages/certifications/responsive-web-design/applied-accessibility/wrap-content-in-the-article-element/index.md) .

[سيساعدك دليل النمط السريع هذا على ضمان قبول طلب السحب](https://github.com/freecodecamp/guides/blob/master/README.md) .


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
Kalmia 12:17. 1982

#### Original name
Acer lobelii Ten.

### Remarks
null


text:
package eml.studio.client.event;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;

/**
 * The event that will be triggered when navigating to register page
 *
 */
public class ToRegisterEvent extends GwtEvent<ToRegisterEvent.ToRegisterEventHandler> {
	public final static Type<ToRegisterEventHandler> TYPE = new Type<ToRegisterEventHandler>();

	private String message;

	public ToRegisterEvent(String msg) {
		message = msg;
	}

	public interface ToRegisterEventHandler extends EventHandler {
		void onToRegisterEvent(ToRegisterEvent event);
	}

	@Override
	public Type<ToRegisterEventHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(ToRegisterEventHandler handler) {
		handler.onToRegisterEvent(this);
	}

	public String getMessage() {
		return message;
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>

<com.google.android.material.chip.Chip xmlns:android="http://schemas.android.com/apk/res/android"
	xmlns:tools="http://schemas.android.com/tools"
	android:layout_width="wrap_content"
	android:layout_height="wrap_content"
	android:checked="true"
	tools:showIn="@layout/mediathek_filter_content"
	tools:text="ARD" />


text:
using System;
using System.Net;
using System.Windows.Controls;

namespace ESRI.ArcLogistics.Services
{
    /// <summary>
    /// The default implementation of the <see cref="IHostNameValidator"/> interface.
    /// </summary>
    internal sealed class HostNameValidator : IHostNameValidator
    {
        /// <summary>
        /// Validates the specified host name and returns appropriate validation result object.
        /// </summary>
        /// <param name="hostname">The host name to be validated.</param>
        /// <returns>A <see cref="ValidationResult"/> object describing the outcome of
        /// validation.</returns>
        public ValidationResult Validate(string hostname)
        {
            if (string.IsNullOrEmpty(hostname))
            {
                return new ValidationResult(false, Properties.Messages.Error_HostNameIsEmpty);
            }

            try
            {
                new WebProxy(hostname);
            }
            catch (UriFormatException e)
            {
                return new ValidationResult(false, e.Message);
            }

            return ValidationResult.ValidResult;
        }
    }
}


text:
import { Command, Option } from '../models/command';
export default class VersionCommand extends Command {
    readonly name: string;
    readonly description: string;
    static aliases: string[];
    readonly arguments: string[];
    readonly options: Option[];
    run(_options: any): void;
    private getVersion(moduleName, projectNodeModules, cliNodeModules);
}


text:
package org.diirt.datasource;

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

/**
 * Aggregates the data out of a Collector into a new data type.
 * <p>
 * The {@link Aggregator} uses {@link #calculate(java.util.List) } to aggregate
 * the values of the current time slice. If no values were collected in the
 * current time slice, the last value (and only the last value, is passed
 * so that the output remains consistent with what would be currently
 * posted. Non calculation is done if no values were collected in the current
 * and in the previous time slice.
 *
 * @param <R> result type of aggregation
 * @param <A> argument type being aggregated
 * @author carcassi
 */
public abstract class Aggregator<R, A> implements ReadFunction<R> {

    private final ReadFunction<List<A>> collector;
    private R lastCalculatedValue;
    private A lastValue;

    /**
     * Creates a new aggregator. The given collector will be the source
     * of data for the new aggregator.
     *
     * @param collector a suitable collector
     */
    protected Aggregator(ReadFunction<List<A>> collector) {
        this.collector = collector;
    }

    @Override
    public final R readValue() {
        List<A> data = collector.readValue();
        if (data.size() > 0) {
            lastCalculatedValue = calculate(data);
            lastValue = data.get(data.size() - 1);
        } else if (lastValue != null) {
            lastCalculatedValue = calculate(Collections.singletonList(lastValue));
            lastValue = null;
        }
        return lastCalculatedValue;
    }

    /**
     * Calculates the new value from a set of collected value. This function
     * will never be called with an empty list
     *
     * @param data the new data to aggregate
     * @return the aggregated value
     */
    protected abstract R calculate(List<A> data);
}


text:
package io.github.hapjava.services.impl;

import io.github.hapjava.accessories.AirQualityAccessory;
import io.github.hapjava.accessories.optionalcharacteristic.AccessoryWithName;
import io.github.hapjava.accessories.optionalcharacteristic.AccessoryWithNitrogenDioxideDensity;
import io.github.hapjava.accessories.optionalcharacteristic.AccessoryWithOzoneDensity;
import io.github.hapjava.accessories.optionalcharacteristic.AccessoryWithPM10Density;
import io.github.hapjava.accessories.optionalcharacteristic.AccessoryWithPM25Density;
import io.github.hapjava.accessories.optionalcharacteristic.AccessoryWithStatusActive;
import io.github.hapjava.accessories.optionalcharacteristic.AccessoryWithStatusFault;
import io.github.hapjava.accessories.optionalcharacteristic.AccessoryWithStatusLowBattery;
import io.github.hapjava.accessories.optionalcharacteristic.AccessoryWithStatusTampered;
import io.github.hapjava.accessories.optionalcharacteristic.AccessoryWithSulphurDioxideDensity;
import io.github.hapjava.accessories.optionalcharacteristic.AccessoryWithVOCDensity;
import io.github.hapjava.characteristics.impl.airquality.AirQualityCharacteristic;
import io.github.hapjava.characteristics.impl.airquality.NitrogenDioxideDensityCharacteristic;
import io.github.hapjava.characteristics.impl.airquality.OzoneDensityCharacteristic;
import io.github.hapjava.characteristics.impl.airquality.PM10DensityCharacteristic;
import io.github.hapjava.characteristics.impl.airquality.PM25DensityCharacteristic;
import io.github.hapjava.characteristics.impl.airquality.SulphurDioxideDensityCharacteristic;
import io.github.hapjava.characteristics.impl.airquality.VOCDensityCharacteristic;
import io.github.hapjava.characteristics.impl.battery.StatusLowBatteryCharacteristic;
import io.github.hapjava.characteristics.impl.common.NameCharacteristic;
import io.github.hapjava.characteristics.impl.common.StatusActiveCharacteristic;
import io.github.hapjava.characteristics.impl.common.StatusFaultCharacteristic;
import io.github.hapjava.characteristics.impl.common.StatusTamperedCharacteristic;

/** This service describes air quality sensor. */
public class AirQualityService extends AbstractServiceImpl {

  public AirQualityService(AirQualityCharacteristic airQuality) {
    super("0000008D-0000-1000-8000-0026BB765291");
    addCharacteristic(airQuality);
  }

  public AirQualityService(AirQualityAccessory accessory) {
    this(
        new AirQualityCharacteristic(
            accessory::getAirQuality,
            accessory::subscribeAirQuality,
            accessory::unsubscribeAirQuality));
    if (accessory instanceof AccessoryWithName) {
      addOptionalCharacteristic(new NameCharacteristic(((AccessoryWithName) accessory)::getName));
    }

    if (accessory instanceof AccessoryWithOzoneDensity) {
      addOptionalCharacteristic(
          new OzoneDensityCharacteristic(
              ((AccessoryWithOzoneDensity) accessory)::getOzoneDensity,
              ((AccessoryWithOzoneDensity) accessory)::subscribeOzoneDensity,
              ((AccessoryWithOzoneDensity) accessory)::unsubscribeOzoneDensity));
    }
    if (accessory instanceof AccessoryWithNitrogenDioxideDensity) {
      addOptionalCharacteristic(
          new NitrogenDioxideDensityCharacteristic(
              ((AccessoryWithNitrogenDioxideDensity) accessory).getMinNitrogenDioxideDensity(),
              ((AccessoryWithNitrogenDioxideDensity) accessory).getMaxNitrogenDioxideDensity(),
              ((AccessoryWithNitrogenDioxideDensity) accessory).getMinStepNitrogenDioxideDensity(),
              ((AccessoryWithNitrogenDioxideDensity) accessory)::getNitrogenDioxideDensity,
              ((AccessoryWithNitrogenDioxideDensity) accessory)::subscribeNitrogenDioxideDensity,
              ((AccessoryWithNitrogenDioxideDensity) accessory)
                  ::unsubscribeNitrogenDioxideDensity));
    }

    if (accessory instanceof AccessoryWithSulphurDioxideDensity) {
      addOptionalCharacteristic(
          new SulphurDioxideDensityCharacteristic(
              ((AccessoryWithSulphurDioxideDensity) accessory).getMinSulphurDioxideDensity(),
              ((AccessoryWithSulphurDioxideDensity) accessory).getMaxSulphurDioxideDensity(),
              ((AccessoryWithSulphurDioxideDensity) accessory).getMinStepSulphurDioxideDensity(),
              ((AccessoryWithSulphurDioxideDensity) accessory)::getSulphurDioxideDensity,
              ((AccessoryWithSulphurDioxideDensity) accessory)::subscribeSulphurDioxideDensity,
              ((AccessoryWithSulphurDioxideDensity) accessory)::unsubscribeSulphurDioxideDensity));
    }
    if (accessory instanceof AccessoryWithPM25Density) {
      addOptionalCharacteristic(
          new PM25DensityCharacteristic(
              ((AccessoryWithPM25Density) accessory).getMinPM25Density(),
              ((AccessoryWithPM25Density) accessory).getMaxPM25Density(),
              ((AccessoryWithPM25Density) accessory).getMinStepPM25Density(),
              ((AccessoryWithPM25Density) accessory)::getPM25Density,
              ((AccessoryWithPM25Density) accessory)::subscribePM25Density,
              ((AccessoryWithPM25Density) accessory)::unsubscribePM25Density));
    }
    if (accessory instanceof AccessoryWithPM10Density) {
      addOptionalCharacteristic(
          new PM10DensityCharacteristic(
              ((AccessoryWithPM10Density) accessory).getMinPM10Density(),
              ((AccessoryWithPM10Density) accessory).getMaxPM10Density(),
              ((AccessoryWithPM10Density) accessory).getMinStepPM10Density(),
              ((AccessoryWithPM10Density) accessory)::getPM10Density,
              ((AccessoryWithPM10Density) accessory)::subscribePM10Density,
              ((AccessoryWithPM10Density) accessory)::unsubscribePM10Density));
    }
    if (accessory instanceof AccessoryWithVOCDensity) {
      addOptionalCharacteristic(
          new VOCDensityCharacteristic(
              ((AccessoryWithVOCDensity) accessory).getMinVOCDensity(),
              ((AccessoryWithVOCDensity) accessory).getMaxVOCDensity(),
              ((AccessoryWithVOCDensity) accessory).getMinStepVOCDensity(),
              ((AccessoryWithVOCDensity) accessory)::getVOCDensity,
              ((AccessoryWithVOCDensity) accessory)::subscribeVOCDensity,
              ((AccessoryWithVOCDensity) accessory)::unsubscribeVOCDensity));
    }
    if (accessory instanceof AccessoryWithStatusActive) {
      addOptionalCharacteristic(
          new StatusActiveCharacteristic(
              ((AccessoryWithStatusActive) accessory)::getStatusActive,
              ((AccessoryWithStatusActive) accessory)::subscribeStatusActive,
              ((AccessoryWithStatusActive) accessory)::unsubscribeStatusActive));
    }
    if (accessory instanceof AccessoryWithStatusFault) {
      addOptionalCharacteristic(
          new StatusFaultCharacteristic(
              ((AccessoryWithStatusFault) accessory)::getStatusFault,
              ((AccessoryWithStatusFault) accessory)::subscribeStatusFault,
              ((AccessoryWithStatusFault) accessory)::unsubscribeStatusFault));
    }
    if (accessory instanceof AccessoryWithStatusTampered) {
      addOptionalCharacteristic(
          new StatusTamperedCharacteristic(
              ((AccessoryWithStatusTampered) accessory)::getStatusTampered,
              ((AccessoryWithStatusTampered) accessory)::subscribeStatusTampered,
              ((AccessoryWithStatusTampered) accessory)::unsubscribeStatusTampered));
    }
    if (accessory instanceof AccessoryWithStatusLowBattery) {
      addOptionalCharacteristic(
          new StatusLowBatteryCharacteristic(
              ((AccessoryWithStatusLowBattery) accessory)::getStatusLowBattery,
              ((AccessoryWithStatusLowBattery) accessory)::subscribeStatusLowBattery,
              ((AccessoryWithStatusLowBattery) accessory)::unsubscribeStatusLowBattery));
    }
  }

  public void addOptionalCharacteristic(NameCharacteristic name) {
    addCharacteristic(name);
  }

  public void addOptionalCharacteristic(OzoneDensityCharacteristic ozoneDensity) {
    addCharacteristic(ozoneDensity);
  }

  public void addOptionalCharacteristic(NitrogenDioxideDensityCharacteristic nitrogenDensity) {
    addCharacteristic(nitrogenDensity);
  }

  public void addOptionalCharacteristic(SulphurDioxideDensityCharacteristic sulphuhrDensity) {
    addCharacteristic(sulphuhrDensity);
  }

  public void addOptionalCharacteristic(PM25DensityCharacteristic pm25Density) {
    addCharacteristic(pm25Density);
  }

  public void addOptionalCharacteristic(PM10DensityCharacteristic pm10Density) {
    addCharacteristic(pm10Density);
  }

  public void addOptionalCharacteristic(VOCDensityCharacteristic vocDensity) {
    addCharacteristic(vocDensity);
  }

  public void addOptionalCharacteristic(StatusActiveCharacteristic statusActive) {
    addCharacteristic(statusActive);
  }

  public void addOptionalCharacteristic(StatusFaultCharacteristic statusFault) {
    addCharacteristic(statusFault);
  }

  public void addOptionalCharacteristic(StatusTamperedCharacteristic statusTampered) {
    addCharacteristic(statusTampered);
  }

  public void addOptionalCharacteristic(StatusLowBatteryCharacteristic statusLowBattery) {
    addCharacteristic(statusLowBattery);
  }
}


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Tagger
{
    public partial class ExtractorManagerDialog : Form
    {
        List<Extractor> extractors;
        public ExtractorManagerDialog(List<Extractor> extractors)
        {
            this.extractors = extractors;
            InitializeComponent();
            readData();
        }

        private void dOk_Click(object sender, EventArgs e)
        {
            apply();
            Close();
            DialogResult = DialogResult.OK;
        }

        private void dCancel_Click(object sender, EventArgs e)
        {
            Close();
            DialogResult = DialogResult.Cancel;
        }

        private void dApply_Click(object sender, EventArgs e)
        {
            apply();
        }

        private void addToolStripMenuItem_Click(object sender, EventArgs e)
        {
            addNewObject();
        }

        private void removeSelectedToolStripMenuItem_Click(object sender, EventArgs e)
        {
            removeSelected();
        }
        private void applyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            apply();
        }

        private void dExtractors_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Delete) removeSelected();
        }

        private void revertToolStripMenuItem_Click(object sender, EventArgs e)
        {
            readData();
        }

        private bool Dirty
        {
            set
            {
                dApply.Enabled = value;
                applyToolStripMenuItem.Enabled = value;
            }
        }

        // -----------

        private void removeSelected()
        {
            Dirty = true;
            dExtractors.RemoveObjects(dExtractors.SelectedObjects);
        }

        private void addNewObject()
        {
            dExtractors.AddObject(new Extractor { Pattern = "%artist%-%title%" });
            Dirty = true;
        }

        private void readData()
        {
            Dirty = false;
            List<Extractor> temp = new List<Extractor>();
            foreach (var e in extractors)
            {
                temp.Add(e.deepClone());
            }
            dExtractors.SetObjects(temp);
        }

        private void apply()
        {
            extractors.Clear();
            foreach (Extractor e in dExtractors.Objects)
            {
                extractors.Add(e);
            }
        }
    }
}


text:
<?xml version="1.0" ?>
<INPUT>

	<MEDALS>
		<MEDAL Id="1" MEDAL_THRESHOLD="52000" TYPE="Gold"/>
		<MEDAL Id="2" MEDAL_THRESHOLD="79000" TYPE="Silver"/>
		<MEDAL Id="3" MEDAL_THRESHOLD="102000" TYPE="Bronze"/>

	</MEDALS>

	<SpeedSettings Default="18" Max="150" Min="0"/>

	<PenaltySettings SpeedLost="0.1" TimeLost="15"/>

	<PROBLEM_SET>
		<PROBLEM_SUBSET>
			<TARGET TYPE="String">
				<ContentSettings string="0.666"/>
			</TARGET>
			<QUESTION INDEX="1">
				<Content TYPE="Fraction">
					<ContentSettings denominator="3" numerator="0"/>
				</Content>
				<Content TYPE="Fraction">
					<ContentSettings denominator="5" numerator="1"/>
				</Content>
				<Answer VALUE="2"/>
			</QUESTION>
			<QUESTION INDEX="2">
				<Content TYPE="Fraction">
					<ContentSettings denominator="10" numerator="0"/>
				</Content>
				<Content TYPE="Fraction">
					<ContentSettings denominator="12" numerator="1"/>
				</Content>
				<Answer VALUE="2"/>
			</QUESTION>
			<QUESTION INDEX="3">
				<Content TYPE="Fraction">
					<ContentSettings denominator="12" numerator="1"/>
				</Content>
				<Content TYPE="Fraction">
					<ContentSettings denominator="4" numerator="3"/>
				</Content>
				<Answer VALUE="1"/>
			</QUESTION>
		</PROBLEM_SUBSET>
		<PROBLEM_SUBSET>
			<TARGET TYPE="String">
				<ContentSettings string="0.4"/>
			</TARGET>
			<QUESTION INDEX="4">
				<Content TYPE="Fraction">
					<ContentSettings denominator="2" numerator="0"/>
				</Content>
				<Content TYPE="Fraction">
					<ContentSettings denominator="1000" numerator="590"/>
				</Content>
				<Answer VALUE="1"/>
			</QUESTION>
			<QUESTION INDEX="5">
				<Content TYPE="Fraction">
					<ContentSettings denominator="2" numerator="0"/>
				</Content>
				<Content TYPE="Fraction">
					<ContentSettings denominator="5" numerator="1"/>
				</Content>
				<Answer VALUE="2"/>
			</QUESTION>
			<QUESTION INDEX="6">
				<Content TYPE="Fraction">
					<ContentSettings denominator="12" numerator="0"/>
				</Content>
				<Content TYPE="Fraction">
					<ContentSettings denominator="100" numerator="14"/>
				</Content>
				<Answer VALUE="2"/>
			</QUESTION>
		</PROBLEM_SUBSET>
		<PROBLEM_SUBSET>
			<TARGET TYPE="String">
				<ContentSettings string="0.246"/>
			</TARGET>
			<QUESTION INDEX="7">
				<Content TYPE="Fraction">
					<ContentSettings denominator="10" numerator="1"/>
				</Content>
				<Content TYPE="Fraction">
					<ContentSettings denominator="8" numerator="1"/>
				</Content>
				<Answer VALUE="2"/>
			</QUESTION>
			<QUESTION INDEX="8">
				<Content TYPE="Fraction">
					<ContentSettings denominator="10" numerator="5"/>
				</Content>
				<Content TYPE="Fraction">
					<ContentSettings denominator="10" numerator="7"/>
				</Content>
				<Answer VALUE="0"/>
			</QUESTION>
			<QUESTION INDEX="9">
				<Content TYPE="Fraction">
					<ContentSettings denominator="8" numerator="0"/>
				</Content>
				<Content TYPE="Fraction">
					<ContentSettings denominator="2" numerator="1"/>
				</Content>
				<Answer VALUE="1"/>
			</QUESTION>
		</PROBLEM_SUBSET>
		<PROBLEM_SUBSET>
			<TARGET TYPE="String">
				<ContentSettings string="0.625"/>
			</TARGET>
			<QUESTION INDEX="10">
				<Content TYPE="Fraction">
					<ContentSettings denominator="2" numerator="0"/>
				</Content>
				<Content TYPE="Fraction">
					<ContentSettings denominator="1000" numerator="139"/>
				</Content>
				<Answer VALUE="2"/>
			</QUESTION>
			<QUESTION INDEX="11">
				<Content TYPE="Fraction">
					<ContentSettings denominator="2" numerator="0"/>
				</Content>
				<Content TYPE="Fraction">
					<ContentSettings denominator="100" numerator="16"/>
				</Content>
				<Answer VALUE="2"/>
			</QUESTION>
			<QUESTION INDEX="12">
				<Content TYPE="Fraction">
					<ContentSettings denominator="4" numerator="0"/>
				</Content>
				<Content TYPE="Fraction">
					<ContentSettings denominator="4" numerator="3"/>
				</Content>
				<Answer VALUE="1"/>
			</QUESTION>
		</PROBLEM_SUBSET>
		<PROBLEM_SUBSET>
			<TARGET TYPE="String">
				<ContentSettings string="0.503"/>
			</TARGET>
			<QUESTION INDEX="13">
				<Content TYPE="Fraction">
					<ContentSettings denominator="2" numerator="0"/>
				</Content>
				<Content TYPE="Fraction">
					<ContentSettings denominator="5" numerator="3"/>
				</Content>
				<Answer VALUE="1"/>
			</QUESTION>
			<QUESTION INDEX="14">
				<Content TYPE="Fraction">
					<ContentSettings denominator="4" numerator="1"/>
				</Content>
				<Content TYPE="Fraction">
					<ContentSettings denominator="5" numerator="2"/>
				</Content>
				<Answer VALUE="2"/>
			</QUESTION>
			<QUESTION INDEX="15">
				<Content TYPE="Fraction">
					<ContentSettings denominator="4" numerator="3"/>
				</Content>
				<Content TYPE="Fraction">
					<ContentSettings denominator="10" numerator="9"/>
				</Content>
				<Answer VALUE="0"/>
			</QUESTION>
		</PROBLEM_SUBSET>
		<PROBLEM_SUBSET>
			<TARGET TYPE="String">
				<ContentSettings string="0.16"/>
			</TARGET>
			<QUESTION INDEX="16">
				<Content TYPE="Fraction">
					<ContentSettings denominator="3" numerator="1"/>
				</Content>
				<Content TYPE="Fraction">
					<ContentSettings denominator="4" numerator="2"/>
				</Content>
				<Answer VALUE="0"/>
			</QUESTION>
			<QUESTION INDEX="17">
				<Content TYPE="Fraction">
					<ContentSettings denominator="12" numerator="0"/>
				</Content>
				<Content TYPE="Fraction">
					<ContentSettings denominator="100" numerator="59"/>
				</Content>
				<Answer VALUE="1"/>
			</QUESTION>
			<QUESTION INDEX="18">
				<Content TYPE="Fraction">
					<ContentSettings denominator="1000" numerator="94"/>
				</Content>
				<Content TYPE="Fraction">
					<ContentSettings denominator="1000" numerator="479"/>
				</Content>
				<Answer VALUE="1"/>
			</QUESTION>
		</PROBLEM_SUBSET>

	</PROBLEM_SET>

</INPUT>